Yes you too can capture and enjoy an animation of images easily on your linux machine. Simply: 1- Get the image sequence into a alpha-cronological order. 2- Generate a list of the image names. 3- Run the .html to show the animation. ===================================================================== 1 - Getting the images ----- First we need a directory to put all the stuff we will use in. ~> mkdir ani; cd ani; ~/ani> ----- You can save images from anywhere manually using the browser "save as" or running wget from the command line or my favorite- a cron job. Of course you could create a sequence of images with paint or gimp too. So we manually can do this every ten minutes: ~/ani> wget http://icons.wunderground.com/data/640x480/2xradarb5.gif ~/ani> mv 2xradarb5.gif 20110517-0035_2xradarb5.gif # create a datey name ----- We can automate that a bit more to create a date string and then gets/saves the image using that date string:. ~/ani> dstr=$(date \+\%Y\%m\%d-\%H\%M); \ while ! wget http://icons.wunderground.com/data/640x480/2xradarb5.gif -O \ "$dstr"_2xradarb5.gif; do sleep 10; done; ----- We can put that in a loop to run every so many minutes for a period: (This should get one every 10 min (600 sec) for 10 hours (60 loops @ 10ea)) ~/ani> for (i=0; i < 60; i++); do \ dstr=$(date \+\%Y\%m\%d-\%H\%M); \ while ! wget http://icons.wunderground.com/data/640x480/2xradarb5.gif -O \ "$dstr"_2xradarb5.gif; do sleep 10; done; \ sleep 600; \ done; ----- We can also write a cron job to do this behind the scenes: Just write the line to a file to have cron do: But first see if you already have some cron tasks going: ~/ani> crontab -l # -l is for "list" If nothing shows then just create the file as shown below as this will be your only crontab entry. If there are already jobs then you will need to add this to them. You should be able to find a hidden file with a "cron" related name in ~/ In the example below I use a fake name and the "append" >> redirect which will add to an existing file instead of overwriting it. WARNING: BE SURE TO BACK UP ANY EXISTING CRON JOB FILE BEFORE OVERWRITING You can use and editor like gedit or vi to edit an existing cron file or write a new one. But here is a way to write the file using cat: ----- ~/ani> cat >> ~/.cron_myjob #example filename only, yours could be different # get nexrad pics every 10 minutes (this is a comment) 00,10,20,30,40,50 * * * * cd /home/me/ani; dstr=$(date \+\%Y\%m\%d-\%H\%M); while ! wget http://icons.wunderground.com/data/640x480/2xradarb5.gif -O "$dstr"_2xradarb5.gif; do sleep 10; done; ----- Then we ask crontab to install the new job. WARNING: THIS WILL REPLACE ANY EXISTING CRON JOBS (user)YOU HAVE RUNNING ~/ani> crontab ~/.cron_myjob You can see it in place with the "crontab -l" as above. ----- So there we go. One way or the other we should now be getting a bunch of files with good cronological names: ~/ani> ls 20110517-1030_2xradarb5.gif 20110517-1110_2xradarb5.gif 20110517-1040_2xradarb5.gif 20110517-1120_2xradarb5.gif 20110517-1050_2xradarb5.gif 20110517-1130_2xradarb5.gif 20110517-1100_2xradarb5.gif See how nicely they sort? ...moving on ===================================================================== 2 Generate a list of the image names ----- So now we need to make a list of the files we have available so far. This list needs to be in the form of a javascript array and saved to a file with a .js extension so that it can be used by the .html (next). For this we can use a simple bash script: ~/ani> cat > anim_generatelist #!/bin/sh echo -e " var pic = ["; i=0; for ea in *.gif; do echo -n " '$ea',"; if [[ $((i++ % 2)) -eq 0 ]]; then echo; fi; done; echo -e "\n ]"; Now we change that file's permissions to be executable: ~/ani> chmod 754 anim_generatelist When we run the command the list will be printed to the screen which is nice: ~/ani> ./anim_generatelist var pic = [ '20110517-1030_2xradarb5.gif', '20110517-1110_2xradarb5.gif', '20110517-1040_2xradarb5.gif', '20110517-1120_2xradarb5.gif', '20110517-1050_2xradarb5.gif', '20110517-1130_2xradarb5.gif', '20110517-1100_2xradarb5.gif', ] ...but we can easily redirect that output to the .js file we need with the >. anim_convertandgeneratelist > anim_images-list.js ----- .PNG FORMAT !!! ----- Ok so there is a suitable file, BUT while .gif's are fairly small and work nicely I found that: - the encoding is copyrighted! - .png is smaller - there is a handy "gif2png" utility to convert from .gif to .png So I added a line to the script to convert all gif's! I would urge that you get "gif2png" and do that as well. gif2png is a very small build if you don't have it available.. Here is that new script: cat > anim_convertandgeneratelist #!/bin/sh # convert all gif's to png for ea in *.gif; do gif2png -Od $ea; done; # print .js array of all the .pngs suitable for import to the html. echo -e " var pic = ["; i=0; for ea in *.png; do echo -n " '$ea',"; if [[ $((i++ % 2)) -eq 0 ]]; then echo; fi; done; echo -e "\n ]"; #### WARNING: THIS WILL OVERWRITE THE EXISTING .GIF FILES gif2png HAS OPTION TO LEAVE OLD FILE TOO , SO man gif2png docs to find out... ===================================================================== And Finally , this is the html I am using so far. I would like to get to adding more controls sometime like clicky single frame arrows to reverse or forward animation But here it is so far: ----- cat > anim_images-20110504.html animated_images-20110423
Animated Fronts   (images from wunderground.com)
0
end
Set Image Loop Range - Start: Stop:

About this map:
This map shows the current radar, frontal boundaries, and areas of high and low pressure for the United States. Cold fronts are depicted in blue, warm fronts in red, and stationary fronts in alternating blue and red. Occluded fronts are depicted in purple. Front positions are updated every 3 hours. Areas of constant pressure are bound by white contour lines and show changes from high to low pressure. The key below the image corresponds to the radar.

http://www.wunderground.com/maps/
===================================================================== Ok so there it is! Try it out and let me know if it works for you too!