We have a TIFF with two profiles in different sections. It was produced by Adobe PhotoShop CS6. The 8bim header (photoshop:ICCProfile) contains an aRGB 1998 profile blob. The tiff:ICC_PROFILE section (tag 0x8773) also contains an Adobe RGB 1998 profile blob (where it usually is).
ImageMagick seems to be getting confused when this is the case and reading both profiles and concatenating them.
Code: Select all
`convert in.tiff -profile sRGB_IEC61966-2.1.icc out.jpg`
The resultant file has the two profiles "stacked" on top of one another.
The particular sRGB profile we used is 3144 bytes, and the aRGB profile is 560 bytes.
Code: Select all
`identify -verbose out.jpg`
Code: Select all
Profile-icc: 3704 bytes
Description: Adobe RGB (1998)
Manufacturer: Adobe RGB (1998)
Model: Adobe RGB (1998)
Copyright: Copyright 1999 Adobe Systems Incorporated
As you can see, it's counting the profile length as the two profiles concatenated. The 8bim section is preserved, along with the aRGB blob, and the APP2 section contains the sRGB blob.
Code: Select all
`convert out.jpg profile.icc`
Upon inspecting the profile that ImageMagick extracts from the file, it is indeed the two concatenated, first appears the Adobe profile, then the sRGB profile.
ImageMagick seems to be getting the colorspaces confused because of this, and is therefore producing the wrong image. Furthermore, if you keep running convert commands with with a -profile option, it will keep concatenating more profiles to this section as long as the photoshop:ICCProfile section is there.
Anyway, this may just be a case of only choosing one profile as the canonical profile section if both photoshop:ICCProfile and the {tiff:ICC_PROFILE, APP2} sections are present.
[*] input tiff: https://dl.dropbox.com/u/20028715/in.tiff
[*] output jpeg: https://dl.dropbox.com/u/20028715/out.jpg
[*] sRGB profile: https://dl.dropbox.com/u/20028715/sRGB.icc
[*] resultant profile: https://dl.dropbox.com/u/20028715/profile.icc
Kevin