An electrophotographic image forming apparatus comprising: an image carrier (2Y, 2M, 2C, 2K); a developer carrier (5Ya, 5Ca, 5Ma, 5Ka) configured to adhere toner onto the image carrier (2Y, 2M, 2C, 2K); an image density detector configured to detect a density of an image on the image carrier (2Y, 2M, 2C, 2K) formed by the developer carrier (5Ya, 5Ca, 5Ma, 5Ka) adhering the toner onto the image carrier (2Y, 2M, 2C, 2K); a rotary member, wherein an image pattern is formed on the outer circumferential surface of the rotary member, and the density of the image pattern is detected by the image density detector; and a rotational position detector (18Y, 18C, 18M, 18K) configured to detect a rotational position of one of the image carrier (2Y, 2M, 2C, 2K) and the developer carrier (5Ya, 5Ca, 5Ma, 5Ka), wherein the image forming apparatus further comprises a writing unit (4Y, 4M, 4C, 4K), characterized in that a determination of a leading end and/or a trailing end position of the image pattern formed on the rotary member in the sub-scanning direction is performed responsive to: the rotational position of the image carrier (2Y, 2M, 2C, 2K) detected by the rotational position detector (18Y, 18C, 18M, 18K); an interval between a writing position on the image carrier (2Y, 2M, 2C, 2K) at which the writing unit (4Y, 4M, 4C, 4K) adheres toner and a detection position of the image pattern by the image density detector; and a process linear speed of the image carrier (2Y, 2M, 2C, 2K) over the interval. an image carrier (2Y, 2M, 2C, 2K); a developer carrier (5Ya, 5Ca, 5Ma, 5Ka) configured to adhere toner onto the image carrier (2Y, 2M, 2C, 2K); an image density detector configured to detect a density of an image on the image carrier (2Y, 2M, 2C, 2K) formed by the developer carrier (5Ya, 5Ca, 5Ma, 5Ka) adhering the toner onto the image carrier (2Y, 2M, 2C, 2K); a rotary member, wherein an image pattern is formed on the outer circumferential surface of the rotary member, and the density of the image pattern is detected by the image density detector; and a rotational position detector (18Y, 18C, 18M, 18K) configured to detect a rotational position of one of the image carrier (2Y, 2M, 2C, 2K) and the developer carrier (5Ya, 5Ca, 5Ma, 5Ka), wherein the image forming apparatus further comprises a writing unit (4Y, 4M, 4C, 4K), characterized in that a determination of a leading end and/or a trailing end position of the image pattern formed on the rotary member in the sub-scanning direction is performed responsive to: the rotational position of the image carrier (2Y, 2M, 2C, 2K) detected by the rotational position detector (18Y, 18C, 18M, 18K); an interval between a writing position on the image carrier (2Y, 2M, 2C, 2K) at which the writing unit (4Y, 4M, 4C, 4K) adheres toner and a detection position of the image pattern by the image density detector; and a process linear speed of the image carrier (2Y, 2M, 2C, 2K) over the interval. the rotational position of the image carrier (2Y, 2M, 2C, 2K) detected by the rotational position detector (18Y, 18C, 18M, 18K); an interval between a writing position on the image carrier (2Y, 2M, 2C, 2K) at which the writing unit (4Y, 4M, 4C, 4K) adheres toner and a detection position of the image pattern by the image density detector; and a process linear speed of the image carrier (2Y, 2M, 2C, 2K) over the interval.