RasterStretchRenderer

require(["esri/renderers/RasterStretchRenderer"], function(RasterStretchRenderer) { /* code goes here */ });
Class: esri/renderers/RasterStretchRenderer
Inheritance: RasterStretchRenderer Accessor
Since: ArcGIS API for JavaScript 4.12

RasterStretchRenderer defines the symbology with a gradual ramp of colors for each pixel in a ImageryLayer based on the pixel value. The RasterStretchRenderer works well when you have a large range of values to display, such as in imagery, aerial photographs, or elevation models.

The stretch renderer allows you to define the range of values to be displayed and apply a ColorRamp to those values.

See also:

Constructors

new RasterStretchRenderer(properties)
Parameter:
properties Object
optional

See the properties for a list of all the properties that may be passed into the constructor.

Property Overview

Any properties can be set, retrieved or listened to. See the Working with Properties topic.
NameTypeSummaryClass
ColorRamp

The stretched values are mapped to this specified color ramp.

more details
more detailsRasterStretchRenderer
Boolean

The computeGamma automatically calculates best gamma value to render exported image based on empirical model.

more details
more detailsRasterStretchRenderer
String

The name of the class.

more details
more detailsAccessor
Boolean

When Dynamic Range Adjustment is true, the statistics based on the current display extent are calculated as you zoom and pan around the image.

more details
more detailsRasterStretchRenderer
Number[]

The gamma values to be used if useGamma is set to false.

more details
more detailsRasterStretchRenderer
Number

Applicable when stretchType is percent-clip.

more details
more detailsRasterStretchRenderer
Number

Applicable when stretchType is percent-clip.

more details
more detailsRasterStretchRenderer
Number

Applicable when stretchType is standard-deviation.

more details
more detailsRasterStretchRenderer
Number

The outputMax denotes the Output Maximum, which is the highest pixel value for the histogram.

more details
more detailsRasterStretchRenderer
Number

The outputMin denotes the Output Minimum, which is the lowest pixel value for the histogram.

more details
more detailsRasterStretchRenderer
Number

The Strength Level determines how much of the sigmoidal function will be used in the stretch.

more details
more detailsRasterStretchRenderer
String

The stretch type defines a histogram stretch that will be applied to the rasters to enhance their appearance.

more details
more detailsRasterStretchRenderer
String

The type of Renderer.

more details
more detailsRasterStretchRenderer
Boolean

Denotes wether the gamma value should be used.

more details
more detailsRasterStretchRenderer

Property Details

The stretched values are mapped to this specified color ramp.

computeGamma Boolean

The computeGamma automatically calculates best gamma value to render exported image based on empirical model. This is applicable to any stretch type when useGamma is true.

Default Value:false
declaredClass Stringreadonly inherited

The name of the class. The declared class name is formatted as esri.folder.className.

dynamicRangeAdjustment Boolean

When Dynamic Range Adjustment is true, the statistics based on the current display extent are calculated as you zoom and pan around the image.

gamma Number[]

The gamma values to be used if useGamma is set to false. Gamma refers to the degree of contrast between the mid-level 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 an ImageryLayer.

maxPercent Number

Applicable when stretchType is percent-clip. Specifies the percentage of the highest values to exclude from the stretch.

minPercent Number

Applicable when stretchType is percent-clip. Specifies the percentage of the lowest values to exclude from the stretch.

numberOfStandardDeviations Number

Applicable when stretchType is standard-deviation. Specifies the number of standard deviations to use. The values beyond the number of standard deviations become the outputMin and outputMax. The remaining values are linearly stretched between outputMin and outputMax.

outputMax Number

The outputMax denotes the Output Maximum, which is the highest pixel value for the histogram. The outputMin and outputMax will set the range of values that will then be linearly contrast stretched.

outputMin Number

The outputMin denotes the Output Minimum, which is the lowest pixel value for the histogram. The outputMin and outputMax will set the range of values that will then be linearly contrast stretched.

sigmoidStrengthLevel Number

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.

stretchType String

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.

The possible stretch types are listed below.

ValueDescription
noneNo stretch method will be applied, even if statistics exist.
standard-deviationThis stretch type applies a linear stretch between the values defined by the standard deviation value.
histogram-equalizationThe pixel values are stretched to adjust the contrast using the histogram of the data.
min-maxThis 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.
percent-clipThis stretch type applies a linear stretch between the defined minPercent and maxPercent pixel values.
sigmoidThe Sigmoid contrast stretch is designed to highlight moderate pixel values in your imagery while maintaining sufficient contrast at the extremes.

Possible Values:"none"|"standard-deviation"|"histogram-equalization"|"min-max"|"percent-clip"|"sigmoid"

Default Value:none
type Stringreadonly

The type of Renderer.

For RasterStretchRenderer the type is always "raster-stretch".

useGamma Boolean

Denotes wether the gamma value should be used. When useGamma is false, the gamma is calculated from the statistics and histogram of the data. The gamma property is required if useGamma is true.

Default Value:false

Method Overview

NameReturn TypeSummaryClass
RasterStretchRenderer

Creates a deep clone of the renderer.

more details
more detailsRasterStretchRenderer
*

Creates a new instance of this class and initializes it with values from a JSON object generated from a product in the ArcGIS platform.

more details
more detailsRasterStretchRenderer
Object

Converts an instance of this class to its ArcGIS portal JSON representation.

more details
more detailsRasterStretchRenderer

Method Details

Creates a deep clone of the renderer.

Returns:
TypeDescription
RasterStretchRendererA deep clone of the object that invoked this method.
Example:
// Creates a deep clone of the first layer's renderer
var renderer = view.map.layers.getItemAt(0).renderer.clone();
fromJSON(json){*}static

Creates a new instance of this class and initializes it with values from a JSON object generated from a product in the ArcGIS platform. The object passed into the input json parameter often comes from a response to a query operation in the REST API or a toJSON() method from another ArcGIS product. See the Using fromJSON() topic in the Guide for details and examples of when and how to use this function.

Parameter:
json Object

A JSON representation of the instance in the ArcGIS format. See the ArcGIS REST API documentation for examples of the structure of various input JSON objects.

Returns:
TypeDescription
*Returns a new instance of this class.
toJSON(){Object}

Converts an instance of this class to its ArcGIS portal JSON representation. See the Using fromJSON() topic in the Guide for more information.

Returns:
TypeDescription
ObjectThe ArcGIS portal JSON representation of an instance of this class.

API Reference search results

NameTypeModule
Loading...