On Tue, 6 Jan 2015, Steve Engledow wrote:
On 05/01, Chris Green wrote:
Is there any simple, automated way I can shrink the pictures? I don't want to have to specify a size for every one of them, I just want to shrink them to a 'reasonable' size.
I can fairly easily add a command (or two) to my script that does the copy, e.g. an ImageMagick 'convert' but how to set the amount of shrinkage?
It depends what you're after.
You can resize by percentage:
convert in.jpg -resize 50% out.jpg
You can resize to a particular size but only if the image is larger than that already:
convert in.jpg -resize 800x600> out.jpg
Or you can resize so that the image has a certain area in pixels:
convert in.jpg -resize 480000@ out.jpg
This is a [handy link](http://www.imagemagick.org/Usage/resize/).
Steve
Imagemagick I have found excellent as the quickest for batch resizing and watermark. I don't use convert though - I use mogrify. Perhaps convert does them as pixel size... haven't got the book handy to check.
# batch resize mogrify -resize 50% *.jpg
#date watermark mogrify -font /usr/share/fonts/truetype/msttcorefonts/Arial.ttf \ -pointsize 20 -gravity southeast \ -fill black -annotate +10+10 '04May2014' \ -fill white -annotate +11+11 '04May2014' \ *.jpg
james