VMware Communities > VMTN > Desktop Products > VMware Fusion > Discussions

This Question is Possibly Answered

1 "correct" answer available (10 pts) 2 "helpful" answers available (6 pts)
1 2 Previous Next
19 Replies Last post: Oct 2, 2007 1:18 AM by poenn
Reply

Display gamma configurable?

Jan 2, 2007 2:59 AM

Click to view Uli Zappe's profile Enthusiast Uli Zappe 44 posts since
Dec 27, 2006
Hi,

while OPENSTEP is running on Fusion just fine for me now, the display gamma is obviously too big. Is there a way to configure the display gamma of the virtual machine in the *.vmx file (or somewhere else, for that matter)?

Thanks in advance for any reply!

Bye

Uli
Reply Re: Display gamma configurable? Jan 2, 2007 6:16 AM
Click to view rcardona2k's profile Champion rcardona2k 4,642 posts since
Oct 20, 2005
while OPENSTEP is running on Fusion just fine for me now, the display gamma is obviously too big. Is there a way to configure the display gamma of the virtual machine in the *.vmx file (or somewhere else, for that matter)?

Just curious what you mean by the gamma being "too big". Gamma usually controls contrast so you're saying that colors are exaggerated?

There's no documented/undocumented feature I've seen that controls virtual virtual gamma. You're likely better off investigating this on the OpenStep side. Apple has display profiles (colorsync) in the Displays system preference that controls video gamma. I have no idea what OpenStep might have to configure this.
Reply Re: Display gamma configurable? Jan 2, 2007 6:23 AM
in response to: rcardona2k
Click to view Uli Zappe's profile Enthusiast Uli Zappe 44 posts since
Dec 27, 2006
Just curious what you mean by the gamma being "too
big". Gamma usually controls contrast so you're
saying that colors are exaggerated?

Exactly. It looks similar to running Mac OS X with a gamma of 2.2 instead of 1.8 (if not worse) – really ugly.

There's no documented/undocumented feature I've seen
that controls virtual gamma.

Too bad. :-( I suppose all guest operating systems that VMware officially supports use gamma 2.2, so VMware saw no need to offer virtual display calibration? (OPENSTEP, just as Mac OS X, uses 1.8.)

Since the deviation is so big, I wonder if there's an additional issue in Fusion. Does Windows gamma look as it should on Fusion?

You're likely
better off investigating this on the OpenStep side.
Apple has display profiles (colorsync) in the
Displays system preference that controls video
gamma. I have no idea what OpenStep might have to
configure this.

Nothing, unfortunately – which is why I ask. The only alternative is tinkering with the OPENSTEP driver source, something I'd like to avoid given my zero experience with writing display drivers ... :-(
Reply Re: Display gamma configurable? Jan 2, 2007 11:13 AM
in response to: Uli Zappe
Click to view nivenh's profile Novice nivenh 23 posts since
Dec 10, 2006
http://www.normankoren.com/makingfineprints1A.html#QuickGamma

use that. windows gamma values can be adjusted w/o messing with display drivers and whatnot.
Reply Re: Display gamma configurable? Jan 2, 2007 11:32 AM
in response to: nivenh
Click to view rcardona2k's profile Champion rcardona2k 4,642 posts since
Oct 20, 2005
windows gamma values can be adjusted w/o messing with display drivers and whatnot.

The original poster is looking for an OpenStep utility not a Windows utility.
Reply Re: Display gamma configurable? Jan 2, 2007 12:19 PM
in response to: rcardona2k
Click to view nivenh's profile Novice nivenh 23 posts since
Dec 10, 2006
ah, i can't believe i missed that. sorry for the OT post.
Reply Re: Display gamma configurable? Jan 2, 2007 5:41 PM
in response to: nivenh
Click to view magi's profile Master magi 2,086 posts since
Aug 8, 2003
VMware
You'd want a way to adjust the gamma in the guest OS, OPENSTEP in this case. Gamma is really a property of the physical display device, and virtualization doesn't affect it. We don't have a "virtual gamma" feature.
Reply Re: Display gamma configurable? Jan 3, 2007 3:24 AM
in response to: magi
Click to view Uli Zappe's profile Enthusiast Uli Zappe 44 posts since
Dec 27, 2006
Gamma is really a property of the physical [...] device,

As is all the other features of the emulated hardware ...

and virtualization doesn't affect it.

I don't think gamma is any different from everything else you emulate. It's just that probably every guest operating system you officially dealt with has a gamma of 2.2, anyway, so hard-coding this value didn't lead to any specific issues. If Windows in its default settings does look right on Fusion (something I cannot judge since I don't have a Windows copy here) then you obviously do perform a hard-coded gamma conversion to emulate 2.2 for the guest operating system although the Mac OS X host uses 1.8. All OPENSTEP would need would be that this conversion is not performed, since it uses the same gamma as Mac OS X and therefore should look perfect out of the box.
Reply Re: Display gamma configurable? Jan 5, 2007 4:54 PM
in response to: Uli Zappe
Click to view micah's profile Enthusiast micah 61 posts since
Nov 7, 2005
VMware
We don't do gamma correction for any guest OS, Windows included.

This behaviour is the same as if you were to run Boot Camp, or if you were to plug an Apple monitor into a white-box machine running Openstep. In either case, you'd have to configure your operating system's gamma to match that of your actual display device.

It would certainly be possible for us to provide an optional gamma adjustment, but I suspect the vast majority of users wouldn't want us touching the value of the pixels coming out of their VMs. Any gamma correction applied at the virtualization level would be lossy, since we have to deal with 8-bit colors on the input and the output side.

One possible approach would be for us to add support to VMware Tools for passing through color profiles from the host's monitor to the guest. This would let the guest do its own (more accurate) color management, and it would allow the guest to automatically switch color profiles when the VM is moved between different hosts or different monitors.
Reply Re: Display gamma configurable? Jan 5, 2007 10:21 PM
in response to: micah
Click to view Uli Zappe's profile Enthusiast Uli Zappe 44 posts since
Dec 27, 2006
We don't do gamma correction for any guest OS, Windows included.

Hm, this would imply that Windows on Fusion looks "washed out" (too little contrast). Is this true? If it isn't, there must be a gamma adjustment somewhere in the chain of layers between Windows and the Mac OS X display driver.

This behaviour is the same as if you were to run Boot
Camp, or if you were to plug an Apple monitor into a
white-box machine running Openstep. In either case,
you'd have to configure your operating system's gamma
to match that of your actual display device.

I'm by no means an expert on this, but I don't think this is correct.

AFAIK gamma is not a property of the physical display, but rather of the operating system (specifically, its display drivers). Otherwise, there would be "Mac monitors" and "PC monitors" which just isn't the case. Take any monitor, connect it to a Mac, and images created for gamma 1.8 will look correct. Take the same monitor, connect it to a PC, and images created for gamma 2.2 will look correct.

Therefore, the behavior is not the same as if I was to run Boot Camp, because with Boot Camp, the physical display is directly addressed by the Windows display driver. If Windows runs in Fusion, the Windows display driver actually communicates with the virtual machine which communicates with Mac OS X which communicates with the Mac OS X display driver which addresses the physical display. If Windows still looks correct (identical to Windows running in Boot Camp) although in Mac OS X, System Preferences > Displays > Color is calibrated to use gamma 1.8 (the default), then somewhere in this chain there must be an adjustment of the Windows gamma to the Mac gamma.

A simple proof that the virtual machine has to deal with the gamma of the host OS (and does not bypass it) is that if you change the gamma of the host OS, the colors of the guest OS inside the virtual machine are affected correspondingly. Specifically, if I start OPENSTEP in Fusion and then in Mac OS X, go to System Preferences > Displays > Color > Calibrate... and change gamma from 1.8 to 1.4, OPENSTEP (which uses 1.8) looks correct (whereas Mac OS X looks washed out, of course). So clearly, Fusion adds a gamma of 0.4 to the gamma of Mac OS X for the guest OS. This is a reasonable default since Mac OS X defaults to 1.8 while most (if not all) guest OSes you officially support will default to 2.2.

However, things will not always be this way. There might be guest OSes which use 1.8 (such as OPENSTEP), and some users might use Mac OS X with 2.2 (e.g. web developers who want to see images displayed with the Windows gamma). In both cases, Fusion's hard-coded addition of a 0.4 gamma will fail. So there really should be a gamma calibration for the virtual display.

It would certainly be possible for us to provide an
optional gamma adjustment, but I suspect the vast
majority of users wouldn't want us touching the value
of the pixels coming out of their VMs.

Problem is, obviously they aretouched now.

Any gamma
correction applied at the virtualization level would
be lossy, since we have to deal with 8-bit colors on
the input and the output side.

I just tried to demonstrate that a conversion already takes place currently, so the situation could probably only get better. Also, I'm not sure the conversion would necessarily have to be lossy. I don't know how you interact with the Mac OS X graphics system, but if you could use ColorSync, you could probably just tell Mac OS X which gamma to use for the visual data you deliver, instead of doing any conversion yourself.

One possible approach would be for us to add support
to VMware Tools for passing through color profiles
from the host's monitor to the guest. This would let
the guest do its own (more accurate) color
management, and it would allow the guest to
automatically switch color profiles when the VM is
moved between different hosts or different monitors.

Apart from the fact that this wouldn't help for cases like OPENSTEP (you don't provide VMWare Tools for OPENSTEP, and OPENSTEP has no color management), I would think that this is possibly unnecessarily complicated. If possible, it should be simpler to just let ColorSync (in the case of Fusion) do the work of adapting the data from the virtual machine (that, depending on a virtual machine setting, come with 1.8 or 2.2) to the gamma Mac OS X uses.
Reply Re: Display gamma configurable? Jan 5, 2007 11:41 PM
in response to: Uli Zappe
Click to view brianriceca's profile Master brianriceca 937 posts since
Oct 11, 2003
VMware
I don't know what the right answer is, but I can offer a datapoint.

I have an iMac with both its built-in LCD and an external monitor (specifically a Philips 170B LCD panel, originally bought for use with a PC, and connected using DVI).

The Wikipedia page for gamma correction (http://en.wikipedia.org/wiki/Gamma_correction) contains a gamma test image. When I drag the window containing the test image from one monitor to the other, I see clearly that the test image changes. That tells me that gamma is a property of the display, not the OS.

I confess there's a lot in the Wikipedia article I don't understand, but it also seems to suggest that gamma is a property of the hardware, and that LCDs made for Macs and PCs do differ. The article says: "In PC video, images are encoded with a gamma of about 0.45 and decoded with a gamma of 2.2; in Mac systems, the corresponding typical values are 0.55 and 1.8."
Reply Re: Display gamma configurable? Jan 6, 2007 6:06 AM
in response to: brianriceca
Click to view Uli Zappe's profile Enthusiast Uli Zappe 44 posts since
Dec 27, 2006
I have an iMac with both its built-in LCD and an
external monitor (specifically a Philips 170B LCD
panel, originally bought for use with a PC, and
connected using DVI).

The Wikipedia page for gamma correction
(http://en.wikipedia.org/wiki/Gamma_correction)
contains a gamma test image. When I drag the window
containing the test image from one monitor to the
other, I see clearly that the test image changes.
That tells me that gamma is a property of the
display, not the OS.

I think it just means that at least one of your two displays is not correctly calibrated. ;-)

Of course, display hardware vastly differs, from model to model, and not just between two "Mac" and "PC" categories; there's probably as much individual specs as there are monitor models. That's why each monitor has to be calibrated, ideally individually, but at least by assigning the appropriate default color management (ColorSync, in the Mac case) profile. (In the old days of anlog displays, non-professionals might have been content with just tweaking the analog monitor knobs for color and contrast.)

Even Apple's own displays differ a lot in their color reproduction. Mac OS X automatically assignes the appropriate ColorSync profile to an Apple display that is detected at boot time, but if you explicitly specify another ColorSync display profile in System Preferences > Displays > Color afterwards, even one of another Apple display, color reproduction will grossly deviate. If Mac OS X at boot time discovers there's a third-party display connected, it tries to use an appropriate generic profile, but of course, this will not be as precise as the profiles specifically dedicated to a specific Apple display model.

Of course, while using one and the same operating system, dragging an image from one monitor to another must never change color reproduction. It simply means one display (or both of them) are not calibrated correctly.

I confess there's a lot in the Wikipedia article I don't understand,
but it also seems to suggest that gamma is a property of the hardware,
and that LCDs made for Macs and PCs do differ. The article says:
"In PC video, images are encoded with a gamma of about 0.45 and
decoded with a gamma of 2.2; in Mac systems, the corresponding
typical values are 0.55 and 1.8."

In this Wikipedia quote, "video" refers to the combination of the graphics card, the corresponding driver, the monitor hardware and the system-wide color management module (if any).
Reply Re: Display gamma configurable? Jan 8, 2007 11:59 AM
in response to: Uli Zappe
Click to view micah's profile Enthusiast micah 61 posts since
Nov 7, 2005
VMware
A simple proof that the virtual machine has to deal
with the gamma of the host OS (and does not bypass
it) is that if you change the gamma of the host OS,
the colors of the guest OS inside the virtual machine
are affected correspondingly. Specifically, if I
start OPENSTEP in Fusion and then in Mac OS X, go to
System Preferences > Displays > Color > Calibrate...
and change gamma from 1.8 to 1.4, OPENSTEP (which
uses 1.8) looks correct (whereas Mac OS X looks
washed out, of course). So clearly, Fusion adds a
gamma of 0.4 to the gamma of Mac OS X for the guest
OS. This is a reasonable default since Mac OS X
defaults to 1.8 while most (if not all) guest OSes
you officially support will default to 2.2.

When you adjust the gamma value in System Preferences, this is adjusting the table your video card uses to convert 8-bit colors to analog RGB values. AFAIK these tables often have a 16-bit output resolution, so you don't lose detail during the conversion.

VMware Fusion is giving the host video drivers the same RGB values it receives from the guest OS. You're seeing the color in your guest change when you adjust System Preferences because, like everything else on your desktop, these RGB values go through a gamma correction process in your video card.

We could implement a virtual gamma correction table in our virtual video card, but it would be lossy. Our table would need to have 8-bit colors on the input and on the output. Since the table couldn't be a 1:1 mapping for gamma corrections other than 1.0, you'd be losing information.
Reply Re: Display gamma configurable? Jan 8, 2007 4:29 PM
in response to: Uli Zappe
Click to view magi's profile Master magi 2,086 posts since
Aug 8, 2003
VMware
I think it just means that at least one of your two displays is not correctly calibrated

Exactly. Gamma itself is a property of the physical display, not the OS. What the OS is responsible for is gamma correction: The OS is supposed to account for and correct for the display gamma, which is what the color calibration stuff is for. If it's misadjusted, you see the wrong thing. So we all agree here.

But Fusion (and any VMware software) doesn't gamma-correct between the guest framebuffer and what we display on the host. The host OS does, the same way it does for all display output. We're not going to do it: not only would it be lossy as Micah's been saying, but it would also be computationally expensive (in other words, performance would suck). Unless the host OS provides a way to do per-window gamma correction in hardware, which I don't know about.

Anyway, Uli - does OPENSTEP provide a gamma correction facility? If so, that's what you want to use. If not, that's sad... but I'm pretty sure you'd get exactly the same results running OPENSTEP on the same hardware without using virtualization.
Reply Re: Display gamma configurable? Jan 8, 2007 5:27 PM
in response to: micah
Click to view Uli Zappe's profile Enthusiast Uli Zappe 44 posts since
Dec 27, 2006
When you adjust the gamma value in System
Preferences, this is adjusting the table your video
card uses to convert 8-bit colors to analog RGB
values. AFAIK these tables often have a 16-bit output
resolution, so you don't lose detail during the conversion.

This sounds plausible for analog output. DVI (the de facto standard for Macs), however, has only 8-bit colors, so you're actually performing a lossy conversion.

VMware Fusion is giving the host video drivers the
same RGB values it receives from the guest OS.

If you really don't modify the values, then I really don't understand why Windows, with a gamma of 2.2, (supposedly, I don't know from my own experience) looks correct in Fusion running in Mac OS X with a gamma of 1.8, whereas OPENSTEP, with a gamma of 1.8 just like Mac OS X itself, does not. It would be really interesting to see how Mac OS X itself looks running as a Fusion guest OS. Judging from Windows and OPENSTEP, it would likely look too dark, but wouldn't this be very strange? (Also, I wonder what effect, if any, the gamma slider in System Preferences of the guest Mac OS X would have.)

We could implement a virtual gamma correction table
in our virtual video card, but it would be lossy. Our
table would need to have 8-bit colors on the input
and on the output. Since the table couldn't be a 1:1
mapping for gamma corrections other than 1.0, you'd
be losing information.

Understood. I think that for most applications, having a lossy gamma correction is much preferable to having no gamma correction. As I pointed out, a gamma correction for DVI monitors is lossy, too, and no-one cares. Those who don't want to experience any (additional) loss of information can always set the correction to 1.0.
1 2 Previous Next
Actions