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

Re: [Public WebGL] gamma/color profile and sRGB



On Sun, Nov 23, 2014 at 8:34 AM, Florian Bösch <pyalot@gmail.com> wrote:
I hope that is exactly not the case, because that would be quite the wrong thing to do, without the application programmer having indicated his willingness for this to happen.

It's relatively easy to show why the pass-trough case should not be neglected.

If you receive color from an image (such as PNG/JPG) it's gamma corrected (either implicitely because the image was created by watching an sRGB display, or explicitely as in JPEG). Being able to receive colors unmodified from the source is important, so you cannot decode those bytes into linear space for storage on the fly implicitely.

Outputting those colors to screen has a variety of usecases, among them if you do not concern yourself with lighting calculations, such as when you're drawing a UI. So if you where to enforce linear space conversion upon output, but do not enforce gamma space conversion upon input, you'd force anybody wishing to output colors unmodified, to modify the colors upon reading them in. Obviously that's not done today. It's not done, largely because needless back/forth conversion without any actual use, introduces its own degradation. And as a consequence of that, a lot of applications out there make use of this "pass trough". So if you where to suddenly enforce linear space output conversion, by default, it'd break a lot of WebGL (and canvas) apps out there.

And those are the reasons pass trough is important. But that doesn't mean providing better sRGB and gamma ramp handling isn't important.