I want to compare 2 same tiles at different dates.

I use the raster calculator like this :

(IR_band_frb - IR_band-aug)^2 

But I get this result : squared diff between 2 images

The data range goes from -6049 to 4486 ... Why I get negativ results ?

(Same when I write "abs" instead of "^2" symbol)

I tried


But I get missing values (transparent "colors" in the output raster). So negatives values are passed to the square root operation.

Maybe do you have a better way for comparing 2 rasters in QGIS, do not hesitate !

Ty !

  • 1
    It may be that the squared numbers are too large, and they exceed the storage capacity of your raster format. – csk Aug 6 at 19:24
  • But when I apply sqrt((im1-im2)^2), I get missing values resulting transparent "color" in the output raster. That indicates some negatives values are passed to the root squared operation. – Antoine Mathu Aug 7 at 7:26

Why would you square the difference between the images anyway?

If you just do (Raster_1 - Raster_2) as the equation then any values you get that are negative mean that Raster_2 > than Raster_1 whereas positive values show that Raster_1 > Raster_2.

Would this information not be helpful?

  • 1
    This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. You can also add a bounty to draw more attention to this question once you have enough reputation. - From Review – whyzar Aug 6 at 18:20
  • 2
    @whyzar I believe this answer addresses the part of the question where they asked for "a better way for comparing 2 rasters in QGIS." – csk Aug 6 at 19:26
  • I wantt to have a positiv difference because I dont care if image 1 > image 2 or vice versa. I just want to measure "the difference" between them and then apply a threshold to keep only the constant structures – Antoine Mathu Aug 7 at 7:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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