title: Get byte[] from <canvas>
body: <p>I have an html canvas, like so:</p>
  
  <pre><code>//output is a base64string of image data
  var oldImage = new Image();
  oldImage.onload = function () {
    var resizeRatio = oldImage.width / 500;
    var height = oldImage.height / 2;
  };
  oldImage.src = output;
  var standardizedCanvas = document.createElement("canvas");
  standardizedCanvas.setAttribute("width", "500px");
  standardizedCanvas.setAttribute("height", height + "px");
  standardizedCanvas.getContext("2d").drawImage(oldImage, 0, 0, frontCanvas.width, frontCanvas.height);
  </code></pre>
  
  <p>So I can read the image into the canvas, and then get the Image Data. But what does that really give me? I need a <code>byte[]</code> from the canvas, which contains the image data, so really I want to convert a <code>base64</code> string into a <code>byte[]</code>. Am I on the right track, or....?</p>