User:Mykhal/WikiPNGRenderingTest

This page demonstrates an interesting but undesired phenomenon of different appearance of different encodings of the same original PNG image after processing (scaling) on Wiki(p|m)edia servers – (currently, ) grayscale PNG images appear to be lighter (gray-er) than their monochrome or RGB variants.

Please note that the phenomenon applies for the image wiki pages as well, as they contain downscaled image versions. The inspection for original visual identity must take one step (click) further.. (URL must be like )

Original PNGs are made with GIMP.

(Note: I wonder why the transparent variants are not shown transparent.. is there some different processing on commons vs en servers?)

Discussed here.

Test A
(Does not apply for the transparent versions, somehow..?)

Screenshots:
 * File:WikiPNGRenderingTest Screenshot 20170820202351Z.png

Test B
More obvious and convincing one (no transparency browser-dependent rendering, no (anti)aliasing differences in the original images), seamless pattern and seamless side-by-side comparison.



RGB / Grayscale / Monochrome (downscaled by Wiki*edia servers)



RGB / Grayscale (pre-downscaled thumbs, original size)

.. more experimenting:



RGB / Grayscale, thumbs further downscaled by Wiki*edia to >50%.. looks the same (I have just noted that it applies for Chrome, NOT for FF !?!)



RGB / Grayscale, thumbs downscaled by Wiki*edia to <50%.. the anomaly appears again

Test B images generation info The monochrome image was generated with Python Imaging Library (Pillow): .. inverted, and converted to grayscale and RGB encodings. Those two encoded images are further downscaled to 128px in GIMP to demonstrate, that if they are not downscaled by the server, they are OK – the same.

Screenshots:
 * File:WikiPNGRenderingTestB_Screenshot_20170821013950Z.png

Cause
More observations show that the presence of the anomaly is browser dependent. E.g. on Windows 7 platform, it appears in MSIE 8 browser, but not in MSIE 9 or Win8/MEIS 11.

Principal observation
PNG gamma value in the original images is set to 0.454545 (because the colorspace is sRGB – GIMP default?). This gamma value is preserved in the Wiki*edia servers processed/scaled images (or just lightly changed to 0.45455 probably by some rounding), except from the grayscale PNG images – they have the gamma value changed to 1.

(I have verified that simple Imagemagick scale convert operation is preserving the gamma value in both RGB and Grayscale images.)