POV-Ray : Newsgroups : povray.binaries.images : Stock colors and assumed_gamma 1 in POV-Ray 3.6 : Re: Stock colors and assumed_gamma 1 in POV-Ray 3.6 Server Time
18 May 2024 11:32:09 EDT (-0400)
  Re: Stock colors and assumed_gamma 1 in POV-Ray 3.6  
From: Ive
Date: 27 Oct 2020 17:35:51
Message: <5f9892b7$1@news.povray.org>
Am 10/18/2020 um 23:22 schrieb Bald Eagle:
> 
> The new tone-adjusting formulas are:
> 
> #declare SRGB_Encode = function (C, M) {
>   select (C-0.0031308, C*12.92*M, C*12.92*M, (1.055 * pow (C, 1/2.4) - 0.055)*M)
> }
> 
> #declare SRGB_Decode = function (C, M) {
>   select (C-0.040449936, C/12.92, pow ((C+0.055)/1.055, 2.4)*M)
> }
> 
> using M as a multiplier.  Looks like it works correctly
 >


Nope. Both functions are wrong far all M <> 1.0!

If you do not already see this by looking at the formulas just check it: 
Use SRGB_Encode for any value of C and then the result for SRGB_Decode. 
This should give the original value of C.


The correct functions would be

#declare SRGB_Encode = function (C, M) {
  select (C*M-0.0031308, C*12.92*M, C*12.92*M, (1.055 * pow (C*M, 1/2.4) 
- 0.055))
}

#declare SRGB_Decode = function (C, M) {
  select (C-0.040449936, C/12.92, pow ((C+0.055)/1.055, 2.4))*M
}


It worries me for this NG that stuff like this stays uncorrected for 
over 10 days.

-Ive


Post a reply to this message

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