-
Notifications
You must be signed in to change notification settings - Fork 160
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
PNG quality loss no matter the config with more examples #180
Comments
I have noticed that the compression strategy is a bit aggressive, with which the output is 173KB while your config maxSizeMB is 400KB. In the next release, I will increase the initial color depth during compression. So your current config will result in a better larger output image(<400KB). However, PNG is lossless by design, so the approach in this library to compress PNG images is to reduce the color depth (number of different colors). |
@ysabri v2.0.1 has been released. You can have a try. |
@Donaldcwl Thank you for the quick turn around. I just tested the change and it seems to be working fine! Since I have you here, I wanted to ask about the maxIteration, I had set to 150 which made this change feel slow so I removed it and everything still seems to be working fine with the default 10. What should I worry about when it comes to the number? |
Sorry I'm opening #172 again, we've heard this complaint from multiple users.
I will give another example here where its more apparent.
The original image (1.74MB):
Compressed PNG (173KB):
Compressed as a JPEG with the same config (221KB):
Both these were with the same config I specified in #172 and is still the case with this image no matter what configs I try. There is always visible loss in quality.
I don't know what to do here, thanks for pointing out that we lose transparent backgrounds in the hack I used in #172, it is something we care about and this issue is preventing us from having.
The text was updated successfully, but these errors were encountered: