POV-Ray : Newsgroups : povray.general : Fuctions, My two cents : Re: Fuctions, My two cents Server Time
3 May 2024 04:24:36 EDT (-0400)
  Re: Fuctions, My two cents  
From: Kenneth
Date: 27 Feb 2023 15:50:00
Message: <web.63fd1617f28769a39b4924336e066e29@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:
> "Bald Eagle" <cre### [at] netscapenet> wrote:
> >
> > Also, you should look into all of the input_gamma for gamma pre-corrected file
> > formats stuff, to see if that's what's going on...
>
> An interesting point-- and a good suggestion. By using the newer(?) 'gamma'
> value keyword with my .png test image, it eliminates the gamma-curve
> effect seen with the function method; the HF ramp is nice and linear now:

(actually, the ability to gamma-correct the image goes all the way back to at
least v3.7.0)
>
> #declare PigM =
> function{pigment{image_map{png "MY_IMAGE.png" gamma 1.0 }}}
>
> Yet when the image_map is used 'directly' to create the HF (no pre-function
> stuff), it works linearly as expected, without any gamma fiddling.

I also tested v3.7.0, and the difference is there as well. It's strange that I
never noticed this until now; I've been running image_map functions as
height_fields for years! I guess that having a linear white-to-black ramp in the
image as a tester is something I never used(?). Or I just wasn't paying enough
attention...
>
> I don't know if this unexpected difference is mentioned in the docs; I haven't
> seen anything that expressly mentions it.
>

It IS there; I had to search for it in the 3.8 documentation (the additional
emphasis is mine):

2.3.4.6 GAMMA IN INPUT IMAGES--
"Normally, gamma handling of input image files will work fine without
intervention, but in some cases it may *fail.* To resolve such problems, the
default handling can be overridden using the gamma keyword..."

"When using an image file in a *height_field*, bump_map or image_pattern,
POV-Ray will convert the image data to linear values *if* you explicitly specify
a gamma for that particular file; if you don't, no gamma adjustment will be
performed..."

Since my test image was made at the usual 2.2 (or perhaps sRGB) gamma-- as was
Leroy's presumably-- this makes sense.

Although, it does not really explain the gamma difference between a
function{pigment{...image_map...}} vs. a direct  height_field{...image_map...}


Post a reply to this message

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