4 common file compression tasks and how to improve their efficiency

Whenever space for your files is limited, whether for storage purposes or for online sharing, it is important to know what types of compression are available and how they affect the final file. While it's true that Windows 11 has built-in ZIP functionality, it's rather limited in scope, and if your file is already compressed, as is often the case with video or photo files, zipping can save the finished file even enlarge. In the pursuit of storage efficiency, you need to know which codecs you can use for different file types and how they affect the compression ratio. It's also helpful to know how they affect the overall quality of the file, as you don't want to introduce distortions, artifacts, or bad data.



Related

Mastering Windows efficiency: I use these software solutions to automate my PC

Achieve maximum efficiency with simple, powerful tools that simplify your digital routine

4 Image file compression

Most image files can be further compressed with minimal loss of fidelity

Image compression has been around for a long time, originally developed by a consortium of photography experts to better manage file size. The humble JPEG has been a staple of life for three decades and, despite new options, is still the reigning champion due to its balance of file size, image quality, support, and ease of conversion to other formats. Some other good options for efficient image storage include:


  • WebP: Based on the VP8 video codec, this web-first file format maintains image quality and can support transparency, which JPEG cannot.
  • HEIC/HEIF: This is the efficient format that iOS and Android use in their camera apps, but it is not very well supported by other devices.
  • AVIF: This AV1-based open source codec is great for image quality and efficiency, but is not supported by many devices or imaging tools.
  • JPEG XL: It was designed as a replacement for JPEG, but never received the support needed to keep pace with the formats popularized by web browser manufacturers.
  • PNG: This is an efficient format designed for images shared on the Internet. It supports transparency, but often has lower visual quality than other formats.

It is perhaps telling that, even decades after its invention, the JPEG format is still the first choice for most users for storing efficient image files. It supports progressive encoding for varying quality, but I would use no less than 65% and no more than about 85% for most applications. Other formats can be useful in the right situation, but there is still no viable replacement for the same visual needs.

Related

I don't use Photoshop, here are the 6 photo editors I use instead

I don't let Photoshop dictate my workflow, and neither should you


3 Compression of video files

Lossless video is huge, but you don't need all of that data for the finished product

Have you ever noticed that if you record a lot of videos of your family, your smartphone and cloud storage plan fills up very quickly? Even when using the more efficient video codecs on modern smartphones, the video files are large. Therefore, it is worth knowing which codecs are best for efficiency. You don't want to shrink the files too much and find that you've lost all the detail in the image. Below are the most common video codecs and the reasons why you should use each option:


  • H.265 (HEVC): One of the more efficient codecs, but requires a license fee to use so other options may be better.
  • AV1: The most efficient codec for compressing videos while maintaining visual fidelity.:
  • H.264: H.264, the most common and widely supported video codec, is lossy but not as efficient as other options.
  • VP8/VP9: These efficient and lossy codecs are primarily used by YouTube and web browsers and are often used by streaming services rather than the content creator.
  • Apple ProRes: This “visually lossless” codec is intended for use in post-production and therefore produces huge file sizes to retain as much data as possible.

Video codecs are not the same as video formats. Think of the codec as the algorithm that does the encoding, while the format is the container that contains the video and audio codecs and all other data necessary to successfully play the full video file.

The most efficient codecs are not always the best supported, but that is starting to change as AV1 gains hardware and software support in most new devices. For the best mix of efficiency and ease of use, H.264 is still the gold standard.

Related

Which video codec should you use for rendering and why

Choosing the right video codec for your final file is important so that you get the right balance of file size and quality for your needs


2 Compression of audio files

Our ears are weird and compression takes advantage of that

If you've ever wondered why DVDs and Blu-rays require multiple layers of optical recording tracks for content with multi-channel audio, it's because audio files are notoriously large and difficult to compress to any level of fidelity. Our ears are highly tuned instruments, but because of the way our brain processes the data from our eardrums, they can be tricked. Audio codecs for compression come in two forms: lossy, where some of the original data is lost in the process, and lossless, where all of the data is restored during decompression. Of course, you want lossless codecs for the highest fidelity, but for efficient file sizes, lossy is the way to go.

Lossy:


  • MP3: The most popular lossy format can be up to one-tenth the size of lossless files when compressed. Most of the attenuated audio frequencies are inaudible to our hearing, but the depth is limited to 16 bits and is therefore only suitable for playback and not for recording or mixing.
  • AAC: Advanced Audio Coding sounds better than MP3 and is great for streaming audio, which is why it's the codec Apple typically uses.
  • Ogg Vorbis: Spotify uses this codec for its lossy streams. The open source codec is more efficient than MP3, but may result in lower fidelity.
  • WMA: Windows Media Player's encoding codec is similar to MP3 but Microsoft's version. There is also a lossless version, but it is not widely supported and WMP is also losing popularity.
  • Opus: This lossy format is designed for streaming voice or music over the Internet, but can also be used for efficient storage as it supports a wide range of bitrates and sample rates.

Lossless:


  • FLAC: Free Lossless Audio Codec is the gold standard for lossless codecs. It is widely supported, can shrink files by up to half, and is royalty-free so anyone can use it in their programs.
  • ALAC: Apple's Lossless Audio Codec is the new format used in lossless Apple Music files. It is open source and royalty-free and is the only lossless format that Apple Music can use.

Multi-channel:

  • Dolby Digital: Most video content created with surround sound audio uses some form of Dolby technology to compress the audio files to manageable sizes. It is compressed and lossy, but provides spatial positioning of the audio tracks.
  • AAC 5.1: Similar to AAC for stereo files, but is primarily used in Europe as an alternative to Dolby's licensing costs.
  • DTS: Available in both lossy and lossless formats, it is similar to the aptX audio codec, which shrinks audio to sizes that Bluetooth connections can handle.


If you want small file sizes for listening, AAC is probably your best bet these days. It creates files that are similar in size to MP3 but sound better. There are also several uncompressed audio codecs like WAV, AIFF and DSD that you can use either for the best playback quality or when editing the files. You won't want to use these file types on mobile devices with limited storage, but they have their place when creating content.

Related

Guide to Lossless Audio: Everything you need to know from a smartphone user's perspective

It's more complicated than flipping a switch in an app.

1 Compression of data files

It's truly magical how small some files can be


Because text files and the like contain a lot of white space, modern compression algorithms can shrink them to amazingly small sizes. Even older compression algorithms can do a pretty good job, allowing you to choose between formats depending on your needs. You should think about how long it will take to compress (and decompress for the other user), whether the tool is easy to use and obtain, and whether you want lossless compression for business-critical data. Here is a selection of common formats and why you should use them:

  • 7-Zip: The most efficient compression ratio and one of the fastest in practice.
  • ZIPPER: A lossless, dictionary-based method that can be encrypted and uses multiple levels of compression.
  • LZ4: Extremely fast, lossless compression algorithm.
  • RAR: Similar speeds to 7-Zip for decompression and compression.
  • BOW: Rarely used but designed for high compression and fast operation.

All of them work in practice, and since 7-Zip is an easy-to-use compression tool, all supported formats are good choices for efficient file compression.


Related

6 Best File Compression Tools for Windows PC

Compressing your files makes sharing them easier

Modern file compression is often quite magical, but it helps to know which tools and formats to use

These are the most common file types that you want to compress, but there are many others that we use every day without thinking about it. Mobile apps are compressed using a ZIP-like structure, and for PC games, code, textures, and other assets are compressed while being transferred from Steam and other storefronts to your computer and also after installation. Some file types are easier to compress than others, especially if they can use well-known psychological and physiological tricks to make it appear that the compression is not there. Regardless of which file you start with, you can often try a more efficient codec, but it may not be the best for your needs.

Leave a Comment