format conversion of an image in python
Question: I have to write an application for image processing in python. does anyone
know how to convert the file type of an image from JPEG to TIFF?


Answer: Check out the [Python Image Library
(PIL)](http://www.pythonware.com/products/pil/). See this
[tutorial](http://effbot.org/imagingbook/introduction.htm), the PIL is quite
easy to use.

[Supported image
formats](http://infohost.nmt.edu/tcc/help/pubs/pil/formats.html).

To do the conversion you open the image and then save it with the new
extension (which PIL uses to determine what format to use for saving).

    
    
    import Image
    im = Image.open('test.jpg')
    im.save('test.tiff')  # or 'test.tif'
    

Note that the official distribution does not support Python 3.x (yet?),
however, at least under Windows there's an [unofficial
version](http://www.lfd.uci.edu/~gohlke/pythonlibs/) available that works with
v 3.x.

