Reposition gif

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
agriz
Posts: 237
Joined: 2011-10-01T02:21:30-07:00
Authentication code: 8675308

Reposition gif

Post by agriz »

Code: Select all

convert -size 500x500 xc:none  \( -page +100+100 mouse.gif \) null: \( -page +0+0 mouse.gif \) -layers composite -loop 0 output.gif
Image

The images are overlapped.
If i change the code a bit,
one animates and other becomes static
Or There is a blink between animations.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Reposition gif

Post by fmw42 »

try adding -coalesce right before null:
agriz
Posts: 237
Joined: 2011-10-01T02:21:30-07:00
Authentication code: 8675308

Re: Reposition gif

Post by agriz »

I was trying -coalesce inside the parenthesis. It is working. But there is a frame missing when the animation repeat.
In usage, "You can do that by either, Coalescing the above animation, then deleting the Zero Delay Background frame, OR Layer Composite the original animation onto a Static Background"

I have used layer composite. But it is still doing that blink.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Reposition gif

Post by fmw42 »

What is your layers composite full command line? If that does not work, then try the other solution
User avatar
GeeMack
Posts: 718
Joined: 2015-12-01T22:09:46-07:00
Authentication code: 1151
Location: Central Illinois, USA

Re: Reposition gif

Post by GeeMack »

agriz wrote:I have used layer composite. But it is still doing that blink.
You might try putting "-background none" near the beginning of your command and "-set dispose background" near the end.
agriz
Posts: 237
Joined: 2011-10-01T02:21:30-07:00
Authentication code: 8675308

Re: Reposition gif

Post by agriz »

It is not working for me.

Added background none or background transparent after xc:none and -set dispose background before -layers.
agriz
Posts: 237
Joined: 2011-10-01T02:21:30-07:00
Authentication code: 8675308

Re: Reposition gif

Post by agriz »

I am not able to find the error.

Code: Select all

exec("/usr/bin/convert -size 500x500 xc:none -background transparent  \( -page +100+100 mouse.gif \) -coalesce null: \( -page +0+0 mouse.gif \) -set dispose background -layers composite -loop 0 output.gif 2>&1", $output, $return);

//always return "-1073740791" for $return. Empty array for $output.

exec("/usr/bin/convert -size 500x500 xc:none  \( -page +100+100 mouse.gif \) -coalesce null: \( -page +0+0 mouse.gif \) -layers composite -loop 0 output.gif 2>&1", $output, $return);

//once for every five run, return "-1073740791" for $return. Empty array for $output.
And instead of -size 500x500 xc:none, -size 500x500 xc:skyblue, the mouse is jumping on a white background and transparent background in different frames.
Post Reply