AboutBlogContact
TechnologySeptember 18, 1992 2 min read 33

JPEG: Compressing the World's Memories

AunimedaAunimeda
📋 Table of Contents

JPEG: Compressing the World's Memories

If you’ve ever tried to download a high-resolution 24-bit color image over a 2400-baud modem, you know the pain. A single uncompressed VGA photo can be nearly a megabyte. We simply don't have the bandwidth or the disk space for a digital world... yet.

But the ISO/IEC IS 10918-1 standard, better known as JPEG, has just been finalized. It’s going to change everything.

Lossy but Brilliant

JPEG is a "lossy" compression format. To a purist, that sounds terrible-it means the compressed image isn't bit-for-bit identical to the original. But JPEG is designed to exploit the limitations of human vision. We're much more sensitive to changes in brightness (luminance) than in color (chrominance).

The process involves:

  1. Color space conversion (RGB to YCbCr).
  2. Discrete Cosine Transform (DCT) on 8x8 blocks.
  3. Quantization (this is where the "loss" happens).
  4. Huffman coding.

The Trade-off

The amazing thing is the compression ratio. You can often compress a photo by 10:1 or even 20:1 with almost no visible loss in quality.

/* Pseudocode for a JPEG encoder loop */
for (int y = 0; y < height; y += 8) {
    for (int x = 0; x < width; x += 8) {
        block = get_8x8_block(image, x, y);
        dct_block = apply_dct(block);
        quantized_block = quantize(dct_block, quality_table);
        huffman_encode(quantized_block);
    }
}

A Visual Web?

Right now, the web (what little there is of it) is mostly text. But with JPEG, we can start imagining a web that's actually visual. Mosaic and other browsers are starting to support inline images.

I suspect that in a few years, we won't even think about the "cost" of an image. JPEG has provided the foundation for digital photography to move from a laboratory curiosity to a mainstream medium. It’s a classic example of how clever mathematics can solve a hardware bottleneck.

Read Also

C++0x: The Long Road to C++11aunimeda
Technology

C++0x: The Long Road to C++11

The C++ committee is working on 'C++0x.' With features like auto, lambda expressions, and rvalue references, it's a massive update to a veteran language.

Second Life: The First Real Metaverse?aunimeda
Technology

Second Life: The First Real Metaverse?

Linden Lab's Second Life is more than a game; it's a platform for a digital society. But can we really live in a 3D world?

The Millennium Bug (Y2K): The World's Biggest Refactoraunimeda
Technology

The Millennium Bug (Y2K): The World's Biggest Refactor

As the clock ticks toward midnight on December 31st, 1999, the tech world is in a collective panic. Is the 'Y2K bug' a real threat, or just the result of decades of lazy coding?

Need IT development for your business?

We build websites, mobile apps and AI solutions. Free consultation.

Get Consultation All articles