DEV Community

Discussion on: Compress image in browser? Easy!

Collapse
 
lexlohr profile image
Alex Lohr

Actually, it is a percentage of signal quality for the quantizer to aim for. While the result is compression, what you set there is the amount of signal loss you deem acceptable.

Thread Thread
 
antonreshetov profile image
Anton Reshetov

I can not confirm your words, but I trust the documentation

A Number between 0 and 1 indicating the image quality to use for image formats that use lossy compression such as image/jpeg and image/webp.
If this argument is anything else, the default value for image quality is used. The default value is 0.92. Other arguments are ignored.

Thread Thread
 
lexlohr profile image
Alex Lohr

That is exactly what I was referring to: you set the quality of the image in a lossy codec, not the compression factor (though both might coincide).

Thread Thread
 
antonreshetov profile image
Anton Reshetov

Got it )