Digital Myth #1 - Staircase Interpolation

 

 

Is this article useful to you?  If you think so,

please consider a voluntary donation.

 

Contribute via Paypal

 

More about donations!

 

"It's not what you know that hurts you, it's what you know that just ain't so."

-Satchel Paige

Introduction

Sometimes, the world seems obsessed with making things bigger.  Cities vie against each other to be home to the tallest building.  The Guinness Book of World Records records various 'largest' items - the world's largest concrete goose statue is in Wawa, Ontario, for instance.  And I get no end of email from various entrepreneurs, all of whom seem hell bent on helping me enlarge things.  The world of photography in general, and the world of photographic prints in particular, is no exception.  We'd all like to take our photographs, and print them really large.

The problem boils down to this:  our photograph, in digital form, consists of a finite amount of information.  When we keep the information density of the photographic print high, the print looks good.  If we have a digital photograph that contains, say, 12 megapixels, and we print it on the paper at 360 pixels/inch, it will probably look pretty good.  It will also be 8" x 12".  If we want to print it larger, we're going to need to spread the information more thinly.

We could print it at 180 pixels/inch, for instance, and get a print that's 16"x24".  Eventually, though, as we drop the resolution (aka pixels/inch) we're going to start to see 'pixelation', which is where we see digital artifacts appear, and the print won't look as good.

The way we'd like to work it is that we'd run some software that would take the limited information in the digital photo, and it would create a NEW digital photo with more resolution, by 'making up' the new pixels it inserts.  The formal term for this process is 'resampling'.

There are lots of ways to resample the image.  Back in the bad old days, we used algorithms like 'nearest neighbor' and 'linear interpolation', and the results were not very good.  Photoshop popularized a method called 'bicubic', and the results are fairly good.

But that doesn't stop the quest for the holy grail, and we have software like Genuine Fractals, etc. all of which purport to do a better job than the competition. 

One particular algorithm that's generated a lot of interest is 'stair interpolation' where the image is resampled upward in size, in small increments (typically 10%) until it's the size we want.  Various arguments are advanced as to why this is a good way to do it.  I don't think much of those arguments, but then I'm a math geek.

And in any case, the proof is in the pudding.  Let's see if we can confirm or debunk this staircase interpolation method by just resampling an image and see what we think of the results.

The Image

This brings us to our selection of test image.  The proponents of various resampling techniques all show us the results on real images, like the eyes of tigers, or portraits.

When I test things, I like to pick the test to be as difficult as possible, and to make it as easy to interpret the results as possible.  Naturally, for this purpose I turn to my trusty old friend, the USAF 1951 resolution test chart.

Above you'll see a cropped section of the USAF 1951 resolution test chart.  I've generated this version from a PDF file, and I rasterized it specifically so that the outer (larger) test patches are easily resolved, and the inner (smaller) patches can't be resolved.  This is like taking a photograph, where there's more detail in the subject than can be captured by the sensor or film. 

What I plan to do is to start with this test image, and resample it upward in resolution by a factor of three, using Photoshops Bicubic, Bicubic Smoother, and with Stair Interpolation.  Then we can just examine the results, and see which seems to be best.

The Three Methods

First up, we try Photoshop's 'bicubic' method:

Note that in the original, if you put on your reading glasses, you can resolve the lines right down to test patch 0/6 (the lower left patches in the inner set).  Here, in the resampled version, we can definitely make out that that patch consists of three horizontal lines on the left, and three vertical lines on the right.  Moving up and to the right, we find the remains of test patch 1/1, where we can sort of make out that there are vertical lines on the left, and horizontal on the right.  The numerals for the 0 column of test patches are all pretty readable until we get down to 0/6, where the 6 is pretty unrecognizable.

Next up, Photoshop's 'bicubic smoother', which is what Adobe recommends for resampling images to be larger:

To make comparing this version to the 'bicubic' version easy, I've arranged it so that if you 'hover' over the image with your mouse pointer, you get the 'bicubic' version, and when you move the mouse pointer away, you get the 'bicubic smoother' version.

To my eyes, these two versions differ mostly in contrast in the patches where we're close the the limit of resolution.  Neither version has dug more detail out of the original than the other, but the 'bicubic smoother' version seems to roll off the contrast as we hit the limit of resolution, which would probably make images seem less grainy or noisy.  Which one you use might well be a matter of preference and your goals with the particular image you're working on, and perhaps the noise level or grain in the image.

One other difference is that the 'bicubic smoother' version seems to show a little less 'staircasing' along the curves.  Look closely at the upper curve of the numeral '2' and you'll see what I mean.

Finally, we look at the result of staircase interpolation.  This next image was generated by using the Photoshop Bicubic method to increase the size in 10% increments until it's the right size:

Again, mousing over it gives you 'bicubic', mousing off gives you staircase.

it's pretty easy to see that this method doesn't hold a candle to the bicubic smoother method.  Look at the differences in test patches 0/4, 0/5, 0/6.  They're no longer clearly resolved, because the aliasing that I feared has messed them up.  The same aliasing has the effect of 'enlarging' each of the dark areas, so that the Stair Interpolation version seems to 'bloom' slightly compared to the bicubic version.

The Bottom Line

The goal when you're resampling an image to make it larger (aka 'uprezzing') is to make sure that the new, larger version meets two goals:  first, it should contain all of the detail there was in the original, and second, it should not have any obvious artifacts introduced that interfere with the appearance of the image.  Put informally, you don't want to throw anything away, and you don't want to make it ugly.

Looking at the staircase interpolation example above, I conclude confidently that it fails on the first goal.  Even the simple bicubic method does a better job of not throwing away the detail in the original.

To borrow a phrase from the TV show "Mythbusters", I think this myth is most definitely busted.

 

 

Is this article useful to you?  If you think so, please consider a voluntary donation.

More about donations!