POV-Ray : Newsgroups : povray.general : checkered passed : Re: checkered passed Server Time
8 Aug 2024 22:12:10 EDT (-0400)
  Re: checkered passed  
From: Geoff Wedig
Date: 20 Nov 2000 08:15:28
Message: <3a1923f0@news.povray.org>
Peter J. Holzer <hjp### [at] sikituwsracat> wrote:

> On Fri, 17 Nov 2000 18:40:42 -0500, Chris Huff wrote:
>>In article <chrishuff-9268FA.17205617112000@news.povray.org>, Chris 
>>Huff <chr### [at] maccom> wrote:
>>
>>> I'm not sure which conversion is used... I will check this out later...
>>
>>The GREY_SCALE() macro is used, which uses the function:
>>Gray = 0.297*R + 0.589*G + 0.114*B
>>I have changed this to use (R+G+B)/3 in my version.

> For pure grayscale values (R==G==B) the results are identical.

> E.g.: 

> 0.33*0.297 + 0.33*0.589 + 0.33*0.114 == 0.33
> (0.33+0.33+0.33)/3 = 0.33

This is because the coefficients sum to 1.  Any set of coefficients that sum
to 1 will work if you're using the same value for R, G, and B.  It's when
they're not that you need something else.  Consider colors <1,1,0> and
<1,0,1>  By 1/3rds these are the same grey (.667), but by the GREY_SCALE()
macro, they're not.  I prefer the latter, because Yellow (the first color)
and Magenta (the second) aren't quite the same in Grey (Yellow is brighter. 
This is because of how our eyes perceive colors and light)

I'm assuming the values of the macro were chosen based on some real world
testing, but I could be wrong.  In any case, they give good results.

Geoff


Post a reply to this message

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