profile conversion incomplete w/o metadata update

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
mikmach
Posts: 38
Joined: 2015-02-06T07:50:43-07:00
Authentication code: 6789

profile conversion incomplete w/o metadata update

Post by mikmach » 2016-10-31T08:10:52-07:00

Profile conversion is incomplete without updating of relevant metadata fields.

Note: for proper review of problem you may need to download all files into your disk and use program like Windows Photography Viewer (built-in Windows app) which are understanding color management partially.

Lets take into account file:
https://drive.google.com/open?id=0B6_Yh ... FNpTHo2MDg
File is in AdobeRGB
Convert it with IM

Code: Select all

convert file.jpg -profile sRGB.icc file-srgb.jpg
Result is:
https://drive.google.com/open?id=0B6_Yh ... HdZZGFpdTg

It was successully converted into sRGB and programs with advanced color management support will display it properly because the will dive into guts of embedded profile but less advanced programs will look into metadata and still will see 'Adobe RGB'. When I do conversion with Photoshop file looks like below:
https://drive.google.com/open?id=0B6_Yh ... F81NFFVVjA

Not only file is converted but all relevant metadata fields are updated. You can check with exiftool (don't mind minor profile description differences for different versions of sRGB profile). The real problem is with IM not updating field EXIF:ColorSpace (and XMP:ICCProfileName - but only EXIF is really important).

Solution is to update field with:

Code: Select all

exiftool -EXIF:ColorSpace=sRGB "-XMP:ICCProfileName<ICC_Profile:ProfileDescription" -o file-srgb-etcorr.jpg file-srgb.jpg
Result:
https://drive.google.com/open?id=0B6_Yh ... 3RMMERUSE0

But it is really only bandaid. I understand that IM is graphics manipulation program and doesn't want to dive into this galaxy of problems but some minimum is required for proper interoperability with other programs (at least mention in documentation about possible problems would be cool).

IM version:

Code: Select all

Version: ImageMagick 6.9.3-5 Q8 x64 2016-02-20 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Visual C++: 180040629
Features: Cipher DPC Modules OpenMP
Delegates (built-in): bzlib cairo freetype jng jp2 jpeg lcms lqr openexr pangocairo png ps rsvg tiff webp xml zlib

Post Reply