Creating huge images

Posted by David Rutten on Stack Overflow See other posts from Stack Overflow or by David Rutten
Published on 2010-04-24T10:56:44Z Indexed on 2010/04/24 11:03 UTC
Read the original article Hit count: 214

My program has the feature to export a hi-res image of the working canvas to the disk. Users will frequently try to export images of about 20,000 x 10,000 pixels @ 32bpp which equals about 800MB. Add that to the serious memory consumption already going on in your average 3D CAD program and you'll pretty much guarantee an out-of-memory crash on 32-bit platforms.

So now I'm exporting tiles of 1000x1000 pixels which the user has to stitch together afterwards in a pixel editor. Is there a way I can solve this problem without the user doing any work?

I figured I could probably write a small exe that gets command-lined into the process and performs the stitching automatically. It would be a separate process and it would thus have 2GB of ram all to itself. Or is there a better way still? I'd like to support jpg, png and bmp so writing the image as a bytestream to the disk is not really possible.

© Stack Overflow or respective owner

Related posts about images

Related posts about memory-allocation