I've got a raster which is provided to the company I work for on a monthly basis. However, the raster has lots of little areas which have different MinMax values, which give it a pretty bad look, as below:

enter image description here

Here you can see there are three different areas - the yellow areas, darker green, and lighter green. These all need to be corrected, and our guys in the field have said that they're useless.

Now, the company providing the images say it's down to aging sensors on the satellites and there's nothing that can be done as the satellites are out of their control. However, I've used the Raster > Extraction > Clip Raster by Mask Layer (after drawing shapes around each individual area) and managed to get a much better result:

enter image description here

So basically, each area IS the same image, but has different MinMax values. In my mind, if I were to get the Min and Max value of each area, and assign it a new value based on where it sits within its MinMax, then we should come out okay.

I extracted it across all areas and then tried merging it, but given that we have the same MinMax (since I was just extracting from the original and then merging it back together) we ended up with the same image. Given that we have 19 areas I've identified (and each one having three channels we're using), I was wondering if anyone knew of a way to automate this, or possibly the calculation to use in raster calculator.

  • If you also wish to ask about how to do this in ArcMap and ArcGIS Pro then please use separate questions to do so.
    – PolyGeo
    Jun 7, 2021 at 23:59

1 Answer 1


In the end, I created a polygon shapefile to use to extract these areas of different colourings (in total, 116 areas when I looked into it), and wrote a Python script which extracted these, saved the result "as rendered", and then merged them together. No colour correction required in the code as QGIS did it using the "as rendered" option.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.