I need to read and write to images pixel by pixel (I was generating Fractals). As I experimented with Image sizes, I realized that writing to an Image using BufferedImage
when the image size is huge (say 24000x18000), led to an OutOfMemoryError
. To tackle that, I used -Xmx -Xms
to increase the heap size.
Is there a way to write to an image pixel wise without having to load the entire image in the memory? Same goes for reading (and modifying) large images.
EDIT
I'm doing it pixel by pixel, left-to-right, top-to-bottom.