-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 Uint8Array
s, Buffer
s, 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
antmarot and dvergeylen