Home / Image Tools / Brightness and Contrast Image Tool
Free online tool

Brightness and Contrast Image Tool

Adjust brightness and contrast of an image by entering values. Contrast is applied first, then brightness. Download the result as PNG. Processing takes place…

Start using

How the Brightness and Contrast Adjustment Works

This tool adjusts the brightness and contrast of an image by modifying the RGB values of each pixel. The processing is done in a specific order: contrast is applied first, then brightness. The contrast operation expands or contracts the distance of each channel value from 128 (the midpoint), while the brightness operation adds a constant offset to all channels.

The formula for contrast is: f = 259 * (contrast + 255) / (255 * (259 - contrast)), then c1 = f * (c - 128) + 128. After that, brightness adds 255 * brightness / 100 to c1. Only the final result is clamped to the range 0-255 and rounded to the nearest integer.

Because the operations are not commutative, the order matters. Reversing the order would produce different results. This tool always applies contrast first, then brightness.

Controls and Inputs

The interface provides two numeric input fields for brightness and contrast. Both accept values from -100 to 100. The default brightness is 10, and the default contrast is 20. There is no live preview; you must click the Generate button to apply the changes. After generation, you can download the resulting image as a PNG file.

There is no option to select an output format, apply a local-region mask, or perform histogram-based auto-correction. The tool works on the entire image uniformly.

Example: Adjusting a Specific Image

Consider an image with a pixel color of RGB(100, 160, 240). If you set brightness to 20 and contrast to 25, the tool processes as follows:

First, contrast is applied: f = 259 * (25 + 255) / (255 * (259 - 25)) = 259 * 280 / (255 * 234) ≈ 1.214. Then for each channel: c1 = 1.214 * (c - 128) + 128. For red: 1.214 * (100 - 128) + 128 ≈ 94.0, green: 1.214 * (160 - 128) + 128 ≈ 166.8, blue: 1.214 * (240 - 128) + 128 ≈ 264.0. Then brightness adds 255 * 20 / 100 = 51 to each: red becomes 145, green becomes 217.8, blue becomes 315.0. After clamping to 0-255 and rounding, the final color is RGB(145, 218, 255). Note that the blue channel clips at 255, losing detail in highlights.

Limitations and Practical Considerations

This tool performs an RGB transform on decoded raster pixels, not a RAW exposure recovery. Strong adjustments can cause loss of detail in shadows or highlights, and changing the sign of a value does not reliably undo a clipped result. For example, if you increase brightness too much, highlights may clip to white, and decreasing brightness later will not recover the lost information.

When using the tool on a mobile device, you can choose a file, enter both values, tap Generate, and then Download. The tool does not provide a live preview, so you may need to experiment with different values to achieve the desired effect.

For best results, compare the processed image with the original to see how shadows and highlights are affected.

Checklist for Using the Tool

  • Select a clear, well-lit image for best results.
  • Start with small adjustments (e.g., brightness 10, contrast 20) and increase gradually.
  • Check for clipping in highlights and shadows after generation.
  • If the image looks too dark or too light, adjust brightness first, then fine-tune contrast.
  • Remember that the order of operations is fixed: contrast first, then brightness.

Frequently Asked Questions

What is the difference between brightness and contrast?

Brightness adds a constant offset to all pixel values, making the entire image lighter or darker. Contrast changes the spread of pixel values around the midpoint (128), making dark areas darker and light areas lighter, or vice versa. They are not interchangeable: brightness shifts all channels uniformly, while contrast expands or compresses the distance from 128.

Why does the output image look different from what I expected?

The tool applies contrast first, then brightness. If you reverse the order, the result will differ. Also, because the final result is clamped to the 0-255 range, strong adjustments can cause clipping, which loses detail in highlights or shadows. This is a normal limitation of RGB image processing.

Can I undo the adjustments if I make a mistake?

If the image has not been clipped, you can apply the opposite values to approximately reverse the effect. However, if any channel was clipped (reached 0 or 255), the original information is lost, and reversing will not restore it. It is always best to keep a copy of the original image.

Processing takes place locally in your browser.