6 Compression and Media Optimization
Learn how media compression affects file size and quality, how formats and codecs differ, and how to optimize images, audio, and video for their intended use.
Why media is compressed
Digital images, audio, and video can require substantial storage and bandwidth. represents media using fewer bits, but the amount of reduction depends on the data, the method, and, for , the quality setting.
A defines how data and related information are organized, while a is a method for encoding and decoding media. A format may support different codecs or modes, so a filename extension alone does not always reveal how much information was preserved.
Lossless and
reduces file size without discarding information. After decompression, the data matches the original exactly. This approach is useful when every detail must remain intact, such as with editable graphics, diagrams, or master files. PNG images and FLAC audio are common examples.
reduces file size by permanently discarding some information, often details that are less noticeable to human viewers or listeners. JPEG images and MP3 audio are familiar examples, and most video distributed for everyday playback also uses . Some formats, including WebP, offer both lossy and lossless modes.
Quality and
does not automatically produce poor quality: a carefully encoded file may look or sound much like its source. Stronger can introduce visible or audible , such as blockiness, blurred edges, or distorted sound.
Re-encoding a file that has already undergone can cause further quality loss. Keep an original or high-quality master, and create delivery copies from it.
Balancing quality and file size
In general, reducing a file’s data rate or increasing makes it smaller but can lower its quality. For example, raising the video often improves clarity while increasing file size.
The precise result depends on the and the media. A photograph, a simple graphic, and a fast-moving video do not compress in the same way, so settings should suit both the content and its intended use.
Logos, text, and diagrams: Favor to preserve sharp edges.
Photographs and streaming media: may provide a useful size reduction if the result remains clear enough.
Editing and preservation: When practical, retain an uncompressed or losslessly compressed master, then export a compressed copy for delivery.
A practical optimization workflow
means meeting a file-size, loading-time, or storage goal while preserving the quality and features the audience needs. Choose settings based on where the media will be viewed and what quality is needed; determine whether transparency, animation, or other features must be retained.
A practical workflow is:
Start with the purpose. Decide the viewing context, required quality, and features to keep.
Remove unnecessary data. For images, use dimensions close to the actual display size. For audio or video, trim unused sections when appropriate.
Choose a suitable format and mode. Consider compatibility as well as file size; the smallest file is not useful if the intended software or device cannot play it.
Adjust quality gradually. Export a test, inspect or listen to it under its intended playback size and conditions, and compare its quality and file size with the source.
Keep the master separate. Preserve an editable or high-quality original and treat optimized exports as delivery copies.
Avoid repeatedly applying generic to files that are already compressed. It may provide little additional size reduction while reducing quality.