Fun fact: d3.blurImage was extracted and refined from D3-contour's code. For faster and more accurate values, you might want to use d3.blur2 on a raster of numbers, rather than blurImage on a raster of pixels.
Haha, good to know! The literal blur approach is not efficient anyways. I featured it mainly for sensemaking. For an efficient implementation, I suggest recoding the fast KDE approach on a byte array representing a grid of heights. It boils down to a fast implementation of a high precision Gaussian blur, and it dodges the aliasing problem we see below, which is due to the height being coded on 8 bits (i.e., from 0 to 255 as a RGB channel).