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.