Converting a few JPG-s to GIF with some effects

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
damaty

Converting a few JPG-s to GIF with some effects

Post by damaty »

Hello!
I'm writing a programm for audio-machines and need to play a slideshow when karaoke is playing.
I have about 10 .jpg pictures and need to get an animated GIF (from console).
Can I do something near:
1. 1.jpg is displayed for 10sec
2. 1.jpg is transforming to 2.jpg with some effects for 2 sec
3. 2.jpg is disaplyed for 10sec
...
n. 9.jpg is transforming to 1.jpg

I tried this "convert -morph 1 1.jpg 2.jpg". And it's work, but too fast, and not delay.
Now write "convert -morph 100 1.jpg 2.jpg"... too much time xD
And is there other effects?
It's would be great if you help me ;]

( Sorry for my english ^_^ )
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Converting a few JPG-s to GIF with some effects

Post by fmw42 »

use the command line to generate your gif animation from each frame with the effect you want and with a specified -delay for each and end with -loop 0. then just display the animation. I don't think you can create such in the display in real time. But I will defer to the experts.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Converting a few JPG-s to GIF with some effects

Post by anthony »

The animation you want is explained in
Im Examples, GIF Animation Modification
http://www.imagemagick.org/Usage/anim_mods/#morph

however Fred provides many other techniques of changing images...
See his "Transitions" script
http://www.fmwconcepts.com/imagemagick/transitions/

however as Fred mentioned, IM is not designed for real time output.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Converting a few JPG-s to GIF with some effects

Post by fmw42 »

actually what I meant was that I did not think you could do an animation from the console in real time, if at all. But Anthony can explain what you can and cannot do in the (interactive X ImageMagick console or whatever it is called).
damaty

Re: Converting a few JPG-s to GIF with some effects

Post by damaty »

I don't convert images in real time, I planned to convert it when it has been added to base, before the main application is started.

Anyway, I did it.
thx2all.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Converting a few JPG-s to GIF with some effects

Post by anthony »

I have been thinking about real-time or on-the-fly image transitions.

that is you have an image displayed, you pick a new image, generate a morph or transition to the new image, display the morph then display the new image.
  • This would have to be done using "animate" to get the sequence right.
  • "Animate" can use a -remote option to say, change the currently displayed animate window.
  • You do NOT have to use GIF file formats (with its 256 color limits) for the animation, but can use "MIFF" for the file format (no color limits).
In this regard I created shell script to select at random a image from the list given, and display it, then in a loop select a new (different) image at random, and morph to that new image, and repeat.

See http://www.imagemagick.org/Usage/script ... show_morph

It works! However the timing can be tricky as currently their is no way to get "animate" to just stop on the last image without looping. As result timing can cause problems.

Also the script has found a memory leak accocisted with using -remote. I have now reported this (and other faults).

NOTE the transition does not have to be morph, but can be a wipe, or even a gradient controlled wipe ,or even a mottle color morph, such as provided by Fred Wienhaus's transitions script (see link in previous posts above).
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply