 The current pixel is compared to a half-gray value.If it is above the value a white pixel is generated in the resulting image.If the pixel is below the half way brightness, a black pixel is generated.