Retinize will upscale (using nearest neighbor) images to look correctly on retina screens. This is particularly useful for pixel art when you don't want to store an upscaled version.
// Construct an instance of Retinize, passing the element
var el = document.querySelectorAll("img.pixelart");
var retinize = new Retinize(el);
// Initialise
retinize.init();
To enable on all images with the class of 'retinize' simply call
$('img.retinize').retinize();
If you want to force the effect on all images reguardless of need use
$('img.retinize').retinize({ forceCanvas: true });
All available settings
var options = {
forceCanvas: false
};
- 0.1.0: Initial Commit