PDA

View Full Version : batch resolution change of jpegs


jessika-kaos
May 12th, 2008, 12:30 PM
I have a few directories each with several thousand jpegs (at 3264 x 2448 pixels) that I would like to reduce to maybe half resolution. Is there a command line program that could do this for all pictures in the directory in one go? If so, how?

rax_m
May 12th, 2008, 02:24 PM
Hi Jessika

It is possible, in fact one of the members of this forum designed a GUI application called "Phatch". Search for it on these forums and there'll be a link to the download.

Regards
Rax

jessika-kaos
May 12th, 2008, 02:40 PM
Cool, thanks!

dangermouse28
May 14th, 2008, 07:19 AM
Google for nautilus scripts - one of them does re-sizing of multiple images. Then you just right-click, scripts, re-size images, bang in the size you want and you're all done!

lessthanjake
May 17th, 2008, 05:36 AM
Just use Imagemagick, it is perfect for tasks like this:



sudo apt-get install imagemagick
cd image_folder
mkdir resized
for f in *jpg
do
convert -resize 50% $f resized/$f
done

or you can make it a bit more fancy, with a script:


#!/bin/bash

types="*jpg *png"

mkdir resized

files=`ls $types 2> /dev/null`
n=`echo $files |wc -w`
i=0

for f in $files
do
i=$[i+1]
printf "[$i/$n] $f"
convert -resize 50% $f resized/$f
printf "\r"
done
echo