prepare binary image