In [1]:
import ee
ee.Initialize()
import geetools

In [2]:
import ipygee as ui

In [3]:
Map = ui.Map()
Map.show()


Site


In [4]:
site = ee.Geometry.Point([-71.5, -41.7]).buffer(2000)
Map.centerObject(site)

Image


In [5]:
image = ee.Image('COPERNICUS/S2/20151123T142942_20170221T180430_T18GYU')

Visualization

For larger areas you can choose a greater scale to avoid waiting too long for getting visualization values

Standard Deviation


In [14]:
for std in range(1, 5):
    stretch = geetools.visualization.stretch_std(image, site, ['B4', 'B3', 'B2'], std, scale=10)
    Map.addLayer(image, stretch, 'RGB stretched by {} standard deviation'.format(std))

Percentile


In [15]:
# Try many
for st in range(10, 110, 10):
    stretch = geetools.visualization.stretch_percentile(image, site, ['B4', 'B3', 'B2'], st, scale=10)
    Map.addLayer(image, stretch, 'RGB stretched by {}%'.format(st))

In [ ]: