I want to write a program that maps the colours of a user-selected image to the closest matching colours in a given set. Here is the basic operation:
-User opens an image using the program
-The program checks the colour of each pixel in the image
-For each pixel, the program chooses the closest matching colour from a set of eight colours (red, green, blue, cyan, magenta, yellow, white, black)
-The program makes a new image from the 8 colours
-The program displays the new image
I have GUI programming experience in Java, but it's been some months since my last project (this is abit of a refresher).
I am looking for is suggestions on how to proceed. For example, useful classes, good methods of implementation (should I go through pixel by pixel?), etc.
-- Load your image
-- Create a IndexColorModel with the required colors
-- Construct a BufferedImage the same size as your image, of TYPE_BYTE_INDEXED and the index color model
-- Obtain the Graphics reference of the second image
-- Draw the first image to the second image
There are no new questions, but there may be new answers.