xooorx PRO 9:35pm, 5 May 2007
This is loooooooong winded, hence a new thread, but I've got a method for:

Colour matching in the Gimp: Source 1


Colour matching in the Gimp: Source 2


Colour matching in the Gimp: Finished!

Instructions to follow...
xooorx PRO Posted 9 years ago. Edited by xooorx (member) 9 years ago
STEP 1: Resize your old master to the same size as the picture you want to modify. (Doesn't matter about the aspect ratio, its the colours we're after not the image).

STEP 2: Change your old master to indexed colour mode, 256 colours, with optimum palette.

STEP 3: Copy the image you want to modify as a new layer into the old master. (You can do this by dragging the thumbnail from the layers menu). The Gimp has no choice but to render your image in the 256 colours it got from the old master.

Here's what this gets us: A really really shoddy version of what we're actually looking for:

Colour matching in the Gimp: Intermediate

(continues below:)
xooorx PRO Posted 9 years ago. Edited by xooorx (member) 9 years ago
STEP 4: Flatten the image and then go to Image->Mode->Decompose and select YCbCr_ITU_R470, having ticked "decompose to layers".

This gets you a 3 layer 'monochrome' picture. Two of the layers look a bit weird, because they encode the colour content of the image. The third layer looks more normal because it encodes the luminance of the image.

STEP 5: Repeat step 4 on the picture you want to modify.

STEP 6: Delete the two colour layers (redness/blueness) from the picture you want to modify, leaving just the luma layer.

STEP 7: Copy the two colour layers from the other picture (ie the picture made in step 4) into the picture being modified.

STEP 8: Blur both of the new colour layers a bit.

STEP 9: go to Image->Mode->Compose and select YCbCr_ITU_R470 again. This combines the colour information from the nasty step-3 picture with the luma information from the original picture. The result is much much better.

Job done.
msmiffy 9 years ago
Hmm. Looks interesting, thanks for sharing. Wondering if this shouldn't go on a wiki somewhere...

I've seen techniques to give an "Impressionist" look to photographs (don't recall what they were though), but to be able to use the same colours sounds really cool.
xooorx PRO 9 years ago
The most convenient place to put it might be a script :)
xooorx PRO 9 years ago
PhotoComiX 9 years ago
well ...right a script will be handy is a cool effect.

But about script and codes all i can do for help is just a added bump
Ate My Crayons 9 years ago
I can't wait to try this out. I am always very appreciative of those who post tutorials / how-to's . Thank you for sharing.
PhotoMasterGreg PRO 9 years ago
In step 4 you need to set the mode back to RGB before it will allow you to decompose. I like the effect.
funadium 9 years ago
Cool! It works nicely.
I'd try to script it, if someone can give a little help...
Here it is a skeleton for a script.

Interface selectors:
- choose source image (IMG)
- choose palette image (PLT)
- red blur slider (RSLD)
- blue blur slider (BSLD)

- resize PLT to the same size of IMG
- convert PLT to indexed color mode, 256 colors optimum (with or without dithering?)
- create a new layer in PLT
- select all IMG
- copy IMG
- paste IMG into PLT new layer
- flatten PLT
- convert PLT to RGB
- decompose PLT, mode YCbCr_ITU_R470 with layers
- get the name of the new image (supposedly PLT_470)
- decompose IMG, mode YCbCr_ITU_R470 with layers
- get the name of the new image (supposedly IMG_470)
- select all the red layer of PLT_470
- copy the red layer of PLT_470
- paste the red layer of PLT_470 over the red layer of IMG_470
- gaussian blur this layer, amount RSLD
- select all the blue layer of PLT_470
- copy the blue layer of PLT_470
- paste the blue layer of PLT_470 over the blue layer of IMG_470
- gaussian blur this layer, amount BSLD
- close PLT_470
- compose IMG_470

The tricky part will be to deal with various image and layer names. I see the decompose plug-in creates layers with a localized name, so this makes the things even more difficult.
Somebody here knows Peter Kirchgessner, who wrote the decompose plug-in a ten years ago? Maybe it is possible to integrate this procedure into that plug-in.
tuxcomputers 9 years ago
I have not checked the group lately and have only just noticed this, I have another script to do and will give this one a go as well in the next day or so.
rore Posted 9 years ago. Edited by rore (admin) 9 years ago
This is rather interesting, but It does not look really good to me - at least on that example, especially on the woman face that turned greenish.
tuxcomputers 9 years ago
@xooorx: Can you confirm that you missed a step of converting the image back to RGB between steps 3 and 4?

I tried following your steps last night and decompose is not an option if the image is an indexed one.
xooorx PRO 9 years ago
Yes sorry... got to go back to RGB before you can decompose.
tuxcomputers 9 years ago
Right, I always do the steps manually first to ensure they are all there and work as expected. I then create the script step by step checking each step as I go.
xooorx PRO 9 years ago
Slightly tweaked the method... wondering if this is a better result?

colour match tweak
RabidClone513 9 years ago
At first I couldn't tell what the difference was, then I noticed the skin had more saturation. (maybe better?) Hard to tell. So what step did you do different for that result?
xooorx PRO 9 years ago
before starting I removed the luminance information from both pics by decomposing, setting Y channels to gray, and recomposing. Then in step 6 I went back to the original pic for the original luminance. I thought the Gimp might do better at matching colours if not having to worry about luminance at the same time. Worked well for this pic but not so sure after trying it out with others.
basswulf PRO 9 years ago
I did play around with trying to find a "match colour" method a few months ago. What put me off pursuing it was the thought that there is far more to the success of an classic painting than just the colour scheme. In the example here, the photo is on a light background and the painting is dark, hence it is not surprising that the end result hasn't been completely transformed.

That said, I like the result of the second version, but I think a random swatch would have as much chance of producing good results as any given painting. Of course, the same applies when the original Photoshop effect that this tries to emulate is applied.

trandoductin Posted 7 years ago. Edited by trandoductin (member) 7 years ago
I just learned script-fu yesterday and tested it.
This is my 1st script it seems to the job very well

Oh yeah instructions:
open two images, click on src image then
It'll be under -> Colors->Components->Match Colour.
then select pallete image.
you can change number of colours and blur radius

I am not sure how to do the tweaked version described, i am a little confused about the setting Y to grey part. if some one can explain this i am glad to change the script to do that
mrocznyelf 6 years ago
Your link is broken, can you update it?
Rantz PRO 6 years ago
I found it here.
François Collard 6 years ago
Another thread about the same subject:
Groups Beta