The Retinex .8bf Plugin
Version 1.201, updated 6/5/2018
Retinex image processing attempts to imitate the lightness and color perception of human vision. The image is first mapped to a logarithmic scale, then a Gaussian blurred copy is subtracted as in unsharp masking. The resulting logarithmic values are then scaled to the range of visible image values.
Retinex is best suited for rescuing underexposed or badly color balanced images, or for extracting detail for scientific or technical purposes. It is not always useful for enhancement of well-exposed naturalistic images. For this, histogram equalization, adaptive contrast, or high-radius unsharp masking may be superior. Related techniques include the shadows/highlights and exposure/gamma controls. (And don’t forget auto levels and curves.)
The filter is based on the Very High Radius Unsharp Mask filter, and uses the same Gaussian blur technique which is suitable for very large images.
• The Radius setting (sometimes called “Scale”) is a percent of the image diagonal, so it is independent of the actual image size. The apparent and preview-scaled radii in pixels are also displayed. Lower values produce visible halos, which fade at higher values. There is a tradeoff between dynamic range compression at small radii, and improved tonal rendition at large radii. Three radii are actually used (multiscale retinex; the number is sometimes called “Scale division”); the image is processed three times at three different radii (2 pixels, the indicated radius, and 2× the latter), and the three images averaged together. This tends to result in increased sharpness, “clarity,” and uniformity, but may also increase noise. Multi is the weight of the multiscale effect; setting this to zero results in single-scale retinex.
• Contrast (sometimes called “Dynamic”; equivalent to “gain” in the literature) stretches the output histogram. It determines how many standard deviations of pixels are included in the range of image values (the default is 1.5 s.d. on each side of the mean), and is thus adapted to each image. Brightness (equivalent to “offset” in the literature) shifts the histogram to the left or right.
• Unlike most of the filters, the luminosity and color components of the retinex effect are independently adjustable. If the only effect desired is color balance, for example, set Luminosity to zero and adjust Color. For grayscale images, Luminosity is renamed to a simple Amount control.
• Vibrance preferentially increases the saturation of less-saturated areas of the image.
• CR refers to color restoration. It often has surprisingly little effect; it is included based on the literature.
• To map the logarithmic values back to a linear scale, use Linear mode (the Log/Linear button). The filter is then called homomorphic, not retinex. Linear values sometimes have better tonal rendition, but not as good color correction. Color restoration does not work with linear values and is not applied.
• Raise the lower black slider in Blend Ranges to gradually fade the sharpening effect in the shadows; lower the upper white slider to similarly fade the highlights. A large color difference between the original and processed image may affect the results.
• Hue, Chroma, or Luma histograms may be selected. The white histogram (background) is the original image; the black one (foreground) is the processed image.
The plugin works with 8- or 16-bit RGB and grayscale images.
Improvements to version 1.2:
• independent adjustment of the luminosity and color components
• an improved progress bar
• fixed a bug in the radius adjustment
Improvements to version 1.201:
• reduced memory requirements; should run better on larger images, 10,000 pixels or more.
|Glenn Woodell’s dog Sally from the NASA site.||Single scale retinex.||Multiscale retinex; a little more sharpness and uniformity.||Partial original colors with some extra vibrance, and a blend range for the highlights.|
|South Solon from the air by Nyttend.||Processed separately for the earth and sky.|
Vivek Agarwal. Achieving Color Constancy and Illumination Compensation. [PDF]
Daniel J. Jobson, Zia-ur Rahman, and Glenn A. Woodell. A Multiscale Retinex for Bridging the Gap Between Color Images and the Human Observation of Scenes. [PDF]
Ana Belén Petro, Catalina Sbert, Jean-Michel Morel. Multiscale Retinex. [PDF]
Zia-ur Rahman, Daniel J. Jobson, Glenn A. Woodell. Retinex Processing for Automatic Image Enhancement. [PDF]
Zia-ur Rahman, Glenn A. Woodell and Daniel J. Jobson. A Comparison of the Multiscale Retinex With Other Image Enhancement Techniques. [PDF]
Retinex Image Enhancement Techniques by Zhixi Bian and Yan Zhang. [PPT]
Fast RETINEX for Color Image Enhancement: Methods and Algorithms by Analysa M. Gonzales and Artyom M. Grigoryan. [PDF]
Land’s Retinex algorithm by Edward Adelson. [PDF]
More informationRetinex Image Processing at nasa.gov The Gimp plugin The ImageJ plugin RawTherapee now includes retinex for raw images.
Download the zipped file, then copy the plugin, the help file, and the demo registration key into your plugins folder. The filter will appear under “RC Filters.”
Retinex_x64.zip version 1.201, 440 KB, 64-bit applications.
Retinex.zip version 1.201, 434 KB, 32-bit applications, Windows 32 or 64 bit.
Windows XP versions
MD5 Checksum: A536874D655F594D03D04A59CA879FE1
SHA-256 Checksum: 1D786D4AD153A8638176369E82708DC1BD4BA818DB9601D6FB5F1CC867633C13
MD5 Checksum: D764C6E8D66D56537094EE22F989D4E6
SHA-256 Checksum: 4F5156687D93511F96B87B64F186604FBF93D77FFB038A96CF1A5CECE9427DCB
The unregistered filters will save images up to 720 pixels in width and/or height. Please purchase a registration key for $9.00 which unlocks all of the RC Filters. Use either of the secure links below and I will e-mail you a text file (RCFKey.txt) to copy into your plugins folder. Be sure to use a valid e-mail address (I don’t sell or give them away). I check my e-mail for payment notifications every morning, Pacific time, and other random times; if you do not receive a key within one day it means I am in the hospital. If you paid for any of the RC Filters before keys were used, email me and I will send you a key. The filters come with a demo key; if properly installed, the dialog will say “Demo key” when you click the About button. Questions . . . .
The filters, the help files, and the registration key all go into the same folder. It may help to make an RC Filters subfolder. Each filter has a link back to the plugin folder on the About dialog for easy access.
© 2018 by Russell Cottrell; released under the
GNU General Public License.