public void setPixel(int x, int y, double r, double g, double b) {
		if (r < 0)
			r = 0;
		if (r > 1)
			r = 1;
		if (g < 0)
			g = 0;
		if (g > 1)
			g = 1;
		if (b < 0)
			b = 0;
		if (b > 1)
			b = 1;
		Color col = new Color((int) Math.round(r * 255.),
				(int) Math.round(g * 255.), (int) Math.round(b * 255.));
		img.setRGB(x - 1, y - 1, col.getRGB());
	}