Hi,
I use in my script for add the watermark this:
#Adding watermark
exec('composite -gravity SouthEast images/logo-watermark.png '.$imagesurse2.' '.$imagesurse2);
but this dont work with gif animation
what i must add or change for work with gif animation?
Regards.
Add watermark on gif animation
Re: Add watermark on gif animation
I have only tried this once and used:
Code: Select all
<?php
$animation = "morph.gif";
$watermark = "output.png";
$watermarked_animation = "morph.gif";
exec("convert -resize 100x200 $animation -coalesce -gravity South -geometry +0+0 null: $watermark -layers composite -layers optimize $watermarked_animation ");
?>
The gif only loops once if you refresh the page it should loop again.
Re: Add watermark on gif animation
Thanks bonzo!!
I use it for the png and gif, this work good but when the file is created, the file have bad quality, why?
I use it for the png and gif, this work good but when the file is created, the file have bad quality, why?
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Add watermark on gif animation
WARNING:
read and coalesce the animation BEFORE using -resize.
See IM examples, Animation Modifications, Resize
http://www.imagemagick.org/Usage/anim_mods/#resize
If you don't and your animation has any form of optimization such as 'frame' or 'transparency', then it will go screwy!!! It only worked in your case as your 'morphed' animation is already a coalesced animation.
See Animation Types. Also look at Animation Optimizations, to get an idea of what these optimizations are
read and coalesce the animation BEFORE using -resize.
See IM examples, Animation Modifications, Resize
http://www.imagemagick.org/Usage/anim_mods/#resize
If you don't and your animation has any form of optimization such as 'frame' or 'transparency', then it will go screwy!!! It only worked in your case as your 'morphed' animation is already a coalesced animation.
See Animation Types. Also look at Animation Optimizations, to get an idea of what these optimizations are
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: Add watermark on gif animation
Thanks Anthony,
I use:
exec("convert $imagesurse2 -coalesce -gravity SouthEast -geometry +0+0 null: images/logo-watermark.png -layers composite -layers optimize $imagesurse2 ");
but i use this code for gif animation and for NO gif animations too, because i have this code the last file that generate all the images...
how can i change the code for get good quality for the files gif and not gif...
Thanks for the help!! this forum is great!!
Regards.
I use:
exec("convert $imagesurse2 -coalesce -gravity SouthEast -geometry +0+0 null: images/logo-watermark.png -layers composite -layers optimize $imagesurse2 ");
but i use this code for gif animation and for NO gif animations too, because i have this code the last file that generate all the images...
how can i change the code for get good quality for the files gif and not gif...
Thanks for the help!! this forum is great!!
Regards.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Add watermark on gif animation
The actions for GIF animations should not effect a single GIF file, unless you specifically
modify GIF animation attributes, such as -loop or -delay
You should be able to use the same command no problem.
modify GIF animation attributes, such as -loop or -delay
You should be able to use the same command no problem.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: Add watermark on gif animation
Thanks for the warning Anthony; I must have just been lucky with the original file format as you said!