var
colorCount:
array
[TColor]
of
integer
;
...
for
x...
y...
inc(colorCount[bitmap
.
canvas
pixels[x, y]]);