1. An image processing apparatus comprising: a memory storing instructions; and one or more processors which execute the instructions and cause the image processing apparatus to function as: a white pixel determination unit configured to determine whether each of a plurality of pixels in an input image is a white pixel; a gray pixel determination unit configured to determine whether each of the plurality of pixels in the input image is a gray pixel; and a gray representation determination unit configured to determine, for each of the plurality of pixels in the input image, whether a setting in which gray is represented by a single K color has been made; and a setting unit configured (i) to set a black-and-white printing flag for a pixel which is determined to be a white pixel by the white pixel determination unit, (ii) to set the black-and-white printing flag for a pixel which is determined to be not a white pixel by the white pixel determination unit, is determined that the setting in which gray is represented by a single K color has been made by the gray representation determination unit, and is determined to be a gray pixel by the gray pixel determination unit, and (iii) to set a color printing flag for a pixel which is determined to be not a white pixel by the white pixel determination unit and is determined that the setting in which gray is represented by a single K color has not been made by the gray representation determination unit.