lossless transformation of jpeg images

Daniel Nogradi nogradi at gmail.com
Sun Oct 29 21:17:05 CET 2006

> Hi all,
> Last time I checked PIL was not able to apply lossless transformations
> to jpeg images so I've created Python bindings (or is it a wrapper? I
> never knew the difference :)) for the jpegtran utility of the
> Independent Jpeg Group.
> The jpegtran utility is written in C and is very efficient, fast and
> robust. It can rotate, flip, transpose and transverse jpeg images in a
> lossless way, see www.ijg.org for more details.
> The bindings allow you to use all jpegtran features from Python.
> Downloads are here: http://ebiznisz.hu/python-jpegtran/
> Any feedback is very welcome, especially if you are able to compile it
> on non-standard platforms. It has been tested on Linux and Python 2.3.
> Usage example:
> import jpegtran
> transformer = jpegtran.transformer( )
> transformer.rotate( 90, 'pic.jpg', 'pic_rotated.jpg' )
> transformer.flip( 'horizontal', 'pic.jpg', 'pic_flipped.jpg' )
> transformer.transpose( 'pic.jpg', 'pic_transposed.jpg' )
> transformer.transverse( 'pic.jpg', 'pic_transversed.jpg' )
> transformer.gray( 'pic.jpg', 'pic_gray.jpg' )

Oh, I forgot to mention that this is a very preliminary release, there
is no support for distutils or any other intelligent packaging tool,
it uses 'make' so probably will only work on Unix flavours. Although
it should compile on Windows as well.

More information about the Python-list mailing list