Skip to content

Instantly share code, notes, and snippets.

@TommyPKeane
Created February 22, 2023 20:23
Show Gist options
  • Save TommyPKeane/065655c115e1bdb2f9cacf11ad5eff06 to your computer and use it in GitHub Desktop.
Save TommyPKeane/065655c115e1bdb2f9cacf11ad5eff06 to your computer and use it in GitHub Desktop.
imagemagick Utilities' Syntax and Examples in bash for commandline Image Conversion, Creation, and Parsing (https://imagemagick.org/Usage/)
# Create Multiscale ICO Image (filename.ico) from a given JPEG Image (filename.jpg)
convert -background transparent filename.jpg -define icon:auto-resize=16,24,32,48,64,72,96,128,256 filename.ico
# Convert MP4 Animated Video (animated.mp4) to Animated GIF (filename.gif)
convert filename.mp4 filename.gif
# Convert MP4 Animated Video (animated.mp4) to Animated GIF (filename.gif)
# with size restriction to width of 300 [px] while preserving aspect-ratio
# (Note that re-scaling may degrade quality)
convert -resize 300x filename.mp4 filename.gif
# Convert MP4 Animated Video (animated.mp4) to Animated GIF (filename.gif)
# with size restriction to height of 240 [px] while preserving aspect-ratio
# (Note that re-scaling may degrade quality)
convert -resize x240 filename.mp4 filename.gif
@TommyPKeane
Copy link
Author

See more discussion and examples related to this gist on my personal website: https://www.tommypkeane.com/articles/bash/imagemagick.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment