Home / Hands-on activities / Pixel Art Grid

Coding activity

Pixel Art Grid

Color squares on a grid to make pictures! Learn to find spots using rows and columns. Each colored square is like a pixel on a screen.

Hands OnAbout 25 minutesScreen-freeParent help expected

Materials and setup

How this changes by age

Pre-K (ages 3–4)

Color squares on a grid to make pictures! Learn to find spots using rows and columns. Each colored square is like a pixel on a screen.

Difficulty 1 of 3

Steps

  1. Draw a 5x5 grid on paper. Number the rows 1-5 and label columns A-E.
  2. Call out coordinates: 'Color the square at Row 2, Column B red!'
  3. Child finds the square and colors it in. Do 8-10 squares to make a simple shape (heart, star).
  4. Let the child give YOU coordinates to color. Can you make their picture?
  5. Show a finished pixel picture and say: 'Screens work the same way — tiny colored squares make pictures!'
  6. Tell a grown-up one thing that surprised you.

Learning objectives

  • Locate positions on a grid using row and column coordinates
  • Follow instructions to color specific grid squares
  • Connect grid coloring to how screens display images

Kindergarten (ages 5–6)

Create pixel art using coordinates and a color key! Write instructions that tell someone which squares to color. Your instructions are like a computer program that draws pictures.

Difficulty 2 of 3

Steps

  1. Draw a 7x7 grid. Number rows and columns. Create a color key: R=red, B=blue, G=green, Y=yellow.
  2. Design a simple picture on one grid (smiley face, tree, house).
  3. Write instructions as coordinates with colors: 'Row 3, Col 4 = Y. Row 4, Col 3 = Y.' etc.
  4. Give your instructions to a family member with a blank grid. Can they recreate your picture?
  5. Compare the original and copy. If they do not match, find the 'bug' in your instructions and fix it.
  6. Tell a grown-up one thing that surprised you.

Learning objectives

  • Write coordinate-based instructions to encode a visual design
  • Use a color key system to represent data efficiently
  • Debug instructions by comparing expected and actual results

Early elementary (ages 6–8)

Program pixel art using loops and patterns! Instead of listing every single pixel, find repeating rows and use shorthand to compress your instructions. Learn how image compression works.

Difficulty 2 of 3

Steps

  1. Draw a 10x10 grid. Design a symmetrical pixel art image (robot face, spaceship, geometric pattern).
  2. Write out every pixel instruction. Count how many lines your 'program' has.
  3. Find repeating rows or patterns. Replace them with loops: 'REPEAT Row 3 colors for Rows 3, 4, and 5.'
  4. Count your lines now. How many instructions did you save using loops?
  5. Challenge: design a picture that is very compressible (lots of repeating patterns) versus one that is not. Which needs more instructions?
  6. Discuss: 'Computers compress images the same way — finding patterns to save space. That is why small files load faster!'
  7. In one sentence, tell a parent or sibling what surprised you today.

Learning objectives

  • Optimize pixel art instructions by identifying and using repeating patterns
  • Compare the instruction count of uncompressed versus compressed image programs
  • Understand the basic principle of image compression through pattern recognition

Upper elementary (ages 8–10)

Master digital image representation. Learn how computers store images as number arrays, explore color depth (1-bit, 8-bit, 24-bit), and write a program on paper that generates pixel art using nested loops, conditionals, and mathematical formulas.

Difficulty 3 of 3

Steps

  1. Research: How do computers store images? Each pixel has a color value. 1-bit = black or white, 8-bit = 256 colors, 24-bit = 16 million colors. Draw examples of each.
  2. Create a 12x12 grid. Assign each color a number (0=white, 1=black, 2=red, 3=blue, etc.). Write your image as a number array (matrix).
  3. Write a program on paper using nested loops: 'FOR row = 1 TO 12: FOR col = 1 TO 12: SET color based on formula.' Example: IF (row + col) is even THEN black ELSE white creates a checkerboard.
  4. Challenge: write a formula that generates a gradient (colors getting darker as row increases) or a diagonal stripe pattern.
  5. Calculate file size: a 12x12 image at 1-bit = 144 bits = 18 bytes. At 24-bit = 3,456 bits = 432 bytes. How big is a 1920x1080 photo at 24-bit?
  6. Discuss: 'Image formats like JPEG and PNG use clever compression to make files smaller. Your loop-based programs are a form of compression!'
  7. In one sentence, tell a parent or sibling what surprised you today.

Learning objectives

  • Represent images as numerical arrays and understand color depth
  • Write nested loop programs that generate visual patterns using mathematical formulas
  • Calculate image file sizes and understand the basics of compression

Safety and evidence note

Read the full activity before beginning. An adult should supervise tools, heat, food, outdoor work, movement, and experiments as appropriate. Completion records that the activity was done; the child’s explanation, work sample, photo, or demonstration is stronger evidence of learning than a completion check alone.

Related coding activities

Browse all 575 activities · Explore course syllabi