This article is a detailed workflow for processing a sample observation of NGC 300 using freely available online tools, so there’s nothing to install on your system. The workflow uses JS9 to combine and convert the FITS files into a PNG and then uses Photopea.com to further enhance the final image.
In this article, you’ll learn the following:
- Combine R, G, and B FITS images using JS9
- Using JS9, blend in luminance image into the RGB
- Resize the image to its original dimensions using JS9
- Remove a gradient using Photopea.com
- Reduce small-scale noise using Photopea.com
- Eliminate cosmic rays (green/red/blue blips) using Photopea.com
- Remove the green cast using Photopea.com
- Learn about masks in Photopea.com
Result
This is the result of processing NGC 300 using the directions in this article:
Sample Download
You can download the sample observation of NGC 300 here:
You can read more about this observation here.
Processing NGC 300 Using JS9
Start by downloading the sample observation of NGC 300 and unzip the files in a convenient folder.
Next, start JS9 either within Slooh.com or using the standalone web application; the directions are the same regardless of how you start JS9.
Do the following in JS9:
- In JS9, from the menu, select File – Close – all images
- Using Windows Explorer, or Finder on a Mac, drag and drop the R, G, and B files onto JS9 or select File – open local and open the R, G, and B files
- Using the File menu, make the Blue file the active file
- From the menu, select Scale and enter 500 in the low box and press enter
What this does is set the background sky level – I discuss how to measure the pixels in your image and how to set the black point here. - Using the File menu, make the Green file the active image
- From the menu, select Scale and enter 550 in the low box and press enter
- Using the File menu, make the Red file the active image
- From the menu, select Scale and enter 850 in the low box and press enter
- From the menu, select Color – Color Controls
- Move the window so that it is out of the way of your image
- Make the blue image the active image
- From the Color Controls menu, select blue for the color (it is under the menu that says grey)
- Make the green image the active image
- From the Color Controls menu, select green for the color (it is under the menu that says grey)
- Make the red image the active image
- From the Color Controls menu, select red for the color (it is under the menu that says grey)
- From the menu select Color – rgb mode
You now have a color image. Next, we’ll open the luminance image and blend it with the color image - Close the Color Controls window
- Open the NGC 300 luminance image
- Set the image scale to 800
- From the menu, select View – Blending
- Clear the checkboxes next to the blue and green images
- Click the checkbox next to Image Blending to blend the image
- From the menu, select View – resize – set to image size
- Save your image as a PNG and note the filename in your browser’s downloads folder
If you open your image using your operating system’s image viewer, you’ll notice that it has several issues that need to be corrected:
- There’s a color gradient going from the top to the bottom of the image
- The image has a blue/green color cast
- Some of the stars have a green cast
- There are red, blue, and green cosmic rays throughout the image (zoom in to see these)
Fortunately, it’s possible to correct all of these problems using Photopea.com or Photoshop; Photopea.com is recommended because there’s nothing to install on your system.
Correcting the Color Gradient using Photopea.com
- Point your browser to Photopea.com
- Open the image your browser downloaded (select File – Open and find your image)
- Follow the directions in this article to remove the color gradient
Removing Cosmic Rays from the Image
If you zoom into the image (press CTRL plus + to zoom in; to move around the image press and hold the space key while clicking and dragging your mouse), you’ll find that there are a lot of red, green, and blue pixels – these are cosmic rays. We can remove these from the image. Instead of filling-in the areas with the color of the background sky, we’re going to use Content Aware fill, which evaluates the pixels around the area being filled and intelligently fills in the regions.
Do the following:
- From the menu, select Window – Navigator
- Zoom into the image until the number beside the slider is around 700
- Navigate around your image to find a region where there are green, red, and blue pixels clustered together
This is what my screen looks like: - From the menu, select Select – Color Range
- Set the Fuzziness value to 20
- Move the Color Range window so that it is out of the way
- Click Replace next to Mode
- Carefully click a green pixel
Your screen should look like the one shown below – the Color Range box should be almost entirely black. If you see a miniature version of NGC 300 in the image, this means you have selected something other than a green pixel. If this happens, click Replace and try again. You can also try to reduce the Fuzziness value. - Click the + symbol next to Mode
- Carefully click a red pixel – see the note for number 8
- Click Ok
- From the menu, select Select – Modify – Expand
- Enter 2 in the box and click Ok
This is what my screen looks like: - From the menu, select Edit – Fill
- From the Fill option, select Content Aware
- Click Ok and wait for Photopea.com to process
- You’ll note that the selected areas are now empty
- From the menu, select Select – Deselect
- From the menu, select Select – Color Range
- Set the Fuzziness value to 20
- Move the Color Range window so that it is not on top of your image
- Click Replace next to Mode
- Carefully click a blue pixel – see the note for number 8
- Click Ok
- From the menu, select Select – Modify – Expand
- Enter 2 in the box and click Ok
- From the menu, select Edit – Fill
- From the Fill option, select Content Aware
- Click Ok and wait for Photopea.com to process
- Zoom back out so that you can see most of the image
- If you still see red, blue, and green pixels in other parts of the image, repeat from step 2
Reducing Small-Scale Noise
Now that we have cleaned up the cosmic rays, there’s some noise in darker parts of the image. We can reduce this noise by adding a gaussian blur but only to the dark parts of the image. To protect the stars and galaxy, we’ll need to create a mask.
Do the following:
- From near the bottom right of the Photopea.com screen, locate the Background layer, right-click it and select Duplicate Layer
- From the menu, select Select – All, followed by Edit – Copy, followed by Select – Deselect
- From the menu, select Layer – Raster Mask – Add (Reveal All)
- Press and hold the ALT key on your keyboard and click the white box next to Layer 1
- From the menu, select Edit – Paste
- From the menu, select Image – Adjustments – Invert
This action reverses the mask image so that the dark areas on the image are protected whereas the white areas are not protected. We need to increase the contrast on this mask image to protect the galaxy and smaller stars more strongly. - From the menu select Image – Adjustments – Levels
- Move the slider on the left until the number in the box on the left is at about 100 and click Ok
- Click the image on the left side of Layer 1 to reveal the normal image of NGC 300
- From the menu, select Filter – Blur – Gaussian Blur
- Enter 3 in the box and click Ok
This action reduces the amount of small-scale noise throughout the darker parts of the image. You can see the effect this produces by zooming into a dark part of the image and repeatedly clicking the eye icon next to Layer 1 to toggle it on and off to see the effect of this change. - Ensure that Layer 1 is active (the eye icon should be white/illuminated)
Masking the Galaxy and Modifying the Stars
Now that we have reduced the noise in the image, we need to correct the green cast of some of the stars. We do that by modifying the mask we created in the preceding section so that it protects the galaxy but still allows us to modify the stars.
Do the following:
- Press and hold ALT on your keboard and click the small white and black version of NGC 300 next to Layer 1
- From the menu, select Image – Adjustments – Invert
- Select the Brush tool from the toolbar
- We’re going to paint over the galaxy in black to protect it. Press the right square bracket key on your keyboard ( ] ) several times until you see the circle become larger. It should be about the size shown in the sreenshot below:
- Next, we have to select the color black to use for the color of the brush. Click the color control box near the bottom-left of the Photopea window, as shown in the following screenshot:
Ensure that you click the box shown in the screenshot – the color of the box may be different than shown here. It is important that you click the correct box as shown in the screenshot. - Enter zero in the R, G, and B boxes, and click Ok
- Click and drag to paint over the galaxy – your screen should look like the following when you are finished:
- Click the icon of NGC 300 on the left side of Layer 1, as shown:
- From the menu, select Image – Adjustments – Levels
- From the Channel dropdown, where it says RGB, select Green
- We’re going to adjust the amount of green in the image slightly. Enter 0.85 in the middle box
This is a small adjustment but the result can be seen in the star below the galaxy. Click the Preview checkbox on and off several times to see the effect and note how only the stars are affected by the change; the galaxy is protected because it is masked in black - Click Ok to accept the change
- From the menu, select Layer – Flatten Image
You can now save your image as a PSD to keep it in native Photopea/Photoshop format or export it as a PNG to post it online.
Conclusion
In this article, you learned how to edit an image of NGC 300 using JS9 and Photopea.com. Along the way, you learned about scaling, blending LRGB, masking, noise reduction, you learned how to eliminate cosmic rays from your image, and you learned how to remove the green cast from the image.
You must be logged in to post a comment.