How JPEG Compression Works

Explaining the magic steps behind JPEG compression

Bilal Himite
Geek Culture

--

JPEG is the most used digital image format. It’s used everywhere, from the internet to professional photo cameras. A lot happening behind the scene when creating a JPEG. In this article, we will explore that.

This article is a part of a series of articles discussing concepts of image processing. Check out the previous articles:

  1. Image Processing and Pixel Manipulation: Photo Filters
  2. How to Create a Photo Mosaic in Python
  3. Image Processing: Image Scaling Algorithms

JPEG is actually the name of the entity behind the file name. Joint Photographic Experts Group created the standard and published the first JPEG standard draft in 1992.

JPEG uses lossy compression. Which means that information is lost in the compression process.

Color Space Transform and Subsampling

Since monitors have three color components for every pixel, one for red, one for green, and one for blue, they use the RGB color space. We will assume we have an image in the RGB color space and we will save it as a JPEG image.

Human eyes are more sensitive to brightness than color. For this reason, JPEG…

--

--

Bilal Himite
Geek Culture

[Looking for a 6-month internship in Data Science.] I write random tech-related content weekly. https://bilalhimite.me/