It is currently Wed May 01, 2024 4:17 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 52 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: New G'MIC filter 'Colors / Recolorize'
PostPosted: Tue Jan 15, 2013 9:55 am  (#1) 
Offline
GimpChat Member
User avatar

Joined: Jan 03, 2011
Posts: 1656
Hi there,

I'd like to present a new color filter I've made for the G'MIC plug-in, located in 'Colors / Recolorize'. It should be available after a filter update. The principle is quite simple. Imagine you open a B&W image in GIMP :

Image

Now, create a new top layer (with transparent background), and draw some color patches on it :

Image

Now, open G'MIC, select 'All layers' for the 'Input Layers' mode, and select filter 'Colors / Recolorize' :

Image

This filter tries to extrapolate your color patches in a quite smart way (edge-directed), so that your color patches are extrapolated over all the image area. It recomposes then the initial B&W image and the color patch so that you get a color image at the end, where the lightness of the resulting image is exactly the same as your original B&W image :

Image

I'm sure there are a lot of funny things we can do with this kind of filter. Any ideas of use or suggestions for improvements ? Feel free to test and tell me if you find it useful !

Cheers.


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: New G'MIC filter 'Colors / Recolorize'
PostPosted: Tue Jan 15, 2013 10:13 am  (#2) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
COOL !! :yes

1)
Once the colours to use are determined how are applied to the original BW image ?

Something similar to color mode ?
or swapping images positions, to Value or luminosity mode ?

Quote:
This filter tries to extrapolate your color patches in a quite smart way (edge-directed), so that your color patches are extrapolated over all the image area. It recomposes then the initial B&W image and the color patch so that you get a color image at the end, where the lightness of the resulting image is exactly the same as your original B&W image :


I may ask a favour ? i would like try to modify to include a alternative :
the lightness would be only close no more identical to the original BUT the colours would looks more ... natural ? catchy ? hard to find the word i should include a example

To do this would be of great help the part of code TILL the merging (before the colour image are applied on the bw)

Yes , i know i may already look to your code but ...you write in a very optimized way with large use of shortening that make the code more compact and efficient but much harder for me to decipher

_________________
My 3D Gallery on Deviantart http://photocomix2.deviantart.com/
Main gallery http://www.flickriver.com/photos/photocomix-mandala/
Mandala and simmetry http://www.flickriver.com/photos/photocomix_mandala/

Image

Mrs Wilbress


Top
 Post subject: Re: New G'MIC filter 'Colors / Recolorize'
PostPosted: Tue Jan 15, 2013 10:33 am  (#3) 
Offline
GimpChat Member
User avatar

Joined: Apr 22, 2010
Posts: 123
The first impression is very positive,filter works fast and it looks really well.Thanks.
More of tests later. :bigthup

Original image B&W http://img0.liveinternet.ru/images/atta ... 713001.JPG

Image

_________________
Image


Top
 Post subject: Re: New G'MIC filter 'Colors / Recolorize'
PostPosted: Tue Jan 15, 2013 10:48 am  (#4) 
Offline
GimpChat Member
User avatar

Joined: Jan 03, 2011
Posts: 1656
Wow Pogo, did you really use the G'MIC Recolorize filter to get this result ? If so, I'm stunned !
I would be very interested to see the image of the color patches then.


Top
 Post subject: Re: New G'MIC filter 'Colors / Recolorize'
PostPosted: Tue Jan 15, 2013 11:05 am  (#5) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
Humm
this is your code...
i really can not find where the colors are applied to the desaturated original

my idea was just allow to modify the merging ..but where is the merging step ?

#@gimp Recolorize : gimp_recolorize, gimp_recolorize(1)
#@gimp : Smoothness = float(30,0,200)
#@gimp : sep = separator()
#@gimp : note = note{"<b>Note :</b> This filter needs two layers to work properly. The bottom layer must be a B&amp;W image, while the
#@gimp : top layer contains color patches that will be interpolated in a smart way (edge-directed) to fill the entire image. At the end,
#@gimp : you end up with a completely recolored image."}
#@gimp : sep = separator(), note = note("<small>Author : <i>David Tschumperl&#233;</i>.      Latest update: <i>2010/12/29</i>.</small>")
gimp_recolorize :

  -repeat {int(@#/2)} -l[$>,{$>+1}]
    -rv[-2,-1]
    -channels[-2] 0 -to_rgb[-2] # Convert to pure gray.
    -to_rgba[-1] -split_opacity[-1] -neq[-1] 0  # Retrieve mask of color patchs.
    -srgb2rgb[-3,-2] -rgb2lab8[-3,-2] -channels[-3] 0 -channels[-2] 1,2 # Now, list is [0]=lightness / [1]=chroma / [2]=mask.
    -+[-2] 1 -*[-2] [-1] --gradient_norm[-3] -*[-1] -1 -watershed[-3] [-1] -rm[-1] --[-2] 1 # Get first estimate for the color interpolation.
    --diffusiontensors[-3] 0,1,1,1 -eq[-2] 0 -*[-1] [-2] -rm[-2]
    -smooth[-2] [-1],$1,0.8,45,2,0 -rm[-1]
    -a[-2,-1] c -lab82rgb[-1] -rgb2srgb[-1]
  -endl -done

_________________
My 3D Gallery on Deviantart http://photocomix2.deviantart.com/
Main gallery http://www.flickriver.com/photos/photocomix-mandala/
Mandala and simmetry http://www.flickriver.com/photos/photocomix_mandala/

Image

Mrs Wilbress


Top
 Post subject: Re: New G'MIC filter 'Colors / Recolorize'
PostPosted: Tue Jan 15, 2013 11:09 am  (#6) 
Offline
GimpChat Member
User avatar

Joined: Apr 22, 2010
Posts: 123
Ronounours wrote:
Wow Pogo, did you really use the G'MIC Recolorize filter to get this result ? If so, I'm stunned !
I would be very interested to see the image of the color patches then.


Yes,it's true.lol
xcf file in the Annex


Attachments:
gmic_recolorize.zip [497.18 KiB]
Downloaded 424 times

_________________
Image
Top
 Post subject: Re: New G'MIC filter 'Colors / Recolorize'
PostPosted: Tue Jan 15, 2013 11:10 am  (#7) 
Offline
GimpChat Member
User avatar

Joined: Jan 03, 2011
Posts: 1656
@PC : Basically, this is a similar implementation to the plug-in 'Colorization', already discussed here : viewtopic.php?f=9&t=839&start=0.

But as the Colorization plug-in is not maintained anymore, I think this is cool to have such a feature in G'MIC (especially as it will be easy to maintain, it took only about 10 lines of G'MIC code :p).

The color extrapolation works by extrapolating the chromaticity values of the colors in Lab. I've some ideas for improvement :
- Ability to select the output mode, either as a single RGB image (as it is done now), either as two layers that should be blended in 'Color' or 'Value' mode, so that we can correct the color extrapolation on some regions where artefacts remain.
- Ability to select amongst several color spaces for the extrapolation : either Lab (as it is done now), but also YCbCr and RGB, with or without keeping a strict lightness constraint.
Maybe I'll have time to do this tomorrow.


Top
 Post subject: Re: New G'MIC filter 'Colors / Recolorize'
PostPosted: Tue Jan 15, 2013 11:11 am  (#8) 
Offline
GimpChat Member
User avatar

Joined: Jan 03, 2011
Posts: 1656
@Pogo : so you made my day, definitely :p Thanks a lot for this fantastic result.


Top
 Post subject: Re: New G'MIC filter 'Colors / Recolorize'
PostPosted: Tue Jan 15, 2013 11:28 am  (#9) 
Offline
Global Moderator
User avatar

Joined: Nov 16, 2011
Posts: 5128
Location: Metro Vancouver, BC
pogogogo wrote:
Yes,it's true.lol
xcf file in the Annex
Thank you for uploading your file! Checking your method was very helpful.

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


Top
 Post subject: Re: New G'MIC filter 'Colors / Recolorize'
PostPosted: Tue Jan 15, 2013 11:36 am  (#10) 
Offline
GimpChat Member
User avatar

Joined: Jul 17, 2012
Posts: 2770
very nice result pogogogo ! :bigthup


Top
 Post subject: Re: New G'MIC filter 'Colors / Recolorize'
PostPosted: Tue Jan 15, 2013 11:42 am  (#11) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
Ronounours wrote:
@PC : Basically, this is a similar implementation to the plug-in 'Colorization', already discussed here : viewtopic.php?f=9&t=839&start=0.

But as the Colorization plug-in is not maintained anymore, I think this is cool to have such a feature in G'MIC (especially as it will be easy to maintain, it took only about 10 lines of G'MIC code :p).


yes a very nice idea indeed

Quote:
The color extrapolation works by extrapolating the chromaticity values of the colors in Lab. I've some ideas for improvement :
- Ability to select the output mode, either as a single RGB image (as it is done now), either as two layers that should be blended in 'Color' or 'Value' mode, so that we can correct the color extrapolation on some regions where artefacts remain.
- Ability to select amongst several color spaces for the extrapolation : either Lab (as it is done now), but also YCbCr and RGB, with or without keeping a strict lightness constraint.
Maybe I'll have time to do this tomorrow.


I really like the results ( i make a quick confront with colorize..nothing worth to be posted but result were good

Quote:
- Ability to select the output mode, either as a single RGB image (as it is done now), either as two layers that should be blended in 'Color' or 'Value' mode, so that we can correct the color extrapolation on some regions where artefacts remain.


That would be perfect for what is spinning in my mind :jumpclap

I never found written references for this but i get often result i like more by

1 )Slightly blurring the "color" layer (except with unreasonable dramatically high values this do not make the resulting image less sharp, but somehow make more clean )
2 )Slightly sharpening and darkening the grayscale layer
(this instead impact a lot on result sharpness )

i do this almost always when using value or color modes,
not always but often i also create additional dup of the layer used , and i add to the visible once merged with low opacity in soft light or overlay mode (to make colors more brilliant and/or increase shadows/highlights contrast )

Again i have no references for this... just my own experiments

_________________
My 3D Gallery on Deviantart http://photocomix2.deviantart.com/
Main gallery http://www.flickriver.com/photos/photocomix-mandala/
Mandala and simmetry http://www.flickriver.com/photos/photocomix_mandala/

Image

Mrs Wilbress


Top
 Post subject: Re: New G'MIC filter 'Colors / Recolorize'
PostPosted: Tue Jan 15, 2013 2:08 pm  (#12) 
Offline
GimpChat Member

Joined: May 09, 2012
Posts: 914
Bonjour,

@Ronounours :jumpclap
Thank you, it will not be necessary to use the old filter "colorize" :bigthup


Top
 Post subject: Re: New G'MIC filter 'Colors / Recolorize'
PostPosted: Tue Jan 15, 2013 3:57 pm  (#13) 
Offline
GimpChat Member

Joined: Aug 05, 2011
Posts: 606
Location: limestone,ny
Very Cool, quick try

Image

Image


Top
 Post subject: Re: New G'MIC filter 'Colors / Recolorize'
PostPosted: Tue Jan 15, 2013 4:18 pm  (#14) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12519
Impressive indeed Pogo and thanks for sharing the cool preset David. :)

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: New G'MIC filter 'Colors / Recolorize'
PostPosted: Tue Jan 15, 2013 4:23 pm  (#15) 
Offline
GimpChat Member
User avatar

Joined: Apr 22, 2010
Posts: 123
:curtsey Thanks to all for the nice comments. :)

_________________
Image


Top
 Post subject: Re: New G'MIC filter 'Colors / Recolorize'
PostPosted: Tue Jan 15, 2013 6:53 pm  (#16) 
Offline
Global Moderator
User avatar

Joined: Apr 07, 2010
Posts: 14182
Wow pogo, that is fantastic. I tried it with Carrie Underwood and mine was a mess. Gots to go back and start from scratch.

_________________
Image


Top
 Post subject: Re: New G'MIC filter 'Colors / Recolorize'
PostPosted: Tue Jan 15, 2013 11:13 pm  (#17) 
Offline
Global Moderator
User avatar

Joined: Nov 16, 2011
Posts: 5128
Location: Metro Vancouver, BC
A bit of play with, Recolorize.
The only difference is the method to isolate the lines.
Inverse edge detection is one interesting method.
Image
Image

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


Top
 Post subject: Re: New G'MIC filter 'Colors / Recolorize'
PostPosted: Wed Jan 16, 2013 1:03 am  (#18) 
Offline
GimpChat Member

Joined: Feb 06, 2011
Posts: 342
Nice Filter! I will have to download the new G'mic for sure and try it. That is really a great photo Pogo. :)


Top
 Post subject: Re: New G'MIC filter 'Colors / Recolorize'
PostPosted: Wed Jan 16, 2013 1:15 am  (#19) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12519
Nice experiment and result Odin. :)

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: New G'MIC filter 'Colors / Recolorize'
PostPosted: Wed Jan 16, 2013 4:35 am  (#20) 
Offline
GimpChat Member
User avatar

Joined: Jan 03, 2011
Posts: 1656
I've implemented a new 'output mode' for this filter, that split the result into two Value / Colors layers, so that it is easier to tweak the color layer afterwards (correct some glitches for instance). Set the top layer to 'Value' blending mode to render the colored result.


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

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) new filter COLORS FRAMED

1

No new posts Attachment(s) Outcomes created using filter COLORS FRAMED

40

No new posts Comic book/Flat colors look filter

1

No new posts Attachment(s) Colors and Patchwork

2

No new posts Attachment(s) Colors/Exposure

1



* Login  



Powered by phpBB3 © phpBB Group