OpenImageIO/oiio — pull request #605 by lgritz (2013-05-26 04:59:38+00:00)
Title: ImageBufAlgo::color_count() and oiiotool --colorcount

Both can be used to count how many pixels match a given color or colors.

The oiiotool version works like this:

oiiotool rgb.tif --colorcount 1,0,0:0.18,0.18,0.18

would count how many pixels in the image are red, and how many are 18% gray. It might produce output like:

1830 1,0,0
20495 0.18,0.18,0.18

This was requested by a production user, it actually does have a purpose.