To any canvas pros out there–I need help.
I'm using node-canvas and I'm trying to get imageData
using it's getImageData
method.
Unfortunately it returns:
interface ImageData {
readonly attribute unsigned long width;
readonly attribute unsigned long height;
readonly attribute CanvasPixelArray data;
}
CanvasPixelArray
is deprecated in favor of Uint8ClampedArray
.
My question is:
Is there a way for getImageData
to return Uint8ClampedArray
or to convert CanvasPixelArray
to Uint8ClampedArray
?
If that's not the case, maybe someone can point me to some other implementation of canvas in node?
Any help would be greatly appreciated, thank you in advance!
It does just that since this PR as @ZachB has pointed out. Nowadays just <=0.10 does it the old way, as branched here for example.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With