Computer science unplugged · kindergarten to grade 5

Turn a picture into
a code of numbers

Draw a black and white picture with # for black and . for white. The page shows the picture and writes its code, a list of numbers for each row, then tells you how many numbers replaced how many squares.

Code your pixel picture

One row per line, # for black and . for white. The worked example is an 8 by 8 heart. Saved on this device only.

Loading Pixel Picture Code Maker. If nothing appears, turn on JavaScript.

What you get

Academics · ElementaryOpen to everyone · no sign-in

What you finish with
A worked-out result for your own entry (a headline figure, tiles, tables and a drawing where one helps), as a printout, a spreadsheet (.csv) or a saved file.
Who it is for
Children from kindergarten to grade 5 learning how computers store pictures, and teachers or families running a coding-without-computers lesson.
Format
Browser tool for a phone, tablet or computer: type or paste, the result updates as you type. Print, spreadsheet (.csv), save to a file and open it again.
Access
Open to everyone with the link: no account, no sign-in, nothing to buy and nothing to install. Everything you type stays in this browser; nothing is sent to Caveat.
Where it lives
The Elementary space in Caveat Academics.
Support
Questions about access, an order or a correction: team@caveatacademic.com.

How to use it

  1. Load the worked example to see how it reads, or start with your own entry.
  2. Type or paste into the fields; the result updates as you type.
  3. Read the headline, the tiles and the tables.
  4. Try a second case from the buttons above the fields.
  5. Print the result, download a spreadsheet or save the entry to a file.

Code my picture

How it works

The worked example for the first row of the heart.

How computers shrink pictures

Pictures are made of tiny squares called pixels. Run-length coding stores long runs of the same color as one number, so a picture with big blocks needs far fewer numbers than squares.

Try this

Swap codes with a friend and each redraw the other's picture on squared paper. Then draw one that is hard to compress, with a checkerboard, and compare.

Sources

  1. Bell, T., Witten, I. H., and Fellows, M. Computer Science Unplugged, activity 5: Colour by numbers (image representation): csunplugged.org.
  2. K-12 Computer Science Framework (2016), Data and Analysis concept for grades K to 5: storing and representing data. K12cs.org.

The worked examples are made up for illustration. What you type is saved only in this browser on this device and is never sent to Caveat. Younger children do best with a grown-up beside them. Support: team@caveatacademic.com.

Written with AI, then checked before it is published. How we checkFound a mistake? Report it and we fix it, or refund you.Cancel anytime.