Intro

Image

An image is represented as a grid of numbers, which can be thought of as a 2D (grayscale) or 3D (color) array, where each element represents a pixel’s color intensity.

Pixel

A pixel is the smallest unit of an image and is represented by an 8-bit integer value of 0-255 (see RGB)

Color Images (RGB)

description
  • Each channel (Red, Green, Blue) has a value 0–255.
    • 0 → no intensity
    • 255 → full intensity
  • Stored as a 3D array (height Ă— width Ă— 3)

Grayscale Images

  • Each pixel has a value 0–255.
    • 0 → black
    • 255 → white
    • Values in between → shades of gray
  • Stored as a 2D array (height Ă— width)