A photo is a very long list of numbers. Today you find out exactly how long — and why that number can't be right.
Longer than the last few. Enrolled in our Runestone course? Open it from there so your progress counts.
Still in Bits, and running the same play as 1.4. There, a letter became a number because a table said so. Here, a color becomes three numbers because a standard says so. The move is identical — only the thing being encoded changed. Which is the point: it always works this way.
Now go open your camera roll and look at what a photo actually takes up. Two or three megabytes. Not close. Ten times smaller than the arithmetic says it can possibly be. Nothing was deleted, and the photo still looks fine. So where did 33 megabytes go? Hold that question — you get the answer in 1.8, and you'll have earned it.
Zoom far enough into any digital image and it stops being a picture. It becomes a grid of tiny solid squares, each one a single flat color. Each square is a pixel, and a photo is nothing but a very long list of them read left to right, top to bottom — the same order you used to encode your 8×8 grid back in 0.2.
So the whole problem reduces to one question: how do you store one color as a number?
Zero means none of that light; 255 means all of it. All three at zero is black. All three at 255 is white. Crank red to 255 and drop the others to 0 and you get pure red. That is genuinely all there is to it, and you're about to slide the sliders yourself.
Count what that buys. One byte per channel is 8 bits, so three channels is 24 bits per pixel, which by the rule from 1.1 gives 224 = 16,777,216 distinct colors. That's the "16.7 million colors" printed on monitor boxes. It isn't marketing — it's 224, and you can now derive it.
You have seen colors written like #FF8000 and it looked like a code. It's not
a code. It's the same three numbers in hexadecimal — base-16, using
sixteen symbols: 0–9, then A, B, C, D, E, F for 10 through 15.
Base-16 exists for exactly one reason: 16 = 24, so one hex digit is worth exactly four bits, always, with no arithmetic. That makes hex a clean shorthand for binary — you just chop the bits into groups of four:
one byte of red, three ways binary 1111 1111 hex F F ← each group of 4 bits is 1 hex digit decimal 255 #FF8000 = R FF (255) G 80 (128) B 00 (0) ← orange
Six hex digits, two per channel, in R-G-B order. Nothing new is being stored — it's the same 24 bits, written in a way a human can read at a glance and type without mistakes.
A 12-megapixel camera produces images of about 4000×3000 pixels. Multiply it out:
4000 × 3000 = 12,000,000 pixels 12,000,000 × 3 bytes = 36,000,000 bytes ← 3 bytes per pixel: R, G, B = 36 MB 36,000,000 × 8 = 288,000,000 bits
36 MB per photo. A thousand photos would be 36 gigabytes. Your phone holds far more than a thousand photos and has not filled up. Something is very obviously going on, and it isn't in this lesson. That's 1.8.
Drag the slider to grow the pixels. Click any pixel to read its three numbers.
Slide each channel and watch the bits and the hex change together.
Write down your guesses first, then check them with the mixer. No peeking.
1. What color is (255, 255, 0)? 2. What are the three numbers for black? 3. If all three channels are equal, what kind of color do you always get? 4. Which channel do you raise to turn dark blue into light blue?
Type any dimensions. The 12 MP button loads the hook's numbers.
Try 1920×1080 — a single frame of HD video is about 6.2 MB raw. Video runs at 30 frames a second. Work out one minute of raw video, then go reconsider how a two-hour movie fits on anything at all.
You just used all three of these. Now they get names.
Five questions in AP format. Pick an answer to see feedback immediately.
A film photograph was a physical object. Light hit chemicals and changed them, and the negative was evidence that a particular thing had been in front of a particular lens. Altering it meant physically altering an object, and skilled examiners could usually tell.
A digital photograph is 36 million numbers. Changing it means changing numbers, and a changed number is not damaged — it is simply a different number, indistinguishable from one the sensor produced. There is no original to compare against, because every copy is identical (1.1) and the file itself carries no proof of where its values came from (1.2).
This is not new — photos have been staged and retouched since the 1800s — but it changed who can do it and how fast. Newsrooms, courts, and insurers now treat images as claims needing corroboration rather than as evidence that settles a question. That shift is a direct consequence of a design choice you can state in one sentence: store the picture as numbers.