POV-Ray : Newsgroups : povray.newusers : color of image map in POVray image Server Time
30 Jul 2024 06:19:11 EDT (-0400)
  color of image map in POVray image (Message 3 to 12 of 12)  
<<< Previous 2 Messages Goto Initial 10 Messages
From: Christoph Hormann
Subject: Re: color of image map in POVray image
Date: 25 Nov 2004 17:40:02
Message: <co5mtt$l4l$1@chho.imagico.de>
Slime wrote:
>>I noticed when I use an image map in POVray, that the colors in the
>>resulting image differ from the original.
> 
> The only time I've ever experienced this is when using PNG files. In this
> case, gamma correction is causing the color changes. This can be fixed by
> adding
> 
> global_settings {
> assumed_gamma 1
> }
> 
> so that gamma correction has no effect.

Sorry but this is nonsense.  The above will apply normal gamma correction.

If you experience unexpected colors in image maps you have to remember 
that POV-Ray does not invert gamma correction in images so you should 
use not gamma corrected, linear images for image maps.

The only special thing about PNG images is that they can store gamma 
correction information.  Some programs (including POV-Ray) read and 
apply this information when present.

Christoph

-- 
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 23 Sep. 2004 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Slime
Subject: Re: color of image map in POVray image
Date: 25 Nov 2004 22:12:56
Message: <41a69f38@news.povray.org>
> Sorry but this is nonsense.  The above will apply normal gamma correction.

Well, I'm not sure exactly what's going on internally. All I know is that
when I don't have the assumed_gamma line, my PNG images are darker then
they're supposed to be in POV-Ray. Maybe this is because gamma correction
*isn't* being applied, or something - I don't know. All I know is that PNG
images are the only image format I use that have gamma correction
information stored in them, and they're the only type of images that give
wrong results when I don't have that line. So I assume that the problem is
caused, one way or another, by gamma correction doing what I don't want it
to do, and when I add that line (it's supposed to be there anyway I
believe), the problem goes away.

Also notice that I said "so that gamma correction has no effect," not "so
that there is no gamma correction." I realize that gamma correction is still
taking place, it's just that this way it produces the desired results. I
wasn't implying that POV-Ray is doing anything wrong. Maybe it's photoshop's
fault (when it saves the image). I assume it's *my* fault because I'm not
telling POV-Ray what the assumed gamma of my scene is.

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

From: Christoph Hormann
Subject: Re: color of image map in POVray image
Date: 26 Nov 2004 03:55:01
Message: <co6r0a$22o$1@chho.imagico.de>
Slime wrote:
> 
> Also notice that I said "so that gamma correction has no effect," not "so
> that there is no gamma correction." I realize that gamma correction is still
> taking place, it's just that this way it produces the desired results.

Without an assumed_gamma line POV-Ray does not apply any gamma 
correction to the render.  But all this has nothing to do with the use 
of image maps in POV-Ray.

What might lead to confusion is that POV-Ray applies gamma information 
stored in images when they are used in image maps which other programs 
don't do.

Christoph

-- 
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 23 Sep. 2004 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: William Pokorny
Subject: Re: color of image map in POVray image
Date: 26 Nov 2004 09:15:35
Message: <41a73a87@news.povray.org>
Not sure. Suppose you might see some shift with certain default or explicit
finishes.

What happens if you change the finish for the object with the image map
applied to { ambient 1.0 diffuse 0.0 } ?  Do you still see a color shift?

Are you looking at the original image and ray traced image on the same
computer monitor?

"Brigitte" <nomail@nomail> wrote in message
news:web.41a64323cc213c51cfb58d550@news.povray.org...
> I noticed when I use an image map in POVray, that the colors in the
> resulting image differ from the original. I understand that the brightness
> may differ, due to lighting conditions, but I would expect that the
> proportion of red/green/blue stays the same.
> However, the resulting image contains less red.
> I am using white light and no special atmospheric conditions. What could
be
> the cause of this ?
>
>
>


Post a reply to this message

From: Brigitte
Subject: Re: color of image map in POVray image
Date: 27 Nov 2004 06:55:01
Message: <web.41a86a36440eb84e2a7121890@news.povray.org>
"William Pokorny" <pokorny_at_epix.net> wrote:
> Not sure. Suppose you might see some shift with certain default or explicit
> finishes.
>
> What happens if you change the finish for the object with the image map
> applied to { ambient 1.0 diffuse 0.0 } ?  Do you still see a color shift?

I've now used an image map (jpeg image) that contains one single color
rgb<94/255,46/255,51/255>
If I apply no lighting, and finish{ambient 1.0 diffuse 0.0},
the resulting color is rgb<162/255,115/255,122/255>, so it's a lot brighter
than the original.

I've also tried to find a value for ambient where the brightness is more or
less the same as in the original image
finish{ambient 0.3 diffuse 0.0} gives a color rgb<93/255,67/255,70/255> so
inexplicably the result contains proportionally less red.

>
> Are you looking at the original image and ray traced image on the same
> computer monitor?
>
I have measured the colors both of the original image and the POV ray result
using paint shop pro, and I am watching them on the same monitor ...


Post a reply to this message

From: Christoph Hormann
Subject: Re: color of image map in POVray image
Date: 27 Nov 2004 09:40:18
Message: <coa3g4$d45$1@chho.imagico.de>
Brigitte wrote:
> 
> I've now used an image map (jpeg image) that contains one single color
> rgb<94/255,46/255,51/255>
> If I apply no lighting, and finish{ambient 1.0 diffuse 0.0},
> the resulting color is rgb<162/255,115/255,122/255>, so it's a lot brighter
> than the original.

Did you read what i wrote?  This is perfectly normal and intended 
behaviour.  POV-Ray applies gamma correction to the rendered image 
according to the display_gamma setting (which is usually 2.2 on PC 
Windows/Linux) if an assumed_gamma statement is present in the scene. 
This is explained in detail in the docs.  Your numbers comply with this 
since

(94/255)^(1/2.2) = (162/255)

For image maps you therefore have to use images without gamma correction 
(i.e. linear images).  If your image is gamma corrected (like when you 
get it from the web or a (cheap) digital camera) use the gamma 
correction function of your imaging program for this.

Christoph

-- 
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 23 Sep. 2004 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: William Pokorny
Subject: Re: color of image map in POVray image
Date: 27 Nov 2004 12:54:25
Message: <41a8bf51$1@news.povray.org>
Cool. So we can be reasonably sure Brigitte's scene file has an
assumed_gamma statement other than 1.0 or that her image_map jpg specifies a
gamma correction. I was under the impression jpg files do not store gamma
correction information. If true when Brigitte correctly sets the
display_gamma and assumed_gamma to 1.0 she will see the proper color for her
image mapped object.

Is it still true many of the older textures shipped with POV-Ray will then
not be properly corrected for display because they expect an assumed gamma
of something like 2.2?

The documentation mentioned can be found at:
http://www.povray.org/documentation/view/3.6.1/218/

Bill

"Christoph Hormann" <chr### [at] gmxde> wrote in message
news:coa3g4$d45$1@chho.imagico.de...
>
> Did you read what i wrote?  This is perfectly normal and intended
> behaviour.  POV-Ray applies gamma correction to the rendered image
> according to the display_gamma setting (which is usually 2.2 on PC
> Windows/Linux) if an assumed_gamma statement is present in the scene.
> This is explained in detail in the docs.  Your numbers comply with this
> since
>
> (94/255)^(1/2.2) = (162/255)
>
> For image maps you therefore have to use images without gamma correction
> (i.e. linear images).  If your image is gamma corrected (like when you
> get it from the web or a (cheap) digital camera) use the gamma
> correction function of your imaging program for this.
>
> Christoph
>
> -- 
> POV-Ray tutorials, include files, Sim-POV,
> HCR-Edit and more: http://www.tu-bs.de/~y0013390/
> Last updated 23 Sep. 2004 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: ingo
Subject: Re: color of image map in POVray image
Date: 27 Nov 2004 14:18:08
Message: <Xns95AECE85E992Eseed7@news.povray.org>
in news:41a8bf51$1@news.povray.org William Pokorny wrote:

> Cool. So we can be reasonably sure Brigitte's scene file has an
> assumed_gamma statement other than 1.0 or that her image_map jpg
> specifies a gamma correction. [...]

No.

If an image looks fine in an imageviewer on a 'gamma 2.2' monitor, you 
can be sure that a gamma correction is applied to it. An image with a 
gamma of 1 would look dark on that monitor.

Now if we take that gamma 2.2 image and use it as an imagemap in POV-Ray 
it will look to bright if the scene is rendered to a gamma of 2.2. The 
gamma correction is now applied twice to the initial image. If the scene 
were renderd to a linear gamma, the image map would look right. Brigitte 
can try this by removing the line 'assumed_gamma = 1' from her scene.

To use images for imagemaps, you have to convert them to a linear gamma 
(gamma=1).


Ingo


Post a reply to this message

From: William Pokorny
Subject: Re: color of image map in POVray image
Date: 27 Nov 2004 18:00:12
Message: <41a906fc$1@news.povray.org>
OK. Let me try again to get my mind around this.

- the gamma isn't stored as part of most images except png.
- when you talk about gamma correction being already applied to the image,
what you are essentially saying is that the image has been adjusted to
display properly on a 'gamma 2.2' display system  - not that the gamma is
stored with the image file itself.  (My failing this time around is here. I
have been for a long time taking images as "linear images" because there is
no gamma information stored as part of the image)
- the POV-Ray recommendation for all of us is to use assumed_gamma of 1.0
for reasons both internal to the POV-Ray engine and for distribution of
source code to others.
- Using an assumed_gamma of 1.0 will brighten any image used as an image map
set up to display correctly on any system where the true display gamma is >
1.0 and the display gamma is either defaulted or set to the true gamma of
the display system where POV-Ray is run.
- These implications apply to all color maps, and pigment maps that were
derived from images that looked good on  display systems with a gamma > 1.0.
- The most general solution is then to convert all mapped color information
so it will display correctly on a display system with a gamma of 1.0 (what I
understand now Christoph was suggesting), set the display_gamma correctly
for every system and use an assumed_gamma setting of 1.0.
- Many of the default textures supplied with POV-Ray have NOT been modified
to display correctly if using and assumed_gamma of 1.0 and the correct
display_gamma as recommended. Is there a reason the developers could not
supply an updated set of textures either as part of the standard package or
as an adjunct package?

Do I have this right or am I still confused?
Bill

"ingo" <ing### [at] tagpovrayorg> wrote in message
news:Xns95AECE85E992Eseed7@news.povray.org...
> in news:41a8bf51$1@news.povray.org William Pokorny wrote:
>
> > Cool. So we can be reasonably sure Brigitte's scene file has an
> > assumed_gamma statement other than 1.0 or that her image_map jpg
> > specifies a gamma correction. [...]
>
> No.
>
> If an image looks fine in an imageviewer on a 'gamma 2.2' monitor, you
> can be sure that a gamma correction is applied to it. An image with a
> gamma of 1 would look dark on that monitor.
>
> Now if we take that gamma 2.2 image and use it as an imagemap in POV-Ray
> it will look to bright if the scene is rendered to a gamma of 2.2. The
> gamma correction is now applied twice to the initial image. If the scene
> were renderd to a linear gamma, the image map would look right. Brigitte
> can try this by removing the line 'assumed_gamma = 1' from her scene.
>
> To use images for imagemaps, you have to convert them to a linear gamma
> (gamma=1).
>
>
> Ingo


Post a reply to this message

From: ingo
Subject: Re: color of image map in POVray image
Date: 28 Nov 2004 03:39:21
Message: <Xns95AF62394D89Dseed7@news.povray.org>
in news:41a906fc$1@news.povray.org William Pokorny wrote:

> - the gamma isn't stored as part of most images except png.

Yes

> - when you talk about gamma correction being already applied to the
> image, what you are essentially saying is that the image has been
> adjusted to display properly on a 'gamma 2.2' display system  - not
> that the gamma is stored with the image file itself.

Yes

> [...] the POV-Ray recommendation for all of us is to
> use assumed_gamma of 1.0 for reasons both internal to the POV-Ray
> engine and for distribution of source code to others.

Yes

> - Using an assumed_gamma of 1.0 will brighten any image used as an
> image map set up to display correctly on any system where the true
> display gamma is > 1.0 and the display gamma is either defaulted or
> set to the true gamma of the display system where POV-Ray is run.

Assumed gamma is just a factor. The essential part of the gamma 
correction is the Display_Gamma setting (defaults to 2.2 in POVwin). For 
what assumed_gamma does exactly check doc-section "3.3.3.3  
Assumed_Gamma"

> - These implications apply to all color maps, and pigment maps that
> were derived from images that looked good on  display systems with a
> gamma > 1.0.

Yes

> - The most general solution is then to convert all
> mapped color information so it will display correctly on a display
> system with a gamma of 1.0 (what I understand now Christoph was
> suggesting), set the display_gamma correctly for every system and use
> an assumed_gamma setting of 1.0.

Yes. Kari Kivisalo once posted an equation for such corrections, but I 
cant find it anymore.

> - Many of the default textures
> supplied with POV-Ray have NOT been modified to display correctly if
> using and assumed_gamma of 1.0 and the correct display_gamma as
> recommended. Is there a reason the developers could not supply an
> updated set of textures either as part of the standard package or as
> an adjunct package? 

I guess so, yes.


On a side note: If you use POV-Ray to render images for use as 
hightfields in another scene, you should render to a gamma of 1, so 
comment out the 'assumed_gamma' line.


Ingo


Post a reply to this message

<<< Previous 2 Messages Goto Initial 10 Messages

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