code: function() {
          this._ensureColor();
  
          let ctx = this._getDrawingContext();
          let width = this._canvas.width;
          let height = this._canvas.height;
  
          let img = ctx.createImageData(width, height);
          let data = img.data;
  
          this._prepareImageIn(data, width, height);
          ctx.putImageData(img, 0, 0);
      }
docs: Draws the field in an ImageData and applying it with putImageData.
  Used as a reference: http://geoexamples.com/d3-raster-tools-docs/code_samples/raster-pixels-page.html