Animate Images: A Children’s Encyclopedia

Idea and Step-by-Step Plan

Today, we’re going to bring a page from a children’s encyclopedia to life — with pictures!

Here’s the plan:

  1. Take an article from some free encyclopedia for children. (Of course, you can use a children's story, short illustrated tales, or any other suitable content.) To keep it simple, we’ll focus only on text and illustrations.

  2. Based on each illustration, a smart multimodal chat model gpt-4o comes up with a short video idea — a little scene that matches the content. Model generates a video model prompt.

  3. With this prompt, generate a 5-second video using video model and download the generated video from the server.

  4. Convert it to a GIF using any free online tool.

  5. Replace the original static image with the animated GIF.

Repeat this process for every illustration on the page.

A Page We’re Bringing to Life

Article Example

What Are Raccoons?

Raccoons are small, furry animals with fluffy striped tails and black “masks” around their eyes. They live in forests, near rivers and lakes—and sometimes even close to people in towns and cities. Raccoons are very clever, curious, and quick with their paws.

One of the raccoon's most famous habits is "washing" its food. But raccoons aren’t really cleaning their meals. They just love to roll and rub things between their paws, especially near water. Scientists believe this helps them understand what they’re holding.

Raccoons eat almost anything: berries, fruits, nuts, insects, fish, and even bird eggs. They're nocturnal, which means they go out at night to look for food and sleep during the day in cozy tree hollows.

Raccoons are very social. Young raccoons love to play—tumbling in the grass, hiding behind trees, and exploring everything around them. And sometimes, if they feel safe, raccoons might even come closer to where people are—especially if there's a snack nearby!

Even though they can be a little mischievous, raccoons play an important role in nature. They help spread seeds and keep insect populations in check.

So next time you see a raccoon, remember: it’s not just a fluffy animal—it’s a real forest explorer!


Full Walkthrough

  1. Let’s take the raccoon article from the previous section. To upload the illustrations into the chat model, we’ll save them to disk first. Later, you can use the resulting folder of images to build an HTML page with animated visuals.

  1. Let’s have the multimodal gpt-4o model analyze the image and suggest a prompt for the video:

Python code
Response: Generated Prompt Based On the Image Description
  1. Now it's time to generate a short video based on our image and the prompt prepared for us by the chat model in the previous step. We'll use a model kling-video/v1.6/pro/image-to-video from Kling AI.

Python code
Response
  1. We've generated two videos and will now convert them into GIF animations using a free third-party web service, for easier playback on a web page. We'll also reduce the frame rate and size to ensure smoother playback. We'll save the resulting GIF files in the same folder, using the same names as the original PNGs.

  1. You can also ask any chat model (e.g., gpt-4o) to generate a web page with the original text and the GIF animations placed in the same spots as the original illustrations.

Results

Animated Article Example

What Are Raccoons?

Raccoons are small, furry animals with fluffy striped tails and black “masks” around their eyes. They live in forests, near rivers and lakes—and sometimes even close to people in towns and cities. Raccoons are very clever, curious, and quick with their paws.

One of the raccoon's most famous habits is "washing" its food. But raccoons aren’t really cleaning their meals. They just love to roll and rub things between their paws, especially near water. Scientists believe this helps them understand what they’re holding.

Raccoons eat almost anything: berries, fruits, nuts, insects, fish, and even bird eggs. They're nocturnal, which means they go out at night to look for food and sleep during the day in cozy tree hollows.

Raccoons are very social. Young raccoons love to play—tumbling in the grass, hiding behind trees, and exploring everything around them. And sometimes, if they feel safe, raccoons might even come closer to where people are—especially if there's a snack nearby!

Even though they can be a little mischievous, raccoons play an important role in nature. They help spread seeds and keep insect populations in check.

So next time you see a raccoon, remember: it’s not just a fluffy animal—it’s a real forest explorer!


Room for Improvement

Of course, the goal is to automate the process as much as possible — and to make the images look more natural and visually appealing:

  • Generate looping videos to make sure the animated illustrations move smoothly.

  • Simply pass a page URL or document to the program and get back a local webpage with animations.

  • Add logic to skip images below a certain size, to avoid animating icons, logos, or other minor elements.

  • Support a wider range of image formats.

  • Automate GIF conversion from video directly within the program.

Last updated

Was this helpful?