Menu

#20 How to fight watermark GIF file

v1.0_(example)
closed
nobody
5
2016-04-23
2014-12-08
JOY
No

How to fight watermark GIF file?
I use:
gm composite -gravity SouthEast -dissolve 50 -quality 88.0 logo.png 1.gif 2.gif

But I found that only the first frame of the watermark.

Discussion

  • Glenn Randers-Pehrson

    Your commandline seems to work for me. The syntax for "composite" is

    gm composite [options] changefile basefile outputfile

    so you'd only get one output (2.gif) which is the change file (logo.png) dissolved onto the lower left corner of the input (1.gif).

    In this context, the "-quality 88.0" option is ignored (the GIF encoder does not use it), so you should omit it (but if you were writing JPEG, then "-quality 88" (not 88.0) would be useful).

    If you were expecting your command to work like "mogrify" (overlaying logo.png on both 1.gif and 2.gif), you could do this:

    for x in 1.gif 2.gif
    do
    gm composite -gravity SouthEast -dissolve 50 logo.png $x $x
    done
    
     

    Last edit: Glenn Randers-Pehrson 2014-12-08
  • JOY

    JOY - 2014-12-10

    Thank you for your help.
    If I want each frame of 2.gif has a watermark, what should I do.

     
  • Glenn Randers-Pehrson

    To watermark each frame of an animated GIF, try

    gm convert -coalesce +adjoin 1.gif frame%04d.gif
    for x in frame*.gif
    do
      gm composite -gravity SouthEast -dissolve 50 logo.png $x $x
    done
    gm convert -deconstruct frame*.gif 2.gif
    

    This splits your 1.gif into individual files frame0000.gif,
    frame0001.gif, etc., watermarks each with logo.png, and then
    reassembles them into a new animation (2.gif). I don't know
    if it's the most efficient method, but it does work for me.

     
  • Bob Friesenhahn

    Bob Friesenhahn - 2016-04-23
    • status: open --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB