imgaug-doc icon indicating copy to clipboard operation
imgaug-doc copied to clipboard

Confusing info on JPG Compression

Open ackbar03 opened this issue 6 years ago • 1 comments

Hi,

There is some confusion regarding the info on the Jpeg compression function

" compression (number or tuple of number or list of number or imgaug.parameters.StochasticParameter, optional) – Degree of compression used during jpeg compression within value range [0, 100]. Higher values denote stronger compression and will cause low-frequency components to disappear. Standard values used when saving images are at around 75 and will usually not degrade image quality very much. "

Its true that 75 is usually used, but because of the way the function is implemented (higher number means more supression), this statement is confusing. The corresponding compression value should be 25.

If you open a png file, make a trivial edit, and resave it as jpg, it has the same file size as passing it through the JpegCompression augmentation with 25 parameter, not 75

ackbar03 avatar Feb 09 '19 06:02 ackbar03

Thanks for reporting this. It should be fixed with PR https://github.com/aleju/imgaug/pull/255.

aleju avatar Feb 09 '19 09:02 aleju