Page 1 of 1

Gamma Correct Resizing

Posted: Fri Feb 08, 2008 2:28 am
by robofunk
Here is a very interesting website about gamma error in picture scaling.
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've tested XnView and it definitely exhibits the gamma error described on the page. It would be a great if XnView added the feature to use gamma correct scaling. It could even be made the default if desired. The examples on the page are very compelling.

The incorrect method is shown first:
http://www.4p8.com/eric.brasseur/gamma_17.html
http://www.4p8.com/eric.brasseur/gamma_01.html
http://www.4p8.com/eric.brasseur/gamma_19.html
http://www.4p8.com/eric.brasseur/gamma_13.html

Generally it seems more detail is preserved with gamma correct resizing and the gamma is obviously correct.

Please consider this feature. As argued by the site XnView would be one of the few softwares that maintains correct gamma when resizing.

Posted: Fri Feb 08, 2008 3:44 am
by pic_viewer
Support!

Posted: Fri Feb 08, 2008 10:16 am
by helmut
Uhh. :-| The resize algorithms including Lanczos really struggle with the sample image "Dalai Lama".

Posted: Fri Feb 08, 2008 11:28 am
by pic_viewer
Question: does this also affect or is relevant for the normal view zoom mode (downscale)?

Posted: Fri Feb 08, 2008 12:47 pm
by plarry
That should be built in.

//edit:

A "System Gamma" input field would be good for this, as found in some compositing packages. (As an addition, maybe replacement, to the already existing "Gamma Correction")

:arrow: Pic_Viewer, yes, this also affects the regular downscale preview.

And as a sidethrought, there is a reason this one got so long ignored, one hardly ever notices it, and, you can always work around when it becomes an issue. If gamma is way off you'll notice anyway. Nevertheless would be nice if it will be built in...

Re: Gamma Correct Resizing

Posted: Thu Jun 06, 2013 11:16 am
by oops66
robofunk wrote:...Please consider this feature. As argued by the site XnView would be one of the few softwares that maintains correct gamma when resizing. ...http://www.4p8.com/eric.brasseur/gamma.html#examples
...
... Right interesting, so every pictures softwares should take care with this gamma correction when resizing pictures (zoom in & out too) .
Does XnView 2.0 & XnViewMP 0.51 do this automatically ?

...And for Nconvert is it he same way as convert ?

Code: Select all

ImageMagick
First of all a warning: ImageMagick is regularly being enhanced and transformed. What you read here is how things worked for me when I made tests with ImageMagick. Read it to get some understanding of the general ideas. But it may not work on the version of ImageMagick you are using. You may have to adapt.

The ImageMagick library allows to convert images to 16bit format and to change the gamma. This command performs the whole chain of operations to resize an image named in.png to an image named out.png. The image is scaled down to 50%:

convert in.png -depth 16 -gamma 0.454545 -resize 50% -gamma 2.2 -depth 8 out.png

You can replace the "-resize 50%" with any set of operations on the image that you want to be performed correctly.

Re: Gamma Correct Resizing

Posted: Thu Jun 06, 2013 9:30 pm
by XnTriq
oops66 wrote:Does XnView 2.0 & XnViewMP 0.51 do this automatically ?
I don't think we have an “official statement” from Pierre.
Eric Brasseur ([url=http://www.4p8.com/eric.brasseur/gamma.html]Gamma error in picture scaling[/url]) wrote:Yet other non-gamma compliant software seem to be Paint.NET, Google Picasa, Irfanview, Python Imaging Library 1.1.6, ITT IDL 7.0, ImageJ 1.40, XNview/NConvert 1.97.5, Opera, Google Chrome, KolourPaint...
Martin Breidt ([url=http://scripts.breidt.net/gamma_correct_v12.pdf]Be gamma correct[/url]) wrote:Other examples of software not using gamma correction when scaling images are Gimp, XnView, Matlab, Word, Firefox.