POV-Ray : Newsgroups : povray.beta-test : Gamma Again : Re: Gamma Again Server Time
28 Sep 2024 15:09:38 EDT (-0400)
  Re: Gamma Again  
From: Warp
Date: 29 Nov 2010 12:34:28
Message: <4cf3e424@news.povray.org>
Stephen Klebs <skl### [at] gmailcom> wrote:
> I use POV for graphics work, so I often rely on it to match rgb values
> irrespective of lighting conditions. For example, in 3.6 a 50% gray with no
> light source and ambient 1 is always accurately rendered as RGB 128, 128, 128,
> as long as Display_Gamma in povray.ini is the same as assumed_gamma in
> global_settings or if no assumed_gamma is declared. This is true of image-mapped
> pigments or declared colors.

> In 3.7, however, with the suggested Display_Gamma and File_Gamma set to 2.2, a
> 50% gray (rgb 0.5) with no light source and ambient 1 comes out as RGB
> 186,186,186 or a gray of about 0.73, much lighter. This does not make sense to
> me. I would expect that if ambient is set to 1 with nothing else affecting the
> color, that the rendered output would match the value called for.

  The problem is that RGB 128,128,128 is *not* 50% gray, in other words,
exactly half-way between black and white, in any display system (except
perhaps very exotic ones). RGB does not map linearly to brightness in
most displays.

  If your monitor has a gamma of 2.2, then RGB 186,186,186 ought to be
pretty close to 50% brightness. If it's not, then you should use a gamma
which matches your display system.

  Moreover, RGB 186,186,186 may look exactly 50% bright in your display
system but not somebody else's. For example, there are systems where
display gamma is 1.8 instead of 2.2. In this case the gamma meta-information
in a PNG file exists to display such an image properly in such a system with
a different display gamma. It helps the system make the proper corrections
to make the 50% bright pixels look 50% bright on the target system.

  If you are dealing with literal pixel values rather than how they look
on screen, eg. because you are using these pixel values as data for some
purpose, then setting gamma to 1.0 is the proper way of achieving that,
as it stops gamma correction from being made.

  Currently if you specify #version 3.6 in your scene, it should make the
current beta to assume 3.6's way of handling gamma (IIRC), but this is still
under discussion and development to make backwards compatibility work better.

-- 
                                                          - Warp


Post a reply to this message

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