Furthermore what I'm doing here is not strictly the local median: it's a posterized average of posterized values. This would be identical to the median (or mode, for that matter…) if the average was uniform over a neighborhood. However, since I took a shortcut with using array-blur, which does a weighted average, the result might be a bit different.