Support Forum Project Downloads FAQ Documentation About Demo Tutorials Blog Plugins

Tag Archive for 'linux-commands'

Batch resize using ImageMagick

One of the most common task I perform before uploading photos in my coppermine gallery is resizing all pictures to a more internet friendly size.

Over the period of time I have found ImageMagick to be very useful when it comes to manipulating images. Below are the commands commonly used for resizing images.

To resize all images in current directory to 800 width (height will be reduced proportionately) :

mogrify -resize 800 *.jpg

Resize all images to 800 height (width will be reduced proportionately)

mogrify -resize x800 *.jpg

Resize all images to a maximum dimension of 800×800. This means that max of width and height will be considered while resizing :

mogrify -resize 800×800 *.jpg

Reduce the size of images to the percent of original :

mogrify -resize 75% *.jpg

Note that in all above commands the original file will be replaced with the new one. Also the examples given above uses only jpg files but you can surely do it with other image formats as well.