It is currently Wed Apr 24, 2024 6:48 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 78 posts ]  Go to page 1, 2, 3, 4  Next
Author Message
 Post subject: Transfer colors from one image to another.
PostPosted: Mon Mar 30, 2015 9:06 am  (#1) 
Offline
GimpChat Member
User avatar

Joined: Jan 03, 2011
Posts: 1656
Hello folks,

I've been working recently on some advanced techniques for doing color transfer between two images.
And today, I've make a working version of the filter available in the G'MIC plug-in for GIMP.
This filter is able to estimate a non-trivial color transformation so that the colors of your input image looks like the color of a reference image that you put as the bottom layer.
So, it avoids manually tweaking the color curves to make an image looks like another one.

Here is how the filter looks like, after a filter update :

Attachment:
gmic_transfer0.png
gmic_transfer0.png [ 361.5 KiB | Viewed 13166 times ]


Here, I have two layers, the bottom is the reference image, i.e. the image of the leaf you see as a thumbnail at the bottom-left on the preview.
The top layer is the image of the purple flower. The filter automatically find the color transformation to make it look as the white flower on the right.

Here are two examples I've done to illustrate what this filter is capable of :

Attachment:
gmic_transfer1.jpg
gmic_transfer1.jpg [ 122.53 KiB | Viewed 13166 times ]


Attachment:
gmic_transfer2.jpg
gmic_transfer2.jpg [ 125.62 KiB | Viewed 13166 times ]


And I've recorder a quick video to show how this works for real :)

www.youtube.com Video from : www.youtube.com


Note that the algorithm used is definitely not trivial, and this is still an experimental work, which means that the filter can be unstable and eat a big amount of RAM.
You are warned :) But so far, it appears to work quite well. Please, if you want to test, post your results here.
I'm interested by any feedback about this particular filter.


Last edited by Ronounours on Mon Mar 30, 2015 3:23 pm, edited 1 time in total.

Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: Transfer colors from one image to another.
PostPosted: Mon Mar 30, 2015 9:42 am  (#2) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
my first attempt

source image :
Attachment:
1979_Dia_194.jpg
1979_Dia_194.jpg [ 496.11 KiB | Viewed 13116 times ]


image from which take the colours :
Attachment:
1979_Dia_323.jpg
1979_Dia_323.jpg [ 236.93 KiB | Viewed 13116 times ]


resulting image : (very nice!)
Attachment:
1979_Dia_194-323_CT.jpg
1979_Dia_194-323_CT.jpg [ 603.26 KiB | Viewed 13116 times ]

_________________
"Where am I ?"


Top
 Post subject: Re: Transfer colors from one image to another.
PostPosted: Mon Mar 30, 2015 9:44 am  (#3) 
Offline
GimpChat Member
User avatar

Joined: Jan 03, 2011
Posts: 1656
Ha nice one dinasset. So one application of this would be to make a landscape looks like it has been shot in another moment of the day :)


Top
 Post subject: Re: Transfer colors from one image to another.
PostPosted: Mon Mar 30, 2015 9:48 am  (#4) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
yes, David! a very interesting filter! thanks...

_________________
"Where am I ?"


Top
 Post subject: Re: Transfer colors from one image to another.
PostPosted: Mon Mar 30, 2015 10:04 am  (#5) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
a similar attempt

from:
Attachment:
1980_Dia_1644.jpg
1980_Dia_1644.jpg [ 264.1 KiB | Viewed 13084 times ]


through:
Attachment:
1980_Dia_1660.jpg
1980_Dia_1660.jpg [ 189.17 KiB | Viewed 13084 times ]


got this one:
Attachment:
1980_Dia_1644-1660-CT.jpg
1980_Dia_1644-1660-CT.jpg [ 343.88 KiB | Viewed 13084 times ]

_________________
"Where am I ?"


Top
 Post subject: Re: Transfer colors from one image to another.
PostPosted: Mon Mar 30, 2015 10:24 am  (#6) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
but in this case I got not nice results, both transmuting the colours in one direction and in the other one

sources:
Attachment:
1981_Dia_665-770.jpg
1981_Dia_665-770.jpg [ 835.47 KiB | Viewed 13077 times ]


outcomes (in one, then in the other direction):
Attachment:
1981_Dia_665-770_CT.jpg
1981_Dia_665-770_CT.jpg [ 809.64 KiB | Viewed 13077 times ]


should I change some parameter?

_________________
"Where am I ?"


Top
 Post subject: Re: Transfer colors from one image to another.
PostPosted: Mon Mar 30, 2015 10:52 am  (#7) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
I tried also to modify the parameter "preserve luminance" but both setting 0 and setting 1 I didn't get acceptable results (tried only one direction...)

_________________
"Where am I ?"


Top
 Post subject: Re: Transfer colors from one image to another.
PostPosted: Mon Mar 30, 2015 12:06 pm  (#8) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12516
I remember you created a similar preset many years ago but there were issues and you said you would re-address them. Is this the result of that effort David? Very cool results that I've seen here. Thanks for the preset. :)

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: Transfer colors from one image to another.
PostPosted: Mon Mar 30, 2015 12:17 pm  (#9) 
Offline
Global Moderator
User avatar

Joined: Nov 16, 2011
Posts: 5128
Location: Metro Vancouver, BC
G'MIC 1.6.1.0, Transfer Colors [simple & advanced]
I have to refresh filters each time to use them, for some reason they are not staying in the menu.
Restarting G'MIC or Gimp doesn't help.

_________________
Image
Gimp 2.8.18, Linux, median user
Gimp Chat Tutorials Index
Spirit Bear (Kermode)


Top
 Post subject: Re: Transfer colors from one image to another.
PostPosted: Mon Mar 30, 2015 12:44 pm  (#10) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12516
Yup; same for me too Odin. Works great, but afterwards, the preset disappears. I then closed GIMP, went to where the presets were saved, and deleted them all, opened GIMP and refreshed my presets, and low and behold, all is now well. There were two presets that had 1610 in my directory; could have something to do with me running the beta of 1610. These two presets with similar names could have interacted somehow. Now all's well. The old preset name is gimp_update1610.gmic; then new name is update1610.gmic. I suspect if you just delete the old preset name, then all would be well. :)

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: Transfer colors from one image to another.
PostPosted: Mon Mar 30, 2015 2:15 pm  (#11) 
Offline
Global Moderator
User avatar

Joined: Nov 16, 2011
Posts: 5128
Location: Metro Vancouver, BC
Thanks Lyle, getting rid of the old update files did the trick. :bigthup

List of removed file.
├── .gimp_update1610.gmic
├── .gmic_def.1516
├── .update1602.gmic
├── .update1603.gmic
├── .update1604.gmic
└── .update1610.gmic

_________________
Image
Gimp 2.8.18, Linux, median user
Gimp Chat Tutorials Index
Spirit Bear (Kermode)


Top
 Post subject: Re: Transfer colors from one image to another.
PostPosted: Mon Mar 30, 2015 2:42 pm  (#12) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
I installed G'Mic from http://gmic.eu/gimp.shtml
I says I have 431 available filters.
Couldn't find Transfer color.
So I clicked on the 2 circling arrow to get from internet i assume. and it told me
"Filters update from Internet (partially) failed!
Unable to reach these filters sources:
*http://gmic.eu/gimp_update1620.gmic.

any thoughts

_________________
TinT


Top
 Post subject: Re: Transfer colors from one image to another.
PostPosted: Mon Mar 30, 2015 2:49 pm  (#13) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12516
I usually get my updates from sourceforge Tran. :)

http://sourceforge.net/projects/gmic/fi ... rce=navbar

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: Transfer colors from one image to another.
PostPosted: Mon Mar 30, 2015 2:50 pm  (#14) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
is there a place where i can set it so that the double arrow circular thing goes and gets it from the link you gave above?

I tried reinstalling from gmic_gimp_win64.exe from the above link and when i click double arrow circular thing it still gives me that error message.

I am confused now.

_________________
TinT


Last edited by trandoductin on Mon Mar 30, 2015 3:00 pm, edited 1 time in total.

Top
 Post subject: Re: Transfer colors from one image to another.
PostPosted: Mon Mar 30, 2015 2:55 pm  (#15) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12516
Link works for me Tran; what OS and browser are you using? :)

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: Transfer colors from one image to another.
PostPosted: Mon Mar 30, 2015 2:57 pm  (#16) 
Offline
GimpChat Member
User avatar

Joined: Jan 03, 2011
Posts: 1656
@dinasset : well, your last experiments look quite good to me. In your case, you cannot expect the filter to transfer the color of the flower to the other flower, because your red flower is quite dark, and your 'reference' image contains colors also dark colors that are closer to the dark red than white.


Top
 Post subject: Re: Transfer colors from one image to another.
PostPosted: Mon Mar 30, 2015 3:01 pm  (#17) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
I am on windows 8.1
firefox browser.

_________________
TinT


Top
 Post subject: Re: Transfer colors from one image to another.
PostPosted: Mon Mar 30, 2015 3:04 pm  (#18) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12516
The link below is the direct link to all the Windows version Tran. If this link doesn't work, then I don't know what to do for you. :)

http://sourceforge.net/projects/gmic/files/windows/

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: Transfer colors from one image to another.
PostPosted: Mon Mar 30, 2015 3:08 pm  (#19) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
That's where i got it from just now.
But the double arrow circular thing still shows the same message.

Thanks for trying anyways. ;)

_________________
TinT


Top
 Post subject: Re: Transfer colors from one image to another.
PostPosted: Mon Mar 30, 2015 3:09 pm  (#20) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12516
This should be the direct link to the 64-bit version Tran.

http://gmic.eu/

If that doesn't work, then you should see a blue colored link stating direct link and clicking that usually works for me. :)

_________________
Lyle

Psalm 109:8

Image


Top
Post new topic Reply to topic  [ 78 posts ]  Go to page 1, 2, 3, 4  Next

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts How do you count colors in an Image in Gimp?

2

No new posts how to transfer one shape onto another

3

No new posts Attachment(s) transfer filter settings to new version

7

No new posts Problem in startup and file transfer 2.10.12

10

No new posts Attachment(s) DIEGO Transfer Colours Plug-in for GIMP 2.10

23



* Login  



Powered by phpBB3 © phpBB Group