A colleague building a set of pluggable computational modules in the browser needs to be able to save HTMLCanvasElements to PNG files but specify the DPI at which those images should be rendered.
https://gitlab.cba.mit.edu/pub/libraries/blob/master/node/frepw.js implements this, at the cost of parsing and regenerating the entire PNG file.
The spec of Canvas.toBlob() should be improved to take an optional dictionary of arguments, arguably instead of the "quality" parameter. Quality could be one of the entries; the intended DPI could be another.