In your "terrain" action, instead of a "while" loop to create the trees, I open my BMP file and work on the rgb component of each pixel. You'll see it soon, I'll give my script here or in the Lite-C contribution forum.
I just want to clean and complete it before
BTW, maybe I should say YOUR code with slight changes