Transfers color advanced filter problems

(Silvio) #1

Hello everyone,

I am working with GIMP 2.10.4 and G’MIC 2.4 on Windows 10 - 64 bit.

My goal is to blend two images together but, before doing so, I want to transfer the colors from one image (source) to another “similar” image (my target).
I have read there are many G’mic filter to try to do so.
In the end, I have opted for the transfers color advanced filter [1] even though I am not 100% sure it is the correct one to pick…

I have applied this filter to several images taken with a Leica camera mounted on a microscope (Orthoplan Leitz). All images concern nematodes (that is, little “worms”).

In short, this filter does not produce any result with my microscope images whereas it does work fine with any image taken with my DSLR camera. As a consequence, I suppose my images with nematodes slides are not meant to be used with this filter…

Here is a screenshot with 2 layers. The “source layer” underneath the layer stack on Gimp is the one I want to preserve as colors. Above there is second layer which I want use as a target (it is supposed to take the colors from the layer below).
Whenever I apply this filter nothing occurs (tried several settings).

Here is the result I am trying to reach:

Here is the Gimp .XCF file with the 2 images (as layers):

As of today, to get this same result I merge the images together and adjust the color of the images with the GIMP clone tool (but it is a time-consuming task…)

Perhaps there are better G’MIC filters to adopt: I have even tried to create a “LUT image” to no avail ?

Thanks in advance for any pointer on this subject.


( #2

try remove transparent

(Silvio) #3

Hello bazza,

Thanks for your tip.

I have added an alpha channel to the above-mentioned layer, the one where I wish to change the overall color of its background.
Later, with Gimp, I have applied the tool “Select by color” and I have erased this selected color with the “Eraser tool”.
It kind of works but some part of the nematode are erased as well.
Here is the results:

BTW, I have also tried some Gimp “Blending modes” with the 2 layers in the stack but the result is not completely satisfactory. On top of that, I have also tried another G’MIC filter: “CLUT from after before layers” but id didn’t work either [1].

In conclusion, I have noticed that the transfers color advanced filter of G’MIC never works on my images since, I suppose, they are pretty much identicals.
They are all taken with a Leica camera mounted on a microscope and the subjects of these pictures are little worms (nematodes) in a drop of water over a microscope glass slide.

This same G’MIC filter works fine with my Nikon DSLR images though :slight_smile:
For instance, I take 2 different pictures of an apple and then I am able to transfer the color between these 2 images with the filter.


( #4

sendme both images separately. To see if I see the problem can not open the xcf

(Silvio) #5

Hello bazza,

First off, THANKS a lot indeed for your help! :slight_smile:

Today, I took another 2 pictures with the Leica camera mounted on the microscope. They are about the same fungus (Fusicoccum spp.).
The first is darker; the second is much brighter.

In short, with the G’MIC transfers color advanced filter I have tried to make the dark image much brighter.
With Gimp it is extremely easy and it suffices to work with the curves tool (it only takes a few seconds). On the contrary, it is extremely difficult to get the same result with this G’MIC filter.

Here is the darker image, that is the one I want to brighten as much as the second image:

Here is the brighter image (the “reference”):

( #6

baterias.xcf (5,4 MB)

Transfer Colors [Variationnal]
I use a cut by that the numbers (10 µm) they would not have to be


Indeed there are many ways to do this with G’MIC. Some questions might narrow it down:

How accurate does it need to be (e.g. is this for a study/paper and needs to be recorded to avoid manipulation issues)?

Does the colour need to be matched, or only brightness?

Are you planning to do this using only the GUI, or command line?

As for suggestions… assuming accuracy isn’t a problem you could try blend [seamless] for merging. G’MIC also has a curves filter. Other than that the list is enormous!

(Silvio) #8

Hello eveyone,

Thanks a lot indeed for your help.

Usually, for my Leica pictures, I only need to match their overall brightness.

Many fungi have spores that have no color and I prefer to have the final images with the same brightness. The same goes for nematodes (little “worms”).
In my previous example, with the Fusicoccum spores, one pciture was much darker than the other.
With Gimp I adjust these different images with the Curves tool (by changing the brigthness).

With G’MIC I have tried the “transfer color advanced” and the “Clut from after before layers filters” (to create a LUT table) but I found them poorly working compared to the Gimp curves tool where this brightness modification is extremely quick to perform by hand.
I prefer to work with the GUI.
No batch transformation is needed since I have only a few images to work with.

Needless to say, I was not sure about the correct G’MIC filter to pick for my use-case because there are hundreds of them to try :slight_smile:


In that case the direct equivalent in G’MIC is probably the “Curves” filter in HSV mode, then tweak the value channel. A more automated rough equivalent might be (at command line) :

gmic img1.png img2.png rgb2hsv8 sh 2 balance_gamma. {ia#-2} rm[-2,-1] hsv82rgb

(Silvio) #10

Hello Garagecoder,

I have applied your G’MIC code, within the CMD prompt (Windows 64 - bit), with my 2 jpeg images (Dark - Bright) and it does work fine!

I have also tried the G’MIC filter: Layer > “Blend Seamless” and it does wonders as well :slight_smile:

Thanks a lot indeed for your suggestions!