As a follow-up to yesterday's post on taking pictures with the Canon Digital Rebel
, today I've got a couple notes on getting the CRW (Canon Raw format) files processed in Linux. I think that the tools I ended up with will work for other raw formats as well. I chose to install the Gimp and ImageMagick with Fedora Core 4 when I set up FC4, but neither of those applications supports raw files in the state they're installed in.
Raw Photos with ImageMagick
I know that I've used ImageMagick
for converting CRW
images before, but it seemed that it worked on one computer but not another. I think what happened is that one of the computers that I used had dcraw
installed and the other didn't. Apparently a lot of popular converters that don't come from the camera manufacturers are based on dcraw. At least that's how it appeared yesterday when I was searching.
I like ImageMagick for batch file processing, since I can write a short command line script to do the same thing to many photos, then leave the computer to do its work. ImageMagick works on Linux and Windows. It comes as a set of command line programs that all behave in almost the same way. It's also available as a library for a lot of programming languages. The command I normally use is called
since it leaves the original file untouched and creates a new copy after processing (
does the same thing but replaces the original file - be careful).
When I first tried to run ImageMagick yesterday on FC4 I got an error indicating that convert didn't recognize the CRW format:
[rob@ruby 179canon]$ convert crw_8000.crw CRW_8000.jpg
sh: dcraw: command not found
convert: Delegate failed `"dcraw" -3 -w -c "%i" > "%o"'.
Since I'd already seen some info on dcraw I gathered that this meant I had to get it. I found a binary RPM
for my build that someone made available on a mailing list
. I think the one from Red Hat
might work just as well though. Installing over the web was surprisingly simple. When you open an RPM from the web, Firefox offers to open it with
. This prompts for the root password then gives a little dialog that offers to install the package. I know that overdoing this (installing arbitrary packages) can mess up a computer by installing unstable and buggy software on it, but dcraw seems to be pretty stable.
At some point I also had to install the LittleCMS
package as a dependency. It's available in the Fedora Extras
repository, and installation was just as easy.
After installation, I could convert an image to JPEG like so:
[rob@ruby 179canon]$ convert crw_8000.crw -size 1024x768 smallerpic.jpg
Now smallerpic.jpg is a 1024x768 image created from the much larger raw file. ImageMagick's convert command has a whole lot of options, including cropping, resizing, rotating and even some filters. Just be sure to do a test picture before committing to an hour long batch job.
I'm not sure how or if ImageMagick uses dcraw on Windows, but dcraw is available for Windows, so there should be a way to set it up.
Raw Photos with The Gimp
ImageMagick is great for doing the same thing to many pictures, but when I want to do many things to one picture, I turn to the Gimp
. I found a Gimp plugin called UFRaw
. UFRaw also relies on dcraw and LittleCMS, so those should be installed the same as above. UFRaw is included in the Fedora Extras. The UFRaw homepage has pointers to the binary install package for several distributions including Fedora.
Once I had UFRaw installed, the Gimp recognized CRW
files from the File-Open dialog. They open first in a UFRaw window. This lets you make the adjustments that you'd like up front. Once you accept the settings, UFRaw passes the picture on to the Gimp and you can work as usual. Perfect :) One thing that I've already figured out is that the high shutter speed I used yesterday cause some of my pictures to be underexposed. UFRaw allows me to adjust the exposure values interactively to correct for this problem and others like it.