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

[Public WebGL] The Newly Expanded Color Space Issue

Our recent conversation about color spaces and texImage2D has brought up a more basic question: what color space is the WebGL Canvas? We need to decide that before we go any further. Choices:

1) sRGB. I proposed this as the first choice because I claimed that this is the color space used by 2D Canvas. My reasoning for that claim comes from 2 places:


states that "In user agents that support CSS, the color space used by a canvas element must match the color space used for processing any colors for that element in CSS". Furthermore in the CSS 2.1 spec at:


states that "All RGB colors are specified in the sRGB color space". Since CSS colors are sRGB, it follows that the Canvas should be sRGB.

2) Linear. I proposed this as the second choice because I claimed that this is the color space used, by convention, by OpenGL. If you look here:


it states: "Conventionally, OpenGL assumes framebuffer color components are stored in a linear color space". So since OpenGL uses linear it follows that the WebGL Canvas should be linear.

There are strong opinions on both sides. Some say that an sRGB canvas would be too difficult to write shaders for and you'd have to rewrite all your existing OpenGL apps. Others say that a linear canvas would have insufficient resolution in the dark areas and it would cause banding.

I'm not qualified to argue any more. So color space experts, please have at it. But keep it civil, or I swear I will send you all to your rooms and there will be NO ice cream tonight! :-)


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: