g.intensitygradient function

Intensity gradient calculation