I have array of pixels(black and white) which represent an image and I would like to save this array or this image as PNG format file and store it in external folder.
Printable View
I have array of pixels(black and white) which represent an image and I would like to save this array or this image as PNG format file and store it in external folder.
Create a BufferedImage. Take a look at the setRGB method. The latest documentation is here: BufferedImage (Java Platform SE 6).
You can use the write method of the ImageIO class to save to a PNG file. There is an example here: Saving a Generated Graphic to a PNG or JPEG File (Java Developers Almanac Example).