Open Source History: dcraw and PS

Hi,
Stumbling upon David Coffin’s resume, I saw this:

Thanks to dcraw source code, Adobe Photoshop and dozens of other image tools now have built-in support for raw photos, and the popularity of raw photography has grown enormously.

Does this mean that PS used dcraw on Camera Raw? Does someone know more details about it?

Have fun!
Claes in Lund, Sweden

@Claes Thanks, a bit of light on that. So, from my understanding, raw processing consists of:

  1. reading “sensor data in a multitude of formats”;
  2. “convert those into a common data structure with camera-specific parameters”;
  3. convert that data structure into an image object, using “common proprietary algorithms, shaped by those camera-specific parameters and user settings”

And, according to those commenters, Adobe uses dcraw code to perform steps 1 and 2 above. Their proprietary code begins on step 3.

To end up with a usable photo, a program needs to:

  1. Decode the raw file from mostly proprietary formats (NEF, CR2, ARW, PEF, etc.) or open formats (DNG) to get the raw image, typically using dcraw, libraw or rawspeed.
  2. Get the metadata parameters required to work with the image (white levels, black levels, the coordinates of the usable image without the surrounding black frame if any, bit depth, color matrix, etc.), either from the decoded raw file or from external sources (exiv2, camconst.json, etc.).
  3. Demosaic the raw image if it needs demosaicing (needed when the camera uses a Bayer or X-Trans color filter array, not needed for Foveon sensors and Pixel Shift images without motion correction).
  4. White-balance the image.
  5. Pump the image through a series of manipulations in appropriate colorspaces to make it look good.
  6. Save the image (JPG, TIFF, PNG, EXR, etc.)
1 Like

@Morgan_Hardwood So, from your list of tasks and from the link provided by @Claes, dcraw code inside ACR performs steps 1 and 2 (3 also?)

I highly doubt the abandoned dcraw was used for steps 2 and 3 when it was allegedly used by Adobe, and I doubt they still use it in 2018.

@Morgan_Hardwood Abandoned? I thought it was still active. Doesn’t all the raw software we talk about here use dcraw? Is it a fork?

dcraw was last updated in 2016, no reply from Dave Coffin.

RT uses dcraw and will adopt something else hopefully soon, darktable uses mostly rawspeed.

What Adobe uses is a mystery to me, but I doubt a company with ~15000 employees and probably over 100 full-time programmers, a world leader in the field with a lot of money and access to all camera manufacturers, would rely on dcraw which has a single point of failure (one developer) and which was created through reverse-engineering, when it could just buy the needed information and write the code itself.

Maybe it was in the dawn of ACR. According to wikipedia, ACR debuted in Aug 2002.

But I agree with you about how doubtful it is to suppose that ACR still depends on dcraw.