w3c / ColorWeb-CG

repo for the Color on the Web Community Group
47 stars 21 forks source link

Is the color space preserved during toBlob() and toDataURL() #119

Closed palemieux closed 2 weeks ago

palemieux commented 2 weeks ago

From https://github.com/w3ctag/design-reviews/issues/917#issuecomment-1964765613

The used color space is a property of CanvasRenderingContext2D, but HTMLCanvasElement provides methods for exporting the canvas contents as an image (toBlob(), toDataURL()). Is the color space preserved during these operations? (again this also applies to wide gamut)

palemieux commented 2 weeks ago

Based on previous discussions, the intent is for toDataURL() and toBlob() to produce resources that best match the fidelity of the underlying canvas (subject to the limitations of the implementation and the requested format).

This statement could be added to the document.