Skip to content

Commit

Permalink
Adding png support from https://github.com/photopea/UPNG.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Kent Willis committed Mar 6, 2020
1 parent 62d29bf commit 1f64bcd
Show file tree
Hide file tree
Showing 2 changed files with 699 additions and 1 deletion.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,25 @@ worker.onmessage = function(e) {
}
```

**PNG Support**
```
worker.postMessage({
image: imageData,
png: true,
quality: 50
});
worker.onmessage = function(e) {
// Make sure to specify the type as png.
var blob = new Blob( [e.data.data], {type: 'image/png'} );
}
```

## Credits

This library relies almost entirely on an adaptation of the encoder from the [jpeg-js]() library. This library was built to work in a node.js environment and not in the browser, let alone in a web worker environment.

The png part of this library is pulled directly from https://github.com/photopea/UPNG.js


## License

Expand Down
Loading

0 comments on commit 1f64bcd

Please sign in to comment.