How to convert PNG to TIFF in Python

You can convert a PNG image to TIFF in Python by following the given steps. If you want to learn Computer Vision then I will highly recommend you to read This book.

How to convert PNG to TIFF in Python
How to convert PNG to TIFF in Python

Step 1

Install the Pillow library.

pip install Pillow

Step 2

Now import the Image from PIL. PIL is used for the Pillow library as an alias.

from PIL import Image

Step 3

Now read the image from the location. In my case “C:\\AiHints” is the location and “cat.png” is the name of the image. Change it according to your image location and name.

image = Image.open("C:\\AiHints\\cat.png")

Step 4

This code will convert the above png image into a tiff and will save it at the location “C:\\AiHints”.

image.save("C:\\AiHints\\cat.tiff")

People are also reading:

Best Python Books

What is Computer Vision? Examples, Applications, Techniques

Top 10 Computer Vision Books

Books for Machine Learning (ML)

Free Learning Resources

Leave a Comment

Your email address will not be published.