title: Create base64 encoded images with JavaScript
body: <p>Since images are data, we can write our code as </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA
  AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO
  9TXL0Y4OHwAAAABJRU5ErkJggg==" alt="Red dot" /&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Now my point is: can we create that base64 data with javascript? Is there any framework for it?</p>
  
  <p>My actual requirement is that I have a string like "Cow" and I want it as an image. </p>
  
  <p>Note: I do not want a server call for it. I know I can call server side code by passing "Cow" as a parameter. My server side code can generate that image, but I want do this from the browser with JavaScript.  </p>