Featured image: Animation as code. Your next intro starts with a sentence.Featured image: Animation as code. Your next intro starts with a sentence.
OpenAIClaudeGoogle AI SearchPerplexity
Ask AI →
TL;DR
Animation as code means the motion graphic is a source file, not an export. You can read it, version it, change a variable and re-render at any size. That makes motion a system instead of a one-off asset. The workflow is short. Name the look. Write the story in one sentence. Let the agent plan the shots. Keep the source in a repo. You’ll have a first render in under an hour.

Most AI video tools hand you an mp4. It looks good, it’s the wrong aspect ratio, and your only real option is to regenerate and hope. That’s an asset. You use it once and it ages in a folder.

Animation as code gives you something different. The output is a file you can open, read, edit and run again. Change a color, change a duration, change the frame size, and the same animation comes out at the new setting. It’s the same file, not a new export.

That difference sounds technical. It’s really a difference in what you own. A video is a finished thing. Code is a system you can keep improving, and that is where the compounding sits for a content team with more channels than hands.

Short version

Animation as code is motion graphics generated from a text file instead of a timeline. The file holds the style, the timing and the shot logic. You version it like software, and you re-render it for every format without rebuilding it from scratch.

Animation as code, defined

Animation as code means the design, timing and shot order are written as instructions in a text file, and a renderer turns that file into frames. The file is the thing you own. The video is one output of it.

Three properties separate it from a rendered file. The source is text, so it can be read, diffed and reviewed in a pull request. The output is parameterized, so one file renders many sizes. The build is repeatable, so the same command produces the same frames next month.

That last property is why an agent can run this loop. An agent is good with a repo, a diff and a command. It is bad with a mouse. Put the motion in a file and the agent stops being an assistant and starts being the builder.

The deliverable is source code, not a video

When animation is code, everything that is true of code becomes true of your motion. You can diff two versions. You can roll back to the cut you liked. You can keep the palette in one variable and change it in one place.

The most useful part is format. One source renders a square for a feed, a vertical for a short, and a landscape for a slide deck. Three exports, one build, no re-layout by hand.

And because it’s text, an agent can edit it. You say “make the intro two seconds shorter and swap the accent to brand violet” and the change happens in the source. You aren’t re-shooting anything.

Apollo Inline Banner8 1
A video file is a finished thing. Code is a thing you can keep improving, which is why the tenth version is better than the first instead of just different.
Source: Chief Content Marketer

Animation as code vs. AI video generators vs. After Effects

I’ve shipped motion all three ways. These paths solve different problems, and picking the wrong one is why teams end up with a folder of clips nobody can update.

ApproachWhat you getWhat you can change laterBest for
Animation as codeA source file plus a renderEverything: style, timing, size, copyRecurring formats and brand systems
AI video generatorAn mp4 from a promptLittle. You regenerate and hopeOne-off concepts and mood tests
After EffectsA project file plus a renderMost things, by hand, in a GUICinematic work and heavy compositing

The practical read: use generators to explore, use code to ship a format you will repeat, and use After Effects when the shot needs a human hand and a lot of compositing.

The brief

Three lines is the whole input. A style, a story, and the instruction to keep the source in a repo. The agent handles the shot list and the render.

Video: @github.signals

A large style library is a vocabulary, not a menu

A style library works when each entry is a name you can say out loud. Ink painting. Neon rain. Pixel grid. Film title card. The name carries a palette, a texture and a motion feel in one word.

That matters because “make it look premium” isn’t an instruction. “Ink painting, slow reveal, 8 seconds” is. The library turns taste into a parameter you can pass to the agent.

The range is the thing to judge. Three hundred looks that all read as the same gradient mesh is a smaller vocabulary than forty looks that span different eras and registers. A wide range is what lets you build a series where each episode feels related but not identical.

Pick a look, write the story, let the agent plan the shots

The workflow moves the hard part earlier. You decide the look and the story. The agent works out the shot list, the keyframes and the easing. That’s the right split, because the shot list is mechanical and the story isn’t.

1
Pick one style and commit

Choose a single named look. Two styles in one clip read as noise, not range.

2
Write the story in one sentence

A sentence forces a throughline. A paragraph invites the agent to invent three competing ones.

3
Review the shot list before the render

Reading a plan takes a minute. Re-rendering a wrong plan takes an afternoon.

4
Keep the source in a repo

Commit the file. Now every later change is a diff instead of a rebuild.

5
Render each format from the same file

Square, vertical, wide. Change the canvas size, not the design.

What the stack actually looks like

You don’t need a new platform. Code-based animation runs on tools that already exist, and most of them are free or open source.

Layer
What it does
Canvas layer
Draws the frames: HTML canvas, SVG or a headless browser
Timeline layer
Holds the timing: keyframes, easing, scene order
Render layer
Captures frames to video: headless browser plus ffmpeg
Source layer
The repo: style tokens, copy, scene definitions
ToolWhat it doesCost
RemotionRenders React components as video framesFree for teams under 4 people, then $100 per seat per year
GSAPTimeline, easing, and scroll-linked motionFree core, $199 per year for bonus plugins
ManimPython math animation, the 3Blue1Brown engineFree, MIT license
PlaywrightDrives Chrome headless for frame captureFree, Apache 2.0
ffmpegEncodes 24 to 60 fps video from image sequencesFree, LGPL
LottieExports interactive motion for product UIFree format, paid editors from $16 per month

Pricing sources: Remotion, GSAP, LottieFiles.

The named tools are boring and they work. Remotion wraps React components in a frame renderer. GSAP handles the timeline and easing. Manim is the Python library behind 3Blue1Brown’s math animations. Playwright or Puppeteer drives Chrome headless. ffmpeg does the encode. Lottie and Rive export interactive motion for product UI. None of these need a license, and all of them run on a 2024 laptop. I run that stack on mine, and my slowest re-render of a 15-second clip is under two minutes.

That’s the whole system. A headless browser renders each frame at 1080p, a frame grabber writes 24 to 30 images per second, and ffmpeg stitches them into a video. The animation logic lives in the source layer, which is the part you keep.

This is also where an agent team earns its keep. In the loop behind this site, a research agent pulls the source material. A build agent writes the scenes. A review agent checks the render against the brief before anything ships. THE SIX is not a metaphor for that process. It is the process, running on files instead of timelines.

If you already have Claude Code or a similar agent in your workflow, the setup cost is a session, not a project. The agent writes the first scene, renders it, and shows you the output. You tune from there. My walkthrough of editing video with Claude Code covers the same loop for footage. The JavaScript video pipeline covers the render step in more detail.

Why video volume is worth the setup

Video is where attention and budget both went.

91%
of businesses use video as a marketing tool
5-20s
the length where code-based motion stays coherent
#1
short-form video as the highest-ROI format
3
formats from one source file: square, vertical, wide

Sources: Wyzowl Video Marketing Statistics for the adoption figure, HubSpot State of Video Marketing for the format ranking. The length and format numbers describe this pipeline, not a survey.

The demand is already there. The problem is that producing video the old way costs a person per format. A code-based pipeline turns that cost into a render time. That’s the difference between publishing one clip a week and publishing the same idea in three places before lunch.

Where code-based animation stops working

This approach has real edges. I’ve hit most of them, and knowing them saves you from forcing code onto the wrong job.

It’s weak with real people. No code renderer gives you a convincing human face in motion. If the shot needs a person, use footage or a generator built for faces.

It’s weak on long-form. A 60-second animation is a lot of scenes to keep coherent. The format works best at 5 to 20 seconds, where the whole piece fits in one mental model.

It’s weak on organic audio. Voice, music and sound design still need a separate pass. Plan the audio track before you render, or you’ll re-render after. The cheapest version of that pass is editing the voiceover against its transcript in Descript, then dropping the exported track into the render.

It needs a repo and a person who owns it. A code pipeline without version control is just a fragile script. It’s 12 lines of shell away from working. The system only pays off if someone treats the source as a product.

The one mistake to avoid

Don’t rebuild your entire motion library on day one. Pick one recurring asset, build it as code, and run it through two full cycles. If the second cycle is faster than the first, expand. If it isn’t, you learned that cheaply.

How to start without rebuilding everything

The fastest path is a single asset you already rebuild on a schedule. A weekly series intro. A product update template. A recurring stat card. Anything with a fixed structure and changing numbers.

Build that one thing as code. Name the style from the library so the look is a parameter. Put the changing numbers in variables at the top of the file. Render it once by hand and once from the agent to prove the pipeline is stable.

Then do the second cycle. Change one number and one color. If the change takes a prompt instead of a project, the system is working. At that point you can copy the pattern to the next recurring asset, and the third one costs almost nothing.

If you want the style side to be easier, my piece on 20 Claude animation styles is a working vocabulary. Pass it straight into the prompt. And if you would rather have the agent learn a motion technique from a video, turning a video into a Claude skill is the shortcut.

Start with a sentence, not a blank timeline

I’ve lost more hours to a blank timeline than to any other part of production. The first hour goes to setup, not ideas. Starting from a sentence and a named style deletes that hour.

The bigger win is what happens after, and it’s the reason to bother. When the source is code, the second version costs a prompt. The fifth costs a diff. The tenth is genuinely better than the first, because each change builds on the last instead of replacing it.

Pick one asset you rebuild every quarter. Build it once as code. Then see whether the next rebuild is a project or a prompt.

Animation as Code: Quick Answers

What does “animation as code” mean?

It means the animation is defined in a text file instead of a video timeline. You edit the file, not the timeline. The file describes the style, the timing and the scenes. A renderer turns that file into frames and then into a video.

Is animation as code the same as AI video generation?

No. An AI generator produces a video from a prompt and gives you a file. Code-based animation produces a source file you can edit and re-render. One is an asset. The other is a system.

Do I need to know how to code?

Not much. A coding agent can write the first scene and the render script. You need to be able to read the output and describe what to change. The judgment matters more than the syntax.

What tools does it use?

Four layers cover it. A canvas layer draws the frames in HTML canvas, SVG or a headless browser. A timeline layer holds the keyframes. A render layer captures frames and stitches them with ffmpeg. A source layer holds the style tokens, the copy and the scene definitions. Most of the stack is free or open source.

When should I not use it?

When the shot needs real people, when the piece runs long, or when it is a genuine one-off. The advantage is reuse, so it only pays if you’ll render it more than once.

How long does the first build take?

A single short asset is a session, not a project. The render loop is the slow part on the first pass. It’s 20 to 40 minutes for a 15-second clip on a laptop. After that, changes are edits to the source and a re-render.

Get the next one in your inbox
One system, one teardown, one prompt pack every week. No filler.
Subscribe
Privacy Policy