title: Flot renders png image with a different background color than it does in browser
body: <p>I ran across an issue, when saving HTML5 canvas made by flot into an image format.  See image below.</p>
  <p><img src="https://i.stack.imgur.com/joHT3.png" alt="enter image description here" /></p>
  <p>This is an image I spliced together from two different renditions of the same graph (which uses same code).  Left side is the canvas in the browser and is rendered white.  Right side, is when I use <code>getCanvas()</code> code to save data into image form and it is rendered gray.  I can't explain the difference in color, nor fix it.   What do you think is the issue?</p>
  <p><strong>More info</strong></p>
  <pre><code>//JS side:
  var plot = $.plot($(&quot;#plot&quot;), flotData, flotOptions);
  var canvas = plot.getCanvas();
  var data = canvas.toDataURL(&quot;image/png&quot;);
  
  //I then pass data via dynamically created JS-form to a PHP script
  {code ommitted, but essentially $imageData = data}
  
  //once in PHP script:
  $parts = explode(',', $imageData);
  $data = base64_decode($parts[1]);
  
  
  header('Content-Type: image/png');
  header('Content-Length: '.strlen($data));
  
  // Output the actual image data //renders with gray instead of white(!!)
  echo $data;
  </code></pre>
  <p><strong>Observations</strong></p>
  <p>Found that I can set background color like so in flot:</p>
  <p><code>grid:{&quot;backgroundColor&quot; : {&quot;colors&quot; : [ &quot;#FFF&quot;, &quot;#EEE&quot; ]}}</code>.</p>
  <p>But it changes the color inside the grid only and the vertical sidelines on the sides of the grid (the axes) still have gray background when it was white in browser rendition.</p>
  <p>Another way to attack this is to find a way to &quot;draw flot chart on top of existing canvas&quot;.  Make canvas, color it, pass it to flot.  (don't know if possible)</p>
  <p>** UPDATE! **</p>
  <p>The problem I am experiencing here is that of 'transparency'.  Transparent pixels with 0 on the alpha channel acquire this kind of coloring that I want to avoid.</p>