GIMP users / Discuss

Current Discussion

STICKY  Gimp 2.7 portable and virus/malware alert
Latest: 4 days ago
Gimp Challenge 30 - Theme to be chosen by Orlando Braga
Latest: 59 minutes ago
Gimp Challenge 29 - Old and New - Time to vote
Latest: 62 minutes ago
Flickr is not displaying proper Exif data for photos edited with GIMP 2.8
Latest: 14 hours ago
My present problems with Gimp and UFRaw Windows
Latest: 14 hours ago
can pspi work with 64 bit gimp (2.8)?
Latest: 19 hours ago
announce: delaboratory 0.7.1 (unstable development)
Latest: 32 hours ago
How do I get this almost white-washed look?
Latest: 3 days ago
Lightroom 4 and Gimp 2.8
Latest: 4 days ago
Help: scripts and curves to create dreamy light/ sunset glare
Latest: 4 days ago
Orange and Gimp
Latest: 9 days ago
ubuntu 10.04 lucid lynx and final release of gimp
Latest: 9 days ago
More...

Search this group's discussions

A "Match Colour" Method for the Gimp

view profile

xooorx  Pro User  says:

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...
Posted at 2:35PM, 5 May 2007 PDT (permalink)

view photostream

xooorx  Pro User  says:

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:)
Originally posted 62 months ago. (permalink)
xooorx edited this topic 62 months ago.

view photostream

xooorx  Pro User  says:

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.
Originally posted 62 months ago. (permalink)
xooorx edited this topic 62 months ago.

view photostream

msmiffy  Pro User  says:

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.
Posted 62 months ago. (permalink)

view photostream

xooorx  Pro User  says:

The most convenient place to put it might be a script :)
Posted 62 months ago. (permalink)

view photostream

xooorx  Pro User  says:

*bump*
Posted 57 months ago. (permalink)

view photostream

PhotoComiX is a group administrator PhotoComiX  Pro User  says:

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
Posted 57 months ago. (permalink)

view photostream

Ate My Crayons  Pro User  says:

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.
Posted 57 months ago. (permalink)

view photostream

PhotoMasterGreg  Pro User  says:

In step 4 you need to set the mode back to RGB before it will allow you to decompose. I like the effect.
Greg
Posted 57 months ago. (permalink)

view photostream

funadium says:

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)

Commands:
- 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.
Posted 57 months ago. (permalink)

view photostream

tuxcomputers is a group administrator tuxcomputers says:

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.
Posted 57 months ago. (permalink)

view photostream

rore is a group administrator rore says:

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.
Originally posted 57 months ago. (permalink)
rore (a group admin) edited this topic 57 months ago.

view photostream

tuxcomputers is a group administrator tuxcomputers says:

@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.
Posted 57 months ago. (permalink)

view photostream

xooorx  Pro User  says:

Yes sorry... got to go back to RGB before you can decompose.
Posted 57 months ago. (permalink)

view photostream

tuxcomputers is a group administrator tuxcomputers says:

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.
Posted 57 months ago. (permalink)

view photostream

xooorx  Pro User  says:

Slightly tweaked the method... wondering if this is a better result?

colour match tweak
Posted 57 months ago. (permalink)

view photostream

RabidClone513 says:

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?
Posted 56 months ago. (permalink)

view photostream

xooorx  Pro User  says:

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.
Posted 56 months ago. (permalink)

view photostream

basswulf  Pro User  says:

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.

Wulf
Posted 56 months ago. (permalink)

view photostream

trandoductin says:

sites.google.com/site/ninebillions/match-colour
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
Originally posted 26 months ago. (permalink)
trandoductin edited this topic 26 months ago.

view photostream

mrocznyelf says:

Your link is broken, can you update it?
Posted 25 months ago. (permalink)

view photostream

Rantz  Pro User  says:

I found it here.
Posted 25 months ago. (permalink)

view photostream

François Collard is a group administrator François Collard  Pro User  says:

Another thread about the same subject:
www.flickr.com/groups/gimpusers/discuss/72157617968228506/
Posted 25 months ago. (permalink)

Would you like to comment?

Sign up for a free account, or sign in (if you're already a member).

RSS 2.0 feedSubscribe to a feed of stuff on this page...</!!> Feed – Subscribe to GIMP users discussion threads