{
const w = image.naturalWidth;
const h = image.naturalHeight;
const context = DOM.context2d(2 * w + 20, h, 1);
context.drawImage(image, 0, 0);
const im = context.getImageData(0, 0, w, h);
const data = im.data;
const data0 = data.slice();
d3.blurImage(im, radius, radius);
for (let i = 0; i < data.length; ++i)
if (i % 4 < 3)
data[i] = data0[i] - gain * (data[i] - data0[i]);
context.putImageData(im, w + 20, 0);
return Object.assign(context.canvas, {
style: `max-width: ${Math.min(width, 2 * w + 20)}px`,
title: "On the left, Blur; on the right, Unblur."
});
}