The color of each pixel is determined by comparing the bit XOR (exclusive or) of its row and column indices with the selected threshold.

The bit XOR of two numbers and can be constructed as follows: Represent and as binary numbers and . For each pair , , construct a bit , or, in words, is 0 if and only if exactly one of , is 1. Form the number from the binary digits .