POV-Ray : Newsgroups : povray.general : Pov-Ray internal gamma handling : Pov-Ray internal gamma handling Server Time
31 Jul 2024 02:30:34 EDT (-0400)
  Pov-Ray internal gamma handling  
From: JetRacer
Date: 1 Dec 2007 20:35:00
Message: <web.47520afd20b3cf60278fa6d50@news.povray.org>
First off; my apologies to moderators (you know why). Please don't hit me, I'm
just poor little house elf...

Have the subject of enforcing internal use of gamma 1.0 (linear) come up here
before?

-I searched the site but found nothing that wasn't related to PC/Mac issues
(which has nothing to do with the above). If not, then here goes:

Images are saved as inverse gamma 2.2 and are not linear as many people assume.
The screen is gamma 2.2 and together with the graphics the end result is
linear. The point is that computer math can't handle unlinear data (like
computer images); such must be converted to linear, processed and then
converted back to the unlinear format.

No current graphics application does this since loss-less convertion requires
32-bpp or float storage. Which means graphics history buffers grow by four
times (or more) and effectively makes realtime editing impossible. Since no-one
can fix the bug and since it's an advanced subject the traditional solution have
been to simply let ignorance reign (among both users and developers).

The simplest example of this common bug is when shrinking a 50% b/w raster. The
result is always level 127 (8-bpp) when it really should be level 186/174
(PC/Mac). Likewize, blending color <1,0,0> with <1,1,0> in povray results in
<1,0.5,0> when it really should be <1,0.73,0>/<1,0.68,0> (PC/Mac).

Unlike 99.999% of the graphics software out there Pov-Ray doesn't have history
buffers and already use floats everywhere. It also features an 8-bpp specific
bug...

The quick and dirty workaround is to use assumed_gamma = 1.0 and system_gamma
2.2. This will cause Pov-Ray to use gamma 1.0 internally. The problem is just
that all script colors are enterpreted as gamma 1.0 aswell and therefore must
be converted manually (no fun) and the Pov-Ray color includes are made useless.
Images behaves correct - aslong as they feature a color profile. So there's
severe drawbacks to this "fix".

If nothing else I've repeated the issue in a concise way so the post can be used
as reference in the future...


Post a reply to this message

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