An image forming apparatus includes: a developing device; a container for containing
developer; a developer detector for outputting an output signal corresponding to
presence or absence of developer, the developer detector being attached to a wall
surface of the container so that a detector plane faces toward inside of the container;
an agitating device for sliding on the detector plane of the developer detector
and for agitating developer in the container; a controller for controlling a movement
speed of the agitating device so that a relation between rise time T0 required
for rise of the output signal outputted from the developer detector and time T1
when the agitating device covers the detector plane of the developer detector meets
T0T1.