Navigate / search

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

  1. Download the patch-edid.rb script from the forums thread above and put it in your home directory.
  2. Connect only the external monitor(s) in question (I closed my MacBook lid, for example). The script will make override files for any connected monitor.
  3. Type “ruby patch-edid.rb” in Terminal.
  4. A new folder will be created in your home directory. Move it into the “/System/Library/Displays/Overrides” folder. If Finder tells you that you are overwriting an existing folder, consider backing it up first.
  5. Restart your computer, 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.

Updates

I’m not running OS X any more, 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, 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.

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, 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, 26 May 2014: If you have had trouble with limited resolutions being available after the fix, check out Ibrahim’s comments here.

Comments

uentoeuoeu
Reply

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.

Mathew
Reply

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.

Glas Good
Reply

Thank you very much Mathew for sharing this, very much appreciated.

Dimitri
Reply

Amazing, that did the trick! Thank you very much!

LinuxLinus
Reply

Jeah!!!! It works!!!! Thanks!!!!

Derek Gates
Reply

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!

Gian Marco Cinalli
Reply

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.

daneale
Reply

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.

Mathew
Reply

daneale: Did you copy the code above into a new file? If so, the app you used may have copy/pasted incorrect characters, so try downloading/saving the script directly from Mr Schwarz’s post here:
http://embdev.net/topic/284710#3027030

daneale
Reply

Dear Mathew, thank you very much for your help, I followed your steps and my mac is working perfect.
Thanks.

Tamer
Reply

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 !

Mathew
Reply

ruby patch-edid.rb

Mathew
Reply

Exactly what I’ve written above, if you have placed the patch-edid.rb file in your home directory. Unless you’ve made changes to Terminal, which sounds unlikely.

Joe Boyer
Reply

You’re a very smart man Mr. Mathew. Well done.

Tamer
Reply

Thanks.. but should i have Ruby installed on my Macbook air (OS Lion) to be able to run this script ?

Thanks in advance.

Mathew
Reply

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.

Adam
Reply

That was awesome, I thought my monitor on my Mac Mini was just going bad. The script above fixed it perfectly.

Tamer
Reply

Thanks Mathew.. i will pray to make this work for my case.

John
Reply

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.

SMELTN
Reply

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

Matt
Reply

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?

Nick
Reply

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.

Mathew
Reply

This is great, thanks for the fix. Any idea why this is required for some people but not others?

Nick
Reply

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.

Sphinx777Sphinx777
Reply

Same issues… a Retina and external monitor (LG IPS). Finally perfect and natural images. THANKS A LOT!

Kevdawg42
Reply

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!

Rob
Reply

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!

Mathew
Reply

First step, definitely update it. But otherwise it sounds like you have an entirely different problem.

Rob
Reply

Seems so, however the ’12 mini will be making it’s way over here in a few days and if the update does nothing I will mix and match the units and see what happens

jason
Reply

Thanks so much for this!

Andrew
Reply

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.

Tamer
Reply

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

Mathew
Reply

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.

Rodrigo De Castro
Reply

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.

Mathew
Reply

Thanks for the tip, I didn’t notice that WordPress had escaped the XML string. I’ve removed the whole section now to prevent confusion.

Rodrigo De Castro
Reply

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.

AJ
Reply

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!

msc
Reply

I’m about to apply this fix, but I want to use DisplayPort audio. Is it really gone when that patch is applied?

Mathew
Reply

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).

ademuk
Reply

Works an absolute treat with MBPr 15 HDMI to Dell SP2208wfp monitor, Thank you!

Rocky Katz
Reply

Do you know if this fix also works on OSX10.6.8?

Mathew
Reply

I don’t know, give it a try! Just make a backup first.

Brett Nemeroff
Reply

This seems to have worked for me as well! LG IPS monitor. Now it even shows more resolutions in the display settings. Not sure if that’s expected..

david
Reply

if you used dvi-d to connect to the mac instead of hdmi it would automatically be rgb mode

Mathew
Reply

Yes, I’m led to believe that’s the case. I’m glad I didn’t have to buy an adapter and DVI cable, though.

twangsta
Reply

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.

azran
Reply

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.

Mathew
Reply

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.

Ross
Reply

Have a Dell monitor and 10.8.3 didn’t fix the issue, but the ruby script did. Thanks a lot!

Andreas Fuchs
Reply

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. (-:

Andreas Fuchs
Reply

One follow-up to this: I didn’t have to restart my computer to get this to work. All it took was disconnecting & reconnecting the external display.

Mathew
Reply

Good to know, thanks!

Karen H
Reply

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?

Nick
Reply

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.

Nate
Reply

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.

pyrosever
Reply

Works like a charm, thank you!

Malikman
Reply

@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

Mathew
Reply

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.

Philip
Reply

Works absolutely great with my new Philips Brilliance 272P4!

Cam Incoll (@camincoll)
Reply

Awesome – Thank-you! Got it working for our data projector in the office which was causing a problem for our Macbook Pros

disiei
Reply

Thank you! It works. I’ve a MBPr using 10.8.3 and a HP Pavilion 23xi

kuehner
Reply

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!

Mathew
Reply

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.

Chris
Reply

Amazing.. Thanks!

[…] of months ago. I previously posted about procuring a small server for NAS/backup purposes and mentioned that I had a new mac laptop for general use, and this “steambox” was the final piece of […]

James
Reply

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!

Zen
Reply

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.

Mathew
Reply

Beyond my knowledge, I’m afraid. If it were me I’d do as you’ve suggested and try an HDMI cable to see how it goes.

Leave a Reply