POV-Ray : Newsgroups : povray.unofficial.patches : post_process and gamma : post_process and gamma Server Time
6 Oct 2024 11:34:10 EDT (-0400)
  post_process and gamma  
From: Kari Kivisalo
Date: 16 Jul 2001 13:32:24
Message: <3B5325C9.89C5577E@pp.htv.fi>
Just a quick note if you haven't noticed. Gamma correction is
applied _before_ post_process in MP0.7. This kind of alters the
operation of all the post functions. Let's take invert for example
with 2.0 gamma.

original linear sample: 20%
after gamma:            45%
after invert:           55%

original linear sample: 20%
after invert:           80%
after gamma:            89%

It's fine if post is used like a filter in an image editor which
operates in perceptually uniform color space (2.2 gamma corrected).
One of the reasons for operating on corrected values is to minimise
the effects on quantisation errors. 8 bits is really the lowest
number of bits to present an acceptable quality image. Any oprations
done in 8 bits result in visible quantisation errors. When done in
linear space the biggest errors appear in the low intensity areas.
When done in corrected space the errors spread evenly among samples.

Because post_process (supposedly) operates on decimal samples there
is no reason to apply gamma before the operations because, for the
practical purposes, the quantisation errors won't be visible anyway.

Of course some people prefer post_process would work the same as
Photoshop for example because they are used to invert producing
"reverse gamma inverted" effect :)

I hope this is addressed in POV 3.5 if post_process is included.
The best solution would be a switch that selects the order of gamma
and post_process.


Here is Q & A from Poynton's gamma FAQ:

   21. Should I do image processing operations on 
       linear or nonlinear image data?

   If you wish to simulate the physical world,
   linear-light coding is necessary.


_____________
Kari Kivisalo


Post a reply to this message

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