[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] Gamma correction and texImage2D/texSubImage2D

On Sep 7, 2010, at 7:33 PM, Mark Callow wrote:

> On 07/09/2010 17:40, Tim Johansson wrote:
>> On 2010-09-07 04:53, Mark Callow wrote:
>>> Why should losslessly compressed files be treated differently than
>>> lossy compressed files? Just because they are more likely to be used
>>> for non-image data does not seem like sufficient reason. There are a
>>> lot of PNG images out on the web. People creating PNG files for, e.g.
>>> normal maps, can easily write a gAMA chunk indicating the gamma value
>>> is 1.0. 
>> What would it mean if we said that jpeg or some other lossy format has
>> to pass the values through "untouched"? What precision and which IDCT
>> algorithm should be used to consider the pixels "untouched"? Two
>> conforming jpeg decoders can produce different data, the requirement
>> for conformance is that the PSNR of the decoded image and the original
>> is small enough iirc.
>> Avoiding that issue is the reason it only applies to lossless images.
> My concern is the failure to apply the gAMA or other color space
> metadata to PNG files while doing so for files using jpeg compression.
> This can lead to the same image looking very obviously different
> depending on whether  it is loaded from a JPEG or a PNG.
> I agree that passing values "untouched" is meaningless in terms of JPEG
> but that is no reason to ignore the PNG spec. and treat PNG files

I don't think it's meaningless. Certainly no one would use JPEG to pass precise pixel values. But the "untouched" flag has two purposes (as has been pointed out in this long discussion). It allow images to be brought in for uses other then as image data, and it allows images to avoid color correction for authors wishing to work in their own custom color space.

Of course the second use begs the question of how an author can know what the color space of the image is. But for now I think it's reasonable for this to be implicit. The author would have to originate the image, so he would know its color space.


You are currently subscribed to public_webgl@khronos.org.
To unsubscribe, send an email to majordomo@khronos.org with
the following command in the body of your email: