A star diffraction effect is a spiking effect from bright sources of light, such as stars. The diffraction effect is usually considered to be pleasant because it enhances the appearance of stars in an image.

This article walks you through the process of adding diffraction spikes to the stars in your images.

Update

The method in this article is not very reliable. I wrote another article that presents a more reliable method with better results here: Creating Star Spikes: Reliable Method.

The Results

First, the result of the process:

This image has faint spikes in it, which you can make out when compared to the original without diffraction spikes:

The effect is not overwhelmingly strong, yet strong enough to be noticeable.

Updated Method

The method in this article is not very reliable. I wrote another article that presents a more reliable method with better results here: Creating Star Spikes: Reliable Method.

Sample and Actions Downloads

I have made available the before and after images for you to download and to try this technique yourself.

The sample includes PNGs as well as a final PSD file with layers.

In addition, I have made available a set of Photopea actions to make this process easier for you. Simply run the actions instead of repeatedly making menu selections. I describe how to download and install the Actions in Photopea later in this article.

The Source Image

Your image source should be nice and contrast-y. This means the stars should ideally be as close to white as possible with a good, dark background. If your image lacks contrast, the diffraction spikes won’t be visible at all. Refer to the sample images for this article for an idea of how your images should look before you get started.

For now, let’s use the ‘before’ image in the sample downloads: ngc3195-without-diffraction.png.

Navigate to Photopea.com and select File – Open to open the image.

Selecting Only The Stars In Your Image

The first thing we’ll have to do is to isolate the stars in our image. I wrote an article about how to select only the stars in your image, but I’ll go over the steps here anyway.

Right-click the Background layer in the layers panel at the bottom right side and select Duplicate Layer as shown:

We’re going to make a couple of adjustments to subtract one part of the image from the complete image, revealing just the stars.

From the menu select Filter – Dust and Scratches

Adjust the top slider until you can’t see the stars in the preview image anymore. Your image will change dramatically, but that’s expected. Move the slider slowly until you see that all of the stars are gone, as shown in the following screenshot:

Once all of the stars are gone, move the lower slider until you see your image looks relatively normal – there shouldn’t be any blurriness or distortions. Your stars will come back but slightly darker – this is normal and expected, as shown in the following screenshot:

Go to the Layers panel and locate the word “Normal” and click the arrow next to it. This is the blending mode – the way Photopea blends one or more layers. Select Subtract from the menu as shown:

The screen changes to mostly black with the stars on it. We have now isolated the stars from the rest of the image.

Now select the areas between the stars and then invert your selection to select just the stars.

Note: If you are interested in applying this effect in different ways, this is where you would do it. You could, for example, pick only some stars, or manually select stars instead of selecting most of the stars as the directions that follow have you do.

From the menu, choose Select – Color Range

Set the value of the Fuzziness parameter to about 40, click Replace, and then click a black area in the image. Your screen should look something like the following:

Click Ok to make the selection. Now the background is selected, to select the stars, from the menu, choose Select – Inverse – your screen will look something like the following:

Click the eye icon next to the Background copy (or Layer 1) layer to hide it since we don’t need it anymore.

Making Layers of Stars

We need to make copies of the background stars.

1. Click the Background layer to activate it and from the menu, select Edit – Copy.

2. Now, from the menu, select Edit – Paste to create a copy of the star layer.

3. Select Edit – Paste again to create a second copy of the star layer.

4. Double-click the word ‘Layer 1’ and rename it to 90deg

5. Double-click the word ‘Layer 2’ and rename it to 0deg

Your layers panel should look like the following:

Load Actions

Actions in Photopea are pre-recorded menu selections that make it easier to repeatedly carry out tasks. I have created a set of Photopea actions to add the star diffraction effect to your image and made the actions available for download.

1. Download this file: RemoteAstropotography-StarDiffractionActions.zip

2. Unzip the file and locate the file “RemoteAstropotography-StarDiffractionActions.txt”.

3. Open the file in Photopea – select File – Open and locate the file.

4. Photopea will ask if you want to load this file each time you start Photopea – select Ok

From the menu, select Window – Actions to bring up the Actions window.

Execute the Diffraction Actions

1. Activate the 90deg layer, and click the 90degrees action in the Actions window.

2. Click the Apply button at the bottom of the window to apply the actions:

3. Activate the 0deg layer, and click the 0degrees action in the Actions window.

4. Click the Apply button at the bottom of the window to apply the actions:

Your screen will look something similar to the following:

We need to enhance the effect a little.

5. Press and hold the CTRL key on your keyboard and click the 90deg and 0deg layers to select both of them.

6. From the menu, select Layers – Merge Layers

7. From the Actions window, locate the DiffractAdjust action and select Apply to apply it to the 0deg layer.

Your screen should look similar to the following:

8. Export your image as a PSD or PNG to save it.

What The Actions Do

The 90degrees and 0degrees actions repeatedly use the Motion Blur filter on the star layers, making the effect longer with each iteration. The effect is applied at 90 degrees and 0 degrees, which is why you have two layers and then merge them.

Note that the stars you select need to be of a reasonably large size – tiny stars won’t work. Ideally, choose fatter stars for this effect to work well.

The DiffractAdjust action applies a curves adjustment, and some other actions to enhance details.

Possible Improvements

You can improve on this result by being more selective about which stars get the effect added to them. Instead of selecting the background when selecting by color, try to select the stars and see what happens. You could also select stars individually or select only stars of a certain brightness before applying the effect.

For example, in the image that follows, only two stars were selected for the effect, leaving the remaining stars alone:

Conclusion

In this tutorial, you learned how to add a star diffraction effect to your images using a combination of manual and automated steps. The manual steps select the stars and the automated steps apply the diffraction effect to the stars.