Article · Wikipedia archive · Last revised Jun 3, 2026

Marching ants

The marching ants effect is an animation technique often found in selection tools of computer graphics programs. It helps the user to quickly distinguish an image selection border from the surrounding content by animating the border as a dotted or dashed line, where the segments appear to move in parallel along the border. The consistent movement of the black segments creates an illusion of ants marching in line, from which the name of the effect is derived.

Last revised
Jun 3, 2026
Read time
≈ 1 min
Length
343 w
Citations
1
Source
An example of a rectangle using marching ants source ↗

The marching ants effect is an animation technique often found in selection tools of computer graphics programs. It helps the user to quickly distinguish an image selection border from the surrounding content by animating the border as a dotted or dashed line, where the segments appear to move in parallel along the border. The consistent movement of the black segments creates an illusion of ants marching in line, from which the name of the effect is derived.

The technique was first widely used by the MacPaint program developed by Bill Atkinson, and has since been adopted by many popular graphics programs like GIMP and Adobe Photoshop. The effect is also known as a marquee selection, as the effect resembles the chaser lights of a marquee sign.

Origin

Bill Atkinson, the creator of the effect, conceptualized the effect while at a pub in Los Gatos, California. An electric Hamm's Beer sign was on display at the pub, which consisted of an illuminated scene with an animated waterfall seeming to flow into a lake. Atkinson figured that this effect could solve his problem due to its recognizability.

He implemented the idea and showed it to Rod Perkins from the Apple Lisa team, who told Atkinson the effect reminded him of "marching ants".1

Implementation

Eight pixel patterns that can be used to produce marching ants source ↗

A common way to achieve the effect is by drawing the selection using a pen pattern that contains diagonal lines, and removing all but the outer edge. If the selection outline is only one pixel thick, the slices out of the pattern will then look like a dashed line, and the marching animation can easily be achieved by simply shifting the pattern one pixel and redrawing the outline. However, selection borders that are not parallel to the coordinate axes will reveal the underlying implementation and compromise the effect.

References

References

  1. MacPaint Evolution at folklore.org
External links