An image forming apparatus that includes a line head formed as a long head by disposing a first short head and a second short head in one direction in a state in which recording elements have an overlap region in adjacent ends of the first short head and the second short head, each of the first short head and the second short head including a plurality of recording elements disposed in the one direction, wherein an array of dots is formed along a direction crossing an array direction of the recording elements by ejecting recording material from the first short head and the second short head, the image forming apparatus comprising: an ejection controller which performs overlap control to form an array of dots in the overlap region by recording material ejected from the recording elements of the first short head and recording material ejected from the recording elements of the second short head and to eject the recording material from the first short head and the second short head while gradually changing ejection share rates in the overlap region of the recording material ejected from the recording elements of the first short head and the second short head from recording element sides adjacent to the overlap region to end sides of the first short head and the second short head in the overlap region; an ejection defective recording element identifier which identifies a recording element that is defective in ejection of recording material in the overlap region; and an overlap area identifier which identifies a plurality of overlap areas in the overlap region, each of the overlap areas including a line of consecutive recording elements not including the recording element identified by the ejection defective recording element identifier, and identifies an overlap area including a largest number of overlapping recording elements from among the identified plurality of overlap areas, wherein the ejection controller performs the overlap control within a range of the overlap area identified by the overlap area identifier. an ejection controller which performs overlap control to form an array of dots in the overlap region by recording material ejected from the recording elements of the first short head and recording material ejected from the recording elements of the second short head and to eject the recording material from the first short head and the second short head while gradually changing ejection share rates in the overlap region of the recording material ejected from the recording elements of the first short head and the second short head from recording element sides adjacent to the overlap region to end sides of the first short head and the second short head in the overlap region; an ejection defective recording element identifier which identifies a recording element that is defective in ejection of recording material in the overlap region; and an overlap area identifier which identifies a plurality of overlap areas in the overlap region, each of the overlap areas including a line of consecutive recording elements not including the recording element identified by the ejection defective recording element identifier, and identifies an overlap area including a largest number of overlapping recording elements from among the identified plurality of overlap areas, wherein the ejection controller performs the overlap control within a range of the overlap area identified by the overlap area identifier.