Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Paint the region of the image" in what colorspace? #7245

Open
svgeesus opened this issue Oct 20, 2021 · 1 comment
Open

"Paint the region of the image" in what colorspace? #7245

svgeesus opened this issue Oct 20, 2021 · 1 comment

Comments

@svgeesus
Copy link

https://html.spec.whatwg.org/multipage/canvas.html#drawing-images

Paint the region of the image argument specified by the source rectangle on the region of the rendering context's output bitmap specified by the destination rectangle, after applying the current transformation matrix to the destination rectangle.

CanvasRenderingContext2D has a well-defined colorspace, defaulting to srgb, and I was pleased to see (although in a Note):

There do not exist any inputs to a 2D context for which the color space is undefined

But the description quoted above does not clearly state

  1. How the colorspace of the source image is determined (maybe it is in a different part of the spec and I missed it)
  2. How the Paint the region is affected by the context colorspace

Is the bitmap assumed to already be in whatever colorspace was used to establish the 2D context? If so, where is that defined?

@annevk
Copy link
Member

annevk commented Oct 20, 2021

This problem was also touched upon #6562 (comment) for a similar API and left for a future PR. @ccameron-chromium do you have a timeline for that?

cc @whatwg/canvas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants