An image processing apparatus comprising: acquisition means for acquiring an image; image processing means for performing image processing on the acquired image; and output means for outputting the image having undergone the image processing to an output destination, wherein the image processing comprises: shade removing processing (S504) for removing illumination unevenness and brightness unevenness from the acquired image; foreground extraction processing (S505) for extracting foreground areas by performing, on the image having undergone the shade removing processing, gray scale conversion and then binarization processing; and replacement processing (S506) for identifying text portions from the extracted foreground areas, and replacing colors of the identified text portions with a first color, and wherein the output means is able to output the image having undergone the replacement processing to the output destination and to output the image not having undergone the replacement processing to the output destination, characterized in that in the replacement processing the first color is selected from a plurality of predetermined different colors, based on the colors corresponding to the identified text portions if the color corresponding to the identified text portion meets a range of the first color that is selected from the plurality of predetermined different colors, wherein, in the replacement processing, the first color is the average color of the identified text portion if the color corresponding to the identified text portion meets none of the ranges of the plurality of predetermined different colors. acquisition means for acquiring an image; image processing means for performing image processing on the acquired image; and output means for outputting the image having undergone the image processing to an output destination, wherein the image processing comprises: shade removing processing (S504) for removing illumination unevenness and brightness unevenness from the acquired image; foreground extraction processing (S505) for extracting foreground areas by performing, on the image having undergone the shade removing processing, gray scale conversion and then binarization processing; and replacement processing (S506) for identifying text portions from the extracted foreground areas, and replacing colors of the identified text portions with a first color, and shade removing processing (S504) for removing illumination unevenness and brightness unevenness from the acquired image; foreground extraction processing (S505) for extracting foreground areas by performing, on the image having undergone the shade removing processing, gray scale conversion and then binarization processing; and replacement processing (S506) for identifying text portions from the extracted foreground areas, and replacing colors of the identified text portions with a first color, and wherein the output means is able to output the image having undergone the replacement processing to the output destination and to output the image not having undergone the replacement processing to the output destination, characterized in that in the replacement processing the first color is selected from a plurality of predetermined different colors, based on the colors corresponding to the identified text portions if the color corresponding to the identified text portion meets a range of the first color that is selected from the plurality of predetermined different colors, wherein, in the replacement processing, the first color is the average color of the identified text portion if the color corresponding to the identified text portion meets none of the ranges of the plurality of predetermined different colors. <EOS>