As a first step in image processing applications it is often required
to identify pixels above a threshold intensity level which contact one
another. Sorting marker particles when the particle images cover many
pixels is an obvious fluid mechanical application. With the present p
rocedure, the image is scanned line by line once. The procedure is rap
id, and can be continued across the boundary of the domain, for exampl
e, when the data is a long time series which must be artificially brok
en into ''image'' blocks for computer processing. The use of the algor
ithm is demonstrated on a variety of complex shapes, and estimates of
speed of execution are given. The timing results show that the increme
ntal time per bright region scales roughly as the square root of the n
umber of bright regions. In addition, if bright regions fill more than
(roughly) ten per cent of the total array space, the execution time p
er additional bright region becomes negligible.