RE: Canvas, color management and GetImageData

>>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.

>Does that answer your question?

Somewhat... re-rereading another section also cleared it up. Namely:

(From spec)
>Furthermore, the rendering of images that have no color correction information (such as those returned by
>the toDataURL() method) must be rendered with no color correction.

Color-managed browsers today have separate 'paths' for tagged/untagged images.
[a] untagged images are not color managed (aka are actually displayed in display-space; the raw color values from the image file are drawn on the screen. Arguably, this is a good thing, as you really want the color values in html elements/untagged images/non-color-managed flash/etc to all sync up.
[b] tagged images are converted to display-space before being displayed

This has been acceptable up to this point, as web page authors have not been reading the RGB values out of a tagged/untagged image - programmatically, it didn't matter to the author how the browser stored the bitmap pixels before displaying them. (iow The author generally had no way of knowing if color management was happening in the browser)

With the introduction of canvas drawImage() and getImageData(), authors can now see the color values of bitmap data in the browser - and authors may be relying on getting specific color values from getImageData() to do hit detection, etc.

(Authors will probably expect that if they draw an untagged bitmap with RGB(200, 0, 0) to a canvas, they should be able get RGB(200, 0, 0) back with getImageData() - this is what the canvas spec implies after all.)

Different browsers return different values today on two computers (with different display-profiles) where you do a canvas getImageData() on a region that has been drawImage()ed with a *tagged* image.

But: As the 'Furthermore...' section (quoted above) says, this should not happen for untagged images.

Imho the color management section could be more clear...I'll suggest some edits shortly. 

Thanks
Frank Olivier

-----Original Message-----
From: Ian Hickson [mailto:ian@hixie.ch] 
Sent: Thursday, September 24, 2009 2:02 AM
To: Frank Olivier
Cc: public-canvas-api@w3.org
Subject: Re: Canvas, color management and GetImageData

On Wed, 16 Sep 2009, Frank Olivier wrote:
> 
> Is the intent of the spec that canvas-space = display-space?

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.

Does that answer your question?

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'



-----Original Message-----
From: Ian Hickson [mailto:ian@hixie.ch] 
Sent: Thursday, September 24, 2009 2:02 AM
To: Frank Olivier
Cc: public-canvas-api@w3.org
Subject: Re: Canvas, color management and GetImageData

On Wed, 16 Sep 2009, Frank Olivier wrote:
> 
> Is the intent of the spec that canvas-space = display-space?

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.

Does that answer your question?

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Friday, 2 October 2009 00:04:23 UTC