incrementally writes result image
merge