Dithering generator Generate dithering effect Example var dg = new DitherGen(canvas); var imgData = dg.testGradient(); dg.dither(imgData, 32); Output Download dithergen.js Github Markup test Test markup markup/testcode test. click me -- test .test