Page 1 of 2

"pause" in 6.6.6-10

Posted: 2011-06-17T10:39:58-07:00
by viper-2
Hello there,

I noticed that with IM 6.3.7.9 (that came with my Debian Lenny) "-loop x" just wouldn't work. The resulting animated gif, built using "convert" cycled indefinitely.

I then uninstalled IM 6.3.7.9 and built 6.6.6-10 from source. But this latest release seems to have issues. Among them, gifs built with loops display ok, but then I get "segmentation fault" when the animation ends.

What is worse, when trying to build an animated gif using "pause", "convert" fails and I get the error:

convert: unrecognized option '-pause' @ error/convert.c/ConvertImageCommand/2177.

"convert -list" indicates that "pause" is indeed absent!!

I only need the animation to run through one loop, but since "-loop 1" ends with a segfault, I thought I'd terminate the animation with "pause". What's happened to "pause" in 6.6.6-10?

Will animated gifs built with "pause" from earlier versions also have issues with 6.6.6-10? (I'll try this out too myself).

Thanks

agt

Freedom - no pane, all gaiGN!

Code Art Now
http://codeartnow.com
Email: agt@codeartnow.com

Re: "pause" in 6.6.6-10

Posted: 2011-06-17T11:13:54-07:00
by fmw42
pause is for showing the animation not building it, if I am not mistaken. Here is from the options page:

-pause seconds

Pause between animation loops. [animate]
Pause for the specified number of seconds before repeating the animation.

Note the red [animate] means that it is for the animate function.

what is your exact command line for building the animation? perhaps there was a bug in your 6.6.6.10 version. try upgrading to IM 6.7.0.8?

convert -delay 20 image1 image2 image3 ... imageN -loop 1 result.gif

for example, this works just fine for me making it loop once when played in my browser:


convert -delay 40 zelda3.jpg lena2.jpg mandril.jpg -loop 1 test_animation.gif

Re: "pause" in 6.6.6-10

Posted: 2011-06-17T12:19:43-07:00
by viper-2
fmw42 wrote:pause is for showing the animation not building it, if I am not mistaken. Here is from the options page:
hmm, found an example at linux.com using pause in the "convert command line to build the gif.
fmw42 wrote:what is your exact command line for building the animation? perhaps there was a bug in your 6.6.6.10 version. try upgrading to IM 6.7.0.8?
convert -delay 100 splash7-900.png splash7-576.png -loop 1 test.gif

Again, I got "Segmentation fault" after the animation ran.

agt

Re: "pause" in 6.6.6-10

Posted: 2011-06-17T12:41:13-07:00
by fmw42
convert -delay 100 splash7-900.png splash7-576.png -loop 1 test.gif
This looks fine. How did you play it -- with what application?

You might try upgrading IM. Perhaps it has been corrupted in some way?

If you post links to your two images, I can test with them. Perhaps there is something wrong with the images.

Re: "pause" in 6.6.6-10

Posted: 2011-06-17T13:47:22-07:00
by viper-2
fmw42 wrote:This looks fine. How did you play it -- with what application?
Here's the thing. I wrote an application which uses IM to load a pseudo splash screen. I can load the splash screen with several images and animate, or alternatively with display and one animated gif. The screen consists of a successive display of images of diminishing sizes, each corresponding to a particular screen resolution that a user might have.

With the animate option, if the first images are larger than the screen resolution, the smaller images become surrounded by a gray background, which I suppose is the canvas size of the largest image. The display option +animated gif is much simpler. Not only do I not get the ugly background that animate gives, but I need only set one variable for the gif.

Because the application will have users with various versions of IM, I can't have a solution that may produce a segfault - as display currently does when the gif is built with loop on 6.6.6-10. Is there anyway to get rid of the gray background round the smaller images when using animate?
fmw42 wrote:If you post links to your two images, I can test with them. Perhaps there is something wrong with the images.
I created the images with Inkscape. I also found that displaying with IM 6.6.6-10 actually removed parts of the image (but not with IM 6.3.7.9), even when I used convert to make jpg's or static gif's. But I found that the IM displays were fine after using Inkscape itself to convert the svg's to png's. I could post a link to samples, but I'd rather make new images as the package has not yet been released.

Apologies, I'm a bit of a newbie to graphics packages. Thank you fmw42!

agt

Freedom - no pane, all gaiGN!

Code Art Now
http://codeartnow.com
Email: agt@codeartnow.com

Re: "pause" in 6.6.6-10

Posted: 2011-06-17T14:11:49-07:00
by fmw42
I ran

animate test_animation.gif

with the animation I created above with -loop 1 and it worked fine on my Mac OSX Tiger.

Here is the animation. See if it segfaults for you.

http://www.fmwconcepts.com/misc_tests/t ... mation.gif

Re: "pause" in 6.6.6-10

Posted: 2011-06-17T14:55:12-07:00
by viper-2
No, there's no segfault with your file, and guess what - there's none with mine either when I use

animate animated.gif

instead of

display animated.gif

Thank you!!

Also, with animate, each successive file overlays the previous one, you see them all and there is no grey. But with display, the canvas size shrinks with the image, I see only the current image surrounded by the desktop. I think I was getting the grey with display in my earlier version of IM.

Now is there any way to get animate to behave so you don't get successively overlaid images?

agt

Freedom - no pane, all gaiGN!

Code Art Now
http://codeartnow.com
Email: agt@codeartnow.com

Re: "pause" in 6.6.6-10

Posted: 2011-06-17T15:02:43-07:00
by viper-2
fmw42,

I do get "Segmentation fault" when I display your file, though:

display test_animation.gif

agt

Freedom - no pane, all gaiGN!

Code Art Now
http://codeartnow.com
Email: agt@codeartnow.com

Re: "pause" in 6.6.6-10

Posted: 2011-06-17T15:47:31-07:00
by fmw42
Well then I would say it has to do with your version of IM, if you get a seg fault when using animate test_animation.gif or display test_animation.gif, since it works fine in my version, though with display, after it finishes the image disappears and I have to cancel the display. What happens when you use animate test_animation.gif rather than display test_animation.gif?

I would suggest you install the latest IM and try again. Do you have more than one version of IM installed? If so that could cause problems.

Re: "pause" in 6.6.6-10

Posted: 2011-06-17T16:06:37-07:00
by viper-2
fmw42 wrote:Well then I would say it has to do with your version of IM, if you get a seg fault when using animate test_animation.gif or display test_animation.gif, since it works fine in my version, though with display, after it finishes the image disappears and I have to cancel the display. What happens when you use animate test_animation.gif rather than display test_animation.gif?
I don't have to cancel the display. Both invocations terminate on their own.The only differences are that I get a segfault with display, and display plays the file longer than animate.
fmw42 wrote:I would suggest you install the latest IM and try again. Do you have more than one version of IM installed? If so that could cause problems.
I thought that having multiple versions might be the cause of the problem, but I uninstalled both then reinstalled one and got the same problems. In any case, I need the solution I choose to work for any version of IM, including 6.6.6-10.

But back to my earlier question, is there any way for animate to clear the canvas in-between frames the same way display does - so I don't get overlaid images?

agt

Freedom - no pane, all gaiGN!

Code Art Now
http://codeartnow.com
Email: agt@codeartnow.com

Re: "pause" in 6.6.6-10

Posted: 2011-06-17T16:21:05-07:00
by fmw42
If there is a bug in a given version of IM, then you will not be able to have it work for every version.

With regard to animate, I don't have that problem with my test_animate.gif (or any animation) on my Mac, so I have no idea what to suggest to you. Perhaps it is your version of X11? Have you tried to update that?

Perhaps Anthony will have more suggestions when he gets online. He knows more about animations and IM than I do.

Re: "pause" in 6.6.6-10

Posted: 2011-06-17T18:27:34-07:00
by viper-2
fmw42 wrote:If there is a bug in a given version of IM, then you will not be able to have it work for every version.

With regard to animate, I don't have that problem with my test_animate.gif (or any animation) on my Mac, so I have no idea what to suggest to you. Perhaps it is your version of X11? Have you tried to update that?
By "that problem" are you referring to animate's failure to clear the canvas leaving overlaid images? In any case, some users of my package are likely to have old X vers. too. Debian Lenny has older packages. Next time I upgrade I'll make sure not to choose the "stable" version.
fmw42 wrote:Perhaps Anthony will have more suggestions when he gets online. He knows more about animations and IM than I do.
Yes, building gifs with a buggy version might give problems. I'll download 6.7.0.8 as you suggested, is this what you're using? Because you have to manually cancel display - isn't that a bug too?!

Here's a link to the kind of animation I've been referring to, with each successive frame being smaller. I get all 3 images overlaid with animate, while with display each image disappears leaving a grey background:
<https://sites.google.com/site/codeartno ... ects=0&d=1>

This one gives more trouble than the others with display, though. I not only get the grey, but I get a backtrace in the terminal. I generated the composite png images directly from Gnuplot. With the Inkscape images I mentioned earlier, only the first layer was an imported png from Gnuplot. After creating the other layers, I then used Inkscape to convert the resulting svg to png.

Thank you Fmw42!

agt

Freedom - no pane, all gaiGN!

Code Art Now
http://codeartnow.com
Email: agt@codeartnow.com

Re: "pause" in 6.6.6-10

Posted: 2011-06-17T20:21:25-07:00
by fmw42
Because you have to manually cancel display - isn't that a bug too?!
No, on the mac, display leaves the image up when a single image until you cancel out. With the gif animation, the image went away, but I had to cancel to get control of the terminal again. With animate, it finished cleanly and gave me back control.
Here's a link to the kind of animation I've been referring to, with each successive frame being smaller. I get all 3 images overlaid with animate, while with display each image disappears leaving a grey background:
<https://sites.google.com/site/codeartno ... ects=0&d=1>
It displays the same way in my browser leaving each frame behind the next one. So I would say it has to do with how you created the animation, in particular the frame disposal method.

See
http://www.imagemagick.org/Usage/anim_basics/
http://www.imagemagick.org/Usage/anim_opt/
http://www.imagemagick.org/Usage/anim_mods/

If you separate the frames:

convert signals.gif signals_%d.gif

you will see they are the same size, but the smaller ones are padded with black.


I am not sure this is the best or most efficient way to correct this (as I am not an expert on animations), but this seems to work:

convert -background none -dispose background -delay 50 signals.gif -coalesce -fuzz 10% -transparent black -loop 0 signals_new.gif

Re: "pause" in 6.6.6-10

Posted: 2011-06-17T23:52:27-07:00
by anthony
First Display is NOT designed to handle an animation.
It will NOT handle any of the special disposal methods, and generally gives at a minimum 2 seconds between frames (by default). It is meant to display either a single image, or at most a series of completely separate images.

Animate is the ONLY thing the should handle a animation with correct timings, the same virtual canvas size, and the gif disposal method. The only extra it has on top of this is -pause (animate only) to add an additional pause before looping back to the start (if that is allowed).

Both display and animate can als obe remote controlled, as demonstrated by the scripts
http://www.imagemagick.org/Usage/script ... show_morph
http://www.imagemagick.org/Usage/scripts/slideshow_next
Which were my attempts at an animation displaying one static image, while generating (on the fly) a morph to a new image, which it then animates before replacing the animation with a new static image.

Now I have see "display" segmentation fault, but only while piping some images into the program, typically as part of some other problem I have been working on. I have however never been sure if that was caused by the problem being looked at or display itself.

So we get down to specific cases, and for that you need to play with the very latest version 6.7.0-8.

NOTE I have never looked into the programming behind display. As such when you have a specific case report it on the bugs forum (Completely as a the specific test case).

Re: "pause" in 6.6.6-10

Posted: 2011-06-18T08:32:56-07:00
by viper-2
anthony wrote:First Display is NOT designed to handle an animation.
...
So we get down to specific cases, and for that you need to play with the very latest version 6.7.0-8.
Thank you, I didn't realise that one really needs animate to display an animated gif. I'll install 6.7.0-8 as you suggested.

agt

Freedom - no pane, all gaiGN!

Code Art Now
http://codeartnow.com
Email: agt@codeartnow.com