public static BufferedImage brighteningImage(Image img, int nBrightness) {
		BufferedImage bufImg = convert(img);

		for (int j = 0; j < bufImg.getHeight(); j++) {
			for (int i = 0; i < bufImg.getWidth(); i++) {
				int values = bufImg.getRGB(i, j);
				Color oldColor = new Color(values);

				int red = oldColor.getRed();
				int green = oldColor.getGreen();
				int blue = oldColor.getBlue();

				int newRed = (red + nBrightness > 255) ? 255 : red
						+ nBrightness;
				int newGreen = (green + nBrightness > 255) ? 255 : green
						+ nBrightness;
				int newBlue = (blue + nBrightness > 255) ? 255 : blue
						+ nBrightness;

				newRed = (newRed < 0) ? 0 : newRed;
				newGreen = (newGreen < 0) ? 0 : newGreen;
				newBlue = (newBlue < 0) ? 0 : newBlue;

				Color newColor = new Color(newRed, newGreen, newBlue);

				bufImg.setRGB(i, j, newColor.getRGB());
			}
		}
		return bufImg;
	}