Python image formatting

I need to write an image processing application in python. Does anyone know how to convert image file type from JPEG to TIFF?

+6
source share
3 answers

Check out the Python Image Library (PIL) . See this tutorial , PIL is pretty easy to use.

Supported image formats .

To perform the conversion, you open the image and then save it using the new extension (which uses PIL to determine which format should be used for saving).

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

Please note that the official distribution does not support Python 3.x (yet?), However, at least under Windows there is an unofficial version that works with v 3.x.

+18
source

Use the Python Image Library (PIL).

 from PIL import Image img = Image.open('image.jpeg') img.save('image.tiff') 

Link: http://effbot.org/imagingbook/image.htm

+6
source

Have you tried using PIL ? It can support many image file formats.

+2
source

Source: https://habr.com/ru/post/918651/


All Articles