An experience of an afterimage is caused by a previously seen stimulus, when that stimulus itself is no longer present.
Positive afterimages are the same colour as the previously seen stimulus. They often occur when there is no stimulation—for example because the lights have gone out, or because your eyes are closed and your hands are in front of them to block all light. In these conditions they occur when some cells (the cones) on your retina keep transmiting signals to the brain for a little while after they have been stimulated. But they can also happen in other conditions, such as when presented with a previously seen outline of a shape, as occurs in the above Colour Dove Illusion.
(Negative afterimages exhibit inverted lightness levels, or colours complementary to, those of the stimulus. They are usually induced by prolonged viewing of a stimulus and then best seen against a brightly light background. They occur (as least in part) becasue some cells (the cones) on the retina do not respond to the present stimulation because they have been desensitised by looking at a prior stimulus.)
The Colour Dove Illusion gives one an experience of a positive afterimage for a few seconds. It is crucial for the effect that the outline shape is preserved after the color of the background disappears. The effect can occur with any colour, as can be seen by looking at left-hand side of the image below and focusing on the target in the dove for a few seconds and then transferring one's gaze to the target in the dove in the image on the right.

The effect also occurs when there is just a thin strip of colour around the image, as one can experience for oneself using the figure below. This, together with the fact that the inducer only needs to be seen for a short period time prompts Barkan and Spitzer (2017) to speculate that the effect is actually an aftereffect of the spatiochromatic edge. However, further investigation of the precise mechanism at play is required.

Many philosophers of perception seek to analyse afterimages as pathological cases of visual experience. Many philosophers think that in order for an experience as of seeing an object to amount to genuine visual perception, that object must exist and one’s visual experience must be appropriately caused by that object. Now, visual illusions are usually analysed as cases in which one perceives the objects of the public, external world, but that perceptual experience is somehow inaccurate or non-veridical. In the case of Negative Afterimages, one may have a lasting visual experience as of a green square on a white wall, but no such green square, or indeed a square of any sort, need exists independently of one’s own nervous system in front of one at that time (and no green square need to have been previosuly in front of one). Afterimages are not ordinary public objects, but rather they arise as artefacts of individual perceptual systems. This has led many philosophers to suggest that the visual experience of an afterimage is a failure of perception, and hence afterimages are best characterised as a type of hallucination.
However, in the case of the Colour Dove, as the effect only occurs when the outline shape is preserved after the color of the background disappears, then it is tempting to think that this is really an illusion of colour. One sees the outline shape of the dove and simply misperceives its colour.
Further discussion of whether other afterimages are illusions or hallucinations and the philosophical implications of this can be read about in the entries for Positive Afterimages and Negative Afterimages.