css-houdini-drafts
css-houdini-drafts copied to clipboard
[css-paint-worklet] How to manipulate pixel data of CSS PaintWorklet context
PaintRenderingContext2D does not have putImageData and an ImageData interface.
If PaintWorklet allowed pixel manipulation with CanvasRenderingContext2D, it would be possible to create beautiful placeholders (e.g. using BlurHash algorithm).
Why doesn't PaintWorklet allow direct manipulation of pixels? Or maybe there is any other way to draw an image in PaintWorklet from Uint8ClampedArray source?
I was wondering the same while playing with this BlurHash/Paint API experiment. Are there any plans to introduce this?
The PaintWorklet context is currently restricted to the operations that can be translated into DisplayLists and similar underlying browser drawing tech, so that it can be stored, painted, and replayed more easily without needing to allocate potentially-large pixel buffers.