Stay organized with collections
Save and categorize content based on your preferences.
Computes the normalized difference between two bands. If the bands to use are not specified, uses the first two bands. The normalized difference is computed as (first − second) / (first + second). Note that the returned image band name is 'nd', the input image properties are not retained in the output image, and a negative pixel value in either input band will cause the output pixel to be masked. To avoid masking negative input values, use ee.Image.expression() to compute normalized difference.
Usage
Returns
Image.normalizedDifference(bandNames)
Image
Argument
Type
Details
this: input
Image
The input image.
bandNames
List, default: null
A list of names specifying the bands to use. If not specified, the first and second bands are used.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-10-06 UTC."],[[["Computes the normalized difference between two specified or default image bands using the formula (first - second) / (first + second)."],["Returns a single-band image named 'nd' representing the normalized difference."],["Input image properties are not preserved in the output, and negative input values in either band result in masked output pixels."],["`ee.Image.expression()` is recommended for handling negative input values and avoiding masking."]]],[]]