• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Lossless TIFF->DNG conversion isn't lossless?

New Here ,
Dec 01, 2022 Dec 01, 2022

Copy link to clipboard

Copied

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.

TOPICS
macOS , Windows

Views

1.2K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 01, 2022 Dec 01, 2022

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 01, 2022 Dec 01, 2022

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 01, 2022 Dec 01, 2022

Copy link to clipboard

Copied

Hmm, when I first imported the two files in LR 12.0.1, they looked identical. But when I did Edit In Photoshop > Edit Original, they looked different -- the DNG was darker.  But then I noticed that my PS was a few versions behind, so I updated it to 24.0.1, and I no longer see the problem.  The files look identical in both LR and PS.  I converted the .tif to a new DNG, and they looked identical as well.

 

So as a next step, verify that you've got PS 24.0.1 installed by doing Help > System Info. If not, then do Help > Updates.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 01, 2022 Dec 01, 2022

Copy link to clipboard

Copied

Also, verify you've got LR 12.0.1 installed.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 02, 2022 Dec 02, 2022

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 02, 2022 Dec 02, 2022

Copy link to clipboard

Copied

@Tyler24543249j9e0, I just noticed that "resized.tif" doesn't have a color profile assigned, while "resized.dng" is assigned Prophoto RGB.  Depending on your Photoshop's Color Settings, that would account for the difference you're seeing.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 04, 2022 Dec 04, 2022

Copy link to clipboard

Copied

That probably accounts for some of the difference, but not all of it as far as I can tell. I'm fully expecting there to be other settings like that, where DNG converter made certain assumptions as a result of there being zero metadata in the scans. I'd just like to find out what those assumptions are.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 04, 2022 Dec 04, 2022

Copy link to clipboard

Copied

quote

That probably accounts for some of the difference, but not all of it as far as I can tell. I'm fully expecting there to be other settings like that, where DNG converter made certain assumptions as a result of there being zero metadata in the scans. I'd just like to find out what those assumptions are.


By @Tyler24543249j9e0

 

I took a 16-bit TIFF in ProPhoto RGB and converted it to a DNG in ACR. 

I then saved that DNG back as a TIFF in the same color space. 

I opened each (TIFF original, TIFF1 from DNG); they are pixel-for-pixel identical. 

ALL embedding a TIFF into a DNG does is embed the TIFF into the DNG (if of course, you have the conversion to DNG properly setup to do just that). 

Author “Color Management for Photographers" & "Photoshop CC Color Management/pluralsight"

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 04, 2022 Dec 04, 2022

Copy link to clipboard

Copied

LATEST

"That probably accounts for some of the difference, but not all of it as far as I can tell. I'm fully expecting there to be other settings like that, where DNG converter made certain assumptions as a result of there being zero metadata in the scans. I'd just like to find out what those assumptions are."

 

Test your hypothesis:

 

1. Open "resized.tif" in PS and assign it a color profile with Edit > Assign Profile. Save the file.

 

2. Import that file into LR and do Library > Convert Photo To DNG to make "resized.dng".

 

3. Copy one of the photos onto the other as a second layer.

 

4. Set the blending mode to Difference and then do Flatten Image.

 

5. Do Levels to inspect the histogram of pixel values -- they're all perfectly black, representing no difference between the photos:

johnrellis_0-1670194536714.png

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 02, 2022 Dec 02, 2022

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 02, 2022 Dec 02, 2022

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 02, 2022 Dec 02, 2022

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 02, 2022 Dec 02, 2022

Copy link to clipboard

Copied

Sorry no, the rendered RGB TIFF has no further or better White Balance or any other tone or color capabilities in the DNG container than outside the container. It's a fully rendered TIFF. Ditto with a JPEG.

Author “Color Management for Photographers" & "Photoshop CC Color Management/pluralsight"

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines