image-rs / imageproc

Image processing operations
MIT License
758 stars 150 forks source link

Add efficient Gaussian filtering via box filters #93

Open theotherphil opened 8 years ago

theotherphil commented 8 years ago

e.g. http://arxiv.org/pdf/1107.4958.pdf, or https://www.mia.uni-saarland.de/Publications/gwosdek-ssvm11.pdf

Shnatsel commented 5 years ago

There is actually a linear-complexity blur already implemented in Rust, where execution time is independent of blur radius: https://github.com/fschutt/fastblur

I've recently optimized the implementation by a further 2.5x, but not all of my PRs are merged yet, so you'll need to either nag the maintainer to merge them or use my fork.

That repo is more or less a toy, feel free to copypaste it wholesale to imageproc and continue development over here.

theotherphil commented 5 years ago

Thanks for the link. (Turns out I didn't get round to looking at this after all. I'm still interested in implementing this functionality, but I'm not sure when it'll get done - if anyone else wants to give this a try they're not going to be stepping on my toes.)

Shnatsel commented 5 years ago

resvg crate recently got the linear complexity algorithm linked above to production quality. It now supports alpha channel as well as all color formats that shuffle RGBA. Now it also matches blur rendering in Chrome, so it appears to be correct.

If you want to integrate that algorithm in imageproc, I suggest backporting those changes into fastblur crate as described here and then using that crate from both imageproc and resvg.