fengyuanchen / compressorjs

JavaScript image compressor.
https://fengyuanchen.github.io/compressorjs/
MIT License
5.23k stars 438 forks source link

'Quality' param not followed when converting from png to jpeg #174

Closed nik32 closed 1 year ago

nik32 commented 1 year ago

Is your feature request related to a problem? Please describe. So whenever I was passing a PNG... the output JPEG files compression was really big (and noticeable). It doesn't seem to be following the 'quality' param (even if I give quality as '1'... it would still result in 50% compression. And if I combine it with maxWidth or maxHeight... the compression increases even further... to around 80-90%

Describe the solution you'd like I would like the loos of quality to be not this drastic. It would be great if the compression could follow quality param (So 2.6MB PNG be converted to 2.6 JPEG. Even if loss of quality is there it should not be drastic. Like when we compress a JPEG... the size decreases but the loss of quality is really negligible. You can't even notice it)

nik32 commented 1 year ago

Sorry my fault. Actually there was a lot of compression of size when converting from png to jpeg (but not a lot of degradation in terms of quality). This I realised when i saw the result of before and after compression image (from here https://fengyuanchen.github.io/compressorjs/)... I could not notice that much of a difference.

nik32 commented 1 year ago

Absolutely great library @fengyuanchen!! Thanks!