public void makeGrayScale()
	  {
		  int[] rgb = new int[3];
		  
		  for(int y = 0;y < height;y++)
			{
		  		for(int x = 0;x < width;x++)
				{
		  			getPixel(x, y, rgb);
		  			int gray = (int) java.lang.Math.round(0.299 * rgb[0] + 0.587 * rgb[1] + 0.114 * rgb[2]);
		  			if (gray > 255) 
		  				gray = 255; 
		  			if (gray < 0) 
		  				gray = 0;
		  			rgb[0] = rgb[1] = rgb[2] = gray;
		  			setPixel(x, y, rgb);
				}
			}
	  }