Image deterioration is suppressed as much as possible which is complexly generated by variations of printing positions respectively of printing elements in a printing element row and by displacement of printing positions among printing element rows. To this end, a first adjustment value for adjusting printing positions among a plurality of printing elements included in a printing element row is obtained. Next, printing positions among a plurality of printing elements are adjusted based on the first adjustment value. Then a second adjustment value for adjusting printing positions among not less than two of the printing element rows is obtained. Thereby variations of printing positions in a discharge port row and displacement of printing positions among discharge port rows are properly adjusted in different phases, and adverse effects generated by two kinds of different causes are collectively suppressed.