Scan line
One row in a raster scanning pattern

A scan line (also scanline) is one line, or row, in a raster scanning pattern, such as a line of video on a cathode-ray tube (CRT) display of a television set or computer monitor.
On CRT screens the horizontal scan lines are visually discernible, even when viewed from a distance, as alternating colored lines and black lines, especially when a progressive scan signal with below maximum vertical resolution is displayed. This is sometimes used today as a visual effect in computer graphics.
01Analogue origin
In mechanical television, a two-dimensional image is converted into a one-dimensional signal using a spinning disc (Nipkow disk) with holes. As the disc spins, the holes make their way across the image and produce a varying brightness signal. Using an identically spinning disc and a light source that varies with this signal, the receiving side could project the original image onto a screen for viewing, so long as the disc spins fast enough for persistence of vision to make the lines blend together without obvious flickering. Additional synchronization signals, emitted at a fixed time before each frame or line, can be used to synchronize the spinning of the discs.
The same principle is employed in analogue television, where images are strictly rectangular and scanned in a pattern of straight lines instead of curved arcs. In addition to the persistence of vision, the cathode-ray tubes exhibit phosphor persistence. There is both a horizontal synchronization signal (which separates the lines) and a vertical synchronization signal (which separates the frames) to make decoding more robust. Additional features such as color were added later. The general shape of analogue television signals was then inherited into analogue computer display signals.
In analogue graphics, while each individual scan line is a discrete entity, the brightness levels within each line varies continuously (contrast with digital pixels chopping each line into a fixed number of segments). The horizontal resolution of an analogue signal is instead limited by the radio-frequency (RF) bandwidth allowed for each broadcast signal: the crisper a horizontal signal is, the more bandwidth it will need to use extending away from its carrier frequency, preventing other signals from using the same range of frequencies. Regulatory limits are set to make sure a reasonable number of channels can co-exist.

02Digital use
The term is used, by analogy, for a single row of pixels in a raster graphics image. Scan lines are important in representations of image data, because many image file formats have special rules for data at the end of a scan line. For example, there may be a rule that each scan line starts on a particular boundary (such as a byte or word; see for example BMP file format). This means that even otherwise compatible raster data may need to be analyzed at the level of scan lines in order to convert between formats.

Sources and credits
This article is adapted from the Wikipedia article “Scan line”, written by its contributors and licensed under CC BY-SA 4.0. Fathomly has changed the layout, removed citation markers, navigation and maintenance notices, and adjusted punctuation. This adapted version is shared under the same license. For references, see the original article.
Images, from Wikimedia Commons:
- Mitsubishi CS-40307 CRT Television Close-up.jpg by Retro Tech, CC BY 3.0
- Videosignal scanline.jpg by Shaddack, CC BY-SA 4.0
- Raster-scan.svg by Ian Harvey, Public domain
Fathomly is not affiliated with or endorsed by the Wikimedia Foundation. Spotted a problem? Tell us.