From NCERTIn depthAsked by Anonymous from New York, United States23 Oct 2026, 7:23 PM ISTUpdated
In one line
JPEG compression reduces the size of a photo by removing details the human eye is less likely to notice.
The rule
JPEG compression is a method that reduces image file size by transforming, quantizing, and encoding image data, mainly by discarding less important visual information.
There is no single formula, but the compression ratio can be calculated as: Compression ratio = (original size) / (compressed size)
Let's understand it simply
Imagine you have a large, colourful rangoli. If you take a photo and want to send it to a friend using slow internet, the photo file is too big. JPEG helps by making the file smaller. It does this by cleverly removing tiny details and colours that your eyes won’t really miss. It’s like rolling out a roti and trimming the edges — you still have the main part, but it takes up less space.
Think of a cricket match on TV. If the camera blurs the crowd in the background, you still enjoy the match because your eyes focus on the players. JPEG works in a similar way — it keeps the important parts sharp, and blurs or removes the less important bits to save space.
JPEG vs PNG
JPEG
PNG
Type
Lossy
Lossless
Best for
Photos
Logos, drawings
File size
Small
Larger
Transparency
No
Yes
How it works
Convert to YCbCr colour space:
The image is split into brightness (Y) and colour (Cb, Cr) parts. Our eyes notice brightness more than colour.
Chroma subsampling:
The colour parts (Cb, Cr) are reduced in detail, as we don’t notice small colour changes much.
Divide into blocks:
The image is cut into small 8×8 pixel blocks. Each block is handled separately.
Discrete Cosine Transform (DCT):
Each block is changed from pixels to a set of numbers showing patterns (like smoothness or sharp edges). This step helps separate important details from less important ones.
Quantization:
The DCT numbers are divided by bigger numbers, so small details become zero. This is where most data is lost, but our eyes usually don’t notice.
Zig-zag ordering:
The numbers are put in a zig-zag line, grouping zeros together.
Encoding:
The numbers are compressed using a method called Huffman coding, which stores repeating patterns in fewer bits.
JPEG Compression Steps
Convert to YCbCr colour space
Chroma subsampling
Divide into 8×8 pixel blocks
Apply Discrete Cosine Transform (DCT)
Quantize the DCT coefficients
Zig-zag ordering
Huffman encoding
The story behind it
JPEG stands for Joint Photographic Experts Group, the team that created this standard in 1992. The group included engineers from different countries who wanted to make a way to store and share photos easily, as computers and cameras became popular. They needed a method that made files small enough to send over slow networks but kept photos looking good. One fun fact: the JPEG logo is often seen on digital camera screens when you save a photo.
Where you see it in real life
WhatsApp photo sharing:
When you send a photo, WhatsApp compresses it using JPEG, making it quick to send even on slow data.
Passport photos at the studio:
The studio saves your photo as a JPEG so it fits on a pen drive or can be emailed easily.
Online shopping sites:
Product images are stored as JPEGs to load faster and save server space.
Facebook and Instagram:
These apps compress your uploaded photos using JPEG to save space and speed up loading.
Digital cameras and smartphones:
Most photos you click are saved as JPEGs by default.
Newspaper websites:
News photos are JPEGs so pages open quickly, even with many images.
Why it matters
Saves storage:
JPEG lets you store thousands of photos on your phone or computer.
Faster sharing:
Smaller files mean you can send photos over WhatsApp, email, or social media quickly, even with slow internet.
Websites load faster:
JPEG images help web pages open quickly, saving data and time.
Standard format:
Almost every device, from old phones to modern laptops, can open JPEGs.
Worked example
Let’s say you have a 5 MB photo. After JPEG compression, it becomes 1 MB.
Given: original size = 5 MB, compressed size = 1 MB
Step 1: Write the rule Compression ratio = original size / compressed size
Step 2: Put in the numbers Compression ratio = 5 / 1
Step 3: Answer Compression ratio = 5
This means the file is now 5 times smaller!
Common mistakes
Thinking JPEG is lossless:
JPEG is a lossy method (some details are lost forever). You can’t get back the original image from a JPEG.
Saving the same image as JPEG again and again:
Each time you save, more details are lost. Always keep a backup of the original.
Believing JPEG works for all images:
JPEG is best for photos, not for logos or images with sharp edges (use PNG for those).
Assuming all JPEGs are the same quality:
JPEG allows different quality settings. Higher compression means smaller files but lower quality.
Remember it
JPEG makes photos smaller by removing details you won’t notice, so you can store and share them easily.
Check yourself
Why does JPEG use 8×8 blocks for compression?
It makes the process faster and easier to handle, and helps separate details in small areas.
What happens if you save a JPEG image again and again?
Each time, more details are lost and the image quality gets worse.
Why is JPEG not good for logos or images with sharp lines?
Because JPEG blurs sharp edges, making logos look fuzzy; PNG is better for such images.
How does JPEG make files smaller?
By removing small details and colours that our eyes do not notice much, then compressing the remaining data.
Quick recap
JPEG compresses photos by removing less noticeable details.
It works in steps: colour conversion, block division, DCT, quantization, and encoding.
JPEG is lossy—some data is lost and cannot be recovered.
It is best for photos, not for sharp-edged images like logos.
JPEG makes sharing and storing images much easier.