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: 4 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 4 years ago)
- Default Branch: main
- Last Pushed: 2021-02-15T13:58:21.000Z (over 4 years ago)
- Last Synced: 2024-10-30T01:22:23.973Z (7 months ago)
- Topics: decoding, deno, encoding, image, png, png-decoder, png-encoder, wasm
- Language: TypeScript
- Homepage: https://deno.land/x/pngs
- Size: 210 KB
- Stars: 23
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
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.