Account Links: Cart | Your Account | Logout

Skip to content

Red Hat Knowledgebase

Red Hat Knowledgebase Search:

Updated Within the Last:

New Solutions within the last day New Solutions within the last week New Solutions within the last month

Browse by topics:


Click to View a Topic
Red Hat Enterprise Linux > AS/ES/WS Basics > Issue <<  822 of 909 >>

Solution Tools:


Email a Solution Postcard Printer version Submit a comment on this answer Update notifications Request an answer Back

Article Reference

Article ID: 12533
Last update: 10-30-08
Issue:
How do I resize multiple image files using command-line tools?
Resolution:

Image file size depends on the amount of image details it has. The higher the image quality, the better the resolution but the larger the resulting file size. Web galleries tend to load very slow and sometimes inaccessbile if photos have very high resolutions.

The mogrify command allows users to resize multiple image files at once. mogrify comes with the ImageMagick package. ImageMagick is a program used to resize, rotate, manipulate and display images. It can read, convert and write images in JPEG, TIFF, PNM, GIF and other Photo CD image formats.

Check if the ImageMagick package is installed:

rpm -q ImageMagick

To install the ImageMagick package on Red Hat Enterprise Linux 3 or 4, use the up2date command:

up2date ImageMagick

On Red Hat Enterprise Linux 5, use the yum command:

yum install ImageMagick

After installing ImageMagick package, use mogrify to resize multiple image files. See example command below in resizing all JPG photos in the current working directory to 640 pixels in width while maintaining its original aspect ratio:

mogrify -resize 640 *.jpg

To resize the resolution of all JPG image files to exactly 640 pixels in width and 480 pixels in height, use:

mogrify -resize 640x480! *.jpg


How well did this entry answer your question?


good wrong incomplete out of date
Red Hat Enterprise Linux > AS/ES/WS Basics > Issue <<   822  of  909  >>