Posts Tagged imagemagick
ImageMagick from the command line
ImageMagick is such a cool and powerful tool to manipulate images, it’s a real shame if you don’t make use of it during your web design or photo album creation. From resizing, compositing and converting all types of file types, it’s list of usability cases is endless. It’s free and available for almost every operating system.
If you don’t have it on your system yet, here is the imagemagick download location. You might also have it in your repository, check your package manager as it might be as simple as calling “sudo apt-get install imagemagick” (on Ubuntu) or “sudo yum install imagemagick” (on Red Hat/CentOs).
Here is a small compilation of command-line tools (by no means a complete list). The list of available commands is actually sheer endless, you’ll be amazed by how powerful this application is.
imagemagick resize
convert image.gif -resize 128×128 resized_image.gif
imagemagick crop
convert image.gif -crop 240×360 cropped-image.gif (add’l params for crop location: 240×360+10+10)
imagemagick rotate
convert image.gif -rotate 90 rotated-image.gif
imagemagick mirror
convert image.gif -flop mirrored-image.gif
There are many more, actually way too many to list them all here. Have a look at the official ImageMagick usage page for a complete list of image manipulation actions.
Auto Create Thumnails The Easy Way
Ever wondered it there is an easy way to resize your images or quickly create thumbnails from your favorite pictures?
Search no more, the awesome little utility ImageMagick does it for you.
Install it using your package manager, most of them should have it in their repository.
sudo apt-get install imagemagick
Once installed, this command will create tumbnails for all JPG’s in the current directory, 200 pixel wide/high on the longest side. Eg. if your image is in landscape layout, it’ll be 200 pixel wide, in portrait format it’ll be 200 pixel high.
for file in *.jpg ; do convert -resize 200 “$file” t”$file”; done
That’s it. Simply change 200 to the size of your liking, or change the extension if your images are in gif, png or any other image format.