in reply to Random Imaging

Unrelated to your imaging problem:

Don't use srand() unless you really know why you need it.

Liz