It was 9 AM at NECOZ School. 🏫
Art Class had just begun when King Nyaomaru walked in wearing his crown and announced:
"I want a portrait of myself. Painted by all 38 cats. Nobody blink." 👑
The teacher smiled. "Easy. Everyone gets ONE square to paint."
One cat raised a paw. "Can my square be on the sofa?" 😴
And so began the greatest art project in NECOZ history. 🎨
🧱 1. Pixel: One Cat, One Square
A digital image is just a big grid of tiny squares. Each square is a pixel. Each pixel is painted by one cat.
from PIL import Image img = Image.open("king.jpg") print(img.size) # (1920, 1080) 1920 × 1080 means 2,073,600 squares. 🙀
The teacher looked at the 35 cats, then at the number. "We need more cats."
"We need more NAPS," said one of them.
🪣 2. RGB: Three Paint Buckets
Every cat got three buckets: Red 🔴, Green 🟢 and Blue 🔵.
A pixel's colour is just how much of each bucket the cat pours in.
r, g, b = img.getpixel((0, 0)) print(r, g, b) # 255 215 0 → gold, perfect for the crown! 👑 The King's crown: "A lot of red, a bit less green, no blue." A cat poured exactly that. The crown glittered. ✨
🔢 3. 8-bit: Only 256 Shades per Bucket
Each bucket has 256 levels, from 0 (empty) to 255 (full).
256 × 256 × 256 = 16,777,216 colours.
"Over sixteen million!" the cats gasped. "That's basically infinite!"
Remember this. It's about to matter. 😼
😱 4. The Big Problem: The King Changes His Mind
King Nyaomaru frowned at his portrait.
"Too bright. Make it half as bright."
Cat Mochi's square had a shade of 201.
shade = 201 half = shade // 2 # 100 (whole numbers only!) The King thought again. "Hmm, now it's too dark. Bring the brightness back."
back = half * 2 # 200 print(back) # 200... not 201! 😭 Mochi stared at the bucket. "A whole shade just... vanished!"
Why? Whole numbers can't hold 100.5, so the .5 was thrown away. And once it's gone, no later edit can bring it back.
One lost shade on one square? Invisible. But 2 million squares, edited 10 times? A smooth sky starts to look like stripes. 🌅 (Photo editors call it banding.)
🌈 5. The Fix: Bigger Buckets (16-bit)
The teacher had an idea. "Give everyone bigger buckets!"
print(2 ** 8) # 256 → 8-bit print(2 ** 16) # 65536 → 16-bit A 16-bit bucket has 65,536 levels, which is 256× more precise. Rounding mistakes become 256× smaller, so they stay invisible. 🔍
And a bonus trick: keep the decimals while editing, and round only once at the very end.
shade = 201 half = shade / 2 # 100.5 (decimal kept!) back = half * 2 # 201.0 ✅ Mochi cheered. The shade was saved! 🎉
🎉 The Big Twist
King Nyaomaru studied the finished portrait for a long time.
"It's magnificent... but why is my nose slightly blue?"
The teacher coughed. "Your Majesty, that's tomorrow's lesson: colour profiles." 🎨
The King sighed. "Fine. But I want PIZZA at that lesson."
(Some things never change at NECOZ. 🍕)
🧠 Summary
| Idea | What it means |
|---|---|
| Pixel | One tiny square in an image |
| RGB | Red + Green + Blue mixed per pixel |
| 8-bit | 256 levels per colour, 16,777,216 colours total |
| 16-bit | 65,536 levels per colour, 256× more precise |
| Golden rule | Edit with decimals, round once at the end |
Your turn! 👇
Reply with your favourite colour and its RGB value. Mine's (255, 215, 0), because I'm a cat who loves gold. 🐈
If you liked this, follow me on GitHub, where I'm always building something: https://github.com/Akhouri-Anmol-Kumar

