Skip to content
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

Resized Image resulted in increase in file size #181

Closed
omodia opened this issue Jan 26, 2023 · 2 comments
Closed

Resized Image resulted in increase in file size #181

omodia opened this issue Jan 26, 2023 · 2 comments
Assignees
Labels

Comments

@omodia
Copy link

omodia commented Jan 26, 2023

Describe the bug
Resizing of files resulted in an increase in the file size rather than decrease.

Software version
2.3.0

Operating System information

  • OS: Windows
  • Version 11

To Reproduce
Steps to reproduce the behavior:

  1. Open the attached webp file in zip below
  2. Check lossless option.
  3. Resize - Keep aspect ratio: 50% width and height.
  4. Output format : same as input or select webp
  5. Compress and see the result

Expected behavior
A decrease in the original file size as the image is also being decreased to 50% of its original width and height

Screenshots

1

@omodia omodia added the bug label Jan 26, 2023
@Lymphatus Lymphatus changed the title Resized Image resulted in increase in file saze Resized Image resulted in increase in file size Jan 26, 2023
@Lymphatus
Copy link
Owner

Unfortunately, this is somehow expected. Let me explain a little bit more.
Resizing an image is always* a lossy operation: you are reducing the pixels of the image, so you naturally lose something. If you check the "Lossless" option, Caesium will resize the image, encode it with the best quality possible and then applying a lossless optimization. This to minimize the loss of quality for the image.
If your image was well optimized before, resizing then encoding it at best quality can result in a bigger image, because the lossless optimization will not shred that much size.

So for example:

  • Initial image is 200 Kb and well optimized
  • Resize at 50%, encode it at 100 quality results in a 300Kb image
  • Optimize it for a 290Kb final image

A possible solution from your side is to uncheck the "lossless" option and save it at your desired quality, since you are losing quality anyway by resizing.
On the other hand, I'm thinking to disable to lossless option for resizing or providing a warning for this behaviour.


*This is not always true, but we are talking about very specific cases

@omodia
Copy link
Author

omodia commented Jan 26, 2023

Thanks for the explanation. I now have an idea of how it works.

@Lymphatus Lymphatus added question and removed bug labels Apr 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants