How to Create Affordable GIF Inscriptions Using Split Images

Albert
Albert
  • Updated

If you want to inscribe a GIF without the high cost of inscribing the entire file at once, you can split it into individual frames and inscribe each frame separately and then use simple HTML and JavaScript to simulate the GIF. This approach reduces inscription costs while preserving the animated effect.

How It Works

1. Split the GIF

The original GIF is broken down into individual frames (images). Each frame becomes a separate image file that can be inscribed independently.

2. Inscribe Each Frame

Instead of inscribing the whole GIF, you inscribe each frame individually. This may be more cost-effective as each image can be smaller and cheaper to inscribe.

3. Simulate the GIF in HTML

After inscribing, you can use HTML and JavaScript to display the frames sequentially, creating the illusion of an animated GIF.

 

Example Code:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta content="width=device-width,initial-scale=1" name="viewport">
    <title>Ceaseless Introspection</title>
    <style>
      body {
        margin: 0
      }

      #gif {
        max-height: 100vh;
        display: flex;
        justify-content: center;
        align-items: center;
        margin: 0 auto
      }
    </style>
    <link rel="stylesheet" href="chrome-extension://ihcjicgdanjaechkgeegckofjjedodee/app/content-style.css">
  </head>
  <body>
    <img alt="Ceaseless Introspection" id="gif" src="./Ceaseless Introspection_files/ed79c2338be326f62a22c5a7cf138b62e3b24eadd944462013e6794f9788d70bi0">
    <script>
      var images = [
        "/content/61ca6e959454404ce2e7dfd560f81d9eb454fc6e6ed68055dfd2df6bfdc2d136i0", 
        "/content/7ed4ca4bc282a9262bbaab69aa5d189bd7f6f39fc94b1c8a46edacb2d3d08455i0", 
        "/content/34c10818bd0904b4bd287fb8b1f48caf25a81c70df172d4a49b1de93e4e0bb61i0", 
        "/content/30c1a35de5247065e4e8f866d4e337fad903bab0a91455aea8ee28066908cff5i0", 
        "/content/f108b4cd8fd115db246c103724b256f8936a46cc859e310ba100264dc3b8f730i0", 
        "/content/ffbe8c0edd356257da4606789bda88394b73d089dc94417f75c44cf58286eda4i0", 
        "/content/ed79c2338be326f62a22c5a7cf138b62e3b24eadd944462013e6794f9788d70bi0", 
        "/content/3bfa7128f14894d523ac53ce786289115304af5160b7886735146ce6c59f2e82i0", 
        "/content/efaa6ff45996c40c66b90880fb09b959669ee03985319a607cdaaf93a655856fi0", 
        "/content/41d8ca225511c1eb4291ebf8ba3641e9861ab4d067a8136d7bb75247e6c2e933i0", 
        "/content/97befb8c41d99af6fc382bcedeb39ea7ba4bdff8f0b91bd7641d708a7f3fd365i0", 
        "/content/00efaa64854e2607ebb1ea34690935355e411f9ef4fb2eed019dd2c43b4311c3i0", 
        "/content/00efaa64854e2607ebb1ea34690935355e411f9ef4fb2eed019dd2c43b4311c3i1", 
        "/content/989d9fc580242f31bdb44b7caca42c0bf22e7dbb9c9a62d50c745554d0d0d23ci0", 
        "/content/ea32d11bf77d6dfedde283b10c62951b56caf4070ad8b6308a4416212bc5d464i0", 
        "/content/4f1ada0c9281b346e02910a3d7a15fb2b99bbd7dc0fe31a8b300f0341357d9cei0", 
        "/content/4f1ada0c9281b346e02910a3d7a15fb2b99bbd7dc0fe31a8b300f0341357d9cei1", 
        "/content/5ea615a14a2590b22ef8f7101a27f33a9c9ee5112f25d3bd453dfa6378f52347i0", 
        "/content/162ba6f85abcd9971dd3a3200784d4657f3703325e7996c2df5c05ffe45c34d4i0", 
        "/content/4a6a7325a09daaefd29270ca5344457e9b021aac2ad7defa28f9c948cd4d4c82i0", 
        "/content/9f7f5ce4aad7cb8fe88172c9f5eda7f01884cee2a03cf84aad8452dabdff1c82i0", 
        "/content/7be55c061c00b1c2d17d3ceee90ac7ce26b3f58edba9b39af0519960d49e004ei0"
    ];

      function loadGif(e) {
        var c = document.getElementById("gif"),
          d = 0;

        function a() {
          c.src = e[d], ++d >= e.length && (d = 0)
        }
        a(), setInterval(a, 100)
      }
      loadGif(images)
    </script>
    <script src="chrome-extension://ldinpeekobnhjjdofggfgjlcehhmanlj/inpage.js" id="leather-provider"></script>
  </body>
</html>

 

- Frame Timing: The setInterval function determines how fast the GIF plays. In the example above, frames change every 100ms.

- Responsive Design: The CSS ensures the GIF scales to the viewport height while remaining centered

- You can add as many frames as needed by updating the images array.

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.