Author Topic: Feature Request: Specifying numerator and denominator explicitly for rational  (Read 4122 times)

koba

  • Newbie
  • *
  • Posts: 5
Hello,

It would be useful to be able to specify numerator and denominator for rational, instead of specifying floating number. For example, I would like to specify something like "-Gamma=22/10" instead of "-Gamma=2.2".

It seems that Canon Digital Photo Professional (DPP) identifies the TIFF file's color space as "AdobeRGB" only if there are tags ColorSpace, Gamma, WhitePoint, and PrimaryChromaticities with appropriate values, and the denominators for these rational values are predefined values (i.e. 10 for Gamma, 1000 for WhitePoint, 100 for PrimaryChromaticities). Current exiftool writes rational "11/5" for value "2.2", and it causes DPP to identifies the file's color space as "Other".

Thanks

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16902
    • ExifTool Home Page
Wow.  Can this be true that DPP is so stupid?  I'll look into this.

Adding control over the numerator/denominator would be a bit of work.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

koba

  • Newbie
  • *
  • Posts: 5
Hi Phil,

Thank you for your prompt reply. I used the 16-bit TIFF file generated by an old film scanner Dual III. DPP detects the TIFF file as "sRGB". By adding some tags as:

exiftool -overwrite_original -ColorSpace=Uncalibrated -Gamma=2.2 '-WhitePoint=0.313 0.329' '-PrimaryChromaticities=0.64 0.33 0.21 0.71 0.15 0.06' Image01.tif

DPP identifies it as "Other". I compared the file with the DPP-generated TIFF file, and found that rational for Gamma and some of
the values of PrimaryChromaticities are different. So I used a binary editor to modify these values, then DPP identified it as "AdobeRGB".

Regards,
koba

koba

  • Newbie
  • *
  • Posts: 5
Hi,

I could reproduce it with JPEG files. Unfortunately, it turned out that this is not only the problem of the name of color space. DPP-generated AdobeRGB JPEG file has Gamma value of "22/10" and is identified as "AdobeRGB". However, rewriting the Gamma value into "11/5" causes it to be identified as "Other", and the histogram to be changed. I tested with DPP version 3.8.1.0.

Regards,
koba

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16902
    • ExifTool Home Page
Hi Koba,

Thanks for the details.

I looked at my code and I think I may be able to implement your suggestion more easily than I thought.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16902
    • ExifTool Home Page
This is now implemented in ExifTool 8.33

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

koba

  • Newbie
  • *
  • Posts: 5
Hi Phil,

Thank you! I confirmed that the file modified by following command is treated as "AdobeRGB" in DPP.

exiftool -overwrite_original -ColorSpace=Uncalibrated -Gamma=22/10 '-WhitePoint=313/1000 329/1000' '-PrimaryChromaticities=64/100 33/100 21/100 71/100 15/100 6/100' Image01.tif

Regards,
koba

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16902
    • ExifTool Home Page
Hi Koba,

Thanks for the confirmation.

This should really be considered a bug in the Canon DPP software.  It should not be sensitive to the individual components of a rational value since just the quotient is significant.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

koba

  • Newbie
  • *
  • Posts: 5
Hi Phil,

I agree with you from the technical point of view. To my surprise, however, the DCF 2.0 specification defines each components of rational values. Please see "5.4.4.4 Color space" in CP-3461A document for example. So it might be possible that Canon DPP just wanted to conform to the spec.

Regards,
koba

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16902
    • ExifTool Home Page
Good point.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).