.\"
-.\" Man page for dcraw (Raw Photo Decoder)
+.\" Man page for dcraw
.\"
-.\" Copyright (c) 2003 by David Coffin
+.\" Copyright (c) 2007 by David Coffin
.\"
.\" You may distribute without restriction.
.\"
.\" dcoffin a cybercom o net
.\" http://www.cybercom.net/~dcoffin
.\"
-.TH dcraw 1 "March 6, 2004"
+.TH dcraw 1 "June 8, 2007"
.LO 1
.SH NAME
-dcraw - convert raw digital photos to PPM format
+dcraw - command-line decoder for raw digital photos
.SH SYNOPSIS
-.B dcraw
+.B dcraw
[\fIOPTION\fR]... [\fIFILE\fR]...
.SH DESCRIPTION
.B dcraw
-converts a list of raw digital camera files to
-.BR ppm (5)
-format. Dozens of cameras are supported, and new ones are
-added as they reach the market.
+decodes raw photos, displays metadata, and extracts thumbnails.
.SH OPTIONS
.TP
+.B -v
+Print verbose messages, not just warnings and errors.
+.TP
+.B -c
+Write decoded images or thumbnails to standard output.
+.TP
+.B -e
+Extract the camera-generated thumbnail, not the raw image.
+You'll get either a JPEG or a PPM file, depending on the camera.
+.TP
+.B -z
+Change the access and modification times of an AVI, JPEG or raw
+file to when the photo was taken, assuming that the camera clock
+was set to Universal Time.
+.TP
.B -i
Identify files but don't decode them.
Exit status is 0 if
.B dcraw
can decode the last file, 1 if it can't.
+.B -i -v
+shows metadata.
.TP
-.B -c
-Write binary image data to standard output.
-Otherwise,
-.B dcraw
-creates files with a ".ppm" extension.
-.TP
-.B -v
-Print verbose messages. Otherwise,
+.B ""
.B dcraw
-prints only warnings and errors.
-.TP
-.B -f
-Interpolate RGB as four colors. The default is to assume that
-all green pixels are the same. If even-row green pixels are
-more sensitive to ultraviolet light than odd-row green pixels,
-this difference causes a mesh pattern in the output.
-.B -f
-solves this problem with minimal loss of detail.
+cannot decode JPEG files!!
.TP
.B -d
Show the raw data as a grayscale image with no interpolation.
Good for photographing black-and-white documents.
.TP
-.B -q
-Use simple bilinear interpolation for quick results. The
-default is to use a slow, high-quality adaptive algorithm.
+.B -D
+Same as
+.BR -d ,
+but totally raw (no color scaling).
.TP
.B -h
-Half-size the output image. Instead of interpolating, reduce
-each 2x2 block of sensors to one pixel. Much faster than
-.BR -q .
+Output a half-size color image. Twice as fast as
+.BR -q\ 0 .
.TP
-.B -g gamma
-Specify the gamma value for eight-bit output. Default is 0.6.
+.B -q 0
+Use high-speed, low-quality bilinear interpolation.
.TP
-.B -b brightness
-Specify the output brightness. Default is 1.0.
+.B -q 1
+Use Variable Number of Gradients (VNG) interpolation.
.TP
-.B -a
-Automatic color balance. The default is to use a fixed
-color balance based on a white card photographed in sunlight.
+.B -q 2
+Use Patterned Pixel Grouping (PPG) interpolation.
.TP
-.B -w
-Use the color balance specified by the camera.
-If this can't be found,
-.B dcraw
-prints a warning and reverts to the default.
+.B -q 3
+Use Adaptive Homogeneity-Directed (AHD) interpolation.
.TP
-.B -r red_mul -l blue_mul
-After all other color adjustments, multiply the red and blue
-channels by these values. Default is 1.0.
+.B -f
+Interpolate RGB as four colors. Use this if the output shows
+false 2x2 meshes with VNG or mazes with AHD.
+.TP
+.B -n noise_threshold
+Use wavelets to erase noise while preserving real detail.
+The best threshold should be somewhere between 100 and 1000.
.TP
-.B -2
-Write eight bits per color value with gamma correction and
-automatic brightness adjustment. Double the height
-if necessary to correct the aspect ratio. This is the default.
+.B -b brightness
+By default,
+.B dcraw
+writes 8-bit PGM/PPM/PAM with a BT.709 gamma curve and a
+99th-percentile white point. If the result is too light or
+too dark,
+.B -b
+lets you adjust it. Default is 1.0.
.TP
.B -4
-Write sixteen bits per color value, with no gamma correction,
-no brightness adjustment, and no changes to the aspect ratio.
+Write 16-bit linear pseudo-PGM/PPM/PAM with no gamma curve,
+no white point, and no
+.B -b
+option.
+.TP
+.B -T
+Write TIFF output (with metadata) instead of PGM/PPM/PAM.
+.TP
+.B -k black
+Set the black point. Default depends on the camera.
+.TP
+.B -K darkframe.pgm
+Subtract a dark frame from the raw data. To generate a
+dark frame, shoot a raw photo with no light and do
+.BR dcraw\ -D\ -4\ -j\ -t\ 0 .
.TP
-.B -3
-Same image as
-.BR -4 ,
-written in Adobe PhotoShop format. File extension is ".psd".
-.SH "SEE ALSO"
-ppm(5), ppm2tiff(1), pnmtotiff(1), pnmtopng(1), gphoto2(1).
-.SH BUGS
-The
.B -w
-option does not work with many cameras.
-.P
-No attempt is made to save camera settings or thumbnail images.
-.P
-Author stubbornly refuses to add more output formats.
-.P
-Don't expect
+Use the white balance specified by the camera.
+If this is not found, print a warning and use another method.
+.TP
+.B -a
+Calculate the white balance by averaging the entire image.
+.TP
+.B -A left top width height
+Calculate the white balance by averaging a rectangular area.
+First do
+.B dcraw\ -j\ -t\ 0
+and select an area of neutral grey color.
+.TP
+.B -r mul0 mul1 mul2 mul3
+Specify your own raw white balance.
+These multipliers can be cut and pasted from the output of
+.BR dcraw\ -v .
+.TP
+no white balance option
+Use a fixed white balance based on a color chart illuminated
+with a standard D65 lamp.
+.TP
+.B -M
+If the raw metadata contains a color matrix, don't use it.
+This option only affects Olympus, Leaf, and Phase One cameras.
+.TP
+.B -C red_mag blue_mag
+Enlarge the raw red and blue layers by the given factors,
+typically 0.999 to 1.001, to correct chromatic aberration.
+.TP
+.B -H 0
+Clip all highlights to solid white (default).
+.TP
+.B -H 1
+Leave highlights unclipped in various shades of pink.
+.TP
+.B -H 2
+Blend clipped and unclipped values together for a gradual fade to white.
+.TP
+.B -H 3-9
+Reconstruct highlights. Low numbers favor whites; high numbers
+favor colors. Try
+.B -H 5
+as a compromise. If that's not good enough, do
+.BR -H\ 9 ,
+cut out the non-white highlights, and paste them into an image
+generated with
+.BR -H\ 3 .
+.TP
+.B -m
+Same as
+.BR -o\ 0 .
+.TP
+.B -o [0-5]
+Select the output colorspace when the
+.B -p
+option is not used:
+
+.B \t0
+\ \ Raw color (unique to each camera)
+.br
+.B \t1
+\ \ sRGB D65 (default)
+.br
+.B \t2
+\ \ Adobe RGB (1998) D65
+.br
+.B \t3
+\ \ Wide Gamut RGB D65
+.br
+.B \t4
+\ \ Kodak ProPhoto RGB D65
+.br
+.B \t5
+\ \ XYZ
+.TP
+.BR -p\ camera.icm \ [\ -o\ output.icm \ ]
+Use ICC profiles to define the camera's raw colorspace and the
+desired output colorspace (sRGB by default).
+.TP
+.B -p embed
+Use the ICC profile embedded in the raw photo.
+.TP
+.B -t [0-7,90,180,270]
+Flip the output image. By default,
.B dcraw
-to produce the same images as software provided by the camera
-vendor. Sometimes
+applies the flip specified by the camera.
+.B -t 0
+disables all flipping.
+.TP
+.B -s [0-99]
+Select which raw image to decode if the file contains more than one.
+For example, Fuji\ Super\ CCD\ SR cameras generate a second image
+underexposed four stops to show detail in the highlights.
+.TP
+.B -j
+For Fuji\ Super\ CCD cameras, show the image tilted 45 degrees.
+For cameras with non-square pixels, do not stretch the image to
+its correct aspect ratio. In any case, this option guarantees
+that each output pixel corresponds to one raw pixel.
+.TP
+.B ""
+If they don't apply to your camera,
+.B -s
+and
+.B -j
+are silently ignored.
+.SH FILES
+.TP
+\:./.badpixels, ../.badpixels, ../../.badpixels, ...
+List of your camera's dead pixels, so that
.B dcraw
-gives better results!
-.SH TIPS
-First raise the brightness if the highlights are too dark,
-then lower the gamma if the lowlights are too dark.
-Use
-.B -q
-or
-.B -h
-until you get it right.
-.P
-To balance the color, do
-.RB \^" dcraw\ -q\ -g\ 1\ -b\ 0.5 \^"
-and select a rectangle of something that you know is white.
-Compute the average R, G, and B values for this area, then
-set red_mul and blue_mul to G/R and G/B.
+can interpolate around them. Each line specifies the column,
+row, and UNIX time of death for one pixel. For example:
+.sp 1
+.nf
+ 962 91 1028350000 # died between August 1 and 4, 2002
+1285 1067 0 # don't know when this pixel died
+.fi
+.sp 1
+These coordinates are before any cropping or rotation, so use
+.B dcraw -j -t 0
+to locate dead pixels.
+.SH "SEE ALSO"
+.BR pgm (5),
+.BR ppm (5),
+.BR pam (5),
+.BR pnmgamma (1),
+.BR pnmtotiff (1),
+.BR pnmtopng (1),
+.BR gphoto2 (1),
+.BR cjpeg (1),
+.BR djpeg (1)
.SH AUTHOR
Written by David Coffin, dcoffin a cybercom o net