Stewdent.eu
▾

Lossy Compression

Lossy compression reduces file size by permanently removing some data, achieving much smaller files at the cost of some quality.

Last updated: 20 December 2025

★★☆☆☆ Level 2computingDatacompressionlossyjpegmp34 min read

Report an error

What is Lossy Compression?

Lossy compression reduces file size by permanently discarding some of the original data. Unlike lossless compression, you cannot get the original file back once it has been compressed with a lossy algorithm — some information is gone forever.

The trick is to throw away only the data that humans are unlikely to notice is missing.

Warning

Once you save a file with lossy compression, the discarded data is gone for good. Always keep an original copy of important photos, audio, or video before converting to a lossy format.

How Lossy Compression Works

Lossy algorithms take advantage of the limits of human perception. For example:

  • For images (JPEG): The human eye is more sensitive to changes in brightness than to changes in colour. JPEG compression removes subtle colour differences while keeping the overall brightness pattern, which the eye barely notices.
  • For audio (MP3): The human ear cannot hear very high-pitched sounds well, especially when louder sounds play at the same time. MP3 removes these inaudible sounds.
  • For video (H.264): Only the differences between frames are stored, rather than complete images for every frame.

Quality Settings

Most lossy formats let you choose a quality level when saving. A higher quality means less data is removed — the file looks or sounds better, but it is larger.

Quality SettingFile SizeQuality Loss
High (90%)LargerBarely noticeable
Medium (60%)MediumSlight blurring/noise
Low (20%)Very smallObvious artefacts

For JPEG images, quality loss at high compression appears as blocky patterns called compression artefacts.

Common Lossy Formats

FormatTypeUse Case
JPEGImagePhotographs for web and sharing
MP3AudioMusic streaming and downloads
AACAudioiTunes, Spotify, streaming
H.264 / H.265VideoYouTube, Netflix, DVDs
Note

Most music you stream is lossy compressed. A CD-quality song is about 40 MB; the same song as a 320 Kbps MP3 is around 7 MB — nearly 6× smaller, but most people cannot tell the difference on typical speakers or earphones.

Lossy vs Lossless: Choosing the Right One

Use lossy when:

  • File size is the priority (streaming, social media, messaging)
  • Small quality reductions are acceptable
  • Files do not need to be edited further

Use lossless when:

  • Perfect quality is essential (archiving, professional work)
  • Files will be edited and re-saved multiple times
  • The data must be reconstructed exactly (software, text, databases)

Practice Problems

A photographer shoots raw images at 25 MB each and wants to upload 50 photos to a social media website. She converts them to JPEG at medium quality, resulting in 1.5 MB each. Calculate the total space saved.

Show answer
Original: 50 × 25 MB = 1,250 MB. Compressed: 50 × 1.5 MB = 75 MB. Space saved = 1,250 − 75 = 1,175 MB (about 1.15 GB).

Why is it a bad idea to repeatedly edit and save a JPEG image? What should you use instead if you plan to edit a photo multiple times?

Show answer
Each time you save a JPEG, the lossy compression runs again, discarding more data. After several saves the image becomes noticeably blurry or blocky with artefacts. Instead, edit using a lossless format like PNG or a raw format, and only export to JPEG as the final step.