imagemagick can't add watermark to gif animation

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
ladyimm
Posts: 2
Joined: 2013-05-09T17:38:00-07:00
Authentication code: 6789

imagemagick can't add watermark to gif animation

Post by ladyimm »

Hi all,
I'm using freebsd and php to deal with images. Below is the imagemagick compile parameter

Code: Select all

 │ │ [x] 16BIT_PIXEL  16bit pixel support                                     │ │
 │ │ [ ] BZIP2        bzip2 compression support                               │ │
 │ │ [ ] DJVU         DJVU format support (needs THREADS)                     │ │
 │ │ [ ] DOCS         Build and/or install documentation                      │ │
 │ │ [ ] FFTW         Discrete Fourier Transform support                      │ │
 │ │ [ ] FONTCONFIG   X11 font configuration support                          │ │
 │ │ [ ] FPX          FlashPix image format support                           │ │
 │ │ [ ] FREETYPE     TrueType font rendering support                         │ │
 │ │ [ ] GRAPHVIZ     Graphviz support                                        │ │
 │ │ [ ] GSLIB        libgs (Postscript SHLIB) support                        │ │
 │ │ [x] HDRI         High dynamic range images support                       │ │
 │ │ [ ] JASPER       JPEG 2000 support via JasPer                            │ │
 │ │ [ ] JBIG         JBIG image format support                               │ │
 │ │ [x] JPEG         JPEG image format support                               │ │
 │ │ [ ] LCMS2        LCMS2 support                                           │ │
 │ │ [ ] LQR          Liquid Rescale support                                  │ │
 │ │ [ ] LZMA         LZMA compression support                                │ │
 │ │ [x] MODULES      Modules support                                         │ │
 │ │ [ ] OPENEXR      HDR image format support via OpenEXR                    │ │
 │ │ [ ] OPENMP       Parallel processing support via OpenMP                  │ │
 │ │ [ ] PANGO        Pango rendering library support                         │ │
 │ │ [ ] PDF          PDF document support                                    │ │
 │ │ [ ] PERL         Perl scripting language support                         │ │
 │ │ [x] PNG          PNG image format support                                │ │
 │ │ [ ] SVG          SVG vector image format support                         │ │
 │ │ [ ] TESTS        Run bundled self-tests after build                      │ │
 │ │ [x] THREADS      Threading support                                       │ │
 │ │ [ ] TIFF         TIFF image format support                               │ │
 │ │ [ ] WEBP         WebP image format support                               │ │
 │ │ [ ] WMF          Windows Metafile support                                │ │
 │ └──────────────────────────────────────────────────────────────────────────┘ │
And I found that if I try to use imagemagick to add a watermark to a gif animation. The output file only contains the the first frame of the gif animation.
Did I miss any module? Anyone can help ?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: imagemagick can't add watermark to gif animation

Post by fmw42 »

You have not given us your command line. Perhaps you are not doing it correctly. See http://www.imagemagick.org/Usage/anim_m ... mpose_draw and the rest of that page
ladyimm
Posts: 2
Joined: 2013-05-09T17:38:00-07:00
Authentication code: 6789

Re: imagemagick can't add watermark to gif animation

Post by ladyimm »

fmw42 wrote:You have not given us your command line. Perhaps you are not doing it correctly. See http://www.imagemagick.org/Usage/anim_m ... mpose_draw and the rest of that page
Hi, I'm using the building function of a php application. If I use php-gd, then everything is OK. I believe that the problem I met is caused by imagemagick
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: imagemagick can't add watermark to gif animation

Post by fmw42 »

Can you provide a command line example that fails. Otherwise, it might be a php issue. Can you get it to work with PHP exec()?

It is really hard to advise you without seeing some code and being able to replicate the problem.
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: imagemagick can't add watermark to gif animation

Post by Bonzo »

Code: Select all

<?php  
$animation = $input16; 

$watermark = $input15; 

$watermarked_animation = "morph.gif"; 

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

exec("convert $cmd $watermarked_animation "); 
 ?> 
Image
Post Reply