Convert and resize images using imagemagick
Tags convert, imagemagick
This past memorial day weekend I took a bunch of pictures which I wanted to post to the web. Web photos are best viewed in 800x600px and I had a lot of them. So I used a simple command to do it.
Now I don't have to spend all my time in Gimp with that simple batch command.
Code:
for x in `ls -1`;do convert -resize 800x600 $x `echo $x | sed 's/.JPG/.png/'`;done mkdir web_album for x in `ls -1 *.png`;do convert $x web_album/`echo $x | sed 's/.png/.jpg/'`;done rm *.png
Total Comments 1
Comments
-
Just resized pictures 25% smaller and used a better way to change extensions which I outlined in this thread.
Code:for x in *.JPG;do convert -resize 25% $x processed/${x%.JPG}.jpg;done
Posted 03-03-2012 at 05:28 PM by sag47
Updated 03-03-2012 at 05:32 PM by sag47