jony
jony

Reputation: 944

how to convert jpeg to tiff file in python

Is there any way to convert .jpeg to .tiff file?

If yes, then how to do that?

There are many library in Python that can convert file from one format to another.

But, I have not found anything for this problem.

Thanks in advance!

Upvotes: 5

Views: 9425

Answers (3)

Daweo
Daweo

Reputation: 36828

According to OpenCV docs for functions used for image and video reading and writing imread does support JPEG files and imwrite can save TIFF files, though with some limitations:

Only 8-bit (or 16-bit unsigned (CV_16U) in case of PNG, JPEG 2000, and TIFF) single-channel or 3-channel (with ‘BGR’ channel order) images can be saved using this function.

Upvotes: 1

qBen_Plays
qBen_Plays

Reputation: 258

You can use PIL (Python Imaging Library) for this:

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

Also, this was the first result for your problem on Google, make sure you google extensively first.

Upvotes: 0

Coder
Coder

Reputation: 1121

see this

from PIL import Image
im = Image.open('yourImg.jpg')
im.save("pathToSave/hello.tiff", 'TIFF')

Upvotes: 9

Related Questions