More on Match Colour

Here everybody can post his problems with PhotoLine
cathodeRay
Mitglied
Beiträge: 151
Registriert: So 15 Nov 2015 12:37

More on Match Colour

Beitrag von cathodeRay »

I do realise the latest version of PL, which I have yet to upgrade to, does have a Match Colour function, but partly out of curiosity and partly precisely because I haven't upgraded yet, I have been trying to find a way to match colour between two or more photos. The scenario might be several photos from a batch that are of the same person/place at the same time but for whatever reason the colours are out ie don't match between the images. The challenge is to find a semi-automatic way to make the colours match, using a reference image as the template for the colours.

I did find an interesting PS method here. The basic idea seems to be to fool PS into thinking a non-grey colour is grey and then applying an invisible curve generated by the trickery to the target image. It's worth mentioning, as I discovered later, you have to follow the instructions exactly to get a good result.

The PS method uses the grey eye dropper in the Level dialog to do the grey point setting, via the colour panel. PL unfortunately doesn't have a grey eyedropper in the Histogram Equalisation dialog but it does have one in the Curves dialog (note the technique appears to need Curves run as a tool rather than an adjustment layer), so I tried the technique via Curves. The steps are:

(1) Open reference and target images, tile them, and make the target the active image.

(2) Tools > Curves and then double click on the grey colour swatch (the one under the grey eyedropper, that starts off being transparent) so the colour panel opens.

(3) Use the colour panel's eyedropper (not the Curves dialog eyedropper) to select the reference colour (the colour you want to inject into the target) and close the colour panel. This does two things: it sets the selected colour as the grey (I think this is what it means - our dearly beloved PL Help is silent on the matter) in the Curves dialog and it adjusts the RGB curves. I think those adjustment are the adjustments to turn the reference colour into grey, or the may be the opposite - the adjustment to turn grey into the reference colour. Or they may be something else...

(4) Now use the Curves grey eyedropper to click on a similar colour point (sky ref to sky target, skin ref to skin target etc) in the target image and Ping! The colour adjusts! Its an improvement, but not there.

So I tried Replace Colour, which allows you to select the source and target colours and again you can select from the reference image (never mind the fact the PL terms are to my mind back to front: the source is the target and vice versa) with the sliders in various places but although some colours matched very well, others went badly off piste and ended up as swathes of monochromatic horror. Curves did better.

I then remembered I had an ancient copy of PSE installed and so decided to try using that. Suffice it to say it produced a good result (as long as you follow the instructions to the letter). Here are the images (I have shamelessly copied the original reference and target image from the site linked to above, in the interests scientific enquiry, and of having something directly comparable):

Reference.jpg

Target.jpg

Result images in next post on account of number of attachment limit -grrrr....

I dare to think you will agree the PSE result is the visually closest and most pleasing image. The problem is the PS/PSE method is opaque as to what is actually going on, meaning I can't find a way to emulate what I can't see, if you see what I mean. Any thoughts on how this might be done in PL?

cR
Du hast keine ausreichende Berechtigung, um die Dateianhänge dieses Beitrags anzusehen.
Zuletzt geändert von cathodeRay am Mi 15 Nov 2017 21:43, insgesamt 1-mal geändert.
cathodeRay
Mitglied
Beiträge: 151
Registriert: So 15 Nov 2015 12:37

Re: More on Match Colour

Beitrag von cathodeRay »

And here are the results...

Result-PL.jpg
Result-PSE.jpg

cR

Edit: I have now tried Easy Filter's 'Smart Curve' using the same basic technique (the key thing is you have got to have access to both images so you can sample from the reference image) and this may produce the best result yet. It also shows more visibly the changes that are made to the curves. But it would be good if the same thing could be achieved using native PL tools...

Result-SC.jpg
Du hast keine ausreichende Berechtigung, um die Dateianhänge dieses Beitrags anzusehen.
bkh
Betatester
Beiträge: 3674
Registriert: Do 26 Nov 2009 22:59

Re: More on Match Colour

Beitrag von bkh »

Here's what you get using PL's "Match Colour":
match colour.jpg
You'll agree that it's much closer to the target than any of the above attempts.

Btw., why don't you select a control point for the source colour in the R,G,B curves (CMD-click into the image to set the points simultaneously, I think), then adjust the curve points vertically to match the RGB value of the target. Should work much better than the grey point.

EDIT: … which gives something like this, picking the sky colour:
match colour 2.jpg
Cheers

Burkhard.
Du hast keine ausreichende Berechtigung, um die Dateianhänge dieses Beitrags anzusehen.
cathodeRay
Mitglied
Beiträge: 151
Registriert: So 15 Nov 2015 12:37

Re: More on Match Colour

Beitrag von cathodeRay »

Burkhard - I think something may be getting lost in translation. In English the usage is 'target' is the image receiving the colour, 'reference'/'source' is the image donating the colour. So the aim is to make the target look like the reference/source image, not the other way round. At least in English 'targets' are things that things happen to, like getting shot(!), to give a rather sharp example. Likewise, a source (what I called reference) is something that things come from, ie something that gives, not receives. I mention this because I have noticed that in the English rendition of Replace Colour in PL, what I would think of as the target is called the source. From the Help:

"Replace Colors allows you to color parts of an image. At the top of the dialog there is a color field that defines the Source Color. This is the color that will be replaced." (emphasis added)

I think if I'm right what you have tried to do above is make the upper image (reference.jpg) match the lower image (target.jpg) in my original post, whereas I have been doing the opposite, which is why our results are so different.

That said, PL's Match Color has done a good job. I may have to upgrade sooner than I planned (was going to wait for the next major release).

I did in fact try the set control point/match the reference image routine and it did sort of work, sometimes quite well (indeed the curves were not that unlike the ones automatically calculated by PL) but it is a lot of manual pointing clicking and dragging, and the whole idea was to semi-automate the process harnessing some of PLs native functions to make the process both quicker and more consistent. That said, FWIW, here is my manual set control points (Ctrl+Left Click on Windows)/move the curve vertically to match the reference image result:

Result-manual curves.jpg


cR
Du hast keine ausreichende Berechtigung, um die Dateianhänge dieses Beitrags anzusehen.
cathodeRay
Mitglied
Beiträge: 151
Registriert: So 15 Nov 2015 12:37

Re: More on Match Colour

Beitrag von cathodeRay »

Here's an image showing I hope a bit more clearly what I mean about the source/target being the wrong way round (I painted on a red stripe to make things easier to see). Given the lower target image is active when the Replace Color tool is started:

- select eyedropper and left click on (as it happens) either image and the colour ends up in the Source panel
- I actually clicked on the sky in the Target image
- select the eyedropper and Shift+Click (as it happens) either image and the colour ends up in the Target Panel
- I actually shift-clicked on the red in the reference image

what PL then does is replace Source colour with the Target colour in the target image:

replace colours.jpg
I hope that makes it a bit clearer...

cR
Du hast keine ausreichende Berechtigung, um die Dateianhänge dieses Beitrags anzusehen.
bkh
Betatester
Beiträge: 3674
Registriert: Do 26 Nov 2009 22:59

Re: More on Match Colour

Beitrag von bkh »

cathodeRay hat geschrieben: Mi 15 Nov 2017 21:36 Burkhard - I think something may be getting lost in translation. In English the usage is 'target' is the image receiving the colour, 'reference'/'source' is the image donating the colour.
I now see what you mean. However, "source"/"target" can also have the opposite different meaning (cf. "source language", "target language", or see the use of "source" and "target" in the "Replace Colour" dialogue you just posted). Plus, things are compilcated by the fact that one image is the target wrt. colour and one the target wrt. structure.

Anyhow, here are the results for PL in the other direction:

PL's "Match Colour":
match colour.jpg
and manually adjusting a single rgb value in the sky to match an rgb value in the reference image using "Curves":
match colour 2.jpg
Cheers

Burkhard.
Du hast keine ausreichende Berechtigung, um die Dateianhänge dieses Beitrags anzusehen.
cathodeRay
Mitglied
Beiträge: 151
Registriert: So 15 Nov 2015 12:37

Re: More on Match Colour

Beitrag von cathodeRay »

Yes, the meanings of words are constantly changing, as the say on BBC Radio 4's I'm Sorry I Haven't Clue, but I still think common English usage has the source as the donor and the target as the recipient. I would even go so far as to suggest the OED (Oxford English Dictionary) backs this up:

Source: A place, person, or thing from which something originates or can be obtained.

Target: A person, object, or place selected as the aim of an attack.

I'm only banging on about this because I very nearly gave up on Replace Colour because the terminology made no sense. It was only when I realised that it was wrong and I 're-wrote' what was what that I got to be able to use it, ie was putting the different image colours in the right places. I've also since discovered that, as usual, a double click on the colour swatches themselves open up the Colour Panel and then it's eye dropper can be used to select a colour. This has the advantage that the Colour Panel appears to operate on its own, so a click from its eyedropper doesn't trigger any changes in the image, which is useful when selecting the source colour from the reference image.

Now that we are applying the changes in the same direction, I note that at least to my eyes the Match Colour result is (at least on my screen here) the least good of all those that have so far been tried. Although the blue sky is OK, the lighter bits of the sky have lost their glow, and the dark clouds are over dark. I gather PS's Match Color is a bit hit and miss, sometimes it works, sometimes it doesn't, and as neither PL nor PS appear to allow any control over the source beyond selecting a particular file then maybe this is not entirely surprising as neither program has any way of knowing what the important colours are.

On the other hand your manual adjustment via curves is one of the best results, partly because of your knowledge of and skill in using curves (and that's important because not everyone has those skills), but also because of the human input - I suspect if you were to turn off preview, you would not get such a good result! Gentle curves also naturally result in smooth transitions. However, as noted earlier, my intention is to somehow harness the internal processing of PL to get a result - basically, we humans select the important colour, and then PL does the match.

More broadly, this is not an easy thing to do. Firstly the desired shifts may not be uniform across the spectrum as they are say with a colour cast. The image the original describer of the Levels/grey eyedropper method used (perhaps deliberately), and which I copied here, does not contain a vast range of colours (blues and yellow/golds but no reds greens etc, nor the dreaded skin tones) and so is at the easy end of colour matching. On the other hand, some of the on-the-road portraits I have been working on recently have presented real challenges, for example I might get the skin tones close enough, but then some other part of the image will be way out. Replace Colors was particularly unpredictable here, with swathes of the image being transformed into a single 'blown out' colour, a sort of uniform pixelation.

FWIW, I also tried the Hue Editor, which has the very useful feature of allowing us to lock colours by adding stationary control points, but it fell down because the colour map in the dialog was too small, as in the crucial control points tended to overlap, and you couldn't see what you were doing - an ability to zoom in on the area of interest would be extremely useful - perhaps something to add to the wish list.

I suppose what I am looking for, specifically the ability to have two images open side by side and to be able to make multiple matching selections (not a huge number, maybe up to three or four or perhaps six) in both donor and recipient images, saying in effect I want these colours to match, doesn't exist. It may even be impossible (or too demanding), for example how to handle transition areas. Nik's Viveza get's close, with its ability to add multiple control points, but it lacks any true Match Color; instead, everything is based on and happens to one image, that is, it has no concept of a reference (source/donor) image. As noted previously, this tends to be a generic problem with plugins - once you are in the plugin, only that one image is available, with the notable exception of Smart Curves, but I think that exception is because of the trick of forcing it to use PL's Color Panel eyedropper, which can see anything that is available on screen.

Which set me thinking - maybe we can do the same thing in Viveza - that is, access PL's Color Panel (Editor) from inside Viveza, and then use it's eyedropper (not Viveza'a) to select a color outside the target image - and I've just tried it and it seems you can! More experiments are in order!

I'll be back!

cR
cathodeRay
Mitglied
Beiträge: 151
Registriert: So 15 Nov 2015 12:37

Re: More on Match Colour

Beitrag von cathodeRay »

OK, here is 'a' Viveza result using multiple grouped control points, along with the original reference/target images. I say 'a' result because with Viveza, anything is possible... It is also rather disappointing that what is supposed to be a sort of Match Colour thing doesn't really match the colour, so you have to do a lot of manual tweaking. In its favour, Viveza does have a full set of RGB curves that can be adjusted. Or maybe I am doing something wrong.

Reference.jpg
Target.jpg
Result-Viveza.jpg

cR
Du hast keine ausreichende Berechtigung, um die Dateianhänge dieses Beitrags anzusehen.