1. An image forming apparatus including a recording head having nozzles discharging ink droplets to form dots on a recording medium based on image data supplied thereto, the image forming apparatus comprising: a detector configured to detect a defective one of the nozzles, the defective nozzle discharging a defective ink droplet forming an expected defective dot; a focus region setting unit configured to set a focus region including a position of the expected defective dot to be formed of the defective ink droplet discharged by the detective nozzle; and a rearranging unit configured to rearrange, when the defective nozzle is detected by the detector, the dots in the focus region based on a slope of a line image expressed by the supplied image data in the focus region and values indicating respective sizes of the dots in the focus region.