In addition to the popular jpeg format, there are many other image formats in which you can save photos and images. For example, when do you save a file as png, and what do you do with an eps file? In this article we discuss the sense and nonsense of all common photo formats and associated issues such as resolution and compression.
Your computer contains images in a variety of file formats. A photo you download from a camera is usually saved as jpg, while an image you download from the internet is often in png format. In this article we start with taking a photo, because here you already decide a lot about the photo. We find out the truths and falsehoods about resolution, compression and pixels. We then discuss standard image formats, program-dependent image formats and image formats of the future.
Part 1: Taking a photo
1. In-camera setup
When we talk about image formats, there are two properties by which we can easily distinguish them: with and without malicious compression. For example the jpeg and raw photo format.
All digital cameras save photos in the jpeg format. When taking a photo with a digital camera, you can specify the quality of the saved photos. If you choose high quality then little compression will be applied, with a lower quality there will be a lot of compression. As more compression is used, the size (in MBs) gets smaller, but details from the photo are also lost.
Digital SLR cameras and the advanced class of compact cameras support the raw format in addition to the jpeg. This format saves the images raw and unedited, and uses only a form of compression that does not lose any detail (see step 2). Not only does this keep the image quality optimal, but raw files can also be edited better in photo editing software. All image information, with the exact color gradation of each pixel, is still intact. As a result, for example, incorrect exposure or white balance of a photo is easy to correct afterwards. This is not possible with a photo in the jpeg format.
2. Resolution and Compression
Suppose a photo consists of 5000 x 4000 pixels, then it is a file with a resolution of 20 megapixels. Most photo files are of the RGB (red-green-blue) type, using 3 bytes of color information per pixel. The size of such a file is therefore 60,000,000 bytes, or 60 MB. Because 60 MB per photo is a huge drain on storage capacity, photos are always compressed so that they decrease in size. The more compression applied, the more photos can fit on a memory card.
There are two types of compression: lossless and lossy. Only lossless compression has no negative impact on image quality. A smart algorithm distinguishes between logical and illogical data, whereby the order is rearranged. For example, if a photo contains 10,000 completely white pixels, it takes significantly less space to remember the area where these white pixels are located than to store the location of each individual pixel. This is a non-destructive compression format that is also used with zip files. All image information remains intact, so the quality does not deteriorate. The size can be reduced from 60 MB to approximately 20 MB.
The other compression method is lossy. This method does lead to a loss of quality, but with moderate use this is hardly noticeable. In a photo, for example, the 100% white pixels and the pixels that are very close to it (and are indistinguishable to the eye) are stored as one color. The light tones that are very close to white are merged, as are the dark tones with black. For example, a blue sky consisting of 100,000 color gradations is reduced to 30,000 gradations. The same 20 megapixel file from our example is then reduced to approximately 5 MB (a 12-fold difference from the uncompressed 60 MB file). The difference is usually barely noticeable, but it is there. Lossy compression is always destructive, i.e. the quality decreases. The damage depends on the degree of compression. A 5 MB jpeg photo can also be reduced to 500 KB while retaining the resolution, but a lot of color information will then be lost. This is mainly reflected in even parts, such as skies. Compression is highly undesirable for high-quality printing, such as poster size or in a glossy magazine.
An example of destructive jpeg compression. The photo on the left has been saved with a quality standard of 90% (4 MB) and the photo on the right with 10% (450 KB). Compression creates so-called artifacts with blocky pixels and a blotchy color gradient.
Megapixel
The current generation of consumer camera contains 12 to 20 megapixels. To determine how much you need, it's important to know what a "megapixel" means exactly. In principle, the number of pixels is often seen as a quality standard, whereby 'the more the better' applies. This statement is, however, quite outdated, because the quality difference between a 12 and 20 megapixel camera is often minimally visible (and also strongly depends on the sensor and the lens used). The number of megapixels mainly says something about the ability to print large images. For example, a photo of 2 megapixels is more than enough to print on the standard photo size of 10 by 15 centimeters. For an A4 size print you usually need about 4 megapixels. If you intend to make even larger prints, it is necessary to have more megapixels. Advertising material or publication in magazines requires an even higher print quality. This is usually expressed in dpi (dots per inch) or ppi (pixels per inch).
The table below provides an overview of the number of megapixels (MP) required to print an image. Here we distinguish reasonable quality (150 dpi), good quality (200 dpi) and super quality for glossy magazines or high-quality posters (300 dpi). This is just a guideline, because the quality of a good photo depends on more factors than just megapixels. In addition, the larger a poster, the greater the distance from which it will be viewed. A large poster does not necessarily have to be printed at 300 dpi. The requirement also differs per print type. 150 dpi or less is sufficient for a canvas print, so that a (sharp!) 6 megapixel photo can also be suitable for a print of, for example, one by one meter.