[Image-SIG] Where to implement other resizing methods...

Fredrik Lundh fredrik@pythonware.com
Mon, 15 Feb 1999 08:36:20 +0100


>I wish to add an interpolation algorythm to the resizing method
>of PIL... I'm just wondering where the current nearest-neighbour
>and antialias methods are implemented so that I can add INTER-
>POLATE to them.

the current resampling machinery is quite convoluted, so
if you cannot even find it on your own, you should probably
not try to modify it ;-)

here's how I would do it:

1. implement your interpolation method in a separate module,
operating on Imaging structure.

2. add a unique resampling filter code to Image.py

3. patch the resize/rotate/transform dispatchers in _imaging.c
so they call your version when that filter is used.

>Any hints/suggestions, or anyone currently have a working inter-
>polation resizing method?

how do you define "interpolation", btw?

Cheers /F
http://www.pythonware.com/people/fredrik