Camera Raw/Lightroom: Kodak DCS SLR/n/c cameras missing Tone Curve support

  • 1
  • Problem
  • Updated 5 years ago
  • (Edited)
Hi,

I am using a few Kodak cameras (namely SLR/n, 14nx and Kodak ProBack 645) and also in a process of developing a various features for them (since Kodak no longer exists to provide support and feature enhancements).

I have came across what I believe is incorrect handling of the raw files from SLR/n/c and 14n/nx models in ACR and Lightroom. The raw files from those cameras have a tone curve applied to them compressing highlights and general 12 bit raw data to 10 bit per pixel (with range of values thus being 0..1023 per raw channel). The decompressing tone curve is supplied in each raw file that expands 10bit data to full 12bit and is taken into account by dcraw and other convertors. The compressing and decompressing curves can be amended by camera firmware up to the point where no compression could be induced with those curves being linear.

From my investigations, it looks as though ACR and Lightroom however are completely ignoring the tonal curve from the raw file and instead use a hardcoded white point effectively cutting off all raw values for those cameras at 1023.

I have experimented and this logic seems to be only coded in ACR/Lightroom based on camera name. If the file with linear tonal curve supplied have metadata that points to SLR/n camera fro example, all highlights are cut off above 1023 level. If the same file is modified (hex editor for example) to use Kodak ProBack as camera name - ACR/Lightroom handle it correctly.

I can supply the raw file, screenshots and details of tonal curve extraction (propriatery ifd and tonal curve tag) if needed (it is available in dcraw as that is an opensource project).
Photo of Alexey Danilchenko

Alexey Danilchenko

  • 14 Posts
  • 1 Reply Like

Posted 5 years ago

  • 1
Photo of Alexey Danilchenko

Alexey Danilchenko

  • 14 Posts
  • 1 Reply Like
I have debugged the CameraRaw module (32bit ACR) and it looks as though I am correct. If the error log messages generated in assembly code are anything to go by, the problem is in ReadKodakDCR() routine. Please pass this onto CameraRaw development team.

It checks the camera type there and for 14n, 14nx, SLR/n and SLR/c sets the upper limit level of 1023 (in that routine it also sets it to 4095 or 3500 to ProBack - I didn't spent much time deducing the differences in those cases). The limit for SLR cameras is definitely wrong and an unpacking tonal curve needs to be applied.

Also it seems that this curve is present in all the .DCR files - but in the likes of ProBack it is simply linear. The size of the curve array determines the ceiling for the compressed raw values (so no need to hardcode 1023 or 4095). It also looks that all of the last .DCRs (not sure about the oldest) are uncompressing to 12bits raw values (0..4095).

Technical details of the tonal curve:

The .DCR file is a TIFF so the expansion tonal curve is represented as a LUT - stored as a TIFF tag 2317 (datatype: short (int16), count: the size of the table corresponds to a maximum number of levels - in case of compressed encoding its 1024 but can up to be 4096). This tag is proprietary and is stored in proprietary Kodal IFD directory in .DCR file. This proprietary IFD offset is specified in tag 33424 (which is in the main IFD). The tone curve should be applied at the extracted raw levels to get the real levels produced by the camera - just like a normal lookup table.

I'd be happy to answer any technical questions if needed and show some examples (and provide the raw files that do not work correctly).