Announcement: All noncommercial projects registered to use Earth Engine before
April 15, 2025 must
verify noncommercial eligibility to maintain Earth Engine access.
Image Reductions
Stay organized with collections
Save and categorize content based on your preferences.
To reduce an Image
, use image.reduce()
. Reducing an image
functions in an analogous way to imageCollection.reduce()
, except the
bands of the image are input to the reducer rather than the images in the collection. The
output is also an image with number of bands equal to number of reducer outputs. For
example:
Code Editor (JavaScript)
// Load an image and select some bands of interest.
var image = ee.Image('LANDSAT/LC08/C02/T1/LC08_044034_20140318')
.select(['B4', 'B3', 'B2']);
// Reduce the image to get a one-band maximum value image.
var maxValue = image.reduce(ee.Reducer.max());
// Display the result.
Map.centerObject(image, 10);
Map.addLayer(maxValue, {max: 13000}, 'Maximum value image');
Python setup
See the
Python Environment page for information on the Python API and using
geemap
for interactive development.
import ee
import geemap.core as geemap
Colab (Python)
# Load an image and select some bands of interest.
image = ee.Image('LANDSAT/LC08/C02/T1/LC08_044034_20140318').select(
['B4', 'B3', 'B2']
)
# Reduce the image to get a one-band maximum value image.
max_value = image.reduce(ee.Reducer.max())
# Display the result.
m = geemap.Map()
m.center_object(image, 10)
m.add_layer(max_value, {'max': 13000}, 'Maximum value image')
m
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-01-02 UTC.
[null,null,["Last updated 2025-01-02 UTC."],[[["\u003cp\u003e\u003ccode\u003eimage.reduce()\u003c/code\u003e processes an image's bands with a reducer, similar to how \u003ccode\u003eimageCollection.reduce()\u003c/code\u003e processes images in a collection.\u003c/p\u003e\n"],["\u003cp\u003eIt outputs a new image with band count equal to the reducer's output count, for instance, using \u003ccode\u003eee.Reducer.max()\u003c/code\u003e results in a single-band image with the maximum value across the input bands.\u003c/p\u003e\n"],["\u003cp\u003eThe provided code demonstrates reducing a Landsat 8 image to a single-band image representing the maximum value across selected bands (B4, B3, B2).\u003c/p\u003e\n"]]],[],null,["# Image Reductions\n\nTo reduce an `Image`, use `image.reduce()`. Reducing an image\nfunctions in an analogous way to `imageCollection.reduce()`, except the\nbands of the image are input to the reducer rather than the images in the collection. The\noutput is also an image with number of bands equal to number of reducer outputs. For\nexample:\n\n### Code Editor (JavaScript)\n\n```javascript\n// Load an image and select some bands of interest.\nvar image = ee.Image('LANDSAT/LC08/C02/T1/LC08_044034_20140318')\n .select(['B4', 'B3', 'B2']);\n\n// Reduce the image to get a one-band maximum value image.\nvar maxValue = image.reduce(ee.Reducer.max());\n\n// Display the result.\nMap.centerObject(image, 10);\nMap.addLayer(maxValue, {max: 13000}, 'Maximum value image');\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\n### Colab (Python)\n\n```python\n# Load an image and select some bands of interest.\nimage = ee.Image('LANDSAT/LC08/C02/T1/LC08_044034_20140318').select(\n ['B4', 'B3', 'B2']\n)\n\n# Reduce the image to get a one-band maximum value image.\nmax_value = image.reduce(ee.Reducer.max())\n\n# Display the result.\nm = geemap.Map()\nm.center_object(image, 10)\nm.add_layer(max_value, {'max': 13000}, 'Maximum value image')\nm\n```"]]