POV-Ray : Newsgroups : povray.beta-test : PNG output much brighter than preview... : Re: PNG output much brighter than preview... Server Time
26 Apr 2024 08:17:14 EDT (-0400)
  Re: PNG output much brighter than preview...  
From: Warp
Date: 15 Jan 2007 05:57:55
Message: <45ab5e32@news.povray.org>
Thorsten Froehlich <tho### [at] trfde> wrote:
> Why?

  I will respond to that question with another question: Can you tell me
any reason why people using povray would want gamma information to be
stored in the png file (especially considering that it's *not* stored
in any other image format supported by povray)?

  By far the most common situation is that people using povray expect
exact pixel color values which correspond to the color vectors they
have used in the scene. For example, if someone makes an object of
color <.5, .5, .5> and removes all lighting/shading effects (usually
by specifying "ambient 1"), they expect to get an image where the
pixel values (assuming 8-bit color channels) are 128, 128, 128, or
perhaps 127, 127, 127, but nothing else.

  When instead they get something like 135, 135, 135, they get confused
because they are not getting what they expect nor want. If they, for
whatever reason, relied on povray giving them exactly half-bright
pixels, getting 135*3 is useless to them.

  Another issue is that getting *different* pixel results when rendering
to png as compared to rendering to another image format is going to only
cause even more confusion. Shouldn't povray give consistent results
regardless of the image format used?

  Gamma information exists in OSes so that images will look approximately
the same as in other systems. However, this is an issue if image viewer
programs (and to some extent image editors). In other words, an image
viewer gets an image with "raw" pixels, and then it gamma-corrects them
to look good on the specific platform. In other words, this correction
is a duty of the viewer program (or the OS itself).

  Povray, however, *creates* the image file. It's not an image viewer.
Putting gamma correction in povray is putting it in the wrong end of
the pipeline. The gamma correction should be at the end of the pipeline
(the viewer program), not the beginning (the program that creates the
image, in this case povray). Using gamma correction in *both* ends will
only cause an incorrect result.

  In the past (at least with pov3.5) people have abused povray's gamma
correction for something completely different than what it was really
intended for: They have used it as a kind of post-process filter to
alter the brightness of the resulting image. This is obviously the
completely wrong usage, and if post-processing of individual pixels
(for example to brighten them) is desired, there should exist a tool
in povray specialized to do exactly that. Using gamma correction as
a hack for this is not the correct way.

  If this was done, the need for gamma correction actually completely
disappears. Why would anyone need gamma correction in povray anymore?
As I already wrote, gamma correction is a duty of the viewer program
(or the OS), not the program which creates the raw image.

-- 
                                                          - Warp


Post a reply to this message

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