I am using the python Pillow library to do a simple image format conversion.
Here is some simple code demonstrating what I'm doing
im = Image.open("images/filename.tiff", mode="r")
im.save("images/filename.png", optimize=True)
This results in on average, a size increase of 98%. Here is the data on the input tiffs I'm trying to create:
<image mode=1 size=2544x2230>
When I explicitly convert it (by calling .convert(), the size only increases on average by 87%, but still terrible. Why is the size ballooning so much?
Here is what I have tried?
- using the "quality" parameter on .save() seems to have little effect
- explicitly passing the "mode" parameter to the save command has little effect
- using the .convert("L") has little effect on overall size after conversion
EDIT
Here is a sample image that ran through what I described above and resulted in an 87% bigger png file, 907% bigger jpeg, and 907% bigger jpg.
https://share.getcloudapp.com/YEuR9LqP
Version of Pillow is latest: 8.2
Python version: 3.8
Running on MacOS: 10.15.7
Am I missing something obvious or this just my lack of knowledge of how the Image library works?