verstra@programming.dev 5 days ago
Wait, how does this work in-browser? Does it send the photos to the local server where image magick does the job, or is it using javascript to read/write images, or does it contain WASM to do that?
verstra@programming.dev 5 days ago
Wait, how does this work in-browser? Does it send the photos to the local server where image magick does the job, or is it using javascript to read/write images, or does it contain WASM to do that?
verstra@programming.dev 5 days ago
It’s JavaScript.
And it is slow, but not as slow as I expected it to be. I’ve optimized a photo I’ve taken with my DSLR, 6.3MB, 24MP, JPEG. It has taken ~50sec on this phone, in Firefox.
I know, it’s a phone, but also, my phone can and does save, optimize, and apply filters to such images in <1sec.
verstra@programming.dev 5 days ago
If you are interested (and can pull together a bit of funding) I can look into how we could do this optimization in WASM.
lent9004@lemmy.world 5 days ago
Yes, it’s all JavaScript and essentially relies on the Canvas API to compress the images, so the performance is heavily dependent of your device and browser. I haven’t delved into WASM yet, but it would indeed open up doors for improvements, such a more file format support and more intelligent optimization. At the moment, working with canvas keeps things a lot more straightforward, however.
There is no funding I can provide at all (I’ve received 2 donations so far, which I’m very grateful for!). I just do this on my spare time, which I have a lot less of these days. I initially created MAZANOKE as a drop-in replacement for family and friends, specifically to those who tend to use questionable or ad-bloated online tools.
verstra@programming.dev 4 days ago
I did also forget to say it does look very nice, with animations and proper polish!
verstra@programming.dev 4 days ago
If you do delve into improving the performance, I suggest using Rust and
no_std
crates for dealing with images, such as docs.rs/zune-jpeg/latest/zune_jpeg/.It would probably take some time to get it working, but it would probably increase performance and support any format you can find a crate for. But it does not seem like it’s worth it.
I’ll add this to my list of “things I might to when I don’t have a side project to waste my time on” :D