Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Colour wrong for images only tagged via DCF EXIF #2066

Open
paperboyo opened this issue Jul 5, 2017 · 2 comments · May be fixed by #3497
Open

Colour wrong for images only tagged via DCF EXIF #2066

paperboyo opened this issue Jul 5, 2017 · 2 comments · May be fixed by #3497

Comments

@paperboyo
Copy link
Contributor

paperboyo commented Jul 5, 2017

Hello,

This affects all frontend display of images sent straight from cameras that are set to record AdobeRGB, e.g. images from Tom Jenkins

grid-dcf-exif-bug

Camera makers often do not actually embed ICC profiles in camera JPEG images (I’ve tested two from Canon and Nikon). Instead they use DCF EXIF tags to specify sRGB or AdobeRGB (pt. A2). Grid does not recognise this and treats these images as untagged. That is no problem for sRGB images as they are assumed to be sRGB anyway, but colour saturation/tonality suffers for images tagged as AdobeRGB. This affects both Grid’s thumbnails and all exports (including a master asset!).

For all JPEG images of an RGB colour model that do not explicitly have embedded ICC profiles, we should read both 0xa001 ColorSpace and 0x0001 InteropIndex EXIF tags and explicitly embed AdobeRGB before performing any image operations when
0x0001 InteropIndex = 'R03' = R03 - DCF option file (Adobe RGB)
and
0xa001 ColorSpace = 0x2 = Adobe RGB
(this pertains only to untagged images; when there is a ICC profile present, it should always take precedence even if the above tags are set)

GraphicsMagick does not identify 0x0001 InteropIndex, so unless we are willing to contribute and update it, we can look into using exiftool to do it. Or maybe metadata-extractor itself (we would most probably need to import additional EXIF directory (?)).

Regards
Mateusz

@paperboyo paperboyo changed the title Colour wrong for images only tagged _via_ DCF EXIF Colour wrong for images only tagged via DCF EXIF Jul 5, 2017
@paperboyo
Copy link
Contributor Author

paperboyo commented Jun 13, 2018

Yeah, so take affected 45c71141a66d7dcc61fd0e09eb90d8c1c1d091b2.

Read that there is no embedded ICC profile:
fileMetadata:xmp:icc{}

Then read
fileMetadata:exifSub:Color Space:"Undefined" and don’t worry, it means AdobeRGB

then read something we do not currently read (?)
https://github.com/drewnoakes/metadata-extractor/blob/master/Source/com/drew/metadata/exif/ExifDirectoryBase.java#L618 [EDITED]
then apply AdobeRGB profile.

And enjoy correct colour (left):
image

@paperboyo paperboyo added the bug label Jul 12, 2018
@sihil sihil added the To Review PRs that need to be reviewed label Sep 8, 2020
@paperboyo paperboyo removed the To Review PRs that need to be reviewed label Sep 8, 2020
@paperboyo paperboyo linked a pull request Oct 10, 2021 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
@sihil @paperboyo and others