Magento – how to use retina product images

imagemagento-1.7product-images

How are you implementing Retina product images in Magento? I've seen a few commercial themes on the web doing it, but I'm not sure how.

Using something like Retina.js hasn't worked either for both product images and static block images.

Best Answer

Aren't retina images just images with a higher pixel density? You could detect and switch it by detecting this density

var retina = window.devicePixelRatio > 1;
if (retina) {
 // the user has a retina display 
} 
else {
 // the user has a non-retina display 
}

To make it clean you could make a regular name image and the image-retina, like that you could get the image src, add -retina and put the src back.

Posted this as an answer as Tim suggested.