I need to do some raster calculation, I've been trying to make it work but I am not sure everything is working properly.

I need to apply a formula, but I am unsure if I am doing it properly. The formula is needed to find out the luminance:

L(Bx) = (CN(Bx) – 1) * G(Bx) - Q0(BX)

Bx is the band, G is 0.64 and Qo is -5, CN is the number of the band ( in this case 3), the name of the file is "B30@1"

Should it look like this ?

( 3B30@1 - 1 ) * 0.64B30@1 - -5B30@1

After I apply this formula, the image become a gray square, is this normal? Have I applied the formula correctly


Check if the resulting pixel values make sense (e.g. using the Identify tool).

Also, if you change away from "greyscale" to "pseudocolor" (in the resulting layer's properties), the patterns should get visible (if they exist).

In general, it's a good idea to use the stretch option in the lower right corner of the first tab. This way, even with the "greyscale" option, the patterns get visible.


Whenever I try out an algorithm that I'm unsure about, I'll test it with a stand-alone calculator using real numbers from the dataset first to see if it gives me the desired outcome.

If the results look decent I then implement the algorithm and compare the output results to see if they're giving the same number (so the "Identify" tool that underdark reference).

This way you know if the problem is with the algorithm or with the visualisation (underdark's reply does a good job of covering the later).

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.