Closed inssein closed 9 years ago
There is putImageData
, or am I misunderstanding what it is you want to do?
@LinusU I wanted to clone ImageData, and then perform some operations.
Example: https://github.com/inssein/jsfx/blob/master/src/filter/unsharpMask.ts#L75
Shouldn't that code work as is right now?
@LinusU works on the web, doesn't seem to properly clone in node-canvas. Also, shouldn't it be a CanvasPixelArray right now, before the PR is merged?
Sorry, the issue was with something else. new Uint8ClampedArray(imageData.data)
seems to clone the data just fine.
I can't figure out how to clone an ImageData object, short of retrieving it again from the context.
All the methods I know of require ImageData.data to be a Uint8ClampedArray with the setter exposed. Is there anything I can do right now, short of waiting for https://github.com/Automattic/node-canvas/pull/604 to be merged?