Skip to content
Bridge Labs
Language: English
All labs Lab No. 001 5 min Color · Sound · Animation

No photos and no recorded sound: everything here is made with code

Pixel & Sound Lab

Every color, picture and sound on your phone is, underneath, just a lot of numbers. Try it yourself: change the numbers, then watch and listen to what happens.

A whole day in 18 seconds. Every frame, and even the music, was made by code: no drawing app, no camera, no recording. The experiments below use the same ideas.

Color from three numbers

Every dot on your screen is really three tiny lights: red, green and blue. Three numbers from 0 to 255 say how bright each one is. Every color you see is made from just these three numbers.

One screen dot, up close

rgb(255, 148, 71)
255
148
71

Colors from the animation

256 × 256 × 256 = 16,777,216 different colors, from just three numbers.

A picture made of squares

A picture is one big table of these dots. Use fewer and you see the squares; use more and the picture turns smooth. Tap any square to see its three numbers.

The square you picked

A Full HD frame, for example (1920 × 1080, not the video above), is 2,073,600 squares: 6,220,800 red, green and blue numbers before compression. They're so small your eye stops seeing squares.

Drawing with rules, animating with time

Nobody drew 540 separate pictures. A few rules say where everything is and what color it is at any moment. The computer runs those rules 30 times a second and takes a snapshot each time. Drag through time, or press play.

The rules, and their answers right now

Frame
Sun height
Top of the sky
Lantern
Stars

The same rules, as code


      

Six frames out of 540. Animation is just these pictures, shown quickly one after another. Tap one to jump to that moment.

Sound from a formula

Sound is air shaking. A speaker pushes its cone back and forth following a list of numbers: 44,100 of them every second. Here those numbers are calculated from a formula and sent straight to your speaker. Nothing was recorded.

Wave shape over

The first 24 numbers up close: each dot is one number

Note

Wave shape

Formula


        

Can't hear anything? Turn your volume up. On an iPhone, make sure the silent switch is off.

The whole story in three lines

  • Pictures: three numbers for every dot (red, green, blue).
  • Animation: a few rules that change with time, run 30 times a second.
  • Sound: 44,100 numbers a second that push a speaker back and forth.

This page works the same way: every picture and sound in the experiments is calculated right now, on your own device.

Questions people ask

Was the animation made with an AI video generator?

No. No video generator was involved. Every frame is drawn by ordinary code on an HTML canvas: gradients for the sky, shapes for the mountains, a formula for the sun's path. The frames are then saved as a video. AI video generators work differently: they paint the pixels directly, from patterns learned from huge numbers of videos.

What is a pixel?

The smallest dot in a digital picture. On a screen, each pixel is three tiny lights, red, green and blue, and its color is stored as three numbers from 0 to 255.

How does a computer make sound?

It sends a stream of numbers to the speaker, usually 44,100 or 48,000 every second. Each number says how far the speaker's cone should move at that moment. Calculate those numbers with a formula and you get a sound nobody recorded.

Could people do this before AI?

Yes, for decades. In 1957 Max Mathews at Bell Labs wrote MUSIC, one of the first programs to make music with a computer. In 1995 Toy Story became the first feature film made entirely with computer animation. And every video game draws its pictures with code, many times a second.

Do I need to install anything?

No. It runs in any modern browser, on phones too. If you can't hear the sounds on an iPhone, check that the silent switch is off.