Animate a pixel art car in 16 frames

This is the Ecto-1 from Ghostbusters, driving. It’s 16 frames of 70 ms, about a second, and it loops. Open it in Baipix to look at every frame.

Below is how it’s made, step by step, from the still drawing to the GIF. You can follow along with the same car: open the still drawing. Or use your own car, the method is the same. On a Mac, Ctrl is Cmd.

The plan

Most of what moves in this animation repeats: the wheels turn, the body goes up and down, the road slides by. All of it comes back to where it started after 4 frames. So we’ll make a loop of 4 frames first, copy it to get 16, and then add a jump on frames 9 to 16 to make it a bit funny.

Each part that moves gets its own layer:

Layer What it does
Roof rack Follows the body one frame late
Wheels The two front wheels, turning
Body Bounces up and down
Far wheels The wheels on the other side, turning behind the body
Smoke Puffs out of the exhaust
Road The ground line, and dashes that slide to the left
Speed lines White lines in the sky that slide faster, at 70% opacity

A layer only changes its pixels from one frame to the next. So moving a part is just moving its layer by a pixel or two on a frame.

1. Make room for the smoke

The car starts close to the left edge, and the smoke needs room behind it. Open Image › Board size… (more on board size), type 134 in W, and click the middle square on the right of the position grid. The board grows on the left, and the car stays where it is.

The Board size dialog: W set to 134, H 84, the drawing pinned to the right in the position grid, and the preview showing the new room on the left of the car. Under the fields: 116 × 84 px to 134 × 84 px. The Board size dialog: W set to 134, H 84, the drawing pinned to the right in the position grid, and the preview showing the new room on the left of the car. Under the fields: 116 × 84 px to 134 × 84 px.

2. One layer for each part

Right now the whole car is on one layer. We’ll cut it into pieces.

Take the Rectangle select (M) and drag a box around the roof rack, from the tip of the antenna down to just above the roof line.

The still Ecto-1 zoomed in, a dashed selection of 47 × 15 pixels around the roof rack: the siren, the boxes and the lights, stopping just above the roof. The still Ecto-1 zoomed in, a dashed selection of 47 × 15 pixels around the roof rack: the siren, the boxes and the lights, stopping just above the roof.

Press Ctrl+X, then Ctrl+V. The rack lands on a new layer, exactly where it was (Selections has the other ways to pick pixels). Right-click the layer and rename it Roof rack.

Do the same for the ground line under the car: select it, cut, paste, and name the layer Road. Then rename the layer that’s left Body.

Add four empty layers with Shift+N: Wheels, Far wheels, Smoke and Speed lines. Set Speed lines to 70% opacity, so they stay in the background. The wheels get drawn on theirs in the next step.

Drag the layers into this order, top to bottom (Layers has the rest of what they do):

The Layers panel with seven layers, top to bottom: Roof rack, Wheels, Body, Far wheels, Smoke, Road, and Speed lines at 70%. The Layers panel with seven layers, top to bottom: Roof rack, Wheels, Body, Far wheels, Smoke, Road, and Speed lines at 70%.

The order matters. The front wheels sit above the body, so the body never hides them. The far wheels sit under it, so you only see their bottom, as in the drawing.

3. Redraw the wheels whole

In the still drawing, the dark outline around each tire belongs to the body. As soon as the body moves up, it takes that outline with it, and the wheels look cut in half.

So erase the wheels from the Body layer, and draw them again, whole, on the Wheels layer:

  • a round shape about 11 pixels wide, with a dark outline all around;
  • the tire inside, 2 to 3 pixels thick;
  • a light hubcap in the middle, about 5 pixels wide;
  • two lighter marks on the tire, opposite each other, and two darker dots on the hubcap. These are what will show the wheel turning.

Where the wheels were, paint the body dark: that’s the inside of the wheel arch. When the body goes up, you’ll see that dark gap above the wheel instead of the background.

A front wheel up close, on the Wheels layer: a round dark outline, a dark green tire, a white hubcap with two grey dots, and two slate marks on the tire, left and right. Behind it, the dark wheel arch on the Body layer. A front wheel up close, on the Wheels layer: a round dark outline, a dark green tire, a white hubcap with two grey dots, and two slate marks on the tire, left and right. Behind it, the dark wheel arch on the Body layer.

Do the same for the wheels on the other side, on Far wheels, a little higher and to the right, with a darker hubcap since they’re in the shade.

If you’d rather skip ahead, here’s the car cut into its seven layers.

4. Open the timeline and make 4 frames

Press Shift+A, or the film button next to Export. The timeline opens under the canvas, with a row for each layer.

Press Alt+N three times. You now have 4 frames, all copies of the first one. Click a frame’s number to show it, or a dot to show that frame and draw on that layer.

The editor with the timeline open under the canvas: 4 frames, frame 2 shown in violet, and a row for each of the seven layers, Wheels picked. The editor with the timeline open under the canvas: 4 frames, frame 2 shown in violet, and a row for each of the seven layers, Wheels picked.

5. Turn the wheels

On each frame, the wheels turn by an eighth of a turn, clockwise since the car drives to the right. So move the two marks on the tire by an eighth of the circle, and the two dots on the hubcap too.

A front wheel on frames 1 to 4, side by side. The two marks on the tire and the two dots on the hubcap move an eighth of a turn clockwise from one frame to the next.
Frames 1 to 4. The body moves too, we'll get to it.

After 4 eighths, a wheel has made half a turn. Since the marks come in pairs, opposite each other, half a turn looks exactly like frame 1. That’s why the loop can be 4 frames long.

Do it for both front wheels, and for the far wheels.

6. Bounce the body

Press V for the Move tool. In the Layers panel, click Body, then Ctrl-click Roof rack to pick both (Shift-click would take Wheels too, it’s in between). The arrow keys now move them by 1 pixel, on the frame shown only.

Frame 2 of 4 with the Move tool: Body and Roof rack picked in the Layers panel, and a frame of 99 × 35 pixels around both on the canvas. Frame 2 of 4 with the Move tool: Body and Roof rack picked in the Layers panel, and a frame of 99 × 35 pixels around both on the canvas.
  • Frame 2: press ↑ once.
  • Frame 3: press ↑ once.
  • Frame 4: leave it.

The body is up on frames 2 and 3, and down on 1 and 4. One pixel is enough, more would look like a jump.

Now the roof rack. It’s loaded with stuff, so it lags behind the body by one frame. Pick only Roof rack:

  • Frame 2: press ↓ once. The body went up, the rack hasn’t followed yet.
  • Frame 4: press ↑ once. The body came back down, the rack is still up.
Frame 1 2 3 4
Body rest up 1 up 1 rest
Roof rack rest rest up 1 up 1

It’s only one frame late, and the car looks heavier and a bit wobbly for it. The same trick works for an antenna, hair or a cape.

7. Slide the road and the sky

The car doesn’t actually move. The ground slides to the left under it.

On the Road layer, draw grey dashes under the ground line: 5 pixels long, one every 16 pixels, across the whole width. A second row a bit lower, 3 pixels long, also every 16 pixels, makes it look like a road.

Then, on each frame, move the Road layer 4 pixels further to the left than the frame before, with the arrow keys: ← 4 times on frame 2, 8 times on frame 3, 12 on frame 4. A gap opens at the right edge as the dashes slide: draw the bits of dashes coming in, every 16 pixels as before.

4 pixels a frame for 4 frames makes 16, one dash. So frame 5 would look like frame 1, and the loop holds.

The Speed lines layer works the same way: a few white lines in the sky, 5 to 10 pixels long, one every 32 pixels, moving 8 pixels a frame. They go faster than the road, so they read as wind.

8. Flash the siren

On the Body and Roof rack layers, the lights take turns, two frames each:

  • frames 1 and 2: the orange lights turn yellow, the blue ones stay blue;
  • frames 3 and 4: the orange lights stay orange, the blue ones turn light cyan.

The Pencil (B) is enough, it’s a handful of pixels.

If you have the patience, the windows can do something similar: the light diagonal stripes on the glass move 4 pixels to the left on each frame, like reflections of the street going by. Skip it if you want, the animation works without it.

9. Smoke

A puff of smoke lives for 8 frames. It comes out of the exhaust small and white, grows, drifts about 3 pixels left and 1 pixel up on each frame, turns grey, and shrinks before it’s gone.

One puff of smoke over its 8 frames: a tiny white diamond, then a bigger white blob with a dark outline and a grey underside, growing up to frame 6 where it turns grey, then shrinking.
One puff, frame by frame. Grey from frame 6.

A new puff starts every 4 frames, so on any frame there are two: a young one near the exhaust, and an older one further left. In our loop of 4 frames:

Frame Young puff Old puff
1 its 1st frame its 5th frame
2 its 2nd frame its 6th frame
3 its 3rd frame its 7th frame
4 its 4th frame its 8th frame

Turn on the onion skin, the ghost button in the timeline, with Before and After at 1. The frame before shows in red and the one after in blue, so you can see where each puff comes from and where it’s going.

Frame 3 of 4 on the Smoke layer, zoomed on the back of the car: two puffs, and the same puffs faded in red on the frame before and in blue on the frame after. The onion skin button is on, Before 1 and After 1. Frame 3 of 4 on the Smoke layer, zoomed on the back of the car: two puffs, and the same puffs faded in red on the frame before and in blue on the frame after. The onion skin button is on, Before 1 and After 1.

Press Enter to play. The car should already drive. Here’s the 4-frame loop if you want to compare.

10. Copy it to 16 frames

Click frame 1’s number, then Shift-click frame 4: the four are picked (several frames at once). Right-click one of them and choose Copy 4 frames.

Frames 1 to 4 picked in the timeline, and the frame menu open: New frame, New empty frame, Copy 4 frames, Paste frames, Reverse frames, Delete 4 frames. Frames 1 to 4 picked in the timeline, and the frame menu open: New frame, New empty frame, Copy 4 frames, Paste frames, Reverse frames, Delete 4 frames.

Now click frame 4, right-click it and choose Paste frames: the copies go after it, as frames 5 to 8. Do it again from frame 8, then from frame 12. You have 16 frames, the loop four times over.

The timeline with 16 frames and the seven layers as rows, every cell drawn. The timeline with 16 frames and the seven layers as rows, every cell drawn.

11. The jump

The second half is where it gets funny. On frame 9 the car squashes down, backfires, and jumps. It lands on frame 14, squashes again, and drives on.

Pick the layers in the left column (Ctrl-click to add Far wheels to Wheels), and press the arrows on each frame:

Frame 9 10 11 12 13 14 15 16
Wheels and Far wheels ↑ 2 ↑ 4 ↑ 4 ↑ 2
Body ↓ 1 ↑ 2 ↑ 5 ↑ 6 ↑ 4 ↓ 1 ↓ 2
Roof rack ↑ 2 ↑ 4 ↑ 5 ↑ 5 ↑ 1 ↓ 1 ↓ 2

These are the presses from where each layer already is after the paste, not from the rest position. The body goes up faster than the wheels, so the springs stretch in the air, and the rack still lags a pixel behind.

Frame 11 of 16, the car at the top of its jump, the wheels off the ground and the body high above them. The onion skin shows two frames before in red and two after in blue. Frame 11 of 16, the car at the top of its jump, the wheels off the ground and the body high above them. The onion skin shows two frames before in red and two after in blue.
Frame 11, the top of the jump, with the onion skin on two frames each side.

A few details finish it:

  • Squash. On frames 9 and 15 the body sits a pixel lower than usual, and the top of the front wheels pokes over the arch. Erase that row of the wheels on those two frames.
  • Shadow. On the Road layer, when the wheels are in the air, draw a short dark line on the ground under each one: 6 pixels on frames 10 and 13, 4 pixels on 11 and 12, when the car is higher.
  • Antenna. On the Roof rack layer, bend the tip of the antenna a pixel back when the car goes up, and a pixel forward when it lands.

12. The backfire

On the Smoke layer, frame 9: a flash at the exhaust, white in the middle, then yellow, then orange, pointing back, with a few orange sparks around. On frame 10, the same flash, smaller. On frame 11 it’s gone.

The puff that starts on frame 9 is bigger than the others, by about a third, and drifts a little higher.

Frame 9 on the Smoke layer: the back of the car squashed down, a yellow and orange flash at the exhaust with a white center, and a few orange sparks below it. Frame 9 on the Smoke layer: the back of the car squashed down, a yellow and orange flash at the exhaust with a white center, and a few orange sparks below it.

13. Timing

Click frame 1, Shift-click frame 16, and type 70 in Duration. All 16 frames last 70 ms, so the loop takes a bit more than a second.

The 16 frames picked in the timeline, light violet, and the Duration field above them set to 70 ms. The 16 frames picked in the timeline, light violet, and the Duration field above them set to 70 ms.

Press Enter to play it, and , and . to go through it one frame at a time. If something jumps where it shouldn’t, it’s usually a layer moved one pixel too many on a frame.

14. Export a GIF

Open Export (Ctrl+E), pick GIF and a pixel size. At 5×, the car makes a GIF of 670 × 420 that loops forever, every frame with its 70 ms.

The Export dialog on the Ecto-1, with GIF picked as the format. The Export dialog on the Ecto-1, with GIF picked as the format.

That’s it. Open the finished car to compare with yours. The Animation docs have every detail of the timeline, the keyboard shortcuts are all on one page, and there’s more on pixel art animation in Baipix.

More from the blog

Draw your first pixel.

Free and open source, under the MIT license. No account, and your drawings stay on your device.