It is currently Wed Apr 24, 2024 2:39 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 21 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: G'MIC skin smoothing for portrait images
PostPosted: Fri Dec 20, 2013 4:43 pm  (#1) 
Offline
GimpChat Member
User avatar

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

I'm happy to present a new filter I've just added to the G'MIC plug-in for GIMP today. After a filters update, you will be able to find it at Repair / Smooth [skin].
Its purpose is to smooth people skin in portrait images. It is a quite complex filter as many different technical steps are involved, and you can finely tune each of those steps.
Here is a quick explanation of the whole thing.

First, here is how it looks when selected in the plug-in :

Attachment:
gmic_smooth_skin.jpg
gmic_smooth_skin.jpg [ 897.26 KiB | Viewed 18770 times ]


As I said, the filter works with distinct steps :

1. First, it tries to detect the skin pixels. To do this, it uses a specific skin detector that can be run in Automatic or Manual mode.
The 'Automatic' mode tries to detect the pixels automatically directly from their chromaticities. I have trained a simple classifier on a high number (millions) of manually labelized skin pixels in various portrait images. When the luminosity is quite standard, this works quite well.
Sometimes of course, the automatic mode fails, and so you can enter the 'Manual' mode where you can do the training by yourself, from samples pixels you suggest (and you can see a 'target' in the preview window that must be positioned to localize skin pixel samples).

2. Once the skin mask has been determined automatically or manually, you enter the second step, which is : soften the details. The filter uses a pyramidal decomposition of the image into several scales (very similar to what Wavelet Decompose does, for those who know it), followed by an smoothing process (isotropic or anisotropic) on the medium details scale (the one that contains most of the skin imperfections).

3. Optionally, you can boost the finest details scale by some gain parameters, in order to render a more sharper image at the end.

Once all those actions have been done, the filter recomposes the image from all its details scales, to render the result.
As you can see, this is a quite complex filter, and it possibly avoids doing a lot of tedious things manually. Of course, you won't have as much controls as if you do the whole pipeline manually, but you will be able to do those things very very quickly.

Here is an example of automatic skin smoothing (almost the default settings), with quite 'light' settings :

Attachment:
gmic_smooth_skin_all2.jpg
gmic_smooth_skin_all2.jpg [ 206.71 KiB | Viewed 18770 times ]


And the same, with more 'heavy' settings (but not the heaviest by the way!) :

Attachment:
gmic_smooth_skin_all.jpg
gmic_smooth_skin_all.jpg [ 209.25 KiB | Viewed 18770 times ]


So, I think this filter allows you to perform quite subtle changes in your images.

Any comments, suggestions or questions are welcome. I'm quite happy with how the filter performs right now, considering the fact that each step was quite challenging to code.
I hope you'll enjoy it !

David.


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: G'MIC skin smoothing for portrait images
PostPosted: Fri Dec 20, 2013 5:02 pm  (#2) 
Offline
GimpChat Member
User avatar

Joined: Mar 23, 2012
Posts: 7308
Location: Göteborg at last!
Nice one, thank you


Top
 Post subject: Re: G'MIC skin smoothing for portrait images
PostPosted: Fri Dec 20, 2013 5:25 pm  (#3) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12517
I've already toyed with this preset David. One of the best degrungers I've run across. I usually use dup grain extract, merge down and set to Overlay and then apply that selectively; won't be doing that anymore. Thanks a heap. :)

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: G'MIC skin smoothing for portrait images
PostPosted: Fri Dec 20, 2013 8:47 pm  (#4) 
Offline
GimpChat Member
User avatar

Joined: Jan 10, 2013
Posts: 863
It would be worth checking this filter, but my version of G'MIC (1.5.6.1 beta) does not have that filter. Even after you enable the update. :roll:

_________________
bbbbbbbbbbbImage
bbbbbbbbbbb Be patient, English is not my language.


Top
 Post subject: Re: G'MIC skin smoothing for portrait images
PostPosted: Sat Dec 21, 2013 4:55 am  (#5) 
Offline
GimpChat Member
User avatar

Joined: Jan 03, 2011
Posts: 1656
It requires the 1.5.8.0 version (or later).


Top
 Post subject: Re: G'MIC skin smoothing for portrait images
PostPosted: Sat Dec 21, 2013 5:03 am  (#6) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
Thanks David. :)

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: G'MIC skin smoothing for portrait images
PostPosted: Sat Dec 21, 2013 10:21 am  (#7) 
Offline
GimpChat Member
User avatar

Joined: Sep 22, 2012
Posts: 2089
Location: US
very good results David


Top
 Post subject: Re: G'MIC skin smoothing for portrait images
PostPosted: Mon Dec 30, 2013 4:35 am  (#8) 
Offline
GimpChat Member
User avatar

Joined: Jan 10, 2013
Posts: 863
Thx David,

In image test, the result seen in the preview and obtained are very different. :hoh

In the preview the result is fantastic, and desirable.
But the result is unsatisfactory, and away from the expected when based on preview. :(

_________________
bbbbbbbbbbbImage
bbbbbbbbbbb Be patient, English is not my language.


Top
 Post subject: Re: G'MIC skin smoothing for portrait images
PostPosted: Mon Dec 30, 2013 5:08 am  (#9) 
Offline
GimpChat Member
User avatar

Joined: Jan 03, 2011
Posts: 1656
Akros, did you modify the preview zoom factor manually ?
If so, then no surprise that the resulting image is very different from what the preview window shows.
Otherwise, I'd be interested by a simple test case so I can reproduce the problem on my machine, and (eventually) fix it if possible.


Top
 Post subject: Re: G'MIC skin smoothing for portrait images
PostPosted: Mon Dec 30, 2013 4:11 pm  (#10) 
Offline
GimpChat Member
User avatar

Joined: Jan 10, 2013
Posts: 863
Ronounours wrote:
Akros, did you modify the preview zoom factor manually ?

Well... Unlike other previews (Smooth thin brush / wavelets etc.), in the smooth skin image was very small in the preview ... I then instinctively widened. :roll: :oops:
Ronounours wrote:
If so, then no surprise that the resulting image is very different from what the preview window shows.
Otherwise, I'd be interested by a simple test case so I can reproduce the problem on my machine, and (eventually) fix it if possible.

I had used the default settings, and as in the preview manually changed the result was satisfactory, stopped by.
Unaware that information about the loss of equivalence between the preview and the result, if there was a manual change the zoom. :lame

With this new information, I went back to the same image and adjusted the setup parameters, and the result was excellent! :yes
Very good the option to apply the Smooth Skin in a selected area of ​​the image! :clap :bigthup

Thx a lot Ronounours! :tyspin

_________________
bbbbbbbbbbbImage
bbbbbbbbbbb Be patient, English is not my language.


Top
 Post subject: Re: G'MIC skin smoothing for portrait images
PostPosted: Wed May 28, 2014 6:12 am  (#11) 
Offline
New Member

Joined: May 28, 2014
Posts: 1
This forum having Informative and useful tips about the introduced G'MIC skin smoothing for portrait images. While editing any picture we have to be keen to make the picture perfect and as you have told in this forum hope it would be too useful.


Top
 Post subject: Re: G'MIC skin smoothing for portrait images
PostPosted: Mon Jun 23, 2014 4:02 am  (#12) 
Offline
New Member

Joined: Jun 23, 2014
Posts: 1
The G'MIC skin smoothing filter does not work on my Gimp. After running it, I get this error message:

*** Error in ./gimp_smooth_skin/*repeat/*local/*local/split_details/*repeat/ *** [instance(0,0,0,0,00000000,non-shared)] gmic<float>::assign(): Failed to allocate memory (182.3 Mio) for image (4608,3456,1,3).


My OS is windows 32 bit, my Gimp version is 2.8 and my G'MIC version is the latest (downloaded just two hours ago!).

Could anyone kindly help me? Many thanks in advance!!!


Top
 Post subject: Re: G'MIC skin smoothing for portrait images
PostPosted: Mon Jun 23, 2014 5:34 am  (#13) 
Offline
GimpChat Member

Joined: Sep 24, 2012
Posts: 275
Location: Scotland
@ oldrado:

I did a quick test with an image the same size, with that filter it was using about 1.5gb of ram. Given the error message it's safe to say you're running out of ram (or at least G'MIC can't allocate enough). You may need to resize the image to be smaller, or close any other running programs first. It's possible you've hit the size limit for the 32bit version of G'MIC, that is not so easy to fix without resizing.


Top
 Post subject: Re: G'MIC skin smoothing for portrait images
PostPosted: Sun Jul 27, 2014 1:58 am  (#14) 
Offline
GimpChat Member

Joined: Sep 29, 2011
Posts: 9
Looks great.

What I don't understand is the order of things.
At first you "Tag" skin pixels.
Yet when you do a pyramid (Is it Gaussian or other type), how do you tell the tag of a pixel in the 5th scale?

Or is it a pyramid without "Down Sampling"?


Top
 Post subject: Re: G'MIC skin smoothing for portrait images
PostPosted: Mon Jul 28, 2014 3:05 am  (#15) 
Offline
GimpChat Member
User avatar

Joined: Jan 03, 2011
Posts: 1656
The first step ("tag pixels of the skin") just defines a mask to defined pixels that will be modified.
The second step (pyramid decomposition) does not really care about tagged pixels: it does its stuff on all the image.
A last step is actually used to make the smoothing visible only for pixels tagged at the first step.


Top
 Post subject: Re: G'MIC skin smoothing for portrait images
PostPosted: Mon Jul 28, 2014 5:00 am  (#16) 
Offline
GimpChat Member

Joined: Sep 29, 2011
Posts: 9
I see.
It makes sense.

How is it different from the Wavelet Decomposition (I mean the Decomposition only)?
Is it Gaussian based?


Top
 Post subject: Re: G'MIC skin smoothing for portrait images
PostPosted: Mon Jul 28, 2014 12:16 pm  (#17) 
Offline
GimpChat Member
User avatar

Joined: Jan 03, 2011
Posts: 1656
Yes it is gaussian-based.
I don't know what kind of Wavelets are used in the Wavelet decompose plug-in, so there might be some differences.
But very few for practical purposes I guess.


Top
 Post subject: Re: G'MIC skin smoothing for portrait images
PostPosted: Sat Aug 23, 2014 6:06 am  (#18) 
Offline
New Member

Joined: Aug 23, 2014
Posts: 1
It is very impressive post. I had not read yet as wonderful post as it is. Good Job!


At home newborn photographer


Top
 Post subject: Re: G'MIC skin smoothing for portrait images
PostPosted: Sat Aug 23, 2014 7:04 am  (#19) 
Offline
GimpChat Member

Joined: Jan 20, 2014
Posts: 66
Hi Ron, When I test any algorithm, I like to do this.
1 grain extract before and after,
2 create new from visible,
3 auto equalize.
From this image, you are not only doing skin smoothing, is this your intention?
Attachment:
changes.jpg
changes.jpg [ 365.12 KiB | Viewed 1526 times ]


Top
 Post subject: Re: G'MIC skin smoothing for portrait images
PostPosted: Sun Aug 24, 2014 1:56 am  (#20) 
Offline
GimpChat Member

Joined: Sep 29, 2011
Posts: 9
Ron,
I was trying to play with Gaussian Pyramids.

How did you solve 2 main issues:
1. Dealing with both Odd and Even number of pixels.
2. Dealing with the boundaries.

It seems every implementation leaves some artifacts due to those issues.


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

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) I have a problem with dream smoothing filter

14

No new posts Anisotropic smoothing stopped working

4

No new posts Change skin tone

4

No new posts Attachment(s) Brown skin to fair

9

No new posts create an evil eye and demon skin

2



* Login  



Powered by phpBB3 © phpBB Group