Announcement: All noncommercial projects registered to use Earth Engine before April 15, 2025 must verify noncommercial eligibility to maintain Earth Engine access.
Stay organized with collections
Save and categorize content based on your preferences.
Raises the first value to the power of 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 float.
Usage
Returns
Image.pow(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."],[[["\u003cp\u003e\u003ccode\u003epow()\u003c/code\u003e raises the pixel values of the first image to the power of the corresponding pixel values in the second image.\u003c/p\u003e\n"],["\u003cp\u003eIt handles images with single or multiple bands, performing pairwise calculations.\u003c/p\u003e\n"],["\u003cp\u003eOutput band names and order prioritize the longer image input or the first image's order if lengths are equal.\u003c/p\u003e\n"],["\u003cp\u003eResulting image pixel values are of float type.\u003c/p\u003e\n"],["\u003cp\u003eA numeric input for the second argument is automatically converted to an image for convenience.\u003c/p\u003e\n"]]],[],null,["Raises the first value to the power of 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 float.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|---------------------|---------|\n| Image.pow`(image2)` | Image |\n\n| Argument | Type | Details |\n|----------------|-------|---------------------------------------------------------|\n| this: `image1` | Image | The image from which the left operand bands are taken. |\n| `image2` | Image | The image from which the right operand bands are taken. |\n\nExamples\n\nCode Editor (JavaScript) \n\n```javascript\n// A Sentinel-2 surface reflectance image.\nvar img = ee.Image('COPERNICUS/S2_SR/20210109T185751_20210109T185931_T10SEG');\n\n// Subset two image bands and display them on the map.\nvar swir1 = img.select('B11');\nvar swir2 = img.select('B12');\nMap.setCenter(-122.276, 37.456, 12);\nMap.addLayer(swir1, {min: 0, max: 3000}, 'swir1');\nMap.addLayer(swir2, {min: 0, max: 3000}, 'swir2');\n\n// The following examples demonstrate ee.Image arithmetic methods using two\n// single-band ee.Image inputs.\nvar addition = swir1.add(swir2);\nMap.addLayer(addition, {min: 100, max: 6000}, 'addition');\n\nvar subtraction = swir1.subtract(swir2);\nMap.addLayer(subtraction, {min: 0, max: 1500}, 'subtraction');\n\nvar multiplication = swir1.multiply(swir2);\nMap.addLayer(multiplication, {min: 1.9e5, max: 9.4e6}, 'multiplication');\n\nvar division = swir1.divide(swir2);\nMap.addLayer(division, {min: 0, max: 3}, 'division');\n\nvar remainder = swir1.mod(swir2);\nMap.addLayer(remainder, {min: 0, max: 1500}, 'remainder');\n\n// If a number input is provided as the second argument, it will automatically\n// be promoted to an ee.Image object, a convenient shorthand for constants.\nvar exponent = swir1.pow(3);\nMap.addLayer(exponent, {min: 0, max: 2e10}, 'exponent');\n```\nPython setup\n\nSee the [Python Environment](/earth-engine/guides/python_install) page for information on the Python API and using\n`geemap` for interactive development. \n\n```python\nimport ee\nimport geemap.core as geemap\n```\n\nColab (Python) \n\n```python\n# A Sentinel-2 surface reflectance image.\nimg = ee.Image('COPERNICUS/S2_SR/20210109T185751_20210109T185931_T10SEG')\n\n# Subset two image bands and display them on the map.\nswir_1 = img.select('B11')\nswir_2 = img.select('B12')\nm = geemap.Map()\nm.set_center(-122.276, 37.456, 12)\nm.add_layer(swir_1, {'min': 0, 'max': 3000}, 'swir_1')\nm.add_layer(swir_2, {'min': 0, 'max': 3000}, 'swir_2')\n\n# The following examples demonstrate ee.Image arithmetic methods using two\n# single-band ee.Image inputs.\naddition = swir_1.add(swir_2)\nm.add_layer(addition, {'min': 100, 'max': 6000}, 'addition')\n\nsubtraction = swir_1.subtract(swir_2)\nm.add_layer(subtraction, {'min': 0, 'max': 1500}, 'subtraction')\n\nmultiplication = swir_1.multiply(swir_2)\nm.add_layer(multiplication, {'min': 1.9e5, 'max': 9.4e6}, 'multiplication')\n\ndivision = swir_1.divide(swir_2)\nm.add_layer(division, {'min': 0, 'max': 3}, 'division')\n\nremainder = swir_1.mod(swir_2)\nm.add_layer(remainder, {'min': 0, 'max': 1500}, 'remainder')\n\n# If a number input is provided as the second argument, it will automatically\n# be promoted to an ee.Image object, a convenient shorthand for constants.\nexponent = swir_1.pow(3)\nm.add_layer(exponent, {'min': 0, 'max': 2e10}, 'exponent')\nm\n```"]]