PNG Mimic

actions:test actions:release shields:license shields:release deno:module

Mimic any binary to PNG.

Details

Embed any binary into IDAT chunk and generate image. Extract binary from IDAT chunk in image.

Due to image size, IDAT chunk size may be larger than binary size, in which case difference will be padded with zero. When extracting binary from image, need to know length of zero padding, so use gAMA (gamma value) chunk to store length.

Output image is square, with width and height approximately equal to square root of binary size divided 3.

Requirements

Property Value
Color 24 bit RGB
Alpha No
Filter per Row No
Chunks IHDR gAMA IDAT IEND

API

See Deno Document for details.