POV-Ray : Newsgroups : povray.binaries.tutorials : Check(er) Your Gamma : Re: Check(er) Your Gamma Server Time
20 Sep 2021 22:23:26 EDT (-0400)
  Re: Check(er) Your Gamma  
From: clipka
Date: 5 Nov 2009 18:43:48
Message: <4af36334@news.povray.org>
Edouard schrieb:

> I can see it's displayed correctly. That's great. But you've taken the decision
> that the file should be output with that display gamma baked in, and that's not
> something that's desirable under all circumstances (like, for example, any
> manipulation of the image afterwards).

No, this is absolutely the proper way to do it with PNG image files, as 
per the PNG file specification.

>> Note that Photoshop lies to you about brightness (and so do your eyes).
>> Photoshop also uses physically wrong math when blurring images (at least
>> the old version I own does).
> 
> No - Photoshop is doing a sensible thing, and that's to work in linear space
> (exactly the same way that POV does). Photoshop is a production tool, and having
> gamma applied half way through your workflow will just screw everything up.

No, that's exactly the problem: Photoshop is /not/ working in linear 
space - it happens to work in /whatever/ space the image happens to be 
encoded in.

As linear encoding gives a great deal of precision loss with 
low-brightness values (at the benefit of some precision gain with 
high-brightness values, where it's not really needed), thereby leading 
to color banding in dark areas, linear encoding is /not/ suited for 
8-bit color depth images.


>> The /physical/ blurring by squinting your eyes, however, does indeed
>> comprise a physically correct "computation" of (black+white)/2 (taking a
>> few steps back may do the same job, and some people may just need to
>> take off their glasses), which obviously gives you a grey of /truly/
>> half the white value (*), which you can then visually compare to the
>> grey of /allegedly/ half the white value.
> 
> I'm arguing that for a digital artist who is using POV as part of their
> workflow, having tools like Photoshop's blur give identical "output" to what you
> see when you do the "squint" method, is a good thing.

Sure it is; however, color banding is a bad thing, and therefore 8-bit 
linear encoded PNG is /not/ an option either.


> I'm sure lots of people will be happy to bake the gamma into their file if they
> are producing "final" images with POV, and not intending to post-process them in
> any way (as long as they know scaling the image is then a no-no). But there are
> plenty of others who use POV in a workflow that includes scaling and other post
> processing, and we would be better suited with having linear ICC profiles
> attached to the images. There is no "right" way, it all depends on how the user
> is intending to use the image.

Feel free to use "File_Gamma=1.0" on the output file, which does exactly 
what you demand - except that it doesn't attach an ICC profile, but 
"only" a gAMA chunk, because an ICC profile would inevitably have to be 
a lie (POV-Ray is presently gamma- but not color space-aware). It's a 
shame that Photoshop 6.0 fails to support the gAMA chunk, but that's not 
POV-Ray's fault. And you can actually work around the problem by 
manually assigning your favorite linear ICC profile to the image /after/ 
you have loaded it into Photoshop.

And don't complain about any color banding you may observe: You're 
asking for it.


(BTW, to scale a gamma-encoded image without messing up the colors, I 
can highly recommend IC. It does properly convert the image to linear 
color space before resampling.)


Post a reply to this message

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