I am using Sentinel 2 Level2A-Data. I want to export every single band as 16-bit jpeg2 or tiff. Afterwards I want to load them into ImageJ and make a stack of all bands.
Can anybody help me how to export every single band as 16-bit?
you can use the convert datatype tool, select Int16 as an output format and J2 as the data type and then apply one of the available scalings. This however severely changes the values of your pixels.
You can apply a manual stretch of the values in the band maths
Or you directly convert them into dB: right-click > Linear to/from dB. Right-click on the new product and select > Convert band. Then use File > Save Product.
Still, the exreme values remain.
If I open the image of one band and then right click on the image, select “export view as image” and click on “full scene” and “full resolution”, I get a jpeg output in 8bit with the adjusted contrast. Is there a possibility to get the same as a 16bit output?
I’m not entirely sure what your purpose is. The “pretty visualization” adapts the contrast such as the value of the pixel corresponding to the percentile 2.5 is set to dark and the percentile 97.5 is set to white. Out of these limits the values are saturated. It is useful to visualize the image that way, to avoid the image to be seen almost dark or almost white.
But that’s only for visualization purposes ! The “almost dark” image that you had corresponds to the true value of pixels. For classification for example, that’s these values that are used.
I think exactly that was my error in reasoning. I of course want to do a classification afterwards so I need the “real values”, not the “pretty ones”. I had a mistake in my thoughts.
Thank you both very much for your answers. I am a student and I am working on my bachelor thesis. This was very helpful now. Thanks!