4 ms·
Nice 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/
by mrbig4545 11y ago
Nice 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