1. An image forming apparatus comprising: a plurality of nozzle row groups in which one nozzle row group is positioned shifted to one side in a predetermined direction with respect to another nozzle row group, a plurality of nozzle rows extends in a direction intersecting the predetermined direction in each of the nozzle row groups, a plurality of nozzles ejecting ink is lined up in the predetermined direction in each of the nozzle rows, and the plurality of nozzles is communicated with a common ink chamber; and a control unit repeatedly performing an ejection operation ejecting the ink from the nozzles while relatively moving the plurality of nozzle row groups and a medium in the intersecting direction and a transport operation moving a relative position of the medium with respect to the plurality of nozzle row groups to one side in the predetermined direction, wherein the image forming apparatus is provided with a first mode, in which ink forming a main image is filled into the common ink chamber communicating with the plurality of nozzles belonging to the first nozzle row in the one nozzle row group, ink forming a background image of the main image is filled into the common ink chamber communicating with the plurality of nozzles belonging to the second nozzle row in the other nozzle row group, and the one nozzle row group and the other nozzle row group are used to form the background image before the main image with respect to a predetermined region of the medium, and a second mode, in which ink forming the background image is filled into the common ink chamber communicating with the plurality of nozzles belonging to the first nozzle row, ink forming the main image is filled into the common ink chamber communicating with the plurality of nozzles belonging to the second nozzle row, and the one nozzle row group and the other nozzle row group are used to form the main image before the background image with respect to a predetermined region of the medium.