Page 1 of 1

Stupid blending question....

Posted: 2009-11-15T14:30:59-07:00
by marclallen
Hi, guys... new to IM, trying to create a blending animation...

The basic command I'm using is:

convert -delay 100 a.png -alpha off -alpha set
\( -clone 0 b.png -alpha off -alpha set -compose blend -set "option:compose:args" 0 -composite \)
\( -clone 0 b.png -alpha off -alpha set -compose blend -set "option:compose:args" 20 -composite \)
\( -clone 0 b.png -alpha off -alpha set -compose blend -set "option:compose:args" 40 -composite \)
\( -clone 0 b.png -alpha off -alpha set -compose blend -set "option:compose:args" 60 -composite \)
\( -clone 0 b.png -alpha off -alpha set -compose blend -set "option:compose:args" 80 -composite \)
\( -clone 0 b.png -alpha off -alpha set -compose blend -set "option:compose:args" 100 -composite \)
-delete 0 -loop 0 -layers Optimize test2.gif

It's supposed to take a.png and transition to b.png over six total images. What I get are six identical images with a.png and b.png merged, each at 100%.

So, two questions:

1) Obviously, I'm missing something stupid. But, what?
2) Is there a better/easier way for me to accomplish the task?

I'd like answers to both questions, if possible, so I can learn where I went wrong as well as any better methods.

Thanks,

Marc

Re: Stupid blending question....

Posted: 2009-11-15T14:46:02-07:00
by Bonzo
Is morph what what you are looking for ?
Image

This is some php code and only uses two images as I wanted to keep the file short.

Code: Select all

$cmd = "morph/path.jpg morph/view.jpg -morph 12";
exec("convert $cmd morph.gif");
 

Re: Stupid blending question....

Posted: 2009-11-15T14:57:33-07:00
by marclallen
Whoa! That's exactly what I want. Thanks so much.

I'd still like to know why my example didn't do what I expected, though. Any thoughts?

Marc

Re: Stupid blending question....

Posted: 2009-11-15T15:22:42-07:00
by fmw42
I think you want to remove -alpha set. That just turns on transparency and probably messes up the blend.

Re: Stupid blending question....

Posted: 2009-11-15T17:02:46-07:00
by marclallen
I wish. I tried it all possible ways. No luck. Originally, I didn't have any alpha commands, so that seemed like an obvious candidate. No alpha channel, no blend transparency. I ended up with what you see because "-alpha opaque" didn't register... it might be newish, and I have 6.3.something.

Marc

Re: Stupid blending question....

Posted: 2009-11-15T17:07:56-07:00
by fmw42
you need 6.5.3-4 to use -set with convert -blend

use composite -blend if older than this version, in general, but I don't think it works within parentheses

see

http://www.imagemagick.org/Usage/compose/#blend
http://www.imagemagick.org/script/comma ... hp#compose

Re: Stupid blending question....

Posted: 2009-11-15T17:24:29-07:00
by marclallen
Ah! I thought that might be it. I looked, but did not find any comment to that effect. The author is usually pretty good about that.

Yeah... I don't think composite can be used within a convert, since it is its own program.

Thanks again,

Marc

Re: Stupid blending question....

Posted: 2009-11-15T18:10:24-07:00
by fmw42
from http://www.imagemagick.org/script/comma ... hp#compose

As of IM v6.5.3-4 the "convert" command can now also supply these extra arguments to its -composite operator, using the special -set attribute of 'option:compose:args'. This means you can now make use of these special argumented -compose methods, those the argument and the method both need to be set separatally

Re: Stupid blending question....

Posted: 2009-11-15T21:05:58-07:00
by marclallen
Thanks!

Marc

Re: Stupid blending question....

Posted: 2009-11-15T21:55:13-07:00
by fmw42
if interested, see my scripts fxtransitions, shapemorph and transitions