[Image-SIG] Saving portions of an image....

Kevin Cazabon KCAZA@cymbolic.com
Mon, 03 Jan 2000 09:55:20 -0800

I've got an interesting problem trying to save part of an image without having to
'crop' it... here's the details:

-I'm using PIL to create HUGE image files for producing 3-Dimensional 'lenticular'
-In this process, I create a canvas that is larger than the final image (for
technical reasons...)
-When the image creation is finished, I need to 'trim' off part of the RIGHT side of
the image
-Because these image files can be over 1.4 GB (yes, GB, not MB), and because PIL uses
4bits per pixel, even for RGB, it's using about 2GB of memory... I don't want to use
im = im.crop(()).

-I need some way to save only part of the image, basically cropping while saving
without using extra memory.  im.save("filename", crop=(0,0,10000,10000)) would be
-I've tried changing the .tile attribute, but unless you're cropping from the top and
bottom of the image, it won't work (the lines get shifted if you try cropping from
the sides).  Obviously, I don't want to have to rotate the image either because of
memory requirements.

Any suggestions?  (Fred?)

If this is all successfull, I'll be producing a 4' x 8' 3-D image for display at
worldwide trade shows (including the largest Photographic trade show in North
America, PMA, in Februaray in Las Vegas, and possibly Photokina in Germany next
fall).  It would really show some of the capabilities of PIL... pushing it to the
extreme in file sizes and complexity anyways.

Kevin Cazabon.