SlideShare a Scribd company logo
Lifecycle of a pixel
From a photon to Jpeg
Three basic principles of light
sensing
● photochemistry: light renders silver halide grains in film
“emulsion” “developable”
● thermal physics: heating effect of incident light heats
sensor that measures temperature
● photophysics: interaction of light with matter frees
electrons
○ light absorbed by metal surfaces causes current to be ejected from
them
○ light absorbed by semiconductors causes their conductivity to
increase
Capturing a digital
image
Photoelectric Effect
● Einstein's Nobel prize
● Light hits the conductor or semiconductor, electrons are
ejected and voltage is generated
● Principle behind solar cells and photosensitive diodes
Semiconductor Technologies
● CCD (“charge coupled device”), mostly obsolete
● CMOS (“complementary metal oxide semiconductor”)
○ originally: naked memory chips
○ currently: “camera on a chip” designs
● CID (“charge injection device”)
○ Mostly used in speciality cameras, by NASA and similar
CMOS imager array
● Two dimensional array of photosensitive diodes is
organized into rows and columns
● Each row charges are moved to a BUS at a time
● Color separation by filters and prisms
● Faster than CCD, cheaper, uses less power, and works
better in low light, but generates more noise
Bayer filter
● Color filter array (CFA) for arranging RGB color filters on
a square grid of photosensors
● 50% green, 25% blue, 25% red
● GRGB arrangement
Lifecycle of a pixel
Lifecycle of a pixel
Raw to RGB
Conversion to RGB
● Need to convert to RGB or similar color space
● Need to interpolate missing pixel values
● Prone to errors
● Moire effect
Lifecycle of a pixel
Lifecycle of a pixel
RGB to JPEG
What is JPEG?
● JPEG is NOT an image format, it is compression standard
● JPEG stands for Joint Photographic Experts Group
● JFIF is standard file format that holds JPEG compressed
images, JPEG File Interchange Format
● Exif, Exchangeable Image Format is actual format
modern cameras use
JPEG compression assumptions
● Human eye sees grayscale better than color
● Human eye are more sensitive to green than red or blue
● Human eye does not see high frequency changes well
Transformation to YCbCr space
● Channels luma, blue and red
● Unlike in RGB, each channel is stored separately
● Luma holds luminosity and green data
● YCbCr color space separates luminance and
chrominance
● Chroma channels are downsampled
● Usually by factor of 2, therefore 4x less space
● Each channel is array of bytes, same as RGB pixel
components, therefore it holds same amount of data
Separating chroma and luma
Extremely downsampled
chroma
Discrete Cosine Transform (DCT)
● Locally, image is a combination of high and low frequency
cosine functions
● For example, shape of a hand is high frequency, shape of
knitting on the sweater is high frequency component
● Image is divided into 8x8 pixel blocks, each block is
encoded as sum of 64 preset cosine functions
● This sorts the data according to its frequency
DCT 8x8 table
How images are composed
Arranged in zig-zag
DCT calculation
and compression
Source 8x8 block
Represent pixels with values
Subtract 128 from each value
Calculate DCT for the matrix
Divide by quantization table
value and round to nearest
integer
Resulting block
DCT quantization
● We will find that large values are in low frequency area
● On most images, high frequency cosines don’t contribute
much, and our eye can’t see them well
● Most values will be zero, only those that contribute a lot
to the image will stay
● High frequency values in quantization table are big, so
they will nearly sure be zeroed out
Compression
● Huffman encoding is very good in removing multiple
values
● We store quantization table used and DCT coefficients in
JFIF format so process can be reversed when
decompression
● Chroma tables have much higher penalty than luma
● Decompressed image has relatively small differences
from original while reducing size significantly
Disadvantages of JPEG
● It is lossy, so not ideal for scientific images
● No coherence between blocks -> JPEG artifacts
● Not good for text, signs, etc, images with sharp edges and
high contrast due to JPEG artifacts
● Text violates our assumption that high frequency does
not contribute a lot to the image
● When DCTing image of the text, DCT coefficients are not
concentrated in low frequency area, a lot gets lost
Steganography
● Neat trick of encoding secret messages in images
● Simplest approach: encode in least significant bits
○ Can be detected as least significant bits will be random noise
● More complex approach: encode in DCT coefficients
○ Not detectable by visual inspection
○ Can be detected by statistics, distribution will be off
○ JSteg, f5, etc, many are open source
● Modern algorithms use DCT, but take into account
statistics, some success detecting with machine learning
● Used for protecting media by watermarking
The End.

More Related Content

PPT
4_14755_CS411_20182019_1__1_1_ImageCompression 1.ppt
PPTX
Fundamentals of Data compression
PPT
WT in IP.ppt
PDF
2019188026 Data Compression (1) (1).pdf
PPTX
PPTX
Jpeg standards
PPTX
4_14755_CS411_20182019_1__1_1_ImageCompression 1.ppt
Fundamentals of Data compression
WT in IP.ppt
2019188026 Data Compression (1) (1).pdf
Jpeg standards

Similar to Lifecycle of a pixel (20)

PDF
Introduction to JPEG and MPEG standard techniques
PPTX
image basics and image compression
PPTX
JPEG Image Compression
ODP
MPEG-1 Part 2 Video Encoding
PDF
steganography based image compression
PPTX
Robotics: Vision-Aided Navigation and Motion Path Planning on Low-End Android...
PPTX
Data compression
PPT
Image Sensing & Acquisition
PPT
Holographic memory
PDF
Compression of digital voice and video
PDF
Digital Theory 1.pdf
PPT
introduction to jpeg for image proce.ppt
PPTX
CR & DR..(5).pptx
PPT
Why Image compression is Necessary?
PDF
Camera pdf
PPTX
digital radiographymmmmmmmmmmmmmmmm.pptx
PDF
Digital Image Processing - Image Compression
PPT
Holographic%20 Data%20 Storage
PPTX
data compression IN COMPUTER NRETWORKS RR
PPTX
Jpeg compression
Introduction to JPEG and MPEG standard techniques
image basics and image compression
JPEG Image Compression
MPEG-1 Part 2 Video Encoding
steganography based image compression
Robotics: Vision-Aided Navigation and Motion Path Planning on Low-End Android...
Data compression
Image Sensing & Acquisition
Holographic memory
Compression of digital voice and video
Digital Theory 1.pdf
introduction to jpeg for image proce.ppt
CR & DR..(5).pptx
Why Image compression is Necessary?
Camera pdf
digital radiographymmmmmmmmmmmmmmmm.pptx
Digital Image Processing - Image Compression
Holographic%20 Data%20 Storage
data compression IN COMPUTER NRETWORKS RR
Jpeg compression
Ad

More from Shaul Rosenzwieg (8)

PPTX
Brainstorming: Manage your ideas like a pro
PPTX
Kotlin Coroutines and Rx
PPTX
Android Open Accessory
PPTX
Secure Android Development
PPTX
Android virtual machine internals
PPTX
Binder: Android IPC
PPTX
Why learn Internals?
PPTX
Introduction to kotlin
Brainstorming: Manage your ideas like a pro
Kotlin Coroutines and Rx
Android Open Accessory
Secure Android Development
Android virtual machine internals
Binder: Android IPC
Why learn Internals?
Introduction to kotlin
Ad

Recently uploaded (20)

PPTX
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
PDF
Salesforce Agentforce AI Implementation.pdf
PPTX
Computer Software and OS of computer science of grade 11.pptx
PPTX
assetexplorer- product-overview - presentation
PPTX
Cybersecurity: Protecting the Digital World
PPTX
GSA Content Generator Crack (2025 Latest)
PDF
AI/ML Infra Meetup | Beyond S3's Basics: Architecting for AI-Native Data Access
PDF
Designing Intelligence for the Shop Floor.pdf
DOCX
Greta — No-Code AI for Building Full-Stack Web & Mobile Apps
PDF
Complete Guide to Website Development in Malaysia for SMEs
PDF
Digital Systems & Binary Numbers (comprehensive )
PDF
MCP Security Tutorial - Beginner to Advanced
PDF
DNT Brochure 2025 – ISV Solutions @ D365
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PDF
Time Tracking Features That Teams and Organizations Actually Need
PDF
Wondershare Recoverit Full Crack New Version (Latest 2025)
PDF
Types of Token_ From Utility to Security.pdf
PPTX
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
PPTX
"Secure File Sharing Solutions on AWS".pptx
PPTX
Tech Workshop Escape Room Tech Workshop
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
Salesforce Agentforce AI Implementation.pdf
Computer Software and OS of computer science of grade 11.pptx
assetexplorer- product-overview - presentation
Cybersecurity: Protecting the Digital World
GSA Content Generator Crack (2025 Latest)
AI/ML Infra Meetup | Beyond S3's Basics: Architecting for AI-Native Data Access
Designing Intelligence for the Shop Floor.pdf
Greta — No-Code AI for Building Full-Stack Web & Mobile Apps
Complete Guide to Website Development in Malaysia for SMEs
Digital Systems & Binary Numbers (comprehensive )
MCP Security Tutorial - Beginner to Advanced
DNT Brochure 2025 – ISV Solutions @ D365
wealthsignaloriginal-com-DS-text-... (1).pdf
Time Tracking Features That Teams and Organizations Actually Need
Wondershare Recoverit Full Crack New Version (Latest 2025)
Types of Token_ From Utility to Security.pdf
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
"Secure File Sharing Solutions on AWS".pptx
Tech Workshop Escape Room Tech Workshop

Lifecycle of a pixel

  • 1. Lifecycle of a pixel From a photon to Jpeg
  • 2. Three basic principles of light sensing ● photochemistry: light renders silver halide grains in film “emulsion” “developable” ● thermal physics: heating effect of incident light heats sensor that measures temperature ● photophysics: interaction of light with matter frees electrons ○ light absorbed by metal surfaces causes current to be ejected from them ○ light absorbed by semiconductors causes their conductivity to increase
  • 4. Photoelectric Effect ● Einstein's Nobel prize ● Light hits the conductor or semiconductor, electrons are ejected and voltage is generated ● Principle behind solar cells and photosensitive diodes
  • 5. Semiconductor Technologies ● CCD (“charge coupled device”), mostly obsolete ● CMOS (“complementary metal oxide semiconductor”) ○ originally: naked memory chips ○ currently: “camera on a chip” designs ● CID (“charge injection device”) ○ Mostly used in speciality cameras, by NASA and similar
  • 6. CMOS imager array ● Two dimensional array of photosensitive diodes is organized into rows and columns ● Each row charges are moved to a BUS at a time ● Color separation by filters and prisms ● Faster than CCD, cheaper, uses less power, and works better in low light, but generates more noise
  • 7. Bayer filter ● Color filter array (CFA) for arranging RGB color filters on a square grid of photosensors ● 50% green, 25% blue, 25% red ● GRGB arrangement
  • 11. Conversion to RGB ● Need to convert to RGB or similar color space ● Need to interpolate missing pixel values ● Prone to errors ● Moire effect
  • 15. What is JPEG? ● JPEG is NOT an image format, it is compression standard ● JPEG stands for Joint Photographic Experts Group ● JFIF is standard file format that holds JPEG compressed images, JPEG File Interchange Format ● Exif, Exchangeable Image Format is actual format modern cameras use
  • 16. JPEG compression assumptions ● Human eye sees grayscale better than color ● Human eye are more sensitive to green than red or blue ● Human eye does not see high frequency changes well
  • 17. Transformation to YCbCr space ● Channels luma, blue and red ● Unlike in RGB, each channel is stored separately ● Luma holds luminosity and green data ● YCbCr color space separates luminance and chrominance ● Chroma channels are downsampled ● Usually by factor of 2, therefore 4x less space ● Each channel is array of bytes, same as RGB pixel components, therefore it holds same amount of data
  • 20. Discrete Cosine Transform (DCT) ● Locally, image is a combination of high and low frequency cosine functions ● For example, shape of a hand is high frequency, shape of knitting on the sweater is high frequency component ● Image is divided into 8x8 pixel blocks, each block is encoded as sum of 64 preset cosine functions ● This sorts the data according to its frequency
  • 22. How images are composed
  • 27. Subtract 128 from each value
  • 28. Calculate DCT for the matrix
  • 29. Divide by quantization table value and round to nearest integer
  • 31. DCT quantization ● We will find that large values are in low frequency area ● On most images, high frequency cosines don’t contribute much, and our eye can’t see them well ● Most values will be zero, only those that contribute a lot to the image will stay ● High frequency values in quantization table are big, so they will nearly sure be zeroed out
  • 32. Compression ● Huffman encoding is very good in removing multiple values ● We store quantization table used and DCT coefficients in JFIF format so process can be reversed when decompression ● Chroma tables have much higher penalty than luma ● Decompressed image has relatively small differences from original while reducing size significantly
  • 33. Disadvantages of JPEG ● It is lossy, so not ideal for scientific images ● No coherence between blocks -> JPEG artifacts ● Not good for text, signs, etc, images with sharp edges and high contrast due to JPEG artifacts ● Text violates our assumption that high frequency does not contribute a lot to the image ● When DCTing image of the text, DCT coefficients are not concentrated in low frequency area, a lot gets lost
  • 34. Steganography ● Neat trick of encoding secret messages in images ● Simplest approach: encode in least significant bits ○ Can be detected as least significant bits will be random noise ● More complex approach: encode in DCT coefficients ○ Not detectable by visual inspection ○ Can be detected by statistics, distribution will be off ○ JSteg, f5, etc, many are open source ● Modern algorithms use DCT, but take into account statistics, some success detecting with machine learning ● Used for protecting media by watermarking