Published November 12, 2026.
Almost every internet service uses some form of compression. It makes files quicker to transfer and less expensive to store, but different techniques make different tradeoffs. Here is a simple look at lossless and lossy compression, and why the choice matters to a website owner.
Reusing repeated information
Early networks had limited bandwidth, and compression helped send information with fewer bits. One intuitive lossless idea is to replace repeated sequences with short references and keep a dictionary explaining them. For example, a message containing blue bird, blue bird might use a symbol for each repeated blue bird. The decoder needs both the references and the dictionary to reconstruct the original exactly. Real compressors use several techniques, not just this simple substitution.

In the illustration, recurring text is represented by symbols. Its example counts 270 bytes before compression and 176 bytes afterward, including the dictionary: a reduction of about 34.8%. That is an illustrative example, not a guaranteed result. Dictionary overhead matters, and some short or already-compressed files may barely shrink or even grow.
Lossless and lossy images
Lossless compression lets a decoder reproduce the encoded data exactly. PNG uses reversible filtering followed by compression, preserving its encoded pixel values. Its filter can make data easier to compress; the filter alone does not shrink the data. See the PNG specification. A PNG made from a camera image preserves the pixels passed to the PNG encoder, but it is not necessarily the camera's original RAW sensor data.
Common JPEG encoding is lossy: it discards some information to reduce size, often focusing on detail people are less likely to notice. At strong compression, blur, blocking or ringing can become visible, especially when enlarged. Quality and savings depend on the image and settings. There are lossless JPEG variants, but the usual photographic JPEG workflow is lossy; converting it back to PNG cannot restore discarded detail.
Why video compression matters
As images, audio and video spread online, their storage and transfer costs grew. Video codecs exploit similarities within and between frames. H.264 already uses motion-compensated prediction, not merely a record of changed frames. Newer codecs such as H.265/HEVC and AV1 can often achieve comparable quality at lower bitrates, but the savings depend on the content, encoder and settings. The H.264 standard describes both intra and motion-compensated inter prediction, and the AV1 specification describes the newer codec.
Playback compatibility and the cost of encoding matter too. Older devices may lack hardware AV1 decoding and need software decoding or a compatible fallback; newer hardware can support it efficiently. A platform may offer multiple encodings based on device support, viewing demand and processing costs. The original article used Bilibili as an example, but its exact selection rules were not independently verified and may change.
A simple hosting-cost example
Suppose a site stores 1 TB of H.264 video, transfers 100 TB per month, pays $10 per TB of storage and $3 per TB of transfer. The monthly total is $10 + $300 = $310 under these assumptions.
Now suppose the site keeps H.264, H.265 and AV1 copies using 2.5 TB in total. Storage costs $25. If more efficient delivery cuts monthly traffic in half to 50 TB, transfer costs $150, for a total of $175. This excludes transcoding, compute and other fees, and assumes the same viewers and acceptable quality. Neither a 50% traffic reduction nor a particular saving is guaranteed. As traffic grows, the extra storage and encoding work can still be worth weighing against bandwidth savings.
Choosing the tradeoff
Lossy MP3 can make audio downloads much smaller than uncompressed PCM audio in a WAV file, although the audible difference depends on the material, bitrate and listener. Putting MP3s in a ZIP archive is convenient for bundling, but already-compressed audio often shrinks little further.
Compression can also frustrate users: an image service that recompresses even an “original” upload may discard details photographers wanted to preserve. As a site owner, I often choose stronger image and video compression to control costs while keeping the result acceptable to readers. Better codecs and careful settings can improve quality at a given size, but very aggressive lossy compression can still leave visible or audible artifacts. The right balance depends on the content and audience.











Comments NOTHING