Extracting groups of adjacent non-white pixels
Given an image, I'd like to extract all groups of adjacent non-white [1] pixels by their rectangular bounding boxes:

Diagonally neighboring pixels (
) may or may not count as adjacent.
Can you give me a few pointers?
[1] (R, G, B < 255, 255, 255)