JPEG: Lossy Compression for Photographs
You'll learn: How JPEG compression works, when to use it, and how to balance image quality against file size for web performance.
What Is JPEG Compression?
JPEG (Joint Photographic Experts Group) uses lossy compression — meaning it permanently discards some image data to create smaller files. Think of it like summarizing a book: you keep the main story but lose fine details. This makes JPEG perfect for photographs where subtle color variations won't be missed, but problematic for graphics with sharp edges or text.
How Lossy Compression Works
When you save a JPEG, the algorithm analyzes the image and removes information your eye is least likely to notice — subtle color gradients, minor texture details in shadows, etc. The more you compress (lower quality setting), the more data gets thrown away. Unlike formats you'll encounter later, you can't get that data back — it's gone forever.
Ideal Use Cases
JPEG excels at:
- Photographs with natural scenes, people, landscapes
- Complex color gradients and soft transitions
- Images where small file size matters more than pixel-perfect accuracy
Avoid JPEG for:
- Text, logos, or line art (edges become blurry)
- Images requiring transparency
- Graphics you'll edit repeatedly (quality degrades with each save)
The Quality Trade-off
Most image editors let you choose a quality level (0-100). Higher numbers mean better quality but larger files. For web use:
- 80-90% quality usually looks excellent while cutting file size significantly
- 60-70% might work for thumbnails or less critical images
- Below 50% typically shows visible artifacts (blocky patterns)
Key Takeaway: JPEG's lossy compression makes it ideal for photographs where you can sacrifice imperceptible details for dramatically smaller file sizes, but always save originals at maximum quality and only compress for final web delivery.