Pixels on each tile are examined in row-major order. If a pixel is an unmarked nonzero-pixel, a breadth-first search procedure starting at that pixel labels all like-colored connected pixels situated on that tile with a globally unique label. A pixel is marked when visited only if it is a 0-pixel, or part of the current connected component.