Re: What is the best way to anti-alias a very large resolution image in PIL

"Charlie Clark" <[email protected]> Tue, 13 Sep 2011 17:58:00 +0200
Newsgroups gmane.comp.python.image
Organization Clark Consulting & Research
Message-ID <[email protected]>
Hi Craig,

Am 08.09.2011, 13:07 Uhr, schrieb Craig Coleman (C)  
<[email protected]>:

> Hi,
> I have a really thorny problem.
> I need to downsample a raster map that is 23622x23622 pixels to
> 7874x7874 pixels using the ANTIALIAS filter.
> I have the following Python code:
>
>>>> import Image
>>>> img = Image.open(r"C:\temp\24bit_nd.tif")
>>>> nimg = img.resize((7874,7874),Image.ANTIALIAS)
> As soon as the resize method is called, python crashes instantly.  I
> presume this is a memory allocation issue.

I think you may be right. Do you have the full traceback the error  
produces?

Is this using a 32-bit version of Python? Do you have access to a 64-bit  
system? For MS Windows there is a 64-bit PIL installer:

http://www.lfd.uci.edu/~gohlke/pythonlibs/#pil

> Is there another way of performing anti-aliasing on such a large image
> (its 2.7GB uncompressed although I'm using LZW for storage).

> I have tried converting the file to 8bit with a palette and this
> successfully downsamples but the ANTIALIAS is not performed.  What am I
> doing wrong?

Charlie
-- 
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-600-3657
Mobile: +49-178-782-6226
_______________________________________________
Image-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/image-sig