format conversion of an image in python

前端 未结 3 776
傲寒
傲寒 2021-02-07 11:40

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?

3条回答
  •  天命终不由人
    2021-02-07 12:14

    Use the Python Imaging Library (PIL).

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

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

提交回复
热议问题