POV-Ray : Newsgroups : povray.off-topic : Making a case for (ab)using gamma correction for brightness adjustment Server Time
29 Jul 2024 10:28:10 EDT (-0400)
  Making a case for (ab)using gamma correction for brightness adjustment (Message 1 to 2 of 2)  
From: Warp
Subject: Making a case for (ab)using gamma correction for brightness adjustment
Date: 2 Jan 2012 11:47:48
Message: <4f01dfb3@news.povray.org>
It has been repeated over and over that (ab)using gamma correction to
adjust the brightness of an image is misusing the real purpose for gamma
correction, and that it's not intended for that, and there are reasons why
a technically accurate gamma correction should always be used.

  On the other hand, suppose you *do* want to adjust the brightness of an
image. Putting aside the fact that povray doesn't currently offer any
method for doing this (you'd have to use an external program to adjust
the final image), gamma correction actually is an extremely good way of
doing this, in terms of the end result.

  Think about it: When you change the gamma correction of an image, pure
blacks remain pure blacks, pure whites remain pure whites, and everything
in between is *smoothly* scaled to either brigher or darker, with no jumps
or steppings at either extreme or anywhere (bar for the limitations of
integral pixel component values, which will round floating point values to
nearest integer values).

  It's just the perfect way of adjusting the brightness of an image.
Blacks won't become dark grays (if making the image brighter) nor whites
light grays (if making the image darker), which is seldom what one wants.

  (Perhaps the only drawback is that color gradients that originally appear
linear will start looking non-linear, but that's inevitable if you want to
keep blacks as blacks and whites as whites. OTOH one seldom needs to change
the brightness of the image so much that this becomes a visible problem.)

  So why shouldn't gamma correction be used for this purpose?

-- 
                                                          - Warp


Post a reply to this message

From: clipka
Subject: Re: Making a case for (ab)using gamma correction for brightness adjustment
Date: 13 Jan 2012 18:41:28
Message: <4f10c128$1@news.povray.org>
Am 02.01.2012 17:47, schrieb Warp:

>    So why shouldn't gamma correction be used for this purpose?

Depends on what you want to do. For realism, there is one simple rule: 
Just don't. Gamma adjustment (you definitely can't call it "correction" 
in this context) doesn't just adjust midtone brightness - it also messes 
with saturation and hue. For instance, darkening an image this way will 
increase color saturation while shifting hues towards the primaries 
(i.e. red, green and blue). If that is really what you want - just go 
ahead. But as for adjusting image brightness, I'd instead recommend 
rendering to OpenEXR and then using an external postprocessing tool that 
knows its job.

(There /is/ one legit gamma adjustment use case that hasn't been 
discussed yet: Viewing conditions differing significantly from the 
reference conditions specified in the sRGB standard require the gamma to 
be tweaked accordingly to ocompensate; otherwise, e.g. when viewed in a 
pitch black room the image would look too pale; however, the sRGB 
standard considers this a duty of the viewing equipment, not the image 
generating software, and I fully agree.)


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.