Maximizing Quality and Compression: Understanding Image File Formats for Optimal Results
- February 24, 2023
We’ve all been mind-boggled by the long list of weird acronyms that drop down once you click “Save image as…” When do you use a PNG instead of a JPEG? And what kind of software opens a RAW file? All these can be cleared just by understanding image file formats and their differences.
To put it shortly, image formats differ by raster or vector graphic types, compression, color spaces, bit depth, alpha channels, and more. Here, we’ll be going through a list of the 8 most common image file formats.
Before we start discussing the file format types, let’s clear out the basics of digital imaging concepts.
Key Digital Imaging Concepts
You have probably come across different image file formats names such as PNG, JPEG, TIFF, GIF, PSD, and more.
While these may not seem that different from each other, you will understand how they compare and contrast when you grasp the key digital imaging concepts.
These key concepts include −
- Raster vs. Vector graphics
- Lossy and lossless compression
- Color spaces
- Bit depth
- Alpha channels
All these concepts are explained in more detail in the next few sections. These concepts will help you see the clear distinctions in understanding file formats.
Raster Vs. Vector Graphic Formats
Raster format images save files in the form of a grid of pixels, better known as a bitmap. On the other hand, vector format images save files in parts, where each section of the image is saved as a geometric formula.
Since vector images are mathematically produced, you will see that when you scale up a vector image, it never loses quality.
Whereas, if you scale up a raster image, you will notice the small boxes called pixels becoming sharper and the image losing quality.
For these reasons, raster formats are used for photographs and other images that are mathematically difficult to define.
Vector formats, however, are used for images that are required to always be sharp quality, such as logos and stamps.
Some common vector image formats are .pdf, .eps, .svg, and .ai.
Lossy and Lossless Compression
Most raster formatted image files apply compression in order to reduce the file size. They do this by either lossy or lossless compression –
This method of compression works by discarding data, which depletes the image quality.
A common lossy compression technique is using discrete cosine transform or DCT. DCT approximates the content of an image using trigonometric functions.
Simply put, lossy compression will reduce the original quality of your image with a series of changes, such as reducing the vibrancy and variety of colors.
This results in an “Approximate” of your original image, which is also smaller in size than lossless files.
Non-lossy compression reduces file size while retaining all the information of the original form of the image.
A common method of this is using run-length encoding or RLE. This technique works by storing sequences of identical bytes as a single value, followed by a count.
Essentially, the file is compressed, but you are not losing any data from your original image, which is the reason it’s called “Lossless.”
Lossless formats allow your images to be reconstructed to their original forms.
Almost all image formats store data in three color channels, using a red, green, and blue (RGB) color space.
However, in the case of professional printing, some formats also offer four color channels, using cyan, magenta, yellow, and black (CMYK).
Additionally, some formats may also support a single black-and-white or grayscale channel.
Bit Depth and Alpha Channels
Different image formats also store different quantities of color information. Most formats support 8 bits per channel (8bpc), which delivers “24-bit color” with a three-channel RGB color space.
Some file formats also support 16bpc and 32bpc, which provides greater flexibility in image manipulation.
At the other end of the spectrum, a few image formats offer the opportunity to store just 8-bit color. This limits the number of colors in an image to 256 in order to save file space.
In addition to color values, some raster formats can store individual pixel transparency in an alpha channel.
For example, an image stored in an RGB color space with an alpha channel added becomes RGBA. Images with alpha channel transparency are useful for overlaying captions in videos.
What Are Image File Formats?
When you save an image to your computer, you might have noticed the drop-down list of all the formats you can save your image file as.
Let’s go through each of these commonly used image file formats –
JPEG/JPG (Joint Photographic Expert Group)
This is the most common image file type. They can be captured by any camera or phone and read by almost all digital imaging software, so they are good for sharing photographs.
JPEGs store rater images, in either RGB or CMYK, with DCT lossy compression. This means their image quality decreases as the file size also decreases.
No alpha channel can be included in JPEGs, and their bit depth is limited to 8bpc or 24-bit color.
PNG (Portable Network Graphics)
Similar to JPEG, it stores raster images. However, it uses lossless compression.
PNG files can also include an alpha channel, which makes them useful for making logos, stickers, cutouts, and more.
One downside to PNGs is that they are limited to either 8-bit or 24-bit color without a CMYK option, meaning they can only use RGB color spaces.
TIFF/TIF (Tapped Image File Format)
These files store raster images as well, but with both lossless and lossy compression, along with no compression. This depends on the option selected by the user.
TIFF files also support RGB, CMYK, and black-and-white images. They offer at least 8, 16, or 32bpc, as well as an alpha channel.
This file type is used for professional graphics, such as print applications.
PDF (Portable Document Format)
Vector graphics can be saved in PDF format and viewed without any editing applications. This is because PDFs were created by Adobe to capture and review various information on almost any device or software.
PDFs can be saved and reused to make new manipulations to the existing information.
EPS (Encapsulated PostScript)
This is another vector-based format that is able to produce high-resolution images. Almost all designing software can produce EPS files.
Like PDF, EPS is also a universal file type that can be used to load other vector graphics onto editing software.
GIF (Graphics Interchange Format)
It is a raster-based format with lossless compression. However, their file sizes tend to remain small, as a maximum of 8-bit color is supported.
Therefore, GIFs are limited to a maximum palette of 256 colors.
GIFs can store both still and moving images. Because of this, they are useful for web graphics, such as animations.
PSD (Photoshop Document)
This file type is native to Adobe Photoshop. It primarily stores non-compressed raster images but can also include vector text and/or other elements.
PSD supports RGB, CMYK, black and white images, and also supports 8, 16, or 32bpc. These images can be stored in multiple layers, with an alpha channel per layer.
RAW (Raw Image Formats)
RAW image format is known as a native raster digital camera file format. It preserves information that is lost when shooting TIFF or JPEG files.
Plus, it offers RGB color spaces with 12, 14, or 16 bpc, depending on the camera model.
Each image stored in this format is a direct binary dump from the camera’s sensor so that there’s no missed-out data from the camera’s internal image processing.
These files can be read by image editing software such as Photoshop. However, it should be noted that the majority of editing applications cannot load RAW files.
FAQs on Understanding Image File Formats
Here are a few asked questions about Understanding Image File Formats. These questions are frequently asked by people who have a genuine interest in image file formats.
What are the 3 most common types of images?
Based on internet usage patterns of people around the world, the three most common types of image files are JPEG, PNG, and SVG.
What is the highest-quality image format?
TIFF is the highest-quality image format. It is used for important scanning documents, designing logos, and other tasks that require crystal-clear images.
Is JPEG or PNG better quality?
PNGs tend to be generally higher quality than JPEGs. However, the difference is sometimes unnoticeable.
When should I use PNG vs. JPEG?
You should use PNGs when you need a transparent background (i.e., for stickers, logos, etc.) and JPEGs for regular photographs.
What is the picture file format?
Digital pictures are usually saved as JPEG, PNG, or GIF files.
Understanding image file formats becomes easy when you learn the basic concepts of digital imaging.
Once you know how color spaces, bit depth, and raster/vector graphics work, all those image file acronyms don’t look as intimidating anymore.
If you’re still confused about how some of these file types are used, you can play around with them on editing applications like Photoshop to clear any doubts.