An image processing apparatus comprising: base material information acquisition means for acquiring base material information including at least (i) yarn type information for specifying a quality of warp and weft as information indicating the quality of the fiber in cloth which is a medium to be printed and (ii) weave type information indicating the type of weave and thickness information indicating a thickness of a yarn; image acquisition means for acquiring image data of a pattern to be printed on the cloth; and pretreatment liquid image generation means for generating a pretreatment liquid image that indicates a pretreatment liquid application pattern defining a pretreatment liquid application position where a pretreatment liquid including a functional material for preventing wetting and spreading of ink in the cloth is applied and a pretreatment liquid non-application position where the application of the pretreatment liquid is limited, on the basis of the base material information and the image data, characterised in that the pretreatment liquid image generation means includes: function determination means for determining a function used to calculate an application direction and range of the pretreatment liquid on the basis of the base material information; and arithmetic processing means for calculating the pretreatment liquid application position and an amount of pretreatment liquid applied which correspond to the image data, using the function determined by the function determination means. base material information acquisition means for acquiring base material information including at least (i) yarn type information for specifying a quality of warp and weft as information indicating the quality of the fiber in cloth which is a medium to be printed and (ii) weave type information indicating the type of weave and thickness information indicating a thickness of a yarn; image acquisition means for acquiring image data of a pattern to be printed on the cloth; and pretreatment liquid image generation means for generating a pretreatment liquid image that indicates a pretreatment liquid application pattern defining a pretreatment liquid application position where a pretreatment liquid including a functional material for preventing wetting and spreading of ink in the cloth is applied and a pretreatment liquid non-application position where the application of the pretreatment liquid is limited, on the basis of the base material information and the image data, characterised in that the pretreatment liquid image generation means includes: function determination means for determining a function used to calculate an application direction and range of the pretreatment liquid on the basis of the base material information; and arithmetic processing means for calculating the pretreatment liquid application position and an amount of pretreatment liquid applied which correspond to the image data, using the function determined by the function determination means. function determination means for determining a function used to calculate an application direction and range of the pretreatment liquid on the basis of the base material information; and arithmetic processing means for calculating the pretreatment liquid application position and an amount of pretreatment liquid applied which correspond to the image data, using the function determined by the function determination means.