Easiest way is probably convert it to greyscale then get a script to return the percentages of colors.Then just see how tall and wide the image is by that 2km bar, and do a little multiplication. I'm too tired to try it right now (I don't have the script handy), might see about it tomorrow tho.
Hell it might even work without converting it.