Rescaling tool: Undo uneven pixel doubling

Started by Snarky, Tue 12/03/2019 08:43:20

Previous topic - Next topic

Snarky

Hey, do any of you have any tips for a tool I can use to rescale sprites or screenshots back to their original resolution, when all I have is an unevenly upscaled image?

[imgzoom]https://i.imgur.com/z2xXteQ.png[/imgzoom]
(Upscaled x3 for visibility, on top of original upscale)

So, for example, the example above  is from an image that has been upscaled by a 14/5 (2.8) factor, so that for every 5 pixels in the original image there are 14 in the upscaled one: 4 of the original pixels are 3 pixels wide or tall, and 1 is 2 pixels. Unfortunately, it doesn't seem to be in a perfectly regular pattern (3-3-3-3-2 - 3-3-3-3-2 - 3-3-3-3-2), but to vary somewhat (e.g. 3-3-3-3-2 - 3-3-3-3-2 - 3-3-2-3-3) â€" you can see that on the right edge of the example there are only two "regular" pixel columns between two "thin" pixels: I've no idea how exactly this has been done. Therefore, simply scaling back to the original resolution using Nearest Neighbor introduces artifacts.

I had hoped that downscaling using seam carving (Content-Aware Scale in Photoshop) would automatically choose to remove the duplicated rows and columns as its first priority, but it doesn't seem to.

I have a few dozen of these images, each a few hundred pixels in each dimension, and varying in the upscale factor, so it's not something I'm prepared to do manually.

Short of actually scripting my own image rescaling algorithm (the algorithm is simple enough, it's just all the stuff around image libraries and creating a functioning exe that is a pain), does anyone have any tips?

eri0o

Try Aseprite, it provides lua scripting.

Snarky

Ah, that's interesting. I don't know Lua, but this might be simple enough that I could hack it together. Thanks!

I've also wanted to ma a wave-generator replacement for Sqirlz, and this might be a way to quickly prototype code.

SMF spam blocked by CleanTalk