5 ImageMagick command line examples – part 1
If you have ever wanted to manipulate images under linux you probably have usedGimp. This isn't your only option and if you want to do things from the command line a better option is to use ImageMagick's convert utility.
I've put together 5 simple command line examples that I have found useful. This is just a sample of what you can do with convert. To see more examples and get more explanation of options see: ImageMagick v6 Examples.
I started with the following image as a base for all the examples that follow:
1. Text annotations
Example (simple text in static location):
Produces:
Example (text with background at bottom):
Produces:
Look at these examples to see more.
2. Cropping an image
Example:
Produces:
Look at these examples or -crop for more information.
3. Rotate an image
Example:
Produces:
Look at these examples or -rotate for more information.
4. Image montage
Example:
Produces:
Look at these examples to see more.
5. Animation
Example:
convert flower.jpg -resize 100×100 -font courier -fill white -pointsize 20 -annotate +50+50 'Frame 2' flower_frame2.gif
convert flower.jpg -resize 100×100 -font courier -fill white -pointsize 20 -annotate +50+50 'Frame 3' flower_frame3.gif
convert flower.jpg -resize 100×100 -font courier -fill white -pointsize 20 -annotate +50+50 'Frame 4' flower_frame4.gif
convert -delay 100 -size 100×100 \
-page +0+0 flower_frame1.gif \
-page +0+0 flower_frame2.gif \
-page +0+0 flower_frame3.gif \
-page +0+0 flower_frame4.gif \
-loop 0 flower_animation.gif
Produces:
Look at these examples, these examples, or these examples for more information.
Summary
That is it for now. Part 2 should be up soon.
No comments:
Post a Comment