i would make a pretty hack which for each step checked where the lowest pixel was besides it. then you know the direction. You add that direction up as a vector. this vector represents the speed in each direction and is added to the position of the ball at each step. you also introduce a friction variable you can multiply with the speed at each step

i haven't implemented this but i think it should be pretty simple to implement. good luck

Regards
Jeppe Johansen