Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
#! /bin/bash
x=`identify -format "%w" $1`
y=`identify -format "%h" $1`
data=`openssl base64 < $1 | tr -d '\n'`
type=`file --mime-type -b $1`
echo "display:block;
font:0/0 a;
color:transparent;
width:"$x"px;
height:"$y"px;
background:url('data:"$type";base64,"$data"');" | pbcopy
echo "Done."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment