POV-Ray : Newsgroups : povray.newusers : Translate colors : Re: Translate colors Server Time
5 Sep 2024 06:16:16 EDT (-0400)
  Re: Translate colors  
From: Kari Kivisalo
Date: 15 Aug 2001 00:16:37
Message: <3B79F84E.CA6CAAC1@pp.htv.fi>
Kari Kivisalo wrote:
> 
> #macro G(Color)
>   #local DisplayGamma=2.2; //Display_Gamma from povray.ini
>   #local Gamma=DisplayGamma/AG;
>   <pow(Color.x,Gamma),pow(Color.y,Gamma),pow(Color.z,Gamma)>
> #end

Here is a demo that shows how G() preserves colors when assumed_gamma
is used. Without G() gamma correction is applied twice to the colors
so they loose saturation and contrast.

http://www.pp.htv.fi/kkivisal/gamma_colors.jpg

When you design a cool color layout in an image editor the colors
you are viewing are gamma corrected. When assumed_gamma (1) is
present povray applies gamma correction to the whole image and
also to your carefully selected colors (which were already corrected).
G() macro applies inverse correction which cancels the povray gamma
correction. Or, as I like to say, converts a color to linear space :)


_____________
Kari Kivisalo


Post a reply to this message

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