[Image-SIG] New Image Library Wrapper - Leptonica

Joao S. O. Bueno gwidion at mpc.com.br
Wed Dec 29 07:18:01 CET 2010

Hi --

I just pushed my ctypes weekend exercise a bit hard, and got something
that might be usefull (I hope)-

I just uploaded to the Pypi a thin ctypes wrapper for the Leptnica Library
(http://www.leptonica.com) --
It parses the C source and generate Python wrappers for the library functions --
These can be  much improved in the future, as currently one has to create the
needed parameters by hand (C arrays, pointers, etc...)

Nonetheless it seems to be working fine, and this library has a lot of
functionality not
present in PIL (I also wrote two utility functions to convert from and
for Leptonoca images).

Leptonica features extensive inline documentation of its functions in
its source files, and
this project transposes most of it to Python doc strings :-)

The project is hosted at

And it can be installed with:

easy_install pyleptonica

(Of course, one also has to install the binary leptonica library )

(I have not tested it in other OSes than Linux -- it is likely ctypes
library laoding will need some tweaking)

License is LGPL v3



More information about the Image-SIG mailing list