@Override
	public void doChangeContrast(int contrastAmountNum) {
		if (imageManager.getBufferedImage() == null)
			return;
		double c = contrastAmountNum;
		double q = (c + 100) / 100;
		WritableRaster raster = imageManager.getBufferedImage().getRaster();
		double[][] newPixels = new double[raster.getWidth()][raster.getHeight()];
		for (int x = 0; x < raster.getWidth(); x++) {
			for (int y = 0; y < raster.getHeight(); y++) {
				double[] pixel = new double[3];
				raster.getPixel(x, y, pixel);
				pixel[0] = q*q*q*q * (pixel[0] - 128) + 128;
				if (pixel[0] > 255)
					pixel[0] = 255;
				else if (pixel[0] < 0)
					pixel[0] = 0;
				newPixels[x][y] = pixel[0];
			}
		}
		for (int x = 1; x < raster.getWidth() - 1; x++) {
			for (int y = 1; y < raster.getHeight() - 1; y++) {
				double[] pixel = new double[3];
				pixel[0] = pixel[1] = pixel[2] = newPixels[x][y];
				raster.setPixel(x, y, pixel);
			}
		}
		GUIFunctions.refresh();
	}