Image format comparison

This page presents image format features and compares image codecs.

What are image formats?

A digital image is a two-dimensional grid of pixels and can be stored in a file, using an image format. There are three main categories of image formats:

Further reading: Image file format, Lossless compression, Lossy compression (Wikipedia)

Codec

A codec is the piece of software, called library, that is used to encode or decode images of a given format. There may exist multiple codecs for the same image format.
Example: libpng for PNG

Note that some repacking tools exist to further compress already encoded image files or mixed media without loss. They are not presented further here because they are seen as transport-level compression schemes rather than image formats.
Examples: brunsli, brotli

Features of image formats

On top of the basic capacity of storing pixels in a universally specified way, image formats may possess other features:

Further reading: Image file format, Transparency, Chroma subsampling (Wikipedia), Image file type and format guide (Mozilla), Progressive and incremental image decoding demo

How to compare image formats?

There are multiple domains where image file formats and software implementations compete:

Over the internet, there could be several "best" formats: servers may choose to send images in different formats depending on the end device. The decision is based on whether the format is supported by the user's operating system, browser or app, the bandwidth, the screen resolution etc.

Estimating visual distortion

There are two main ways of getting a sense on how distorted is a decoded image compared to the original asset (for lossy compression only):

Choice of dataset

Even if distortion evaluation of lossy compression was a settled matter, the open question of the corpus choice remains for both lossy and lossless compression. A lot of image datasets exist out there but assuming its license is permissive enough, there is no guarantee that a dataset:

With all that said, one can still get an approximation of the overall performance of a codec compared to another. See the dedicated section "Comparison of image codecs".

Comparison of image codecs

Comparisons of multiple image codecs are linked below. The presets in the left navigation bar contain more codecs, more effort encoding settings for the same codecs, or different comparison criteria.
The Codec-Compare framework matches pairs of encoded images based on some criteria, for example the same source image and a similar amount of compression artifacts. It then aggregates the ratios given by each pair on some other dimensions such as file size, compression and decompression timings. Matching pairs ensures the selected data makes sense before aggregation. Unmatched data may be hidden by this selection process but should not be compared anyway.
See the section "How to compare image formats?" above for an explanation on the chosen comparison criteria.

All encodes and decodes are single-threaded. All metadata was stripped from the original images to only compare the compression rate of pixel values and mandatory format header sizes.

Verification: Verification is probably the MOST important part of any codec comparison when evaluating quality and performance. You, the reader, should be able to reproduce all of the results. All of the matched pairs in the Codec-Compare framework have the version of the codec and the command line, so you can independently verify the results.

Latest comparisons