pngs
A simple wasm png encoder/decoder module for deno using wasm.
Examples
Decoding
import { decode } from "https://deno.land/x/pngs/mod.ts";
const file = await Deno.readFile("image.png");
console.log(decode(file));
Encoding
import { encode } from "https://deno.land/x/pngs/mod.ts";
// An array containing a RGBA sequence where the first pixel is red and second is black
const data = new Uint8Array([255, 0, 0, 255, 0, 0, 0, 255]);
// Encode the image to have width 2 and height 1 pixel
const png = encode(data, 2, 1);
await Deno.writeFile("image.png", png);
Maintainers
- Elias Sjögreen (@eliassjogreen)
Other
Related
- image-png - PNG decoding and encoding library in pure Rust
Contribution
Pull request, issues and feedback are very welcome. Code style is formatted with
deno fmt
and commit messages are done following
Conventional Commits spec.
Licence
Copyright 2021, Denosaurs. All rights reserved. MIT license.