Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/png_mimic/mod.ts>pngEncode

Mimic any binary to PNG.
Latest
function pngEncode
import { pngEncode } from "https://deno.land/x/png_mimic@v1.0.3/mod.ts";

Generate png image from binary. Output format is 24 bit color, gamma, no alpha, no filter.

Examples

Example 1

const bin = await Deno.readFile("./file");
const encode = await pngEncode(bin);
const decode = await pngDecode(encode);

Parameters

data: Uint8Array

Returns

Promise<Uint8Array>