POV-Ray : Newsgroups : povray.general : rgb color looks dark Server Time
30 Jul 2024 10:16:03 EDT (-0400)
  rgb color looks dark (Message 4 to 13 of 13)  
<<< Previous 3 Messages Goto Initial 10 Messages
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


 

From: Warp
Subject: Re: rgb color looks dark
Date: 13 Jul 2009 10:13:29
Message: <4a5b4109@news.povray.org>
clipka <nomail@nomail> wrote:
> 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.

  Isn't assumed_gamma used for this exact purpose? AFAIK it makes the
correction to all colors used in the SDL.

-- 
                                                          - Warp


Post a reply to this message

From: scott
Subject: Re: rgb color looks dark
Date: 14 Jul 2009 06:17:13
Message: <4a5c5b29$1@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)>
>
>> Don't know by heart whether you need to use GAMMA=2.2 or GAMMA=1/2.2 
>> though.
>
>  Isn't assumed_gamma used for this exact purpose?

No.

> AFAIK it makes the
> correction to all colors used in the SDL.

Yes, it does gamma correction on the *output* image, but it makes no attempt 
to do the inverse of this on any input values you provide.  It assumes the 
values you type in are in linear colour space (ie <1,0.5,0> means the red 
channel is twice as bright as the green channel).  If you choose a value 
from Paint/PowerPoint/whatever, it is definitely not in linear colour space, 
so you need to do the correction clipka showed to get the colours in the 
output to match the input - check the image in my other post comparing 
PowerPoint colours to POV with and without the above correction, it's fairly 
obvious.


Post a reply to this message

From: clipka
Subject: Re: rgb color looks dark
Date: 14 Jul 2009 09:45:00
Message: <web.4a5c8b0bfb16eaf5fee4dc70@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
>   Isn't assumed_gamma used for this exact purpose? AFAIK it makes the
> correction to all colors used in the SDL.

Some things to consider about assumed_gamma:

- It affects all colors, not just those you picked from Paint.
- In POV 3.6, it affects even output colors (except in the preview, which is
governed by Display_Gamma).
- In POV 3.7, its use is deprecated, to be superseded by File_Gamma.


Post a reply to this message

<<< Previous 3 Messages Goto Initial 10 Messages

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