Gif Image is not animated after making watermark

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Gif Image is not animated after making watermark

Post by fmw42 »

found these references to -layers composite in the changelog --- for reference to when introduced and a bug fix


2011-04-14 6.6.9-5 Anthony Thyssen <A.Thyssen@griffith...>
Layers Composition Bug Fix, animations attributes of first image not transferred in a single destination, multi-source image composition.



2007-04-06 6.3.3-6 Anthony <anthony@griffith...>
Addition of a CompositeImages() "layer.c" function to compose two separate image lists together (with a virtual canvas offset) in three different ways, depending on the size of the lists.
A 'hack' for command line use (the two lists separates by the special "NULL" image, which is junked) has also been added. Specifically... "-layers Composite".
psanjib
Posts: 20
Joined: 2014-02-04T23:03:41-07:00
Authentication code: 6789

Re: Gif Image is not animated after making watermark

Post by psanjib »

Last question i want to set the water mark image in buttom right corner using gravity please let me know how could i use
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Gif Image is not animated after making watermark

Post by Bonzo »

So this thread can be helpful to other people: How did you fix your problem?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Gif Image is not animated after making watermark

Post by fmw42 »

psanjib wrote:Last question i want to set the water mark image in buttom right corner using gravity please let me know how could i use
see -gravity at http://www.imagemagick.org/script/comma ... hp#gravity

Code: Select all

convert h8Hjm.gif null: WFr1K.png  -gravity southeast -layers composite -layers optimize animation.gif
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Gif Image is not animated after making watermark

Post by fmw42 »

Bonzo wrote:So this thread can be helpful to other people: How did you fix your problem?
He linked to the more current version of IM that his ISP provided. He was using the wrong version of IM from his ISP
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Gif Image is not animated after making watermark

Post by Bonzo »

He linked to the more current version of IM that his ISP provided. He was using the wrong version of IM from his ISP
I had assumed that but it annoys me that the OP has not said how the problem was fixed and then proceeds onto another question.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Gif Image is not animated after making watermark

Post by fmw42 »

Bonzo wrote:
He linked to the more current version of IM that his ISP provided. He was using the wrong version of IM from his ISP
I had assumed that but it annoys me that the OP has not said how the problem was fixed and then proceeds onto another question.
I only know because he sent me a PM.
psanjib
Posts: 20
Joined: 2014-02-04T23:03:41-07:00
Authentication code: 6789

Re: Gif Image is not animated after making watermark

Post by psanjib »

Sorry for late replay

i was not available, my ISP provider installed image magic version 6.2.8 and 6.8.8 in different path. 6.2.8 in current directory and 6.8.8 in another path. by using the below command

Code: Select all

exec("/usr/local/bin/convert -version 2>&1",$out,$returnval);

and

Code: Select all

exec("convert -version 2>&1",$out,$returnval);
i came to know that there are two image magic version installed.

i used the full path of image magic then that works fine see the below code

Code: Select all

exec("/usr/local/bin/convert http://gif-king.com/test/$file null: WFr1K.png -gravity West -layers composite -layers optimize ../animation123.gif 2>&1",$out,$returnval);
Finally i solved this problem because of your great support.

Thanks Sanjib
thomanphan
Posts: 6
Joined: 2014-03-15T10:00:07-07:00
Authentication code: 6789

Re: Gif Image is not animated after making watermark

Post by thomanphan »

I have error when add watermark,some gif error when add watermark
This is source
Image
and after add watermark
Image

I'm using this code

Code: Select all

$cmd = "$input -coalesce -gravity South " .
            " -geometry +0+0 null: $watermark -layers composite -layers optimize ";

    exec("convert $cmd $output ");
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Gif Image is not animated after making watermark

Post by fmw42 »

$cmd = "$input -coalesce -gravity South " .
" -geometry +0+0 null: $watermark -layers composite -layers optimize ";
Try

$cmd = "$input -coalesce null: $watermark -gravity South " .
" -geometry +0+0 -layers composite -layers optimize ";

If that does not work, then post a link to your watermark image, so others can test.

Also in the future, it would be best to start a new topic rather than tack onto an old post.

Also what is your IM version and platform.


This command works fine for me on IM 6.8.8.8 Q16 Mac OSX


convert tfinrZy.gif -coalesce null: sphinx.gif -gravity South -geometry +0+0 -layers composite -layers optimize anim.gif

using your input image and the following watermark image

Image
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Gif Image is not animated after making watermark

Post by snibgo »

@thomanphan: Your command works fine for me, IM v6.8.8-7 on Windows 8.1. If your version of IM is old, I suggest you upgrade.
snibgo's IM pages: im.snibgo.com
thomanphan
Posts: 6
Joined: 2014-03-15T10:00:07-07:00
Authentication code: 6789

Re: Gif Image is not animated after making watermark

Post by thomanphan »

Hi
Thanks for reply, I'm using Imagick in cpanel (Imagick is a native php extension to create and modify images using the ImageMagick API).
I have try your code and watermark but same problem.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Gif Image is not animated after making watermark

Post by fmw42 »

thomanphan wrote:Hi
Thanks for reply, I'm using Imagick in cpanel (Imagick is a native php extension to create and modify images using the ImageMagick API).
I have try your code and watermark but same problem.
What version of Imagemagick is liked to Imagick?

Check your PHP installation via the phpinfo.php file. I suspect it is an old version of IM. You may have to ask your ISP to upgrade Imagemagick (not Imagick).
thomanphan
Posts: 6
Joined: 2014-03-15T10:00:07-07:00
Authentication code: 6789

Re: Gif Image is not animated after making watermark

Post by thomanphan »

root@rs02 [~]# /usr/bin/convert --version
Version: ImageMagick 6.8.3-9 2013-10-15 Q16 http://www.imagemagick.org
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Gif Image is not animated after making watermark

Post by snibgo »

Running your command with IM v6.8.4-0 shows the same bad results. So does fmw42's variation of the command. I suggest you upgrade to the current version.
snibgo's IM pages: im.snibgo.com
Post Reply