Request to read TIFF Tag PrimaryChromaticities

Hier diskutieren die Betatester von PhotoLine untereinander und mit den Entwicklern
Benutzeravatar
shijan
Mitglied
Beiträge: 1528
Registriert: Mo 23 Dez 2019 15:21
Wohnort: Ukraine

Request to read TIFF Tag PrimaryChromaticities

Beitrag von shijan »

I noticed that "raw" tiff film scans from Noritsu minilab scanner have unusual Primary Chromaticities tag If check image metadata in Media Info. Probably it is used instead of input ICC profile.
I find some specification info here: https://www.awaresystems.be/imaging/tif ... ities.html
TIFF Tag PrimaryChromaticities
IFD Image
Code 319 (hex 0x013F)
Name PrimaryChromaticities
LibTiff name TIFFTAG_PRIMARYCHROMATICITIES
Type RATIONAL
Count 6
Default None
Description

The chromaticities of the primaries of the image.

This is the chromaticity for each of the primaries when it has its ReferenceWhite value and the other primaries have their ReferenceBlack values. These values are described using the 1931 CIE xy chromaticity diagram and only the chromaticities are specified. These values can correspond to the chromaticities of the phosphors of a monitor, the filter set and light source combination of a scanner or the imaging model of a rendering package. The ordering is red[x], red[y], green[x], green[y], blue[x], and blue[y].

For example the CCIR Recommendation 709 primaries are:
640/1000,330/1000,
300/1000, 600/1000,
150/1000, 60/1000
:arrow: Is it possible to "learn" PhotoLine to read this tag as ICC profile?

I also noticed that if i open image in PhotoLine and export TIFF, it erases this tag.

I can provide TIFF image sample if it helps.

Bild
PhotoLine UI Icons Customization Project: https://www.pl32.com/forum3/viewtopic.php?f=3&t=6302
Benutzeravatar
shijan
Mitglied
Beiträge: 1528
Registriert: Mo 23 Dez 2019 15:21
Wohnort: Ukraine

Re: Request to read TIFF Tag PrimaryChromaticities

Beitrag von shijan »

Same thing available in PNG specification
https://www.w3.org/TR/REC-png-961001#C.cHRM
4.2.2. cHRM Primary chromaticities and white point
Applications that need device-independent specification of colors in a PNG file can use the cHRM chunk to specify the 1931 CIE x,y chromaticities of the red, green, and blue primaries used in the image, and the referenced white point. See Color Tutorial (Chapter 14) for more information.

The cHRM chunk contains:

White Point x: 4 bytes
White Point y: 4 bytes
Red x: 4 bytes
Red y: 4 bytes
Green x: 4 bytes
Green y: 4 bytes
Blue x: 4 bytes
Blue y: 4 bytes

Each value is encoded as a 4-byte unsigned integer, representing the x or y value times 100000. For example, a value of 0.3127 would be stored as the integer 31270.

cHRM is allowed in all PNG files, although it is of little value for grayscale images.

If the encoder does not know the chromaticity values, it should not write a cHRM chunk; the absence of a cHRM chunk indicates that the image's primary colors are device-dependent.

If the cHRM chunk appears, it must precede the first IDAT chunk, and it must also precede the PLTE chunk if present.

See Recommendations for Encoders: Encoder color handling (Section 9.3), and Recommendations for Decoders: Decoder color handling (Section 10.6).
PhotoLine UI Icons Customization Project: https://www.pl32.com/forum3/viewtopic.php?f=3&t=6302
Martin Huber
Entwickler
Entwickler
Beiträge: 4176
Registriert: Di 19 Nov 2002 15:49

Re: Request to read TIFF Tag PrimaryChromaticities

Beitrag von Martin Huber »

Please send me a sample file.

Martin
Benutzeravatar
shijan
Mitglied
Beiträge: 1528
Registriert: Mo 23 Dez 2019 15:21
Wohnort: Ukraine

Re: Request to read TIFF Tag PrimaryChromaticities

Beitrag von shijan »

Here is original file with PrimaryChromaticities Tag https://drive.google.com/file/d/1bUEkMk ... sp=sharing
PhotoLine UI Icons Customization Project: https://www.pl32.com/forum3/viewtopic.php?f=3&t=6302
Benutzeravatar
shijan
Mitglied
Beiträge: 1528
Registriert: Mo 23 Dez 2019 15:21
Wohnort: Ukraine

Re: Request to read TIFF Tag PrimaryChromaticities

Beitrag von shijan »

WOW! It now works in 23.90b2. Even more - i can export those PrimaryChromaticities as ICC profile.
PhotoLine UI Icons Customization Project: https://www.pl32.com/forum3/viewtopic.php?f=3&t=6302