
Variations on symmetric nearest neighbour smoothing - jashkenas
https://observablehq.com/@jobleonard/symmetric-nearest-neighbour-all-the-things
======
unlinked_dll
After some googling this kind of looks like "inverse distance weighted
interpolation." Is that at all similar? Seems well trodden ground

[https://pro.arcgis.com/en/pro-
app/help/analysis/geostatistic...](https://pro.arcgis.com/en/pro-
app/help/analysis/geostatistical-analyst/how-inverse-distance-weighted-
interpolation-works.htm)

[https://en.wikipedia.org/wiki/Inverse_distance_weighting](https://en.wikipedia.org/wiki/Inverse_distance_weighting)

------
BubRoss
This is a neat article with some good experimentation, but... This is
essentially someone seeing the precursor to the bilateral filter for the first
time without ever having heard of a bilateral filter before.

A bilateral filter weights surrounding pixels by how close in value they are.
This ends up creating a smoothing effect from soft clustering. Take a look at
the 'rolling guidance filter' for an effect when used iteratively.

------
joe_the_user
Really simple filters can yield very impressive results on images.

This makes me think of deep learning "style transfer" effects. They're nice
but so are artistic filters that long predate these things and are
tremendously simpler.

~~~
enriquto
> They're nice but so are artistic filters that long predate these things and
> are tremendously simpler.

CNN are also tremendously simple. They just iterate many filters, but each one
of them is much simpler than the bilateral filter.

~~~
fenwick67
Everything a computer does is simple if you are reductionist about it

------
jmpeax
It seems to create aliasing artefacts at edges. I wonder if this can be
suppressed by scaling up the image and the filter radius and then scaling back
down?

~~~
BubRoss
Look up bilateral filters and the various papers related to minimizing sharp
segmentation.

~~~
AstralStorm
Indeed, a bilateral filter is this approach of selection but segmenting on
signal statistics of the surrounding image rather than just value. (Usually
variance for denoising, contrast for non-blocking sharpening, L2 metric like
PSNR for deblocking, luminance for chroma artifact reduction after upscaling.)

~~~
BubRoss
Can you link some papers that take about this? Segmenting on statistics isn't
typical in the many papers I've read.

------
fenwick67
I implemented this in ShaderToy if anyone wants to see it run in real-time:

[https://www.shadertoy.com/view/WlGGzt](https://www.shadertoy.com/view/WlGGzt)

------
keyle
Fascinating. Couldn't help but think that the result looks a lot like some
recent game shaders, for grass and landscape, like seen in the witness. Maybe
Jonathan can chime in.

~~~
fenwick67
I was just thinking, "this would be a great screen-space shader effect". It's
at once both painterly and pixelly.

