I've never done anything like that before, but I do know datatypes is very, very limited in its abilities. Some have use guigfx.library and render.library instead for image data manipulation. But since I've done neither myself, I can't help you much, sorry.