Learn How To Compress Photos
Photo and image compression is a process designed to minimize the size of a graphics file without noticeably degrading the quality of the image itself. Using the proper compression format and tools can make a substantial difference in how images appear on websites and in emails. However, many people do not understand how to compress photos properly. If you aren’t aware of the difference in the various compression formats, it’s likely your photos will not have the quality you expect, and your image files may be much larger than they need to be.
Lossy and Lossless Compression
To understand how to compress photos, it’s important to recognize the difference between “lossy” and “lossless” compression. In essence, lossy compression eliminates certain nonessential artifacts from the original file and saves the image as a much smaller sized file. In contrast, lossless compression shrinks the size of the file without removing any data from the original source. While lossless compression is preferred for highly detailed photos, it may not be necessary for less critical purposes.
For lossless compression, the most popular format is run-length encoding, which is used most often for simple graphics files when there are long streams of identical data elements. DEFLATE is the other popular format used for PNG images. It can also be used in Gzip and ZIP compression methods. For GIF and TIFF formats, Limpek-Ziv-Welch (LZW) employs a lossless compression algorithm that conducts limited data analysis.
Lossy compression methods are often combined with lossless formulas to optimize the overall file reduction. The most common method reduces the number of colors down to those that appear most often in the image. This method is most effectively employed in GIF and PNG formats. Chroma subsampling uses human eye physiology to take advantage of the perception of brightness as opposed to color. This format is most commonly found in JPEG images. Transform encoding averages out the overall color of the image into small blocks by using discrete cosine transform (DCT) that creates a JPEG image with fewer shades of color than the original.
Check out our complete article for a comprehensive comparison of lossy vs lossless compression.
Image Types and Formats
There are many different image formats, some better used for certain purposes than others. The list below includes some of the most popular image formats currently in use.
- JPEG - The Joint Photographic Experts Group (JPEG) is the most common lossy image compression format used for quick image transfer. JPEG offers users a great deal of control over the amount of compression applied to the image. However, if too much compression is used in a JPEG, the picture may display pixelization in certain parts of the image. Learn more about the difference between JPG and JPEG.
- PNG - The Portable Graphics Network (PNG) is currently the most popular lossless compression format that was created for the purposes of replacing GIF. Although PNG does not support animation like GIF, it has a distinct advantage in that it supports a variety of transparency options.
- GIF - The Graphics Interchange Format (GIF) supports 8-bits per pixel, so an image can contain as many as 256 different RGB colors. The GIF format is commonly used for animated images, which are usually not supported in most other formats.
There are many other image format types available for use. One of which has been recently gaining in popularity is WebP. This image format has shown impressive lossless compression results when compared to other popular image formats. Although WebP browser support isn’t yet complete, it is certainly moving in the right direction. Read more about comparing compression sizes from PNG to WebP and JPG to WebP.
How to Compress a Photo or Image In Photoshop
Knowing how to compress images will help ensure that your photos don’t overburden your system’s memory or disk space. You’ll be able to transfer images faster across the internet and through email or SMS. While various image editing applications function differently, most use common protocols.
- Choose the image you want to compress and open it in your photo editing or compression software (in this example, we’ll be using Photoshop).
- Click on the file menu and choose “Save for web”.
- Select the image format you would like to save as. In this case, we’ll choose JPEG
- Select the desired image compression quality, the higher the quality level the larger the size of the image. A safe quality setting is “80” or very high. However, this can be modified depending on your requirements.
- Click the “Save” and then select a destination and name for your newly compressed image.
It’s important to remember that saving your image in the JPEG format can result in a noticeable loss of quality depending upon how much you compress the image.
Image Compression Tools
There are countless applications that can be used to compress files and images. The following applications are easy to use and provide detailed instructions on how to compress photos and images properly.
- Optimus - If you’re a WordPress user, using the Optimus plugin is a convenient way to optimize your images upon upload. Apart from that, you can also convert images to WebP format, use the developer API, and more.
- Easy Image Resizer - This free Joomla extension allows you to easily resize the resolution of your images as well as optimize them. A convenient extension for Joomla users who don’t want to optimize their images using a third party program / service.
- Image_optim - Based on the ImageOptim app developed for Mac OS, this tool is a suite of command line tools useful for compressing a variety of image format types. It makes use of a variety of programs combined into one and is quite efficient and easy to use.
How to Compress Photos - Summary
Although it may appear daunting at first, learning how to compress photos is a relatively simple process once you understand the different terms and formats. In most cases, photo compression can be accomplished with your existing software, however for convenience, there are many plugins, extensions, and projects available that allow you to simply automate the optimization process.