lossless transformation of jpeg images

D

Daniel Nogradi

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' )
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top