Saturday, July 15, 2017

A Super-Duper Primer of Astrophotography Part 8 - Post-Processing with Freeware

Stacking is only part of what makes a great image.  After getting an image out of DeepSkyStacker, there are still further steps to take that will complete the transformation of your noisy, dim, light-polluted subframes into a fantastic work of celestial art.  I'm going to write two separate tutorials - one for using freeware, and one for Photoshop.  Freeware can get you some good results, but Photoshop has some truly amazing algorithms that will blow freeware out of the water (there's a reason it costs money).  But I'll start with the freeware to show that there are still some things you can do before committing to buying a subscription for Photoshop.

"Fake" vs "Real"

It might feel at first like putting an image through an image manipulation program like GIMP or Photoshop makes it somehow less real.  I mean, you can make an image look like whatever you want, right?  While this is true, it is important to remember that what you are really doing with image processing is bringing forth the photons that are really there, but are obscured by noise and light pollution.  

My personal image processing philosophy is to keep the image as close to reality as possible.  Now, knowing what reality looks like can be very difficult.  No one has been on a spaceship and flown close enough to these objects to see what they look like, and every camera is going to capture that light-information a little differently.  Looking at other people's images online can help, but you have to keep in mind that even these images were all processed, and many use narrowband filters that are false-colorized or add color to wavelengths that we normally wouldn't be able to see (IR, UV, x-ray, etc).  Among close color renditions of red-green-blue imagery, there can still be vast differences of opinion - look up some images of M27, the Dumbbell Nebula, for example.  Is it green, or is it blue??  My camera tends to show more of a blue, but sometimes it can look more teal.  So what is truly real?  Basically what I try to do is to keep the expression of colors as my camera captures them, accounting for the knowledge that I will have less-intense red than I should, and if I use a light pollution filter, there will be a blue tinge to everything.  I will white-balance and enhance/suppress colors with that knowledge.  

Some astrophotographers prefer to make their images more artistic.  They will oversaturate colors, blow out reds or blues, change the hues of some colors in order to bring out differences in color, and other things in order to get neat-looking images or to point out interesting scientific phenomena.  I occasionally do this, but I don't post these images as astrophotography - I'll specifically call them my "artistic" take.  But that is up to each person.  When I get to a point when I can start selling my images, I might make more of these "artistic" versions, since they can be prettier and more interesting to look at than the "accurate" versions.  

The way you edit your images is up to you - there's no doctoral defense committee that is going to question your methods or your data.  So have fun, and make of your images what you want!  And always be transparent - don't make your Pleaides Cluster images all red and then tell people that's what it looks like in reality.  (Although a Pleaides triptych in red, green, and blue sounds neat!)


GIMP is short for GNU Image Manipulation Program.  GNU is itself a recursive acronym for "GNU's Not Unix," a project to build a Unix-like operating system that is not actually Unix-based (Mac and Linux are both Unix-based, for example).  There are many pieces of software out there that fall under the GNU label.   (Don't worry about the name - GIMP has versions for Windows, Mac, Linux, and GNU).  Because it's open-source, many users have written plug-ins for it to do all kinds of stuff.  Basically, it's a free mimic of Photoshop.

First, go find your favorite version of the TIF you saved out of DeepSkyStacker.  I'll edit my Rosette Nebula image for this tutorial.  Ignore the warning about GIMP only being able to handle 8 bits per channel if you get it.

Now, the following steps don't necessarily need to be done in the order I present them, but this is the order I usually do stuff in.  Go to Colors -> Levels.  This is where you can "stretch" your histogram and set your black point.  Start by moving in from the left - in the histogram for my image, you can see that the main peak is pretty far over to the right, which is why the background is so light.  Move the leftmost arrow close to the main peak, but try not to cut off any of it - you can lose faint details on your object.
I don't really end up stretching my histogram very much, since it usually comes out of DSS pretty well stretched.  I'll just cut off the bottom, which effectively moves the whole thing to the left, making your background blacker.  Click OK.

Re-open Colors -> Levels.  Setting the black point is a quick way to white-balance your image, but can sometimes give you weird results.  Click on the dropper icon (next to the box that says "Auto"), and then click on an area of your image that is empty and dark.  You will see this re-color your image.  If it comes out weird, try a different spot - you may have unknowingly clicked on a noisy pixel, or a tiny star.  You can also try the Auto button, which will set the black, gray, and white points for you.

See?  It's looking better already.

Now go to Colors -> Curves.  This will show a histogram with a diagonal line drawn across it.  Basically, the line represents an input-output value for every intensity from black (left) to white (right).  The horizontal axis is the input value, and the vertical axis is the output value.  For example, if you clicked on the line near the left and dragged it down to the bottom, it would change the input value to a lower output value, lowering the visual intensity of the blacker parts of the image (make the blacks blacker).  If you clicked on the line near the right side of the image and dragged it to the top, it would increase the visual intensity of the whiter parts of the image (making the whites whiter).  Go easy in this section - it's very easy to add noise here, or blow out parts of your image.  Usually here, I grab the middle of the line and bring it up a bit to increase the brightness of the midtones (where your object lives).  I sometimes also drag the lowest, leftmost part of the line to the floor of the plot, darkening the black areas a bit more.  

You can do this for the image as a whole, or you can break it down by color channel - red, green, and blue by clicking on the box next to Channel and choosing one of those color channels.  I will frequently go to the Red channel and bump up the red intensity, since shooting with a DSLR means that you lose quite a bit of red.  

Play with this for a while to get familiar with what moving the line does, and then decide how you want your image to look.  Changing the line will show a preview on the image, but if you click Cancel, it will reset it to before you opened the Curves window.  To make a change and "save" it before making another change, click OK, and then re-open the Curves window (Colors -> Curves) to do your next Curves edit.  I do this so that I don't have to re-do several steps if I change something and then don't like it.

With nebula images, usually I don't need to do much color-balancing after DeepSkyStacker, even if I use a light pollution filter.  So I'm going to open up a galaxy image now and show some additional color-balancing tools.

Here is an image out of DeepSkyStacker that I took recently of M101.  I used a light pollution filter, so it appears quite blue.
When I go search for M101 images online, generally the arms are a bluer share of blue, with red star-forming regions, and a yellow core.

I'll usually let the image processing program take a stab at white-balancing - but sometimes the results are really bad!
This is from clicking the "Auto" button in the Levels window.  When I choose a black point instead, the background gets blacker, but M101 still looks just as blue.  Choosing a star as a white point didn't change anything in this case.  So I'm still stuck with a blue M101.

Once you've done Levels and Curves, go to Colors -> Color Balance.  Here, you can adjust the color balance of CMY (cyan, magenta, yellow) versus RGB (red, green, blue).  Make sure you adjust for all three of the ranges - shadows, midtones, and highlights - until you get something you are happy with.  After messing around with all of the sliders, I got something with whitish-bluish arms, some red star-forming regions, and an almost-yellowish core.

Not too shabby!  Now I would go play around with the Curves tool some more.

You can also adjust the huge and saturation of your colors.  Go to Colors -> Hue-Saturation.  You will see a wheel of Red, Magenta, Blue, Cyan, Green, and Yellow, as well as Master in the middle.  I'll use this tool sometimes to further bump up the redness of my red if I'm imaging something with a ton of red, like the Eagle Nebula or the Rosette Nebula.  Basically what it does is let you change the hue (the color - you can make all of the reds blue instead), the lightness (the shade of the color - for red, burgandy to light pink, for example), and the saturation (how "strongly" the color shows up in the image).  For this image, changing these attributes doesn't drastically change the image (except for changing the hue of cyan), but I did make the cyan a little bluer.  These changes would be more obvious on a nebula image.

Finally, when you are satisfied, click File -> Export As... to save out a TIF (for future re-edits) and a JPG (to post to the internet).  

Now, as you may notice, there are a lot more tools available.  Many of them are filters that add interesting effects to images, and won't do much for your astroimages.  Others include healing tools, clone stampers, etc, which can help get rid of dust in your optical train if your flats are not the exact same orientation as your camera was that night.  I have not explored much beyond the tools I've shown (at least, not in GIMP), but feel free to try out all kinds of stuff on your images!  And there is a wealth of knowledge out there about how to use GIMP.


Even with darks and biases, you are still going to have noise, particularly with a DSLR, since they tend to not be cooled and are not optimized for low-light imaging.  Not to worry, there are ways of "removing" the noise so that your images look a little better.  An AstroBin user told me about a piece of software called Noiseware, which is not freeware but has a free version that lets you save out JPGs and works pretty well.

If you take a close look at the Rosette Nebula image, you can see a lot of "graininess," which is called that in the film world, but is called noise in the digital world.  While we can't remove it in a strict sense, we can reduce its appearance.  

Open up Noiseware and import your TIF.  It will look extra noisy here.  

You can see that there are a number of settings.  This program can both add noise or suppress it, so set the "Noise Level Adjustment" sliders to 0% if they aren't already.  Under the "Noise Suppression," start with the defaults, and see how that looks.  I would recommend staying away from 100% - basically what noise suppression is doing is smoothing several pixels across each other to reduce the appearance of noise.  But too much smoothing will smooth out the fine details of your image as well, and those fine details are what we really love in astrophotography.  So split the difference.  Click Go when you've set your settings.

Now check out your image - much better!
 Let's zoom in on that.

Now, the free version will unfortunately only let you save out JPGs, although the (rather expensive) paid version will let you save out TIFFs (and has a batch mode).  On the other hand, Photoshop has a built-in tool as well.


And now you're done!  Go back and look at your subframes, and then the image out of DeepSkyStacker, and then the image you just created.  Amazing what a little tweaking can do!  And there is so much more out there.  Some people spend hours post-processing their photos.  I tend to spend about 20 minutes after DeepSkyStacker is done stacking working on mine because I just don't know what all to do with it yet.  But there you have it!  So now you can spend all of your money on astronomy gear instead of software. :)

No comments:

Post a Comment