Skip to content

klase/ditherjs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#ditherJS

A javascript library which transforms an element into a dithered image using a fixed palette.

###Usage: HTML:

<img src="..." class="dither" />

JS:

new DitherJS('.dither'[,options]);

or as a jQuery plugin

$('.dither').ditherJS(options);

options are defined as:

var options = {
    "step": n // The step for the pixel quantization n = 1,2,3...
    "palette": palette // an array of colors as rgb arrays
    "className": "dither" // can be whatever class used in the constructor
    "algorithm": "ordered" // can be "ordered" or "errorDiffusion"
};

the monochrome branch supports also "monochrome": true

Testimonials

Useful as a comb to a bald man. -Anon

Changelog

  • jquery plugin wrapper

author 2014 Daniele Piccone

license GPL