Image Contrast

Stretch image colors away from mid-gray.

Use this tool

Drop a file here, or use the picker. The file type is checked from its contents.

Result

The result appears in this panel after you run the tool.

About this tool

Each channel is pulled away from mid-gray by the 259 contrast factor and then clamped to the 0–255 range. Alpha is left as it was.

This is a pixel adjustment. It does not sharpen edges. Sharpen Image is the convolution for that.

How to use it

  1. Choose an image.
  2. Set the contrast amount.
  3. Adjust contrast. Channels are clamped to 0–255.

Limitations

Distance from mid-gray, then a hard clamp

The 259 factor

Contrast pushes each channel away from 128, or toward it, using the factor (259 times (amount plus 255)) divided by (255 times (259 minus amount)). Each channel is then rounded into the closed interval from 0 to 255. Alpha stays at its old value. Amount zero is the identity, because the factor becomes one. Positive amounts stretch distance from mid-gray, so near-black and near-white move apart until the clamp flattens them. Negative amounts pull channels toward 128 and the picture looks flatter. This is the usual integer contrast formula, not a filmic curve and not a local contrast filter that hunts edges.

Dimensions do not change. The pass sees one bitmap. Later frames of an animation are outside that bitmap.

Encode after the stretch

The stretched channels are the edit. Preserve intent then writes the source type when the browser can. Quality is a range whose starting point is 0.92. It is consulted for JPEG and for WebP. For AVIF it is consulted only after two AVIF quality settings are shown to change file length. Contrast does not consult it for a PNG stretch, a GIF stretch, a BMP stretch, an ICO stretch, or a HEIC stretch rewritten as PNG. The control is disabled in those cases, and no quality number is passed. Missing AVIF support substitutes PNG and keeps the stretched samples there, alpha included when the canvas had alpha.

GIF storage still quantizes to a 256-color palette, so a contrast boost that created smooth ramps can band when the palette is small. BMP storage is 24-bit with partial transparency flattened on white.

Contrast, then a second lossy save

A JPEG that you contrast and then save again compounds the clamp with a new quantization. Edges that the factor pushed to 0 or 255 stay stuck. Midtones that survived the factor can still pick up blockiness on the next write. Set the amount on the original, choose the JPEG quality once, and keep that download. A PNG holds the clamped formula output without a quality argument, which makes it the better intermediate if you are still deciding how strong the stretch should be.

Privacy

Your input is processed in your browser and is not uploaded to UtilChain. File names, text, and results are not sent to analytics.