POV-Ray : Newsgroups : povray.binaries.images : Gamma tests Server Time
8 Aug 2024 01:17:17 EDT (-0400)
  Gamma tests (Message 9 to 18 of 18)  
<<< Previous 8 Messages Goto Initial 10 Messages
From: Bruno Cabasson
Subject: Re: Gamma tests
Date: 12 Dec 2005 05:15:01
Message: <web.439d4d0b51e1e6ef5fba6ef0@news.povray.org>
Hello POV-folks!

My understanding about gamma is now the following (I made an unforgivable
mistake in my entry for last IRTC entry ... shame on me): if your monitor
is calibrated (ie the operating system compensates your monitor's weakness
on low grays by applying color correction using an appropritate color
profile, typically the most used sRGB color profile) then your system can
be considered as linear, with an overall gamma of 1.0. IS THIS TRUE? If so,
this means that if a pixel has 10% gray value, then your monitor displays
10% of brightness, whatever the file format used.

I guess that ALL not-too-old systems perform this correction. So, according
to me, I would rather agree with Tim, and POV scenes should be designed for
linear display and linear values in output files. This means, if I am not
too wrong, that either both assumed_gamma and Display_Gamma should have the
same value (typically 2.2) or no "assumed_gamma" directive should be in the
code.

The POV documentation recommends a value of 1.0 for assumed_gamma: So I
would say that Display_Gamma should also be set to 1.0. Otherwise the
images would appear too bright (for example the shadowed area (defaulted to
10% of brightness).

       Bruno


Post a reply to this message

From: Tim Nikias
Subject: Re: Gamma tests
Date: 12 Dec 2005 10:10:01
Message: <439d92c9@news.povray.org>
> I guess that ALL not-too-old systems perform this correction. So,
according
> to me, I would rather agree with Tim, and POV scenes should be designed
for
> linear display and linear values in output files. This means, if I am not
> too wrong, that either both assumed_gamma and Display_Gamma should have
the
> same value (typically 2.2) or no "assumed_gamma" directive should be in
the
> code.

I think you misunderstood me, I don't think that Display_Gamma and
assumed_gamma should be the same, it's just that when they are the same, the
input images look like I expect them: no gamma correction applied.

I'm not too sure about how displays handle gamma, if they adjust the input
etc. I don't think mine does, but I've yet to read a little about this
mentioned "sRGB"...

What I've done in the past, because that's what POV-Ray's docs say, is to
set assumed_gamma to 1.0. Then, Display_Gamma 2.2 is used to adjust the
final image for the display (which has a gamma of 2.2 in my case, tested
with the image supplied in the docs as well). That's what's in the docs.
Of course, if your monitor "calibrates colors to linear space", you'd have
to set Display_Gamma to 1.0, not 2.2.

My macro simply applies the inverse gamma correction, so that after
POV-Ray's gamma correction, the image input looks like the output. To
achieve that, the gamma given to the macro has to be the same as
Display_Gamma and assumed_gamma should be 1.0. Of course the macro can be
used for other gamma-corrections as well.

(I'm actually thinking about doing some more stuff with functions and
images, to create some sort of simple compositing-script. I tend to be a
little geeky and nerdy about creating my animations/images with pure POV-Ray
(or at least, with some sort of script), cause I like to be sure that I can
reproduce it *exactly* at a later date. :-) )

Regards,
Tim

-- 
aka "Tim Nikias v2.0"
Homepage: <http://www.nolights.de>


Post a reply to this message

From: Kenneth
Subject: Re: Gamma tests
Date: 13 Dec 2005 02:15:01
Message: <web.439e73e051e1e6e83bb86110@news.povray.org>
"Tim Nikias" <JUSTTHELOWERCASE:timISNOTnikias(at)gmx.netWARE> wrote:
> (see thread "using assumed_gamma of 1.0... a discussion", located here:
>
http://news.povray.org/povray.general/thread/%3Cweb.439a1b692d1f46002a1c213f0%40news.povray.org%3E/)
>
> Anyways. My experience is this: I have a nice image_map, I follow the docs
> and supply assumed_gamma of 1.0 and have Display_Gamma properly set to 2.2,
> and what happens? The image_maps turn out brighter than their source. Why?
> Due to the internal gamma correction of POV-Ray.
> Personally, I'd like an image-map to look like it's source when its lit with
> 100% white light (e.g. by applying finish{ambient 1 diffuse 0}), but the
> gamma-correction prevents that.

That's exactly what I've been seeing as well.  Which is really the main
reason I
haven't (yet) gone over to using assumed_gamma of 1.0

There seems to be a kind of "either/or" situation in POV, from my own point
of view: Either use assumed_gamma of 1 so that POV can work internally in
an "undistorted" linear color space...in which case an "unprocessed,"
normal .png or .bmp image_map will look too bright...OR use an
assumed_gamma that matches display_gamma (and monitor/OS gamma)..2.2 in
your case...so that the image map will reproduce exactly as it is supposed
to look...but then, apparently, POV itself is no longer working in an ideal
color space.  That's just...weird!

My own solution to the image_map problem (which I've posted elsewhere, if
less succinctly): IF using an assumed_gamma of 1, first bring the .png
image_map image into a graphics program (like Photoshop, or GIMP, or of
course your own gamma macro) where you can re-save the image with a
gamma (gamma correction?) of 1.0 embedded into it.  Only then
will the image_map
render correctly in POV!  This doesn't work with .bmp images (or, for that
matter, any other kind that doesn't support embedded gamma info.)

In reading all the responses so far to my own original post (which you
referenced), I'm coming around to the idea that using an assumed_gamma of
1.0 is, in fact, correct.

But I find this either/or situation to be MOST perplexing!!!

Ken


Post a reply to this message

From: Kenneth
Subject: Re: Gamma tests
Date: 13 Dec 2005 03:25:01
Message: <web.439e83c351e1e6e83bb86110@news.povray.org>
"Tim Nikias" <JUSTTHELOWERCASE:timISNOTnikias(at)gmx.netWARE> wrote:

......BUT, in figuring out my own solution, I hadn't  considered the problems
you mentioned...

> The lower right is the uncorrected PNG version of the image. PNG comes with
> internal gamma values, and POV-Ray makes proper use of them. The problem
> lies within the usual floating point (in-)accuracy. If you take a closer
> look at the ocean's horizon, you'll notice color-banding and
> color-clipping-like effects.

Are these artifacts in your original .png image, or in the POV render of it?
I'll have to scrutinize my own .png's, to see if I detect
this.

BTW, your original photo is beautiful!

Ken


Post a reply to this message

From: Tim Nikias
Subject: Re: Gamma tests
Date: 13 Dec 2005 09:04:01
Message: <439ed4d1$1@news.povray.org>
> Are these artifacts in your original .png image, or in the POV render of
it?
> I'll have to scrutinize my own .png's, to see if I detect
> this.

It's just the POV render, you can see on the other parts of the image that
the color-banding isn't in the photo itself.

> BTW, your original photo is beautiful!

Thanks, but it's not mine. Someone posted a link to it on off-topic, and
because of the various colors and such it's a nice testing image.

Regards,
Tim

-- 
aka "Tim Nikias v2.0"
Homepage: <http://www.nolights.de>


Post a reply to this message

From: Kenneth
Subject: Re: Gamma tests
Date: 13 Dec 2005 15:10:00
Message: <web.439f29c451e1e6ea36bd2010@news.povray.org>
"Tim Nikias" <JUSTTHELOWERCASE:timISNOTnikias(at)gmx.netWARE> wrote:

>
> It's just the POV render, you can see on the other parts of the image that
> the color-banding isn't in the photo itself.
>
Sorry; having trouble seeing that, at the resolution of your posted image.
Post a larger version, perhaps?

BTW, I went snooping back through older posts and found one with similar
arguments for having to reprocesss image_map images to alter the gamma to
1.0...

http://news.povray.org/povray.general/thread/%3Cvp9bd1p330mntk3k9dhlfch4csv2215j12%404ax.com%3E/?ttop=221530&toff=200&m
top=219340

Ken


Post a reply to this message

From: Tim Nikias
Subject: Re: Gamma tests
Date: 13 Dec 2005 21:53:52
Message: <439f8940@news.povray.org>
> Sorry; having trouble seeing that, at the resolution of your posted image.
> Post a larger version, perhaps?

Here are two images, the one without banding was made with a BMP, the other
with PNG. You might want to zoom in on the shoreline with a paint program.

Regards,
Tim

-- 
aka "Tim Nikias v2.0"
Homepage: <http://www.nolights.de>


Post a reply to this message


Attachments:
Download 'gamma_test_png.jpg' (112 KB) Download 'gamma_test_bmp.jpg' (103 KB)

Preview of image 'gamma_test_png.jpg'
gamma_test_png.jpg

Preview of image 'gamma_test_bmp.jpg'
gamma_test_bmp.jpg


 

From: Kenneth
Subject: Re: Gamma tests
Date: 19 Dec 2005 03:15:01
Message: <web.43a66ac651e1e6ed6fdca530@news.povray.org>
"Tim Nikias" <JUSTTHELOWERCASE:timISNOTnikias(at)gmx.netWARE> wrote:
> > Sorry; having trouble seeing that, at the resolution of your posted image.
> > Post a larger version, perhaps?
>
> Here are two images, the one without banding was made with a BMP, the other
> with PNG. You might want to zoom in on the shoreline with a paint program.
>

Thanks. This is weird: I thought I would be looking for some kind of subtle
effect--but the banding your talking about really jumped out , once I
brought your image up in Photoshop and brightened it. Talk about not seeing
the forest for the trees! :-) If what I'm seeing is what you're talking
about, it looks like the (millions-of-colors?) render has somehow been
down-sampled to 256 colors or less. The effect looks just like a
digital-camera .jpeg image that I "reduced" to a .gif, to see what would
happen. Is it possible that your POV .png render is in a "reduced" color
pallette? Very odd. BTW, I couldn't duplicate your image's strange
appearance by changing my .jpeg to a .png, not even by invoking all the
"special" .png settings available in Photoshop. It still looked correct.

Ken


Post a reply to this message

From: Tim Nikias
Subject: Re: Gamma tests
Date: 19 Dec 2005 06:34:12
Message: <43a69ab4$1@news.povray.org>
>Is it possible that your POV .png render is in a "reduced" color
> pallette? Very odd.

Nope, it's 24bit, just like the BMP.

> BTW, I couldn't duplicate your image's strange
> appearance by changing my .jpeg to a .png, not even by invoking all the
> "special" .png settings available in Photoshop. It still looked correct.

What do you mean with "special" settings? With your post in mind, I went and
checked my PNG, but somehow, I've got no paint-application (using Paint Shop
Pro 7 and XnView) to find the included gamma in my PNG. Nontheless, the
image gets gamma-corrected and I end up with banding. Though I can't find
the actual source for this problem (only guessing that its probably
calculating precision), it's reason enough not to use PNG, at least for the
moment.

-- 
aka "Tim Nikias v2.0"
Homepage: <http://www.nolights.de>


Post a reply to this message

From: Tim Nikias
Subject: Re: Gamma tests
Date: 19 Dec 2005 06:49:01
Message: <43a69e2d$1@news.povray.org>
Here's a site that might be of interest:

http://www.w3.org/Graphics/PNG/all_seven.html

I've downloaded the 5 PNG images and rendered them in POV-Ray (without the
use of my macro, I might add). The result seems to indicate that POV-Ray
doesn't perform gamma-correction of the images, as I get what the page
describes: a set of images getting darker. OTOH, I wonder why the other PNG
I derived from a BMP using Paint Shop Pro 7 gets darker. The color-banding
is described on the page as well (precision issues). I'm slightly confused
now... Does POV-Ray perform a "standard" gamma-correction on PNG, or based
on the gamma-value in the PNG, or what? Does anyone know (maybe because he
has insight in the source)?

Regards,
Tim

-- 
aka "Tim Nikias v2.0"
Homepage: <http://www.nolights.de>


Post a reply to this message

<<< Previous 8 Messages Goto Initial 10 Messages

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