geometry defines the dimensions of each individual image in the montage and the spacing around it - in this case 250px by 250x with 5px spacing on either side. tile specifies how many columns and rows the montage should have. Generate a grid from a folder of images gm montage -tile 5x5 -geometry 250x250+ 5+ 5 *.jpg grid.jpg delay defines the delay between each frame of the animation in milliseconds. GM will convert pretty much any image file into anything you could think of - the list of supported file types is impressive Create an animated gif from a folder of images gm convert -delay 100 *.jpg animation.gif Here's some more examples: Convert a folder of images to a different format gm mogrify -output-directory output -format png *.jpg This gm structure remains largely the same regardless of which command you're using. *.jpg defines the source images we're working with - in this case any JPG image in the current folder.If you want to resize an image to exact dimensions (and possibly strech it in the process) use -resize 400x200! (with and exclamation mark). GM will resize each image so that it fits within those dimensions - so the resized images will be at most 400px wide and at most 200px tall. -resize 400x200 is what triggers the actual resizing.create-directories tells gm to create the output directory if it doesn't exist yet. If we didn't do this, gm would overwrite the source files. -output-directory your-output-folder specifies a folder where gm will save the resized images.Next, we'll pass a number of arguments to mogrify that tell it exactly what to do. mogrify is the command we're using - it handles scaling, resizing and other basic transformations. If everything is set up correctly you should see the following result: > gmĬopyright (C ) 2002-2016 GraphicsMagick Group.Īnd you're good to go! Here's some examples of things to do: Resize a folder of images gm mogrify -output-directory your-output-folder -create-directories -resize 400x200 *.jpg Once the setup is complete, open a new command line and type gm (short for Graphicsmagick). On Windows grab the latest version from the project website and follow the instructions. Once you've got it set up, run the following command to install Graphicsmagick: brew install graphicsmagick Homebrew is a command-line app that makes it easier to install other command-line apps. On a Mac the easiest way to install Graphicsmagick is through Homebrew. The Windows command-line is fundamentally the same thing as the Mac OS X command-line - you'll figure it out pretty quickly.) Let's install Graphicsmagick (If you're on Windows like myself, read the Treehouse article anyway. Once you read that you'll be ready to follow along with the rest of the article. Jim Hoskins has a very good introduction to the Mac OS X Command Line on Treehouse. If not, stick around - it's really not that hard to use. If you're already comfortable with the command-line skip right ahead. I'll keep using Lightroom for more advanced photo editing, but for the simple stuff Graphicsmagick is great. GraphicsMagick does things like rotate, scale and convert images just as well, but with a much smaller footprint. This is easy enough to do in Lightroom, but it feels icky to fire up a massive piece of software just for one simple task.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |