An image processing apparatus comprising: scanning means configured to scan a document; obtaining means configured to obtain, using buffering means, brightness values of two pixels among a plurality of pixels included in a target area of image data obtained by scanning the document, wherein the two pixels are a pixel having a maximum brightness among the plurality of pixels included in the target area and a pixel having a minimum brightness among the plurality of pixels included in the target area, and the target area has a predetermined size and a target pixel; characterized in that the image processing apparatus further comprises: determination means configured to determine whether or not a difference between the brightness values of the two pixels is higher than a predetermined threshold (Th); decision means configured to decide a brightness correction amount for increasing brightness of the target pixel based on the result of the determination by the determination means; and correction means configured to correct a brightness value of the target pixel based on the brightness correction amount decided by the decision means, wherein, in a case where a brightness value corresponding to the brightness of the target pixel is higher than or equal to a predetermined brightness value and the difference between the brightness values of the two pixels is lower than or equal to the predetermined threshold, the decision means is configured to decide the brightness correction amount so that the brightness correction amount is higher than a brightness correction amount decided when the difference between the brightness values of the two pixels is higher than the predetermined threshold. scanning means configured to scan a document; obtaining means configured to obtain, using buffering means, brightness values of two pixels among a plurality of pixels included in a target area of image data obtained by scanning the document, wherein the two pixels are a pixel having a maximum brightness among the plurality of pixels included in the target area and a pixel having a minimum brightness among the plurality of pixels included in the target area, and the target area has a predetermined size and a target pixel; characterized in that the image processing apparatus further comprises: determination means configured to determine whether or not a difference between the brightness values of the two pixels is higher than a predetermined threshold (Th); decision means configured to decide a brightness correction amount for increasing brightness of the target pixel based on the result of the determination by the determination means; and correction means configured to correct a brightness value of the target pixel based on the brightness correction amount decided by the decision means, wherein, in a case where a brightness value corresponding to the brightness of the target pixel is higher than or equal to a predetermined brightness value and the difference between the brightness values of the two pixels is lower than or equal to the predetermined threshold, the decision means is configured to decide the brightness correction amount so that the brightness correction amount is higher than a brightness correction amount decided when the difference between the brightness values of the two pixels is higher than the predetermined threshold. determination means configured to determine whether or not a difference between the brightness values of the two pixels is higher than a predetermined threshold (Th); decision means configured to decide a brightness correction amount for increasing brightness of the target pixel based on the result of the determination by the determination means; and correction means configured to correct a brightness value of the target pixel based on the brightness correction amount decided by the decision means, wherein, in a case where a brightness value corresponding to the brightness of the target pixel is higher than or equal to a predetermined brightness value and the difference between the brightness values of the two pixels is lower than or equal to the predetermined threshold, the decision means is configured to decide the brightness correction amount so that the brightness correction amount is higher than a brightness correction amount decided when the difference between the brightness values of the two pixels is higher than the predetermined threshold.