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

Why Image compression increases size of image? #81

Open
g-abhishek opened this issue Feb 15, 2022 · 1 comment
Open

Why Image compression increases size of image? #81

g-abhishek opened this issue Feb 15, 2022 · 1 comment

Comments

@g-abhishek
Copy link

g-abhishek commented Feb 15, 2022

I am trying to compress the PNG image using imagemin and imagemin-pngquant, after applying the transformation with different quality level, getting different sizes of image

See for quality between 0, 1 => 1848433. and for quality between 0, 0.8 => 2051244. for lower quality image size is greater than the higher quality.

e.g
input size 1677003 bytes
quality: [0, 0.1] => 1227453
quality: [0, 0.5] => 1662248
quality: [0, 0.7] => 1886730
quality: [0, 0.8] => 2051244
quality: [0, 0.9] => 2018915
quality: [0, 0.95] => 1995294
quality: [0, 1] => 1848433

Sample code:
let res = await imagemin.buffer(buffer, { plugins: [ imageminPngquant({ quality: [0, 1], }), ], });

Sample image:
1p7

@ikitty
Copy link

ikitty commented Oct 10, 2022

got the same problem. cannot understand the 'quality' variable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants