Hi,
I have a instance of BufferedImage. What I’m trying to do with this instance is to modify some pixels in it, by doing
bufferedImage.setRGB(x,y,rgba)
This works, that is, I get some results. But I do not get the right color!
It only seems to “allow” me to set a rgba value that exists in the “colorspace” of that bufferedImage instance. So, if I loaded up a image that is 4 colors, red, green, blue, black, then I cannot change any pixels to anything but red, green, blue, black. If I were to do change some pixels to, let’s say, cyan, then I would get weird results (no error/exception though).
I can’t seem to find a easy way to add a new color to the colorspace. Any ideas?
of course the WorldMap image should have contents to load. that means you may replace the blank image with one read from your favorite picture.