https://github.com/andytango/webp-wasm-js
🎨 Simple webp encoder and decoder, compiled to WebAssembly
https://github.com/andytango/webp-wasm-js
image-processing javascript wasm webassembly webp
Last synced: about 2 months ago
JSON representation
🎨 Simple webp encoder and decoder, compiled to WebAssembly
- Host: GitHub
- URL: https://github.com/andytango/webp-wasm-js
- Owner: andytango
- License: apache-2.0
- Created: 2020-07-28T08:45:15.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-03-27T06:56:39.000Z (about 4 years ago)
- Last Synced: 2025-12-27T05:55:44.960Z (6 months ago)
- Topics: image-processing, javascript, wasm, webassembly, webp
- Language: C++
- Homepage:
- Size: 217 KB
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# WebP encoder and decoder
Extracted and built from Google's [Squoosh](https://github.com/GoogleChromeLabs/squoosh) app, packaged for NPM.
## Example
See `dec/example.html` and `enc/example.html`
## Decode API
### `int version()`
Returns the version of libwebp as a number. va.b.c is encoded as 0x0a0b0c
### `RawImage decode(std::string buffer)`
Decodes the given webp buffer into raw RGBA. `RawImage` is a class with 3 fields: `buffer`, `width`, and `height`.
### `void free_result()`
Frees the result created by `decode()`.
## Encode API
### `int version()`
Returns the version of libwebp as a number. va.b.c is encoded as 0x0a0b0c
### `UInt8Array encode(uint8_t* image_buffer, int image_width, int image_height, WebPConfig config)`
Encodes the given image with given dimension to WebP.
### `void free_result()`
Frees the last result created by `encode()`.