title: Include Image Data in JSON FabricJS
body: <p>I'm trying to use FabricJS canvas, and I'd like to export canvas as JSON.</p>
  
  <p>I've tried loading image using both <code>new fabric.Image</code> and <code>fabric.Image.fromURL</code> both of them work great.</p>
  
  <p>Now I want to get JSON from canvas. But I want 2 kinds of JSON. One where image's src would be link to a image which I used initially. Another would simply add base64 data right on JSON. So I tried to use <code>canvas.toJSON()</code> and <code>canvas.toDatalessJSON()</code>, but to my surprise, It simply gives same result with link, and none of them contain image data.</p>
  
  <p>How do I export to JSON which INCLUDES image data right on JSON? (I already got with the link)</p>
  
  <p>I've put together a small <a href="http://jsbin.com/bunosaduwi/edit?js,console,output" rel="nofollow noreferrer">demo</a> of what I have till now. Notice when you click on export and see on console, both objects have source link and none of them actually have base64 data.</p>
  
  <p>The reason I want base64 is because I want it instant when I re-use somewhere else.</p>
  
  <p>I tried searching over the internet, according to docs, toJSON should contain, but looks like it's only for shapes, and not image. Or did I miss something?</p>
  
  <p>Thanks in advance!</p>