PDF.js displays blurry plots in PDF documents, e.g.

http://arxiv.org/pdf/1202.5344v1.pdf

When viewed in Chrome or Adobe Acrobat all the plots show sharp-edged squares. When viewed in Preview or PDF.js, all the squares show as blurry pixelated blobs.

const tmpCanvas = owner.cachedCanvases.getCanvas(
      "pattern",
      owner.ctx.canvas.width,
      owner.ctx.canvas.height,
      true
    );
    const tmpCtx = tmpCanvas.context;
    tmpCtx.clearRect(0, 0, tmpCtx.canvas.width, tmpCtx.canvas.height);
    tmpCtx.beginPath();
    tmpCtx.rect(0, 0, tmpCtx.canvas.width, tmpCtx.canvas.height);
    if (!shadingFill) {
      tmpCtx.setTransform.apply(tmpCtx, owner.baseTransform);
      if (this._matrix) {
        tmpCtx.transform.apply(tmpCtx, this._matrix);
      }
    } else {
      tmpCtx.setTransform.apply(tmpCtx, ctx.mozCurrentTransform);
    }
    applyBoundingBox(tmpCtx, this._bbox);
    let grad;
    if (this._type === "axial") {
      grad = tmpCtx.createLinearGradient(