Bytes per pixel: 1 grayscale, 2 grayscale/alpha, 3 RGB, 4 RGBA; this order is preserved.
Positive safe integer rows in pixels, checked by the encoder.
Row-major interleaved samples in supplied row order, exactly widthheightchannels bytes. The encoder performs no vertical flip, premultiplication or color conversion.
Positive safe integer columns in pixels, checked by the encoder.
Borrowed 8-bit interleaved pixels for encodeAutoMoviePng. The encoder reads without mutation and returns padded base64 PNG bytes without a data: prefix; image identity is assigned separately by the caller.
Output uses bit depth 8, no interlace, filter zero and stored deflate blocks, with no compression or color-management metadata. Dimensions/channel count/buffer length are checked before encoding; host allocation failures still propagate.