[GIS] How is Sentinel 2 MSI Natural Colours Profile in SNAP calculated

sentinel-2sentinel-snap

Using the ESA Toolbox named SNAP one can load a sentinel 2 data package and see a RGB view using the profile.

I am wondering what this profile in mathematical terms are.

Is it just information about which bands to use?
Is it a weighting of the bands?
Is it static across time/geo position?

How would one create a RGB geotiff from a sentinel 2 data package using GDAL?

I noticed that seeing the RGB images in SNAP they seemed dark. What tools do we have to auto adjust images to best possible visual appeal?

Best Answer

the RGB image in snap is built using the red, green and blue bands of Sentinel-2 MSI: respectively bands 4, 3, 2 (as you can see on the snap shot, those bands are selected by default). the "Profiles" in this case are predefined colour composites to visualize the data (only 3 out of the 13 spectral bands of Sentinel-2 can be sen by the human eye at once).

enter image description here

You can create a similar geotif with gdal by creating a stack of those three bands, located in the /GRANULE/yourimagename/IMG_DATA directory

gdalbuildvrt -separate output.vrt image_B04.jp2 image_B03.jp2 image_B02.jp2
gdal_translate output.vrt output.tif -co TILED=YES -co COMPRESS=LZW -co BIGTIFF=YES

The advantage of using SNAP is that you do not need to unzip the file archive in order to open the image, and it is easier to select a subset and mosaic.

For color stretching, the fastest way in SNAP is to use the color manipulation. By default it uses the statistics of the image, but on my example below there was a lot of clouds, so the colour stretching had to be adjusted (except if you are interested in clouds...). Note that this is on the fly manipulation, so the pixel values are not modified. You could also do this with command lines, but is is difficult to automate on raw data that have not been atmospherically corrected and cloud screened (cloud, cloud shadow, large water area... can strongly affect the statistics).

enter image description here

Related Question