Skip to main content
Researchdata.se

Images

There are primarily two image formats used for digital image files: raster and vector. Both formats have advantages and disadvantages. Vector images can be scaled up and down in size without losing quality and are therefore often used for logos or illustrations that need to vary in size. However, they do not capture details and color variations as accurately as raster images. Raster images are better suited for detailed images and digital photographs but lose quality when resized.

illustration describing the difference between the structure of vector images and raster images.
Representation of points, lines, and polygons as vector or raster.

Digital cameras automatically store image metadata in the image file, including information about the camera model and version, image rotation, aperture, shutter speed, focal length, white balance, light metering method, ISO, whether flash was used, and even the distance to the object. These metadata are called EXchangeable Image File Format (Exif).

In some cases, photographs may need digital post-processing. If the images are modified in an photo or image editing program, the Exif metadata may be destroyed or distorted. Therefore, never modify the original images, but create copies for processing and document all image format conversions and the software used for post-processing.

If it becomes necessary to convert a digital image from one format to another, it is also important to save the original images in their original, unedited state and store them separately. You may also face the question of whether to compress the files. You can read more about compression on the page “Compression of audio, image, and video.”

Below, we list several file formats, but many other formats may exist. Contact your local research data supportOpens in a new tab for advice on which file formats are suitable for long-term preservation and sharing of the type of research data you are working with.

Raster images

A raster image consists of a grid where each cell (pixel) has its own unique position and color. Raster images can be created in various ways, such as by photographing with a digital camera, scanning, or generating images from GIS layouts.

Key characteristics

There are many file formats for raster images, both proprietary (software-specific) and open formats. Different formats vary in how well they handle features such as color depth, transparency, and embedded metadata. Digital cameras and software often have preset values for various functions, but these presets can vary, as what is standard for one camera model is not necessarily the same for another.

Resolution

Resolution describes the level of detail in an image, expressed as a pixel count (e.g., pixels per inch [ppi], dots per inch [dpi], or samples per inch [spi]). The higher the resolution, the more details are captured in the image, and the larger the file size becomes. Raster images are sensitive to size changes. If an image is reduced, disturbing patterns may appear, and if enlarged, the sharpness may degrade, and the image may appear “pixellated” or blurry.

Two images of the same photo of a butterfly, but in different resolutions
The same photo but in different resolutions. Left is 72 ppi (1268 kb) and right is 15 ppi (81 kb).

Bit depth

Bit depth, or color depth, indicates how many colour shades an image file can contain or how many bits are used to represent colours. The bit depth is often 1 bit (either black or white), 8 bits (usually grayscale), or 24 bits (standard colours), but it can be more, allowing for greater transparency.

Color space

Color space describes which colours and colour variations are available. Color space often uses the RGB (Red, Green, Blue) or CMYK (Cyan, Magenta, Yellow with the addition of black/Key color) colour models for colour images, or a binary model (black and white) and grayscale formats for black-and-white images.

RGB systems are used for images that are primarily intended to be viewed on a screen, such as sRGB (standard RGB), which is the standard for today's web browsers. CMYK systems are instead common for printing. Therefore, if you are using images for printing, it may be wise to use a CMYK colour profile since RGB-based images may not reproduce the same colours when printed. There are also RGB systems that work well for print, such as Adobe RGB. Print services can often provide advice on which colour system to use for your images.

Compression

Since image quality degrades with so-called destructive (lossy) compression, it is important to know what type of compression different file formats use. Examples of lossless file formats are TIFF and PNG, which allow data to be stored without compression. A common format that uses destructive compression is JPEG. Destructive compression techniques should be handled with caution. If images are repeatedly migrated between different compressing systems and formats, image quality will deteriorate with each migration.

Layers

Layers are a common feature in many popular image editing programs and are used to edit parts of an image independently from other parts. The use of layers is not supported by raster file formats (except for TIFF). If you have used layers to process an image, the layers will be merged if you save the image as a raster image. Merged layers cannot be separated again, which makes it impossible to export or edit individual layers afterward.

What to preserve?

Recommended file formats for sharing and long-term preservation of raster images:

File formats like TIFF (.tif), JPEG2000 (.jp2), PNG (.png), and JPEG (.jpg) are well-known and widely supported for raster images. Other file formats may exist, and some, like PDF and SVG, can be used for both raster and vector images.

What should be preserved depends largely on how and for what purpose the raster images were created. You should aim for the images to be of a quality that ensures they can be reused and preserved in a long-term perspective. A general recommendation is to archive the original raster image files in an uncompressed, open file format, but in some cases, it may be necessary to convert images to an archive-friendly format.

Digital cameras typically create files in JPEG, TIFF, or RAW formats. If you use JPEG, consider the compression rate and decide whether the image quality justifies the file size and storage requirements. If you choose a raw format, ensure that the files can be converted to an appropriate archive format. TIFF is preferable in this case, although TIFF files are relatively large.

Scanners often allow users to choose the format in which the scanned image will be saved. The recommendation is to save scanned images, before any processing and regardless of the final format, in an open, uncompressed format or a format that uses lossless compression.

Most programs that allow you to create raster images support several file formats. If images are exported from, for example, a GIS or CAD program, the choice of file formats may be limited. If it is not possible to select, for example, TIFF, the files can be converted to a suitable archive format in another program. Always try to choose a format that does not use destructive compression.

If you have created composite images in an image editing program (e.g., Photoshop), you should save both the final composite version of the image and the individual images that make up the composite as separate files.

Vector images

Vector images can be seen as a collection of lines, polygons, and curves. A way of describing the shape of a vector figure is as a series of connected points, which can be compared to a colouring book where you draw lines between points to form an image. The placement of the points is determined by coordinates and mathematical formulas, which means that vector graphics can be enlarged or reduced without becoming blurred or “pixellated.” Vector figures can also be manipulated in various ways, for example rotated and combined with other vector objects, and may include two- or three-dimensional geometry.

Two images of the same photo of a butterfly, where one image is a vectorized version of a digital photo
A vectorized version (left) of a digital photo (right). Many details and colours are lost in the vectorized version.

Vector graphics are created in many different contexts but are often used for two-dimensional images intended for publication in articles or project reports. It is also standard practice to create logos using vector graphics, as a single vector file can be used for everything from headers on paper documents and websites to billboards that cover entire walls without losing resolution or requiring a larger file size.

Key characteristics

The key characteristics of a vector image involve the image's geometry, relationships between various shapes, and visual properties (colours, line types, and thickness). All of these must remain intact when images are migrated between file formats and for long-term preservation.

The key characteristics of vector images are:

  • Points and lines, along with text and/or embedded metadata
  • Basic geometries/primitives, such as rectangles, circles, and ellipses
  • Image structure, i.e., grouped objects and layers
  • Clipping and masks
  • Transformations and coordinate systems (which may be present in GIS and CAD vector files).

In addition to ensuring that these specific vector elements remain intact, several other properties may be added:

  • Line width, terminations of lines (which may sometimes be rounded), and join types
  • Miter limit (used to trim the point where two lines meet at a sharp angle)
  • Patterns and offsets
  • Colour
  • Transparency
  • How the area of a polygon figure is defined
  • Gradient (a transition from one color to another)
  • Text attributes such as font size and typeface
  • Rendering (the process of representing complex digital vector images from simple primitives).

Unfortunately, there is no simpler and more objective way to compare original files and migrated versions than by checking whether all elements are displayed correctly. When you convert a file to a new format, it is important to check for any hidden information, such as transparent objects or layers.

Sometimes, vector-based data need to be exported as raster images. In such cases, the resolution will be fixed for the vector image, which means there is a risk that certain features and layers may disappear. In such cases, it is important to choose an appropriate resolution for the raster image and to save the original vector file in a format which preserves all associated information.

What to preserve?

Recommended file formats for sharing and long-term preservation of vector images:

For vector images, the open file format Scalable Vector Graphics (.svg) is recommended. Other file formats may exist, and some formats, such as PDF, can be used for both raster and vector images.

Vector images are often accompanied by a database of important metadata. The metadata included may vary, but the database could contain information about the ID of various vector figures, what the figures represent (for spatial data, this might include labels like “industrial area,” “marsh,” or “Block Korpen”), coordinates, and similar information. Such databases must be saved alongside the vector file as they contain information that is necessary for future reuse.

Many vector images are created or included in larger datasets in CAD or GIS programs. If a vector figure originates from a file containing several different vector figures, such as a GIS file with an accompanying attribute database, it is recommended to preserve the original file intact instead of exporting each figure to its own file. The original file contains all necessary information, and it is more convenient to have a single file rather than many files. In other projects, it may instead be more appropriate to export vector images as individual figures. Regardless of the program, collection technique, or purpose, ensure that each file is accompanied by sufficient documentation for future reuse.

For more information on file formats for text, see the ARIADNE guides Raster images: A guide to good practiceOpens in a new tab and Vector images: A guide to good practiceOpens in a new tab.The guides have been developed by SND and translated into English in cooperation with the EU-funded infrastructure ARIADNEOpens in a new tab. ARIADNE is responsible for updating the English guides and keeping them accessible.