function maskDataURL2Image(maskDataURL, { color = Constants.FILL_COLOR } = {}) {
  return new Promise((resolve, _reject) => {
    const img = document.createElement("img");

    img.onload = () => {
      const canvas = document.createElement("canvas");
      const nw = img.width;
      const nh = img.height;

      canvas.width = nw;
      canvas.height = nh;

      const ctx = canvas.getContext("2d");

      ctx.drawImage(img, 0, 0);

      const imgData = ctx.getImageData(0, 0, nw, nh);

      const numChannels = 4; // RGBA

      setMaskPixelColors(ctx, imgData.data, nw, nh, color, numChannels);

      img.src = canvas.toDataURL();

      resolve(img);
    };
    img.src = maskDataURL;
  });
}
Given an RGBA image data URL, turn it into an actual DOM Image filled in with the current
class color.
@param {string} maskDataURL Data URL, such as returned from mask2DataURL, containing
 an image.
@param {string} color The fill color of the image produced from the Data URL.
@returns {Promise<Image>} DOM Image filled out with the resulting mask data URL.