Page 1 of 1

imagemagick can't add watermark to gif animation

Posted: 2013-05-09T17:42:13-07:00
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 ?

Re: imagemagick can't add watermark to gif animation

Posted: 2013-05-09T18:07:45-07:00
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

Re: imagemagick can't add watermark to gif animation

Posted: 2013-05-09T20:37:31-07:00
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

Re: imagemagick can't add watermark to gif animation

Posted: 2013-05-09T20:53:53-07:00
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.

Re: imagemagick can't add watermark to gif animation

Posted: 2013-05-10T00:22:54-07:00
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