Digital Images and Compression

26th September 2016

What is a digital image?

A digital image is a photograph or other graphic that has been saved using a computer into a digital format.

Digital simply means something can be expressed as a series of 0s and 1s which is how your computer stores all of your computer files.

Digital images can be classified into two types: vector images, or raster images; usually if the term digital image is used by itself it will be referring to raster images rather than vector images.

Vector Images

Vector images, or vector graphics, use shapes to represent images; they are based on vectors which hold locations and control points.

Each point has a position and other attributes such as colour, shape, and thickness which tell the computer how to draw the image. Vector images are not created from fixed pixels and are created by the computer following the instructions held within the image file.

Vector images can be resized without loss of quality because the computer simply draws the image at a larger scale instead of having to manipulate individual pixels.

Vector images are normally used for simple graphics and are not suited for photography.

The file format of a vector image depends on the particular graphics package the image was created in, however recently the SVG (Scalable Vector Graphic) format has seen wide adoption on the world wide web due to cross browser support.

Raster Images

Raster, or bitmapped images, are made up of collections of mapped pixels; a pixel is the smallest unit of information in a digital image and represents a single colour value.

Unlike vector images, raster images are stored with colour information held in fixed positions within a grid structure, and when enlarged individual pixels will appear as squares of a single colour.

Raster images have a pixel resolution which is the width and height of the image in pixels, e.g. 1920 x 1080.

Raster images can also be held in different formats, the format is the way the information is held by the computer or device. Different formats produce different file sizes, but the file size has nothing to do with an image’s pixel resolution or it’s display or print size.


Smaller file sizes are created by using image compression; compression allows the computer to save disk space by using a software algorithm to reduce the amount of raw information that is needed to represent the image.

There are two types of compression: “lossless”, which retains all of the original image information; and “lossy” which reduces the quality of the image in order to increase the efficiency of the compression algorithm thereby reducing the file size.

Lossy compression make use of the fact that human eyes cannot tell the difference between certain colour values especially when looking at a high quality image on a high resolution display where the pixels are extremely small; because of this, some file formats throw away “unnecessary” colour information in order to save space.

For example, there may be three different colours in an image that could be considered white, they’re not exactly the same but it would be hard to tell the difference unless the colours were next to each other and the image was scaled up, in this case a compression algorithm may choose the “average” white and change all the white values to be this single value.

The higher the compression the lower quality the image would become as more and more colour information is thrown away; this will result in fuzzy, blocky, graphics.

PNG and TIFF image formats are examples of lossless compression; JPEG files are examples of lossy compression.

Image editors such as Photoshop or GIMP also have their own file formats, these formats save all of the image information and additional information such as image layers, filters, or other options applied in the editor. Files saved in these proprietary formats cannot normally be opened in any other application because the information is relevant only to the original editor.

Which format should I use

Which format you should use depends on the what you want to do with the graphic; a photograph that will be displayed on a website or social media does not need to have a very high resolution and you could use a lossy format such as JPEG to keep the file size down.

If you need high quality images for printing then you should use a lossless format such as PNG or TIFF, and if you have yet to finish editing your graphic you should keep it in the default format your image editor uses so all of the image information will be saved.