POV-Ray : Newsgroups : povray.pov4.discussion.general : Gamma correction of input colours/image files : Re: Gamma correction of input colours/image files Server Time
17 May 2024 19:04:55 EDT (-0400)
  Re: Gamma correction of input colours/image files  
From: Warp
Date: 10 Oct 2008 12:38:37
Message: <48ef850c@news.povray.org>
Ive <"ive### [at] lilysoftorg"> wrote:
> And finally quite frankly: this gamma and assumed_gamma issues have been
> discussed so many times and still the same old misconceptions reappear -
> this makes me think it is meanwhile a kind of urban legend where some
> people just insist to *believe* in something.

  The only thing I know for sure about gamma correction is that whenever
it makes an appearance, it only causes problems and nothing else.

  Take, for example, the GIF and JPEG image formats: No gamma correction
values anywhere, never any problems with gamma correction. They are two
of the most popular image formats ever, yet I don't remember reading
anybody complaining about gamma correction issues with them. Why? Because
they don't have any gamma correction info.

  Now take PNG: As a more modern image file format they decided to add
gamma correction information to it, as well as some recommendations and
specifications about how sofware should interpret it (as well as interpret
what happens if the info is missing). The result? The PNG format is
burdened with endless problems related to gamma correction issues. No two
programs seem to agree on how a PNG should be shown, regardless of whether
it has gamma correction info embedded or not.

  This is a huge problem for example with web browsers, which is one of
the reasons why PNG has been so unpopular in web design. And why wouldn't
it be: The exact same PNG can look completely different in different
browsers (for example with regards to the background color of the webpage),
while GIF and JPEG images look the same regardless of the browser.

  One big problem precisely related to web design is that you might
specify, for example, a background color for your web page, let's say
for example #808080, and you use *the exact same color* in a PNG expecting
it to match precisely the background color of the web page so that its
color scheme will nicely blend with the background. However, in one browser
the colors may match, while in another they might not. And this completely
regardless of whether you embed any gamma correction info into the PNG or
not. (This is because some web browsers *assume* some gamma value if none
is present in the PNG file, as per the specs recommendation, while others
just take the pixels unmodified, like they do with other image formats.)

  So what can a web developer do when he encounters this problem? The only
solution is to switch to either GIF (if 256 colors are enough) or JPEG.
Those do not present the problem because they do not have any gamma info.
A pixel value of #808080 will be #808080, like the page background, and
nothing else. No browser will make a *different* gamma correction to the
image and the background color, like they often do with PNG images.

  If PNG had never included the gamma correction information in its format,
this problem would not happen, and it would be exactly as usable as GIF and
JPEG. But no. Gamma correction = problems.

  It's no wonder why POV-Ray is also riddled with all kinds of problems
related to gamma correction. Whenever you are dealing with gamma correction
you are going to encounter big problems.

  I suppose that gamma correction is a bit like text character encodings:
Nice ideas in theory, but the world is completely riddled with endless
problems related to them, and every software has its own ideas about how
it should implement them.

-- 
                                                          - Warp


Post a reply to this message

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