Deviant Login Shop  Join deviantART for FREE Take the Tour
×

More from deviantART



Details

Submitted on
July 24, 2012
Submitted with
Sta.sh Writer
Link
Thumb

Stats

Views
2,291
Favourites
39 (who?)
Comments
5
×
Sometimes, we want an image at a specific size for a specific use. People may notice that when we try to scale pixel art, we tend to run into issues as our computer will most likely ruin its crisp quality which we want out of this medium of art.

IN A NUTSHELL: You can only scale pixel art by multiplying its dimensions by a whole number and without interpolation (e.g. 50x50 by a factor of 2 to get 100x100).

To prevent confusion, no interpolation is functionally the same as nearest-neighbor interpolation. It apparently depends on what the software calls this method of scaling images.

Why is this?

It should first be noted that resizing most images will mess with its quality, but it hurts pixel art out of other images the most if not done correctly. In order to understand why scaling pixel art is especially problematic, here's a fun puzzle:



Consider a 8x8 checker pattern we can create as an image that is 8 pixels tall and 8 pixels wide. Now, what if we want the same 8x8 checker pattern in a 9x9 image? What we get may vary on the software we use, but by scaling this image through our software of choice one possible result can look something like this:



This image is 9 pixels wide and 9 pixels tall, but the results are pretty stupid. What the computer tries to do is blend the pixels together to try to fit the 8x8 checker pattern into a 9x9 image. What if we try to scale the image without any of the fancy interpolation? Again, what we might get from this will vary on the software, but this is what I got:



The results are still stupid as it's still not a great checkerboard pattern as there's a row and column that is twice as wide as the other ones.

By trying to scale a 8x8 image to a 9x9 image, what this is effectively trying to do is make every pixel 9/8 pixels big. This makes no sense as we cannot have a fraction of a pixel, which is already the smallest element we can work with. This is why the computer tries to compensate by either stretching or tossing out certain rows and/or columns or by blending the pixels together, because it's an imposssible task otherwise.

Consider this portrait I made:



It's dimensions are 100x100, and it's quality is nice and crisp, just what I love about pixel art. However, since this is meant to be used for whatever people need them for, I will expect people to need this image in different sizes, from 50x50 as a deviantart icon (or game sprite), or as large as 100x100 or 150x150 as forum avatars.

I can scale this image up by a factor of 2 to 200x200, which is perfectly fine as it's basically taking every pixel and turning them 2 x 2 = 4 pixels big. Unlike the checker pattern example which tries to make them 9/8 times bigger, we're dealing with a non-problematic whole number. As long as we upscale a work by a factor of a whole number, our work will not be destroyed. As for down-sizing though, if a pixel work is already scaled by a factor of a whole number so every pixel is actually made up of more pixels arranged in a square, we can safely scale them down without interpolation and retain the original quality.

Here, I scaled my portrait by a factor of two:



However, be mindful that we do not want our computer to use interpolation to blend pixels together. The version to the left is what I get if I scale my Rainbow Dash portrait without interpolation. The one on the right was scaled with interpolation.

Let's say that I want my RD portrait at a size of 75x75, this is what happens if I downsize the original portrait to that size without interpolation:



The results are very ugly. If we want to scale an image by a factor of a non-whole number, it's in our interest to clean up the mess that the computer creates. Computers have no spatial reasoning so they have no ability to know if what they're doing is making something really ugly. It's up to me to fix every mistake and polish this up to be of a quality comparable with the original.

Resizing any other raster image will likely mess with its quality, but because other raster images do not tend to place so much emphasis on the careful placement of the pixel, we might not see the obvious change in quality, but nonetheless, it still messes with the quality of a work by either tossing away information, or trying to create information that does not exist.

This is also the reason why vectors exist for things like text - they can be scaled to any size without any change in quality. If we need an image that can be scaled to any size, vectors is what we want. However, with pixel art images, those images are going to be extremely size-specific and will not be scaled very beautifully.
Just addressing a question I've been asked a few times.
Add a Comment:
 
:icon161803:
You know there are some non-convolutional resizing algorithms designed especially for pixel art like epx or hqx? If not, you should check them out! But of course, the fact that you can scale it only by integral factor still holds.
As for downscaling, nearest neighbour simply means throwing out some samples, so this obviously results in aliased image. That's why for continuous tone images we normally run them through a lowpass filter when downsampling. It unfortunately can't be done with pixel art without changing the palette so human intervention is usually required.
Reply
:iconpix3m:
Pix3M Aug 31, 2012  Professional Digital Artist
I probably overlooked them. Maybe I could see what happens if I try those algorithms out... one day.
Reply
:iconthetriforcebearer:
what about nearest neighbor? i have used that with pixel art and it works great
Reply
:iconpix3m:
Pix3M Jul 25, 2012  Professional Digital Artist
I read that it's the same as no interpolation?
Reply
:iconxonimaru777:
xOnimaru777 Jul 25, 2012  Student General Artist
I was going to say that. If you use the nearest neighbor option when resizing, it recalibrates the image to take on the dimensions of the closest to the original. It's not as clean as scaling it up 2:1, but it's so subtle you can hardly notice it.
Reply
Add a Comment: