Hello, I don't know wheather my title was clear enough but i was wondering. How would i go about setting certain colours such as "0xff00ff" to lets say a grass block. and when ever there is that colour "0xff00ff" on a .png file it places it in the world. Is this complicated to. PS i am making a 2D game so its not a 3d game. Also another example would be this would be from Notch's Metagun game from the ludum dare competition:

The problem is, sometimes ImageIO will load an image using a type other than TYPE_INT_ARGB. So it might be backed by a byte[] array, or an int[] array of TYPE_INT_RGB. A simple solution is to create a new image of the necessary type. The benefit of this method is that you can modify the pixel array to change how the image is rendered.

In your case, since you don't need to render the buffered image, you might rather use this (which will do the type conversion for you):

As for how to implement something like this.. there are many ways. I like using enums for small projects. You could also use EnumMap or HashMap to query the colors. Here is one possible implementation:http://www.java-gaming.org/?action=pastebin&id=432

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org