Skip to content

Instantly share code, notes, and snippets.

@sven-bock
Created January 26, 2018 16:04
Show Gist options
  • Save sven-bock/cdb6cbcee5eed945d68c26d3a3ab1ac1 to your computer and use it in GitHub Desktop.
Save sven-bock/cdb6cbcee5eed945d68c26d3a3ab1ac1 to your computer and use it in GitHub Desktop.
Convert, animate images in command line using function from image magick
#Convert the format of one image
convert source.pgm target.png
#Convert all images format of one type into another
# e.g. png is the target format
# e.g. all pgm images starting with "source" are converted
mogrify -format png source*.pgm
#Convert multiple images to one animated image
# e.g. takes all pgm images in the folder to create one animated gif. Verify that the images are numbered in ascending order.
# e.g. sample01.pgm, sample02.pgm, .... (not: sample9.pgm, sample10.pgm)
convert -delay 120 -loop 0 *.pgm animated.gif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment