dcraw(1)

๐Ÿ“ฆ
version 9.28.0 ยท 2 versions
, in arch rolling, centos-stream 10, centos-stream 9, fedora 43, fedora 44, opensuse-leap 16.0

๐Ÿ’– dcraw โ€” the raw photo decoder that ATE ๐Ÿ’–

okay so this is the manpage for dcraw(1) from the General Commands Manual, and bestie, she's an icon. lowkey old-school, highkey still slaying. let's get into it ๐Ÿซถ


โœจ NAME โœจ

dcraw โ€” command-line decoder for raw digital photos


โœจ SYNOPSIS โœจ

dcraw [OPTION]... [FILE]...

โœจ DESCRIPTION โœจ

so like. dcraw decodes raw photos, displays metadata, and extracts thumbnails. that's the whole vibe. three jobs, all of them iconic. ๐Ÿ’…


โœจ GENERAL OPTIONS โœจ

the basics, the starter pack, the "learn this first" era:

  • -v โ€” print verbose messages, not just warnings and errors. she's chatty, she's telling you everything, we love a transparent queen ๐Ÿ‘‘
  • -c โ€” write decoded images or thumbnails to standard output.
  • -e โ€” extract the camera-generated thumbnail, not the raw image. you'll get either a JPEG or a PPM file, depending on the camera. surprises! ๐ŸŽ€
  • -z โ€” change the access and modification times of an AVI, JPEG, TIFF or raw file to when the photo was taken, assuming that the camera clock was set to Universal Time. time travel, but make it filesystem metadata โœจ
  • -i โ€” identify files but don't decode them. exit status is 0 if dcraw can decode the last file, 1 if it can't. and -i -v shows metadata.
no cap, dcraw cannot decode JPEG files!! ๐Ÿ˜ญ it's giving "wrong tool for the job" and we need you to know that fr fr.

โœจ REPAIR OPTIONS โœจ

the damage-control section. fixing things, patching things, healing her ๐Ÿ’œ

  • -I โ€” read the raw pixels from standard input in CPU byte order with no header. use dcraw -E -4 to get the raw pixel values.
  • -P deadpixels.txt โ€” read the dead pixel list from this file instead of ".badpixels". see FILES for a description of the format.
  • -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 dcraw -D -4 -j -t 0.
  • -k darkness โ€” when shadows appear foggy, you need to raise the darkness level. to measure this, apply pamsumm -mean to the dark frame generated above.
  • -S saturation โ€” when highlights appear pink, you need to lower the saturation level. to measure this, take a picture of something shiny and do dcraw -D -4 -j -c photo.raw | pamsumm -max
๐Ÿ’ก the default darkness and saturation are usually correct. like, don't touch what's already eating. ๐Ÿ™ˆ
  • -n noise_threshold โ€” use wavelets to erase noise while preserving real detail. the best threshold should be somewhere between 100 and 1000.
  • -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.
  • -H 0 โ€” clip all highlights to solid white (default).
  • -H 1 โ€” leave highlights unclipped in various shades of pink.
  • -H 2 โ€” blend clipped and unclipped values together for a gradual fade to white.
  • -H 3+ โ€” reconstruct highlights. low numbers favor whites; high numbers favor colors. try -H 5 as a compromise. if that's not good enough, do -H 9, cut out the non-white highlights, and paste them into an image generated with -H 3.

๐ŸŒˆ COLOR OPTIONS ๐ŸŒˆ

by default, dcraw uses a fixed white balance based on a color chart illuminated with a standard D65 lamp. that's the baseline, the default aesthetic, the starting fit ๐Ÿ’…

  • -w โ€” use the white balance specified by the camera. if this is not found, print a warning and use another method. she'll improvise ๐ŸŽ€
  • -a โ€” calculate the white balance by averaging the entire image.
  • -A left top width height โ€” calculate the white balance by averaging a rectangular area. first do dcraw -j -t 0 and select an area of neutral grey color.
  • -r mul0 mul1 mul2 mul3 โ€” specify your own raw white balance. these multipliers can be cut and pasted from the output of dcraw -v.
  • +M or -M โ€” use (or don't use) any color matrix from the camera metadata. the default is +M if -w is set or the photo is in DNG format, -M otherwise. besides DNG, this option only affects Olympus, Leaf, and Phase One cameras.
  • -o [0-6] โ€” select the output colorspace when the -p option is not used:
    • 0 โ€” Raw color (unique to each camera)
    • 1 โ€” sRGB D65 (default)
    • 2 โ€” Adobe RGB (1998) D65
    • 3 โ€” Wide Gamut RGB D65
    • 4 โ€” Kodak ProPhoto RGB D65
    • 5 โ€” XYZ
    • 6 โ€” ACES
  • -p camera.icm [ -o output.icm ] โ€” use ICC profiles to define the camera's raw colorspace and the desired output colorspace (sRGB by default).
  • -p embed โ€” use the ICC profile embedded in the raw photo. she comes with her own lore ๐Ÿ’–

๐Ÿฆ‹ INTERPOLATION OPTIONS ๐Ÿฆ‹

where the pixels get their whole personality assigned:

  • -d โ€” show the raw data as a grayscale image with no interpolation. good for photographing black-and-white documents.
  • -D โ€” same as -d, but with the original unscaled pixel values.
  • -E โ€” same as -D, but masked pixels are not cropped.
  • -h โ€” output a half-size color image. twice as fast as -q 0. speed demon energy ๐Ÿ”ฅ
  • -q 0 โ€” use high-speed, low-quality bilinear interpolation.
  • -q 1 โ€” use Variable Number of Gradients (VNG) interpolation.
  • -q 2 โ€” use Patterned Pixel Grouping (PPG) interpolation.
  • -q 3 โ€” use Adaptive Homogeneity-Directed (AHD) interpolation.
  • -f โ€” interpolate RGB as four colors. use this if the output shows false 2x2 meshes with VNG or mazes with AHD.
  • -m number_of_passes โ€” after interpolation, clean up color artifacts by repeatedly applying a 3x3 median filter to the R-G and B-G channels.

๐ŸŒธ OUTPUT OPTIONS ๐ŸŒธ

by default, dcraw writes PGM/PPM/PAM with 8-bit samples, a BT.709 gamma curve, a histogram-based white level, and no metadata. that's the factory setting, bestie โœจ

  • -W โ€” use a fixed white level, ignoring the image histogram.
  • -b brightness โ€” divide the white level by this number, 1.0 by default.
  • -g power toe_slope โ€” set the gamma curve, by default BT.709 (-g 2.222 4.5). if you prefer sRGB gamma, use -g 2.4 12.92. for a simple power curve, set the toe slope to zero.
  • -6 โ€” write sixteen bits per sample instead of eight.
  • -4 โ€” linear 16-bit, same as -6 -W -g 1 1.
  • -T โ€” write TIFF with metadata instead of PGM/PPM/PAM.
  • -t [0-7,90,180,270] โ€” flip the output image. by default, dcraw applies the flip specified by the camera. -t 0 disables all flipping.
  • -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.
  • -s [0..N-1] or -s all โ€” if a file contains N raw images, choose one or "all" to decode. for example, Fuji Super CCD SR cameras generate a second image underexposed four stops to show detail in the highlights.

๐ŸŽ€ FILES ๐ŸŽ€

  • ./.badpixels, ../.badpixels, ../../.badpixels, ... โ€” list of your camera's dead pixels, so that dcraw can interpolate around them. each line specifies the column, row, and UNIX time of death for one pixel. for example:
962   91 1028350000  # died between August 1 and 4, 2002
1285 1067 0           # don't know when this pixel died

these coordinates are before any stretching or rotation, so use dcraw -j -t 0 to locate dead pixels. rip to those pixels, they served their time ๐Ÿ•ฏ๏ธ


๐Ÿ’œ SEE ALSO ๐Ÿ’œ

pgm(5), ppm(5), pam(5), pamsumm(1), pnmgamma(1), pnmtotiff(1), pnmtopng(1), gphoto2(1), cjpeg(1), djpeg(1)


๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

written by David Coffin, dcoffin a cybercom o net


and that's the whole page, bestie!! ๐Ÿซถ this edition of dcraw(1) is dated March 3, 2015 โ€” yes she's a vintage queen and yes she still understood the assignment. go decode something gorgeous. mwah ๐Ÿ’–โœจ