Jump to content
You must now use your email address to sign in [click for more info] ×

Affinity silently assigns wrong ICC profiles when opening and exporting images (V1 and V2)


YourMJK

Recommended Posts

I just discovered this and I'm a bit shocked.  
This bug means that all screenshots I've edited with Affinity Photo have slightly wrong colors due to a wrong ICC profile embedded in the exports.

When you open an image file with an embedded ICC profile, Affinity will first check if there is a profile with the same ASCII name ('desc' tag aka. Localized description strings) installed on the system.  
If yes, it will use this one as the workspace/document profile over the original embedded one (this causes colors to be inaccurately displayed!). This is also the profile embedded in the export, unless explicitly specified otherwise.  
You can see this in Finder on the exported file which shows the "real" name.  
Only if the embedded profile's ASCII name is unique, it will use the embedded profile.

You would expect that Affinity always uses the embedded profile or at least matches them based on the XYZ tristimulus values and response curves of the profiles.  
Not based on some non-unique description string.

Reproduce:  

  • Have multiple profiles with ASCII name "Display" installed under /Library/ColorSync/Profiles/Displays/. This is tricky, I don't know how many or how the files should be named to guarantee that Affinity always chooses the "wrong one" (not the actual internal display's profile) to deduplicate all. Knowing the source code would be helpful here.
  • Take a screenshot. Finder should say something like "Color LCD" in the color profile metadata.
  • Open screenshot with Affinity Photo V1 (1.10.6) or V2 (2.0.3) and export as PNG with "ICC profile: Use document profile", "Embed ICC profile: yes", "Embed metadata: yes".
  • Look at exported file with Finder. It should/could say something different now in the color profile metadata.

macOS Monterey 12.6.2, MacBookPro M1 16".

Background:  
When you take a screenshot using macOS's built-in tool, it embeds the ICC profile of the monitor into the PNG file (which is good, since this will help with accurately showing the correct colors on different displays) as opposed to something like sRGB.  
This profile is usually under /Library/ColorSync/Profiles/Displays/Color LCD-*.icc (depends on your internal display, you can find it through the ColorSync Utility) and it has the ASCII name "Display" as metadata. That's also the name shown in Affinity.

Now you might have lots of ICC profiles in /Library/ColorSync/Profiles/Displays/ of other displays you had previously connected (years/decades ago perhaps) and most of these will also have an ASCII name of "Display".  
Note that this is not the name shown in Finder etc.! That shows the multi-localized description `dscm`, e.g. "Color LCD", "Thunderbolt Display", "DELL <model>" etc.

In my case, every screenshot I took on my wide gamut Display P3 display got converted/interpreted with the RGB primaries of some 20 year old Dell display after I opened it in Affinity because apparently that's the first *.icc file with the ASCII name "Display" that it matched.  
Document > Assign ICC profile… doesn't work since it deduplicated all profiles with this name to that Dell one, so it only lists this one under "Display".

Workaround:  
Either delete/move all profiles in /Library/ColorSync/Profiles/ with "Display" as the ASCII name if you don't need them anymore or rename them so they are all unique.  
You can lookup and change that name by opening the .icc file with the ColorSync Utility and going to 'desc'/Localized description strings > ASCII Name.

If you move them to a different location, make sure it's not still inside /Library/ColorSync/Profiles/ or ~/Library/ColorSync/Profiles/.

Now of course this only helps with screenshots you create on your computer but the issue still persists when you open other people's file!

It's embarrassing for Affinity to handle color profiles so carelessly and intransparent for the user. You should fix this ASAP.

Link to comment
Share on other sites

 

How did it come you got multiple different profiles sharing the same name?
The calibration software i‘m aware of creates a unique name when calibrating to avoid this issue, containing Display make/model and timestamp. 

Mac mini M1 A2348 | Windows 10 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080

LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5

iPad Air Gen 5 (2022) A2589

Special interest into procedural texture filter, edit alpha channel, RGB/16 and RGB/32 color formats, stacking, finding root causes for misbehaving files, finding creative solutions for unsolvable tasks, finding bugs in Apps.

 

Link to comment
Share on other sites

@NotMyFault macOS automatically created them over the years whenever I attached a display.
They are also copied over when you migrate machines through TimeMachine or Migration Assistent.

They do of course contain timestamp, manufacturer and all sorts of other metadata but they all have the same "ASCII Name" in "Localised description strings".  
Their actual name (shown in Finder, ColorSync Utility, Preferences etc.) is different.

See the attached profiles. "Color LCD" is the MacBook's internal one, the other three are older external displays. All four have ASCII name "Display".

Color LCD-37D8832A-2D66-02CA-B9F7-8F30A301B230.icc Thunderbolt Display-8D473DEC-366A-4232-AC22-0027A548D55D.icc LED Cinema Display-82B0B317-2947-5615-1D46-AEB4167B03CA.icc DELL U2212HM-C74F0953-E6A6-A1A5-A17E-2186A9E122C7.icc

Link to comment
Share on other sites

That is potentially a nasty bug. FWIW, I use an X-rite calibrator and it tends to use the monitor name as the prefix, so it's often going to start with the same names. I never intentionally use these in my images though...

When you say these are screenshots, do you mean that you paste from clipboard and it converts? In Windows 10, whenever I dump the clipboard into the program, it converts to whatever I have set to as my RGB working space (Adobe 1998 in this case). Macintosh may include certain profiles by default that it "connects" your monitor with, so it could be Mac is adding a color profile (Edit: I see you explained that here essentially). I did check with a small clipboard viewer in Windows to see if there was any color profile data, but looks like it is just simple bitmap data.

image.png.7cf0082f5eea31aae211702976f4b785.png

Out of curiosity, what are your color settings for your RGB color profile(s)?

image.png.a9af31867e10075babcb16f3ca60e08f.png

Link to comment
Share on other sites

Screenshots on Mac are different. You click a shortcut, and the OS stores the images as files in a chosen folder, not in the clipboard (except pressing another modifier key which i always forget)

So the OS is embedding the profile, no user involved, not configurable.

https://support.apple.com/en-us/HT201361

Mac mini M1 A2348 | Windows 10 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080

LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5

iPad Air Gen 5 (2022) A2589

Special interest into procedural texture filter, edit alpha channel, RGB/16 and RGB/32 color formats, stacking, finding root causes for misbehaving files, finding creative solutions for unsolvable tasks, finding bugs in Apps.

 

Link to comment
Share on other sites

@debraspicher What @NotMyFault said.
I also want to add that macOS doesn't convert the actual 8bit RGB values by converting from e.g. Display P3 to sRGB. It just embeds the correct ICC profile of the display and keeps the native values.

I'm using sRGB as the default profile for both 32bit and 16bit/8bit.  
The rest is the same as in your screenshot, except for that HDR checkbox.

Link to comment
Share on other sites

  1. I hope Affinity will rate this as bug and fix it.
  2. Apple has its share to the issue as giving multiple file with different content the same description is no good practice
  3. As a workaround i would suggest to try using screenshot-2-clipboard with ctrl-modifier key, and paste to Photo. I hope this will convert to a standardized profile. Using device profiles within documents tends to break things, as we see again here.

 

Mac mini M1 A2348 | Windows 10 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080

LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5

iPad Air Gen 5 (2022) A2589

Special interest into procedural texture filter, edit alpha channel, RGB/16 and RGB/32 color formats, stacking, finding root causes for misbehaving files, finding creative solutions for unsolvable tasks, finding bugs in Apps.

 

Link to comment
Share on other sites

I wonder if this will cause problems when there are multiple profiles on the machine from different vendors?

For example, different vendors install their own sRGB profiles, but they differ in accuracy, so assigning the wrong one by accident can throw the colours out.

After installations and updates, I tend to review all the ICC profiles on my machine to unclutter selection lists and make it easier to use the same profile each time. Anything I don't use, I put aside in a ZIP file in case it is needed down the track.

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.