Digital Image Formats

There are two main ways that a digital file can store information about an image:

Vector images are made up of independent objects (eg circles, arcs, squares). Each of these objects is defined in terms of mathematical relationships and instructions as to how to create it. A square, for example, is defined by where it is placed on the image, the length of a side in relation to the size of the entire image, the thickness and colour of the defining edges and so forth. This sounds complicated when explained in words but, in fact, the size of images made up of vector shapes is typically much smaller than an equivalent bitmap file (see below). This is because it is not the image itself that is stored – just the instructions necessary to re-create it.

Zombie - created as a vector graphicThe other main feature of a vector graphic (or image) is that it is “resolution-independent”. If you print a vector image the size of a postage stamp, its sharpness will be the same as if you printed it to fill a whole A4 page. Vector graphics are used in situations such as computer-aided design where images are made up of individually created elements and where sharpness and clarity at large sizes are important. Unfortunately, vector graphics won’t work for us in a lot of situations because the image (eg a photograph) can not easily be broken down into objects that can be defined geometrically and mathematically.

The image of the zombie was created as a vector image (source).

Bitmaps or raster images
are the more familiar format of graphics file for most people. In a bitmap file the image is composed of thousands or millions of individually coloured rectangles or dots, each of which is a single colour. These are called “pixels” (a contraction of “picture elements”). Pixels can be seen in the enlarged section of Tate Modern on the bitmap here.

Bimap image showing pixels

There may be a choice of up to 16,777,216 colours available for each pixel. So, if you imagine a grid of 3000 pixels in one direction and 2000 pixels in the other, in which each pixel could be one of 16,777,216 colours, you are imagining what a bitmap image looks like. In this case, there would be 6 million pixels (3000 X 2000), so this is would be a “6 mega-pixel” image.

The problem with bitmap images is that they can be large – very very large – in terms of the space they take to store. It takes an awful lot of zeroes and ones to define 6,000,000 pixels when each pixel can be one of 16 million colours.

So, we can now say that the smaller, resolution-independent, type of image (ie the vector graphic) isn’t going to be any good to us if our images are, in fact, photographs (or anything else that can not be broken down into individual geometric “objects”). Therefore, we are usually going to be using bitmap (raster) images. This means that we are going to have to struggle with the play-off between the size of file that we create and the quality of the final image. It is largely to achieve the best compromise in this play-off that there exist several types of bitmap image:

Tif (or tiff) files tend to produce very large files because all of the information in each pixel is always retained (this is known as a “lossless” image type). This has advantages for quality but disadvantages for file size. It is often the preferred file format for people creating and editing images (including photographs) using photo editing software such as Photoshop.

Gif and png files (pronounced “gif” or “jif” and “pee en gee” respectively) are graphics formats producing very small files. They are mainly used for images on web pages. The small file size is achieved by reducing the number of different colours in the image to the minimum necessary to create that image at an acceptable quality.

Jpg or jpeg files (pronounced “jay peg”) are the most favoured for finished photographs. Almost all digital cameras will create jpg files (although a lot will also create other formats). The advantage is that the file is compressed to be smaller. The price to be paid for this is that some loss of information (which translates into picture quality) will occur. This probably won’t be too serious to begin with, but if you repeatedly edit and save a jpg image then the quality will continue to degrade.

Raw is a “lossless” format produced by many digital cameras. However, there are lots of flavors of raw images so you may need the software provided with the camera to handle them.

Bmp (bitmap) is a Windows specification of a lossless file. Bmp files can be large but they have the advantage that they can be handled by almost all programs that need to deal with image files . And, yes, we do now have two different uses of the word “bitmap”. It is used synonymously with “raster” (as distinct from vector images) and is also used as the name of a specific Windows file format.

Apart from the image itself, most image files can also carry other information (called “exif” information or “metadata”) that can be used and displayed by image-handling programs. This can include, for example, the camera type, exposure information, date and time of exposure, and – somewhat controversially – the exact geographical location where the photograph was taken (known as “geotagging“).

Although I’ve tried to keep this simple, we’ve only scratched the surface (ha-ha) of digital photography by just looking at how digital images are composed and the main formats of files. Next time, I will look in more detail at jpgs as these are initially the most commonly encountered files in digital photography.

(Last updated 07/09/2023)