The first step of the process involves converting each pixel to grayscale. This simplification removes most color information from the image, enabling the OCR to better recognize different characters and process the information more quickly since it no longer has to deal with color data.

This conversion is handled by the function \verb'void pixel_to_grayscale'. It takes as parameters a \verb|void* pixel| and an \verb|SDL_PixelFormat*format|, applying the necessary processing to achieve the grayscale effect.