【发布时间】:2011-04-18 19:56:28
【问题描述】:
如何在 Java 中编辑图像的像素值。有什么方法可以改变像素值吗?
【问题讨论】:
如何在 Java 中编辑图像的像素值。有什么方法可以改变像素值吗?
【问题讨论】:
例如:
BufferedImage image = ...
image.setRGB(x, y, 0);
void setRGB(int x, int y, int rgb)
//Sets a pixel in this BufferedImage to the specified RGB value.
【讨论】:
在BufferedImage: public void setRGB(int x,
整数,
int rgb)
将此 BufferedImage 中的一个像素设置为 指定的 RGB 值。像素是 假定为默认 RGB 颜色 模型、TYPE_INT_ARGB 和默认 sRGB 色彩空间。对于带有 IndexColorModel,索引与 选择最接近的颜色。
http://download.oracle.com/javase/6/docs/api/java/awt/image/BufferedImage.html
【讨论】: