Search code examples
imagemagickmogrify

Generate thumbnails for only the first frame of animated gif with mogrify


How to modify this code so mogrify will generate thumbnails only for the first frame of animated gifs?:

mogrify -resize 80x80 -background white -gravity center -extent 80x80 -format jpg -quality 75 -path thumbnails *.gif

Solution

  • The select frame notation would be [N] immediately after the filename; where N is the frame number you wish to select. See Selecting Frames section under the input filename examples.

    mogrify -resize 80x80 \
            -background white \
            -gravity center \
            -extent 80x80 \
            -format jpg \
            -quality 75 \
            -path thumbnails \
            *.gif[0]