Raster graphics describe a picture by an array of pixels on a grid. For a rectangular image of width and height , write its stored values as , with and . A grayscale pixel can have one shade value; a colour pixel can have several component values. The grid specifies where values belong, while the encoding specifies what those values mean. A raster image therefore needs dimensions and an interpretation of its samples, not just a string of numbers.
The appealing feature is that pictures become explicit data: selecting a rectangle selects entries of an array; comparing two images compares their pixel values; image compression can exploit repeated or related values. Raster sampling and reconstruction explains why the stored grid and the displayed picture are different objects. A square drawn around a sample is one display convention, not a claim that the original scene consisted of little squares.
For example, a grayscale raster image stores 24 pixel values, even when displayed across a much larger rectangle. With one unsigned eight-bit sample per pixel, its uncompressed sample payload is bits; a file format can additionally require a file header, padding and other information, and image compression can change the stored size.
Enlarging that image can copy each pixel into a block through nearest-neighbor interpolation, or infer intermediate values through interpolation. Either procedure supplies a reconstruction rule; neither determines which unrecorded detail was present in the original. Vector graphics use a different representation, specifying geometric objects to be rendered onto a chosen grid. Re-rendering such a description and enlarging an existing raster image are different operations.
Articles by others on the same topic
Raster graphics, also known as bitmap graphics, are images composed of a grid of individual pixels, where each pixel represents a specific color. This pixel-based approach means that raster images are resolution-dependent; their quality is determined by the number of pixels in the image (measured in resolution, such as DPI or PPI). Common formats for raster graphics include JPEG, PNG, GIF, and BMP.