I'm trying to script this in GIMP, and running into issues with the angle lighting calculations.

I have tried using the bumpmap filter. adjusting the azimuth for each of the angle steps, then performing some thresholding. Unfortunately this doesn't give me the control I need to select only the surface angle I want without a tremendous amount of trial and error...

I have found a normalmap plugin for gimp that seems to do alot of the heavy lifting, converting a greyscale heightmap into a RGB normal map (nvidia standard?) with R as the X, G as the Y and B as the Z vector component. I'm thinking that I could use tehse as base components to determine my thatch angle. The "problem" is that I can think how to do this mathematically (i.e. calculating for each pixel) but this will be REALLY slow. Can anyone suggest an image processing way to accomplish this?

TIA-

-Rob A>