Skip to content

Latest commit

 

History

History
33 lines (20 loc) · 1.02 KB

README.md

File metadata and controls

33 lines (20 loc) · 1.02 KB

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

  1. Include jQuery and jquery.pixelate.js
  2. Apply the pixelate() function, a la:
$(document).ready(function() {
	$('img').pixelate();
});
  1. 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 as focus 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