This PNG will show different version if you open it in Chrome than in Safari
50 points by lr0
50 points by lr0
The image embedded on the page doesn't contain a color profile. It contains a gAMA chunk with a junk value of 219998 (interpreted as 2.19998 ≈ 2.2). This is bogus, because the PNG chunk stores 1/gamma*100000, so what's known as "gamma 2.2" is stored as 45455 (interpreted as 0.45455 ≈ 1/2.2).
The difference in behavior is because some viewers reject obviously buggy values of gAMA, and some apply the garbage value. Chrome and Firefox probably agree due to compatibility with legacy web content. Chrome and Firefox are technically correct in this case, because the PNG spec doesn't limit the range of values in gAMA.
curl -s https://lr0.org/blog/i/2025-12-27_18-21-51_screenshot.png | hexdump -C | head
00000000 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 |.PNG........IHDR|
00000010 00 00 04 4c 00 00 02 94 08 02 00 00 00 91 de 3a |...L...........:|
00000020 95 00 00 00 04 67 41 4d 41 00 03 5b 5e 5c ff 26 |.....gAMA..[^\.&|
00000030 78 00 00 00 44 65 58 49 66 4d 4d 00 2a 00 00 00 |x...DeXIfMM.*...|
00000040 08 00 01 87 69 00 04 00 00 00 01 00 00 00 1a 00 |....i...........|
00000050 00 00 00 00 03 a0 01 00 03 00 00 00 01 00 01 00 |................|
00000060 00 a0 02 00 04 00 00 00 01 00 00 04 4c a0 03 00 |............L...|
00000070 04 00 00 00 01 00 00 02 94 00 00 00 00 e9 5c 85 |..............\.|
00000080 75 00 00 40 00 49 44 41 54 78 01 64 dd d9 92 2c |u..@.IDATx.d...,|
00000090 b7 b2 a0 e7 1a 32 6b 58 e4 3e 3a 7a de b6 96 f5 |.....2kX.>:z....|
If Chrome and Firefox are handling the colour profile correctly, how come the image ends up looking incorrect? Surely there's a step somewhere that goes wrong.
Yes I don't get it; if the browser showed "true" foggy image, and feh was displaying "false", how come after merging png with color profile both display whatever was in feh, i.e. "false"?
Interestingly, GwenView renders an entirely differently glitched version of the image, but it displays fine in the preview