Deep Sky Astrophotography - Processing Tutorial

Learn how to process, step by step in written format, deep sky astrophotography using Deep Sky Stacker and Photoshop.

Learning the skills to process astrophotography images is something that takes time. It is also something that you will continually build on and improve. When I first started deep sky astro work I felt fairly competent with capturing the individual pictures after a few test runs. However, the processing was a huge learning curve and it is not necessarily intuitive, even if you are used to using Photoshop and Lightroom. I wish there was a step by step guide when I started  - as I found a lot of the youtube videos, somehow, confused me also. When I begun shooting deep sky style astrophotography images, I had some experience with ultra wide field tracking. I am speaking about astro landscape style shooting - with lenses such as a 14mm, 20mm, or 35mm / 50mm prime lens. Because of this, I jumped at the chance of a conjunction occurring in March of 2021 between Mars and the Pleiades.

Mars and Pleiades conjunction on March 2021 from Scotland

In order to get this field of view, I used a 70-200/2.8 lens at 200mm on a Nikon D850 in ‘full frame’ mode (which gives a 45MP output, more than enough for a competant astrophoto - that can also be dithered to double that resolution later - a technique developed by NASA themselves, if you have a lower resolution camera). The settings for this image were ISO 800, 2 minute sub exposures (individual exposures making up the image), of which there where only 20. The astute amongst us will clock that this means on stacking, this will give 40 minutes of total integration time on target if we use all the frames. (sometimes we need to discard a few due to wind causing blur, or other factors). This image is not perfect, it has been edited a while ago now and like any photographer will tell you - their process from capture to print is constantly evolving, and hopefully improving. We could almost go back to any old image and process it better than we did, especially if we look far back in our careers. This aside, I wanted to demonstrate what it looked like for what it was, the initial foray into this genre by me. The one thing I would change about this image would be more time on target of course, along with the fact I should have tried to track most of it at zenith, rather than most of the exposures in the stack being low on the horizon, where light pollution is greatest and therefore, collection of the data, the light - is poorest. This would have given me more dust  and detail etc.

The Deep Sky Stacker Interface

So how did I process it? First I imported all the files onto the PC and stacked them in deep sky stacker. This process involves direct stacking of raw files called light frames, essentially the frames that contain  your actual exposures, along with the necessary calibration frames called flats, bias and sometimes  - darks. Lights, flats and bias frames (used to calibrate the flat frames) are essential in order to perfectly knock out lens vignetting  for deep stretching of the file during processing, and in addition get rid of any dust spots that show in the resulting stack, originating from your sensor or rear element. You may think your lens profile correction will work but it is no where near accurate enough  to do a good job. I have seen a few youtubers proclaiming this works well but it is not my experience at all. It definitely doesn’t help with dust spots which are a big problem when stacking multi-hours of data together for deep sky astrophotography images. Depending on your camera, you might not need  dark frames. This all depends on how good your sensor’s dark current suppression is. The d850, Z 8 for example - which I own, do not require darks for example. Most modern dslr  and mirrorless cameras will no longer require them. This is good. It saves a lot of time when under precious dark skies.

At the end of the stacking process, deep sky stacker kicks out a   stacked tiff file containing huge amounts of data in a linear form.  This  file will look almost utterly black most of the time, and will next undergo a process we call stretching. Because my initial example picture is very old now, and the data is limited, I have opted to show you on something much newer from the Whirlpool Galaxy, which lies at 23 Million light years from us. This will allow me to show you the dramatic effect processing has, and how careful one must go about it to achieve the best results.

32 bit to 16 bit conversion - choose exposure and gamma as the method

When we first import the file to Photoshop from Deep Sky Stacker, as mentioned, we are presented with a black looking 32 bit file. This is normal. In order to be able to work on it, we must convert it to 16 bit to see things like colour histograms - which will be essential to allow us to process it efficiently. We can go ahead to select Image - Mode - 16 bit. Use the method "exposure and gamma” to do the conversion. As you can see here, I made a simple action to save me time which is something I’ve done more and more over the years in PS to save time in repetitive processes.

The first stretch

Stretching is the process in which we dig out faint signal carefully, and reveal the image within the greyness / blackness of the stacked file we see on screen. To do this, press CTRL-J for a new layer copy, and then CTRL-M for curves. The upward slope of the curve brightens the collected signal as you can see here vs the 32 bit original file. You can now see that the histogram has now moved along to about a 1/3 position and the colour channels are separating. True colour balance is garnered by ensuring the start of the data slope matches (not the mid point). More importantly, first we must correct the histogram by using a levels layer (CTRL-L) in order to blacken the sky again and remove sky glow and some light pollution. You may see a faint green cast here - that’s normal, and we can deal with this shortly. Stretching is a process that  most of the time needs a few iterations or more. It is better to carefully stretch each time, than to try and do it   ‘all in a one-er’, which most of the time isn’t possible anyway.

CTRL-L to access levels

I’ve pulled the black point slider just before the start of the curve. If you wish, you can do the exact same on curves. Be careful not to clip into the data and burn the blacks up beyond recovery. Press OK to confirm the change and let’s move onto the next step - protecting star colour. We do this by making a selection of the stars using colour range (select - colour range), on a new layer. See the below image. I have selected the brightest stars which have colour in the original stack using the colour range tool - I will now go and remove the centre of the galaxy with a selection and then feather this using expand 2 pixels and feather 2 pixels, to ensure I have captured the halo of light around each star. Do this by going to Select - Modify - Expand, et cetera.

Colour Range tool to select highlights

After doing so, press CTRL-U to bring up the saturation filter in Photoshop, shown below:

Star colour protection and boost

This is a to taste type of thing here. Remember that in stacking these images together, they have lost colour because there is no de-bayering process applied. So we need to bring it back. Stretching will dig out signal, but will slowly desaturate colour. This is why I have taken to using special stretches which have mathematically been calculated to maintain as much colour as possible. (More later). 35-60 is a range I live in, any less than 35 and the change is not noticeable enough. Press OK, then press Ctrl-D to deselect the previous selection. Flatten the image and then press CTRL-J for another layer to work on. This keeps the system running fast and efficiently. If you have a lot of RAM and wish to go non-destructive with your editing, feel free to do so (I do this often also).

2nd stretch using the Arcsinh stretching process

This time, as explained earlier, I am using a specially designed stretch by the very knowledgeable Mark Shelley. You can grab the stretches for PS here. You can see that the image is really starting to come together, however another issue is presenting itself. Notice the much more obvious green cast as we have stretched the data? There are many ways to combat this, even a program, hasta-la-vista green. I am going to show you the correct way to remove it, no matter how bad it is, no matter the colour the cast is. This is  based on what I have learned from Roger Clark. Notice the colour channels have drifted apart like we touched on before? Now we are going to bring the leftmost point to match. Make sure you have your histogram enabled in the view window, and that you have colours selected to see the red, green and blue channels as I do here. Open curves on a new layer, and go to in this case the green channel. Slide the left most point to the right (you are subtracting green from the image as you do this). This is also the correct method to extract light pollution. Many people rely on the white balance slider in a processing to fix light pollution issues - which is why you will see plenty of blue milky ways with white colourless stars online. This is creative processing - I wanted to demonstrate what I have learned in regards to keeping it as natural as possible.

NB: In order to remove light pollution, we have to subtract from each colour channel, to align the left most peak of the data, then slowly, bring the hump of the data to the left. The amounts we subtract will often be different from each channel, to achieve neutrality. The gap between the left side wall of the histogram and the data hump is where sky glow and any light pollution in the image live. By correcting it properly, without white balance tools, we protect star colour and naturality of the image.

Green Channel Correction

Now, simply do the same with blue, pull the left most point rightwards until every channel now aligns (the left most point - not the peaks of the colour channels).

Blue Channel Correction

Hey presto; as if by magic, we now have a neutrally toned image which we can further process still. About here, I’d deal with gradients. The best place to deal with them is when they appear, and again, in iterations, gradually. You can see in this file, it is pretty good already but it can be improved. There is a manual way of doing this but I bought a program called GradientXTerminator. It is well worth the money, but to begin with, I will show you how to approach this without owning the plugin which I have applied to Photoshop. Notice that, throughout this entire process, I have been very careful not to clip black areas. (any clipping on the histogram you might see here is just from the stacking artefacts on the edge frames). Nearer the end of processing you can set your black point and how dark you wish the sky to end up being. For now, it is about subtlety. Some files will require many iterations of stretching. As I mentioned, it is best to do this in small steps, than one huge step that could introduce artefacts into your end result. In my opinion, the more amateur looking deep sky pictures have too black a background. Space is not deep black, it is mostly a greyish colour to our eyes. Keep this in mind, but ultimately - you have to decide this one yourself as you process. For now, it is left processible, and protects the data we worked so hard to collect on the night. It also allows the faint spiral arms of the galaxy to be seen. We will see later, that in making space appear unnaturally black, we will destroy this faint signal around many deep sky objects which would be a shame.

Removing the Deep Sky Object

To remove gradients in PS, once again make a new layer and we are going to do something which at first seems counter-intuitive - remove the galaxy or deep space object. This process really only works where there is a definitive object. Otherwise you will have to use selection feathering. (I will expand this section later). Take the Spot brush tool and clone the galaxy away. Less is more. Make it invisible. Then go to Filter - Noise - Dust and Scratches. Remove all the stars to be left with just the background gradients in your image.

Dust and Scratches filter

Next we go to Image - Apply Image. Use the same settings you see here. What we are doing here is extracting that background gradient from the file. Note that I have the method as subtract.

Apply Image Settings

After using apply image and pressing OK, the file will have a pretty level background. (Ignore the bright lower left section - we can deal with that later). This file did not have a bad gradient to start with, so the result is not very dramatic in this instance. If you are shooing with a wider lens (a lens that say has a large angular field of view like say a 50mm lens, in a light polluted area - this step will be very dramatic to see if done correctly.

Gradient Removal in Photoshop using no plugins

Depending on how the stars look, it is time to protect them again. Repeat the process previously described earlier in this tutorial if you feel your image requires it. We can now open Adobe Camera RAW (ACR) and essentially get Lightroom. It’s time to remove Chromatic Abberation in the lens profile area if your file displays purple or green star halos etc. Give a mild saturation and vibrancy boost to the overall image too if you wish. (Remember that the image looks like a faded photograph still at this point because of debayering).

Mangled Colour

I’ve put this next photoshop picture in here to show how easy it is to change colours using curves. Here I have introduced blue into the file. All I did was open a curves layer, select the blue channel and pull the curve up on the lower third very slightly. Some will like this style of processing but please consider that it is completely faked colour, and is not reality. Notice how the histogram left wall has now shifted? Doing this, will ruin the beautiful alternating vibrancy of the stars in your image. That said, it is your image and you do with it as you wish.

So far, we have stretched the image, protected and boosted star colour, corrected gradients, removed sky glow and light pollution and moved the file closer to a presentable state. To really bring the image to life we have a choice. We can continue stretching and processing in this way, but what we find is in doing so, the stars get larger (bloat) and begin to dominate the scene. Remember that the stars are in our own galaxy. We are viewing foreground milky way stars, and a distant 23 Million Light Years, Whirlpool galaxy behind them. Ideally we do not want to have the stars super massive in the foreground and distract from the final result. It also makes them physically larger than they would appear to the eye, which does not feel natural. This is why I use another plugin, called StarXTerminator. This program splits the file into stars and galaxy. This way, we can work on each independently and prevent star bloat, ultimately allowing much better control in post processing. If we progress without using a star-splitting program, we can claw back the stars - to a point, using a selection of the stars themselves, and the minimum filter in Photoshop. Because this is a beginner tutorial, I will progress without the paid plugin to show you what you can attain in Photoshop with no extra money spent, you are also free to try further stretching and reducing the stars later with a minimum filter. Google search for starnet++. This is a program that can do the same as StarXTerminator but it is completely free. It is not as good at removing all stars as the paid option, but with a bit of cleaning up we can make it work just fine for now. Next I am going to show you how to separate the deep sky object from the stars, so we can really bring the picture alive in processing and bring out all the faint detail present in the stacked tiff.

Let’s make a new layer, CTRL-J, and on this layer we are going to remove the stars. Make a further copy if you wish, in case things go wrong. This is the most modern way to approach astrophotography processing and allows us not to bloat stars as previously mentioned, and also maintain their colour. You want to do this step, when you have the stars as you like them. Ideally, you do not want them large and bloated from multiple stretches, so care is required at this step.

Run StarXTerminator, or Starnet++ to remove the stars and leave the galaxy only

If you are using starnett to do this, simply make a copy of what you are so far and export it as a TIFF into starnett and run it. Make sure the TIFF is flattened, 16 bit and has no layers. If you have done this correctly, the following is what you will see when you bring it back into photoshop as a starless TIFF:

Stars removed. Stellar structures maintained

If you used starnett++, you can load that resulting file that you ran through the program by going to File - open - place embedded. Now we have a layer above, which has only the galaxy, and the stars and galaxy below it. You may have some artefacts that you can carefully remove using the clone stamp or healing brush tools. Be careful not to remove small satellite galaxies, or smaller distant deep sky objects. On the bottom left here, is another galaxy. We don’t want to remove that. Note that colour is still good - the left side of each colour channel aligns. Keep the colour histogram up at all times to give you feedback as you process your picture. Now we can progress to the next step.

Make another copy of the starless layer, just in case we screw something up during the next steps. It can be invaluable and quick to refer back to a copy when processing images such as these. On the top layer, let’s press CTRL-M to bring up curves, and lets reset the black point in the image. This removes sky glow and light pollution, and obviously, makes the sky blacker. This is what you will see:

CTRL-M to access curves, protecting highlights and resetting the black point, all whilst brightening the galaxy

Notice that the colour histogram channels, red, green and blue have all been pulled to the left wall of the histogram. Be careful not to clip anything here when doing this part. Notice I have slid the first point on the histogram to the bottom of the data curve, then applied a small S-curve to the data. This upward last point in the slope, brightens the data contained here. The central point, increases contrast. I’ll say it again - it is important to do this in small steps so we do not mangle the data, especially the highlights. So far the highlights are still okay, too far and we will burn them out to pure white, but I will show you ways to stop this occurring, whilst still brightening and increasing the contrast of the galaxy. Let’s do another curves stretch on this galaxy.

2nd curves stretch with an additional point placed to the right

The reason I have now added this extra point on the right, is to protect the highlights blowing at this stage. Later, we will have to do more than this to mitagate the data breaching and blowing in the histogram. I think you will agree, it is starting to look very nice, and we are maintaining the faint spiral arms which extend outwards from the galaxy. This part has always excited me and put my night of image capture into perspective. Seeing the image develop is a huge buzz. Let’s do a third curves stretch.

3rd curves stretch

Brighter still, and more detail in the spiral arms are showing. Notice the colour channels are slipping out of alignment? We need to correct this, and increase contrast whilst doing so. Levels layer and let’s tidy this up.

It got slightly less red, I pulled the red channel back 2 with a levels adjustment

In case you are wondering, we have some stacking artefacts around the edges of some of this image. This is normal and will always occur. Be aware that this will show up in the histogram as some clipped data because it is deep black and contains no data. We will fix that later when we recombine the data. The reason I am not doing this now is it will make the files out of alignment when we try to recombine them shortly. That can be fixed but I do not want to introduce further complexity at this stage in this tutorial. Next let’s look at giving the galaxy some more structure and presence. Invoke a high pass filter by going to Filter-Other-High Pass. Do this on a new layer. To do this, combine all the data so far by pressing CTRL-ALT-SHIFT-E to make a merged layer. Choose a radius to bring out the dust lanes as I have done. It looks terrible right now, but wait…

Invoke a High Pass filter to show the dust lanes

High pass filter invoked, change the blend mode to soft light and adjust opacity to taste

Now we simply change the blend mode of that layer to soft light, and adjust it’s opacity to taste. This really brings out the detail. We can also add some clarity and vibrance by going into camera raw filter. New stamped layer (CTRL-ALT-SHIFT-E) and then Filter-Camera Raw. In Camera Raw, we can go head and further adjust vibrance a little more than saturation in order to saturate some of the weaker colours and bring them out. We can also add a touch of clarity to taste. Press OK to accept the changes. (Notice I have not altered or skewed colours - I am just boasting what is already present in the image. If you wish, you can simply use a basic feathered mask to maintain this correction to the galaxy and prevent the sky background becoming affected by this adjustment. Yet another way is to make a black mask on the layer and paint where you want the adjustment around the galaxy, then select the layer mask options and apply a ton of feathering to it (essentially a gaussian blur layer but on the layer - thus we can see the changes and modify them, with more control than a direct gaussian blur layer would do). You can also split this step up, and if you have bad colour noise in the background, use camera raw detail correction to remove colour noise on the dark sky background. Go gentle with that tool, and look at a 100% view when making the adjustments.

Camera Raw Vibrancy / Saturation boost of existing colours

The image is looking ok so far, quite good even you might say. But I have been a touch heavy-handed on the core, and it is very slightly near being burned out. Lets make a basic selection. Here I have used a Luminosity Mask using Lumi32 from Jimmy McIntyre (highly recommended to follow his teaching and the like - I have learned so much from his teaching). Of course, you don’t have to use a luminosity mask to select the core, just use whatever method you prefer, the most rudimentary being a brush with feathering, maybe a colour range selection, hand drawn could work, etc. Now all we do is apply it to a curve and drag the curve downward. If you wanted, you could also on a fresh layer, select the burn tool - highlights and adjust it that way.

Luminosity Selection of the core of the galaxy in Lumi32 - a 32 bit masking program by Jimmy McIntyre

Curves to bring back the core data

There are lots of little tricks and nuances we could perform here to this image, however I am going to progress to combining the data and finishing the image. Here is the really exciting step - recombining the two images and seeing how they look. Let’s leave the galaxy sitting on top and the stars below on layers. Change the top layer (galaxy only) to lighten, or screen blend, whichever looks best. Don’t worry, we can tweak further. It just has to recombine nicely.

Recombine using the Lighten blend mode applied to the top layer

Ah-ha! Now we have beautiful stars which show their star colour, they aren’t bloated, and we have dug out the faint galaxy and it’s spiral arms and made it ever closer to the final result - the picture. What I have shown so far will keep colours fairly accurate if you will. However, if you want to go artistic - knock yourself out, it is your image. This image will benefit from a contrast increase - but we must watch that we don’t destroy highlight or shadow detail when doing so. Let’s crop the image to get rid of the stacking artefacts and recheck the colour histograms.

Crop Tool

Below, I have used curves to pull the left point right, subtracting the skyglow from the background and darkening space around the galaxy. Be careful here. This is a to taste measurement but remember that if you are going for realism, space is never black (except perhaps in a black hole). Most keep the background between 15-30. This can be checked by using the info panel if you are really curious.

Curves to reset the black point in the image

You can see the info window easily in PS by going to WINDOW-INFO, see below.

Black point circa 24-23-23

Now for the finishing touches. To bring an image together, I find it is best to do a global contrast edit, being careful of the core etc. There are also a few other steps you can do, or more if you wish. Upon viewing at 100%, I noticed I had some colour noise. I made a luminosity selection of the sky background using Lumi32. This gets a very fine selection and is thus very accurate and smooth in it’s result. However, you can just simply paint and feather it to do this if you are not yet competent in using Luminosity masking which is a topic I will perhaps be demonstrating more in the future. Here I simply opened camera raw, pulled the colour noise up to about 25 and thus it only acts on the blackness of space.

Selecting the background using a luminosity selection to apply colour noise reduction via Camera Raw

Another colour correction using the same method shown previous to take out some of the red

I applied a simple contrast increasing S - Curve here using curves (obviously!)

Let’s fix the bottom left corner artefact. Below, I have applied a selection and I am going to apply a feathering to it. I can either do that by using the select menu, or just simply make a mask and feather it there, which is what I am going to do. All I did here was drop the red channel and green slighty in curves, then I went to the layer mask properties and applied 90 or so pixels of feathering. There is still some green that won’t budge. Let’s open camera raw and get rid of this patch once and for all, then adjust it slightly with a soft brush, shown in the next three images:

I used the lasso tool to make a simple selection bottom left

Using curves to fix the redness in the bottom left corner

A soft brush can do wonders

Now we are nearing the end. Let’s “sharpen” the image. I don’t like to apply actual sharpening because I think it feels unnatural. I like these pictures to have this soft glow. I have added some clarity and texture (very low amounts) in the below picture.

A touch of clarity applied in camera raw and vibrance to taste (low amounts here)

Now I use NoiseXTerminator to finish up and reduce any noise without making it too plasticy looking, a further quick levels layer and an orientation adjustment and we have the final result:

The final result in photoshop

The final result

And there you have it. This could be tweaked more - you can really do what you want with a file until you are happy with it as a final picture. As I’ve shown here, Photoshop is still a very competant tool to process astrophotographs. It also allows one to build on what they already know from other genres, perhaps such as landscape photography. I have tried to process this as naturally as possible to preserve and maintain natural colour of the galaxy showing it’s light blue spiral arms, hydrogen alpha areas and dusty surroundings. I hope it was helpful to anyone trying to process that first picture, or second, or third…

This page is being continually developed and expanded. Check back soon.