Introduction
What is JPG?
What is JPG? This format, also known as JPEG, is one of the most popular image file formats used in digital photography and web graphics. The term comes from the ‘Joint Photographic Experts Group’, the international group of experts who developed the standard.
The abbreviation ‘JPEG’ is a reference to a compression method that was designed to reduce the size of image files while maintaining acceptable image quality.
There is a common confusion of terms, where ‘JPEG’ is a compression standard and ‘JPG’ is a file name extension used on systems that do not accept more than three letters in extensions (e.g. older operating systems). However, in practice the two terms are used interchangeably and refer to the same image format.
History and origin
The history of the JPG format dates back to the late 1980s, when a team of experts from various fields came together to create an image compression standard that would allow for more efficient storage and transmission of digital photographs. The JPEG standard was officially published in 1992 and quickly gained popularity, becoming the global standard for digital photography and graphics.
A key feature that contributed to the proliferation of the JPG format was its ability to compress images in a lossy manner, meaning that part of the image information is permanently removed to reduce its size. Although lossy compression can lead to quality degradation, in practice JPG allows the right balance to be found between file size and retained image quality, making it ideal for the web, digital photography and printing.
Looking for a professional photographer to take better product photography?
Choose marshalstudio photographers!
Specifics of the JPG format
The Use of the JPG Format in Photography and Graphics
The JPG format is widely used in many areas of digital imaging, mainly because of its flexibility and ability to reduce file size while maintaining satisfactory image quality. Here are some of the main applications:
- Digital photography is the most common use of the JPG format. Most digital cameras and mobile phones use the JPG format as their default photo storage format. This allows photographers to store a large number of images on memory cards and makes it easy to quickly share images on social media or via email.
- Web graphics, where due to its compression properties, the JPG format is often the format of choice for creating graphics to be published online, such as banners, images in articles or blog graphics. By using compression, web pages load faster, which improves the overall performance and accessibility of websites.
- Printing where, although lossless formats are often preferred for printing purposes, JPG is used for photographic printing and some forms of digital publishing, especially when disk space or file size limits are restricted.
- Archiving professional photographs where lossless formats are also preferable, many people use JPG to archive their photographs because of the trade-off between quality and file size, saving space on hard drives and servers.
JPG is a versatile format, used by professionals, and amateurs in various fields of photography and graphics, offering a compromise between file size and image quality.
JPG Compression
How JPG Compression Works
JPG compression is based on a lossy algorithm that reduces file size by eliminating information that is less relevant to the human eye. The process begins by converting the colour space from RGB to YCbCr, which separates the brightness (luminance) information from the colour (chrominance) information. The image is then divided into blocks, typically 8×8 pixels, and a discrete cosine transform (DCT) is performed for each block, allowing the separation of high and low frequency components of the image.
In the next stage, quantisation takes place, a process in which the high-frequency components, which are less noticeable to the human eye, are reduced more than the low-frequency ones. Completing this complex process, finally, the data is encoded using entropy coding, leading to the final, compressed form of the file. The process can be adjusted by setting the quality level, allowing you to decide how much compression you want and how much quality loss may occur.
Quite a complex theory. Now let’s get down to specifics. Below are the images in JPG format. One before more compression in JPG format and 100% quality, and the other already much more compressed at 5% quality level. The difference seems to be clearly discernible, but the 5% photo still retains a relatively decent quality.
Pros and Cons of JPG Compression
Pros:
- The reduction in file size is the main advantage of JPG compression, saving disk space and allowing images to be transferred faster over the internet.
- Basically 100% compatibility of the format by all graphics programs and web browsers.
- Adjustment of the compression level, balancing quality and file size.
Cons:
- JPG compression is lossy, meaning that once information is removed it cannot be recovered, which can lead to quality degradation, especially when saving the same image repeatedly.
- With heavy compression, undesirable visual effects such as blocking, blurring or a ‘halo’ effect around contrasting edges can occur.
Differences Between Lossy and Lossless Compression
The main difference between lossy compression (as in JPG) and lossless compression (as in TIFF) is that lossy compression reduces the file size at the expense of permanently losing some of the image information, which can affect the quality of the image. Lossless compression, on the other hand, reduces the file size without losing any information, allowing the original image to be fully restored after decompression.
The choice between lossy and lossless compression depends on the user’s needs and the application of the image. For images published on the internet or for personal use, lossy compression is usually sufficient. On the other hand, for professional applications such as high quality printing, photo archiving or precision computer graphics, lossless compression is preferred.
JPG in Practice
How To Create and Edit JPG Format
Creating and editing JPG files is a straightforward process. To create a JPG file, you can start by saving an image in this format from any graphics program or directly from your camera or phone. Here are a few steps to follow:
- Most digital cameras offer a choice of image saving formats, including JPG. It is important to pay attention to the image quality and size settings, as these affect the final file size and quality.
- Once the image has been transferred to your computer, you can use any graphic editor for further processing. When saving or exporting the file, select the JPG format and decide on the compression level, which is usually referred to as ‘quality’. A lower value means a smaller file size, but also a lower image quality.
- Edit images as required – you can adjust brightness, contrast, colour saturation or perform more advanced tasks such as retouching or colour correction.
Tools and Programmes Supporting the JPG Format
Various tools can be used to create and edit JPG files, from professional graphics software to simple online applications. Here are some examples:
- Adobe Photoshop – this professional image editing tool offers extensive JPG editing capabilities, including advanced colour correction, layers, masks, filters, etc.
- GIMP – a free alternative to Photoshop, offering many editing features and support for the JPG format.
- Paint.NET – a simpler but effective image editing programme, ideal for beginners.
- Canva – a web-based application that enables the rapid creation of graphics, including JPG format, using ready-made templates and simple tools.
Advice for Photographers and Graphic Designers
- Optimise for use. Before saving an image as a JPG, it is worth considering where and how it will be used. For web pages, it is important to keep the files as small as possible to speed up page loading. For prints, it’s worth betting on higher image quality.
- Be careful with compression, too much, can lead to loss of quality and the appearance of artefacts. It is worth experimenting with different quality settings to find the optimum balance.
- Keep your software up to date. Using the latest versions of graphics software provides access to improved compression tools and algorithms, which can improve the quality and efficiency of working with JPG files.
- Create backups. Most importantly – it’s a good idea to archive the original files before doing any intensive editing, so that if you make a mistake or are unhappy with the compression results, you can go back to the original version of the image.
- Use a variety of compression tools. There are a number of online and offline tools that help optimise the size of JPG files without any apparent loss of quality, which is particularly useful when working with web graphics.
JPG vs. Other Graphic Formats
JPG or PNG:
- JPG is optimal for photographs and images with subtle colour transitions. It uses lossy compression, which allows a significant reduction in file size, but can lead to a loss of quality, especially when repeatedly edited and saved.
- PNG is best for web graphics such as logos, vector graphics and images with transparent backgrounds. It uses lossless compression, maintaining high image quality, but usually leads to larger file sizes than JPG.
JPG or GIF:
- JPG is ideal for complex images and photographs. It does not support transparency or animation.
- GIF is mainly used for simple animations and images with a limited colour palette. It supports transparency, but is limited to 256 colours, making it less suitable for high-quality images.
JPG or TIFF:
- JPG is a good choice for general use, especially on the web and for non-professional purposes. The small file size makes it easy to share.
- TIFF is often used in professional photography and printing because of its flexibility and support for lossless compression and layers. TIFF files tend to be much larger than JPG files, making them less practical for online use.
When To Use JPG
Use JPG:
- When a small file size is a priority.
- For images and photographs published on the web.
- When images contain a rich colour palette and complex detail.
Use PNG:
- For web graphics that require transparency.
- When image quality is a priority over file size.
- For images with sharp edges and flat colours, such as graphic text or logos.
Use GIF:
- For simple web animations.
- When transparency is needed but the colour palette is limited.
Use TIFF:
- In professional photography and printing.
- When it is necessary to maintain the highest possible image quality.
- In situations where editing and re-saving of images is frequent to avoid quality degradation.
The choice of the appropriate format depends on the needs of the specific situation, such as requirements for quality, file size, transparency, animation and the final use of the image.
Modern Alternatives to JPG
Oprócz ewolucji wewnątrz rodziny JPEG, pojawiają się również całkowicie nowe formaty plików obrazowych, które mogą lub stanowią już konkurencję dla JPG w przyszłości:
- WebP is a format developed by Google to replace JPG, PNG and GIF on the web, it offers much better compression while maintaining image quality. WebP supports both lossy and lossless compression, as well as animation and transparency, making it very versatile.
- HEIF is a format, based on the HEVC (High Efficiency Video Coding) codec, and provides better compression than JPG with higher image quality. HEIF can also store multiple images in a single file (which is useful, for example, for Live Photos on Apple devices) and additional information such as text, audio and location data.
- AVIF is the latest among image formats, using advanced compression techniques borrowed from the AV1 video format. It offers excellent image quality with very small file sizes and is considered a strong competitor to WebP and HEIF.
These new formats provide a variety of capabilities that can better meet the modern needs of users and content creators, such as higher compression efficiency, improved image quality and support for new features such as HDR and wide colour gamut.
As these technologies become more widely adopted, the role of the JPG format can be expected to diminish. However, thanks to its ubiquity and versatility, JPG is likely to remain an important format in the digital imaging world for a long time to come. At the same time, further development and potential shifts to newer formats will depend on factors such as device support, compatibility with existing software and end-user needs.
Summary
One of the most widely used digital image formats, the JPG format has become a standard in digital photography, web graphics and many other applications due to its flexibility and efficiency. A key feature of JPG is its ability to use lossy compression, which allows a significant reduction in file size with a relatively low loss of image quality, making it ideal for fast data transfer over the Internet and efficient use of storage space.