Skip to content

Commit

Permalink
Add white backgrounds to GPW preview scripts.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 704512497
  • Loading branch information
Google Earth Engine Community Authors authored and copybara-github committed Dec 10, 2024
1 parent 74a8add commit b120fef
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ domi_grassland_2020 = domi_grassland_2020.selfMask()
var palette = [ 'ff9916', 'ffcd73'];
var vis = {min: 1, max: 2, palette: palette};

// Add a white background image to the map.
var background = ee.Image.rgb(255, 255, 255).visualize({min: 0, max: 255});
Map.addLayer(background, {min: 0, max: 1});

Map.setCenter(lon, lat, 4);
Map.addLayer(domi_grassland_2020, vis);

Expand All @@ -29,4 +33,5 @@ var parameters = {
};

var image = domi_grassland_2020.visualize(vis);
print(ui.Thumbnail({image: image, params: parameters}));
var imageWithBackground = ee.ImageCollection([background, image]).mosaic();
print(ui.Thumbnail({image: imageWithBackground, params: parameters}));
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ var nat_semi_grassland_2020 = nat_semi_grassland.filterDate('2020-01-01', '2021-
var palette = ['#f7f1e5', '#af8260', '#803d3b', '#322c2b'];
var vis = {min: 15, max: 85, palette: palette};

// Add a white background image to the map.
var background = ee.Image.rgb(255, 255, 255).visualize({min: 0, max: 255});
Map.addLayer(background, {min: 0, max: 1});

Map.setCenter(lon, lat, 10);
Map.addLayer(nat_semi_grassland_2020, vis);

Expand All @@ -29,4 +33,5 @@ var parameters = {
};

var image = nat_semi_grassland_2020.visualize({palette: palette});
print(ui.Thumbnail({image: image, params: parameters}));
var imageWithBackground = ee.ImageCollection([background, image]).mosaic();
print(ui.Thumbnail({image: imageWithBackground, params: parameters}));

0 comments on commit b120fef

Please sign in to comment.