How to save a large fractal image with the least p

2019-07-20 13:17发布

问题:

I'm currently working on fractals, and when it comes to fractals, detail is a must. However, since I am using Java, I run out of heap space once I get past about 2000x2000px. Yes, I could increase the heap space, but that's not a very elegant solution.

So my question is: Are there any image formats where I could write the pixel data as I calculate it? If there are multiple, which ones are the easiest to understand? (The Java libraries only support writing whole images at a time, from what I know).

Thanks!

回答1:

Well, there's always BMP. You can find multiple simple references to the BMP file format at wotsit.



回答2:

I think the best way to accomplish this is to break your image up into small square regions and render each individually. Then try to recombine the tiles into one large image as per the suggestions in this thread.. The answer involves using JAI to reassemble the tiles in a streaming fashion rather than loading everything in memory at once.