Stay organized with collections
Save and categorize content based on your preferences.
Multiplies the first value by the second for each matched pair of bands in image1 and image2. If either image1 or image2 has only 1 band, then it is used against all the bands in the other image. If the images have the same number of bands, but not the same names, they're used pairwise in the natural order. The output bands are named for the longer of the two inputs, or if they're equal in length, in image1's order. The type of the output pixels is the union of the input types.
Usage
Returns
Image.multiply(image2)
Image
Argument
Type
Details
this: image1
Image
The image from which the left operand bands are taken.
image2
Image
The image from which the right operand bands are taken.
[[["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."],[[["`Image.multiply()` multiplies corresponding bands of two images, handling single-band images and differing band names gracefully."],["The output image bands are named based on the input images, prioritizing the longer band list or image1's order for equal lengths."],["Pixel type in the output image is determined by combining the input pixel types."],["If a number is provided instead of an image, it's treated as a constant image for the multiplication."]]],["The `multiply()` function computes the product of pixel values from two images (`image1` and `image2`). It pairs bands from each image for multiplication. If one image has a single band, it's paired with all bands of the other. If both have multiple bands with different names, they are paired in their natural order. The output image bands are named based on the longer of the input image. Output pixel type is the union of input types.\n"]]