The second part of the process involves converting each grayscale pixel to black and white. This further simplifies the image by retaining only two colors: white and black. This allows the OCR to recognize different characters more effectively and process information more quickly, as it only has to differentiate between two color values, either black or white.

This conversion is handled by the function \verb'void pixel_to_black_white'. It takes as parameters a \verb|void* pixel|, \verb|SDL_PixelFormat* format|, and \verb|Uint8 threshold|. The function applies the transformation directly on the image.
