Page 1 of 1

Resize bug in most image processing programs?

Posted: Wed Apr 14, 2010 10:37 pm
by eL_PuSHeR
Hello all.

A friend of mine sent this page to me yesterday.

Although old, the mentioned issue seems to remain on most image processing programs.

So far XnView 1.97.2 (even after trying the 32bits workaround), Irfanview 4.25 (zooming is almost fine) and Paint Shop Pro X are affected. The only one that worked (after the workaround) was Adobe Photoshop CS3 (I don't have CS4 or CS5 so I can't say for them).

What do you think?. I think this is an interesting issue which I never thought about. Is there any other possible workaround that rings a bell?

Re: Resize bug in most image processing programs?

Posted: Wed Apr 14, 2010 10:55 pm
by obelisk
read that before, really isn't a big issue.

Re: Resize bug in most image processing programs?

Posted: Thu Apr 15, 2010 1:15 am
by XnTriq

Re: Resize bug in most image processing programs?

Posted: Thu Apr 15, 2010 7:17 am
by eL_PuSHeR
Ok. This is old news. The current workaround is:

1. Decrease gamma to 0.45
2. Resize
3. Increase gamma to 2.2

...

Posted: Sun Jun 13, 2010 12:56 am
by DOS386
...

Re: Resize bug in most image processing programs?

Posted: Wed Jul 14, 2010 2:11 am
by DOS386
read that before, really isn't a big issue.
I did read it and it is a BIG issue :-(
eL_PuSHeR wrote:The current workaround is:

1. Decrease gamma to 0.45
2. Resize
3. Increase gamma to 2.2
NO it isn't. It is theoretically correct, in practise it's invalid. Why ? "Decrease gamma to 0.45" will cause massive damage by truncation to the 8 bits, actually much worse than the gamma error that you are trying to avoid. The method works with 16 bppc (not yet (?) supported in XN/NC), but not with 8 bppc.

Actually it's even more complicated. I had some discussion with Eric Brasseur recently (and he improved his article a bit), the "correct" meaning of the 8bppc RGB values is:

http://en.wikipedia.org/wiki/SRGB

Image

There is a "special" formula (see above), "similar" to y=x^2.2 for larger values, but very different for very dark values.

So what's missing in XN/NC is not only the 8 bppc -> 16 bppc conversion, but also the sRGB Gamma conversion.

Image

Image

Download now: http://ompldr.org/vNzltZQ/TESTPICT.ZIP (6'914 Byte's)

See also :

http://newsgroup.xnview.com/viewtopic.php?t=21739 "Gamma correct resizing (english, français)" - Leonidas - 2011-Jan-28

http://newsgroup.xnview.com/viewtopic.php?t=21441 "Resize bug (Bilinear and nearest neighbour)" 2010-Dec (valid about bilinear, invalid about NN)

http://newsgroup.xnview.com/viewtopic.php?t=20095 "16 bppc - supported or not ?" - 2010-May

http://newsgroup.xnview.com/viewtopic.php?t=14372 "Gamma Correct Resizing" - robofunk - 2008-Feb-08

http://www.4p8.com/eric.brasseur/gamma.html "Gamma error in picture scaling" :bug:

EDIT : this post has been updated many times, last 2011-Feb-05