If you are using grunt, you can simply use the grunt-data-uri task to achieve a normal url () string conversation with base64.
dataUri: { dist: { src: ['dist/styles/*.css'], dest: 'dist/styles/', options: { target: [ 'img/low-res/embeded/*.*' ], fixDirLevel: true } } },
In essence, the task will look for all the images contained inside the built-in folder in your .css. From there, it converts url () to base64.
source share