{
const width = resolution, height = resolution
let canvas = DOM.canvas(width,height),
context = canvas.getContext("2d")
canvas.style.width = "400px";
canvas.style.imageRendering = "pixelated"
let projection = d3.geoMercator().fitExtent([[0,0], [width,height]], district)
let time = Date.now()
let monochrome = renderGeoToBitmap(district, projection, width, height)
let unantialiased = threshold(monochrome)
let eroded = erode(unantialiased, width, height)
mutable renderTime = Date.now() - time
eroded = Uint8Array.from(eroded, d => (d == thresholdValue) ? 255: d)
let amplified = Uint8ClampedArray.from(eroded, val => val * 255 * 4 / resolution)
let imgData = new ImageData(monochromeToMultichannel(amplified), width, height)
context.putImageData(imgData,0,0)
return canvas
}