Node.js canvas implementation with Uint8ClampedArray
Asked Answered
F

1

6

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!

Fledgling answered 29/1, 2014 at 15:9 Comment(1)
github.com/LearnBoost/node-canvas/issues/403Arte
E
1

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.

Edulcorate answered 14/9, 2015 at 0:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.