Histogram contrast stretching allows you to customize your contrast stretch by interactively adjusting the histogram. Usually ArcGIS Pro displays your image and raster data with good contrast by default. When the preset contrast stretches do not produce the enhancement you want, histograms can be manually adjusted to change the contrast stretch of the raster.
The histogram of the contrast stretch shows you the distribution of the image pixels. The pixel values are along the x-axis, and the pixel counts are shown on the y-axis as a histogram. The histogram does not show every pixel's value due to binning of values.
Not all of the stretch types allow you to edit the histogram. The None and Esri stretch types only allow you to view the pixel distribution. The Minimum Maximum, Percent Clip, and Standard Deviation stretch types allow you to view the pixel distribution and interactively set the minimum and maximum input values so that the stretch only focuses on the majority of the input values and disregards the outliers or tails of the distribution at either extreme. The Histogram Specification stretch type allows you to interactively create a piecewise histogram stretch to enhance specific portions of the histogram differently.
|Stretch type||Histogram capability|
The histogram is read-only.
The minimum and maximum values of the histogram can be manually adjusted.
You can manually specify a piecewise histogram.
This allows you to create a custom stretch, where each portion of the histogram can be stretched differently.
View the histogram
The raster histogram distribution can be viewed when the RGB or Stretch symbology types are used from the Symbology pane. There are two methods to open the histogram view:
- Click the Stretch button on the Appearance tab.
If the stretch type is currently None and you click the Stretch button before you choose a different stretch type, you can only view the histogram. To adjust the histogram, click Stretch Type on the Appearance tab or Symbology pane to choose a stretch type.
- Click the Histogram button on the Symbology pane.
The histogram shows the low and high breakpoint values along the histogram distribution where the histogram will be clipped; it shows you the histogram distribution for each rendered band in your image.
This histogram will be viewable for all the stretch types; additionally, some of the stretch types will allow you to edit the histogram. Below the histogram display is a Statistics section that shows the statistics of the data source. In the Information section, see input and output information for any location on the histogram by hovering the pointer over the histogram.
Edit the minimum and maximum values
When the stretch type is set to Minimum Maximum, Percent Clip, or Standard Deviation, you can view the histogram and also edit the minimum and maximum values of the histogram. When you set the high and low limits of the histogram, it adjusts the contrast stretch of the image. This helps to remove outlier values in high and low regions of the histogram.
To set the minimum and maximum histogram limits, click and hold the minimum or maximum triangle located below the dotted line, and move the breakpoint line along the x-axis to where you want to set the limit. You can use the graphical histogram display to help you decide where the limits should be set. If you know the minimum and maximum values you want to set, you can also double-click the minimum or maximum value and then type the number in the text box.
When the stretch type is set to Histogram Specification, you can interactively specify a piecewise histogram.
Click the Histogram button to open the Histogram page. For each rendered band, the histogram has a line that maps the input x-value and the stretched y-value. Initially this line is a straight diagonal from the lower left origin (minimum input, minimum output) to the upper right of the histogram graph (maximum input, maximum output). You place and adjust histogram stretch breakpoints along this line to create your piecewise histogram stretch.
There are several tools you can use to edit the histogram:
- Line tool
- Spline tool
- Manually add input and output
The Line tool is used to edit the piecewise line on the graph, which displays the stretched histogram superimposed over the original input histogram. This line actually sets how to map the output display values. Use the Line tool to create a set of vertices where your input values map to your output display values. For instance, if you want the input value of 20 to be displayed as 30, place a point where the input (x) is 20 and the output (y) is 30. Once you complete all the custom input and output values, click Apply to see the resulting stretch.
The Spline tool works similar to the Line tool, except the input-output line will be curved through your breakpoints.
Open the Manually add input and output category to see text boxes for an x- and y-input. This functionality is similar to that of the Line tool, except instead of using the graphical display to set points, you type the input and output values in the text boxes and then click the Add a point button to add another breakpoint to the histogram.
You can move any of the vertices if you want to edit them. Hover over a vertex, click and hold the mouse button, and move the vertex to the desired position on the histogram. If you want to remove any of vertices, hover over the vertex, select it, right-click, and choose Delete selected point. The Smooth button is used to smooth the line rather than having abrupt changes per your breakpoint settings.
While you view the histogram, there are several tools you can use to query the data. The Information for Selected Area tool is used to highlight a portion of the histogram and the highlighted data is shown in the Information section. The Cumulative button is used to change the display of the graph. Instead of showing the histogram distribution, two ascending curves are displayed, showing the input and output values for the input data and the stretched values. To return to the histogram view, click the Cumulative button again to turn off the cumulative view.