gamma correction makes the baby jesus cry

Last night I adjusted my monitor so that (I think) pictures look more like they look on Macs, with the result being that now most of the pictures in the DNA photo gallery look way too bright and washed out on my monitor. Yay. Bonus points: with the new setting, the default colors of whatever Gnome theme I'm using make it so that I can no longer read the titles of windows that don't have focus.

Why is this gamma correction shit not a Solved Problem yet? I've been fighting this, and being angry that I have to know anything about it at all, for at least ten years. Surely people who do this for a living get even more head-explodey over it than I do? Why has this outrage not translated into it being fixed? Get out of my face and just do the right thing already, you stupid computer!

Now I get to decide whether to go back and edit a zillion pictures, under the assumption that the way my monitor is set now is more "right" than before. Which would mean adding another round of JPEG compression, since I didn't save the large versions, and taking the risk that they'll end up being illegibly darker on people for whom they looked ok before.


Tags: , , , ,

35 Responses:

  1. Isn't that what PNG was supposed to be for?

    The technical solution is there, the social solution is not. No built-in IE support for it, no older-browser support without a plugin.

    Isn't that always the way?

    • zztzed says:

      IE supports PNG; it DOESN'T, however, support PNG transparency without a really ugly CSS hack.

      • It supports it on the mac :)
        Also, it supports transparency just not alpha-transparency.
        Also l'd like to see the hack to make it work. since lack of alpha transparency in the browser 90% of everyone uses doesn't support it.

    • jwz says:

      No, what PNG is for is useless wheel-reinvention inspired by the GIF patent, which expired last month anyway. PNG never caught on because it was solving a problem that nobody actually cared about. (And then had a bunch of other marginally useful features bolted on as an afterthought -- but nobody cared much about those either, not enough to deal with format-change pain anyway.)

      See also Ogg Vorbis. (Point and laugh.)

      I don't believe a change as drastic as PNG would be necessary to fix the damned gamma situation. I think it would only require a whole bunch of tiny, incremental changes all over the place, which is a lot of work, but come on! We had a whole industry be born and die in the meantime. It's not that crazy.

      • chrisg says:

        At least PNG has other good things about it too, like having more than 256 colours. If anything, it's better for screenshots at least (where jpeg makes it look like crap). I don't really use images enough on my web pages to care much about other normal stuff.

      • freiheit says:

        PNG's purpose certainly might've been better accomplished via incremental adjustments to a currently existing format (GIF), but there's 2 features PNG has that GIF doesn't that people want:
        (1) variable levels of transparency (alpha channel), which allows things like having a non-square graphic on top of a textured background (or on top of any background without needing a different version depending on the background color) without looking like moldy ass and
        (2) including the gamma setting the image was created with, allowing an image viewer to adjust appropriately so that the image looks "right" everywhere.

        Most people don't know that they want gamma correct ability, but they want it, even if they don't understand it.

        I suspect another reason PNG didn't catch on was lousy browser support.

        Also: is your brightness turned up? You may have turned your brightness up at some point to "correct" for the low default gamma on an average Linux setup. Try resetting your monitor's brightness and contrast back to the defaults and only adjust as much back towards your previous setting as looks right. You won't know if it "looks like it does on a Mac" until you compare it side-by-side to a Mac under identical lighting conditions, etc. You're not using the same monitor as that theoretical Mac user, your monitor probably assumes a gamma setting closer to what Windows uses.

        • jwz says:

          I didn't say that PNG didn't do useful things. Only that nobody cares enough about those things to deal with the pain of switching formats, and that's demonstrably true by the sparse support PNG has in the real world.

          The fact that PNG lets you encode the gamma value in the file doesn't help if the software that creates PNGs doesn't put anything there, and my understanding is that nothing does.

          Besides which, the JPEG spec mandates that images be stored in the file as gamma 1.0 and converted at display time -- nobody does that either.

      • shandrew says:

        The GIF patent expired in the US, but is still alive for a few more years in several other important countries.

  2. jiritsu says:

    well, they look OK on my monitor, so either my gamma is too low or your new gamma is too high.
    if you run the adobe gamma wizard that comes with photoshop it gives you a more-or-less correct gamma setting... but i think you need a degree in imaging science to get it perfect.

    • jwz says:

      Where can I download the adobe gamma wizard for Red Hat? Thx.

    • violentbloom says:

      I think they looked fine on my mac too...though it died a few hours ago so all I have is this shitty pc.*sniffle*As I recall though the pc was slightly brighter and a bit of a different tone.

      Besides 77% of users (or more now) are on pc anyway. Who cares about us poor users formerly known as mac users. *sniffle*
      Next thing you know you'll be worring about the 5 amiga users in germany! heh.

      • ... but are 77% of the users who view the DNA Lounge website on a PC?

        Possible, but I'm not so sure. JWZ has more than a slight following with Unix geeks, and it's reasonable to expect a somewhat large following (actually looking at images on the web site) of artsy, mac-using people from around SF (who actually go to the club).

        Sure, the HMP are liable to be on PCs, but does anyone paying attention actually care what they think?

        Fwiw, the images have always looked just fine on three very different NetBSD workstations with a variety of video cards (one of them an aging Thinkpad 760ED laptop) using both XF86 3 and 4. But maybe I'm just not that picky about color correction.

        This, I think, might be the real source of the un-fixedness of the problem; nobody who codes for anyone besides Adobe cares enough to fix it (like, say, in an X server), and nobody who has coded a fix for it would come anywhere near using anything that's not fixed. Most people are happy, but some (like JWZ) fall through the "I shouldn't have to fix this bullshit myself too" cracks.

  3. harryh says:

    An interesting primer on Gamma Correction

    • wfaulk says:

      Note that if your frame buffer had more than 8 bits, say 16 bits per component, then this scheme would be perfect. That's a few years away and hopefully after that I can delete this page and never hear of gamma again.


    • raph says:

      This page probably does more to mislead and confuse than it does to educate. It starts off with the myth that gamma comes from the interaction of electron beams and phosphors. Bzzt. There's a good reason why video systems have gamma.

      The question of whether to do antialiasing in perceptually-linear or brightness-linear spaces is tricky. From his page, you'd get the impression that it's always best to do it in brightness-linear. Actually, for most desktop usage, including fonts, it's best to do operations in perceptually-linear space. Even "experts" get this wrong, such as InDesign 2.0.

      Brightness-linear processing starts making more sense in 3D graphics, but the state of the art these days goes far beyond simply setting a gamma value. If you really want to do things right, do all your processing with high dynamic range images, then do a final compression step to your low dynamic range display. There is no one single "right" compression step, just as there is no one single "right" way to print a photograph.

      I'm tempted to put a web page together that cuts through the widespread bullshit I see propagated about gamma. As jwz rants, it's surprising that people who you'd think should know better don't.

      • jwz says:

        I encourage you to do so, because the existing pages are baffling and contradictory. (There's always room for one more baffling and contradictory gamma page, right?)

  4. naturalborn says:

    Even if everyone were using the gamma correction that macs do, the advantages would still be fairly small.

    You basically have two choices. You can leave things like they are now and your web site will look fine on the 90%+ of computers which are running windows, or you can go through a lot of effort and it will look fine on the < 10% of computers which are macs and like crap on the > 90% which are windows. What, exactly, would be the benefit of that second situation? Slavish devotion to what would theoretically be a marginal improvement if everybody did it?

    • jwz says:

      You seem to be assuming that "whatever random way my monitor was set" approximates "the way things are on all PCs", which seems unlikely at best.

      It's true that only a tiny percentage of computers in the real world are Macs -- but approximately all the ones used by designers are Macs, so it's more likely that the graphical parts of the web are calibrated for Macs than for PCs.

      Anyway, I thought the default Windows gamma was even higher than the default Mac gamma?

      • naturalborn says:

        You seem to be assuming that "whatever random way my monitor was set" approximates "the way things are on all PCs", which seems unlikely at best.

        A very large fraction of all monitors are completely misconfigured due to the end user messing with them, but there's not much you can do about that.

        In terms of things you can do stuff about, it's my impression that there's basically the 'windows gamma value' and the 'mac gamma value', which tend to be pretty consistent for each system. On windows mac graphics looks dark, and on macs windows graphics look too bright. It's sort of like listening to dolby C tapes without dolby anything.

        The advantage of gamma, by the way, is that it allows you to do more with a limited color depth. It basically tries to make it so that all shades look about the same amount different, rather than having a band of shades which look mostly identical and another band of shades which look dramatically different. Even under ideal circumstances the difference is pretty small though, especially when you're using more than 256 colors.

        • rzr_grl says:

          BTW, he was comparing images with me. While i am on a Mac, I have it set to "PC compatible" gamma so that I can play with the other kids. His black levels were still way, way too high.

      • mattbot says:

        The RGB values on your example picture run about 15+ points higher at Mac gamma than at PC gamma on my Mac. (JPG compression also might desaturate your RGB a few points from the original too unless you correct for it.)

        At CCAC, I've got all our Macs set at Mac gamma but Photoshop set to PC gamma. Dispite the difference, I've never once heard a design student here even bring the subject up, so judging by that unformal poll and my general experience with designers, left to their own devices they use Mac gamma in Photoshop by default. So you're unfortunately probably right about much of the gamma settings being Mac in the wild.

        It's also unfortunate that if I switch the gamma to PC, the window pinstripping and font anti-aliasing in Mac OS X becomes more pronouced and starts to give me headaches so I'm stuck with Mac gamma.

        Personally, I would prefer that Apple go along with the PC way as their default setting. Whatever the reason for originally choosing their gamma (desktop publishing issues I'm guessing) didn't anticipate the WWW. I suspect more people view and create web graphics than produce print graphics on their Macs.

  5. mightymu says:

    "head-explodey" - good word!

  6. chanson says:

    It's possible to embed ICC color profiles in GIF and JPEG (and I think PNG) images. This means the designer that creates the image can embed a profile of the device it was created with, and then if you have a profile set for your display, your rendering engine can match the two profiles to get you the most accurate possible reproduction.

    Furthermore, if an image doesn't have an embedded profile, it's not unreasonable to assume it's in a device-independent color space. The sRGB color space was created for this purpose; it's designed to mimic the average uncalibrated PC monitor, and I think it's the color space Photoshop defaults to.

    Of course that's in theory. In practice, it isn't used much at all (except to adjust sRGB images for correct display on the Mac). The only browsers I know of that even support color-correcting displayed images are on the Mac. I don't think there's much of anything that can use ICC pofiles at all on Linux or FreeBSD, though I think there is an Open Source ICC library that could be used to implement support in applications like Gimp and Mozilla.

  7. baconmonkey says:

    you do know that twiddling brightness/contrast on the monitor is not a good way to approximate gamma, right?

    My understanding is that the gamma is handled by the video card and OS, not the monitor.

    but that picture is a bit washed out on the right side anyways. however, large patches of absolute black generally looks wrong in photos.

  8. flipzagging says:

    Where do I sign up? I have been banging my head against this problem for close to a DECADE now. I don't know anything about image file formats but getting something even half-baked doesn't sound incredibly hard.

    The whole CSS campaign on the part of WASP is not nearly as important as a gamma jihad.

  9. jwz says:

    Well, I just went and adjusted levels on the pictures from 2003. I think I ended up tweaking about 2/3rds of them. I didn't do previous years because my sleepiness finally outweighed my OCD.

  10. cetan says:

    I've found that following the advice on the bottom of every review (such as: ) solves most of my problems.

    Though, my work monitor is still too dark. Can't seem to fix that for some reason.

    • vxo says:

      Let's see...

      The monitor on my parents' computer (an LCD hooked up to a DVI port) with no adjustments other than backlight brightness displays that color bar okay...

      The screen on my laptop does too, but it's very angle-sensitive...

      and... the monitor on my desktop does as well, but it has to be cranked to the point that black is no longer black.


    • sw00p says:

      now that looks great on my iMac, but crap on either of my 2 PCs (I can get differentiation in one or another of the extremes of A,B,C or X,Y,Z but not a happy medium).

  11. raph says:

    Seriously. Gamma wouldn't be a problem if it weren't for Apple. All sane displays have a gamma of 2.2. For some reason, the Mac applies an additional gamma "correction" of 1.4. If they hadn't done this, people wouldn't be having gamma problems today.

    It'll take a while to back out of this mistake. It's very similar to the backspace/delete confusion in X11, which is finally starting to converge. Gamma is slightly different than key mapping because the latter is arguably purely a matter of personal taste, while there are sound technical reasons for preferring a gamma of 2.2.

    You can't fix this problem by fiddling with image formats. It's almost certain that attempting to fix it in the wrong place will do more damage than good. If you want to fix your gamma problems, it's very simple: just remove every step in the pipeline that applies gamma "correction", and you'll be fine.

    • jwz says:

      If you want to fix your gamma problems, it's very simple: just remove every step in the pipeline that applies gamma "correction", and you'll be fine.

      Meaning that a Linux/Gimp user who wants to create images which are properly viewable to the widest audience should do what exactly? It sounds like you're saying "don't run xgamma, leave your monitor controls on the defaults", but that's what I had been doing, and that caused me to create images whose blacks looked like light gray to many, many people.

      So now I think I've "fixed" things by cranking my monitor's brightness way up and running "xgamma -g 1.8".

      I fail to see how it's Apple's fault that X11 and Windows apparently have different default gamma. (Though both of those are different again from MacOS.)

      • raph says:

        I'm surprised that X11 and Windows have different default gammas. In all the configurations I've seen, they both (correctly) apply no gamma "correction".

        If you're seeing washed-out blacks, then your problem is probably not gamma, but just not adjusting black level correctly. This is pretty easy to do in Gimp (and Photoshop) - I just use Image/Color/Levels and move the black slider until the blacks are deep and rich, but shadow detail is still preserved. If done well, images should display reasonably well on both monitors with correct (2.2) gamma and too-light monitors (Macintosh; gamma 1.4).

        It may be reasonable for you to preview images using the too-light gamma setting (xgamma -g 1.6 would be the correct setting for this, as 1.4 ~= 2.2/1.6), but I encourage you to stick with correct (2.2 gamma, meaning xgamma -g 1.0) for your default viewing and image editing.

        After all, it's people like you who pander to Macheads who disincent them from actually fixing the problem :)

        • jwz says:

          I'm surprised that X11 and Windows have different default gammas. In all the configurations I've seen, they both (correctly) apply no gamma "correction".

          My understanding is that unless I run "xgamma" on my Linux system, images on my screen are way darker than images on a Windows screen. Not having a Windows box, I can't test this, but it's what I've been told.

          If you're seeing washed-out blacks, then your problem is probably not gamma, but just not adjusting black level correctly.

          Well yeah, but that was a gamma problem, in that, my gamma was set such that #0F0F0F looked pretty close to black -- whereas, that's not the case on lots of other peoples' monitors. So I'd look at a picture on my screen, say "that looks pretty good", and then find out that it looked like ass to others.