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.

Tuesday, January 21, 2014

Installation of Arch Linux

Without being generic, I'm explaining the steps I used to install archlinux in my laptop. While applying to other hardware, most of it must be unchanged except the nvidia driver part.
I haven't covered the installation of GRUB since I use the grub of another linux installed in my computer. Also, some steps about local time etc were omitted since they do not affect me much. There might be some other steps which are specific to my laptop or my preferences which can be omitted or modified when if desired.
Here is the link to download the zip file of these 6 files together:

In case the link s unavailable, here is the merged content of these files, separated by a long array of hashes. They should be saved in different files called 1, 2, ..., 5 (say) and ran in the natural order. Sometimes, a file ends echoing a command which have to performed manually. It is strongly advised to edit and modify the files before running to avoid deletion or alteration of important data.

After the installation, the linux should have a working awesome window manager. For personalisation, I use the following files:
1. bashrc
2. prettify

Update: Broadcom wifi drivers are working properly after updating. But gtk2 ran into an error while updating apart from some conflicts which I resolved. Apparently, gtk2 was installed by firefox, not by the standards package installation hence there was an ownership problem, it seemed. Finally the documentation of Arch Linux saved me. Since gtk2 was the only package having problems while updating, a simple pacman -Syu --force gtk2 fixed everything.(It gives pacman the right to replace existing files of the corresponding packages which was the problem to begin with.)

Update: The following codes in the ~/.inputrc will give you incremental history search facility in xterm which means you can type a few characters of your command and press up/down arrow to navigate through your terminal history with matching initial characters: