cargo install wasimage
wasimage --wasm-file my.wasm --js-file my.js
- This will generate
index.png.htmlwhich will automatically unpack and execute, loading itself as a PNG and extracting the data from there
NOTE: By default file access is blocked in Chrome, so you can't test this locally unless you spin up an HTTP server. Start Chrome with the
--allow-file-access-from-file to remove this restriction.
arguments. See the
examples folder for an example.
You can also pass
--max-width to restrict the width of the generated PNG.
Inspiration and parts of the loader code come from pnginator by Gasman et al.