aleju / imgaug-doc

Code and assets to generate the documentation of imgaug
http://imgaug.readthedocs.io
MIT License
155 stars 50 forks source link

Confusing info on JPG Compression #1

Open ackbar03 opened 5 years ago

ackbar03 commented 5 years ago

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

aleju commented 5 years ago

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