- Download https://gist.github.com/jsocol/1089733 and unpack
 - Rename 
data-uri.pytodata-uriand copy to/usr/local/bin/ - Open Terminal, 
cd /usr/local/bin/and and thenchmod +x data-uri(enter password when prompted) - Open Automator, choose New > Service.
 - Set up the service as follows:
Service receives selectedfiles or foldersinFinder.app
which is connected to aRun Shell Scriptaction, with the following settings:
Shell:/bin/bash
Pass input:as arguments 
  for f 
  do
    /usr/local/bin/data-uri "$f" | pbcopy
  done
And save as convert-to-datauri
See http://grab.by/nuCE for a visual overview.
Right click on any file and select the convert-to-datauri option in the Services submenu. The data URI is copied to the clipboard and is ready to be pasted.