Brightness & contrast adjuster
Brighten or darken any photo and fine-tune its contrast with two live sliders. This is a quick way to rescue an underexposed snapshot, flatten a high-contrast scan, or add punch to a dull product photo — all without installing editing software and without your image leaving your device.
How it works
The image is loaded into a <canvas> and every pixel is transformed channel by
channel. Both sliders run from −100 to +100. Brightness is mapped to an offset
b = (brightness / 100) × 255, and contrast to c = (contrast / 100) × 255. A
standard contrast factor is computed:
F = (259 × (c + 255)) / (255 × (259 − c))
Each colour channel then becomes F × (value + b − 128) + 128, clamped to the
0-255 range. Subtracting 128 first means contrast scales around mid-grey, so
lights and darks move apart symmetrically.
Example
| Setting | Effect |
|---|---|
| Brightness +40, Contrast 0 | Each channel gains 102 (40% of 255) — a noticeably lighter image |
| Brightness 0, Contrast +50 | F ≈ 2.0; darks get darker, lights get lighter for more punch |
| Brightness −20, Contrast −30 | Slightly darker and flatter, useful for harsh scans |
The preview updates instantly and everything runs in your browser, so your image is never uploaded.