https://github.com/denosaurs/pngs
📷 A simple wasm png encoder/decoder module for deno
https://github.com/denosaurs/pngs
decoding deno encoding image png png-decoder png-encoder wasm
Last synced: 8 months ago
JSON representation
📷 A simple wasm png encoder/decoder module for deno
- Host: GitHub
- URL: https://github.com/denosaurs/pngs
- Owner: denosaurs
- License: mit
- Created: 2021-02-15T03:13:30.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2025-02-10T17:54:38.000Z (over 1 year ago)
- Last Synced: 2025-09-11T13:35:56.931Z (9 months ago)
- Topics: decoding, deno, encoding, image, png, png-decoder, png-encoder, wasm
- Language: TypeScript
- Homepage: https://deno.land/x/pngs
- Size: 389 KB
- Stars: 28
- Watchers: 2
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# pngs
[](https://github.com/denosaurs/pngs/releases)
[](https://github.com/denosaurs/pngs/actions)
[](https://github.com/denosaurs/depsbot)
[](https://github.com/denosaurs/pngs/blob/master/LICENSE)
A simple wasm png encoder/decoder module for deno using wasm.
## Examples
### Decoding
```ts
import { decode } from "https://deno.land/x/pngs/mod.ts";
const file = await Deno.readFile("image.png");
console.log(decode(file));
```
### Encoding
```ts
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](https://github.com/eliassjogreen))
## Other
### Related
- [image-png](https://github.com/image-rs/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](https://www.conventionalcommits.org/en/v1.0.0/) spec.
### Licence
Copyright 2021, Denosaurs. All rights reserved. MIT license.