Akhouri Anmol Kumar explains the basics of digital images on DEV Community using a story about 35 cats painting a portrait of a king: https://dev.to/necoz/necoz-art-class-the-day-35-cats-painted-a-portrait-of-the-king-how-pixels-work-10en
The piece walks through pixels, RGB channels, bit depth and rounding errors, and it uses short Python snippets with Pillow to show each idea in code. It is aimed at beginners and stays with the fundamentals rather than any particular library or workflow.
Pixels as a grid
An image is a grid of tiny squares, each one a pixel. The article opens an image with Pillow and prints its size, noting that a 1920 × 1080 image contains 2,073,600 of these squares. The cat framing makes the scale of a normal photo easy to picture.
RGB as three buckets
Each pixel's colour comes from three values: red, green and blue. The author reads a single pixel and gets a gold value, which the story ties to the king's crown. The point is that a colour is just how much of each channel is present.
8-bit precision and its limits
With 8 bits per channel, each bucket has 256 levels, from 0 to 255, giving 16,777,216 possible colours. The article then shows the catch with a small example:
shade = 201
half = shade // 2 # 100 (whole numbers only!)
back = half * 2 # 200... not 201!
Integer division discards the 0.5, and later edits cannot recover it. On a single pixel the loss is invisible, but across millions of pixels and repeated edits it can show up as banding, such as stripes in a smooth sky.
The 16-bit fix
A 16-bit channel has 65,536 levels, which is 256 times more precision, so rounding errors shrink by the same factor. The article also offers a simpler habit: keep decimals while editing and round only once at the end, which restores the lost shade in the example.
What the piece covers
The summary table lists the core ideas: pixel, RGB, 8-bit, 16-bit, and the rule to edit with decimals and round once. The article closes with a teaser about colour profiles and a prompt asking readers to share their favourite colour and its RGB value.
It is a light, story-driven introduction rather than a deep reference. Readers who want a first mental model of how image data is stored, and why bit depth matters during editing, will find the cat framing a memorable way in.