-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resize the width and height to 90% of original, but the image file size(bytes) become larger #6771
Comments
My bad, my previous test case, open a jpg file, and resize it then save as png(different image type). Which make it from 80KB to 700KB |
I also tried to open the jpg and save it as another jpg(same image type) with 90% width and height, and the file size changed from 80KB to 89KB. It's weird too. |
You may already know this, but regarding saving it as a PNG,
#617 is an open issue that mentions PNG file size. Regarding saving it as a JPG, |
@radarhere Thanks for the information about the I did the following test im.save(targetFilePath) #from 80KB to 89KB
im.save(targetFilePath,optimize=True) #from 80KB to 85KB
im.save(targetFilePath,quality=90,optimize=True) #from 80KB to 149KB
im.save(targetFilePath,quality=72,optimize=True) #from 80KB to 79KB By the way, how do you know that the quality should set to 72? |
I just manually decreased the quality value until I found one that gave a smaller file size. |
@radarhere Thanks very much, I appreciate your effort. |
What did you do?
resize the width and height of a image to 90%
What did you expect to happen?
I expect the file size(bytes) become smaller,
What actually happened?
The file size(bytes) become larger, the original file size is 80KB,
and the resized image file size become
700KB89KBWhat are your OS, Python and Pillow versions?
The text was updated successfully, but these errors were encountered: