Sunday, January 26, 2014

Canon RAW files(CR2) handling in Linux

Since I'm planning to shift to Arch Linux, handling raw files is one factor I would like to be fluent with.

Here are the necessary packages:

Converting CR2 to jpg or other readily viewable format: dcraw
Conveniently viewing the thumbnail or jpg files: feh
Merging to HDR: luminancehdr
Major Editing: gimp, ufraw, dcraw-gimp

Since I have no graphical file browser, viewing the raw files in a directory is out of question. Once I have copied all the CR2 files to a directory, I would like to view them in jpeg format.

Extracting Thumbnail:

The command dcraw -e *.CR2 extracts a jpg from the raw file and saves it as IMG_####.thumb.jpg in the same directory. We would now like to view these jpg files in a simple image viewer and find out the raw file(s) we would like to edit.

feh *.jpg opens a single window with all the images in its filelist. Here are the most frequently used commands which also can be found in man feh:

  • Zoom In, Zoom Out: Up_arrow, Down_arrow
  • Zoom to fit: /
  • Zoom to 100%: *
  • Moving the picture: Ctrl + Arrow_keys
  • Locking the zoom and offset value: k
  • Toggle Filename: d
  • Toggle EXIF: e
  • Next, previous image: Left_arrow, Right_arrow, n, p
  • Jump to 5% of the filelist: pageup, pagedown
  • Go to first, last image: Home, End
  • Rotate Image: <, >
  • Toggle slideshow: h
  • Increase, Decrese reload time: +, -

From the image preview, looking at the filenames, we now know which files to edit.


luminance-hdr is a graphical HDR creating software. It is pretty much automated and used KDE-like file browser in its file list. So, naturally it is bulky with respect to Arch Linux's lightweight-ness. An alternative is enfuse which I am willing to try.

Alternative: In magiclantern, in the shoot menu, there is an option to generate a post-script corresponding to a bracketing sequence. This script file can be collected and  ran in linux to merge raw files into HDR using enfuse tools. This script can reduce the work load since it contains the list of photos clicked in the bracketing sequence. This makes the previous step of extracting thumbnails useless, provided magiclantern is used properly.


Since GIMP cannot handle CR2 files, we need to install some plugins to convert the raw into usable format. ufraw, dcraw-gimp (decide which one is applicable/ useful) are the necessary plugins. If you have used lumance-hdr to generate a gimp-usable file, these plugins are not required.

No comments: