我的github

一. 为什么要将BufferedImage转为byte数组?

在传输中,图片是不能直接传的,因此需要把图片变为字节数组,然后传输比较方便。

而字节数组变成BufferedImage能够还原图像。

参考1:https://blog.csdn.net/weixin_39958559/article/details/114788932

参考2:https://blog.csdn.net/itigoitie/article/details/125301480

参考3:http://www.360doc.com/content/20/0522/17/1314937_913926645.shtml

怎么转成byte[][]二维数组?

>>分离rgb通道?BufferedImage.getRGB()

https://blog.csdn.net/missieo/article/details/123635801 https://zhuanlan.zhihu.com/p/463140610

Java的int是32位,ARGB包含Alpha、R、G、B四个通道,每个通道占8位。下面就是要从32位的像素值中分离出R、G、B三个通道了。

存到三个int[width][height]数组里?或者是一个int[3][width][height]三维数组里?还有一个Alpha值呢?

>>反过来:如何把一个三维数组转成rgb图像存到文件里呢?

参考:https://blog.csdn.net/liu911025/article/details/98479876

参考2:https://blog.csdn.net/weixin_39774445/article/details/114451807

posted on 2023-07-07 09:25  XiaoNiuFeiTian  阅读(401)  评论(0编辑  收藏  举报