I download sentinel images from EO browser as tiff (8bite) and open them with rasterio in python. My problem is when I transfer the image to the array, the value of the true color image is different from the arrays of images for B02, B03 and B04.
what is the reason?
When selecting TIFF (8-bit) as the downloaded format, values will be automatically stretched from the interval [0, 1] to [0, 255] (More info). Since the range of values is different between true color, B02, B03, and B04, the result of stretching will be different.
The values of true color layer are multiplied by 2.5 for a better visualisation by default. If you select TIFF (32-bit float) and multiply B02, B03, and B04 by 2.5 you will get the same value of true color.
Thank you for your reply. So, I need 4 channels (B02, B03, B04, B08). If I download them separately, will I have four channels with different scales? If so, what transformation is used to convert [0, 1] to [0, 255]? Is it just MinMax transformation?
The stretching for TIFF (8-bit) is simply multiplied by 256 and for TIFF (16-bit) is multiplied by 65536, so the scale for all 4 channels will be the same. If you are interested in actual band values TIFF (32-bit float) is the option to use.
I downloaded the TIFF (32-bit) images (B04, B03, B02, and true color images). I still have the same problem. The True color image array differs from B04, B03, B02. As you mentioned, I multiply bounds by 2.5.
When downloading from Analytical Visualized column, it will give you visualized values, which are transformed by the HighlightCompressVisualizer. On the EO Browser, the minValue is set to 0 and maxValue is set to 0.4. The visualized values lie between 0 and 1, and will be stretched to 256 for 8-bit TIFF or to 65535 for 16-bit TIFF (No stretching for 32-bit float).
The difference between the true color image array and the single band image array multiplied by 2.5 is caused from actual values lying in the interval where the second slowly increasing function is applied, or the third function which maps the value to 1 while values are greater than or equal to (2*maxValue - minValue) in HighlightCompressVisualizer.