[Image-SIG] Speeding up an image transformation in C

Fredrik Lundh fredrik at pythonware.com
Mon Nov 16 16:20:33 CET 2009


There's a brief note here:

    http://effbot.org/zone/pil-extending.htm

You can simplify the dependencies by simply copying the Imaging
definition to your own code -- the "im.id" attribute used in that
article is guaranteed to give you a pointer to that structure (that
is, if the structure ever changes, PIL will provide a different
mechanism to access the internal image descriptor).

Another approach is to use tostring/fromstring in a wrapper, and write
a C extension that works on a byte string or buffer object.

</F>

On Mon, Nov 9, 2009 at 5:24 PM, Grzegorz Adam Hankiewicz
<ghankiewicz at rastertech.es> wrote:
> Hello.
>
> I have a small python algorithm similar to a floodfill that works slow in
> python. Is there any documentation on how I could write a C extension to
> speed it up? Are there any dev headers I can compile against to handle an
> Image from C?
> _______________________________________________
> Image-SIG maillist  -  Image-SIG at python.org
> http://mail.python.org/mailman/listinfo/image-sig
>


More information about the Image-SIG mailing list