Data Formats

Data Formats

Images are made up of either pixel data, vector data, or a combination of the two. In the end, both types of data are rendered as pixels on a display device, but the way in which the data is constructed and saved is very different between the two.
The following chapters describe the features of the main image data types (For a description of file formats, see the file formats page).

Raster Data

A raster image or bitmap is a structure representing a rectangular grid of small points of color, so called pixels. Each pixel has a certain position and a certain color value. Simply put, a bitmap or raster image will store the position and color of every pixel of an image.

For example, in raster image, a circle is built by arranging individual colored pixels in a way that forms a circular shape. Editing raster images means editing pixel data instead of objects or forms, deleting and moving pixels, effectively editing the information as one would overpaint something on a canvas.

A bitmap is characterized by the width and height of the image in pixels and the number of bits per pixel, which determines the numbers of colors it can represent. The quality of a bitmap depends on the total number of pixels, the resolution, and the amount of information in each pixel, the so called color depth. For example: an image that stores 24 bit of color information per pixel can represent smoother degrees of shading than one that can store only 256 colors. Also, an image sampled with 640 x 480 pixels will look rough and blocky compared to one sampled at 1280 x 1024 pixels.
Raster graphics cannot be scaled to a significantly higher resolution without noticeable loss of quality. Vector graphics on the other hand can easily scale to any size.

Vector Data

As opposed to the raster image formats above (where the data describes the characteristics of each individual pixel), vector image formats contain a geometric description of the shapes and colors within, which can be rendered smoothly at any desired display size.

In a vector graphic, a circle would be built using a mathematical definition of said circle. Saving its specific radius, location, color etc. in numeric values. These values can be adjusted and the circle smoothly redrawn. This can be thought of like altering construction plans. When rendering an element of a vector file, a graphics program will refer to the saved parameters of the object, e.g. draw circle with 50cm radius. Scaling the circle changes the instructions in the construction plan, the circle is redrawn with the new parameters. This way of storing the graphical information means it can be moved, scaled, and its color can be changed without any loss of quality.
Vector graphics do not depend on the resolution – that is, they are not determined by a given number of pixels. They are scaled automatically so that they come out very sharp on any output device and in any resolution. Vector images are suitable for text (especially in small sizes) and graphics such as logos that require clear contours in any size.