Sentinel-2 individual jp2 bands to GeoTIFF

Sorry if this is not the appropriate forum for this topic but I suppose this community knows better S-2 data.

I have been doing some test to convert individual band images (.jp2) to GeoTIFF. I am not using SNAP (although it has batch processing) since I am working with a long S2 dataset and that would require a lot of processing time (at least my experience was that).

The graph uses subset to select only one band and the writes it as GeoTIFF in the output directory.

To solve my problem I am using the GDAL processing toolbox (gdal translate) in QGIS and I am wondering which should be the correct settings when doing the ‘translation’ in order to prevent loses in data quality (meaning pixel values).

I have been using UInt16 as raster type. Pixel values remain equal (I have compared some pixel values manually) but min and max values of the image change (slightly). Is there any other parameter to adjust?

I have been checking these posts:

But my question is out of the SNAP capabilities to create GeoTIFF

ps: this is the complete code

gdal_translate -of GTiff -ot UInt16 -outsize 100% 100% -projwin 499980.0 4500000.0 609780.0 4390200.0 -co COMPRESS=DEFLATE -co PREDICTOR=1 -co ZLEVEL=6 C:/Users/myuser/S2A_OP~1.04/IMG_DATA/S2A_OPER_MSI_L1C_TL_EPA__20160814T155250_A000463_T29TNE_B02.jp2 "[temporary file]"

1 Like

You could directly open the jp2 files in QGIS and then save them as GeoTIFFs. To prevent loss in quality, you just stick to the data type of the input files (can be seen in the raster metadata of QGIS)

on the different ranges. There is not necessarily a loss: Importing RTC S-1 into QGIS
You can compare minimum and maximum of input and output products in QGIS directly from the raster metadata to go sure the value ranges stay the same.

To my opinion,
gdal_translate -of GTiff input.jp2 output.tif
would be sufficient

1 Like

Thanks for you reply. Was checking again and it seems to be a QGIS issue on how it renders the data. In case someone check the post later, this link can be useful