Method for high performance comparisons in canvas matrix