[SOLVED] Simple Tilemap from Image file noob question :D

Hello JGO, bringing forth a rather nooby question tonight but I’m in need of help ;D

Lets say I have a Image that’s 2x2 and each pixel is colored green.

I want to scan the picture and detect if the pixels green. (completed)
I’d than like to render a tile which corresponds with the data in the image.

The problem I’m having is actually rendering on my map based off of the read data.

At the moment this is how I’m loading the map:


	public void preInit(double currentPercentage) {
		if (!loaded) {
			/* ...... */
			/* Map Loading */
			int[] pixels;
			try {
				final BufferedImage img = ImageIO.read(new File("res/textures/terrain/map_1.png"));
				final int width = mapImgW = img.getWidth(null);
				final int height = mapImgH = img.getHeight(null);
				tiles = new int[width * height];
				pixels = ImageUtils.getPixelsFromBufferedImage(img); // Correctly obtains pixels[]
				final int green = -14503604; // Green ^_^
				for (int i = 0; i < pixels.length; i++) {
					if (pixels[i] == green) {
						tiles[i] = 1; // Assign the tile type, 1 = green(grass)
					}
					//System.out.println("Number at slot " + i + " is: " + pixels[i]);
				}
			} catch (IOException e) {
				e.printStackTrace();
			}
			loaded = true;
		}
	}

If anybody could advise me on how I’d go about rendering the tiles please let me know ^_^, I’ve never done this before and I’m kinda stuck ATM ;o