Created
September 4, 2013 23:07
-
-
Save cvan/6444031 to your computer and use it in GitHub Desktop.
convert URI of image to data URI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Load an image in your browser and paste this in your console | |
var i=new Image();i.src=document.location.href;i.onload=function(){var c=document.createElement('canvas');c.width=this.width;c.height=this.height;c.getContext('2d').drawImage(this,0,0);window.location=c.toDataURL('image/png');}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment