Using Decorrelation Stretch to Enhance Rock Art Images

By Jon Harman, Ph.D.  ( 

Web site:

Originally presented at American Rock Art Research Association Annual Meeting May 28, 2005. Updated May, 2008.


Decorrelation stretch, an image enhancement technique first used in remote sensing, can be usefully applied to rock art.  In pictograph images from Baja California, California, and Nevada I demonstrate its ability to bring out elements nearly invisible to the eye and to improve visualization of difficult sites.  A decorrelation stretch plugin to the imaging program ImageJ is available from the author for a $50 contribution.

San Borjita
        3174 original  San Borjita 3174 enhanced YDS  San Borjita 3174 YBK

Figure 1. Cueva San Borjita, Baja California Sur.  Left: original, Center: decorrelation stretch in colorspace YDS, Right: YBK.


Decorrelation stretch was developed at JPL.  For a history of development see [4].  It has been used in remote sensing to enhance multispectral images [2].   NASA has used it to enhance Mars Rover images [5].

I have modified and implemented this technique in the DStretch plugin to ImageJ [1].  The plugin has options intended to be useful in rock art research.

DStretch is a useful tool for archaeologists involved in the study and documentation of rock art.  Its enhancement techniques can bring out very faint pictographs almost invisible to the eye.  Subtle differences in hue are enhanced which can give clues to superposition. Pictographs can be enhanced for publication or presentation to viewers not capable (or inclined) to puzzle out faint elements.  Use of DStretch can be as simple as just hitting a button, but it also contains sophisticated tools for the manipulation of false color images.  Because the enhancement works by increasing differences in hue, the technique gives better results for pictographs than petroglyphs.


The technique consists of applying a Karhunen-Loeve transform to the colors of the image.  This diagonalizes the covariance (or optionally the correlation) matrix of the colors.  Next the contrast for each color is stretched to equalize the color variances.  At this point the colors are uncorrelated and fill the colorspace.  Finally the inverse transform is used to map the colors back to an approximation of the original.  Other names for related techniques are Principal Components Analysis and Hotelling transformation  [2] [3].  There is a good explanation of the mathematics involved on the web [4]The decorrelation stretch calculation produces a 3x3 transformation matrix that is then applied to the colors in the image.  DStretch supports several different colorspaces (see below).  The image is converted from RGB to the colorspace, the calculation and transformation is performed, and then the colors are converted back to RGB before writing into a digital image.

Tule River Painted Rock Original  TUL-19 LDS  TUL-19 LRE

Figure 2. Tule River Painted Rock. (TUL-19)  Left: original, Center: decorrelation stretch in colorspace LDS, Right: LRE.


Each image enhances differently depending on the distribution of colors, colorspace chosen, and whether the inverse transform is used to map the decorrelated colors back.  After some experience with the algorithm I am beginning to see some trends, but my observations must be considered preliminary at this point.   The most common color found in pictographs (in my experience) is red, followed by black, then white, then rarely other hues.  Often the rock shelter or cave wall is reddish or blackened.  Thus there are common types in the color distributions of pictograph images and this causes there to be consistency in the decorrelation stretch enhancements.

When investigating stretch possibilities in RGB colorspace, I noticed similar, very striking, enhancements in several red pictograph images.   I created an enhancement matrix that reproduced those striking results and made it accessible from the plugin (CRGB button).  This enhancement gives consistent results over many different input color distributions.  It works well to enhance red pigment but suppresses white and blacks.  By bringing out the red painting and suppressing the background shades it can help clarify image composition.

I also began to experiment with modifications to colorspaces.  The shape of the color distribution of an image can be manipulated to effect the decorrelation stretch result. Based on my experience with rock art images I developed several custom colorspaces that can give good enhancements.

Burham Canyon Original  Burham Canyon
          Custom RGB

Figure 3. Burham Canyon (KER-273).  Left: original.  Right: CRGB.  Note improved visibility of red pigments and the small creature at left center brought out by enhancement.

Program Features

DStretch is a plugin to ImageJ which is a full-featured imaging program.  It is written in Java and can run on PCís, Macís and Linux computers.   Information on its capabilities can be found at [1].  This section will focus on the DStretch plugin features.

The program contains colorspace buttons which perform a decorrelation stretch in the colorspace.  When the button is pressed the plugin calculates the covariance matrix of the image colors (within the chosen colorspace) and then determines the transformation.  The transformation is a 3x3 matrix that multiplies the original colors to give the enhancement colors.  If an area selection is made within the image the calculation will be restricted to the pixels inside the area.  The transformation is then applied to the entire image.  This allows the exclusion of parts of the image that may have little to do with the area of interest, say a green bush at the side of a pictograph panel.  Different decorrelation results are possible by selecting different parts of the image.

Different colorspaces give different results.  I have implemented the algorithm in the standard RGB and LAB colorspaces and also in the colorspaces I have created myself: YDS, YBR, YBK, LDS, LRE.  These colorspaces are modifications of the YUV or LAB colorspaces that I have found to give good decorrelation stretch results on images of rock art.  The YDS and LDS coorspaces are good for general enhancements and can bring out faint yellow pigments.  YBR and espeically LRE enhance reds.  YBK can help with black and blue pigments and also enhances yellows well.

The user can design their own colorspaces using the YXX and LXX buttons.

The enhanced image is false color, i.e. the colors in it can be radically different from the original.  The contrast between different hues can vary a great deal and sometimes the enhanced image has poor contrast between desired elements.  DStretch (in expert mode) has the ability to shift the hues in the enhanced image to increase contrast.

Each image enhances differently, depending on its own unique distribution of colors.  It is possible to save a transformation matrix that was calculated on one image and apply it to others.  This can give more consistent transformations.  I have saved several matrices that I have found useful .  The user can access these matrices using the "Builtin" button.

Another useful enhancement technique, not related to decorrelation stretch, is the manipulation of the hue and saturation of the image.  DStretch (in expert mode) can do hue histogram equalization and saturation stretching.

DStretch also contains a tool that allows a region of the enhanced image to be isolated by hue and then added back to the original image.  This can be used to isolate an enhanced element then return it to the original image.


[1] ImageJ web site:
[2] Gillespie, et al. 1986: Color enhancement of highly correlated images. I. Decorrelation and HSI contrast stretches. Rem. Sens. Environ., 20, 209-235.
[3] Gonzalez and Wintz, 1977: "Digital Image Processing", Addison-Wesley, Reading, MA.
[4] Ronald E. Alley, 1996, Algorithm Theoretical Basis Document for Decorrelation Stretch, NASA, JPL.
[5] Mars Exploration Rover Mission Press Release, July 1, 2004, NASA,JPL:


Thanks to Bob Mark for the suggestion to investigate decorrelation stretch and for help in program debugging.  Thanks to Sheila Harman for advice and support.

DStretch Home