Google Earth Engine – Best Parameters for Visualizing Sentinel-2 for Same Region Over Different Times

google-earth-enginegoogle-earth-engine-javascript-api

I would like to visualize the sentinel-2 imagery for the same region but at different times and only use the same visual parameters in the google earth engine. My problem is that one image is quite dark and the other is very bright in my script. Is there any way to choose the suitable parameters for both imageries clearly seen? My script is below:

var S2_collection_2021 = ee.ImageCollection("COPERNICUS/S2_SR")
                    .filterDate('2021-01-10','2021-05-30')
                    .filterMetadata('MGRS_TILE', 'equals', '60HVC') print (S2_collection_2021,'collection');
    
var S2_collection_2022 = ee.ImageCollection("COPERNICUS/S2_SR")
                    .filterDate('2022-01-10','2022-03-10')
                    .filterMetadata('MGRS_TILE', 'equals', '60HVC')
                  
    
print (S2_collection_2022,'collection'); 
// VISUALIZE IMAGERY 
var visualize={'bands': ['B4', 'B3', 'B2'], 'min': 0, 'max': 1500,gamma:0.6} 
Map.addLayer(S2_collection_2021,visualize, 'S2_2021'); 
Map.addLayer(S2_collection_2022, visualize, 'S2_2022');

The link of code is here: https://code.earthengine.google.com/370f4a22a4622587f1d4cc8327440f90

Best Answer

You should use the harmonized Sentinel-2 collection. This collection matches the range of the image's values in both old and new images. You can find more details in the description of the collection.

ee.ImageCollection("COPERNICUS/S2_SR_HARMONIZED")