POV-Ray : Newsgroups : povray.general : rgb color looks dark Server Time
4 Nov 2024 19:21:51 EST (-0500)
  rgb color looks dark (Message 1 to 10 of 13)  
Goto Latest 10 Messages Next 3 Messages >>>
From: mysdn
Subject: rgb color looks dark
Date: 11 Jul 2009 06:15:00
Message: <web.4a5865409e9a3ab0e4e47a1b0@news.povray.org>
Hi,

this line works
pigment { rgbf <146,218,164,>//255 filter 0.5 transmit 0.6}}

for transparent, glasslike objects.

But when I want solid colors defined by rgb values, actual color rendered is too
dark in comparison to what I see in Paint's color picker.

the code I use is this, I tried variations without success.

pigment {color rgb <146,218,164>/255}}

146,218,164 is alight green color, but it comes out as dark green.

Could you please tel me what is wrong? Thanks

PS: Last week I had it working, by adding /255 to the end but that is no good
now


Post a reply to this message

From: Christian Froeschlin
Subject: Re: rgb color looks dark
Date: 11 Jul 2009 07:18:38
Message: <4a58750e@news.povray.org>
mysdn wrote:

> this line works
> pigment { rgbf <146,218,164,>//255 filter 0.5 transmit 0.6}}

but it certainly looks a bit corrupted by itself.

> pigment {color rgb <146,218,164>/255}}
> 
> 146,218,164 is alight green color, but it comes out as dark green.

The end color of course also depends on lighting, so if you
wish to compare with ms paint you should probably set your
texture to use "finish {ambient 1 diffuse 0}".

Furthermore, there may be issues with gamma correction.


Post a reply to this message

From: mysdn
Subject: Re: rgb color looks dark
Date: 11 Jul 2009 08:15:00
Message: <web.4a588173fb16eafe4e47a1b0@news.povray.org>
Christian , thank you for your reply but there is nothing wrong with povray or
gamma values, something's wrong with this code
pigment {color rgb <146,218,164>/255}}

it just doesn't render the rgb color as it should. As I said I had it working
last week, So I know Povray can render rgb just as they look in ms paint color
picker. Why is it so hard to simply assign objects rgb colors in povray, thanks
a million?


Post a reply to this message

From: mysdn
Subject: Re: rgb color looks dark
Date: 11 Jul 2009 08:30:00
Message: <web.4a58857efb16eafe4e47a1b0@news.povray.org>
Christian Froeschlin <chr### [at] chrfrde> wrote:
> mysdn wrote:
>
> > this line works
> > pigment { rgbf <146,218,164,>//255 filter 0.5 transmit 0.6}}
>
> but it certainly looks a bit corrupted by itself.
>
> > pigment {color rgb <146,218,164>/255}}
> >
> > 146,218,164 is alight green color, but it comes out as dark green.
>
> The end color of course also depends on lighting, so if you
> wish to compare with ms paint you should probably set your
> texture to use "finish {ambient 1 diffuse 0}".
>
> Furthermore, there may be issues with gamma correction.


I got it,

pigment {color rgbf <146,218,164>/255} finish{phong 1 ambient 0.8}}

this works, I hope this is the correct way to do rgb colors in pov, thank you.


Post a reply to this message

From: clipka
Subject: Re: rgb color looks dark
Date: 11 Jul 2009 13:10:01
Message: <web.4a58c68cfb16eafe555c1690@news.povray.org>
"mysdn" <kam### [at] hotmailcom> wrote:
> But when I want solid colors defined by rgb values, actual color rendered is too
> dark in comparison to what I see in Paint's color picker.

This is a Gamma problem: Paint shows you the actual values stored in the image
file, which are typically gamma-corrected for a display gamma of ~2.2, while
POV-Ray works with linear color values.

You need to gamma-"un-correct" the values from Paint before using them in
POV-Ray; the following code should do the job:

  color rgb <pow(R/255,GAMMA),pow(G/255,GAMMA),pow(B/255,GAMMA)>

Don't know by heart whether you need to use GAMMA=2.2 or GAMMA=1/2.2 though.


Post a reply to this message

From: clipka
Subject: Re: rgb color looks dark
Date: 11 Jul 2009 13:15:00
Message: <web.4a58c86cfb16eafe555c1690@news.povray.org>
"mysdn" <kam### [at] hotmailcom> wrote:
> it just doesn't render the rgb color as it should. As I said I had it working
> last week, So I know Povray can render rgb just as they look in ms paint color
> picker.

I wouldn't bank on that. Maybe you changed the gamma handling in your scene, by
using assumed_gamma or changing Display_Gamma or the like?

Your code to set the object's color looks perfect, except for possible Gamma
issues, and - like someone already pointed out - maybe issues with the
(default) finish or lighting.


> Why is it so hard to simply assign objects rgb colors in povray, thanks
> a million?

Because simply assigning colors to an object is not a typical use-case in
POV-Ray these days; typically, you'll also want to set other material
properties such as specularity or the like.


Post a reply to this message

From: clipka
Subject: Re: rgb color looks dark
Date: 11 Jul 2009 13:25:00
Message: <web.4a58ca74fb16eafe555c1690@news.povray.org>
"mysdn" <kam### [at] hotmailcom> wrote:
> pigment {color rgbf <146,218,164>/255} finish{phong 1 ambient 0.8}}
>
> this works, I hope this is the correct way to do rgb colors in pov, thank you.

It's a bit... uncommon; but depending on what you want to do, it may indeed give
you what you want.

Typically, you'll use a much different finish, such as:

    finish { diffuse 0.7 specular 0.5 ambient 0.1 }

or something like that; in case of radiosity scenes, you'll virtually always use
ambient 0.

Note that you can define a default finish in your scene, using:

    default {
       finish { diffuse 0.7 specular 0.2 ambient 0.0 }
    }

(for instance) at scene level, before defining your objects.


Post a reply to this message

From: mysdn
Subject: Re: rgb color looks dark
Date: 11 Jul 2009 16:20:00
Message: <web.4a58f31bfb16eafe4e47a1b0@news.povray.org>
clipka, thank you for all the info, I'm impressed with the depth of details  you
provided. People like you make this whole thing more pleasurable.


Post a reply to this message

From: Alain
Subject: Re: rgb color looks dark
Date: 11 Jul 2009 22:17:09
Message: <4a5947a5$1@news.povray.org>

> Christian Froeschlin <chr### [at] chrfrde> wrote:
>> mysdn wrote:
>>
>>> this line works
>>> pigment { rgbf <146,218,164,>//255 filter 0.5 transmit 0.6}}
>> but it certainly looks a bit corrupted by itself.
>>
>>> pigment {color rgb <146,218,164>/255}}
>>>
>>> 146,218,164 is alight green color, but it comes out as dark green.
>> The end color of course also depends on lighting, so if you
>> wish to compare with ms paint you should probably set your
>> texture to use "finish {ambient 1 diffuse 0}".
>>
>> Furthermore, there may be issues with gamma correction.
> 
> 
> I got it,
> 
> pigment {color rgbf <146,218,164>/255} finish{phong 1 ambient 0.8}}
> 
> this works, I hope this is the correct way to do rgb colors in pov, thank you.
> 
> 
If there is NO light shining on your texture, it will look very dark 
with the default ambient of 0.1.
This is a glowing finish. If you use that in a radiosity scene, it will 
shed a light green light on everything around it.
It can easily get oversaturated if there is also a light shining on it. 
The default ambient is 0.6. With a light of intensity 1, it will combine 
with the ambient to potentialy give you a brightness of 0.6 + 0.8 = 1.4 
and a resulting colour of <146,218,164>/255 * 1.4
<0.5725, 0.8549, 0.6431>*1.4 = <0.8015, 1.1969, 0.9003> that get clipped 
to: <0.8015, 1.0000, 0.9003>
Not the same tint, the saturation is diminished.

Defining rgbf with a 3 component colour is legal if unusual. The filter 
value is then set to zero.
Defining a colour this way is also legal:

rgb<Red_value, Green_value, Blue_value, Filter_value, Transmit_value>

and the filter and transmit values WILL be used. (found that by accident)


Alain


Post a reply to this message

From: scott
Subject: Re: rgb color looks dark
Date: 13 Jul 2009 10:09:24
Message: <4a5b4014@news.povray.org>
> You need to gamma-"un-correct" the values from Paint before using them in
> POV-Ray; the following code should do the job:
>
>  color rgb <pow(R/255,GAMMA),pow(G/255,GAMMA),pow(B/255,GAMMA)>

Yes, you need to do this for any image files you use as textures too.

Check the attached image I made a while ago, the circles in the middle are 
RGB values chosen in PowerPoint, the top row of spheres is without the gamma 
correction trick, the bottom row is with the trick mentioned above.  Note 
that however much you try to adjust the lighting or shading in the top scene 
the colours will always be wrong because you have the wrong ratio of RGB 
values.


Post a reply to this message


Attachments:
Download 'comparison.png' (65 KB)

Preview of image 'comparison.png'
comparison.png


 

Goto Latest 10 Messages Next 3 Messages >>>

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