How Videos, Pixels, and Digital Color Work
Imagine a video like a flipbook –
it’s really just a bunch of still images (frames) shown quickly one after
another. For example, a 24fps video
shows 24 different images in each second.
When these frames flash by fast enough, your brain blends them together
and you see smooth motion instead of separate pictures. Each frame is just a normal image.
Each image frame is made up of
tiny dots called pixels. Think of a
pixel as a little square on the screen.
All computer images are made of millions of these squares tightly packed
together. Each pixel holds one color, so
when you zoom in you see a mosaic of colored squares that blend into a picture
when you step back.
A pixel’s color is usually defined
using the RGB model. In RGB, you mix
red, green, and blue light to get any color you want. In practice, each of R, G, B is given an
integer value (often 0 to 255). For
example, (255,0,0) is bright red, (0,255,0) is green, and (0,0,255) is blue;
(0,0,0) is black (no light) and (255,255,255) is white. By picking values for red, green, and blue,
each pixel can display any of millions of colors.
The range of those values depends
on bit depth. “8-bit color” means each
channel (R, G, B) is 8 bits, so it can range from 0–255 (2^8 values). That gives 256×256×256 ≈ 16.7 million
possible colors in total. A “10-bit”
channel goes from 0–1023 (2^10 values), letting in roughly 1 billion colors. A “12-bit” channel is 0–4095 (2^12 values)
for over 68 billion colors. More bits per pixel mean smoother color
gradients and finer shades, but also more data to store.
Representing a 2-Second Black-and-White Video in Binary
Assumptions about the Video
Assumptions about the Video
- Duration:
2 seconds.
- Frame
rate: 2 frames per second (2 fps) That means two still images (frames) are
shown each second.
- Total
frames: 4 frames (because 2 seconds × 2 fps = 4 frames).
- Frame:
Each frame is one still image in the video. Think of it like a page in a
flipbook.
- Pixels
per frame: 2 pixels (for simplicity, imagine a 1×2 pixel image).
- Color
format: Black-and-white only (each pixel is either black or white, no gray
shades).
Pixel Values and Binary Codes
· Brightness values: In a grayscale image, black is represented by the number 0 and white by 255. (Smaller numbers mean darker; larger mean lighter.)
· 8-bit encoding: Each pixel uses 8 bits (1 byte) to store its value. This gives 256 possible values (0 through 255).
· Binary representation: In 8 bits, 0 is 00000000 and 255 is 11111111.
· Example: So a black pixel is stored as 00000000, and a white pixel as 11111111. These will be used below in our tables.
Frame-by-Frame Pixel Data
Below is a table of all 4
frames. Each column shows the binary values for Pixel 1 and Pixel 2 in that
frame. Here “00000000” means black and “11111111” means white (per the rules
above):
|
Time |
Frame |
Pixel
1 |
Pixel
2 |
|
1st Second |
1 |
00000000 |
11111111 |
|
2 |
11111111 |
00000000 |
|
|
2nd
Second |
3 |
11111111 |
11111111 |
|
4 |
00000000 |
00000000 |
- In this example, Frame 1 has Pixel 1 =
black (00000000) and Pixel 2 = white (11111111).
- Frame 2 has Pixel 1 = white (11111111),
Pixel 2 = black (00000000).
- Frame 3 has both pixels white (11111111
each).
- Frame 4 has both pixels black (00000000
each).
- Each frame’s data is a pair of 8-bit
binary numbers (one for each pixel).
Transmitting the Video as
a Binary Stream
When the video is sent or
stored, all frame data is put together into one long binary stream, frame by
frame:
- Frame order: The bits for Frame 1 go
first, then Frame 2, then Frame 3, and Frame 4, in order.
- Concatenation: We simply concatenate each
pixel’s bits in that order.
- Combined data: For our example, the binary
stream would be (spaces added every 8 bits for clarity)
Frame 1: 00000000
11111111
Frame 2: 11111111 00000000
Frame 3: 11111111
11111111
Frame 4: 00000000
00000000
Combined stream:
0000000011111111 1111111100000000 1111111111111111 0000000000000000
In one line:
0000000011111111 1111111100000000 1111111111111111 0000000000000000. This is
the raw binary bit sequence for the whole 2-second video (with our chosen pixel
values).
Why This Matters
This
example shows the basic idea behind all digital video. In real life, a video is
just a fast sequence of frames (still images). Each frame is made of pixels,
and each pixel’s brightness is stored as binary numbers. When you watch a video
on your phone, computer, or TV, the device is actually receiving (or reading)
these bits and reconstructing the images. Real videos have many more frames per
second and many more pixels, and they often compress the data, but the core
process is the same. Understanding this helps you see that every digital video
– from a short clip to a full movie – is ultimately just streams of 0s and 1s
representing pictures. Computers and networks move these bits around so that
the right image appears at the right time on screen.
How
This Simple Video Becomes a Stream of 0s and 1s
Video
Settings
We
have a tiny 2-second video that we want to turn into a stream of binary data.
To understand this step by step, let's first break down the video’s settings
and its pixels:
- Video
Duration: 2 second total.
- Frame
Rate (fps): 2 frames per second.
- Total
Frames: 4 (because 2 seconds × 2 fps).
- Frame
Size: Each frame is a 2×2 grid of pixels, so there are 4 pixels per frame.
- Color
Depth: We are using 8-bit values for color. That means each pixel’s color is
described by 8 binary digits (0s and 1s).
Colors
and Encoding
Each
pixel can be one of five colors: black, red, green, blue, or white. We map each
of these colors to an 8-bit binary value. Here’s what each color means in
binary:
- Black:
00000000 (all color bits are 0, meaning no light).
- Red:
11100000 (the red bits are on (111) and green/blue bits are off (00000)).
- Green:
00011100 (the green bits are on (111) and red/blue bits are off).
- Blue:
00000011 (the blue bits are on (11) and red/green bits are off).
- White: 11111111 (all bits are 1, so full red, green, and blue).
Frame-by-Frame
Data
Now
we list each frame’s pixels (each frame is 2×2). The table below shows Frame 1
through Frame 4, with each pixel’s color and the 8-bit code:
|
Time |
Frame |
Pixel |
Color |
Binary
(8-bit) |
|
1st
second |
1
|
1 |
Black |
00000000 |
|
2 |
Red |
11100000 |
||
|
3 |
Green |
00011100 |
||
|
4 |
Blue |
00000011 |
||
|
2
|
1 |
White |
11111111 |
|
|
2 |
Red |
11100000 |
||
|
3 |
Green |
00011100 |
||
|
4 |
Black |
00000000 |
||
|
2nd
second |
3
|
1 |
Blue |
00000011 |
|
2 |
White |
11111111 |
||
|
3 |
Red |
11100000 |
||
|
4 |
Green |
00001100 |
||
|
4
|
1 |
Black |
00000000 |
|
|
2 |
Black |
00000000 |
||
|
3 |
White |
11111111 |
||
|
4 |
White |
11111111 |
Building
the Binary Stream
Next,
we form the full video stream by writing down each pixel’s bits in order. We go
frame by frame, and within each frame we list pixels 1 through 4:
- Frame
1 bits: 00000000 11100000 00011100 00000011
- Frame
2 bits: 11111111 11100000 00011100 00000000
- Frame
3 bits: 00000011 11111111 11100000 00001100
- Frame
4 bits: 00000000 00000000 11111111 11111111
Each
line above shows the bits for pixels 1, 2, 3, and 4 of that frame(in order).
When we send this video data, we put all those bits together in one long
stream, in frame order. The final combined binary stream is:
0000000011100000000111000000001111111111111000000001110000000000000000111111111111100000000011000000000000000001111111111111111
This
long string of 0s and 1s is all 16 pixels of the 4 frames, back-to-back. In
practice, digital video is sent or stored as such sequences of bits. Our
example is very small, but it shows the principle: each pixel’s color is turned
into an 8-bit number, and those numbers are lined up in time order.
Why
It Matters
Digital
devices (like phones, cameras, and streaming services) use the same idea. Each
frame of a real video is made of pixels, each stored as bits for colors. All of
those bits become a data stream that can travel over wires or the internet.
Understanding this basic process helps explain how videos are stored and sent
on computers. Even though real videos use far more pixels and more bits per
color, at the core they also work by converting images into a long series of 0s
and 1s, just like our tiny example.









0 Comments