retina.js is an open source script that makes it easy to serve high-resolution images to devices with retina displays

What the script does is loop all images and do a HEAD request to the guessed @2X version in order to see if it exists. On success the retina version will be loaded in. Of course you’ll need to keep your naming scheme consistent.

Retina graphics for your website →
Retina.js Source (GitHub) →

Published by Bramus!

Bramus is a frontend web developer from Belgium, working as a Chrome Developer Relations Engineer at Google. From the moment he discovered view-source at the age of 14 (way back in 1997), he fell in love with the web and has been tinkering with it ever since (more …)

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.