Sentinel-2 Image inconsistencies

Hello, this is my first time working with satellite images for a project and I happened to run into some weird behaviour when cropping images and trying to display them in QGIS. I’m not sure if this is a matter of misshandling the image files, or one of lack of experience with the QGIS program to display these images.

I’ll try my best to explain my issues, so please bear with me. I’m using the python API and am able to download the Sentinel-2 images as I please with my program, as well as form .tiff and .tif images. The thing is when I try to visualise these images, they come with many different colors as I will now demonstrate.

The following images contain the visualization of a raster of a fixed location, on different dates from 16/05/2020 to 26/10/2020 (spaced evenly every 5 days), as well as another raster, cropped from the large one, which is my location of interest.




I have two questions about these.

First: why is it there that the larger images are so different from one another? Taking into account that these are pictures of farms, but I don’t think the landscape itself should vary this much on different dates.

Second: How come the cropped areas are so much different that the larger images they are cropped from? In the case of the last image (RGB_25 and RGB_masked_25) they seem to match eachother, but that doesn’t happen for the great majority of the images I downloaded.

I will also provide my function for cropping these images, to show that the RGB_masked_X actually comes from its respective RGB_X:

def show_crop_img(polygon_file, b2, b3, b4, i):
    shp_data = gpd.read_file(polygon_file)
    crs_atual = b3.crs
    gpd_polygon = shp_data.to_crs({'init': crs_atual})
    trueColor = rio.open(f'RGB_{i}.tiff','w',driver='Gtiff',
                         width=b4.width, height=b4.height,
                         count=3,
                         crs=b4.crs,
                         transform=b4.transform,
                         dtype=b4.dtypes[0]
                         )
    trueColor.write(b2.read(1),3) #blue
    trueColor.write(b3.read(1),2) #green
    trueColor.write(b4.read(1),1) #red
    trueColor.close()

    with rio.open(f"RGB_{i}.tiff") as src:
        out_image, out_transform = rio.mask.mask(src, gpd_polygon.geometry,crop=True)
        out_meta = src.meta.copy()
        out_meta.update({"driver": "GTiff",
                    "height": out_image.shape[1],
                    "width": out_image.shape[2],
                    "transform": out_transform})
        
    with rasterio.open(f"RGB_masked_{i}.tif", "w", **out_meta) as dest:
        dest.write(out_image)

If you’ve read this far I already thank you for your patience, any help is appreciated.

Maybe you better ask in a QGIS forum when you have issues with QGIS. There it is more likely that you get useful support.