About writing out 2D image