Shrink or enlarge images at the command line

GIMP can do just about anything to an image but it can be time-consuming to fire it up just to resize an image. For ultra-quick manipulation, consider Imagemagick, a command-line image manipulation program. It doesn’t come installed by default and you’ll need to install it via Synaptic (search for and install imagemagick). Once installed, the convert command should be used with the addition of the -resize command option.

For example, the following will shrink filename.bmp to half its original size:

$ convert -resize 50% filename.bmp filename_small.bmp
The following will enlarge filename.bmp to twice its original size (although there will be an obvious degradation in quality):

$ convert -resize 200% filename.bmp filename_larger.bmp


Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s