Skip To Content

Stretch function

Overview

The Stretch function enhances an image by changing properties such as brightness, contrast, and gamma through multiple stretch types.

The Stretch function uses the statistics from the rasters within the mosaic dataset; therefore, if you use this function, you must make sure statistics have been calculated.

The following images show an example of a stretch. Histogram A represents the pixel values in image A. By stretching the values (shown in histogram B) across the entire range, you can alter and visually enhance the appearance of the image (image B).

A linear histogram stretch

Notes

The stretch type defines a histogram stretch that will be applied to the rasters to enhance their appearance. Stretching improves the appearance of the data by spreading the pixel values along a histogram from the minimum and maximum values defined by their bit depth. For example, an 8-bit raster dataset or mosaic dataset will be stretched from 0 to 255. Different stretches will produce different results in the raster display.

Parameters

ParameterDescription

Raster

The input raster to contrast stretch.

Type

Choose the stretch type method:

  • None—No contrast stretch
  • StdDev—Standard deviation stretch
  • MinMax—Minimum-Maximum stretch
  • PercentMinMax—Percent clip stretch
  • Sigmoid—Sigmoid stretch

Output Minimum

Set the lowest pixel value for the histogram.

The Output Minimum and Output Maximum will set the range of values that will then be linearly contrast stretched.

Output Maximum

Set the highest pixel value for the histogram.

The Output Minimum and Output Maximum will set the range of values that will then be linearly contrast stretched.

Standard Deviation n

Specify the n value for the number of standard deviations to use. This method is used to emphasize how much feature values vary from the mean value; it is best when used on normally distributed data.

Percent Clip Minimum

Specify the percentage of the low values to exclude from the stretch.

Valid values range from 0 to 99.

Percent Clip Maximum

Specify the percentage of the high values to exclude from the stretch.

Valid values range from 0 to 99.

Sigmoid Strength Level

The Strength Level determines how much of the sigmoidal function will be used in the stretch. A low value such as 1 will only use the middle portion of the curve, which tends to produce dull and faint colors. A high value such as 6 will use the entire curve, which tends to produce bold and sharp colors.

Estimate Statistics

Check the Estimate Statistics check box if you want to estimate your statistics. The estimated statistics are calculated from a 1000 by 1000 sampling from the center of the raster and used by the stretch.

If this is checked and the raster has statistics, or you've entered values in the Statistics table, they will be used instead of estimating, unless the stretch requires a histogram. If the stretch requires a histogram that doesn't exist, it will be estimated.

Dynamic Range Adjustment

Check the Dynamic Range Adjustment check box if you want the statistics calculated from only the pixels displayed on your screen. This option is generally applied when the image will be published and used in a web app that cannot perform this type of stretch.

Statistics

You can enter your own statistics on the dialog box. By default, the statistics are retrieved from the data; however, any values you enter in this parameter will be used instead.

Auto Gamma

Use Auto Gamma to calculate gamma from the statistics and histogram of the dataset. The statistics can be the estimated stats by the function itself, or the statistics can be estimated by the software if you chose a layer.

Use Gamma

Check the Use Gamma check box if you want to apply a gamma stretch.

Gamma

Use the slider bar to manually set the Gamma value.

Learn more about the stretch types

None

If the stretch type is None, no stretch method will be applied, even if statistics exist.

Standard deviation and percent clip

In many cases, you can assume that the majority of the pixel values fall within an upper and lower limit. Therefore, it's reasonable to trim off the extreme values. You can do this statistically by defining either a standard deviation or a clipping percent.

The standard deviation stretch type applies a linear stretch between the values defined by the standard deviation (n) value.

The percent clip stretch type applies a linear stretch between the defined percent clip minimum and percent clip maximum pixel values.

When you use either of these stretch types, all the values in the histogram falling outside the defined values are pushed to the ends. For example, assume your histogram has the same range of values as previously mentioned, 33 to 206, and you've defined a percent clip minimum and maximum of 2. If 2 percent at the low end are values 33 to 45, and 2 percent at the high end are values 198 to 206, the histogram will be redistributed to spread the values from 0 to 255. Values 33 to 45 become 0, values 198 to 206 become 255, and all others are spread in between. Similarly, if you define a 2 standard deviation, the values beyond the 2nd standard deviation become 0 or 255, and the remaining values are stretched between 0 and 255.

Minimum-maximum

This stretch type applies a linear stretch based on the output minimum and output maximum pixel values, which are used as the endpoints for the histogram. For example, in an 8-bit dataset, the minimum and maximum values could be 33 and 206. A linear stretch is used to distribute the values across 256 values, from 0 to 255. Features in the imagery are easier to distinguish as the pixel values are distributed across the entire histogram range, brightening and increasing the contrast of the image.

Sigmoidal

The Sigmoid contrast stretch is designed to highlight moderate pixel values in your imagery while maintaining sufficient contrast at the extremes. It places all of the pixel values along a sigmoidal function (an S-shaped curve). The result of this is less contrast in very bright and very dark areas, and more contrast in areas between these extremes. This is an ideal stretch for almost any image, and performs very well when there are clouds and water in the image.

The Strength Level determines how much of the sigmoidal function will be used in the stretch. A low value such as 1 will only use the middle portion of the curve, which tends to produce dull and faint colors. A high value such as 6 will use the entire curve, which tends to produce bold and sharp colors.

Learn more about gamma

Gamma refers to the degree of contrast between the midlevel gray values of a raster dataset. Gamma does not affect the black or white values in a raster dataset, only the middle values. By applying a gamma correction, you can control the overall brightness of a raster dataset. Additionally, gamma changes not only the brightness but also the ratios of red to green to blue.

Gamma values less than one decrease the contrast in the darker areas and increase the contrast in the lighter areas. This darkens the image without saturating the dark or light areas of the image. This helps bring out details in lighter features, such as building tops. Conversely, gamma values greater than one increase the contrast in darker areas, such as shadows from buildings. Gamma values greater than one can also help bring out details in lower elevation areas when working with elevation data.

In the following images, you can see the effect of adjusting the gamma values used to display a raster dataset:

Gamma

Related topics