POV-Ray : Newsgroups : povray.programming : factors for rgb2grey conversion Server Time
23 Dec 2024 11:05:12 EST (-0500)
  factors for rgb2grey conversion (Message 1 to 6 of 6)  
From: ABX
Subject: factors for rgb2grey conversion
Date: 10 Oct 2002 13:08:04
Message: <5bcbqu4k6jmj2r9ed1ljj8jrm6962jjp3t@4ax.com>
Would you like to give me values for 'correct/best' conversion from rgb to
grey value without looking into POV sources ? I have found at least 3
different versions of this conversion in POV sources and searching Internet I
found even different. I have connected in PoPOV all occurences of such
conversion into one define. Not convertable cases I have connected with unique
constants. Now I'm not sure they use correct values...

ABX


Post a reply to this message

From: Vahur Krouverk
Subject: Re: factors for rgb2grey conversion
Date: 10 Oct 2002 13:39:40
Message: <3DA5BC36.9030706@starman.ee>
ABX wrote:
> Would you like to give me values for 'correct/best' conversion from rgb to
> grey value without looking into POV sources ? I have found at least 3
> different versions of this conversion in POV sources and searching Internet I
> found even different. I have connected in PoPOV all occurences of such
> conversion into one define. Not convertable cases I have connected with unique
> constants. Now I'm not sure they use correct values...
> 
> ABX

There is no 'correct' conversion. But YIQ model, which is probably most 
used, uses values 0.299, 0.587, 0.114, which  are pretty close to 
GREY_SCALE macro. I think that best would be to go with these values. 
Strange value 0.229 in image.cpp is probably typo.
For definitive information check out colorspace faq:
http://www.faqs.org/faqs/graphics/colorspace-faq/


Post a reply to this message

From: ABX
Subject: Re: factors for rgb2grey conversion
Date: 11 Oct 2002 02:49:32
Message: <ucscqusm5ol0l24tvf5o41t0b3kiuhem7i@4ax.com>
On Thu, 10 Oct 2002 20:43:18 +0300, Vahur Krouverk <vkr### [at] starmanee>
wrote:
> There is no 'correct' conversion. But YIQ model, which is probably most 
> used, uses values 0.299, 0.587, 0.114, which  are pretty close to 
> GREY_SCALE macro. I think that best would be to go with these values. 
> Strange value 0.229 in image.cpp is probably typo.
> For definitive information check out colorspace faq:
> http://www.faqs.org/faqs/graphics/colorspace-faq/

fncode.cpp : 0.297,0.589,0.114
image.cpp  : 0.229,0.587,0.114
targa.cpp  : 0.30 ,0.59 ,0.11
libsdl     : 0.299,0.687,0.114 as you suggested

Not a big difference but could be nice to hold unique values in whole package.
I included such modification in PoPOV.

ABX


Post a reply to this message

From: Peter Popov
Subject: Re: factors for rgb2grey conversion
Date: 11 Oct 2002 03:21:55
Message: <mvucqu8062a9o6mb0ui87t30t8dfhrvba1@4ax.com>
On Fri, 11 Oct 2002 08:47:11 +0200, ABX <abx### [at] abxartpl> wrote:

>I included such modification in PoPOV.
                                 ^^^^^^

I like the name of your project :)


Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] vipbg
TAG      e-mail : pet### [at] tagpovrayorg


Post a reply to this message

From: Philippe Lhoste
Subject: Re: factors for rgb2grey conversion
Date: 11 Oct 2002 05:20:30
Message: <Xns92A4732257D3EPhiLho@204.213.191.226>
> There is no 'correct' conversion. But YIQ model, which is probably
> most used, uses values 0.299, 0.587, 0.114, which  are pretty close to
> GREY_SCALE macro. I think that best would be to go with these values. 
> Strange value 0.229 in image.cpp is probably typo.
> For definitive information check out colorspace faq:
> http://www.faqs.org/faqs/graphics/colorspace-faq/

Interesting link. The "Colour Space Conversions" link is broken.
Going up, I found a link to http://www.inforamp.net/~poynton/ which seems 
interesting, with a gamma and a color FAQ in various formats.

-- 
--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--
Philippe Lhoste (Paris -- France)
Professional programmer and amateur artist
http://jove.prohosting.com/~philho/


Post a reply to this message

From: Vahur Krouverk
Subject: Re: factors for rgb2grey conversion
Date: 11 Oct 2002 15:01:43
Message: <3DA720F3.2020108@starman.ee>
ABX wrote:
> On Thu, 10 Oct 2002 20:43:18 +0300, Vahur Krouverk <vkr### [at] starmanee>
> wrote:
> 
>>There is no 'correct' conversion. But YIQ model, which is probably most 
>>used, uses values 0.299, 0.587, 0.114, which  are pretty close to 
>>GREY_SCALE macro. I think that best would be to go with these values. 
>>Strange value 0.229 in image.cpp is probably typo.
>>For definitive information check out colorspace faq:
>>http://www.faqs.org/faqs/graphics/colorspace-faq/
> 
> 
> fncode.cpp : 0.297,0.589,0.114
> image.cpp  : 0.229,0.587,0.114
> targa.cpp  : 0.30 ,0.59 ,0.11
> libsdl     : 0.299,0.687,0.114 as you suggested
                        ^- 6 or 5?
Last seems to conform YIQ model (if you really meant 0.587), image.cpp 
is probably typo (sum should be 1!), other are a little bit off (but I 
doubt that someone would notice difference).


Post a reply to this message

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