lmms.io icon indicating copy to clipboard operation
lmms.io copied to clipboard

Lossless image optimization

Open FlipFloop opened this issue 4 years ago • 8 comments

FlipFloop avatar Mar 08 '20 19:03 FlipFloop

Thanks for your PR! How did you optimize these images though? Also, looks like the changes weren't totally lossless, rather they were too small to notice.

liushuyu avatar Mar 08 '20 19:03 liushuyu

It's just SVG compression and only lossless algorithms were used!

FlipFloop avatar Mar 10 '20 01:03 FlipFloop

It's just SVG compression and only lossless algorithms were used!

Okay then.

I can see you also introduced public/.DS_Store file which I think it's unintended. Would mind removing it?

liushuyu avatar Mar 10 '20 01:03 liushuyu

Also, looks like the changes weren't totally lossless, rather they were too small to notice.

Worth noting that zopflipng does truly visually lossless compression. (In other words, the resulting pixel data shown will be identical to the original, but stuff like metadata that doesn't affect pixel color might be lost.) For this case though, perceptually lossless seems fine.

Zopfli beats PNGOut, and PNGOut beats OptiPNG. If we're ok with lossy, pngquant appears to be a good choice.

Spekular avatar Mar 10 '20 16:03 Spekular

Also, SVG compression doesn't explain how the PNGs were compressed, which is the majority of the changes in this PR.

Spekular avatar Mar 10 '20 16:03 Spekular

PNGQuant beat OPs compression for logo and project icons at large and medium sizes. Otherwise OPs is better. img - quant.zip

However, I think we should leave the logo and project images (truly) lossless, since they're provided for download in the branding section they should be as high quality as possible.

Spekular avatar Mar 10 '20 17:03 Spekular

Looks like this PR went stale.

To summarize, the OP probably need to:

  1. Remove all the .DS_Store clutter
  2. lmms-64x64.svg lmms-project-64x64.svg logo_lg.png project_lg.png should not be compressed since these files are meant to be downloaded in full quality with all the metadata intact (see https://lmms.io/branding)

Otherwise LGTM

liushuyu avatar Mar 22 '20 21:03 liushuyu

@liushuyu Sure for the .DS_store

However, this is lossless optimization --> quality is not affected!

FlipFloop avatar Mar 23 '20 15:03 FlipFloop