Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Combining RGB layers
#1
Some of my photographs have a chromatic aboration problem where some colours are out of sync with others. The problem colour appears to be green but it might be more tricky than that. Assuming it is green..

I thought it might be possible to decompose the problem image into colour layers in GIMP, move the pixels of one layer over slightly, and recombine the layers. I don't know exactly which colour is out of sync or how much to move them so it is an experiment.

For the first attempt I decompiled the original image into RGB layers, which produces three greyscale layers. 

Unfortunately the greys do not help me to see how much one colour is out of sync with the others, so I converted each layer to RGB and colourised them as the colour they are supposed to represent (red = hue 0, green = hue 120, blue = hue 240). I now have three distinct coloured layers that I can combine in various ways. I also created a solid white background layer.

However, I cannot find how to merge these layers to reproduce the original pre-decomposed image. Which transparency and layer modes should merge the red/green/blue layers to re-create the original image?


×
Reply
#2
Quote:...[I thought it might be possible to decompose the problem image into colour layers in GIMP, move the pixels of one layer over slightly, and recombine the layers. I don't know exactly which colour is out of sync or how much to move them so it is an experiment....]

I will throw this old script into the hat. One of Saul Goodes scripts, shows how you can combine those grey masks back into one. Each layer and mask move as-one, just use the move tool on the layer.  Note the layer mode for RGB additive colours. The script can also decompose to CMY for a subtractive model.
You can of course make similar up manually, copy and paste the decomposed image layers into layer masks.

   

This is the original for Gimp 2.8 (there is a modified version for 2.10) Unzip, put into (probably)  /Users/MyName/Library/Application Support/Gimp/2.8/scripts  Registers in the layers menu.


Attached Files
.zip   sg-decompose.zip (Size: 1.41 KB / Downloads: 353)
Reply
#3
I also tried what appears to be the same approach with black background and lighten only, but the total output was more than 100% lightness (original yellows were washed out). I then added a greyscale for lightness only, and reduced each layer to 25% - this produced the right amount of lightness overall, but average hue was incorrect.

I'll take a look at the script and come back tomorrow, thank you.
Reply
#4
(02-27-2021, 08:50 PM)GnR Wrote: Some of my photographs have a chromatic aboration problem where some colours are out of sync with others. The problem colour appears to be green but it might be more tricky than that. Assuming it is green..

I thought it might be possible to decompose the problem image into colour layers in GIMP, move the pixels of one layer over slightly, and recombine the layers. I don't know exactly which colour is out of sync or how much to move them so it is an experiment.

For the first attempt I decompiled the original image into RGB layers, which produces three greyscale layers. 

Unfortunately the greys do not help me to see how much one colour is out of sync with the others, so I converted each layer to RGB and colourised them as the colour they are supposed to represent (red = hue 0, green = hue 120, blue = hue 240). I now have three distinct coloured layers that I can combine in various ways. I also created a solid white background layer.

However, I cannot find how to merge these layers to reproduce the original pre-decomposed image. Which transparency and layer modes should merge the red/green/blue layers to re-create the original image?

Tools to correct the chromatic aberrations are part of many demosaicing apps (they work much better when they can use the "raw" sensor data).
Reply
#5
Maybe this can help you: http://hugin.sourceforge.net/tutorials/tca/en.shtml
Reply


Forum Jump: