On 01.06.2011, at 04:39, Steve Thomas wrote:
> Bert (I assume this was you),
Guilty as charged.
> I really like the changes made adding Twitter and especially the new "doThings" animated gif!!!
Well, Alan made the project long ago, I only made the GIF.
I use the "SqueakEtoys" twitter account to re-tweet messages mentioning "etoys" or "squeakland". The re-tweeting is manual ("etoys" is often used for non-Squeak related things). New tweets show up only when I have time to do it.
> Okay, how did you do the gif? My guess is its a three lines of squeak ;) This is great, would love the code to do it.
Well, Squeak can write animated GIFs. Execute "GIFReadWriter exampleAnim" and then look at the resulting "anim.gif" in a web browser.
But that was not working well enough, so I instead wrote a snippet that just writes out each GIF as a separate numbered file. I'm attaching a project with the code, it's just one 20 line method.
After loading the project I put "GIFReadWriter recordScreen" into the do-menu (cmd-comma, "do...", "edit this list").
Then I switched to the demo project and chose that item from the do-menu. It records until you move the mouse to the top of the screen.
To "preview" the anim I select the first file (recording.1.gif) in the Finder and press the space bar, which displays it in a quick-view window. With the cursor keys I can move through all the files.
I have a very fast machine, but some of the scenes are time-based so they look shorter in the recording. I manually sped up some parts (like the transitions) by deleting intermediate images.
Finally I used the free "gifsicle" command line tool to build an optimized animated gif from the recordings:
ls recording.*.gif | sort -n -t. -k2 | xargs gifsicle -O3 -l0 -d20 > doThings.gif
This sorts the filenames numerically, then builds the anim. The -O3 switch tells it to optimize the GIF animation. This brings the file size down from 1.5 MB (storing each frame in full) to 150 KB (storing only the parts that changed). This compares very favorably to the 900 KB Flash video we had on the site before (plus it work pretty much anywhere now).
I tried making a higher-quality version (e.g. you'll notice in the transitions, the two vertical lines are not always visible) but that resulted in a 600 KB file, which I thought was not worth it.
- Bert -
_______________________________________________
squeakland mailing list
[hidden email]
http://lists.squeakland.org/mailman/listinfo/squeakland