Skip to content
animorio
IT
Back to the library

Tiled AI image

ImagesCanvas, GSAPMediumCompressed weight: Demo 7.5 KBGSAP 28 KBFreeDownload the zip

The image generator of a made-up AI app, Prismo, on near black in the Libraries.dev style: under the prompt, a mosaic of breathing grey tiles turns over one tile at a time from the bottom and takes on colour, then the photo refines in finer and finer passes until it is sharp, with a glow running around the border while it generates and a light crossing it at the end. Regenerate rewrites the prompt and runs again with another photo: a glass greenhouse, a harbour at dusk, the dunes.

The code

A folder that runs on its own: index.html, style.css, script.js and the libraries from a CDN. The React and Vue tabs hold the same demo as a ready component, which switches its animations off when it leaves the page.

<!doctype html>
<!--
  "Tiled AI image" from Animorio · https://animorio.com
  License: free on your own sites and your clients’ sites, paid work included.
  Not for resale, redistribution, templates or code collections · https://animorio.com/en/license/
-->
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>The image that generates from tiles while the AI draws</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/wdth.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <main class="stage" data-stage>
    <!-- an image generator of a made-up AI app, Prismo: the prompt on top, the picture assembling itself from
         grey tiles that turn one by one and get finer and finer, and the progress underneath -->
    <section class="gen" aria-label="Prismo image generator">
      <div class="prompt" data-prompt>
        <svg class="prompt__spark" viewBox="0 0 16 16" aria-hidden="true"><path d="M8 1.6c.5 3.4 1.9 4.8 5.3 5.3-3.4.5-4.8 1.9-5.3 5.3-.5-3.4-1.9-4.8-5.3-5.3 3.4-.5 4.8-1.9 5.3-5.3Z"/></svg>
        <span class="prompt__text" data-prompt-text>A glass greenhouse, soft morning light</span>
        <span class="prompt__caret" data-caret aria-hidden="true"></span>
        <span class="prompt__model">Prismo 2</span>
      </div>

      <div class="frame" data-frame>
        <span class="frame__glow" data-glow aria-hidden="true"></span>
        <canvas class="frame__canvas" data-canvas role="img" aria-label="Generated image"></canvas>
        <span class="frame__shine" data-shine aria-hidden="true"></span>
      </div>

      <div class="status">
        <div class="status__row">
          <span class="status__label" data-label>Generating…</span>
          <span class="status__time" data-time>0.0 s</span>
          <span class="status__pct" data-pct>0%</span>
        </div>
        <div class="status__bar"><span data-bar></span></div>
      </div>

      <div class="actions">
        <button class="btn btn--light" type="button" data-regen>
          <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M13 8a5 5 0 1 1-1.5-3.6"/><path d="M13 2.6v3.2H9.8"/></svg>
          <span>Regenerate</span>
        </button>
        <button class="btn btn--ghost" type="button" data-save>
          <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M8 2.6v7.6"/><path d="M4.8 7.2 8 10.4l3.2-3.2"/><path d="M3 12.8h10"/></svg>
          <span>Download</span>
        </button>
      </div>
    </section>

    <svg class="pointer" data-pointer viewBox="0 0 20 20" aria-hidden="true"><path d="M4 2.5v13.2l3.5-3.3 2.4 5.1 2.2-1-2.4-5h4.8z"/></svg>
  </main>

  <script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/gsap.min.js"></script>
  <script src="script.js"></script>
</body>
</html>

Playground

Change values, colours and text with the controls and watch the animation respond live. Or write in the code yourself. Then download the folder with your changes.

22 values to change

Or ask your AI assistant for it

With the Animorio connector, Claude Code, ChatGPT, Cursor or VS Code take it from here, guide included, and fit it into your project. Paste this request:

Take “Tiled AI image” from Animorio and fit it into my site
Platform licenseFree on your sites and your clients’ sites. Want it inside a website builder, a template platform or a client dashboard? There’s a license for agencies and platforms.

What it does

On a near black background sits the Prismo generator: at the top the prompt in a pill, “A glass greenhouse, soft morning light”, with a small violet star and the model’s name; below it the image frame, with rounded corners. At first it is a mosaic of 32 pixel grey tiles breathing slowly, each to its own rhythm, and around the frame a violet and peach glow lights up and runs around the border while the frame dips slightly. Then the tiles turn over one at a time, from the bottom up with a ragged front: they close like a card, and when they open again they have their colour. Once the whole mosaic is coloured, the picture moves to 16, 8, 4 and 2 pixel tiles, each time with a pass rising from the bottom in staggered columns, and finally turns into the sharp photo (a glass greenhouse full of plants in the morning light), with grain. The glow goes out, the frame comes back up with a small bounce, takes a long shadow and a light crosses it diagonally. Underneath, meanwhile, “Generating…” counts the seconds and the percentage rises with the thin violet and peach bar; at the end it says “Done in 4.2 s” and the two buttons, Regenerate and Download, rise by a pixel. A drawn pointer presses Regenerate: the picture dims, the prompt erases and retypes itself with the caret (“A quiet harbour at dusk, lights on the water”, with the photo of a harbour at dusk and the city lights in the water, then “Dunes at noon, one long shadow”, with the red dunes and their long shadow) and it all starts again with another photo.

How it works

The real photo, prepared once

The three pictures are real CC0 photos in the demo folder (serra.webp, porto.webp, dune.webp), loaded at the start with decode(). Each photo is drawn once on a hidden canvas the size of the frame, covering it like object-fit: cover, and the grain is laid over it: a 256 pixel tile of our own noise in overlay, where mid grey changes nothing. It is only redone when the frame changes size (a ResizeObserver) or when the scene changes.

The tile levels

From the photo come five small canvases, a thirty-second as wide, a sixteenth and so on down to a half: drawn big again with imageSmoothingEnabled set to false they become tiles of that size. Each pixel of the smallest canvas is the colour of one big tile.

The turning tiles

Every big tile has its own moment: the lower it is the earlier it comes, plus a little chance. A single number, the front, goes from 0 to 1 with GSAP; for each tile the distance between the front and its moment gives the vertical scale, from 1 to 0 in grey and then from 0 to 1 in colour, like a card being turned: the coloured face is its own pixel of the smallest canvas, stretched with drawImage.

The finer passes

Each finer level rises over the previous one column by column: for each column the edge is the same height plus a random offset of a few tiles, so the pass has a ragged edge. At the end the sharp photo fades in over the last level.

The border lighting up

Behind the canvas sits a conic-gradient that is almost all transparent, with a violet and peach tail, and an 18 pixel blurred copy of it. GSAP takes the --a variable from 0 to 360 degrees in a continuous loop while it generates, and turns it off at the end.

Values to change

NameFileDefaultWhat it changes
GEN_TIMEscript.js4.2The seconds the image takes to generate, from grey tiles to sharp.
FIRST_TILEscript.js32The side in pixels of the grey tiles at the start.
FLIPscript.js0.32The seconds each tile takes to turn over and take its colour.
BREATHscript.js0.35How much the grey tiles breathe while they wait (0 still).
GRAINscript.js0.07The grain of the finished image.
ACCENTscript.js'#9a8cff'The colour of the border glow and the bar.
HOLDscript.js2.6The seconds the finished image stays before it regenerates.

Try them in the Playground

When to use it

For an app that generates images with AI, for the page of a model or a creative tool, or for any long wait for an image: the tiles say something real is coming, and the growing resolution tells the progress better than a bar alone.

On phones

The same animation with adapted sizes: the frame is sized on the width and the height, the model name disappears under 420 pixels and Regenerate is pressed with a finger.

With reduced motion

No turning tiles, no passes and no glow: the frame stays grey while the percentage rises, then the image appears sharp with a fade; Regenerate changes the prompt and the image with a fade.

Pitfalls

  • Redrawing the photo, the grain and the levels every frame costs too much: it is done once per size and per scene, and every frame only copies ready canvases with drawImage.
  • No getImageData on the photo: opened from disk (the zip with file://) the browser marks the canvas as “tainted” and the read stops with an error. The tile colours are copied with a one-pixel drawImage, and the grain is our own canvas laid over in overlay.
  • The generation only starts once the photo is decoded (img.decode()): until then the grey tiles just breathe, otherwise they would turn over onto an empty background.
  • Small levels drawn big need imageSmoothingEnabled set to false, otherwise the tiles turn into a blur; for the final photo it goes back to true.
  • The column pass draws with drawImage only the one-column strip of the small canvas: with a whole rectangle per column the tiles on the left would cover their neighbours.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 7.5 KB; the libraries: GSAP 28 KB.

Testing

Tested on 6 November 2026

  • Desktop: Done
  • Phone: Done
  • Reduced motion: Done
  • Safari on iPhone: To do

License

Use it in your own projects and in your clients’ projects. Do not resell it or redistribute it as is. GSAP stays under its own Standard license. Full license.

All animations