The documentation gives these parameter descriptions:
The images that I want to represent using IndexColorModel will be user-selected, so the image dimensions are not fixed. If it makes things much simpler, I can restrict the user to selecting an image of a fixed format, such as only GIF or only JPEG.
The eight colours I want the IndexColorModel to have are: red, green, blue, cyan, magenta, yellow, white, black.
Could anyone please explain what the parameters mean in this case? Then I can try filling them in.