There's a freely available library which allows you to read and write
PNG files. It can be used in C and other compiled languages. We use
this in a couple of products, and it works very well.
http://www.libpng.org/pub/png/libpng.html
If you decide you want to do the job in C, I can probably give dig up
a bit of code to get you started with reading and writing the file and
reading and writing the image data once you have it in memory.
I'm fairly sure this job could be done in Java as well. I have a
colleague who rents some office space from us who is a Java expert.
He assures me that Java has functions for reading and writing PNG
files and that it's possible to access the image data as well.
Off the top of my head, here's an easy way for the program to do the job.
What if you created a grayscale image where a given gray level
represents a region you wish to colorize? For example, the region of
Nevada might be gray level 1, California might be 2, etc. For an 8
bit grayscale image, that gives you a maximum of 256 different
regions. If you need more, you could use a 16-bit image for 65536
regions – PNG supports both bit depths.
Then, you could produce an XML data file associating regions with a
count of plots. For example, region 1 (Nevada, in our example) might
have 1100 plots, and region 2 (California) might have 300.
You would also need a file which associates plot counts with a RGB color.
The computer program could put this all together. It would read the
two data files and the input image and create a color image for
output. To fill the color image, it would traverse the pixels of the
grayscale input image. For each pixel it would check the gray value
to determine what region the pixel belongs to. Then, it would look up
the plot count for that region and the color for that plot count and
write the appropriate color to the output image.
For each geographical scale, you would need a separate grayscale image
and XML data file containing plot data. You could reuse the color
mapping file though.
This plan assumes that every pixel in the output is associated with a
region. If you have other map details, you could read a second color
input image instead of creating a blank one and use the grayscale
image to colorize it. Some specific gray level (such as zero) could
indicate an area that doesn't contain a gray level and isn't affected
by colorization.