Photon: High Performance Image Processing in WebAssembly / Rust
silvia-odwyer.github.io
silvia-odwyer.github.io
Regarding performance, I don't see what makes this high-performance. I looked into the code for filters and it's a very naive translation of the algorithms.
Naive not in the pejorative way, you can only do so much on images stored as contiguous RGB (arrays of struct), even OpenCV does not really optimize for this.
Non-naive implementations of filters would use tiling, register blocking, register rotation to avoid being bottlenecked by memory which is the main issue with stencil code. I don't think vectorization is straightforward with the RGB layout since you would need both scatter and gather instructions but gather requires AVX2 and scatter is very manual.
Anyway the benchmark should use a reference C or C++ library or even imageflow that is also written in Rust https://github.com/imazen/imageflow. Bonus point if you benchmark against Halide (https://halide-lang.org/) or Taichi (http://taichi.graphics/) and you're only 20 times slower (see their box blur example: https://github.com/halide/Halide/blob/master/apps/blur/halid...)
Fwiw, Automattic’s image optimizer / CDN for WordPress is also called Photon: