public void quantizeImage(ImageBean img)
	{
		int[][] newPix = new int[img.getWidth()][img.getHeight()];
		for (int x = img.getWidth(); x-- > 0; )
			for (int y = img.getHeight(); y-- > 0; )
				newPix[x][y] = img.getPixels()[(y * img.getWidth() + x)];
		int[] newColMap = Quantize.quantizeImage(newPix, 254);
		for (int x = 0; x < img.getWidth(); x++) {
			for (int y = 0; y < img.getHeight(); y++) {
				img.pixels[(y * img.getWidth() + x)] = newColMap[newPix[x][y]];
			}
		}
		for (int i = 0; i < img.pixels.length; i++) {
			int[] rgb = unpack(img.pixels[i]);
			if ((rgb[0] == 255) && (rgb[1] == 0) && (rgb[2] == 255))
				img.pixels[i] = 0;
		}
	}