Skip to content

Image Overview

As mentioned in the Get Started doc, raster data are represented as Image objects in Earth Engine. Images are composed of one or more bands and each band has its own name, data type, scale and projection. Each image has metadata stored as a set of properties.

In addition to loading images from the archive by an image ID, you can also create images from constants, lists or other suitable Earth Engine objects. The following illustrates methods for creating images, getting band subsets, and manipulating bands:

import ee
ee.Initialize()

# Create a constant image.
image1 = ee.Image(1)
print(image1.getInfo())

# Concatenate two images into one multi-band image.
image2 = ee.Image(2)
image3 = ee.Image.cat([image1, image2])
print(image3.getInfo())

# Create a multi-band image from a list of constants.
multiband = ee.Image([1, 2, 3])
print(multiband.getInfo())

# Select and (optionally) rename bands.
renamed = multiband.select(
    ['constant', 'constant_1', 'constant_2'], # old names
    ['band1', 'band2', 'band3']               # new names
)
print(renamed.getInfo())

# Add bands to an image.
image4 = image3.addBands(ee.Image(42))
print(image4.getInfo())

  1. Portions of this page are modifications based on work created and shared by Google and used according to terms described in the Creative Commons 4.0 Attribution License. Code samples are licensed under the Apache 2.0 License 

  2. Last updated July 10, 2019.