RE: using TPad->Print() to create animated GIF

From: Olivier Couet <Olivier.Couet_at_cern.ch>
Date: Mon, 20 Jul 2009 16:43:01 +0200


Hi,

Yes, animated gif are usually meant to be visualized in a web browser. I pointed out the example in $ROOTSYS because I could not tell with the information you gave if, what you were doing on the ROOT side, was correct.

Cheers,

O.Couet  

From: owner-roottalk_at_root.cern.ch [mailto:owner-roottalk_at_root.cern.ch] On Behalf Of Neil Fazel
Sent: Monday, July 20, 2009 4:39 PM
To: Olivier Couet; James Jackson
Cc: roottalk_at_root.cern.ch
Subject: Re: [ROOT] using TPad->Print() to create animated GIF  

Thanks for the example.  

Somebody else pointed out that Mac Preview might not display animated GIF files and suggested I load the file in a browser instead. I tried that, and it worked.  

It turns out that I can also open the animated GIF file in Mac Preview, and view the individual pictures using View->Drawer. There is no animation, but all the pictures are listed and one can use the arrow keys to traverse them, i.e. some sort of manual animation.  

Neil  

On Jul 20, 2009, at 9:15 AM, Olivier Couet wrote:

See the example:

$ROOTSYS/tutorials/image/hsumanim.C  

From: owner-roottalk_at_root.cern.ch [mailto:owner-roottalk_at_root.cern.ch] On Behalf Of Neil Fazel
Sent: Monday, July 20, 2009 4:13 PM
To: roottalk_at_root.cern.ch
Subject: [ROOT] using TPad->Print() to create animated GIF  

I've been trying to create an animated GIF file using the Print() function of TPad class:  

void Print <http://root.cern.ch/root/html/src/TPad.cxx.html#ySpbRE> (const char* filename, Option_t
<http://root.cern.ch/root/html/ListOfTypes.html#Option_t> * option)
 

 Save Pad
<http://root.cern.ch/root/html/TVirtualPad.html#TVirtualPad:Pad>
contents in a file in one of various formats.  

   if option = 0 - as "ps"

            <snip>

               "gif" - a GIF file is produced

               "gif+NN" - an animated GIF file is produced, where NN is delay in 10ms units

            <snip>    

I do something like this:  

mycanvases->Print("./out/animated.gif+50");  

A .gif file is indeed created, but when I view it in Mac Preview, I only see the first picture saved, without animation. What am I missing here?  

Thanks,

Neil     Received on Mon Jul 20 2009 - 16:43:06 CEST

This archive was generated by hypermail 2.2.0 : Mon Jul 20 2009 - 23:50:01 CEST