How to estimate the grid size of a rescaled pixel art?

392 Views Asked by At

A pixel art image originally has a consistent resolution with its grid size. However, in our case, this image may be upscaled using nearest neighbor upscaling to an arbitrary size (like 16x16 to 200x200), eg, a grid may contain 10 pixels. Our goal is to retain the original grid size of this image, ie, the exact number of grids.

Is there any way to do this? This seems to be a simple image processing problem, but I cannot figure out an effective solution. A fact of nearest neighbor upscaled pixel art is that the color distribution remains the same.

Thanks for your help.

1

There are 1 best solutions below

5
On

Well, the way I see it, there are essentially two cases :

  • Case 1: The up-scale is a mutiple of the down scale : $(N \times M) = (a n \times b m)$. Then, the problem is more or less trivial.
  • Case 2: The above relationship does not hold, and using antialiasing techniques will help restore a feeling of sharpness in the image.