Stay organized with collections
Save and categorize content based on your preferences.
Updates an image's mask at all positions where the existing mask is not zero. The output image retains the metadata and footprint of the input image.
Usage
Returns
Image.updateMask(mask)
Image
Argument
Type
Details
this: image
Image
Input image.
mask
Image
New mask for the image, as a floating-point value in the range [0, 1] (invalid = 0, valid = 1). If this image has a single band, it is used for all bands in the input image; otherwise, must have the same number of bands as the input image.
[[["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."],[[["`updateMask()` modifies an image's mask, making pixels with a mask value of 0 invalid."],["It accepts a single or multi-band image as a mask, applying it to corresponding bands in the input image."],["The input image's metadata and footprint are preserved in the output."],["Floating point mask values (0-1) control pixel opacity during visualization."]]],["The `updateMask()` function modifies an image's existing mask. It takes a new mask as input, a floating-point image where 0 denotes invalid and 1 denotes valid pixels. When applied, the function updates all image pixels where the current mask is non-zero. The new mask can be single-band, affecting all input image bands, or multi-band, updating bands individually. Mask values between 0 and 1 indicate partial transparency. The output image keeps the input image's metadata and footprint.\n"]]