Home » Deep Sky » How to Convert a 2D Astro Photo to 3D
Deep Sky Nebulae Tutorial

How to Convert a 2D Astro Photo to 3D

At some point during your astrophotography journey you start to wonder – can these deep space photos be done in 3D?

3D-Carina
The Great Carina Nebula in Bicolour narrowband, acquired and processed as 3D. Photo: Dylan O’Donnell

You may have seen visualisations on space documentaries where nebulae are given a sense of depth. It’s possible you’ve already stumbled across the incredible work of Finnish astrophotographer J-P Metsavainio, whose 3D post processing is some of the best in the world.

Sponsored advertisement

Here I’ll show a simple method, originally described by J-P Metsavainio, for converting a 2D nebula astrophoto into a 3D stereo pair.

The process leans heavily on artistic license and is certainly not a scientifically accurate portrayal of the volume and spatial dimensions of the subject, but it is exquisite to look at.

Once you have the 3D pair, people who can cross their eyes will be able to view the 3D effect immediately. For others, you can create a looping GIF as shown here, or convert to a red/cyan anaglyph for use with 3D glasses.

Either way, if your folks reckon you’re pretty fancy with your space photos…just wait until you blow their cotton socks off with one in 3D!

Ok let’s do it. You will need:

  • A completed nebula astrophoto, preferably with no dominating stars or diffraction spikes
    Note: if you intend on making a 3d Stereo pair, portrait oriented images are best.
  • PhotoShop
  • PixInsight (Optional)

Step 1 – Prepare a starless image

The left hand image in our 3D pair is the finished photo. Rotate this to portrait orientation if not already (it’s easier on the eyes to get the 3D that way) save this as LEFT.TIF.

For the right hand side, we need to start with a starless version of the finished image. There are many ways to do this, and it can be done with PhotoShop filters like Dust and Scratches, but I prefer PixInsight’s MorphologicalTransformation tool.

Screen Shot 2016-02-22 at 8.23.25 PM

Use MorphologicalTransformation with PixInsight and PhotoShop to remove stars:

  • Open LEFT.TIF in PixInsight and then the go to the PROCESS menu -> Morphology -> MorphologicalTransformation
  • Zoom into the image until your pixels are 100% or more.
  • Change the Operator to “Morphological Selection” and the Amount to roughly 50%. Set the Structure Type to “Circular”.
  • Under Thresholds increase Low to about 0.2 to help preserve the nebula structure. You may need to adjust these depending on your image resolution and star size.
  • Hit the APPLY square at the bottom left of the image. Note the nebula detail — if it’s ok, hit APPLY a second, then a third time if needed. You should now be left with some bigger stars only.
  • Save the image as RIGHT.TIF
  • In PhotoShop, open RIGHT.TIF and use the Spot-healing tool to remove the remaining bright stars and save your file. You might also like to run a gentle Dust and Scratches filter.

At this point you might be tempted to stop because a starless nebula looks AMAZING! Admire your work then move on to the next step…

Starless nebulas do look kind of amazing. Without the stars, the structure of the dust and gas dominate your attention.
Starless nebulas do look kind of amazing. Without the stars, the structure of the dust and gas dominate your attention. (NOTE: Rotated for article, keep your starless image portrait aligned like the final) Photo: Dylan O’Donnell

Step 2 – Create a star-only image

In PhotoShop:

  • Duplicate the “final” LEFT.TIF and call it STARS.TIF. Make sure it’s flattened.
  • Open STARS.TIF in PhotoShop and select Image menu -> Apply Image -> Source: RIGHT.TIF -> Blending: Subtract. This will give you a nice “stars only” image.
  • Save this file.
Screen Shot 2016-03-02 at 8.46.31 PM
Apply Image subtracts your starless nebula from the full version, leaving you with just the stars!

Step 3 – Prepare a luminance map

In PhotoShop:

  • After you’ve saved your starless image as RIGHT.TIF, open in PhotoShop and choose File -> Save As… -> LUM.PSDeffectively duplicating it into a new file.
  • Image menu -> Mode -> Greyscale and confirm you want to discard the colour data.
  • Image menu -> Mode -> 8bits/Channel
  • Add the Gaussian Blur filter at 1-2 pixels. This will smooth out the 3D effect as this image will determine the depth/height of the 3D effect, based on value of each pixel from black to white.
  • Save this image as a PhotoShop document (e.g. LUM.PSD)
Screen Shot 2016-02-22 at 9.08.52 PM
The luminance map is a black and white version of the starless nebula. It will be used in the next step to determine how high (or deep) parts of the nebula will appear in 3D.

Step 4 – Add your stars to the RIGHT.TIF image and place in 3D space!

At this stage I like to open the LEFT.TIF and RIGHT.TIF files and put them side by side in PhotoShop. It makes it easy to compare the differences, and if you can do the 3D crossover vision unaided, you can look at your image in 3D as you manipulate it.

In PhotoShop:

  • Open LEFT.TIF and RIGHT.TIF files so you can see them side by side. RIGHT.TIF is still a starless nebula at this stage.
  • Click on RIGHT.TIF to make it the active window and Convert to 8-bit with Image -> Mode -> 8 bits/Channel.
  • Select File -> Place … -> STARS.TIF to add the stars as a new layer.
  • Change the Layer Blending Mode from “Normal” to “Screen” on the new layer.
  • Hold down SHIFT and click the LEFT ARROW on your keyboard 2-3 times. This shifts the star layer slightly to the left.
    NOTEAt this stage remember that anything we shift left on the RIGHT.TIF image will appear to move “away” from the viewer in 3D. Anything we shift right will appear to move “toward” the viewer in 3D.
  • Right click anywhere in the image and select Place. Your star layer is now in the image, and the stars are in the back, “behind” the nebula when viewed in 3D.
  • Now use the lasso or circle select tool to select a bright star, then click “V” for the move tool. Use SHIFT and the RIGHT ARROW key to nudge the star to the right. This brings it “towards” the viewer in 3D.
  • Repeat this last step for as many bright stars as you like. Use different amounts of nudging to the right so they appear different distances from each other for a great depth effect.

Step 5 – Make your nebula 3D with the displace filter

In PhotoShop:

  • In RIGHT.TIF select the starless nebula layer
  • Click Filter -> Distort -> Displace … then change Vertical to 0 and Horizontal from 10-30. You may need to try different values here if the effect is too extreme or subtle depending on your image size.
  • It will prompt you for a file, select the LUM.PSD file you created and saved earlier.
  • Did you see your nebula appear to rotate as if by magic? If you missed it hit CONTROL-Z (undo) a few times to see it change. If it’s too subtle or too strong, go back a few steps and change the Horizontal value for the Displace.Screen Shot 2016-03-02 at 9.15.36 PM

Your LEFT and RIGHT images are now a pretty convincing 3D pair.

Ideally you should save them in a new document side-by-side and export to JPG to share with your cross-eyed capable friends.

You might also like to try reversing the pairs to see the nebula “pop” in a different direction. If that’s more pleasing to you, you might like to go back and move the star layer around again as reversing the pair would have made the far-away stars close, and vice versa.

Another good trick is if you’d like to “sculpt” certain areas of the nebula in 3D, use the liquify filter in photoshop to “push” the nebula features right or left slightly (nearer or further).

Finally, if your nebula has certain features, like a tendril of cloud you’d like to see “closer” to you, copy it into a new layer and push it slightly to the right.

The final 3D stereo paid ready to view or convert! Photo: Dylan O’Donnell

Step 6 – Enjoy your insanely amazing 3D stereo pair!

There are several different ways to view the 3D image, try them all:

  • View with the traditional cross-eye method.
  • Convert into an animated GIF that bounces between each pair giving the illusion of 3D rotation.
  • Load the image onto your phone and view with a pair of “Google Cardboard” goggles. Anyone can view these and they are super cheap!
  • Use these instructions from NASA to convert into a red/blue anaglyph for use with classic retro 3D glasses.
  • If you’d like to make a colour anaglyph like the one at the start of this article, simply copy and paste one of the pairs into the RED channel of the other one. Then with all channels visible, line up the stars as best you can then and nudge the RED channel layer left or right until it looks good in your 3D glasses. Note, this will work best for photos that are not predominantly blue or red.

I’m a huge fan of 3D space photos, so if you create any for planetary or landscape I’d love to see them. Let me know in the comments, and happy displacing!

The Rosette Nebula, captured by the author, Dylan O’Donnell with 9.25″ Celestron Edge HD + Hyperstar / QHY12 CCD and processed as a 3D anaglyph.
Like this article enough to support the author?

About the author

Dylan O'Donnell

Dylan O’Donnell is an Australian web developer, Director of DNA Digital and zen10 Australia and public science communicator. He has a Masters of Information Technology and his astrophotography been featured by NASA and ESA among others. He is also a member of Team Celestron where he also contributes. To date, two of his images have been selected for NASA Astronomy Photo of the Day (APOD).

See more of Dylan’s work on his website.

3 Comments

Click here to post a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  • Dude…You are soooo awesome….This was a really easy to follow guide. My Grandmother always said if I crossed my eyes too much, they might get stuck. As long as I can keep looking at images like these it might be worth it… 😉

  • Thanks so much for the help. You showed me some things I couldn’t have figured out – like the displace filter. I took a Hubble image of the crab nebula and made it spectacular.
    I’d like to move on to some rotating images, like Metsavainio has done.
    Have you tried making lenticular prints? I can imagine them in a transparent medium, backlit. That would probably be the ultimate.

From PhotographingSpace.com:

Astrophotography Photoshop Actions!

Make your Milky Way POP and finish off your photos like a pro with our Photoshop Action Packs optimized specifically for astrophotography!