{"id":244383,"date":"2016-08-11T12:57:34","date_gmt":"2016-08-11T19:57:34","guid":{"rendered":"http:\/\/css-tricks.com\/?p=244383"},"modified":"2016-08-12T06:40:26","modified_gmt":"2016-08-12T13:40:26","slug":"get-original-image-data-url","status":"publish","type":"post","link":"https:\/\/css-tricks.com\/get-original-image-data-url\/","title":{"rendered":"Get the Original Image from a Data URL"},"content":{"rendered":"
Someone wrote in asking how they might get the “original image” when all they had was the data URL version of the image. I’m not exactly sure how you get into that situation, but hey, I woke up in a trunk more than once.<\/p>\n
You can absolutely get the original back, by exploiting the wonderful powers of the browser.<\/p>\n
<\/p>\n
Here is the data they have:<\/p>\n
data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNLTItMmgyNHYyNEgtMnoiIGZpbGw9Im5vbmUiLz48cGF0aCBkPSJNMTAgMjBDNC40OCAyMCAwIDE1LjUyIDAgMTBTNC40OCAwIDEwIDBzMTAgNC40OCAxMCAxMC00LjQ4IDEwLTEwIDEwem0xLTE1SDl2MmgyVjV6bTAgNEg5djZoMlY5eiIgZmlsbD0iIzE2ODJGOCIvPjwvc3ZnPgo=<\/code><\/pre>\nPlop that sucker in an <img><\/code> tag and open in the browser and you’ll see it render:<\/p>\n