Change pixel values

How to edit image pixel values ​​in Java. Is there a way to change pixel values?

+6
source share
2 answers

For instance:

BufferedImage image = ... image.setRGB(x, y, 0); 

From the documentation :

  void setRGB(int x, int y, int rgb) //Sets a pixel in this BufferedImage to the specified RGB value. 
+7
source

In BufferedImage : public void setRGB (int x, int y, int rgb)

Sets the pixel in this BufferedImage to the specified RGB value. Pixel assumes that the color RGB is the default model, TYPE_INT_ARGB and the default sRGB color space. For images with IndexColorModel, the index with the closest color selected.

http://download.oracle.com/javase/6/docs/api/java/awt/image/BufferedImage.html

+2
source

Source: https://habr.com/ru/post/886138/


All Articles