Page Link:

Red Sky Or Blue?

Is Mars' sky pink or blue?  A possible explanation for the uproar.

    So which is it?  Does Mars have a pink sky or a blue sky?  So far, there seems to be a real problem answering that question.  I may have found out why there is so much controversy and the single question that we must answer to know the truth.  It all stems from how we get our color pictures back from Mars.  Let's look at how the process works.

In theory, it all looks fine

   In a color photograph, the film is made in layers- each sensitive to a different part of the spectrum.  We have three primary colors that are used to make up an image- cyan, magenta, and yellow.  With paint, it is all different because we are seeing reflected light with pigments, not transmitted light (like from a television).  In paints, we use red, yellow, and blue as our primaries.

   Now, because the scientists wanted to be able to see light wavelengths beyond what humans can see (so they can help to identify rocks by their infrared or ultraviolet spectrum components), they chose a wide response solid state imager that could see just up into the ultraviolet (well, just beyond violet) and way down into the far infrared.  Then, by selecting specific filters and having the camera change them on command, they could take pictures in different colors and transmit them back individually.

   What this means is that there are never really any color pictures taken- the frames of image are of a single color at a time, and must be combined again to recreate the actual color images.  In color film, this is done all at once by the various dyes in the layers that make up the film.  In television, three simultaneous images are made and recombined in your television to make the color picture.  Really, there is not much difference in those methods and the MER cameras.

   So just stick them back together, right?  No.  It gets complicated now.

Hardware related issues

   When you take a picture, you assume that the light from each part of the spectrum is at the proper "relative intensity".  In other words, the camera is getting the proper ratio of green to blue to red.  But due to a simple and devious hardware idiosyncrasy, the light level for each filter is "balanced" so that it takes up the whole range of intensities it has available.

   What this means is that the darkest part of the image is assigned the darkest possible black level (in digital format) and the brightest part of the image is assigned the lightest possible white level (also in that same digital format).  Now, this is great if you want to get the absolute maximum amount of data in a frame of image, but it means that you now have lost the relative light level of each separate color.  It got thrown away in the process!

   But that is not the only problem.  You see, to get the most utility out of the camera, the colors selected for each filter are really not well suited for typical color images.  They were selected for geology, not pretty pictures.  So we face a second thorny challenge- how to make the somewhat off-kilter frequencies match up with what we expect to see.

Solving the problems

   If you know anything about photography and light, you can get a fair approximation of each color's contribution to the image overall and sort of "wing it".  In other words, you might take the 752 nm filter (a very deep red) and boost its overall percentage of the image to sort of compensate, because red this long in wavelength is much harder to see than red at, say, 673 nm.

   And, you might be tempted to take that 440 nm violet and use it as blue- just add a touch of red for a minor color correction, right?  Well, maybe.  Most of the time it will work well enough.  The 483 nm filter is much better; a "truer" blue to our perceptions.  But it still is not ideal.  Overall, if you choose the 673 nm as your red, the 535 nm as green (pretty good green, too!) and the 483 as your blue, you can get some very close images.

   Well then, that's that.  Or is it?

   As it turns out, in many image sets those images are not present.  You are stuck with the filters that the scientists chose to use for whatever inscrutable reasons they had.  And not only that, in every early sol for Spirit, the filter assignments are reversed (right and left camera) or worse yet, the frequencies are completely wrong.  It seems amazingly inept that somebody would get this vital information completely scrambled up.  But things happen; perhaps their secretary had a bad two and a half months.

    But for the sake of argument, let us stick with images that DO have the proper colors available.  What more do we need to know to get it right?

Balancing act

   Remember that the images get "scaled" to fit the data space?  To get the most data from a given frame, the image brightness is scaled to the largest range it can use.  But we do not know what that scale factor is, so we have developed a few rules of thumb that will produce good images with minor tweaks.  As a rule, the blue should be 30% of whatever the image brightness is, the green should be about 60%, and the red should stay at 100%.

   Here is where it gets tricky.

   Suppose I have three images from a particular sol, such as these three pictures of a crater from Opportunity panoramic cameras, Sol 069.  Here are the images I want to use to construct a "true color" image of the planet, based on the filter frequencies and this rule of thumb for the color ratios.  So far, so good.

   This is the "blue" image, taken at 432 nanometers (nm).  That is the actual length, if you used a tiny ruler, of the individual light waves for this particular color of blue light.

   So an electromagnetic wave that is 432 billionths of a meter long would look blue to us.  Of course, this image is just the gray scale of that picture taken with that color filter in front of it- in reality, this would be very dim compared to the rest of the image.

   So this image gets turned blue and the brightness set down to 30% of what it appears to be here

   This is the "green" image, taken with the 535 nm filter.  It looks exactly like the blue image, doesn't it?  But our eyes are notoriously fickle about recognizing the subtle differences in these things, and without actually "subtracting" this image from the one above, you would very likely never be able to see the differences between them.

   Still, this is going to get turned green and its intensity will be set to 60% of what it is now.

   Finally, this is the red image data, taken at 602 nm.  This is really orange, but we can use it if we must.  You stand a better chance of seeing some small differences here, but still it's not something that stands right out.

   This image will get turned red and left at its present brightness level before being combined into the full color image we want to see.

   So what could possibly stand in the way of making a great color picture from these three images?

Gain and offset versus brightness and contrast

   Now comes the artistic part- we use the level controls to blot out the red and blue channels of image data to make our 535 nm image green.  All that is left is green once that is done, and we will use that to make our color picture.

   Then we do likewise for the blue image- blot out the red and green portions to leave a fully blue picture, then blot out the green and blue to make the 602 nm image all red.  If we use the wrong images by mistake, it will not work at all, and we will get something really terrible looking like purple skies and blue ground.  It is most important to get the proper filter image in place for each step.

   But now we confront the real problem- when we set the brightness of the image, do we also set the contrast to match?  You see, brightness is like moving all the image data up or down in value in one block- known as "offset".  But contrast is the scaling of that data so that it is literally larger or smaller- that is called "gain".

   Imagine it like this- gain is "magnification" and offset is "height above a level".  You can make the signal get larger or smaller, or you can make the signal go up or down in level.  Doing both might be the right way, or doing only one might be the right way..  We don't have a clue if the people doing the image processing are doing one or both.

   What sort of difference does it make?  I tried this process both ways and found out something amazing.

   In this image, the brightness and contrast were both adjusted to the same levels when equalizing the ratios of red, green, and blue.  The resulting image shows a pink-orange sky, the sort of sight we have been presented with commonly in the news media.

   This is not a bad picture, and if shown it and told that it was an alien world, most people would not question it at all.  (Click either image for a larger view.)

   But here I have performed a brightness adjustment only, and left the contrast values on their own.  The outcome is dramatically different.  Now the sky has only a hint of the pink, and looks fairly normal otherwise.

   I would readily accept this as sunset colors if told that this was a desert sunset scene.  But now there is something that shows up that reveals the true difficulty of getting this right.

   Notice the top picture with the pink sky?  The ground seems darker and more intense, with wind blown orange looking sand ripples.  This is the sort of picture that we have seen of late, with dark granular surface material everywhere.  But now look at the second image.

   It shows the sky as almost normal, but paradoxically, the ground is much redder!  How can one thing become more red and another less red?  That is the whole point of this rambling of mine- that some subtle changes in the process can completely throw it off, leaving us to wonder why somebody didn't put a simple prism on board for picking out the true solar spectrum when that sunlight reaches the ground.  And why, why, did they discard the scaling values for the images?

   Two small things that would have settled this decades-old question, and we still have no idea which is correct.  Of course, some of the earlier Viking images also showed a nice blue sky, and later composite images produced from them had been turned yellow-orange for some reason.

   My personal feeling is that most of the time, the skies on Mars are just as gray or blue as you would like, but when the dust kicks up, it turns a pink color.  That makes the most sense, based on what we know of Raleigh scattering and just what makes the sky blue in the first place.

Now, a thorny question

   Since the relative light intensity data is thrown away when an image at one frequency is made, there is no way to create a light curve that shows the amount of each part of the spectrum that is present.  If this is the case, then looking at rocks in different parts of the spectrum will no longer yield the curve that is essential to identifying minerals properly.  If this is true, then NASA cannot possibly identify a rock from its infrared components, because without a valid light curve, the mineral data cannot be reconstructed.

    If this information is true, then they have lost a very valuable part of the data at the outset.  It would seem to be true, since they state that they cannot construct an accurate color image.  This means that there are two possibilities- if they cannot make the proper light curves, then they cannot use the cameras for geology as intended.  If they ARE using the cameras to identify minerals, then they must have the proper relative intensity data, and therefore, should be able to create proper color images.  QED.

    So, NASA- what's the answer?  Do you have the proper relative intensity values?  Do you do brightness AND intensity sometimes, and not others?  Which should it be?  You, after all, made the hardware and wrote the code- you should indeed have the answers.

UPDATE:  I located this chart showing the light curves that NASA has produced from a sample of minerals.  This chart proves that either they DO have the relative intensity values or they found a way to compensate.  In either case, they CAN produce true color images using this information!  Here is the original link to the spectral chart.

    Here is the chart itself, showing that they have the ability to create a useful relative intensity light curve.  That proves that true color images can indeed be produced that do NOT show that muddy orange smoggy sky.

    The short line segments extending from each colored box is an isobar, a line that shows the amount of confidence in that particular data value.  In other words, the answer is that they have found out how to compensate with the lack of the relative intensity data well enough to construct useful light curves that allow minerals to be identified.  Using this same method, they can easily construct images in true color that will show the actual view of Mars at it would appear to the human eye.