Play with Images on Linux!

Find the info about an image
#identify abc.jpg

Resize an image
#mogrify -resize 800X600 file.jpg

Convert an image from one formate to other format
#mogrify -format png test.jpg

How to reduce the size of an image
#mogrify -quality 80% surendra.jpg
This will reduce the size of the image file by reducing its quality

To reduce image file size big time!
#mogrify -resize 800X600 -quality 80% *jpg

More interesting Image Editing tips with Imagemagick

Create thumbnails using this command:
#mogrify -geometry 120×120 *.jpg

Rotate an Image using this command
#mogrify -rotate “-90” test.jpg
Reduce Colours of any given image using this command
#mogrify -colors 2 test.jpg

Monochrome the given image using this command
#mogrify -monochrome test.jpg

Add Borders to given image using this command
#mogrify -border 2×4 test.jpg

Add Annotate to Image using this command
#mogrify -comment ‘My holiday highlight’ test.jpg

Add some more Decorative Border using this command
#mogrify -frame 20×20 test.jpeg

Text annotations
#convert flower.jpg -font courier -fill white -pointsize 20 -annotate +50+50 ‘Flower’ flower_annotate1.jpg
Example (text with background at bottom):
#convert flower.jpg -fill white -box ‘#00770080’ -gravity South -pointsize 20 -annotate +0+5 ‘ Flower ‘ flower_annotate2.jpg

Rotate an image
#convert flower.jpg -rotate 45 flower_rotate45.jpg

Animation
This consist a series of commands to form a gif image as follows
#convert flower.jpg -resize 100×100 -font courier -fill white -pointsize 20 -annotate +50+50 ‘Frame 1’ flower_frame1.gif
#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

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s