jQuery Image Halftone

Feb 24, 2013 in jQuery, Javascript

Below is javascript implementation of Floyd-Steinberg dithering algorithm to convert image into two-color (black and white) version. I wrapped the code in form of jQuery plugin however it can be extracted to to separate function.


The list of possible settings includes:

Usage example

Here is a some possible usage example:

    output: 'image'

The example above will process image with id image and replace it with new converted version (image).

    output: 'image',
    target: function($new) {

This example with not replace original image but instead will append new image to body.


comments powered by Disqus