Skip to content

An AI skill that turns books into animated, narrated, interactive web experiences

14.8 KB
Raw Blame
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>The Three Little Pigs: how it was made</title>
<meta name="description" content="An experiment: a picture book animated from a story alone, with an image model for the art and code for the motion. What we tried, what worked, and why it stayed out of the Skill.">
<link rel="canonical" href="https://papermorph.diamonddoge.org/three-little-pigs/">
<meta property="og:type" content="website">
<meta property="og:site_name" content="Papermorph">
<meta property="og:title" content="The Three Little Pigs: how it was made">
<meta property="og:description" content="An experiment: a picture book animated from a story alone, with an image model for the art and code for the motion. What we tried, what worked, and why it stayed out of the Skill.">
<meta property="og:url" content="https://papermorph.diamonddoge.org/three-little-pigs/">
<meta property="og:image" content="https://papermorph.diamonddoge.org/assets/bookshelf.webp">
<meta property="og:image:alt" content="A wooden bookshelf of animated books">
<meta name="twitter:card" content="summary_large_image">
<style>
  :root { --ink: #2f2418; --soft: #6b5a46; --paper: #fbf5e8; --card: #fffaf0; --line: #e4d6bb; --accent: #a64a24; --ui: "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif; --serif: "Iowan Old Style", Palatino, Georgia, serif; color-scheme: light; }
  * { box-sizing: border-box; }
  html, body { overflow-x: clip; }
  ::selection { background: #a64a2433; }
  a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
  h1, h2 { text-wrap: balance; } p, li, dd { text-wrap: pretty; }
  body { margin: 0; background: var(--paper); color: var(--ink); font: 18px/1.65 var(--ui); }
  a { color: var(--accent); }
  header.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 40px; align-items: center; max-width: 1180px; margin: 0 auto; padding: 48px 24px 24px; }
  .hero img { width: 100%; height: auto; border-radius: 10px; box-shadow: 0 14px 40px #4a33182e; }
  .back { display: inline-block; margin: -10px 0 8px; padding: 10px 0; font-size: 15px; color: var(--soft); text-decoration: none; }
  h1 { margin: 0 0 8px; font: 700 clamp(34px, 4.6vw, 56px)/1.05 var(--serif); }
  .tag { display: block; margin: 0 0 14px; color: var(--accent); font-size: 18px; font-weight: 600; }   /* a subtitle under the title */
  .lede { font-size: 20px; color: #4a3b2a; }
  .watch { display: inline-flex; align-items: center; gap: 10px; margin-top: 10px; padding: 14px 26px; border-radius: 99px; background: var(--ink); color: #fff6e0; font-weight: 600; text-decoration: none; }
  .watch:hover { background: #4a3826; }
  .watch:focus-visible { border-radius: 99px; }
  .watch { flex-wrap: wrap; justify-content: center; row-gap: 2px; text-align: center; }
  .watch span, .watch small { white-space: nowrap; }
  .watch small { opacity: .75; font-weight: 500; }
  main { max-width: 900px; margin: 0 auto; padding: 8px 24px 80px; }
  h2 { margin: 64px 0 8px; font: 700 32px/1.2 var(--serif); }
  h3 { margin: 32px 0 4px; font: 700 21px/1.3 var(--ui); }
  figure { margin: 18px 0 26px; }
  figure img { display: block; width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); background: #fffdf8; }
  figcaption { margin-top: 8px; font-size: 15px; color: var(--soft); }
  .pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .stills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 18px 0; }
  .stills img { width: 100%; height: auto; border-radius: 6px; display: block; }
  .notice { margin: 0 0 18px; padding: 12px 16px; border-radius: 8px; background: #f6e3d6; border: 1px solid #e4bfa6; font-size: 16px; color: #5a3320; }
  .notice a { font-weight: 600; }
  .verdict { margin: 18px 0; padding: 4px 22px; border-left: 4px solid var(--accent); background: var(--card); border-radius: 0 8px 8px 0; }
  .numbers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
  .numbers div { padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; text-align: center; }
  .numbers b { display: block; font: 700 28px/1.1 var(--serif); }
  .numbers span { font-size: 14px; color: var(--soft); }
  ol.tries { padding-left: 22px; }
  code { font-size: .88em; background: #f1e6cf; padding: 1px 5px; border-radius: 4px; }
  footer { max-width: 900px; margin: 0 auto; padding: 0 24px 60px; color: var(--soft); font-size: 15px; }
  @media (max-width: 760px) {
    header.hero { grid-template-columns: minmax(0, 1fr); padding-top: 28px; }
    .pair, .numbers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
</style>
</head>
<body>
<header class="hero">
  <img src="making/cover.webp" width="1000" height="1006" alt="The Three Little Pigs: the wolf blows at the straw house while the first little pig peeks out of the window.">
  <div>
    <a class="back" href="../">← Back to the bookshelf</a><br>
    <div class="notice"><b>We don't recommend this method.</b> Asking an image model to draw the characters as well as the world meant new drawings for every action and a constant fight for consistency. Our picture books now paint only what stays still and move the characters in code: see <a href="../joke-collection/">Joke Collection</a>.</div>
    <h1>The Three Little Pigs</h1>
    <span class="tag">An experiment</span>
    <p class="lede">The other books on this shelf start from a textbook and draw every picture in code. This one started from nothing but the story. An image model painted the characters and places, and code made them move, speak and dance. It works, and it's fun to watch. But the method turned out not good enough to become part of the Papermorph Skill. Here is how it was made, and why.</p>
    <a class="watch" href="ch01/"><span>▶ Watch the film</span> <small>4½ minutes, narrated, music</small></a>
  </div>
</header>

<main>
  <div class="stills">
    <img src="making/still-1.webp" width="1200" height="675" alt="Mother Pig waves goodbye with her handkerchief." loading="lazy">
    <img src="making/still-2.webp" width="1200" height="675" alt="The first pig carries straw to her half-built house." loading="lazy">
    <img src="making/still-5.webp" width="1200" height="675" alt="The wolf licks his lips." loading="lazy">
    <img src="making/still-6.webp" width="1200" height="675" alt="The straw house flies apart." loading="lazy">
    <img src="making/still-8.webp" width="1200" height="675" alt="Three pigs in the windows of the brick house." loading="lazy">
    <img src="making/still-11.webp" width="1200" height="675" alt="Happily ever after." loading="lazy">
  </div>

  <h2>What we set out to do</h2>
  <p>Take a story with no book and no pictures, and make it an animated film you can pause, scrub and read along with, built like the rest of the shelf. What was new: the art came from an image model (OpenAI's gpt-image through OpenRouter), and the goal was a TV cartoon, not a slideshow.</p>
  <figure><img src="making/styles.webp" width="1400" height="260" alt="The same scene in three styles: gouache, cut paper, TV cartoon." loading="lazy"><figcaption>Style tests, one scene in three looks. We chose the TV cartoon (right).</figcaption></figure>

  <h2>Four tries at a character</h2>
  <ol class="tries">
    <li><b>Rotating painted parts.</b> Too stiff, with seams at every knee.</li>
    <li><b>Painted body, code-drawn limbs.</b> Much livelier, but one fixed camera still felt like a slideshow.</li>
    <li><b>Separately painted parts.</b> They never lined up: arms came out beside the sleeve, hands went missing.</li>
    <li><b>Characters drawn entirely in code.</b> Far too crude next to the painted world.</li>
  </ol>
  <div class="pair">
    <figure><img src="making/try1-rigid.webp" width="1400" height="788" alt="The wolf assembled from rigid painted parts." loading="lazy"><figcaption>Try 1: rigid parts.</figcaption></figure>
    <figure><img src="making/try2-hose.webp" width="1400" height="788" alt="The wolf with bendable code-drawn limbs." loading="lazy"><figcaption>Try 2: bendable limbs.</figcaption></figure>
    <figure><img src="making/try3-sheets.webp" width="1400" height="362" alt="Mother Pig's arm emerging beside her sleeve." loading="lazy"><figcaption>Try 3: parts that don't fit.</figcaption></figure>
    <figure><img src="making/try4-handdrawn.webp" width="1000" height="781" alt="Mother Pig drawn in code, crude." loading="lazy"><figcaption>Try 4: drawn in code.</figcaption></figure>
  </div>

  <h2>What finally worked</h2>
  <h3>One picture, edited, never redrawn</h3>
  <p>Each character got one large picture, and every other version was an <em>edit</em> of it: without the near arm, without a face, with the legs in each walking pose. The edits change only a few percent of the pixels, so they line up exactly, and a script can cut parts out wherever two pictures differ.</p>
  <figure><img src="making/edits-mother.webp" width="1400" height="689" alt="Mother Pig three times: complete, without her arm, without her face." loading="lazy"><figcaption>Mother Pig as drawn, without her arm (the dress behind it painted in), and without her face.</figcaption></figure>
  <h3>Vectorized, then swapped like a TV cartoon</h3>
  <p>The cut parts were traced into vector shapes, so close-ups stay sharp. Movement comes from swapping drawings the way TV cartoons do: legs walk on four drawings, and big actions, like sleeping or running, are whole drawings of their own. Code adds body bounce, blinks and the camera.</p>
  <figure><img src="making/vectorize.webp" width="1400" height="741" alt="Mother Pig painted, vectorized, and zoomed in three times." loading="lazy"><figcaption>Painted, vectorized, and the vector zoomed in three times.</figcaption></figure>
  <figure><img src="making/walk-wolf.webp" width="1400" height="516" alt="Four walking drawings of the wolf." loading="lazy"><figcaption>The wolf's walk: four drawings, all edits of the same picture.</figcaption></figure>
  <figure><img src="making/whole-poses.webp" width="1400" height="410" alt="The first pig carrying, tossing, napping, laughing and running." loading="lazy"><figcaption>Whole-body drawings for actions that limbs alone can't do.</figcaption></figure>
  <figure><img src="making/wolf-poses.webp" width="1400" height="292" alt="The wolf sniffing, grinning, inhaling, blowing, tiptoeing, collapsing and howling." loading="lazy"><figcaption>Every wolf action in the film is one of these.</figcaption></figure>
  <h3>Faces that talk</h3>
  <p>Each face has a featureless "faceplate" laid over it, with moving eyes, lids and brows on top. Painted mouth shapes are timed to the words of the voice track.</p>
  <figure><img src="making/mouths-wolf.webp" width="1400" height="245" alt="The wolf's mouth: closed, and four open shapes." loading="lazy"><figcaption>The wolf's mouths. Each is a block of the muzzle with a soft edge, so the jaw can really open.</figcaption></figure>
  <figure><img src="making/mouths-mother.webp" width="1400" height="195" alt="Mother Pig's mouth: closed and four shapes." loading="lazy"></figure>

  <h2>Places, houses and the camera</h2>
  <p>Backgrounds were painted, then separated into layers that slide past each other as the camera moves. The houses come in three aligned stages, so building them is a series of thumps, not a wipe. The camera cuts on words: a close-up for whoever speaks, a follow shot when someone runs.</p>
  <figure><img src="making/layers.webp" width="1600" height="178" alt="The cottage scene as five separate layers." loading="lazy"><figcaption>Mother Pig's cottage in five layers.</figcaption></figure>
  <figure><img src="making/houses.webp" width="1600" height="175" alt="Each house in three construction stages." loading="lazy"><figcaption>Three houses, three stages each.</figcaption></figure>
  <p>The voices are free text-to-speech, one per character. The music, four pieces generated with Google's Lyria, crossfades between parts of the story.</p>

  <h2>What kept going wrong</h2>
  <p>Almost every fix came from watching, and many were specific to one character.</p>
  <figure><img src="making/bugs-hands.webp" width="1400" height="344" alt="A hollow arm, a missing hand, and ghost legs." loading="lazy"><figcaption>A see-through arm (fur the same colour as the body behind it fooled the cutting), a missing hand, ghost legs from blending two drawings.</figcaption></figure>
  <ul>
    <li>The second pig wore no trousers, and the image model's safety filter kept refusing his pictures. Another model redrew each one slightly differently, so his body flickered. In the end he got shorts and was redrawn from scratch.</li>
    <li>A held object belongs to one drawing: the third pig carried the pot while still holding a brick.</li>
    <li>Quality "high" cost five times "medium" and, once traced, looked the same. We found out late.</li>
  </ul>
  <figure><img src="making/medium-vs-high.webp" width="1400" height="788" alt="Medium and high quality side by side, zoomed in." loading="lazy"><figcaption>Medium (left) and high (right), vectorized and zoomed in three times.</figcaption></figure>

  <h2>The numbers</h2>
  <div class="numbers">
    <div><b>~4½ min</b><span>11 scenes</span></div>
    <div><b>~220</b><span>generated pictures</span></div>
    <div><b>$10.7</b><span>pictures and music</span></div>
    <div><b>1 day</b><span>of making and fixing</span></div>
  </div>

  <h2>Why we don't recommend it</h2>
  <div class="verdict">
    <p><b>Every new action needs new drawings.</b> In a book drawn in code, a new movement is a few lines. Here, picking up a pot or climbing a ladder means another round of edits per character. The film can only do what was drawn, and you notice the gaps.</p>
    <p><b>Consistency has to be fought for, character by character.</b> A safety filter or a second model could break a character halfway through.</p>
    <p><b>It doesn't get cheaper with practice.</b> A Skill should make the hundredth chapter as good as the first. This method makes each one cost about the same, in money and attention.</p>
  </div>
  <p>So the film stays here as a record of a path we wouldn't recommend as it stands. What we kept: an image model is very good at painting a world that stays still, and <a href="../joke-collection/">Joke Collection</a> uses it for exactly that. What would change our mind: image models that hand back a character as a real, bendable rig, or video models that keep a character consistent and can be steered word by word.</p>
  <p><a class="watch" href="ch01/">▶ Watch the film</a></p>
</main>
<footer>Story: the English folk tale, retold for this film (in this version nobody gets eaten). Pictures generated with OpenAI gpt-image and Google Gemini image models, music with Google Lyria, voices with Microsoft Edge text-to-speech. Part of <a href="../">Papermorph</a>.</footer>
</body>
</html>