[Image-SIG] Re: Speed of Image.crop

Kenji YOKOI k.yokoi at aist.go.jp
Fri Oct 22 08:41:21 CEST 2004


Fredrik Lundh wrote

>
> are we talking about color images?
>
> if so, you're actually hitting a limit in PIL: the internal storage 
> module
> switches allocation strategy for images that need more than 1 mega-
> byte of storage.  It's unlikely that the alternate storage strategy can
> explain a 7x performance drop, but one never knows...
>
> to see if this is the problem, you have to edit the 
> libImaging/Storage.c
> file.  change
>
> #define THRESHOLD 1048576L
>
> to, say,
>
> #define THRESHOLD 4*1048576L
>
>
> and rebuild.
>
> (I should probably increase the threshold in 1.1.5 final; PIL's almost
> 10 years old, so parameters like this could need some tuning...)
>

Thanks for your reply. I tried and tried to rebuild the library as 
suggested, but unfortunately I could not. It is hard, since I am 
unfamiliar with compiling C especially in Windows, and I do not have 
the MS Visual C compiler.

So could you anyone send me the customized version of PIL ?


Kenji Yokoi



More information about the Image-SIG mailing list