Does Sombra gain Ultimate charge by healing Junkrat's RIP-Tire?

Here is another approach:

// Make a (toy) 3 bands image
var image  = ee.Image([1,2,3]).rename(['one', 'two', 'three'])
Map.addLayer(image, null, '3 bands image')

// Sum all bands
var sum_bands = image.reduce('sum')
Map.addLayer(sum_bands, null, 'sum')

// You can compute any reduction
var mean_bands = image.reduce('mean')
Map.addLayer(mean_bands, null, 'mean')

link: https://code.earthengine.google.com/9ff53b49274f3842f353a2994905e750


Are you looking for something like this?

var image  = ee.Image(1).addBands(ee.Image(2)).addBands(ee.Image(3)).addBands(ee.Image(4)).addBands(ee.Image(5));

var bandNames = image.bandNames();

var toCollection = ee.ImageCollection.fromImages(bandNames.map(function(name){
  name = ee.String(name);
  // select one band an put into an image. You might need a specific cast and renaming of the bands
  return image.select(name).rename('newName').toFloat();
}));
var summedBand = toCollection.sum();


print(summedBand);
print(toCollection);

Map.addLayer(summedBand)

link

Tags:

Overwatch