3 ms·
My acid test for resizing (downscaling to be more precise): http://www.4p8.com/eric.brasseur/gamma-1.0-or-2.2.png http://www.4p8.com/eric.brasseur/gamma-1.0-or
by leni536 11y ago
My acid test for resizing (downscaling to be more precise):
http://www.4p8.com/eric.brasseur/gamma-1.0-or-2.2.png 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/gamma-1.0-or-2.2.png 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):
http://www.4p8.com/eric.brasseur/gamma.html http://www.4p8.com/eric.brasseur/gamma.html
- avinoth 11y agoWhat's happening actually? I wanted to learn image processing but always get hung up. Can you just give an quick note about what's happening here? or direct me to any links? thanks
- leni536 11y agoI think my last link describes the problem accurately from the ground up. 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.
- mrbig4545 11y agoNice one for that, I didn't know this existed! seems I pass this one ok, https://thisaintnews.com/view/picture/138385/downscale-test https://thisaintnews.com/view/picture/138385/downscale-test Thanks to https://metacpan.org/pod/Imager 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/1218395289-sonic.gif 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/138386/test-gif-1 https://thisaintnews.com/view/picture/137264/test-gif-2 https://thisaintnews.com/view/picture/137264/test-gif-2 https://thisaintnews.com/view/picture/137265/test-gif-3 https://thisaintnews.com/view/picture/137265/test-gif-3 https://thisaintnews.com/view/picture/138387/test-gif-4 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
- leni536 11y agoWell gifs being palette based does add to the problem more. Well the obvious solution is to use the color values for rescaling and averaging (in a proper colorspace), resize the image then build a new palette from the new colors. Well this palette generation isn't exactly straightforward either.
- leni536 11y agoI don't know what am I supposed to see in your test. I see the image in its original resolution but much darker.
- mrbig4545 11y agoThat it works. Those gifs have weird layouts and transparency things going on, and to get them to scale correctly is tricky. 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
- leni536 11y agoOh I see. For the png it's darker then my original (both the copy of the original and the downscaled), but the text reads "RULES", so that's something.
- mrbig4545 11y agoI can't edit, but here's the code, https://gist.github.com/anonymous/1cecd2288ebef0cf90f1 https://gist.github.com/anonymous/1cecd2288ebef0cf90f1