The code below should be extracting the pixel data from the mapProvinceFile bitmap specificed and placing it into a byte array, modifying some of that color data depending on the contents of a custom ArrayList, vertically flipping the image, and then displaying the resulting modified image in a new pane.

Unfortunately, the image which is recreated appears to be identical to the original (apart from being flipped). This occurs despite the modified byte array being inside a databuffer which is used as the input for a raster which the resulting image then has applied to it by way of 'setData(raster)'.

The input is a very large unindexed 24bit bitmap. Here is an example file: provinces.7z

Here is the code: [Java] public DisplayImage(boolean resize, boolean mapCountries) throws IOException { -

Anybody know what could be wrong?

If anybody knows a faster way of swapping particular colors in a very large unindexed bitmap that would be useful as well. I was thinking of somehow converting it to an indexed bitmap and then swapping the color indexes, but I couldn't figure out any way to successful assign it/recreate it with a color index with Java.