Creating Diffraction Spikes with GIMP 2.8

Updated on November 3rd, 2014

Photos of open star clusters always appear to be more pleasant when stars have diffraction spikes.  But if your telescope does not have support vanes from a secondary mirror you are out of luck.  One solution is to simply tape in a cross pattern some string or fishing line over the dew shield.  Or you can turn to digital enhancement.  Below is a procedure to enhance your photos by digitally adding diffraction spikes using GIMP 2.8. in 8 easy steps!  No special plugin or filter required.

Lets try with my image of M45 – Pleiades taken with a Skywatcher 80ED.

M45 - Pleiades Benoit Guertin

M45 – Pleiades
Benoit Guertin

The first step is to create a new “brush” in the shape of diffraction spikes.  To do this, start with new canvas with a transparent background.  In the screen shot below, a new 1000 x 1000 pixel image with Fill with: Transparency

Create new image with transparent background

Create new image with transparent background

Then draw a grey straight horizontal line.  I’ve used the Pencil Tool to create a thin solid line, 4 pixel width end about 300 pixels length.  To ensure a straight line, click once to mark your starting point and holding the SHIFT+CTRL keys click again for the end point.  Note that my line isn’t centered, that is because the blur performed in the next step will shift the line to the left.

Draw a gray horizontal line

Draw a gray horizontal line

Next use Motion Blur to create the gradient (Filter > Blur > Motion Blur…) The blur angle must be 0 deg such that it’s in the same direction as the line.  In this example I’ve used a blur quantity of 150.

Add motion blur to create the gradient.

Add motion blur to create the gradient.

Duplicate the layer, rotate by 90deg and align both lines to form a cross.  A simple step by step is the following:

  1. Select > All
  2. Edit > Copy
  3. Edit > Paste as > New Layer
  4. Layer > Transform > Rotate 90deg clockwise
  5. Tools > Transform Tools > Move  (now align the vertical line to form a cross)
Duplicate, rotate and align both lines

Duplicate, rotate and align both lines

Once both layers align, you can merge them into a single layer.

Merge down to flatten into a single layer

Merge down to flatten into a single layer

Finally, using the Ellipse Selection Tool, select the cross and Copy to clipboard.  This will automatically assign it to the Clipboard Brush (red arrow and box below).  Note that I have kept the screenshot of my previous version with the black background in the snapshot below to make it easier to see.

GIMP - Diffraction Spike Creation - STEP 4

GIMP – Diffraction Spike Creation – STEP 4

We now have a new brush type that can be used to create diffraction spikes with nothing more than a single click. Yay!  The Paintbrush will show up as a cross but with dotted line (see red arrow in screenshot below).  Size and angle can be adjusted via the Tool Option Box; see below sections with red boxes.  I use the Paintbrush tool to create the spikes.

Now have a new brush to create the diffraction spikes

Now have a new brush to create the diffraction spikes

Now it’s time to get down to business and add those diffraction spikes to the stars.  Start by opening your astrophoto and duplicating into another layer.  This duplicate layer will be blurred and used to transfer the colour information on the spikes.

In the duplicated layer (with the original layer turned off), use a heavy Gaussian Blur (Filter > Blur > Gaussian Blur…) to blend out the colours.  In this example, I used a blur value of 60px.  As the blurring makes the image darker, use the Curves Tool to bring the brightness back up.

Increase brightness after burring

Increase brightness after burring

Result of the blurred layer

Result of the blurred layer

Now create a Layer Mask for this blurred layer.  Select to initialize the Layer Mask to Layer’s alpha channel.

GiMP - Diffraction Spike Creation - STEP 7

GiMP – Diffraction Spike Creation – STEP 7

With both the original and blurred layer visible.  The blurred layer is selected and the blend Mode is set to Screen.  Select to edit the mask of the blurred layer (right mouse-click on the blurred layer), and click on the stars to draw the cross pattern.  A diffraction spike should instantly appear!  As your Brush is the cross pattern, you will see in dotted lines the size and angle.  If you don’t see your cursor, simple adjust the size (ex: 500).

GIMP - Diffraction Spikes Creation - STEP 8

GIMP – Diffraction Spikes Creation – STEP 8

Resulting image after clicking on a few bright stars:

M45 with diffraction spikes added

M45 with diffraction spikes added

Try different settings (a larger pen width for the initial cross pattern) or playing with the quantity of blurring and curve adjustment of the blurred layer.

If you have other improvements or suggestions, please share using the comment field below.

Advertisements

4 thoughts on “Creating Diffraction Spikes with GIMP 2.8

  1. Quick test performed with transparent background for the cross-hair and it works. To get the right results, instead of the pencil tool to apply the diffraction spikes, must select the paintbrush tool to get the right gradient. Will try a few other improvements and will modify the procedure in the next day.

    Like

  2. could you please break this down a bit more, im duplicating layers as you said but i cant get the 2 lines to overlap each other i cant even get them in the same box??? any help would be great thanks.

    Like

    • I’ll break it down more into step-by-step tonight. I’ll also try a few things to see if it’s easier such as doing a Select All – Copy and then Paste as New Layer instead of duplicating the layer. That way the new layer is floating. Then the following operation: Layer > Transform > Rotate 90deg. Hopefully the layer will still be floating and it’s easier to align both lines into a cross.

      Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s