Page 1 of 1

composite

Posted: 2013-04-07T04:28:39-07:00
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!

Re: composite

Posted: 2013-04-07T10:57:21-07:00
by fmw42
can you provide your input images?

see
http://www.imagemagick.org/Usage/anim_mods/#glitter

Re: composite

Posted: 2013-04-07T14:19:06-07:00
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.

Re: composite

Posted: 2013-04-07T14:34:20-07:00
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.

Re: composite

Posted: 2013-04-07T15:19:35-07:00
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.

Re: composite

Posted: 2013-04-07T16:09:09-07:00
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/

Re: composite

Posted: 2013-04-07T16:29:49-07:00
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!

Re: composite

Posted: 2013-04-07T16:42:42-07:00
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/

Re: composite

Posted: 2013-04-07T17:57:59-07:00
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!

Re: composite

Posted: 2013-04-07T18:48:20-07:00
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.