Editing (resizing, format converting, compressing) images in the command line with ImageMagick (mogrify, convert)
First published May 23, 2007 • Last modified on July 18, 2026 • 1 min read • 183 wordsResize all tif images in the current directory:mogrify -resize 25% 25% .tifResize all jpeg images in the current directory to a width of 614 pixels and keep the image ratio constant:mogrify -resize 614 .jpgAs above, but resize the hight to 614 pixels:mogrify -resize x614 .jpgConvert all bmp imgaes in the current directory into tiff images:mogrify -format tiff .bmpCompress all tiff images in the current directory with ZIP compression:mogrify -compress ZIP .tiffI tried to convert also pict files (from Macintosh), but without success, although the pict file format appears to be supported by Imagemagick.
mogrify -resize 25% 25% *.tifResize all jpeg images in the current directory to a width of 614 pixels and keep the image ratio constant:mogrify -resize 614 *.jpgAs above, but resize the hight to 614 pixels:mogrify -resize x614 *.jpgConvert all bmp imgaes in the current directory into tiff images:mogrify -format tiff *.bmpCompress all tiff images in the current directory with ZIP compression:mogrify -compress ZIP *.tiffI tried to convert also pict files (from Macintosh), but without success, although the pict file format appears to be supported by Imagemagick. In order to make sure that ImageMagick knows that the file to convert is a pict file I used this command:convert pict:Photo0024.PICT tiff:Photo0002.tifThere is also a picttoppm utility in the netpbm package, but it was not anymore included in the version that Suse 9 uses; so I couldn’t check that out…Interestingly PixiePlus can display pict files, where does it take the routines from?If you have very large images, the default limits of ImageMagick are resulting in an error(e.g. mogrify-im6.q16: width or height exceeds limit) and you need to edit /etc/ImageMagick-6/policy.xml!