There is provided an image forming apparatus comprising: detection means for detecting position information indicating a scanning position interval prediction means for predicting a first scanning line interval indicating a distance in the sub-scanning direction between the scanning line of interest and a succeeding scanning line to be scanned after the scanning line of interest interval calculation means for calculating, by using the position information held by the holding means, a second scanning line interval indicating a distance in the sub-scanning direction between the scanning line of interest and the scanned scanning line and rate calculation means for calculating a correction rate on an exposure amount for the scanning line of interest so that a predicted density calculated using the first scanning line interval and the second scanning line interval matches with a predicted density calculated using a predetermined reference scanning line interval.