Stupid blending question....
Stupid blending question....
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
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....
Is morph what what you are looking for ?
This is some php code and only uses two images as I wanted to keep the file short.
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....
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
I'd still like to know why my example didn't do what I expected, though. Any thoughts?
Marc
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Stupid blending question....
I think you want to remove -alpha set. That just turns on transparency and probably messes up the blend.
Re: Stupid blending question....
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
Marc
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Stupid blending question....
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
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....
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
Yeah... I don't think composite can be used within a convert, since it is its own program.
Thanks again,
Marc
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Stupid blending question....
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
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
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Stupid blending question....
if interested, see my scripts fxtransitions, shapemorph and transitions