Force RGB mode in Mac OS X to fix the picture quality of an external monitor

I recently bought a MacBook Pro (with ‘Retina’ screen), but when I hooked it up to my Dell U2410 monitor via HDMI cable I was shocked by the poor picture quality. The contrast was all wrong and text was misshapen. No amount of calibration in the monitor or software would fix it.

Short answer: OS X thinks my monitor is a TV, and is using the YCbCr colour space rather than RGB. I had to override an EDID setting to force the RGB colour space, and it is now working correctly.

Long answer: I haven’t owned a Mac for a while and had forgotten how difficult much of the “Apple community” can be when it comes to anything that can’t be adjusted in System Preferences. Googling for problems with external monitors on MacBooks found dozens of threads on official and unofficial Apple forums, all full of people with the same problem. The most common response was to blame the monitor, despite assurances from the stricken users that the monitor worked beautifully in Linux and Windows, even on the same machine under Boot Camp.

“You just haven’t calibrated it!”, “You are just too used to Retina now!”, “You just need to buy a Thunderbolt display!” Apple people also like to solve problems by throwing more money at it. (I realise that owning a Mac makes me an Apple person, too. Hypocritical self-loather?)

My lucky break was reading that the current colour space was “YCbCr” when I was browsing the monitor’s settings menu. I was sure that it was using RGB when hooked up to my PC, so I started searching instead for forcing RGB mode in OS X. It didn’t appear to be available out-of-the-box, but I have had some experience in overriding EDID settings for similar purposes so I searched instead for that.

I found this thread on the EmbDev.net forums. Mr Schwarz, thanks very much. Your thread and script was incredibly helpful and informative. It was written to fix problems connecting an external monitor via DisplayPort, but it fixed my HDMI issue just the same. I’ve summarised the required steps below.

My last word is to wonder what Apple is playing at. It seems that this problem has been reported by a lot of people for a long time, and I expect it would require a fairly simple software update. Do they just not care about those using third-party components, or are they actively attempting to force people on to Thunderbolt displays?

How to force RGB in Mac OS X

These steps have been updated for Mac OS version 10.11, “El Capitan”. See below for differences for previous versions of the system.

  1. Download the patch-edid.rb script from the forums thread above, or download Andrew Daugherity’s improved patch-edid.rb script from his github page. Put the script in your home directory.
  2. Disable “rootless” mode, you can follow these instructions: How to modify System Integrity Protection in El Capitan.
  3. Reboot.
  4. Connect only the external monitor(s) in question, if you can (I closed my MacBook lid, for example). The script will make override files for any connected monitor.
  5. Type “ruby patch-edid.rb” in Terminal.
  6. A new folder will be created in your home directory. Move it into the “/System/Library/Displays/Contents/Resources/Overrides” folder. If Finder tells you that you are overwriting an existing folder, consider backing it up first.
  7. Restart your computer. The picture quality should be fixed from this point.
  8. Re-enable “rootless” mode, the instructions are available on the same guide: How to modify System Integrity Protection in El Capitan.
  9. Reboot. Enjoy your monitor.

To undo the changes, either delete the folder you had copied to the Overrides folder (if it didn’t already exist) or replace it with the folder you had backed up. You will need to re-enable rootless mode to do this.

Earlier versions of Mac OS X

The process is a little more straightforward. There are two differences to the steps above:

  1. You do not need to disable/re-enable rootless mode and perform the subsequent reboots.
  2. The overrides folder location is “/System/Library/Displays/Overrides”.

Updates

I no longer own a Macbook Pro, but if you’re having trouble with any of these steps, please have a look through the comments below (and note that there are multiple pages). Many questions have been answered with helpful tips from others.

Update, 8 Feb 2016: A comment from nos1609 below, warns about a bootloop that can occur when running other patches (like the pixel-clock patch) simultaneously, and how to get around it.

Update, 23 Nov 2015: According to Peter’s post, you don’t need to disable SIP if you use recovery mode. If others have similar success with this method I’ll update the process.

Update, 3 Oct 2015: I have amended this post to target El Capitan. I have taken the steps from bigmcguire’s process, posted in the comments. Although some are still having issues, it appears to be working for people. Thanks!

Update, 29 May 2015: Mac OS 10.11 El Capitan does things a little differently. You must first disable the new ‘rootless’ mode and then use a different overrides folder: /System/Library/Displays/Contents/Resources/Overrides. Rootless can then be re-enabled if desired, as confirmed by nos1609 in the comments below. El Capitan is still in beta, I’ll update this post if the issue is still apparent afterwards.

Update, 26 May 2014: If you have had trouble with limited resolutions being available after the fix, check out Ibrahim’s comments here.

Update, 28 Nov 2013: If the process appears to work but doesn’t seem to make a difference, consider Tom’s comments below. Depending on your monitor an extra tweak may be required.

Update, 13 Nov 2013: Andrew comments below that he has modified the script to add some useful new features, and provides a link to his GitHub for those wishing to use it instead.

Update, 27 Oct 2013: If you’ve applied this fix before, the OS X Mavericks update will overwrite it. I’ve successfully re-applied the fix by following exactly the same steps, and other commenters below have done so, too.

825 thoughts on “Force RGB mode in Mac OS X to fix the picture quality of an external monitor

  1. Hello Mathew,

    I’ve just bought my first apple product ever (a 13” rMBP) and three hours later ended up on your website.

    My DELL 2412m has the “smudgyness” issue, aswel. It is connected via HDMI -> DVI. Maybe I should borrow someone’s HDMI -> HDMI cable and see what happens? OS X is fully updated and, if I can trust the color sync utility, both the native and external display are correctly detected as “display” and the color range is RGB. 2412m’s native resolution of 1920×1200 is available and selected.

    I still tried the script you posted about, got the override running, but it had no effect.

    Also tried forcing font AA, still no change.

    I know it’s a software issue since booting in windows makes the external display look as amazing as it should be, but I’ve no idea where to go next with this..

    Any help would be greatly appreciated.

  2. Didn’t work for my Samsung monitor, im not sure I put the patch in the right place but O have no idea where to find the home directory, when I run the command in terminal it just says “ruby patch-edid.rb”
    -bash: “ruby: command not found.

    any help would be greatly appreciated!

  3. Pingback: The Silverstone SG05 “steambox” and HTPC | i reckon

  4. Thank you Mathew! The picture quality is much better, however I’m still running into a slight problem. I’m using a Seiki 48″ 1080p 60hz tv as my external and it seems like the size is off. The screen is too big for the monitor. When I use display preferences, the option to scale the display is no longer there. Any extra help would be appreciated. Thanks!

    • In Windows I use the ATI or Nvidia settings to do this, but I’m afraid I’ve not had to deal with it with the Mac. Hopefully someone else can help you out.

  5. Pingback: Anonymous

  6. @mathew where specifically do you mean by “home directory”? and can i leave my macbook retina lid open if i need to type the command? thanks

    • By home directory I mean your user folder. When you open up Terminal that’s where you are first put, so if you run this script the results are created in that location. Not sure what your level of expertise is with the command line, so check out this if you are unsure: http://blog.teamtreehouse.com/introduction-to-the-mac-os-x-command-line

      For your other question see my reply to azran on April 22nd. I think it will just generate files for both screens, and you will have to determine which one was created for the external screen and use that.

  7. Thanks for posting. This solved my problems. The number of people suffering from this is problem in ignorance is probably very high. I wonder if it isn’t a strategy to drive sales towards apple displays.

  8. Hi,

    I’ve changed line 7 as suggested above to be “data=`ioreg -l -d0 -r -w0 -c AppleDisplay`” but still receive the error:

    undefined method `[]’ for nil:NilClass (NoMethodError)

    Any other suggestions?

    • I’m not sure why this didn’t work for you. Try running “ioreg -l -d0 -r -w0 -c AppleDisplay” in a terminal window and see what the result is.

  9. Matthew, thank you thank you thank you for digging this up. The blurriness issue was driving me crazy! I should have known something was up when I couldn’t reproduce the issue on my TV, but the colors on my Asus PA248Q seemed just that tiny bit off. This is so much better.

    Thanks again. If you ever should find yourself in San Francisco (or me in your neck of the woods), I owe you a lot of beers. (-:

  10. I’m connecting an external monitor to a new iMac (27″ late 2012) and having the same issue with blurry text. Since I cannot turn off the main iMac monitor to only display the external display, I can’t run the script above. Any ideas how to fix this problem for an iMac? Thanks.

    • If I recall correctly, when you run the ruby script an override is created for each attached monitor. I’m not 100% sure on this, but I presume you can run the ruby script and then determine which override represents your external monitor before copying just that one to the /System/Library/Displays/Overrides directory.

  11. I’m using 10.8.3 and can confirm this wasn’t fixed in any update to date.
    Thanks a ton for the fix, Dell U2410 here.

    • This is the first I’ve heard about it affecting DisplayPort audio. I would suggest you run the ruby script with only the HDMI attached, then backup any existing folder with the same name as the one created before putting it in the overrides folder. If it affects your DisplayPort audio, revert the changes by deleting the new folder (and reinstating the old one, if applicable).

  12. Thank you, worked perfectly. You saved my brand-new mac-mini, I was preparing to take it back tomorrow.

    I had the washed-out/too-white color issue, and also the fuzzy-text problem. My new mini was already installed with 10.8.3, so whatever fix is in there did not resolve my issue. Your link and clear explanation did the trick. I’m using the HDMI cable without any adapters, and an LG 1920 x 1080 monitor at 1080p.

    “Instant buyer’s remorse” was absolutely the LAST thing I expected upon powering up my new mac mini. Which only got worse upon reading all of the nonsense posted by apple “experts” who have apparently imbibed far too much apple kool-aid over the years. The numerous cheerful suggestions to buy a new Thunderbolt display at $1,000 to solve the problem were particularly unsettling. Thanks for restoring some sanity to the matter!

  13. A minor suggestion: the xml tags in the script on this page are gone, so I’d suggest to escape them, so they are displayed correctly or remove the script altogether. I ended up copying it and pasting into my emacs and only later, when comparing to the existing overrides file that I realized that it was supposed to be an xml and saw the comments suggesting to get it from the forum link :-)

    Other than that, thanks so much for this post. I had researched how to get a better resolution with MacBook Pro and had not found any good solution until now.

      • As it turns out, although this suggestion fixed the issue with images, font rendering on my Lenovo monitor was really bad compared to my retina display and even compared to a Windows PC connected to it. I tried all the suggestion for anti-aliasing on the web and gave up trying to get my rMBP to work with it :-( If you have any suggestion, I’d appreciate it.

  14. I am back with failure :(

    When i type ( ruby patch-edid.rb ) in terminal

    i got this message ( -bash: ruby: command not found ) ..

    Any clue or help why this happened ?!?

    I am starving to make this work.. really appreciate your help.

    Regards,
    Tamer

    • Sounds like ruby isn’t installed, or not in your PATH. I’m afraid it was installed already when I bought mine, so I’m not sure of the process to get it on the mac.

  15. Thanks! This helped a ton. I have a new mac mini (2012) and the hdmi output was horrific, no matter what adapters I tried (asus vh236h monitor). 10.8.3 did not yet fix the issue for me. It still seems far less crisp than I expect, but is at least usable now — it was quite painful on my eyes before! I’ll keep following to see if anything other fixes arise.

  16. Well I’ve the same problem on a ’12 mini and just checked the monitor settings and “space” is listed as RGB. The very same brand and model monitor are on this ’11 mini and looks great. So now what? (the latest update has not been done yet however.

    Thanks in advance!

  17. Thank you so much. I always knew there was something off about my monitor, but i could never get it “right”. Enjoying my super crisp monitor now!

  18. I’m getting this error when typing in “ruby patch-edid.rb” to Terminal:

    patch-edid.rb:9: undefined method `[]’ for nil:NilClass (NoMethodError)

    Is it because I do not have Ruby installed?

    • Change line 7 to look like this:
      data=`ioreg -l -d0 -r -w0 -c AppleDisplay`

      Note: I’ve added the -w option and set it an unlimited width. This solves the “patch-edid.rb:9: undefined method `[]‘ for nil:NilClass (NoMethodError)” error.

        • The EDID for some displays is quite long. My HPw2207h has an EDID of several hundred characters. By default ioreg clips the output to the terminal width. The -w flag allows to you set the clip width and setting it to zero set the clip width to unlimited.

  19. Just to share I do not have a Dell monitor ( I have an Acer ) but the above method fixed my issue perfectly.. Thank you so much I was so tired of the washed out colors and bright display

  20. Thank you for this pointer. I also have a U2410 that looked bad via HDMI, but this fix took care of the problem. I got tired of waiting for Apple and 10.8.3, which supposedly fixes the issue according to feedback on the numerous beta versions.

    • I had wondered that, too, but it ran on my new MacBook without me installing ruby myself, so I guess it comes with it now. I have whatever 10.8 is, though. Mountain Lion? Mangy Cougar? Something like that.

  21. Thanks for the help.. but i rarely use Terminal !!

    Could you please paste the code you wrote in the terminal to make sure aim doing it right !

  22. HI, I have an issue when I try to complete the script, I get a message \\Syntax Error -Expected end of line, etc. but found unknown token.\\ and I get a highlighted issue in the file \\’base64′ \\, over the first symbol, anyone has the same issue?
    Can anybody tell me where am wrong, I will appreciate any help.
    Thanks.

  23. Thank you very much! I tried to solve this problem since September, when I just received my MacBookPro. Finally, I can reuse my Samsung monitor without washed colors and with a true and deep black! For your information I use an adapter Thunderbolt (Mini DisplayPort) – HDMI, and I created a backup of the replaced folder in order to test if OSX 10.8.3 fixes the problem.

  24. This is so awesome. Fixed up my Dell U3011. I can now rotate the display (the Dual DVI adapter has this broken in 10.8.3) and now the display won’t have static/black outs! Woo!

  25. No worries! It was someone else’s solution, it just wasn’t very widely disseminated. I’ve had some feedback since from people checking out beta release notes suggesting that a fix may be in 10.8.3. That’d be good, but it’s still pretty slow moving for what is a pretty simple update.

  26. Brilliant! Would have saved me $33 on the stupid DVI adapter had I known thin months ago! Thank you for posting this on the forums.

Leave a Reply