[Image-SIG] [ANN] FreeImagePy 1.0.0

Michele Petrazzo michele.petrazzo at unipex.it
Thu Sep 15 10:32:16 CEST 2005

SPE - Stani's Python Editor wrote:
> Great! Thank you for wrapping it.

I'm very happy to contribute. I had always use the work (the code) of
the other python developers, an now I want to contribute by myself to
the community.

> What are the advantages over PIL (speed, features, ...)?

FI -> FreeImage
FIPY -> FreeImagePy

Good question :)
I don't know very well PIL, but this is that I saw:

First is to work well with the TIFF g3/g4 without problem, that is the
first reason that push me to create the wrapper, because in my fax
client, I must use this compression (of course), and second (with the
same importance) is that, in the same program, I use the multipage
tiff+resize+set correct DPI function for create a "standard" fax page.

The image type and its depth supported by FI library, so by FIPY (I only
wrap the functions, not the code), is largest because it support (by FI
site) :
"Support for High Dynamic Range images. FI supports RGB float images as
well a 48-bit HDR images and provides tone mapping operators to convert
these images to 24-bit LDR images."

FI (FIPY) support Metadata information: "Comments, Exif (including GPS
and maker notes), IPTC, Adobe XMP and GeoTIFF metadata models."

With FI you don't need to worry to what type of image "modes" you are 
working on, example: PIL:
im = Image.open("test.tif")
im.save("out.png", "PNG")
---->IOError: cannot write mode CMYK as PNG

Ok, if a developer working on the image he has to know its type, but for 
people like me that not know what is a CMYK mode :), it's very difficult 
to find a immediate solution for resolve this problem. With FIPY this 
not happen, because the library make all the conversion for me!

But, in the other hand, PIL support types like pdf, font (ttf, ...) that
FI not support.
PIL is more "pythonic", so it not need methods like Initialize,
DeInitialize, Unload (image), when the developer have to do something on
a image, for example, resize the image, with PIL you can do
image.resize, with FIPY you must use the FIPY instance and do
FIPY.Resize(image, ...)
With PIL you don't need to work with pointers or other strange and
"magic" (for me :) ) C/C++ code, but in FIPY yes, like you can read on
the Palette and Invert functions.

The speed in my tries is the same (more or less), or better in same
tests with a big (16 MB) tiff image (without compression) 24 color,
where I load, rotate, rescale with highest quality, save all the image
to png format, seem that PIL time is lesser than FI dll + FIPY to about
0,05 0,1 seconds, so I think that is not a real difference.

I think that the documentation is better in FI. It has a simple pdf that
explain all the features with same examples. For me the PIL
documentation is not so simple that the other.

That's all, for me.
If you have other questions, I'm here.

> Stani


More information about the Image-SIG mailing list