trooper posted on Oct 24 2005 at 03:07 AM said:
You could always use
ImageShack to host your pictures, It`s also free too.
Trooper
Thanks for a suggestion, I already did so! So back to the topic.
This is an original image (not scaled, just like it is in a reality):
It is a fragment of main screen of the
UQM game. It's a basically open port of StarControl2. I did chose that game (and this fragment of screen) for a very simple reason - it will allow to show points of different methods of scaling most noticeably. All this imho of course and be
free to criticize or anything.
So we are discussing a scaling of uneven factors such as 1.5x. This isn't an easy problem as previous posts stated very well. However I will try to demonstrate some of techniques which can help to alleviate it.
So scale this image by factor of an 1.5x (horizontally and vertically) using simplest of all methods:
the pointsampling:
.
Ugly, isn't it? It's even worse when playing because
any moving object will be rippling like a hell. This is an aliasing (we can call it a distortion too) at its worst.
So there must be a better method and here it is! The
bilinear filtering:
It works by averaging of matrix of 2x2 source's pixels to compute the final one. It hides the distortion very well however at a cost - image looks fuzzy. Yet the dreaded distortion is almost gone and our eyes will welcome the change.
But it could be better so we shouldn't stop now, should we?
Look at this then:
This one is was done using the
bicubic filtering. It works the same way as the bilinear just has a bigger matrix of pixels (4x4 to be exact). It's apparent the image is a sharper with less fuzziness. The distortion is hidden as well so we might conclude the bicubic is a better solution than a bilinear filter.
These three methods of scaling are a most basic ones so it's time to go after something more sophisticated.
First this:
This was done by using somewhat more complicated algorithm. But first compare this image to the previous ones. What you are seeing?
Far less fuzziness and the distortion isn't showing its ugly head too much. Actually you can even see a blocks of individual pixels (just like in the original)! How was this achieved might you ask. Well... by scaling the image to the bigger size (upsampling) first then scaling it down to the required size (downsampling) second. It's called an
oversampling. In this case upsampling was done using plain pointsampling at 2x2 ratio and downsampling was using the bicubic filter at 0.75x0.75 so the final image would be of desired size of 1.5x1.5.
Let gets this concept to a more "hardcore" level:
And then to the really real
hardcore:
These last two images were done the same way as previous one (the first with an oversampling). They just used higher rates of upsampling: 4x4 and then 32x32! Actually the last one was more complicated because it was using three stages of downsampling (two bicubics and one bilinear filter in a serial) to scale down to the 1.5x1.5 ratio. As you see you must be a very nitpicking to see differences among them. This is because the 2x2 upsampling was just enough to get a good results. We have a "diminishing returns" syndrome at work here.
Well it's all? Not, obviously not!
Two more images and I'm going to a bed.
This one is nothing special really as it's basically somewhat smoother version of a bicubic filtering.
However the picture above is the most advanced scaling showed here. The actual link to the picture is a hint how it was done. It does look like it was done natively for an 1.5x1.5 (assuming the artist was lazy
).
Sorry to stop now but my eyebrows are closing themselves now... Must go to a sleep... I hope I made something interesting to you.