CS5720 - Week 4
Slide 62 of 80

Images as Data: Pixels and Tensors

Understanding Pixels

What is a pixel?

A pixel (picture element) is the smallest addressable element in a digital image. Each pixel contains numerical values representing color intensity.
💡 Key Insight
To a computer, images are just arrays of numbers. Understanding this is crucial for deep learning!
R
Red Channel
0-255 values
G
Green Channel
0-255 values
B
Blue Channel
0-255 values

Images as Tensors

Tensor Representation:

Grayscale Image: 2D tensor (H × W)
Color Image: 3D tensor (H × W × C)
Batch of Images: 4D tensor (B × H × W × C)
Channel 1 (R)
Channel 2 (G)
Channel 3 (B)
Common Image Formats:

RGB: Red, Green, Blue (most common)
BGR: Blue, Green, Red (OpenCV)
HSV: Hue, Saturation, Value
LAB: Lightness, A*, B* (perceptual)

Interactive Pixel Explorer

Original Image
Hover to Explore Pixels
Position: (x, y)
RGB Values: R: 0, G: 0, B: 0
Hex Color: #000000
Normalized: [0.0, 0.0, 0.0]
Prepared by Dr. Gorkem Kar