-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WebAssembly demo #58
Comments
Great work, and thanks for sharing! I tested it briefly, and it worked quite well on reasonably sized images. A few thoughts:
|
Yes, binary size is indeed pretty small. I think A couple of things that would improve this demo/use case further:
|
I was able to get the binary down to from here compressing with |
Ah, I remember |
Hi,
I've created a small wasm demo based on
jxl-oxide
: https://gitlab.com/nitroxis/jxl-wasm. The main code is based onjxl-oxide-cli
and works by transparently transcoding JXL files to PNG inside a ServiceWorker. From a user perspective, nothing other than including thejxl-worker.js
script is required. One can simply use<img src="image.jxl" />
in HTML, similar to a polyfill.Currently it requires the browser to put the entire JXL blob into the transcode function at once since there is no async or streaming API in
jxl-oxide
(or is there?), but it works alright nonetheless. Might not be a good idea for very big images due to memory constraints. It's also single-threaded currently. Successfully tested it in Firefox and MS Edge.To try it out, one needs to have wasm-pack installed, then run
wasm-pack build --target no-modules
. Afterwards, run e.g.python -m http.server
in the project root and open http://localhost:8000/demo/index.html, or use any other means of hosting the files via HTTP(S). ServiceWorkers do not work forfile://
URLs, so HTTP is required, and HTTPS for anything but localhost.I thought maybe you'd be interested to hear that this crate works well in wasm. Feel free to include this as an example or something.
The text was updated successfully, but these errors were encountered: