POV-Ray : Newsgroups : povray.general : color to grey Server Time
7 May 2024 00:10:53 EDT (-0400)
  color to grey (Message 1 to 6 of 6)  
From: Bonsai
Subject: color to grey
Date: 30 Mar 2001 02:32:37
Message: <3ac43695$1@news.povray.org>
Hi,


groups:

How can I calculate the grey equivalent of a given rgb color?

Thanks,

Bonsai


Post a reply to this message

From: Christoph Hormann
Subject: Re: color to grey
Date: 30 Mar 2001 03:10:53
Message: <3AC43F8F.7E04CA5A@gmx.de>
Bonsai wrote:
> 
> Hi,
> 

> groups:
> 
> How can I calculate the grey equivalent of a given rgb color?
> 

It's a bit hidden in the following thread:

Subject: checkered passed
Date: Tue, 14 Nov 2000 23:57:07 -0500
From: "Rick Mabry" <rma### [at] softdiskcom>
Newsgroups: povray.general

Christoph

-- 
Christoph Hormann <chr### [at] gmxde>
IsoWood include, radiosity tutorial, TransSkin and other 
things on: http://www.schunter.etc.tu-bs.de/~chris/


Post a reply to this message

From: Chris Huff
Subject: Re: color to grey
Date: 31 Mar 2001 08:36:16
Message: <chrishuff-27BAFB.08361331032001@news.povray.org>
In article <3ac43695$1@news.povray.org>, "Bonsai" <bon### [at] b0n541net> 
wrote:


> groups:
> 
> How can I calculate the grey equivalent of a given rgb color?

Try this macro:
#macro Grayscale(Color)
    (0.297*Color.red + 0.589*Color.green + 0.114*Color.blue)
#end

This uses the same equation that POV uses internally.

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: Jan Walzer
Subject: Re: color to grey
Date: 1 Apr 2001 09:51:15
Message: <3ac73253@news.povray.org>
>     (0.297*Color.red + 0.589*Color.green + 0.114*Color.blue)
> This uses the same equation that POV uses internally.

Where does POV use a RGB2Grey computation do ?

--
background{rgb 1}camera{location<1,5,-2>look_at 0}#macro
m(a,b,i)#local d=(b-a)
/8;#local
e=vcross(d,y);#if(i)m(a-e,a+e+2*d,i-1)m(a+e,a+2*d-e,i-1)m(a+3*d-e,a+e
+3*d,i-1)m(a+3*d-e,a+5*d-e,i-1)m(a+6*d-e,a+e+6*d,i-1)m(a+8*d-e,a+e+8*d
,i-1)#else
cylinder{a,b,vlength(d)/3 pigment{rgb 0}}#end#end m(-4*x,2*x,4) // Jan
Walzer


Post a reply to this message

From: Christoph Hormann
Subject: Re: color to grey
Date: 1 Apr 2001 10:19:15
Message: <3AC738E2.DE13F165@gmx.de>
Jan Walzer wrote:
> 
> Where does POV use a RGB2Grey computation do ?
> 

pigment_pattern and displace warp for example.

Christoph

-- 
Christoph Hormann <chr### [at] gmxde>
IsoWood include, radiosity tutorial, TransSkin and other 
things on: http://www.schunter.etc.tu-bs.de/~chris/


Post a reply to this message

From: Chris Huff
Subject: Re: color to grey
Date: 1 Apr 2001 10:24:44
Message: <chrishuff-E9AF27.09243401042001@news.povray.org>
In article <3ac73253@news.povray.org>, "Jan Walzer" <jan### [at] lzernet> 
wrote:

> >     (0.297*Color.red + 0.589*Color.green + 0.114*Color.blue)
> > This uses the same equation that POV uses internally.
> 
> Where does POV use a RGB2Grey computation do ?

MegaPOV has a GRAYSCALE() macro in colour.h. I think this replaces the 
use of many separate equations, sometimes completely different ones, in 
the official version.
MegaPOV uses it for image_pattern, pigment functions, and a few other 
things. It may be used as an estimate of the brightness of the color in 
some places.

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

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