stockton wrote:Using the following command [...] Please help me fix this.
Building an animated GIF from more than one set of other animated GIFs can be tricky, but if you follow along, I think we can help you understand how it's done.
In a comment in your other thread one of the experts here, snibgo, mentioned an operator called "-coalesce". It looks like that might help you here. One or both of your animated GIFs has been optimized, and "-coalesce" will turn them back into sets of complete images to use further along in the command.
Another issue you're dealing with here is one of your overlay animated GIFs has 8 frames, and the other has 24 frames. You can find this with a simple command like...
So your final image will require 24 frames, the 8 frame image being repeated 3 times. (You're lucky the numbers divide so evenly, otherwise it would require applying some more complicated math.)
Start by bringing in your background image "lcars_screen_1b.png", which is a single frame.
Then bring in the "null:" built-in we used in your other project. Remember that's to separate the two groups of images so the "-layers composite" can alternate between using one from the group
before the "null:" and using one from
after it.
Next bring in the 24 frame animated GIF "lcars_anim2.gif" and "-coalesce" the frames to make them all complete images. So far the command, not yet complete, looks like this...
Code: Select all
convert \
lcars_screen_1b.png \
null: \
-delay 15 \
\( lcars_anim2.gif -coalesce \) \
...
Now you specify the geometry which will determine the location of the "lcars_anim2.gif" frames as they get composited onto the "lcars_screen_1b.png" image, then apply the operator "-layers composite". After that the image stack contains 24 frames, each one is the background image with a single frame from the first animated GIF.
At this point in the command it's like you're just starting with a 24 frame animated GIF, so... Put another "null:" image in there to separate those first 24 images from what will come after. And after that you'll bring in the "fwscan.gif" animated GIF,
but remember it has only 8 frames, so you have to bring it in 3 times to match the number of frames you have before the "null:" separator. Apply the "-coalesce" operator to those 24 frames, too. Your command isn't complete yet. You're up to here...
Code: Select all
convert \
lcars_screen_1b.png \
null: \
-delay 15 \
\( lcars_anim2.gif -coalesce \) \
-geometry +150+210 \
-layers composite \
null: \
\( fwscan.gif fwscan.gif fwscan.gif -coalesce \) \
...
Keeping those groups of images separated in parentheses isn't always necessary, but sometimes it helps us keep track of what the command is actually doing. And in some cases, it is absolutely required.
Now you have the background with 24 frames of your first GIF overlaid onto it, and you've brought in your second GIF and made it into 24 frames. Specify the geometry for compositing those on the background, and "-layers composite" them onto it.
Finish by compressing the whole thing with "-layers optimize" which tries to reduce the output file size by eliminating the parts that are duplicated from frame to frame throughout the animation.
Give it an output file name, and you're done!
Code: Select all
convert \
lcars_screen_1b.png \
null: \
-delay 15 \
\( lcars_anim2.gif -coalesce \) \
-geometry +150+210 \
-layers composite \
null: \
\( fwscan.gif fwscan.gif fwscan.gif -coalesce \) \
-geometry +550+280 \
-layers composite \
-layers optimize \
sensors.gif
I use Windows not *nix. I'm pretty sure those backslashes "\" are where they need to be to make this command work. If they're not exactly correct, maybe someone else can explain what you need to do to get it right.