ee.Image

An object to represent an Earth Engine image. This constructor accepts a variety of arguments:

  - A string: an EarthEngine asset id,

  - A string and a number: an EarthEngine asset id and version,

  - A number or ee.Array: creates a constant image,

  - A list: creates an image out of each list element and combines them into a single image,

  - An ee.Image: returns the argument,

  - Nothing: results in an empty transparent image.

UsageReturns
ee.Image(args)Image
ArgumentTypeDetails
argsImage|List, optional

Constructor argument.

Examples

Code Editor (JavaScript)

var image = ee.Image('JAXA/ALOS/AW3D30/V2_2');

Map.setZoom(3);
Map.addLayer(image.select('AVE_DSM'), {min: -1e3, max: 5e3}, 'AVE_DSM');
// Image JAXA/ALOS/AW3D30/V2_2 (3 bands)
// type: Image
// id: JAXA/ALOS/AW3D30/V2_2
// version: 1595337806697615
// bands: List (3 elements)
// properties: Object (21 properties)
print(image);

var transparent = ee.Image();
Map.addLayer(transparent, null, 'transparent', false);
// Image (1 band)
// type: Image
// bands: List (1 element)
// 0: "constant", int ∈ [0, 0], EPSG:4326
print(transparent);

// Create a multi-band image from a list of constants.
var orange = ee.Image([0xff, 0x88, 0x00]);
Map.addLayer(orange, {min: 0, max: 0xff}, 'orange', false);
// Image (3 bands)
// type: Image
// bands: List (3 elements)
// 0: "constant", int ∈ [255, 255], EPSG:4326
// 1: "constant_1", int ∈ [136, 136], EPSG:4326
// 2: "constant_2", int ∈ [0, 0], EPSG:4326
print(orange);

// Create a one band image where each pixel is an array of three values.
var imageOfArray = ee.Image(ee.Array([0x00, 0x00, 0xff]));
Map.addLayer(imageOfArray, null, 'imageOfArray', false);
// Image (1 band)
// type: Image
// bands: List (1 element)
// 0: "constant", unsigned int8, 1 dimension, EPSG:4326
// id: constant
// crs: EPSG:4326
// crs_transform: [1,0,0,0,1,0]
// data_type: unsigned int8, 1 dimension
// type: PixelType
// dimensions: 1
// max: 255
// min: 0
// precision: int
print(imageOfArray);