Bug? macOS Sierra Preview/Quick Look issues with rendering colors of images when using any icc profile other than the macOS standard

I had this problem with High Sierra, Preview, and a DisplayCal profile.

The latest version of DisplayCal, 3.5, has in its release notes:

Mac OS X: Set default profile type to single curve + matrix with black point compensation due to long-standing Mac OS X bugs with any other profile type.

Upgrading DisplayCal and creating new profiles for each of my displays based on the Default profile solved the problem for me. The profile is probably not as descriptive as it could be, but at least Preview/Quick Look work.


(After reading all the literature I could find around the issue here's what I've learned)

A disclaimer first

There is a chance (as @Mr.Kennedy points out) that your system is suffering from issues with the quicklook generator. You may wish to read first his very thorough details on clearing the cache and debugging qlamanager's process of generating the thumbnails/previews. If you are certain the actual thumbnails/previews generated are fine, read on!

the Problem

Description of the problem

Apple programs and programs that depend on ColorSync CMM's capabilities, exhibit under some conditions crushed black colors and gamma issues.

Programs affected

  • Preview
  • Quick Look (when zoomed in)
  • Certain versions of Lightroom
  • The Export As... preview at Photoshop (the Save for Web (legacy) dialog is not affected on the other hand)
  • Apple Photos App
  • Apple iPhotos App
  • Aperture
  • Quicktime
  • Finalcut Pro X

(the issues affecting QT, FCPX Lr and Aperture may be different, I'm not sure)

Programs (not) affected

  • Quick Look (before zooming in)
  • Finder previews/thumbnails
  • Adobe Bridge
  • all programs who manage their own colors

Specifics

This is an issue (or a family of issues) around ColorSync. Most probably an Apple's bug inside ColorSync or Preview/QuickLook/Photos, that affects some color profiles generated by a few profiling software, but does not affect other profiles at all (such as the factory profiles).

According to some, first ColorSync issues were introduced in Mountain Lion. Others had issues in Mavericks, while others discovered it first in El Capitan. I can verify that it is still present in Sierra though. It's unclear if all these issues were all one and the same, but in here I'll treat them as such.

Adobe is aware of these issues (it was affecting Lightroom up to some version) rectified it since(2), but consequent updates by apple have complicated things since it has reemerged in a different way. There is a lengthy discussion in the Adobe forums(3).

Cause

At the root, it is that certain ICC profiles, contain information that **Apple's ColorSync won't treat properly (and this affects all programs that rely on ColorSync). There have been various ideas proposed as what it is that ColorSync doesn't like about them. This issue has been linked (but inconclusively) to:

  • LUT based icc profiles
  • matrix based icc profiles
  • particular software used to generated the ICC profile (eg displayCal/basICColors).
  • compatibility issues with the ICC version number (ICCv2 or v4 profiles)
  • black point compensation accounted for in the profile curves.
  • EIZO displays
  • Secondary displays

There has been no consensus though. For instance I've seen both ICCv2 and ICCv4 profiles that work, and ICCv2 and ICCv4 profiles that do not.

Solution

No solution has been found yet afaik.

  • From reports, it seems that profiles created with certain programs seem to be "incompatible" while profiles created by other programs seem to be fine.If you are using

    • displayCal (using ArgyllCMS) (aka dispcalGUI)
    • basICColor
    • Eizo ColorNavigator (4)

    this may be the related. testing some other software for profiling, may be the solution for some who have the option

  • Others have reported success with experimenting by changing parameters of the profiles generated (ICC version number, black point compensation, LUT, curves, 3x3 matrix) but nothing definitive.
  • Adobe is implementing its own workarounds(2),(5) (that seem to be falling apart when apple is changing something).
  • One could revert to using the factory profile (for those who don't care about color management) which work fine
  • Needless to say that avoiding ColorSync reliance and using programs that color manage their own output everywhere in your work environment is certainly the most complete solution (but rarely a viable option)

Raising Awareness

You may also wish to add your voice by submitting to Apple a bug report on the issue

Other places where this problem is discussed

I'm listing here some of the other places where these issues are being discussed

OSX Preview issues

  • Q: Preview+El Capitan = color management bug?
  • Q: wrong colors in preview.app
  • Dark Images in Mac "Photos" & "Preview" with DisplayCAL generated Profile

Adobe Lightroom

  • Lightroom 5 ICC profiles clipped shadows under OSX
  • Serious color management bug in Mac OS 10.9 "Mavericks"
  • Further quantification of the Mavericks color management problem

Finalcut Pro X

  • Q: Very very dark video in FCP X viewer.

Here's a primer on ColorSync and Apple's color management. If the following doesn't help resolve the color shift when zooming in on QuickLook previews, then I suggest you submit a bug report to Apple: https://developer.apple.com/bug-reporting/

"The strangest thing is that on the quicklook preview, the colors will be fine until I zoom in the image: After that it will darken, and never recover (until I reopen the preview)."

Have you used the ColorSync Utility? From the Finder Cmd⌘+Shift+u will get you to the /Applications/Utilities/ directory where ColorSync Utility.app lives.

Check for all Quick Look files:
/Library/QuickLook/
/System/Library/QuickLook/
/Users/<user_name>/Library/QuickLook/

Are there any duplicate or conflicting *.qlgenerator files? Also, and per the above article try:

First try running a permissions fix on the boot drive using Disk Utility to ensure that the Quick Look plug-ins and other files the Quick Look server needs are properly accessible, and then force Quick Look to reload the plug-ins and its cache by running the following commands in the Terminal:

qlmanage -r
qlmanage -r cache

After this is done, clear out the Quick Look configuration files by going to the /username/Library/Preferences folder (in Lion press the Option key and select "Library" from the Finder's Go menu), and then removing the files called "com.apple.quicklook.ui.helper.plist," "com.apple.quicklookconfig.plist," and "com.apple.QuickLookDaemon.plist." With these files removed and the Quick Look service reloaded, try previewing your documents again.

Are there any duplicate or conflicting *.icc profiles in
/Library/ColorSync/Profiles/
/System/Library/ColorSync/Profiles/
/Users/<user_name>/Library/ColorSync/Profiles/

It might help if you rebooting - maybe "zap the PRAM" (NVRAM) as well: hold Option+Cmd⌘+p+r and let the computer chime at least three times while restarting then let go of the keyboard kung-fu grip.

Also, per MacIssues.com: check the Cache files in ~/Library/Caches/com.apple.QuickLookDaemon/
~/Library/Caches/qlmanage/

In addition, you can try removing the QuickLook caches manually, which can be done by opening the user library from the Finder’s Go menu (if it is missing from this menu, hold the Option key to reveal it). Then open the Caches folder in the window that appears and locate and remove the folders called “qlmanage” and “com.apple.QuickLookDaemon.” When finished, log out and back in to your system and try using QuickLook again.

Lastly, here are some Apple developers notes for debugging - perhaps the tool qlmanage can help you to ascertain the cause of this problem:

per man qlmanage

1.  qlmanage -r resets Quick Look Server and all Quick Look client's generator cache.

2.  qlmanage -m gets all sort of information on Quick Look server including the list of detected generators.

3.  qlmanage -t displays the Quick Look generated thumbnails (if available) for the specified files.

4.  qlmanage -p displays the Quick Look generated previews for the specified files.

5.  qlmanage -h displays extensive help.

Oddly, per the answers to this stack overflow question, you will never know if Apple notices or addresses your bug. At best, I suppose you can try and narrow down the cause.