draw image to memory bitmap

memory bitmaps are faster for direct pixel acces by the cpu.

also, output file is stored to a container format.