Skip to main content
Participant
December 1, 2022
Question

Lossless TIFF->DNG conversion isn't lossless?

  • December 1, 2022
  • 2 replies
  • 1442 views

I have a bunch of uncompressed 48 bit .TIFF files from a film scanner (Epson V850), and I used Adobe Lightroom to losslessly convert them to DNG to save space. I wanted to confirm that Lightroom created pixel-perfect conversions before deleting the originals, so I tried to compare them using a technique that has worked fairly well for me in the past, via ImageMagick:

 

convert a.tiff a.mpc
shasum -a 256 a.cache

convert b.dng b.mpc
shasum -b 256 b.cache

 

Unfortunately, the hashes don't match, suggesting that something changed along the way. Differences can also be seen if I use Photoshop to open both files and overlay them on top of each other, then subtract. I assume this is something as simple as a color profile being added to the DNG file, or some other information that Adobe DNG Converter is picking as a default because it's missing from the original TIFF. Is there any way to determine why these files look visibly different after conversion? Lossless conversion definitely shouldn't be altering the visible image data, so I'm curious if this is actually a bug.

This topic has been closed for replies.

2 replies

Legend
December 2, 2022

I don't see the point to this. A DNG file is already a TIFF. Just compress the original TIFFs if you need to save space.

Community Expert
December 2, 2022

Yeah agree with this. It is a much better idea to just resave the tiffs using zip compression. This will ensure long term compatibility of the files. The compression is not quite as efficient as that used in dng but close enough. I would only use dng for raw files.

Participant
December 3, 2022

DNG has certain benefits that TIFF doesn't (like internal checksumming). The different file extension also makes it very easy to confirm that the files have actually been compressed, and aren't straight out of the uncompressed film scanner. Considering these are mostly scans of negatives (with messed up colors to begin with), being prompted for white balance / tone adjustment when opening each file is reasonable behaviour, and I wouldn't get that by keeping it as TIFF. While I could have compressed my files before importing them into Lightroom, I figured that having Lightroom convert into DNG via DNG Converter would be a reasonable option.

johnrellis
Legend
December 1, 2022

Upload a sample TIFF and converted DNG to Dropbox, Google Drive, or similar and post the sharing link here -- that will enable others to poke into them and try their own conversion to learn more about what's going on.

Participant
December 1, 2022

Here are two files that exhibit this problem. They aren't the exact files I was working with earlier (those are around half a GB each on average), so I shrunk one down in Photoshop to 10%, exported it as TIFF, then imported it into Lightroom to do the DNG conversion. The original file's EXIF data is below, just in case something is different between that and the scaled down version.

 

exiftool -a -G /img20220907_17521610.tif

[ExifTool] ExifTool Version Number : 12.26
[File] File Name : img20220907_17521610.tif
[File] File Size : 184 MiB
[File] File Modification Date/Time : 2022:09:07 17:52:16-04:00
[File] File Access Date/Time : 2022:09:20 05:50:27-04:00
[File] File Inode Change Date/Time : 2022:09:07 17:52:16-04:00
[File] File Permissions : -rwx------
[File] File Type : TIFF
[File] File Type Extension : tif
[File] MIME Type : image/tiff
[File] Exif Byte Order : Little-endian (Intel, II)
[EXIF] Image Width : 5669
[EXIF] Image Height : 5661
[EXIF] Bits Per Sample : 16 16 16
[EXIF] Compression : Uncompressed
[EXIF] Photometric Interpretation : RGB
[EXIF] Strip Offsets : (Binary data 53338 bytes, use -b option to extract)
[EXIF] Orientation : Horizontal (normal)
[EXIF] Samples Per Pixel : 3
[EXIF] Rows Per Strip : 1
[EXIF] Strip Byte Counts : (Binary data 33965 bytes, use -b option to extract)
[EXIF] X Resolution : 4800
[EXIF] Y Resolution : 4800
[EXIF] Planar Configuration : Chunky
[EXIF] Resolution Unit : inches
[Composite] Image Size : 5669x5661
[Composite] Megapixels : 32.1

identify -verbose /126/img20220907_17521610.tif

Image:
  Filename: /126/img20220907_17521610.tif
  Format: TIFF (Tagged Image File Format)
  Mime type: image/tiff
  Class: DirectClass
  Geometry: 5669x5661+0+0
  Resolution: 4800x4800
  Print size: 1.18104x1.17938
  Units: PixelsPerInch
  Colorspace: sRGB
  Type: TrueColor
  Endianness: LSB
  Depth: 16-bit
  Channel depth:
    Red: 16-bit
    Green: 16-bit
    Blue: 16-bit
  Channel statistics:
    Pixels: 32092209
    Red:
      min: 2756  (0.0420539)
      max: 65535 (1)
      mean: 37050.2 (0.56535)
      median: 65535 (1)
      standard deviation: 15505.3 (0.236596)
      kurtosis: -0.630517
      skewness: -0.32685
      entropy: 0.932591
    Green:
      min: 1848  (0.0281987)
      max: 65535 (1)
      mean: 39860 (0.608225)
      median: 65535 (1)
      standard deviation: 15194 (0.231845)
      kurtosis: -0.187175
      skewness: -0.723296
      entropy: 0.916869
    Blue:
      min: 421  (0.00642405)
      max: 65535 (1)
      mean: 37693.9 (0.575172)
      median: 65535 (1)
      standard deviation: 13972.9 (0.213212)
      kurtosis: 0.422505
      skewness: -0.679648
      entropy: 0.883998
  Image statistics:
    Overall:
      min: 421  (0.00642405)
      max: 65535 (1)
      mean: 38201.4 (0.582916)
      median: 65535 (1)
      standard deviation: 14890.7 (0.227218)
      kurtosis: -0.22754
      skewness: -0.556783
      entropy: 0.911153
  Rendering intent: Perceptual
  Gamma: 0.454545
  Chromaticity:
    red primary: (0.64,0.33)
    green primary: (0.3,0.6)
    blue primary: (0.15,0.06)
    white point: (0.3127,0.329)
  Matte color: grey74
  Background color: white
  Border color: srgb(223,223,223)
  Transparent color: none
  Interlace: None
  Intensity: Undefined
  Compose: Over
  Page geometry: 5669x5661+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: None
  Orientation: TopLeft
  Properties:
    date:create: 2022-09-07T21:52:16+00:00
    date:modify: 2022-09-07T21:52:16+00:00
    signature: 5bac5329714ca28bdbb0c9c493b5c343d31480b4d93dfa26735c6872b81c0e9c
    tiff:alpha: unspecified
    tiff:endian: lsb
    tiff:photometric: RGB
    tiff:rows-per-strip: 1
  Artifacts:
    verbose: true
  Tainted: False
  Filesize: 183.676MiB
  Number pixels: 32.0922M
  Pixels per second: 3399600P
  User time: 0.610u
  Elapsed time: 0:10.439
  Version: ImageMagick 7.1.0-20 Q16-HDRI x86_64 2022-01-22 https://imagemagick.org

 

 

https://github.com/ImageMagick/ImageMagick/files/9883343/Archive.zip

Participant
December 2, 2022

Also, verify you've got LR 12.0.1 installed.


Okay, I just upgraded to Lightroom 12 / Photoshop 2023. Opening both existing images in Photoshop still looks different (one is slightly bluer than the other). If you overlay both images on top of each other, then set the top layer to difference, merge them, then use the magic wand @ tolerance 1, you'll see it doesn't select the entire image (which it should if they were actually identical). I haven't tried importing them into Lightroom (or doing a more recent conversion) - this is just with the old images I uploaded.