Optimize.js is a Javascript Library for optimizing image and videos resolutions. Supports Retina.