by leni536 · 11y ago · 0 comments
http://www.4p8.com/eric.brasseur/gamma-1.0-or-2.2.png
The resize.ly version (2x downscaled):
http://resize.ly/256x128/http://www.4p8.com/eric.brasseur/ga...
It fails horribly for me. Most software fails too (try to downscale the original in your favorite browser!), but this somehow ruins the base background gray too somehow.
Sorry for the test image being a little harsh, it's not mine (also some reading material how downscaling should be implemented):
seems I pass this one ok, https://thisaintnews.com/view/picture/138385/downscale-test
Thanks to https://metacpan.org/pod/Imager
Although I passed this one no problems, I find animated gifs to be the worst thing to resize, especially the ones where the changes are part of a layer over another layer
e.g. look at this one in gimp/photoshop
https://thisaintnews.com/static/user/pics/1218067200/1218395...
layer two is just enough to cover layer one and make the hand move, the rest is transparent. but at least the layers are the same size
some animated gifs have the new layer not the same canvas size as the layer underneath, so you have to adjust the layer offsets correctly or they end up all over the place
Infact I have a few evil gifs for testing this
https://thisaintnews.com/view/picture/138386/test-gif-1
https://thisaintnews.com/view/picture/137264/test-gif-2
https://thisaintnews.com/view/picture/137265/test-gif-3
https://thisaintnews.com/view/picture/138387/test-gif-4
I can't remember the exact differences, but I do remember they go from easy to hard to resize correctly
I guess what I was getting at is they're my acid test for image scaling
edit: also I mean the smaller image, on the left of the big one. The big one is probably a copy of the original
thanks
TL;DR the raw pixel values are typically not linearly proportional to the luminescence of the color channels. But a cone cell in the eye actually averages the luminescence of different areas if you look at a fine structured image from far away, so if you want to emulate the perception of the eye then you have to average luminescence values instead of raw pixel values. The conversion is well defined by the colorspaces in use. Most pictures on the Internet uses the sRGB colorspace, which is not linear.
Color perception and colorspaces are actually not straightforward in the sense that naive algorithms often fail. But the basics are not that hard.