Last active
October 11, 2015 02:38
-
-
Save madeingnecca/3790060 to your computer and use it in GitHub Desktop.
IMAGEMAGICK utils
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Convert a list of pngs to an animated gif. | |
convert -delay 20 -loop 0 *.png animation.gif | |
# Resize image | |
convert image.jpg -resize 150x image_resized.jpg | |
# Resize and crop to size. | |
# Note: specify the smallest dimension in -resize. | |
convert image.jpg -resize x300 -gravity center -crop 400x300+0+0 image_resized_and_cropped.jpg | |
# Resize jpg in directory | |
# cd "$dir" | |
for p in $(ls "$dir"| grep jpg); do | |
convert "$p" -resize 150x "$dir"/resized/"$p" | |
done | |
# Converts an image so it can be used as the screenshot of a Drupal theme. | |
function drupal_theme_screenshot { | |
convert "$1" -resize x219 -gravity center -crop 294x219+0+0 screenshot.png | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment