2 ms·
Very nice! Starred for further experimentation of my own when (if) I ever have time for this kind of thing again! (it's only a matter of time until one of the r
by vanderZwan 7y ago
Very nice! Starred for further experimentation of my own when (if) I ever have time for this kind of thing again! (it's only a matter of time until one of the regulars on Observable does a fast canvas implementation so they'll probably beat me to it)
This reminds me a lot of Mario Klingeman's Stackblur[0] (and my "quadratic" stackblur variant), which also is O(1) by kernel radius (if I understand the metric of the paper correctly - if measured by total pixels it is O(n)). The techniques seems very similar.
The column histogram trick feels like taking what would be a two-pass and merge it into one more memory-intensive pass. Pretty simple and elegant! I think this could be applied to the stack blur approach too.
[0] https://observablehq.com/@jobleonard/mario-klingemans-stackblur https://observablehq.com/@jobleonard/mario-klingemans-stackb...