adroitwhiz
adroitwhiz
I'm interested on working this after the library is recoded to fix #100. I was blocked in the past on a resolution to #53, but I think we should be...
I've created [a quick-and-dirty Firefox patch](https://github.com/whatwg/html/files/4345148/premul_imagedata.patch.txt) for those who want to play around with the API. It's rough around the edges but might be helpful for prototyping.
I suppose it would be nicer to make the premultiplication state immutable. If a developer needs to change it, they can always create a new `ImageData` with a different premultiplication...
So the consensus seems to be on something like: ``` dictionary ImageDataOptions { boolean premultiplied = false; }; interface ImageData { constructor(unsigned long sw, unsigned long sh, optional ImageDataOptions options...
@jdashg The [CanvasImageData interface already exists](https://html.spec.whatwg.org/#canvasimagedata)-- I only modified the `createImageData` and `getImageData` signatures to use the new `ImageDataOptions`.
@kenrussell > Further, it should be specified that constructing an ImageData from another one where the `premultipliedAlpha` creation attribute differs is a lossy operation. How can such an operation occur?...
> I sort of like that it's not readonly, since that lets you "recast" it without having to copy or something. It's lesser usecase, but I think it's real. Even...
Is there still any interest in this API? I let it lay dormant for a while because it seemed like there was a lot of discussion happening with the [canvas-color-space...
My concern is moreso that this would be the first appearance of the options dictionary in the first place, at least in FF. I briefly looked into your prototype WebGL...
#100 was something I discovered after writing this issue. I think this issue better describes my proposed solution (in retrospect)