image-shrinker icon indicating copy to clipboard operation
image-shrinker copied to clipboard

Compression lossy or not?

Open jancborchardt opened this issue 6 years ago • 2 comments

It seems that the compression is lossy? This is a PNG logo I compressed the other day.

Original: image-shrinker original

Shrunk file, note the staircase effect: image-shrinker shrunk hard edge

(In Nextcloud for example we use Trimage for compression of JPG/PNG and scour for compression of SVG, which are both lossless and have not had issues. Lossy compression like SVGO and others have always led to issues, so we avoid them.)

Especially for SVG it needs to be not lossy since they are often the source files. If some of the methods used in Image Shrinker are lossy and others not, maybe a switch to "Compress even more! (smaller files but lossy compression)" or the like is best?

jancborchardt avatar May 30 '18 20:05 jancborchardt

Ok, so according to the projects:

  • :+1: mozjpeg is lossless
  • :x: pngquant is lossy (they specifically say on their website, also see example above)
  • 🤔 svgo seems lossless if used with the right attributes, cause it also seems to have lossy ones. (As said we had bad experience using it in Nextcloud.)

jancborchardt avatar May 31 '18 01:05 jancborchardt

Good point, I love mozjpeg - for me it's the best, jpg compressor - it's quite fast and the results are great. But I will check out scour and optipng, pngcrush, advpng. Those png compressors are used by Trimage

stefansl avatar May 31 '18 08:05 stefansl