An image forming apparatus configured to scan light beams, the light beams corresponding to image data, in a main scanning direction, irradiate a photosensitive member, the photosensitive member being rotatable in a sub scanning direction, with the light beams to form a latent image, develop the latent image formed on the photosensitive member, and transfer the developed image onto a recording sheet, the image forming apparatus comprising: a plurality of light sources (A, B), each configured to emit a light beam; an optical system (801, 804, 805, 806), wherein the plurality of light sources and the optical system are arranged such that the light beams emitted by the plurality of light sources pass through the optical system and are emitted from the optical system, such that they each scan a scanning line across the photosensitive member in a main scanning direction; storage means (107, 109) configured to store profile data of the scanning line of each of the plurality of light sources; image processing means configured to obtain shift amounts of neighboring pixels on neighboring scanning lines from their ideal positions on ideal scanning lines extending in the main scanning direction and a shift amount of a target pixel from its ideal position on another ideal scanning line extending in the main scanning direction, based on the profile data stored in the storage means and to obtain distances between the target pixel and the neighboring pixels based on the shift amounts of the neighboring pixels and the shift amount of the target pixel; wherein the image processing means comprises: a filter coefficient control unit configured to obtain filter coefficients, corresponding to the distances between the target pixel and the neighboring pixels; and a filter calculation unit configured to perform a filter calculation by using image data of the neighboring pixels and the filter coefficients to obtain an adjusted density value of the image data of the target pixel to compensate for a deviation, in the sub-scanning direction, of the scanning line of each of the light beams from the ideal scanning line; wherein the image forming apparatus further comprises a drive means configured to cause light beam emission from the plurality of light sources based on the adjusted image data to which the image processing is performed by the image processing means. a plurality of light sources (A, B), each configured to emit a light beam; an optical system (801, 804, 805, 806), wherein the plurality of light sources and the optical system are arranged such that the light beams emitted by the plurality of light sources pass through the optical system and are emitted from the optical system, such that they each scan a scanning line across the photosensitive member in a main scanning direction; storage means (107, 109) configured to store profile data of the scanning line of each of the plurality of light sources; image processing means configured to obtain shift amounts of neighboring pixels on neighboring scanning lines from their ideal positions on ideal scanning lines extending in the main scanning direction and a shift amount of a target pixel from its ideal position on another ideal scanning line extending in the main scanning direction, based on the profile data stored in the storage means and to obtain distances between the target pixel and the neighboring pixels based on the shift amounts of the neighboring pixels and the shift amount of the target pixel; wherein the image processing means comprises: a filter coefficient control unit configured to obtain filter coefficients, corresponding to the distances between the target pixel and the neighboring pixels; and a filter calculation unit configured to perform a filter calculation by using image data of the neighboring pixels and the filter coefficients to obtain an adjusted density value of the image data of the target pixel to compensate for a deviation, in the sub-scanning direction, of the scanning line of each of the light beams from the ideal scanning line; a filter coefficient control unit configured to obtain filter coefficients, corresponding to the distances between the target pixel and the neighboring pixels; and a filter calculation unit configured to perform a filter calculation by using image data of the neighboring pixels and the filter coefficients to obtain an adjusted density value of the image data of the target pixel to compensate for a deviation, in the sub-scanning direction, of the scanning line of each of the light beams from the ideal scanning line; wherein the image forming apparatus further comprises a drive means configured to cause light beam emission from the plurality of light sources based on the adjusted image data to which the image processing is performed by the image processing means.