IMG · Images tools

Retinex Filter (Multiscale Retinex)

Shareable link

Settings are written to the URL as you change them. Nothing differs from the defaults yet.

Retinex treats a photo as two things multiplied together: the surfaces in the scene, and the light falling on them. The light changes slowly across the frame and the surfaces change quickly, so dividing each pixel by a blurred copy of its surroundings removes most of the light and keeps the surfaces. Multiscale Retinex does this at three blur sizes and averages the results.

What it is good at

  • A subject against a bright window or sky, where the subject is nearly a silhouette.
  • A room lit from one side, with one half two stops darker than the other.
  • Night and dusk shots where the detail exists but sits in the bottom tenth of the range.
  • Scans and photos of documents, whiteboards and specimens with a lighting gradient.
  • Fog, smoke and underwater scenes, with the cast-correcting mode.

On a photo that is already evenly lit, the result is a flatter, more detailed version of the same picture, close to a tone-mapped HDR look. Lower Strength for that case.

Strength

Strength mixes the original with the full Retinex result. At 100 the lighting is removed as far as the method can; the picture can look flat, because the difference between the lit side and the shadow side is part of what made it read as a scene. The default of 80 keeps some of it.

Scale

Scale is the size of the largest neighbourhood, as a share of the short side of the image. The two smaller neighbourhoods follow it.

A small scale, under 10, compares each pixel with its close surroundings. Texture and fine detail come up strongly and large areas go toward the same grey. A large scale, above 25, only removes lighting that changes slowly across the frame, and leaves local contrast closer to the original. The default of 20 suits most photos.

Because the scale is relative, the preview and the full-size download use the same proportions.

Contrast

After the lighting is divided out, the values have to be placed back into a visible range. The filter measures their mean and spread, and maps a window around the mean to black and white. Contrast sets the width of that window. Low values keep nearly everything inside it and look soft. High values clip the darkest and brightest areas and look harder.

Keep colours or correct a cast

Keep original colours works on intensity and multiplies the three channels of each pixel by one gain. A red jacket in shadow comes up as the same red, brighter. The gain is capped so no channel passes white and so the darkest pixels are not multiplied without limit.

Correct colour cast runs the comparison on red, green and blue separately. Each channel is judged against its own surroundings, so a scene that is blue everywhere loses the blue. This is the classic MSRCR form. Its side effect is known: large areas of one colour drift toward grey, because a channel that is high everywhere is treated as lighting.

Example: a backlit portrait

A person stands in front of a window. The face sits around 15% brightness and the window is clipped. Load the photo, keep the defaults, and the face rises to mid-tones while the window frame and curtains gain detail. If a bright rim appears around the head, raise Scale to 30. If the face looks grey, lower Contrast or bring Strength down to 60.

Limits

The method assumes lighting changes slowly. A hard shadow edge breaks that assumption and produces a halo on both sides. Noise in dark areas is raised with everything else, so run a denoiser first on a high-ISO photo. Clipped highlights stay clipped.

Frequently Asked Questions

It takes a JPEG, PNG or WebP and removes much of the difference in lighting across it. Dark areas come up, areas brighter than their surroundings come down, and local detail gains contrast. The download keeps the format of the file you loaded.

A shadows slider maps each brightness to a new one, so two pixels of the same value always end up equal. Retinex compares each pixel with the average around it, so a mid-grey pixel in a dark corner is raised and the same grey in a bright sky is lowered. That is why it can open up a backlit subject without washing out the background.

Keep original colours scales red, green and blue together, so hue and saturation survive. Use it on any photo whose colours are already right. Correct colour cast runs the filter on each channel separately, which pulls a tinted scene toward neutral. Use it for underwater shots, sodium street lighting or fog, and expect lower saturation.

A pixel next to a strong edge is compared with a neighbourhood that straddles the edge, so the bright side reads as brighter than its surroundings and the dark side as darker. Raising Scale widens and weakens the halo. Lowering Strength mixes the original back in.

No. It redistributes the tones in the file. An area that is pure black or pure white has nothing to bring out, and raising a very dark area also raises its noise and JPEG blocks.

Correct colour cast is the same method, MSRCR, with three scales and a colour restoration term. Keep original colours is the intensity-only variant, MSRCP, which GIMP does not offer. Contrast plays the part of GIMP's Dynamic slider, in the other direction.

Explore Our Tools

Browse all tools