Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Computer Forums > Programmers Lounge > Programming Discussions » Animations in PHP or Linux
Closed Thread
Old 07-24-2007, 08:16 PM   #1 (permalink)
 
Monster Techie

Join Date: May 2004

Location: Tucson, AZ, USA

Posts: 1,183

Vormund

Send a message via AIM to Vormund Send a message via MSN to Vormund Send a message via Yahoo to Vormund
Default Animations in PHP or Linux

Does anyone know of an easy way to compile a bunch of JPG's into a GIF animation - either via PHP or any linux utilities?
__________________
Vormund is offline  
Old 07-25-2007, 02:20 AM   #2 (permalink)
Greg's Avatar
 
Indeed.

Join Date: Dec 2004

Posts: 1,554

Greg is on a distinguished road

Default Re: Animations in PHP or Linux

First convert the JPGs into sequentially named GIFs, and then you can use
Code:
convert -adjoin -delay 5 *.gif animation-name.gif
(the convert command is part of imagemagick)

Making a BASH script to do this would be pretty easy if you're going to want to do this multiple times.
__________________
Greg is offline  
Old 07-25-2007, 04:21 PM   #3 (permalink)
 
Monster Techie

Join Date: May 2004

Location: Tucson, AZ, USA

Posts: 1,183

Vormund

Send a message via AIM to Vormund Send a message via MSN to Vormund Send a message via Yahoo to Vormund
Default Re: Animations in PHP or Linux

Quote:
Originally Posted by Greg View Post
First convert the JPGs into sequentially named GIFs, and then you can use
Code:
convert -adjoin -delay 5 *.gif animation-name.gif
(the convert command is part of imagemagick)

Making a BASH script to do this would be pretty easy if you're going to want to do this multiple times.
ImageMagick ... perfect. I tried that once before under Windows, but could never get it working quite right - the animation would either be garbled images or the delay was always...minutes apart. Gotta give it a try on nix, the OS it was meant for. Danke.
__________________
Vormund is offline  
Old 08-01-2007, 11:53 AM   #4 (permalink)
Slim420's Avatar
 
Newb Techie

Join Date: Jul 2007

Location: America

Posts: 18

Slim420 is on a distinguished road

Default Re: Animations in PHP or Linux

When using GIMP you can specify the delay times I believe.
Slim420 is offline  
Old 08-01-2007, 05:20 PM   #5 (permalink)
 
Monster Techie

Join Date: May 2004

Location: Tucson, AZ, USA

Posts: 1,183

Vormund

Send a message via AIM to Vormund Send a message via MSN to Vormund Send a message via Yahoo to Vormund
Default Re: Animations in PHP or Linux

I'm having trouble getting nix up on my laptop (the wireless annoyance), so I'm just running Debian in the VM right now. I don't think GIMP has the ability to do it from the command line, but ImageMagick should as after he mentioned that, I remembered trying to use it on Windows long ago...
__________________
Vormund is offline  
Old 08-01-2007, 07:48 PM   #6 (permalink)
Slim420's Avatar
 
Newb Techie

Join Date: Jul 2007

Location: America

Posts: 18

Slim420 is on a distinguished road

Default Re: Animations in PHP or Linux

Huh.....interesting. I've never thought of running it from a command-line :freak:. I guess the thought of working with graphics always involved a graphical user-interface. That's very interesting. It's funny when you assume that theres no other way of doing it when such a (not-so-)simple solution lies right there! How does it work for you? Do you have to pass all of the arguments (like effects, animations, whatever) on the command-line with the image location?
Slim420 is offline  
Old 08-01-2007, 08:21 PM   #7 (permalink)
 
Monster Techie

Join Date: May 2004

Location: Tucson, AZ, USA

Posts: 1,183

Vormund

Send a message via AIM to Vormund Send a message via MSN to Vormund Send a message via Yahoo to Vormund
Default Re: Animations in PHP or Linux

That's the plan!

I don't know the exact arguments, but it's something like...

compileGIF <delay> <loop quantity> <img1, img2, img3...>

I still have to get it running myself, but the reason behind it is semi funny - the university has a cam on a taller building here, snapping a pic every minute. I have my server pulling the images, but want to have a time-lapsed version - something like the last hour or two, see what the weather is really doing...:laughing:
__________________

Last edited by Vormund; 08-01-2007 at 08:42 PM.
Vormund is offline  
Old 08-02-2007, 05:28 PM   #8 (permalink)
Slim420's Avatar
 
Newb Techie

Join Date: Jul 2007

Location: America

Posts: 18

Slim420 is on a distinguished road

Default Re: Animations in PHP or Linux

Oh!!! So you are trying to take 120 images and make a 10 second .gif?? All by command line!!! That's hardcore man! If you want some help, zip up the files and i'll help with a little point and click if I can.
Slim420 is offline  
Old 08-03-2007, 01:00 AM   #9 (permalink)
Greg's Avatar
 
Indeed.

Join Date: Dec 2004

Posts: 1,554

Greg is on a distinguished road

Default Re: Animations in PHP or Linux

Lots of times doing things with the command line is much more efficient than using a GUI, and this is one of those cases.
__________________
Greg is offline  
Old 08-03-2007, 07:33 PM   #10 (permalink)
 
Monster Techie

Join Date: May 2004

Location: Tucson, AZ, USA

Posts: 1,183

Vormund

Send a message via AIM to Vormund Send a message via MSN to Vormund Send a message via Yahoo to Vormund
Talking Re: Animations in PHP or Linux

Quote:
Originally Posted by Greg View Post
Lots of times doing things with the command line is much more efficient than using a GUI, and this is one of those cases.
Funny comment there...as I actually wrote a small AutoIt script to launch Flash and make a very simple/fast animation...more for concept, but yeah. :laughing:

Re your comments, Slim420, I honestly have since dumped my cache of images...need to rerun the script, which hopefully I'll get started on this weekend (have to put the script on my new server, and find a place to call it every 60 seconds, hah! I need a wget cronjob placed on a nix server...after I find a nix server!)... but once that's done, they'll all be in a public directory on my server if you wanted to play, too. :rolleyes:

This is the specific cam. image I was/am talking about, for those curious:
Arizona Webcam

As the page mentions, it's updated (and automatically refreshed) every minute. Nice for a time-lapsed animation...!

The experience from playing with Linux is superb, although, I wish I could get the wireless working on the laptop!
__________________
Vormund is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Free Online Linux Courses Osiris Linux, BSD, other *nixes & Open Source Software 3 06-11-2007 05:54 PM
Ten things a Linux Fanboy will not tell you… Osiris Linux, BSD, other *nixes & Open Source Software 18 05-16-2007 06:06 PM
Dell to finally ship PCs with Linux Osiris Linux, BSD, other *nixes & Open Source Software 7 05-13-2007 04:54 AM
New Linux user Blog. Saxon Linux, BSD, other *nixes & Open Source Software 0 04-25-2007 12:30 PM
Remote file access w/ IP + PHP? thejeremy Programming Discussions 2 04-04-2007 05:24 PM