kangax/fabric.js — pull request #627 by aleph1 (2013-05-11 16:30:37+00:00)
Title: Optimized Grayscale Filter performance and footprint

Changed from "for" to "while" loop and reduced number of variables.

It is possible to get even better performance by assigning the average
amount in a single line, or by dropping the average variable and doing
a direct assignment (See:
http://jsperf.com/fabric-js-grayscale-benchmark/5), however I wasn't
sure if this is against the project's coding guidelines.