public static Image fill(Image img, int xSeed, int ySeed, Color col) {
		BufferedImage bi = new BufferedImage(img.getWidth(null),
				img.getHeight(null), BufferedImage.TYPE_INT_ARGB);
		bi.getGraphics().drawImage(img, 0, 0, null);
		int x = xSeed;
		int y = ySeed;
		int width = bi.getWidth();
		int height = bi.getHeight();

		DataBufferInt data = (DataBufferInt) (bi.getRaster().getDataBuffer());
		int[] pixels = data.getData();

		if (x >= 0 && x < width && y >= 0 && y < height) {

			int oldColor = pixels[y * width + x];
			int fillColor = col.getRGB();

			if (oldColor != fillColor) {
				floodIt(pixels, x, y, width, height, oldColor, fillColor);
			}
		}
		return bi;
	}