Nature Photographers Network
This is the preserved archive of the original Nature Photographers Network. The community continues at naturephotographers.network.

Image Scaling

Discussion

3 replies
Posted by Mark Stahlke on February 24, 2010 at 2:26 AM
I just read an interesting article about gamma errors when scaling images, especially down sizing them. The article gets very technical but it's a good read.

From the article:
There is an important error in most photography scaling algorithms. All software tested have the problem: The Gimp, Adobe Photoshop, CinePaint, Nip2, ImageMagick, GQview, Eye of Gnome, Paint and Krita. Also three different operating systems were used: Linux, Mac OS X and Windows.

And also:
Technically speaking, the problem is that "the computations are performed as if the scale of brightnesses was linear while in fact it is an exponential scale." In mathematical terms: "a gamma of 1.0 is assumed while it is 2.2." Lots of filters, plug-ins and scripts probably make the same error."


I fooled around with the author's example images in Photoshop CS3 and the issue is quite dramatic. Genuine Fractals shows the problem too. Of course, the example images are designed to show the issue at its worst.

Fortunately, the author offers a couple of solutions for Photoshop. Either down-sample in 32 bit mode or convert to a custom RGB profile with gamma 1.0, down-sample, then convert back to your working RGB.

I tried this on some of my own images and I can see the difference. Sometimes it's subtle, sometimes it's obvious. The versions I re-sized with a gamma 1.0 profile look more like the master files.
Posted by Paul Wegemann on February 24, 2010 at 8:00 AM
Interesting. Thanks for the link, Mark.
Posted by David Bostedo on February 24, 2010 at 10:56 AM
Neat...I'll be interested to see how much actual effect this has on some of my photos. Apparently it's been somewhat corrected in CS4 in that 16-bit images are handled "properly".

EDIT :
Using the example (worst case) image from the article shows that PS CS4 requires a conversion to 32-bits to handle it correctly.

But I ran the same conversion on two copies of several of my actual 8-bit JPGs. I downsized each by 50%, one in 8-bit mode and the other in 32-bit mode. Then I converted the 32-bit back to 8-bit with defaults, and overlayed the two on layers. Switching the blending mode to difference showed differences in quite a few places. But they were all very minor, and I had lots of trouble seeing any difference on screen without using the layering method.

My take? I won't be bothering to convert to 32-bit to downsize unless I see something funny going on with my image. (I may try a few more though to try to really prove this to myself.)
Posted by John Williams on February 25, 2010 at 9:55 AM
Excellent article Mark; thanks for the link. I've noticed this effect with downsizing but never knew why it happened.