Saturday, April 17, 2010

ImageMagick resize Image

ImageMagick has some pretty cool commandline tools to manage images. Specifically I wanted to resize an image (make it smaller).

Code:

convert -resize 50% -quality 80 input.jpg output.jpg

You can change resize to a pixel size also: 800x600. Pretty handy and quick. Update: You can resize/recompress and entire directory of images using find and xargs. This works good if you need to resize an entire directory/camera full of images to save space.
Code:

find . -iname "*.jpg" | xargs -l -i convert -quality 75 {} /tmp/output/{}

No comments:

Post a Comment