Saturday, 8 December 2012

Pink 650D RAW images under Ubuntu

Underwater photos are usually blue

The versions of libraw and dcraw currently in the Ubuntu repos have a slight problem. When accessing RAW files from Canon's latest 650D, they display them entirely in pink - which probably isn't what you want.

The problem is simple enough: the versions of dcraw/libraw used by all the RAW processing apps in Ubuntu 12.10 (aside from eog - so Shotwell, UFRaw, RawTherapee, etc.) don't have the 650D listed yet, so the ICC profiles aren't getting properly interpreted.

One solution is to rebuild your applications, such as Shotwell, with the appropriate versions of the underlying raw libraries. That can be a pain, so I took the easier option, and opted to convert the images to JPEG first, thereby circumventing the issue.

sudo apt-get install libjasper-dev libjpeg-dev liblcms1-dev graphicsmagick
wget http://www.cybercom.net/~dcoffin/dcraw/dcraw.c
gcc -o dcraw -O4 dcraw.c -lm -ljasper -ljpeg -llcms
sudo mv dcraw /usr/local/bin/dcraw
echo alias rawtojpg="\"find . -name '*.CR2' -print0 | xargs -0 -n 1 -P 8 -iIMG gm convert IMG -format jpg IMG.jpg\"" >> ~/.bashrc
source ~/.bashrc

At least it's better than pink
Thereafter, you should be able to use the primitive alias rawtojpg to convert all .CR2 files in the current directory to JPEGs (leaving the original CR2 files as-is). Note the -P 8 flag, which runs 8 conversion threads in parallel - adjust as appropriate. You can obviously change the alias to a proper function which takes some args too, but the above was sufficient for my purposes.



Update, 8th August 2013

See my comment below for a complete solution to this problem.

Assuming you've already followed the preceding instructions in this post, all you need to do is install gimp-dcraw; then you'll be able to open your 650D CR2s with GIMP:

sudo apt-get install gimp-dcraw