-
Notifications
You must be signed in to change notification settings - Fork 75
Open
Labels
good first issueGood for newcomersGood for newcomers
Description
Hi, thanks for this lib that looks great! (I'm still evaluating)
I'm trying to pass the output to another lib, which requires an ImageData input:
class ImageData {
data, // Uint8ClampedArray one-dimensional array containing the data in the RGBA order, with integer values between 0 and 255 (inclusive). The order goes by rows from the top-left pixel to the bottom-right.
colorSpace, // string indicating the color space of the image data.
height,
width,
}
Looking at the output of resvg-js, it looks extremely similar:
export class RenderedImage {
/** Write the image data to Buffer */
asPng(): Buffer
/** Get the RGBA pixels of the image */
get pixels(): Buffer
/** Get the PNG width */
get width(): number
/** Get the PNG height */
get height(): number
}
My suggestion is to switch the output of resvg-js to the standard API ImageData or provide a conversion function, ex. toImageData()
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomers