Caveat: Even NASA pictures may not be linear (or the wrong kind of linear)

Today I am going to share a dis­cov­ery that might not be news­wor­thy for many peo­ple, but for me it seemed some­what scanadalous at first. Could it real­ly be true that an over­sight of this kind slips through the cracks and makes it to the front page of pub­licly released NASA pic­tures? Appar­ent­ly yes. This talk is about miss­ing gam­ma cor­rec­tion in some space images which there­fore give an unre­al­is­tic appear­ance. This issue seems to exist on top of the col­or-fil­ter issue (where the imag­ing instru­ments most­ly do not have spec­tral sen­si­tiv­i­ties that cor­re­spond to human vision) and results in a dis­tor­tion of bright­ness rela­tion­ships between objects. Extra cau­tion is there­fore advised when using these images as a ref­er­ence for artis­tic purposes.

The Lunar Transit picture

Lunar tran­sit as cap­tured by the EPIC cam­era on board of the Deep Space Cli­mate Obser­va­to­ry. Left: image as pub­lished; right: corrected.

I remem­ber how in 2015 an image of a lunar tran­sit tak­en by the Earth Poly­chro­mat­ic Imag­ing Cam­era (EPIC) made rounds in sev­er­al twit­ter threads. These tran­sits hap­pen reg­u­lar­ly, the lat­est one being from feb­ru­ary this year. There’s just one prob­lem with these images as orig­i­nal­ly pub­lished on the NASA web­site: they’re too dark. As if some­body took the files with the lin­ear pho­ton counts from the sci­en­tif­ic instru­ments, and threw them togeth­er to make the images while for­get­ting to account for dis­play gam­ma.

How do I know? The visu­al geo­met­ric albe­do of the moon is quot­ed as 12%. If the image is nor­mal­ized to unit reflectance (using the clouds as a proxy for unit ref­electance), then – accord­ing to the sRGB trans­fer func­tion – a sur­face of 12% reflectance should come out with a grey val­ue of 97 out of 255 (or #616161 in web-par­lance). That is the val­ue that would dri­ve a com­put­er dis­play to out­put 12% grey, on average.

Side note: Why sRGB? The sRGB stan­dard orig­i­nat­ed as a descrip­tion of the ‘aver­age com­put­er dis­play’, in the absence of col­or mange­ment. (See anoth­er blog post here with more infor­ma­tion). While it is true that the pre­cise trans­fer func­tion would depend on the dis­play device and its set­tings, it is vir­tu­al­ly always going to be some­thing in the ball­park of a gam­ma 2.0- to gam­ma 2.4‑ish curve (you can test that for your­self here, here and here, for exam­ple). There­fore, in the absence of pre­cise infor­ma­tion about the tar­get dis­play, it is still infi­nite­ly bet­ter to just assume an aver­age trans­fer func­tion, than doing noth­ing about it for fear of doing some­thing wrong.

In the pub­lished image how­ev­er, the grey val­ues of the moon sur­face are in the range of 60 out of 255, which would cor­re­spond to a sur­face reflectance just short of 4% – which is too dark by a fac­tor of 3! There is no way this can be explained by an uncer­tain­ty in the moon’s geo­met­ric albedo.

We can apply a sim­ple gam­ma cor­rec­tion to the image until the moon’s sur­face is in the expect­ed range (shown on the right). There are two clues that the cor­rect­ed image is more rep­re­sen­ta­tive of the nat­ur­al scene: first, the clouds do no longer exhib­it this kind of ‘hot­ness’ or arti­fi­cial spec­u­lar­i­ty in the cen­ter, and sec­ond­ly, the ocean col­or is also in the cor­rect range (around 7% reflectance).

Saturn with Titan upfront

Sat­urn with Titan upfront, tak­en by the nar­row angle cam­era on board of the Cassi­ni-Huy­gens probe (cat­a­log page). Pay atten­tion to the ter­mi­na­tor region. Left: image as pub­lished; right: corrected.

Exhib­it B is going to be an image of Titan tak­en by the Cassi­ni-Huy­gens probe in 2011. A dead give­away that this image is in the wrong col­or space is what I would call the soft ter­mi­na­tor phenomenon.

You see, the sRGB trans­fer func­tion approx­i­mates a gamma‑2.2 curve, and this is in turn almost the same as a sim­ple squar­ing oper­a­tion. This means that, with­out any cor­rec­tion, a numer­i­cal­ly lin­ear gra­di­ent will be dis­played on a com­put­er screen as a squared gra­di­ent, more or less.

Now look at the ter­mi­na­tor on Titan’s sur­face. The ter­mi­na­tor should van­ish approx­i­mate­ly as \cos \theta, and there­fore, should have a vis­i­ble kink at \theta = 90^\circ. In fact, a sharp ter­mi­na­tor is one of the five major clues of lin­ear light­ing that I iden­ti­fied in my talk on phys­i­cal­ly based shad­ing.

How­ev­er, in the orig­i­nal image as pub­lished on the NASA web­site (shown on the left) there is no kink. Instead, the image looks like the ter­mi­na­tor van­ish­es as \cos^2 \theta, indica­tive of a miss­ing gam­ma cor­rec­tion. If we apply this cor­rec­tion so that the pub­lished albe­do val­ues of Sat­urn and Titan are in bet­ter agree­ment (Sat­urn should be round­about twice as bright as Titan and not 4 times as bright), we arrive at the image on the right, which again should be more rep­re­sen­ta­tive of the nat­ur­al scene.


This post is not meant to be a rant. I total­ly applaud the work of the peo­ple that give us these images in the first place, and I can total­ly imag­ine how in a large organ­i­sa­tion these things might fall under the bus when files change hands mul­ti­ple times between depart­ments, or might even be inten­tion­al decisions.

How­ev­er, for com­put­er graph­ics research, such as I have done for atmos­pher­ic scat­ter­ing and space games in gen­er­al, I have in the past used NASA images as a ref­er­ence with­out giv­ing it much thought. As it turns out, one needs to be extra care­ful and crit­i­cal in doing so.

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht.

Please answer the following anti-spam test

Which thing makes "tick-tock" and if it falls down, the clock is broken?

  1.    chair
  2.    table
  3.    ruler
  4.    pencil
  5.    watch