I need to convert a lot of CR2 photos to either JPG or PNG, no editing. How to do this?
you can convert
.jpeg by ufraw.
sudo apt-get install ufraw
Right click on the file and select
open with ufraw.
** You can also import them to Gimp with
gimp-ufraw and then export as
sudo apt-get install gimp-ufraw
I'll go a different route... Use
sudo apt-get install ufraw-batch ## This will output (not replace) the file with a new extension. ## foo.CR2 exported to foo.png ufraw-batch --out-type png *.CR2
ufraw-batch --help and
man ufraw-batch for more info.
For another alternative, use
mogrify -format png *.cr2
You could also program a simple loop in the console.
For example (using the fish console), and assuming the active directory only has RAW files.
set files (ls) for i in $files dcraw $i end
set files (ls) for i in $files ufraw-batch --out-type=tif --out-depth $i end
I use ufraw-batch that way because it often leads to an error, see https://bugs.launchpad.net/ubuntu/+source/ufraw/+bug/1768855 .
The method that really worked for me:
ppmtojpeg (install with apt)
for i in *.CR2; do dcraw -c $i | ppmtojpeg > $1.jpg; echo $i done; done
What it does: First convert CR2 to PPM with
dcraw passing the output to
ppmtojpeg which converts to JPG.
I found this here
exiftool -Composite:PreviewImage -b photo.CR2 > photo.jpg
ufraw-batch conversion quality is very bad. Imagemagick uses ufraw under the hoods (unfortunately). dcraw is better, but still not great. The best solution I found out was to use exif to extract PreviewImage metadata. I believe that's generated by the camera itself.
Create a bash file like foo.sh and execute as ./foo.sh in command line:
#!/bin/sh for i in $(ls) do ufraw-batch --out-type png $i echo "conversion done $i" done