jquery-grayscale icon indicating copy to clipboard operation
jquery-grayscale copied to clipboard

Improve performance of grayscale calculation steps

Open developher-net opened this issue 13 years ago • 0 comments

The grayscale calculation involving nested loops that check properties of the image on every loop are inefficient. On top of that, the extra calculation to determine the pixel position based on the interation of the nested loops adds more overhead

This can be collapsed into a single iterative loop, without an inner calculation. Considering this loop runs literally thousands of times on even a small image, simplification makes for a significant performance improvement.

developher-net avatar Oct 24 '12 16:10 developher-net