I thought it might be worth noting this use of claide.ai. I’ve seen a wide variety of views on AI and its promise & pitfalls. When it comes to writing a wee bit of code I feel a lot of sympathy with Alan’s approach. But I have dabbled a bit and do so again this week.

I use gifsicle a bit for creating and editing gifs, it is a really powerful tool. I think I’ve a reasonable but limited understanding of how to use it. In the past I’ve used it for removing every second frame of the gif and adjusting the delay.

#!/bin/bash gifsicle -U -d 28 --colors 64 "$1" `seq -f "#%g" 0 2 20` -O3 -o "$2"

This is pretty crude and you need to manually edit the number of frames and guesstimate the new delay which will be applied to every frame1.

I know gifsicle can list the delays of each frame with the –info switch, but I do not know enough enough bash to use that information to create a new gif. I had a good idea of the pseudo code needed but I reckoned that the time it would take to read the man page and google my way to the bash syntax needed was too much for me.

This week I was trying to reduce a gif I’d made from a screen recording. It turned out a bit bigger than I had hoped. I tried a couple of application but didn’t make much of a dent. I decided to ask Claude:

I am using gifsicle/ I want to input a gif, and create a new one. Explode the gif, delete ever second frame and put an animated gif back together doubling the delay for each frame. So a gif with 20 frames will end up with 10 frames but take the same length of time. I’d like to deal with gifs that have different delays on different frames. So for example frame 1 and 2 the delays for these frames added together and applied to frame one of the new gif.

The original query had a few typos and spelling mistakes but Claude didn’t mind. After one wrong move, when Claude expected the gifsicle file name to be slightly different I got a working script and took my 957KB gif down to 352KB, that was the image at the top of the pos2t.

I had asked for the script to use gifsicle explode facility to export all of the frames. Which the script did, neatly in a temporary folder. As I typed up this post, looking at my original attempt, I realised I should not have asked for the script to explode the gif, but just grab every second frame from the original. This seemed more logical and perhaps economical, so I asked Claude to take that approach. The final script has been quickly tested and uploaded a gist: gif frame reduction in case anyone would find this useful.

Of course this has added to the pile of not quite formed reflections on AI and should we have anything to do with it. I don’t feel too guilty as I needed at least a little gifsicle knowhow to get started.

  1. The seq command just outputs a sequence of numbers from 0 to 20, counting up in steps of 2. The -f “#%g” makes it print a # before each number, which makes gifsicle understand it as a frame selection instead of a file name. The backticks around the seq command cause its output to be included as parameters in the gifsicle command line. I am sure I googled to work that out ↩︎
  2. There is a difference between the sizes reported by the Finder & WordPress. The wordPress ones are on the image caption. ↩︎

Given I want a nice gentle start for my class this session I thought we would play with Vedic Squares. I was reminded of these and their possibilities from a tweet I’d bookmarked from Blair Minchin.

We started on Last Thursday making multiplication grids then vedic squares, making patterns by joining the same numbers with lines.

 

The next day we recreated the grids in Numbers. I then explained conditional highlighting so that the class could colour the grid. They were fascinated by both the process and the results. The Gallery below steps through the process.

The next step was to screenshot the grids and place them in keynote to duplicate and create symmetrical patterns. At this point some of the class started animating their patterns to rotate madly in keynote. At that point gifs became obvious;-)

Here is the process in Keynote.

For a gif purist like myself Keynote gifs are a bit off. Very big files indeed. This got a little better after I explained that they didn’t need 999 rotations for a gif, one would do. Getting rid of any easing in the rotation and any delay in the export gives a straightforward rotation.

A quick screencast of rotation settings and gif export:

I particularly enjoyed the excitement as the class saw the conditional highlighting in action and then that the animation step was suggested by the pupils. There is still a lot to explore around both the patterns and processes. I hope that the class will further explore both, opening up links to maths, R.E. and art.

Although we used iPad, Apple Numbers and Keynote I am sure you could do the same with Excel & PowerPoint.

Listened GIFs as Blackface from Glimmer
Anil Dash: What I'm saying is, sometimes that machine is making us do something that replicates the systemic racism of the world around us. I don't think anybody intends that, but maybe by talking about it, what we can do is encourage each other to be a little bit more thoughtful, a little bit more mindful about which images we use, whose images we use, and the way we use them. And if we do that, we can keep the machines and the software and the technology from undermining other people's ability to trust in our good intent when we send them a message.

Really interesting discussions. I’ve messed around a lot with gifs, mainly making them, I like their use for examining moments, “art” and just playing with the tools. I’ve never, afair, entered into the world of reaction gifs. I’ve used giphy for the odd daft experiment, but that is as far as it goes.

I do like a gif. I like to make them in all sorts of ways. Recently I’ve been messing about with Live Photos. The mac Photos app will export gifs from these but they are huge. To my mind a gif should be as small as possible. The other problem wit Live photos is my hands tend to move. Today I tried the iOS app Motion Stills:

Motion Stills is an app from Google Research that uses advanced stabilization and rendering to turn your Live Photos and videos into GIFs

The only problem is that the files are pretty big. I took a photo of a squirrel in the botanic gardens this morning and ran it through the app. The stabilisation was great but the file size for the image was 8.7MB for a 480 × 360 image!

I decided to see if I could shrink it a little and got it down to 331kb. This is how:

  1. I opened in the Gif in FireWorks
  2. The gif had 54 frames at 3/100 of a second and one at 6/100 of a second. I deleted every second frame and doubled the length of each.
  3. The gif was set to have an exact pallet with 256 colours, i changed that to Adaptive and 128 colours.
  4. I set the loss to 20%
  5. I made a new layer which was shared across the frames. copied the first frame to that layer and cut out a space for the squirrel in the top layer. This froze most of the image except for the squirrel.

The featured image of this post is the shrunken gif.

 

I’ve got my raspberry pi working as a webcam posting gifs every 9 minutes and stills every 5. Gif Cam.

The pi has been sitting around for a while acting as a web server with a broken tweetbot. It took very little effort to get it taking photos from our window and showing them on the web. Little more to grab a bunch and gif them (Gifsicle again). A better view might be more interesting.

I’ve not spent as much time as I’d like playing with the pi but the potential for play, learning and work seems large.