A friend of mine sent me a lot of pictures in .ARW format one week ago. Now I need to convert them to .jpg so, to do it in one step, I’ve written a short bash script I show here. Before execute the script, you have to install two utilities, imagemagick (contains “convert”) and dcraw. You can do it this way for instance:
#apt-get install imagemagick
#apt-get install dcraw
The script I’ve called it raw2jpg, you can see it below:
—————————————–
#raw2jpg.sh april 2008
#Converts .raw files to .jpg
#Must be installed dcraw and convert utilities before run this program.
#Jorge Muñoz Rodenas <jorgeroden1@gmail.com> Albacete (Spain)
#bash script licensed under GPL v3.0
echo Step 1 of 3: .arw to .ppm conversion, wait...
for file in *.ARW; do
dcraw $file
done
echo Step 2 of 3: .ppm to .jpg conversion, wait...
for file in *.ppm ; do
convert $file ${file/.ppm/%d.jpg}
done
echo Step 3 of 3: Deleting .ppm files, wait...
rm *.ppm
echo done!
———————————-
You can copy this script in your work directory and it will convert all .ARW files to jpg by typing
$./arw2jpg.sh
I hope this script be useful for you.
regards