2

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?

1
  • 1
    I am not a user of SNAP software, but there is a dedicated forum where you should get your answer : forum.step.esa.int
    – O. Hagolle
    Commented Dec 5, 2015 at 11:22

2 Answers 2

4

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

3
  • Very good. I've done something similar using GDAL and imported the output to QGIS for visualisation. However, the image is still quite dark despite adjusting the Contrast Enhancement. I got much better results in SNAP using the Histogram Stretching. Any suggestions?
    – dmci
    Commented Mar 9, 2016 at 15:35
  • This is a good answer :) thanks. About Histogram Stretching - maybe we just need a good tool to run at commandline for this also. If radouxju have any hints for this, feel free to put it into the answer also. Commented Mar 9, 2016 at 15:52
  • I am still wondering if there is any automatic histogram stretching built into the "natural colors" procedure of SNAP?!
    – Michael
    Commented Oct 27, 2017 at 14:12
0

First of all, I don't realy understand your question. What do you mean with "using the profile"?

Second, get the latest version of SNAP via STEP. Then after you have opend a RGB image, you can adjust the histogram stretch with help of the Colour Manipulation Tool/Tab. Thus the image will not look dark anymore.

You can export the data to GeoTiff using SNAP, if you don't want to have all possible spectral bands, you can do a spectral subset during export.

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.