A simple jQuery plugin to pixelate images, because I miss my Nintendo and high-resolution graphics are for suckers.
Check out the demo here.
- Include jQuery and jquery.pixelate.js
- Apply the
pixelate()
function, a la:
$(document).ready(function() {
$('img').pixelate();
});
- Revel in your newfound retro cred.
Right now, jquery.pixelate.js
exposes only two options, focus
and canvasID
:
focus
(whose default is 0.5) takes a value from 0 to 1 which roughly corresponds to pixel density (where 'pixels' become larger asfocus
approaches 0).canvasID
(whose default is 'pCanvas') takes a string which designates the ID to be applied to the<canvas>
elements generated by the plugin.
The general method comes from Ken Fyrstenberg's answer on StackOverflow.
MIT