Maps from input values to output values, represented by two parallel lists. Any input values not included in the input list are either set to defaultValue if it is given, or masked if it isn't. Note that inputs containing floating point values might sometimes fail to match due to floating point precision errors.

Image.remap(from, to, defaultValue, bandName)Image
this: imageImage

The image to which the remapping is applied.


The source values (numbers or EEArrays). All values in this list will be mapped to the corresponding value in 'to'.


The destination values (numbers or EEArrays). These are used to replace the corresponding values in 'from'. Must have the same number of values as 'from'.

defaultValueObject, default: null

The default value to replace values that weren't matched by a value in 'from'. If not specified, unmatched values are masked out.

bandNameString, default: null

The name of the band to remap. If not specified, the first band in the image is used.



// Your example goes here!


# Your example goes here!