composite

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
phobos
Posts: 13
Joined: 2013-04-07T03:07:18-07:00
Authentication code: 6789

composite

Post by phobos »

Hello!
please tell me how to add an animated GIF with a transparent background over the static (or animated) images?
1. size of static and animated images are the same (fill animated glitter stars with transparent background all photo).
2. Animated less static images, and animation in the lower right corner
(animated watermark above static(or animated) picture)

I tried a lot of things, but nothing seems to work properly :(

Code: Select all

convert $photo  -coalesce  -gravity SouthEast   \
            null: $watermark  -layers composite  \
            -layers optimize $anim_watermarked_photo
Could someone help me with this?
thanks!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: composite

Post by fmw42 »

can you provide your input images?

see
http://www.imagemagick.org/Usage/anim_mods/#glitter
phobos
Posts: 13
Joined: 2013-04-07T03:07:18-07:00
Authentication code: 6789

Re: composite

Post by phobos »

fmw42 wrote:can you provide your input images?

see
http://www.imagemagick.org/Usage/anim_mods/#glitter
sorry, i try..
I study all imagemagitsk first week, he was very interested in me, but so far not quite understand his command line options.

so i have
1. static picture https://dl.dropbox.com/u/57057313/my/wh.jpg
2. animated picture with transparent background https://dl.dropbox.com/u/57057313/my/82.gif
i need this :
https://dl.dropbox.com/u/57057313/my/pic_1.avi


and i have
1. https://dl.dropbox.com/u/57057313/my/wh.jpg
2. https://dl.dropbox.com/u/57057313/my/starport_e0.gif
and i need this:
https://dl.dropbox.com/u/57057313/my/pic_2.avi

sorry it is video rec from web page, because i dont know how to unite two pictures in one GIF.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: composite

Post by fmw42 »

1. size of static and animated images are the same
I cannot view your avi images. I do not have a player that supports that, only Quicktime. And my browser won't play it either. Perhaps you need some Windows user to help you.

Your animation image is not the same size as the jpg. You must create an animation (glitter or face) that is the same size as the jpg if you want it to fill the transparent area. Furthermore jpg does not support transparency, so it must be convert so that black is transparent and save to png.
phobos
Posts: 13
Joined: 2013-04-07T03:07:18-07:00
Authentication code: 6789

Re: composite

Post by phobos »

fmw42 wrote:
1. size of static and animated images are the same
I cannot view your avi images. I do not have a player that supports that, only Quicktime. And my browser won't play it either. Perhaps you need some Windows user to help you.

Your animation image is not the same size as the jpg. You must create an animation (glitter or face) that is the same size as the jpg if you want it to fill the transparent area. Furthermore jpg does not support transparency, so it must be convert so that black is transparent and save to png.
sorry, video compressed with xvid mpeg4 codec
try in flv format
https://dl.dropbox.com/u/57057313/my2/pic_1.flv
https://dl.dropbox.com/u/57057313/my2/pic_2.flv
i know what jpg not support transparent.

1.i need just put small animated gif (animated watermark,animated logo or animated emoticon with transparent background) above some other big picture (jpg, png, animated gif) in any coordinates.
2. i need for example fill with transparent stars all place of some big static photo .
3. and i want learn how to horizontal(or vertical) move animated picture (for example emoticon) with speed 20 pixels/sec from left to right side(or in other direction) of static picture.
if imagemagick support moves one pic over other pic.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: composite

Post by fmw42 »

OK. I downloaded an extension for QT for avi/divx. Let me look at it now.

For the first one, try this

convert wh.jpg null: \( 82.gif -coalesce -resize 200% \) -gravity center -geometry +0-230 -layers composite -layers optimize result1.gif

on windows remove the \ and use %%, see http://www.imagemagick.org/Usage/windows/
phobos
Posts: 13
Joined: 2013-04-07T03:07:18-07:00
Authentication code: 6789

Re: composite

Post by phobos »

fmw42 wrote:OK. I downloaded an extension for QT for avi/divx. Let me look at it now.
https://dl.dropbox.com/u/57057313/my2/p ... .42%5D.jpg
https://dl.dropbox.com/u/57057313/my2/p ... .45%5D.jpg
its snapshots.
seeing all the great features imagemagick I know that my task is very simple,
I just do not know how to write a right command lines.
tried many times different options, but sometimes receive only the first frame of the animation, sometimes owerwrite pictures, sometimes I get the error 1 and 127, but it did not work properly. :(
thank you!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: composite

Post by fmw42 »

For the first one:

convert wh.jpg null: \( 82.gif -coalesce -resize 200% \) -gravity center -geometry +0-230 -layers composite -layers optimize result1.gif

see
http://www.imagemagick.org/script/comma ... hp?#layers
http://www.imagemagick.org/Usage/anim_mods/#background


For the second one:

convert wh.jpg null: \( starport_e0.gif -coalesce -virtual-pixel tile -set option:distort:viewport 400x600 -distort SRT 0 \) -layers composite -layers optimize result2.gif

see http://www.imagemagick.org/Usage/anim_m ... tter_tiles

on Windows remove the \ and use %%, see http://www.imagemagick.org/Usage/windows/
phobos
Posts: 13
Joined: 2013-04-07T03:07:18-07:00
Authentication code: 6789

Re: composite

Post by phobos »

fmw42 wrote:For the first one:

convert wh.jpg null: \( 82.gif -coalesce -resize 200% \) -gravity center -geometry +0-230 -layers composite -layers optimize result1.gif

see
http://www.imagemagick.org/script/comma ... hp?#layers
http://www.imagemagick.org/Usage/anim_mods/#background


For the second one:

convert wh.jpg null: \( starport_e0.gif -coalesce -virtual-pixel tile -set option:distort:viewport 400x600 -distort SRT 0 \) -layers composite -layers optimize result2.gif

see http://www.imagemagick.org/Usage/anim_m ... tter_tiles

on Windows remove the \ and use %%, see http://www.imagemagick.org/Usage/windows/
YeesS!
it s work very good!
https://dl.dropbox.com/u/57057313/my/result2.gif
https://dl.dropbox.com/u/57057313/my/result1.gif
very thank you fmw42!
but work good in web hosting, local server (denwer+windows) always return code 1 (with / or with %%)
web server return code 2 with %%
im go to read http://www.imagemagick.org/Usage/windows/ :)
thank you!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: composite

Post by fmw42 »

Web servers are usually Unix. So you need the unix syntax. Also if you are using PHP exec, you need to be careful of quoting.
Post Reply