voxolith

encodePng()

Encode 8-bit RGB pixels, row-major, as a PNG file (no alpha, no filtering). Uses node:zlib.

function encodePng(
   width: number, 
   height: number, 
   rgb: Uint8Array
): Uint8Array;

Defined in: preview/png.ts:13

Parameters

ParameterType
widthnumber
heightnumber
rgbUint8Array

Returns

Uint8Array

The file's bytes, ready to write.

On this page