-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
How to generate image from stream of raw input? #1579
Copy link
Copy link
Closed
Labels
Milestone
Description
I am trying to create an image (ideally to be output as a png) from raw pixel data, but I'm struggling to understand the desired format
const rs = Readable();
const transformer = sharp({
raw: {
width,
height,
channels: 3,
},
});
rs.pipe(transformer).pipe(createWriteStream(outputPath));I have tried setting _read on rs to push Uint8Arrays, Buffers, and other types representing RGB data, but I inevitably get the Error: Unexpected data on Writable Stream error
I'm stumped, any help would be greatly appreciated
Reactions are currently unavailable