In the next article we are going to take a look at DCRaw. This is one open source application used to read numerous raw image formats (RAW, CR2, ect ...). It basically reads those typically produced by high-end digital cameras. DCRaw is a simple tool to install with which we can convert these raw images to standard PPM and TIFF image formats. This program has been written by Dave Coffin in the ANSI C language, so it is cross-platform in nature.
This program is a command line tool. This takes a list of files to process, in addition to the desired image options. This makes DCRaw easy to use from the console, but more difficult to use from external programs. This program is the basis for various high-level graphic processing applications, such as viewers and converters, both free and proprietary.
As I say, DCRaw is a command line tool for converting raw images to TIFF or PPM format. It is also compatible with dozens of cameras and it offers users many parameters to obtain the desired result.
Once we get the satisfactory result, it is recommended to use DCRaw through a batch file to facilitate bulk conversion of multiple files.
Content of the article
Install DCRaw on Ubuntu 17.04
To install DCRaw in Ubuntu we are going to resort to its corresponding PPA. To do this, we open a terminal (Ctrl + Alt + T) and write the following in it:
Once the repository has been added, we update the list of software and proceed with the installation using the following script:
sudo apt update && sudo apt install dcraw -y
If everything went smoothly during the installation, the DCRaw application will run correctly.
Get started with DCRAW
With this example, and the documentation that the author leaves us in the program, users can play with these options and create our own scripts. This is just the beginning, the possibilities of this program are almost endless.
To know more about the options available in this program, we can execute the following command in the terminal and the list of Available options will appear below:
The best way to understand how this program works is by observing a practical example and reeling off the options that have been used in it. The example would be the one that can be seen in the previous screenshot.
dcraw -v -w -H 1 -o 0 -q 3 -4 -T 1334012583_-mg-9952.CR2
- -v: with this option, DCRAW it will show us the log that is being generated on the screen throughout the development process.
- -w: camera white balance. If we used -a instead, we could force DCRAW to estimate the white balance. This will be based on a sampling carried out of the entire image. It would be something like automatic camera WB.
- -H 1: This useful attribute is used to define the treatment that DCRAW will give to the high beams. We will be able to convert the burned areas to neutral gray (2), or use a linear interpolation to recover those burned lights (0). Option 1 is the one that I usually put when I want to modify the original white balance and also the photograph is well exposed. It guarantees that when modifying the white balance, we do not move the histogram of any channel to the area of burnt pixels.
- -o: this option is very important to set the color profile of the output file. In this case, with the value 0 we tell it not to do any color management and preserve the space of the original photograph. But we could convert to sRGB, AdobeRGB, ProPhoto ...
- -q [0-3]: with this option we are going to indicate the matrix interpolation algorithm. Usually, value 3 (AHD) works best since it is an adaptive algorithm, although it is possible that in certain camera models you need to try others and keep them for your photos.
- -4: if we don't put this option, the resulting image will have 8 bits of color per channel. A) Yes we ensure 16-bit images.
- -T: generate a TIFF file. It is best if later we are going to work the image in a retouching program.
To eliminate this program from our operating system, we will only have to follow the usual steps. First delete the repository by typing in the terminal (Ctrl + Alt + T) the following command:
add-apt-repository -r ppa:dhor/myway
Now we can delete the program. In the same terminal we write:
sudo apt remove dcraw
If the help of the program and the example in this article are not enough, who needs it can use the following tutorial about DCRAW (in Spanish).