See BufferedImage (Java Platform SE 7 ) and Lesson: Working with Images (The Java™ Tutorials > 2D Graphics) , idea would be to create a BufferedImage object, draw to it with your pixels, then save...