i wrote a plugin that writes to a image handle from wdl... kinda fast (however depends on the size).
do you write the image data into a tga file on hd, or in memory? if you want, i can share my c++ code to improve your feature...