jquery.pixelate.js
A simple jQuery plugin to pixelate images, because I miss my Nintendo and high-resolution graphics are for suckers.
Check out the demo here.
Getting started
- Include jQuery and jquery.pixelate.js
- Apply the
pixelate()
function, a la:
$(document).ready(function() { $('img').pixelate(); });
- Revel in your newfound retro cred.
Options
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.
Credit
The general method comes from Ken Fyrstenberg's answer on StackOverflow.
License
MIT