Image Optimizer is a free extension for Visual Studio 2012 created by Mads Kristensen. It uses SmushIt and Punypng for optimization. You can get it from Extensions and Updates, search for “Image Optimizer”:
You need to restart Visual Studio and when you right click an image in the Project Window you will see this new options:
Optimize Image and Extract data URI to clipboard. You can see the results in the Output Window.