Nepedia
Back to Discover
Advanced Reader
💻

Raster graphics

technology Maturity 7-9 Next article →

A raster graphic is a digital image built from a rectangular grid. This grid is made of tiny colored squares known as pixels, which is short for "picture elements."

Rgb-raster-image
Rgb-raster-image

Unlike vector graphics that use mathematical formulas to draw shapes, raster images store the specific color of every single pixel. This makes them the best choice for photographs and images with very complex details. They are defined by their dimensions, which are the width and height in pixels. They are also defined by color depth, which is the number of bits used for each pixel.

Raster graphic fish 20x23squares sdtv-example
Raster graphic fish 20x23squares sdtv-example

To create these images, the computer uses a process called tessellation. This means it tiles a flat plane into a two-dimensional array of squares. In digital photography, this plane is the visual field captured by a sensor. In computer art, the plane is a virtual canvas. In geographic information systems, the plane is a projection of the Earth's surface. Each pixel in the grid has a constant size, which is called the resolution or support. The computer stores a single numeric value for each pixel to represent its color or other data.

Most modern color raster formats use the RGB color model to represent color. This model uses three color channels: red, green, and blue. Each channel typically uses 8 bits of data, which provides values from 0 to 255. By combining these channels, a single pixel can represent over 16 million distinct colors. Some specialized sensors can even go beyond this. For example, the Vera C. Rubin Observatory uses a large CCD sensor. It captures 3.2 gigapixels in a single image, which creates a 6.4 GB raw file. This sensor uses over six color channels to exceed the spectral range of human vision.

When a computer saves a raster image, it must serialize the data. This means turning the 2D grid into a long list of numbers. The most common method is called row-major format. In this format, the computer lists the cells in the first row from left to right. It then moves immediately to the second row and repeats the process.

The use of a raster data structure to summarize a point pattern
The use of a raster data structure to summarize a point pattern

To reconstruct the grid, the file must include a header section. This header contains essential information like the number of columns and the pixel datatype. It may also include metadata tags, such as those found in the Exif standard.

Because high-resolution grids contain so many pixels, they require a lot of storage. To solve this, engineers use compression algorithms to make files smaller. Some algorithms are "lossless," meaning the original pixels can be perfectly regenerated. An example is Run-length encoding (RLE), which looks for repeated values and stores them as a single value plus a count. Other algorithms are "lossy," meaning they only provide an approximation of the original data. JPEG is a common example of a lossy format. Other popular formats used on the web include GIF and PNG.

Matrix transpose
Matrix transpose

The history of the word "raster" traces back to the Latin word "rastrum," meaning a rake. This name comes from the way cathode-ray tube (CRT) monitors worked. These old monitors used an electron beam to scan the screen line by line. This process is called a raster scan. In the late 1960s, A. Michael Noll invented an early scanned display at Bell Labs. He filed a patent application for this in February 1970. However, a legal battle over the patentability of software reached the Supreme Court in 1977, and the patent was abandoned.

Today, you can see raster graphics in many different technologies. Modern flat-panel LED monitors use a raster approach to refresh the screen. They scan through pixels and color them according to bits in memory. Almost all modern printers, including inkjet and laser types, create images as a raster grid. In medical imaging, such as MRI scanners, scientists use a three-dimensional version called a voxel. Even geography uses rasters to represent fields like temperature or soil moisture. In these systems, each pixel is called a cell and represents a specific area of the Earth.

674 words

Where will your curiosity go next?

Keep exploring at your chosen reading level.

🖼️ Images & Media (4)
File:Rgb-raster-image.svg
Rgb-raster-image.svg
File:Matrix transpose.gif
Matrix transpose.gif
File:Raster graphic fish 20x23squares sdtv-example.png
Raster graphic fish 20x23squares sdtv-example.png
File:The use of a raster data structure to summarize a point pattern.png
The use of a raster data structure to...
More to explore

🔬 Go deeper

More advanced topics to explore

🪜 Step back

Simpler topics to build understanding

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.