Article feature image: Screenshot of me asking ChatGPT to create a script, with the new Canvas UI open.

GIFs from GPT; New Canvas Feature

The real benefit of LLMs for coding is that they have read the documentation for all those software packages.

By Daniel Detlaf

One-man flea circus, writer, sci-fi nerd, news junkie and AI tinkerer.

Pssst. Would you like a quick weekly dose of AI news, tools and tips to your inbox? Sign up for our newsletter, AIn't Got The Time.

Screenshot showing the ChatGPT interface with Canvas open and vode for an emoji-gif generator displayed. 
Image: Daniel Detlaf.

One of the great things about LLMs if you know or are willing to learn a little coding is their ability to string together all the little parameters and modifiers in a given software library.

“Coding” is Often Reading the Instruction Manuals for Tools

If you don’t code, let me explain briefly. Coding is about problem solving, and often the problems that come up are repetitive. A lot of problems have perfectly good solutions already publicly available. So in practice, programmers often reuse code by loading packages of pre-made code called libraries, modules, or various other names depending on the language and context.

These libraries are basically toolkits. You don’t have to build your own power saw, you just need to grab it from your toolkit, read the instructions, plug it in, and start cutting.

The instructions on these software tools can be lengthy and complex, however. If they have good documentation they aren’t hard to work out. But “not hard” and simple or quick are not the same.

Imagine if before using your power saw, you first have to define the radius of the blade, the speed of the motor in RPMs, the angle of the blade, etc. It’s all stuff you can figure out with the manual but it takes some thought and time.

Same with software libraries. It’s all there, pre-made, instructions provided, but some configuration is needed to put it to work. LLMs can speed that process up, because it knows all the different settings, what they do, how they affect each other, and what to set them at to achieve certain goals.

Creating the GIF with GPT-4o and Python

I wanted to make a GIF of the alphabet flashing in a cycle for a small side project. I know that Pillow, a Python package full of code for image manipulation, can probably do it. And that’s about all you need to know – whether the tools and code exist and are common enough that GPT, Claude, Llama et al might have been trained on them.

After typing in a straightforward prompt asking GPT to create a script using Python to cycle through the alphabet in GIF form, it was done. GPT has the library’s handbook memorized and can provide answers faster than I can scroll through the docs.

Below you can find the source code and the end result. If you’re following along at home and have Python involved, you can save it to a file and run it with “python yourfilename.py”. You might need to install Pillow first (pip install Pillow).

The letters of the alphabet cycling in a GIF image.  Image: Daniel Detlaf.
Total time from thought to gif – about 3 minutes. Image: Daniel Detlaf.

Sidenote: Canvas and Artifacts

While we’re at it, let me briefly mention two new AI interfaces: OpenAI’s Canvas and Anthropic’s Artifacts. Both offer an improved way of interacting with the AIs when working on files. You can see the canvas open in the feature image for this post.

Canvas is akin to a digital workspace, an editor that opens up with the code GPT generates and then lets you type to make changes shared with GPT. When GPT makes changes to the code, it rewrites in the same window, using a versioning system to let you undo and redo, moving through versions of the file generated during your conversation.

It’s OpenAI’s response to Anthropic’s Artifacts feature that came out a few months back and offers a similar iterative workspace for working on file-based tasks. They are both great features and fun to play with.

Create an amazing adventure with Storynest.ai. Try it free.  - Sponsored

Sponsored