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:

Download NGC 300 FITS

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:

  1. In JS9, from the menu, select File – Close – all images
  2. 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
  3. Using the File menu, make the Blue file the active file
  4. 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.
  5. Using the File menu, make the Green file the active image
  6. From the menu, select Scale and enter 550 in the low box and press enter
  7. Using the File menu, make the Red file the active image
  8. From the menu, select Scale and enter 850 in the low box and press enter
  9. From the menu, select Color – Color Controls
  10. Move the window so that it is out of the way of your image
  11. Make the blue image the active image
  12. From the Color Controls menu, select blue for the color (it is under the menu that says grey)
  13. Make the green image the active image
  14. From the Color Controls menu, select green for the color (it is under the menu that says grey)
  15. Make the red image the active image
  16. From the Color Controls menu, select red for the color (it is under the menu that says grey)
  17. 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
  18. Close the Color Controls window
  19. Open the NGC 300 luminance image
  20. Set the image scale to 800
  21. From the menu, select View – Blending
  22. Clear the checkboxes next to the blue and green images
  23. Click the checkbox next to Image Blending to blend the image
  24. From the menu, select View – resize – set to image size
  25. 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

  1. Point your browser to Photopea.com
  2. Open the image your browser downloaded (select File – Open and find your image)
  3. 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:

  1. From the menu, select Window – Navigator
  2. Zoom into the image until the number beside the slider is around 700
  3. 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:


  4. From the menu, select Select – Color Range
  5. Set the Fuzziness value to 20
  6. Move the Color Range window so that it is out of the way
  7. Click Replace next to Mode
  8. 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.



  9. Click the + symbol next to Mode
  10. Carefully click a red pixel – see the note for number 8
  11. Click Ok
  12. From the menu, select Select – Modify – Expand
  13. Enter 2 in the box and click Ok

    This is what my screen looks like:


  14. From the menu, select Edit – Fill
  15. From the Fill option, select Content Aware
  16. Click Ok and wait for Photopea.com to process
  17. You’ll note that the selected areas are now empty
  18. From the menu, select Select – Deselect
  19. From the menu, select Select – Color Range
  20. Set the Fuzziness value to 20
  21. Move the Color Range window so that it is not on top of your image
  22. Click Replace next to Mode
  23. Carefully click a blue pixel – see the note for number 8
  24. Click Ok
  25. From the menu, select Select – Modify – Expand
  26. Enter 2 in the box and click Ok
  27. From the menu, select Edit – Fill
  28. From the Fill option, select Content Aware
  29. Click Ok and wait for Photopea.com to process
  30. Zoom back out so that you can see most of the image
  31. 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:

  1. From near the bottom right of the Photopea.com screen, locate the Background layer, right-click it and select Duplicate Layer
  2. From the menu, select Select – All, followed by Edit – Copy, followed by Select – Deselect
  3. From the menu, select Layer – Raster Mask – Add (Reveal All)
  4. Press and hold the ALT key on your keyboard and click the white box next to Layer 1
  5. From the menu, select Edit – Paste
  6. 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.
  7. From the menu select Image – Adjustments – Levels
  8. Move the slider on the left until the number in the box on the left is at about 100 and click Ok
  9. Click the image on the left side of Layer 1 to reveal the normal image of NGC 300
  10. From the menu, select Filter – Blur – Gaussian Blur
  11. 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.
  12. 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:

  1. Press and hold ALT on your keboard and click the small white and black version of NGC 300 next to Layer 1



  2. From the menu, select Image – Adjustments – Invert
  3. Select the Brush tool from the toolbar


  4. 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:


  5. 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.
  6. Enter zero in the R, G, and B boxes, and click Ok
  7. Click and drag to paint over the galaxy – your screen should look like the following when you are finished:



  8. Click the icon of NGC 300 on the left side of Layer 1, as shown:


  9. From the menu, select Image – Adjustments – Levels
  10. From the Channel dropdown, where it says RGB, select Green
  11. 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

  12. Click Ok to accept the change
  13. 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.