I am trying to export the TIFF file from Google Earth Engine, but the exported file appears black.

var image = ee.Image(ee.ImageCollection("COPERNICUS/S2")
    .filterDate('2021-06-01', '2021-06-30')
  Map.addLayer(image, {bands: ['B4', 'B3', 'B2'],min:0, max: 3000}, 'True colour image')

var classNames = heterogeneitybaresoil.merge(vegetation);

var bands = ['B2', 'B3', 'B4','B8', ];
var training = image.select(bands).sampleRegions({
  collection: classNames,
  properties: ['landcover'],
  scale: 30

var classifier = ee.Classifier.smileCart().train({
  features: training,
  classProperty: 'landcover',
  inputProperties: bands

//Run the classification
var classified = image.select(bands).classify(classifier);

//Display classification
Map.centerObject(classNames, 11);
{min: 0, max: 1, palette: ['green','red']},

// Create a task that you can launch from the Tasks tab.
  image: classified,
  description: 'Akamas',
  scale: 30

enter image description here

this is how looks like my exported tiff

the script of the above (in order to help you to run it) https://code.earthengine.google.com/f8bc253d6c67799c92012441177173a0?hideCode=true

  • Add a screenshot of the exported raster. Commented Aug 19, 2021 at 15:14
  • Try visualizing the image in a GIS (e.g., ArcGIS, QGIS) Commented Aug 19, 2021 at 15:30
  • i have already open the tiff file in ArcGis Pro but file appears black too Commented Aug 19, 2021 at 16:55
  • the code of the script (if this help to run it) : code.earthengine.google.com/… Commented Aug 19, 2021 at 18:13
  • It's only all black because you haven't symbolized it (the Windows image viewer can't do this). Use unique values symbology in your GIS software. It's mostly 0s with a small patch of 1s (i.sstatic.net/jP43z.png).
    – user2856
    Commented Aug 19, 2021 at 22:05

1 Answer 1


If you want to export the red/green image, call Image.visualize on the output, using the same visualization parameters you're using to display it. Otherwise, you're Exporting an image of 0s and 1s, which when you display it will appear black and almost-black.

  image: classified.visualize({min: 0, max: 1, palette: ['green','red']}),
  description: 'Akamas',
  scale: 30
  • thank you for your answer Mr. Noel Commented Aug 21, 2021 at 13:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.