Difference between revisions of "Dcraw"

From PanoTools.org Wiki
Jump to navigation Jump to search
m (link to ufraw)
(The Gimp -> GIMP (official naming))
 
(21 intermediate revisions by 6 users not shown)
Line 1: Line 1:
To get the full [[Dynamic Range|dynamic range]] from your camera you need to switch to a [[full 16 bit workflow]] which means using [[RAW]] data rather than [[JPEG]]. Camera manufacturers generally provide tools of varying quality to convert [[RAW]] data into something usable, but if you want something better you might want to use the Abode [[Photoshop]] [[RAW]] plugin or the free [http://www.cybercom.net/~dcoffin/dcraw/ dcraw] utility.
+
'''dcraw''' is {{Glossary|an ANSI C program written by Dave Coffin to decode any raw image from any digital camera on any computer running any operating system|1}}. Thousands of people use dcraw without knowing it, as Bibble, BreezeBrowser, IrfanView, Conceiva, and the Adobe Camera Raw plugin all contain source code from dcraw.  
  
'''dcraw''' was originally developed by Dave Coffin for Linux, it is also available as [http://www.insflug.org/raw/ dcraw for Windows and OS X].
+
dcraw can write 16 bit per channel image files (on windows [[PSD]] files are supported) which contain all the image information of the [[RAW]] file in a linear ([[gamma]] 1.0) color space.
 +
 
 +
As dcraw is no longer in active development it doesn't support newer cameras. But with dcraw_emu as part of libraw there is an drop in replacement.
 +
 
 +
== Alternatives ==
 +
 
 +
dcraw_emu is a complete emulation of dcraw.
 +
[[UFRaw]] is an easy to use GUI that incorporates dcraw. Levels can be adjusted and previewed before saving.
 +
 
 +
== Usage ==
 +
=== Windows ===
 +
You shouldn't be afraid of the command line if you want to use dcraw directly. If you simply call it, it gives you a short syntax help. However, it is easy to integrate it in windows explorer right click menu, once you found your favourite parameter settings:
 +
 
 +
Create a batch file (prefferable in the folder where dcraw is installed) with the dcraw call looking like this:
 +
dcraw -w -3 %*
 +
pause
 +
 
 +
Actual parameters may vary according to your needs. Call dcraw at the command line to get a parameter overview. You might consider using the -n and -m switch and play with the -b setting (values below 1.0) in order to get maximum dynamic range.
 +
 
 +
Create a link to that batch file and move it to the 'Send to' folder  (a subfolder of your user folder on "C:\Documents and Settings" - may be hidden, hence you first must [[Enable_windows_file_extensions#Unhide_files_and_folders|unhide]] it)
 +
 
 +
=== UBUNTU and Mint (tested under saucy) ===
 +
 
 +
'''Prequisites'''
 +
 
 +
* terminal session
 +
* ljasper: install via Synaptics
 +
* lcms2: install via command line with:
 +
sudo apt-get install liblcms2-dev
 +
* get the latest dcraw.c
 +
 
 +
'''Compiling'''
 +
 
 +
* sudo gcc -o dcraw -O4 dcraw.c -lm -ljasper -ljpeg -llcms2
 +
There might be warnings.They could be ignored.
 +
 
 +
'''Running'''
 +
 
 +
* make dcraw executable
 +
* copy the binary to /usr/bin and change user and group to root
 +
* excute the binary on the command line. The output should display the version and the options.
 +
 
 +
'''Hint for scripting'''
 +
 
 +
* dcraw prints the processing steps to STDERR (due to the source code code). There are 6 lines separated by \n
 +
 
 +
'''Example:''' to get the white balance of the camera I propose this command line
 +
 +
dcraw -v -w <filename> | sed -e 1d -e 2d -e 4d -e 5 -e 6d -e s/multipliers//g
 +
 
 +
=== 16 bit files with Photoshop ===
 +
[[Photoshop]] users can use this files simply by assign a gamma 1.0 color space (and then convert to working space if needed). A [[gamma]] 1.0 color space can be created with following steps:
 +
* Choose '''Color Settings''' from '''Edit''' menu.
 +
* Check '''Advanced Mode'''
 +
* Choose '''sRGB IEC61966-2.1''' from the '''RGB''' droplist under '''Working Space'''.
 +
* Choose '''Custom''' from the same droplist (very top).
 +
* In the '''Custom RGB''' dialog set Gamma to 1.0 - leave all other values as they are.
 +
* Enter appropriate name (f.e. '''sRGB Gamma 1''') and leave dialog by pressing '''Ok'''.
 +
* In the '''Color Settings''' dialog choose '''Save RGB''' from the RGB dropdown list.
 +
* Give an appropriate name (f.e. '''sRGB Gamma 1.icc''') and save (this might be slightly different for Mac users).
 +
* Close the '''Color Settings''' dialog by pressing '''Cancel''' (in order not to choose the new profile as working space.
 +
 
 +
Even after conversion into a gamma 2.2 working space the images might look dull. Don't worry. If you use them with [[full 16 bit workflow]] for panorama creation you wont loose anything. You can adjust levels and contrast in your ready stitched panorama.
 +
 
 +
=== 16 bit with other image processors ===
 +
Users of other operating systems or other image processores can apply a gamma of 2.2 to those linear gamma files produced by dcraw in their favourite 16 bit per channel capable image processor (e.g [[GIMP]] on Linux).
 +
 
 +
== External links ==
 +
 
 +
* [http://www.dechifro.org/dcraw/ dcraw]
 +
* [https://www.libraw.org/docs/Samples-LibRaw.html dcraw_emu]
  
The dcraw code is behind many applications that can open [[RAW]] files such as the free [http://ufraw.sourceforge.net/ UFRaw] plug-in for the [[Gimp]].
 
  
 
[[Category:Software:Platform:Windows]]
 
[[Category:Software:Platform:Windows]]
 
[[Category:Software:Platform:Mac OS X]]
 
[[Category:Software:Platform:Mac OS X]]
 
[[Category:Software:Platform:Linux]]
 
[[Category:Software:Platform:Linux]]
 +
 +
{{Incomplete|Talk}}

Latest revision as of 14:32, 21 November 2022

dcraw is an ANSI C program written by Dave Coffin to decode any raw image from any digital camera on any computer running any operating system. Thousands of people use dcraw without knowing it, as Bibble, BreezeBrowser, IrfanView, Conceiva, and the Adobe Camera Raw plugin all contain source code from dcraw.

dcraw can write 16 bit per channel image files (on windows PSD files are supported) which contain all the image information of the RAW file in a linear (gamma 1.0) color space.

As dcraw is no longer in active development it doesn't support newer cameras. But with dcraw_emu as part of libraw there is an drop in replacement.

Alternatives

dcraw_emu is a complete emulation of dcraw. UFRaw is an easy to use GUI that incorporates dcraw. Levels can be adjusted and previewed before saving.

Usage

Windows

You shouldn't be afraid of the command line if you want to use dcraw directly. If you simply call it, it gives you a short syntax help. However, it is easy to integrate it in windows explorer right click menu, once you found your favourite parameter settings:

Create a batch file (prefferable in the folder where dcraw is installed) with the dcraw call looking like this:

dcraw -w -3 %*
pause 

Actual parameters may vary according to your needs. Call dcraw at the command line to get a parameter overview. You might consider using the -n and -m switch and play with the -b setting (values below 1.0) in order to get maximum dynamic range.

Create a link to that batch file and move it to the 'Send to' folder (a subfolder of your user folder on "C:\Documents and Settings" - may be hidden, hence you first must unhide it)

UBUNTU and Mint (tested under saucy)

Prequisites

  • terminal session
  • ljasper: install via Synaptics
  • lcms2: install via command line with:
sudo apt-get install liblcms2-dev 
  • get the latest dcraw.c

Compiling

  • sudo gcc -o dcraw -O4 dcraw.c -lm -ljasper -ljpeg -llcms2

There might be warnings.They could be ignored.

Running

  • make dcraw executable
  • copy the binary to /usr/bin and change user and group to root
  • excute the binary on the command line. The output should display the version and the options.

Hint for scripting

  • dcraw prints the processing steps to STDERR (due to the source code code). There are 6 lines separated by \n
Example: to get the white balance of the camera I propose this command line

dcraw -v -w <filename> | sed -e 1d -e 2d -e 4d -e 5 -e 6d -e s/multipliers//g

16 bit files with Photoshop

Photoshop users can use this files simply by assign a gamma 1.0 color space (and then convert to working space if needed). A gamma 1.0 color space can be created with following steps:

  • Choose Color Settings from Edit menu.
  • Check Advanced Mode
  • Choose sRGB IEC61966-2.1 from the RGB droplist under Working Space.
  • Choose Custom from the same droplist (very top).
  • In the Custom RGB dialog set Gamma to 1.0 - leave all other values as they are.
  • Enter appropriate name (f.e. sRGB Gamma 1) and leave dialog by pressing Ok.
  • In the Color Settings dialog choose Save RGB from the RGB dropdown list.
  • Give an appropriate name (f.e. sRGB Gamma 1.icc) and save (this might be slightly different for Mac users).
  • Close the Color Settings dialog by pressing Cancel (in order not to choose the new profile as working space.

Even after conversion into a gamma 2.2 working space the images might look dull. Don't worry. If you use them with full 16 bit workflow for panorama creation you wont loose anything. You can adjust levels and contrast in your ready stitched panorama.

16 bit with other image processors

Users of other operating systems or other image processores can apply a gamma of 2.2 to those linear gamma files produced by dcraw in their favourite 16 bit per channel capable image processor (e.g GIMP on Linux).

External links

This article is incomplete. You can help Panotools Wiki by expanding it.

See the related Talk page for hints.
Once the article is ok feel free to remove the {{Incomplete|Talk}} template