1. An image reading apparatus comprising: an image reading unit configured to scan a printed side of an original in a main scanning direction with a light source turned on and to perform a photoelectric conversion of a reflected light from the printed side on a line-by-line basis with a photoelectric conversion element to read as an analog image signal; an analog-to-digital conversion unit configured to convert the analog image signal read by the image reading unit into a digital image signal and outputting the digital image signal; a first-black-level generating unit configured to generate, as a first black level, a gray level of the digital image signal outputted from the analog-to-digital conversion unit on a pixel-by-pixel basis in a state where the light source is turned off; a second-black-level generating unit configured to generate, as a second black level, an average of gray levels of a portion of the digital image signal outputted from the analog-to-digital conversion unit that corresponds to an optical black image portion in the photoelectric conversion element when the first-black-level generating unit generates the first black level generated on the pixel-by-pixel basis; a third-black-level generating unit configured to generate, as a third black level, an average of gray levels of the portion of the digital image signal outputted from the analog-to-digital conversion unit that corresponds to the optical black image portion in the photoelectric conversion element when an image of the original is read; and an offset correction unit configured to perform an offset correction of the gray level of the digital image signal outputted from the analog-to-digital conversion unit when an image of the original is read based on the first black level generated by the first-black-level generating unit and a difference between the third black level generated by the third-black-level generating unit and the second black level generated by the second-black-level generating unit.