How to Invert Colors in Photoshop

Astrophotography is the realm of heavy post-processing: in order to create a pleasant and detailed image, you can’t avoid using powerful techniques such as image calibration, image stacking, histogram stretching, and more.

Alongside these crucial and universal “big editing steps”, you have a number of techniques and dirty tricks, each one useful to help you fix a specific aspect of your images.

Inverting colors in Photoshop is one of those “quick & dirty” tricks to deal with color cast and more.

img-2
Inverting the image of the M45 using Photoshop.

What Sort Of Effect Can I Achieve From Inverting My Images?

In photography, we rarely invert the colors of an image if this is not part of an editing workflow: inverted images are not exactly visually appealing.

Inverted images are not exactly visually appealing
Inverting the colors in everyday photography often results in something that is odd-looking rather than good-looking.

But astrophotography is not ordinary photography, isn’t it? It is more science than art and inverting colors of an astronomy image has some scientific importance.

Consider this image of M106 I recently photographed.

M106 is a classic target during galaxy season
M106 is a classic target during galaxy season (springtime in the Northern Hemisphere). Celestron C5 reduced on Sky-Watcher Az-GTI.

At a quick glance there is not much going on, except that some of the dots and smudges are actually galaxies.

Let’s now invert the image and convert it to black and white: now the tiny galaxies towards the top left of the image are much easier to spot, aren’t they?

The inverted version of the M106 photo
The inverted, black and white version of the previous image.

Also, the faint outskirt for M106 is more readily visible, as well as its inner arms.

Before computers, astronomers would inspect the negative film rather than the positive image (the one that looks normal to us). This is because our eyes and brain can pick up dark details on bright backgrounds more easily than faint details on a dark sky.

If you want to show you have captured something faint and small, you can invert your image to make the object easier to spot.

But there is also one popular celestial body that can greatly benefit from inverting the colors to create a fresh and surprising image: our Moon.

The lunar surface details are seen easily if you edited your Moon to create a mineral Moon

Not only do you see the lunar surface details very easily, but if you edited your Moon to create a mineral Moon, where the natural colors of the lunar surface are enhanced, by inverting the colors you usually get a good looking image.

(Very) Quick Tutorial To Invert Colors In Photoshop

Inverting an image in Photoshop is as difficult as:

  • Step 1: duplicate the level with cmd+j (mac) or ctrl+j (windows).
  • Step 2: hit cmd+i (mac) or ctrl+i (windows). Alternatively, you can select Invert in the Image -> Adjustments menu.

Since the editing in Photoshop is often destructive, it is better to invert the colors on a different layer, so that you can go back to the original image at any time.

Inverting colors works just as quickly with black and white images and even with layer masks.

Using Photoshop To Invert Colors On Layer

You can invert single colors selected from your image too. 

  • Step 1. Select the eyedropper tool and sample the color in your image you want to invert
  • Step 2. Create a new solid color layer by clicking the icon to create a new fill or adjustment layer
  • Step 3. Right-click on the newly created solid color layer and choose rasterize from the menu
  • Step 4.  Invert the layer with cmd+i (mac) or ctrl+i (windows)

Can I Reverse The Effect?

By inverting the inverted image/colors, you will recover the original one. 

But it is easier to work with layers and just delete the ones containing the inverted image/colors.

How To Remove Color Cast Using Opposite Color Neutralisation

There are many methods one could use to remove a color cast from an image, and Opposite Color Neutralisation is one of those and involves inverting colors.

A color cast is an unwanted tint that uniformly affects an image. In astrophotography, color casts can result from light pollution, using filters or a combination of the two.

The most advanced astrophotography software has tools to get rid of color cast, light pollution, and gradients but with others like, say, Deep Sky Stacker you have to take care of those problems by yourself.

Check this photo I made of the Pleiades: while I think it is a fine image, it clearly has a yellow/green color cast all over that should be removed.

M45 or The Pleiades
M45, also known as The Pleiades.

Depending on your monitor calibration the color cast may be evident or more subtle, so here is a high saturation version to make the color cast 100% visible.

Edited photo of the Pleiades

In the image above, you clearly see the cast has a mixed yellow/green tint in unknown proportion.

Rather than play with saturation in Photoshop Hue/Saturation adjustment layer and try to fiddle with the properties of the different colors, let’s remove this unwanted color cast with Opposite Color Neutralisation instead.

  • Step 1. Duplicate the layer using cmd+j (mac) or ctrl+j (win).
Duplicating the original image on a new level
Duplicating the original image on a new level.
  • Step 2. Invert the image with cmd+i (mac) or ctrl+i (win). Now you have the “negative” image, with the opposite colors.
Inverting the image in the top layer
Inverting the image in the top layer.
  • Step 3. Go to Filter -> Blur -> Average to transform the inverted image in a color layer whose color is the average color for the inverted image.
Creating a solid color layer with the average color
Creating a solid color layer with the average color for the inverted image in the top layer.
  • Step 4. Blend this layer with the original image using the blending Color mode.

The image clearly has lost a lot of colors and if anything, there is now a magenta color cast. We will fix this in the next step by reducing the opacity of the layer just right.

Setting the blending mode to Color
Setting the blending mode to Color.
  • Step 5. The dark sky is not solid black, but rather a neutral dark color that, in an RGB image like ours, is an equal mix of red, green, and blue. 

Toggle off the visibility of the top layer and with the eyedropper tool sample an area of black sky that has no stars nor nebulosity in it. 

When you find the right area, to sample it just shift+click on it.

A new Info window will appear, showing the R, G, and B values for the sampled area. You can see in my image I have little blue and red with respect to green. 

Sampling the dark sky in the original image
Sampling the dark sky in the original image.

Now toggle on the visibility for the top layer and look at how the R, G, and B values change: you can now see the green is lower than red and blue, which gives the image the magenta cast.

The R, G, and B value after applying the opposite color
The R, G, and B value after applying the opposite color.

To equalize the R, G and B values we can reduce the opacity of the top layer to a point where the image looks neutral and the R, G and B values are close together.

For my image, I am pretty happy with an opacity of 58%.

Setting the opacity to tune the strength of the color cast correction
The R, G, and B value after applying the opposite color.
  • Step 6. As you can see in the previous image, the blue colors typical of the Pleiades are greatly reduced. To recover it, we can create a layer mask so that the blue nebulosity in the original image is not affected by the opposite color neutralization.

Select the original image and go to Select -> Color Range and sample the nebulosity with the eyedropper tool in the Color Range window. 

Play with the Fuzziness and Range slider to have a good selection of the nebulosity area. 

The selection done to recover the blue color in the Pleiades nebulosity
The selection done to recover the blue color in the Pleiades nebulosity.

Toggle on Invert to invert the selection (we don’t want the nebulosity to be neutralized) and press OK.

Select the top layer and click on the add layer mask icon to create the layer mask. 

Now, select the mask, and with cmd+L (mac) or ctrl+L (windows), you can use the levels to extend or reduce the dark areas of the mask, so to further tweak the effect of the color cast neutralization on the nebulosity.

Tweaking the layer mask with levels
Tweaking the layer mask with levels.

And this is the final image, compared to the initial one.

original and corrected image comparison
Comparison between the original (top) and corrected (bottom) image.

Remove Chromatic Aberration With Opposite Color Neutralisation

The same idea of neutralizing the color cast can be used to selectively remove unwanted chromatic aberration, CA, and purple fringes from around the stars.

The workflow is the following:

  • Step 1. Sample the color of the CA to remove with the eyedropper tool.
  • Step 2. Create a solid color layer with the sampled color, rasterize the level and invert it.
  • Step 3. Select the original image and go to Select -> Color Range. Use the eyedropper to select the area with the color to remove.
  • Step 4. Select the top layer and create a new layer mask with the color range selection.
  • Step 5. Blend the top layer using Color Mode and tweak the opacity until you are pleased with the results.

The beauty of this method is that you can remove different CA colors (i.e., blue and purple fringes) in steps, and you can alter the mask to further tweak the effect and even exclude stars.

Conclusion

Inverting colors in Photoshop is very easy, and this is at the core of techniques to create less common images of the Moon, but also to help reveal small details such as lunar features, small galaxies, and structures in larger deep sky objects.

And let’s not forget that inverting colors is central to a powerful technique to remove unwanted color cast and chromatic aberration around stars from your deep-sky images.

img-19
About Andrea Minoia

Andrea Minoia works as a researcher in a Belgian university by day and is a keen amateur astrophotographer by night.

He is most interested in deep sky photography with low budget equipment and in helping beginners along their journey under the stars.