It is currently Wed Aug 19, 2026 5:05 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 99 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
 Post subject: Re: G'MIC - tips and curiosities
PostPosted: Mon Jun 24, 2013 9:34 am  (#21) 
Offline
GimpChat Member

Joined: Oct 21, 2012
Posts: 13
documentation tip:
if you look for a command in the reference web page (my post look too spamy to give your the URL) add two spaces in your search bar, it will make things easier.

For example, look for "-append" and you'll find too many things, look for " -append" and you'll find the command help.


Top
 Post subject: Re: G'MIC - tips and curiosities
PostPosted: Mon Jun 24, 2013 1:29 pm  (#22) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14831
Location: roma, italy
Tip #9

today we talk about a "funny" command:

-uniform_distribution

I call it "funny" because -if I play with the second parameter- I may get funny results.
Certainly they are not funny for a scientist, but we talk among non-scientist gimp users.
Anyhow, to avoid confusion, we will strictly adhere to a basic rule:
because the second parameter is the "spectrum" (which is the name of the fourth
dimension of an image, i.e. the "channels") we will use this second parameter:
a) set to 3 when we play with an RGB image
b) set to 4 when we play with an RGBA image
The first parameter defines the number of colour-levels, which for us become stripes.
First of all we set the environment:
(1)open a new gimp image, white, RGB, default 640x400 pixels
(2)start GMIC console (you know how to) and set output to "new image"
(3)enter this sequence of commands (after having cleaned the area)
-----------------------------------------------------------------------------
(4)-uniform_distribution 64,3 #as in the example on page 34 of the handbook
#this will create an image 64x1x1x3
(5)-normalize[1] 0,255 #as usual
(6)-resize[1] [0] #expand the created image to the gimp image
(7)-keep[1] #to have as output only the new image
-----------------------------------------------------------------------------

case A) RGB image
With the shown parameters we get an image 640x400x1x3 filled with coloured stripes.
You see 64 stripes (=1°parameter), in 4 groups, with colours moving from dark to light.
Each group can be considered subdivided in 4 sub-groups.
Each of the 4 sub-groups contains 4 stripes
The colours vary as such:
(r)the red varies on each stripe with a sequence of 0 - 85 -170 -255
(g)the green varies on each sub-group with a sequence of 0 - 85 -170 -255
(b)the blue varies on each group with a sequence of 0 - 85 -170 -255

case B) RGBA image
(1) modify step 1 to get an RGBA image (use Layer->Transparency->Add alpha channel)
(4) modify step 4 to set the second parameter to 4 (-uniform_distribution 64,4)
You still see 64 stripes, but in 3 groups subdivided in 3 sub-groups.
Each sub-group has 7 stripes, except the first one wich has 8 stripes
(or -maybe- there is an initial group of one stripe only, you cannot distinguish)
The first group(1+7*3 stripes) is totally transparent, because of alpha set to 0.
The second group shows an alpha of 127.
The third group shows an alpha of 255 (full colours).
We will consider the last group for colour analysis (for the other two apply alpha).
In this third group the colours vary as such:
(r)the red varies on each stripe but not with an equal sequence on the sub-groups
(g)the green varies with the sequence 0-0-0-127-127-255 along each sub-stripe
(b)the blue varies regularly among groups with value 0-127-255
Maybe that -having an additional channel- the number of stripes has to different.

What to do?
It's up to you.
I play converting those images to gimp palettes and mapping one of my images with them.
You can see the result.
Attachment:
IMAGE-mapped-unidistr.jpg
IMAGE-mapped-unidistr.jpg [ 243.48 KiB | Viewed 2660 times ]

_________________
"Where am I ?"


Top
 Post subject: Re: G'MIC - tips and curiosities
PostPosted: Sun Jun 30, 2013 10:12 am  (#23) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14831
Location: roma, italy
Tip #10

Let' talk about gradients (in Gimp language).
One could say: well, there are fantastic gradients in Gimp, why that?
Right, but -afaik- Gmic is not able to access Gimp resources, so if one likes to create a custom Gmic command self-standing, it's better to know how to create gradients to be used for overlaying images and so on.

Recall: to define a new image with predefined colours we need:
- 2 parenthesis outside ( ..... )
- a string of numbers inside where:
-- points on the same row are separated by commas (,)
-- columns are separated by semicolons (;)
-- colours are separated by the symbol ^
Values "per-se" are irrelevant, what's important is the proportion among them.
At the end we will insert the command -normalize to get visible values.

I write down here some examples of gradients:
note the full sequence of commands is written only on gradient 1, for the other only the line related to the gradient is shown
______________________________________________________________________

#gradient 1 (generic)

(2,2,0;2,2,0;0,0,0^0,2,2;2,2,2;2,2,0^0,0,0;0,0,2;0,2,2)
-normalize[1] 0,255
-resize[1] [0],3
-keep[1]

#corners:
#top-left=red
#top-right=green
#bottom-left=green
#bottom-left=blu

#mid-points:
#top=yellow
#left=yellow
#right=cyan
#bottom=cyan
___________________________________________________________________

#gradient 2 (landscape)
(0,0,0;0,0,0;3,3,3^0,0,0;3,3,3;1,1,1^2,2,2;3,3,3;0,0,0)

#top-line=blue
#mid-line=cyan
#bottom-line=red-orange
__________________________________________________________________

#gradient 3 (seascape)
(0,0,0;1,1,1;0,0,0^1,1,1;3,3,3;2,2,2^2,2,2;3,3,3;2,2,2)

#top-line=blue
#mid-line=cyan
#bottom-line=red-orange
________________________________________________________________________

#gradient 4 (blue-cyan vignette)
(0,3,3,0;2,5,5,2;2,5,5,2;0,3,3,0^1,3,3,1;3,5,5,3;3,5,5,3;1,3,3,1^1,3,3,1;3,5,5,3;3,5,5,3;1,3,3,1)

#corners="dirty"-blue-cyan
#mid-points="dirty" white
________________________________________________________________________

#gradient 5 (red-orange vignette)
(3,8,8,3;3,11,11,3;3,11,11,3;3,6,6,3^0,2,2,0;2,8,8,2;2,8,8,2;0,2,2,0^0,0,0,0;1,5,5,1;1,5,5,1;0,0,0,0)

#corners="dirty"-red
#mid-points="dirty"-orange
=====================================================
attached a zipped folder


Attachments:
gradients.7z [65.86 KiB]
Downloaded 101 times

_________________
"Where am I ?"
Top
 Post subject: Re: G'MIC - tips and curiosities
PostPosted: Tue Jul 02, 2013 2:42 pm  (#24) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14831
Location: roma, italy
Tip #11

Today we talk about a rarely mentioned command: -name
It does neither create nor modify an image.
So, why to talk about it?
Well, as said many times, this topic is for non-scientist candidate coders in GMIC world, thus clarity is very important for us.
As it is recommended among us to use -at least during the initial period of experiments-:
a) one line per command
b) the full-text command instead of the abbreviated one (-remove not -rm, -reverse not -rv, ...),
so it could be useful to use
c) the command -name to better understand the code, especially when it becomes complex.

Here an example.

(assume we call GMIC after having created a new image in GIMP, white)

we enter:
-name[0] white_image # from now on, we can refer to the image received in input as "white_image"

then we enter:
[white_image]x3 # we ask GMIC to create 3 copies of the received image

then we rename all three copies as such:
-name[1] first_copy
-name[2] second_copy
-name[3] third_copy


we like to fill the copies with different colours, so we enter:
-fill_color[first_copy] 255 # pure red
-fill_color[second_copy] 0,255 # pure green
-fill_color[third_copy] 0,0,255 # pure blue

well, better now if we rename those three copies with more meaningful names, so we enter:
-name[first_copy] red,1 # the ,1 stays for renamed ("is_modified")
-name[second_copy] green,1
-name[third_copy] blue,1

OK, now we now which layers we manage, so let's enter:
-reverse[green,red] # we reverse the order between the second and the first copy
# after this command, the series of layers will be:
# white, green, red, blue

we enter a command which will verify the order we imposed to the layers
the blend command blends each pair of layers on the stack
we use average-mode to better verify values of colours
--blend average # two new layers are created:
# the first new layer comes from blending white and green
# the second new layer comes from blending red and blue
we double-check the result using the colour-picker tool of gimp
on the first new (fifth in the list) we find the colour: 127,255,127 OK
on the second new (sixth in the list) we find the colour: 127,0,127 OK

we could also play again and enter a new:
--blend average # other three new layers are created:
# the first two are exactly the same as before
# the third one comes from blending the pale green (fifth layer) and the purple (sixth layer)
we double-check again with the colour-picker and we find the colour: 127,127,127 OK

Have fun!

_________________
"Where am I ?"


Top
 Post subject: Re: G'MIC - tips and curiosities
PostPosted: Tue Jul 02, 2013 3:15 pm  (#25) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
I found very useful this commands also when writing filters :
when a filter create several "virtual images" (i say virtual because the final result will be only one image created by their combinations ), or in other words a complex layerstack often i found tricky guess their position in the layerstack (i mean for me is often tricky , not sure why but i tend to misplace at least 1, and that 1 of course misplace others in a chain reaction )

-name each of this images helped me a lot, ...
as examples if you see that is something wrong in the layerstack , if your virtual-images/layers (never sure how to call them) are named ,i.e. " BG" "middle" "Top Layer" will be easy use the command -move to correct and place everything in the right place .

PS
you will not find -name in my finished filters, but i used often in the wip stage .

_________________
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: G'MIC - tips and curiosities
PostPosted: Tue Jul 02, 2013 4:27 pm  (#26) 
Offline
GimpChat Member

Joined: Sep 24, 2012
Posts: 275
Location: Scotland
It's great to have all this dinasset, I'm sure some people who were a little scared to try things will have a go now. It's becoming one of the biggest pages on the wiki too :bigthup

http://sourceforge.net/p/gmic/wiki/Tips ... riosities/

Still needs some tidying which I'll get around to sometime :yup


Top
 Post subject: Re: G'MIC - tips and curiosities
PostPosted: Wed Jul 03, 2013 8:49 am  (#27) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14831
Location: roma, italy
many thanks, PC!
many thanks, GC!
I hope this can help some new candidate coder in GMIC...

_________________
"Where am I ?"


Top
 Post subject: Re: G'MIC - tips and curiosities
PostPosted: Wed Jul 03, 2013 2:38 pm  (#28) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14831
Location: roma, italy
Attachment:
CLEANED-LUMACHROMA.JPG
CLEANED-LUMACHROMA.JPG [ 289.88 KiB | Viewed 2559 times ]
Attachment:
CLEANED-RGB.JPG
CLEANED-RGB.JPG [ 328.39 KiB | Viewed 2559 times ]
Attachment:
ORIGINAL.JPG
ORIGINAL.JPG [ 1.16 MiB | Viewed 2559 times ]
Tip #12

Today we will enter into photo manipulation/enhancement.
At first, a very useful denoising command:
-bilateral
This works better than other "traditional" methods:
- it does not blur the image
- it does not create halos
because it preserves edges (does not average pixels across edges).
Warning: this "quality" may become a "defect" when command is used with high values.
Result could be a "cartoonised" image.
The command uses two parameters:
a) the "space" (extension of the area around each pixel to be used for averaging)
b) the "range" (the minimum amplitude for considering an "edge")

We detail two approaches:
1 - applying the denoising function to each colour channel separately.
(it's known that noise is greater on red and blue channels than on the green one)
2 - applying the denoising function separately on luma and chroma
(it's known that we may blur colours more than luminosity)

Case 1

enter the following sequence of commands:
--split[0] c # the input image is split into 3 layers: R,G,B
# we use the naming command as already learned
-name[1] red
-name[2] green
-name[3] blue
# now we call -bilateral with different values for each colour
-bilateral[red] 2.5,5
-bilateral[green] 1.25,2.5
-bilateral[blue] 3.75,7.5
# small values for green, higher values for red and blue
# now we recombine the 3 layers into a single RGB image
--append[blue,green,red] c
# we give it a name
-name[4] cleaned
# we save only the result, discarding the rest
-keep[cleaned]

The first value can be better entered as a percentage of image space, for example:

--split[0] c
-name[1] red
-name[2] green
-name[3] blue
-bilateral[red] 1%,7
-bilateral[green] 0.25%,3
-bilateral[blue] 1.5%,10
--append[blue,green,red] c
-name[4] cleaned
-keep[cleaned]



Case 2 using YCbCr to split the image (luma-chroma)

-rgb2ycbcr # split the image into 3 layers, 1 for luma, 2 for chroma
--split[0] c
-name[1] luma
-name[2] chromaB
-name[3] chromaR
-bilateral[luma] 1.25,1.25
-bilateral[chromaB] 8.75,8.75
-bilateral[chromaR] 8.75,8.75

# low values for luma, higher values for chroma
--append[luma,chromaB,chromaR] c
-name[4] cleaned
-ycbcr2rgb[cleaned]
-keep[cleaned]


also in this case, we better use percentage as first parameter

-rgb2ycbcr
--split[0] c
-name[1] luma
-name[2] chromaB
-name[3] chromaR
-bilateral[luma] 0.25%,3
-bilateral[chromaB] 3%,10
-bilateral[chromaR] 3%,10
--append[luma,chromaB,chromaR] c
-name[4] cleaned
-ycbcr2rgb[cleaned]
-keep[cleaned]

-------------------------------------------------------------------
I place here one example, but you may play with your images and changing values

_________________
"Where am I ?"


Top
 Post subject: Re: G'MIC - tips and curiosities
PostPosted: Wed Jul 03, 2013 6:31 pm  (#29) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
I saw only now tip 10 ... thank that code snippet may be really handy !

_________________
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: G'MIC - tips and curiosities
PostPosted: Wed Jul 03, 2013 8:14 pm  (#30) 
Offline
GimpChat Member

Joined: Feb 13, 2013
Posts: 86
Most images have more noise in the shadows. A simple method of changing the noise reduction strength in the shadows is to us the -apply_gamma command before the noise reduction, and then again afterwards to reverse the initial gamma change.

-apply_gamma 0.7 # makes image darker and reduces contrast in the shadows

# rest of the filter goes here.


-apply_gamma {1/0.7} # Reverses the gamma change at the start to give correct brightness.



This works because the gamma change reduces the contrast between dark pixels, and increases the contrast between light pixels, so the bilateral filter smooths darker parts of the image more than the lighter parts.

A gamma value less than 1 will increase the noise reduction in the shadows, a gamma value greater than 1 will have the opposite effect and the highlights will have more noise reduction. A value of one will have no effect.


Top
 Post subject: Re: G'MIC - tips and curiosities
PostPosted: Fri Jul 05, 2013 7:35 am  (#31) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14831
Location: roma, italy
Tip #13 (with a lot of questions to scientist)

Still on photo manipulation/enhancement, sill on denoising commands.

After a suggestion of GC, I started looking at the command -smooth.
This should be more efficient (certainly more modern and more complex) than -bilateral.
It tries to identify the directions towards which the smoothing has to be applied for best results.
These directions are "visible" as coloured "tensors"
(see the output of the command: -diffusiontensors on the Manual).
I spent hours googling on the subject, but -obviously- almost any found document is full of mathematics. Not for me.
Eventually, I found a document readable/understandable even by me:
it was written by Zonderr (many many thanks!) on flickr, here is the link:
http://gmic.sourceforge.net/tutorials/anisotropic_smoothing_zonder/

So, basically I simply rearrange his sentences, plus some personal tests.

The command has 10 parameters, up to 7 I was able to -more or less- understand the meaning and the use.
For 3 of them not at all, so I put here my first question to the scientists:
- what do DL - DA - PRECISION mean, and -even more relevant question-
- when does a user need to manage them (which is the effect on the image)?

So, let me summarize the 7 I partially understood (thanks to Zonderr):
1 - amplitude: is said to define the "strength" of the command
questions to scientists:
has it to do with the space around the pixel or not? what else?
what does "60" mean? (minimum 0 and maximum 1000?)
2 - sharpness: meaning easy to understand for anyone managing images
values between 0(everything is smoothed, including edges) and 1(nothing is smoothed)
3 - anisotropy: how much is anisotropic methodology applied?
values between 0 and 1 (beware: the methodology is good but creates artifacts, so use low values)
4 - alpha: is the smoothing applied before creating the tensors, to skip small noisy dots
values vetween 0 and 10
5 - sigma: is the smoothing applied after having created the tensors, to avoid too hard edges
values between 0 and 10
6 - interpolation: 0=nearest neighbor, 1=linear, 2=RungeKutte (best, slowest)
7 - use fast approximation: 0=don't use, 1=use (choice depends on how quickly you drink a coffee...)

I cropped the central part of the image used for -bilateral to make some test.

First run was using all default values.
Good result, but too smoothed for my taste (look at the hair, and also at the skin)
Second run with four parameters reduced:
- amplitude to 30
- anisotropy to 0.2
- alpha to 0.3
- sigma to 0.6
Better result, for my taste; so - for myself - I would say:
use small values if the photo is not so bad (from a digital noise viewpoint).
I tried also to use the command on each separated channel, as for -bilateral.
I used my reduced values for red and blue and even more reduced values for green
(10,0.1,0.1,0.3)
Good result, again for my taste.
Attached a zip file.
Now, a final question to the scientist:
there is a command called -diffusiontensors to create the tensors separately,
then use the result for -smooth.
IMHO, because the parameters to be used in -diffusiontensors are part of those
used for -smooth, I do not see benefits in using two commands instead of one.
I also tried and -apparently- I didn't get any difference, if same values where used.
Am I wrong?
Attachment:
tip13.7z [261.62 KiB]
Downloaded 112 times

_________________
"Where am I ?"


Top
 Post subject: Re: G'MIC - tips and curiosities
PostPosted: Fri Jul 05, 2013 12:42 pm  (#32) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14831
Location: roma, italy
Tip #13 addendum

(just in case you like the "ready-cooked"...(only last case discussed previously)

#@gimp test denoise smooth: test_denoise_smooth, test_denoise_smooth
test_denoise_smooth:
#this filter makes use of -smooth command to denoise an image
-apply_gamma[0] 0.9 # makes image darker and reduces contrast in the shadows (Iain)
--split[0] c
-name[1] red
-name[2] green
-name[3] blue
-smooth[red] 30,0.7,0.2,0.3,0.6,0.8,30,2,2,0
-smooth[green] 10,0.9,0.1,0.1,0.3,0.8,30,2,2,0
-smooth[blue] 30,0.7,0.2,0.3,0.6,0.8,30,2,2,0
--append[blue,green,red] c
-name[4] cleaned
-apply_gamma[cleaned] {1/0.9} # Reverses the gamma change at the start to give correct brightness.
-keep[cleaned]

enjoy!

_________________
"Where am I ?"


Top
 Post subject: Re: G'MIC - tips and curiosities
PostPosted: Fri Jul 05, 2013 3:12 pm  (#33) 
Offline
GimpChat Member

Joined: Feb 01, 2013
Posts: 24
Location: London, UK
The literate programming style of naming layers is a nice idea .. but you may come across some confusing behaviour in G'MIC as the actual index order of the stack does matter. [green,red] might be [-2,-1] or [-1,-2] for instance but the called command receives a sub-set in the same order .. always [-2,-1].

_________________
-- jayprich


Top
 Post subject: Re: G'MIC - tips and curiosities
PostPosted: Sat Jul 06, 2013 12:58 am  (#34) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14831
Location: roma, italy
yes, Jayprich, but the rule is the same both for numbers and for names:

saying [-2,-1] is the same as saying [-1,-2];
consistently:
saying [green,red] is the same as saying [red,green]

see tip #4
"...d)NOT BECAUSE YOU ENTERED blend[1,2], what you put is irrelevant, even if you put blend[2,1] you get the same result, so remember:
e)the order in which images(layers) are considered is fixed UNLESS YOU EXPLICITLY CHANGE THE ORDER, ..."

_________________
"Where am I ?"


Top
 Post subject: Re: G'MIC - tips and curiosities
PostPosted: Sat Jul 06, 2013 1:29 am  (#35) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
"The command has 10 parameters, up to 7 I was able to -more or less- understand the meaning and the use.
For 3 of them not at all, so I put here my first question to the scientists:
- what do DL - DA - PRECISION mean, and -even more relevant question-
- when does a user need to manage them (which is the effect on the image)?"

Good question i experimented a lot and for a long while i could not understand the function and i just kept the default and that for very long (that command exist before gmic, was "GreyCstoration"

Then only lately, casually i discover that may be quite useful, that elude me before because in the other atttempt i tried to raise their values, while the effect become visible only by lowering them

But i am not able to explain what they do , but you may try to start from mine or Leylejk preset (are included in the plugin ) on a large image, you will see that, yet in a different way then the others, lowering the value allow to get more ...sharp smoothing

My suggestion to try is first set the other values in a way the image is a bit too smoothed and blurred, not very much just a bit , and then try to lower them

I

_________________
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: G'MIC - tips and curiosities
PostPosted: Sat Jul 06, 2013 4:28 am  (#36) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14831
Location: roma, italy
Yes, you are right, PC!
By reducing only those 3 values (DA,DL,Precision) I got a good result, leaving the other to their default values (while all defaults together - for my taste - produce a too smoothed image, as I said in the post).
But I didn't find your nor Lyle's pre-sets (I found one of your filters under Testing where those 3 values where still set to their defaults : 0.8 30 2)

edit: maybe, you can post your and Lyle's triplets here

_________________
"Where am I ?"


Top
 Post subject: Re: G'MIC - tips and curiosities
PostPosted: Sat Jul 06, 2013 4:39 am  (#37) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
Yes before i was baffled because i tried to raise the value that with default doesn't give visible result but if you start on a threshold (very light blur ) and you lower effect become more clear

About my preset Mine should be in my folder , L was in testing

I will search more i have several that may be interesting , the problem is only that since gmic can't properly save preset , if not a few i have always to move them away to make space

I will found but i may need some time my backup are a bit messy

_________________
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: G'MIC - tips and curiosities
PostPosted: Sat Jul 06, 2013 8:37 am  (#38) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14831
Location: roma, italy
Curiosity (or challenge)
Would it be possible to define in GMIC a filter able to perform "face detection"?
Not to identify people, but to extract the area related to human skin, separate it from the rest creating two different channels, so afterwards one could apply different functions, for instance smooth the skin but don't smooth the hair or other components of the image (avoiding tedious manual selection).
Something to allow a sequence of commands like:
--face_detection[0] #create a two channels new image one with the area of skin plus transparency, the other one will all the rest and transparency on the face area
--split[1] c #split the two channels
-name[2] face
-name[3] all_the_rest
-smooth[face] .............
--append[face,all_the_rest]
.....

_________________
"Where am I ?"


Top
 Post subject: Re: G'MIC - tips and curiosities
PostPosted: Sat Jul 06, 2013 6:31 pm  (#39) 
Offline
GimpChat Member

Joined: Feb 13, 2013
Posts: 86
dinasset wrote:
Curiosity (or challenge)
Would it be possible to define in GMIC a filter able to perform "face detection"?
Not to identify people, but to extract the area related to human skin, separate it from the rest creating two different channels, so afterwards one could apply different functions, for instance smooth the skin but don't smooth the hair or other components of the image (avoiding tedious manual selection).
Something to allow a sequence of commands like:
--face_detection[0] #create a two channels new image one with the area of skin plus transparency, the other one will all the rest and transparency on the face area
--split[1] c #split the two channels
-name[2] face
-name[3] all_the_rest
-smooth[face] .............
--append[face,all_the_rest]
.....



Skin tones cover a small range of hues centered around red-ish orange, so it is reasonably easy to create a mask for those hues. The problem is that other things also sit in that hue range, like brown hair, wooden items etc. The hue mask can be refined a bit by combining it with a saturation mask, but that only improves things a small amount.

I think any face/skin detection needs to have some kind of feature recognition to be effective.


Top
 Post subject: Re: G'MIC - tips and curiosities
PostPosted: Sat Jul 06, 2013 11:51 pm  (#40) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14831
Location: roma, italy
Iain,
maybe it's possible to have the skin-recognition-filter asking for a rough user selection, so to exclude unwanted pieces of the image...

_________________
"Where am I ?"


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

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group