A tutorial on implementing a fast Gaussian blur in Java using two key optimizations: separable 1D filters and repeated box blurs with a sliding window. The standard 2D convolution runs in O(n·r²), but separating horizontal and vertical passes reduces it to O(n·r), and using a sliding-window moving average for box blurs further reduces it to O(n), making performance independent of blur radius. The post includes full Java code for horizontal and vertical box blur functions, an orchestrator applying multiple passes, and tests using both an impulse image and a real ARGB image.

8m read timeFrom feeds.feedblitz.com
Post cover image
Table of contents
1. Introduction2. Problem Overview3. The Fast Approximation Algorithm4. Solution5. Test6. Conclusion

Sort: