Open simurai opened 7 years ago
Hi @simurai,
According to the spec, an sRGB chunk can spare an ICC profile http://www.libpng.org/pub/png/spec/1.2/PNG-Chunks.html#C.Anc-color. This is what the #12916 stripped.
before:
Reading IHDR chunk.
Reading IHDR chunk, length = 13.
Reading sRGB chunk.
Reading sRGB chunk, length = 1.
Reading IDAT chunk.
Reading IDAT chunk, length = 16384.
…
Reading IDAT chunk.
Reading IDAT chunk, length = 3669.
Reading IEND chunk.
Reading IEND chunk, length = 0.
after:
Reading IHDR chunk.
Reading IHDR chunk, length = 13.
Reading IDAT chunk.
Reading IDAT chunk, length = 365579.
Reading IEND chunk.
Reading IEND chunk, length = 0.
…
Recompressing IDAT chunks in .../atom/resources/app-icons/stable/png/1024.png
Total length of data found in critical chunks = 365636
Now, some browser including Chrome still treat untagged images as Device RGB (Color LCD), and the visual difference could be even greater on wide-gamut devices. Since Apple has adopted untagged=sRGB across the whole platform, ICNS files contain images tagged as sRGB (previously, Generic RGB). For example, one from Finder.icns in OS X Yosemite / El Capitan.
Reading IHDR chunk.
Reading IHDR chunk, length = 13.
Reading sRGB chunk.
Reading sRGB chunk, length = 1.
Reading IDAT chunk.
Reading IDAT chunk, length = 8192.
…
Reading IDAT chunk.
Reading IDAT chunk, length = 7083.
Reading IEND chunk.
Reading IEND chunk, length = 0.
So, for the sake of consistency, the sRGB chunk has to be restored.
As for the optimization, you can also reduce the actual ICO and ICNS files. Total size went down from 6.52MB to 4.35MB saving 33.3% with Optimage (Disclaimer: I'm the author). These are lossy optimizations but in a more controlled way than #13634, i.e. visually lossless. Lossless is also an option. If needed, I can make a proper PR.
Prerequisites
Description
Apparently the added zopflipng compression in https://github.com/atom/atom/pull/12916 makes the icon look "washed out".
Steps to Reproduce
resources/app-icons/stable/png/1024.png
.Expected behavior:
They should look the same.
Actual behavior:
The right icon looks "washed out/faded".
Reproduces how often:
I can't reproduce it with my setup. This issue is moved over from https://github.com/atom/atom/pull/13634#issuecomment-272922681
Versions
10.12.2 (16C67)
Additional Information
We could revert that PR, but it would be great if more could confirm the issue. Especially on Linux since macOS and Windows use their own icon format.
Initially reported here: https://github.com/atom/atom/pull/13634#issuecomment-272922681