Having thought about it, I simply created a 255x1 BufferedImage and then used the GradientPaint class to create myself a colour lookup table. With this approach I can even load a manually created colour table. For anyone else:
// Set up the reference image that will be used as the color map
int width = 255;
int height = 1;
BufferedImage colorGradientImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
Graphics2D g2 = (Graphics2D) colorGradientImage.getGraphics();
Paint p = new LinearGradientPaint(
0, 0, width, 0, new float[] { 0.0f, 0.7f, 0.8f },
new Color[] { Color.YELLOW, Color.BLUE, Color.RED }
);
g2.setPaint(p);
g2.fillRect(0, 0, width, height);
g2.dispose();
// Now process the data, using the colour map we created above for the colour values
// pixel data is matrix of values, from 0-255
int[][] pixelData = getSourceValues();
BufferedImage myImage = new BufferedImage(pixelData[0].length, pixelData.length, BufferedImage.TYPE_INT_RGB);
for (int y=0; y<pixelData.length; y++) {
for (int x=0; x<myImage[y].length; x++) {
myImage.setRGB(x,y, colorGradientImage.getRGB(pixelData,0));
}
}
I could probably have converted the colorGradientImage to 255 length array, but for now this does the job.
If anyone knows of an alternative or better approach I am always interested.