I wouldn't think that there would be anything commercially available. Based on experience from learning C programming as an electronics engineering student in the mid 90's, it is the sort of thing that should be pretty simple to do with one of the scripting languages such as Python or Perl. Doing it with a JPEG image might be a bit hard, since you would have to uncompress the data and hold it in memory. Using an uncompressed 8 bit TIFF should be OK though, since it should be pretty easy to find the start of the image data in the file. All you would then need to do is read the value of each byte knowing which order each channel will be in just check the value of each of the three bytes against the ranges of values for each of your chosen colours and increment the relevant counter. Once you get to the end of the image data you just calculate the percentage of each colour against the total number of pixels.
If you are dealing with a group of bright high school aged kids I would hope that at least one of them has some programming skills in an appropriate language. Unfortunately I no longer have the C code and libraries that I used back then, nor a complier, or I would have offered to write something up for you in C. The lecturer was actually a biologist, and his research was in digital image recognition. So he provided us with a library that would read and write TIFF files, and our assignments were to write a range of image filters, sharpening, blur, and some basic interpolation filters were included. This was back in 93/94, when JPEG was a really new and clever format.
If I can supply any specific information that might help just drop me a PM.
Alan