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).
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).
In optical remote sensing in the visible spectrum you cannot see through clouds. So there is nothing you can do, except to wait for images without clouds.
Cloud masks are (as far as i know) used to exclude clouded areas from (for example) landcover classification, because results there would be incorrect anyways.
edit
As Aaron mentioned, you can sometimes use a cloud mask to insert cloud-free imagery into a cloudy image, but that only works if you a) do have cloud free imagery and b) you don't care that the resulting image is now a mosaic of images from different acquisition dates, and thus you cannot compute change detection etc. on it.
Best Answer
ESA's Sen2cor Toolbox removes haze, cirrus and cloud shadows, not dense clouds. It's performed over the same scene, not by mosaicking.
The AC flow is the following from L2A algorithms document:
So, Sen2cor performs an image classification and use this layer to select where to correct pixel values. You can check documentation to know which equation is used in each step.
Thresholds and options are set in GIP file by default (
L2A_GIPP.xml
), you can change them from this file to overwrite default settings or call them from command line: