It is currently Thu Jul 25, 2024 7:26 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 49 posts ]  Go to page Previous  1, 2, 3
Author Message
 Post subject: Re: Is there any G'MIC filter for foreground/background extraction?
PostPosted: Wed Jul 24, 2013 7:53 pm  (#41) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14730
Location: USA
Iain wrote:
Here is a quick filter that uses garagecoder's filter but adds some more bits to get better edges. It requires two layers, the top layer is filled with either red,green,or blue. red for parts to remove, green for parts to keep and blue for edges to be calculated by the filter.

[ Image ]


#@gimp objectmask: objectmask, objectmask
#@gimp : edge max = float (255,0,255)
#@gimp : edge min = float (0,0,255)
#@gimp : erode = int(3,3,19)
objectmask:
-remove_opacity[1]
-split[0] c
--l[1,2,-1]
-add[0,1] #create inpaint mask
-inpaint[1] [0] # inpaint
-keep[1]
-endl

-sub[-1] [-2] -abs[-1] # difference between the inpainted image and the original

-l[0,1,2,3,-1] # use gcd_splitobj on the difference image
-reverse[2,3]
-fill[2] 0
-negative[3]
-append[0,1,2,3] c
--gcd_splitobj[0,1] 50,3,3,0,0,0,0
-endl


-l[1,2]

-l[0] # create greyscale mask
-split c
-max
-endl

-split_opacity[1]
-erode[-1] $3 # adjust gcd calculated mask
-apply_curve[0] 0,-1,0,$2,0,$1,255,256,255 # apply curve to difference image to adjust transparency
-add[0] [2] # add gcd mask and difference image
-c 0,255
-endl

-keep[1,5]
-reverse
-append c


Iain i borrowed your image. Hope you don't mind.
May i ask which values in the filter you used to get those excellent results? Even using your red, green, and blue mask i could not get the extraction area correct. :)

Image

I also couldn't get very good results with my own mask.
Image


Definitely getting very close with this filter though! :bigthup
Thanks!

_________________
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: Is there any G'MIC filter for foreground/background extraction?
PostPosted: Wed Jul 24, 2013 8:19 pm  (#42) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12536
I too hope the foreground/background extract preset gets the improvements necessary for fine hair extraction. Even so, it's pretty cool and I indeed using the program to extract the pills that I used in my new DAP preset so again thanks a heap GC. :)

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: Is there any G'MIC filter for foreground/background extraction?
PostPosted: Wed Jul 24, 2013 10:21 pm  (#43) 
Offline
GimpChat Member

Joined: Feb 13, 2013
Posts: 86
Rod wrote:

Iain i borrowed your image. Hope you don't mind.
May i ask which values in the filter you used to get those excellent results? Even using your red, green, and blue mask i could not get the extraction area correct. :)



Definitely getting very close with this filter though! :bigthup
Thanks!


The image I posted is actually downsized to better fit the forum so your results are from using a smaller image than I did.


Top
 Post subject: Re: Is there any G'MIC filter for foreground/background extraction?
PostPosted: Wed Jul 24, 2013 11:39 pm  (#44) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
Some suggestion to remove the starry background in this series ?
viewtopic.php?f=11&t=8041

I hate it , ido forgot to remove from the original because there was no bad, but symmetrical sucks

Would be no hard to remove on a single pic, but seems a pain for the series (on the links i uploaded only a little part , are about 60 to edit )

_________________
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: Is there any G'MIC filter for foreground/background extraction?
PostPosted: Thu Jul 25, 2013 5:29 am  (#45) 
Offline
GimpChat Member

Joined: Feb 13, 2013
Posts: 86
PhotoComix wrote:
Some suggestion to remove the starry background in this series ?
http://www.gimpchat.com/viewtopic.php?f=11&t=8041

I hate it , ido forgot to remove from the original because there was no bad, but symmetrical sucks

Would be no hard to remove on a single pic, but seems a pain for the series (on the links i uploaded only a little part , are about 60 to edit )


Some kind of selection by hue would probably work. The background is blue and the foreground is yellow/green.


Top
 Post subject: Re: Is there any G'MIC filter for foreground/background extraction?
PostPosted: Thu Jul 25, 2013 5:33 am  (#46) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
oh that 's right, thank Jan

_________________
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: Is there any G'MIC filter for foreground/background extraction?
PostPosted: Thu Jul 25, 2013 12:27 pm  (#47) 
Offline
GimpChat Member

Joined: Sep 24, 2012
Posts: 275
Location: Scotland
lylejk wrote:
I too hope the foreground/background extract preset gets the improvements necessary for fine hair extraction.


@lylejk

It's absolutely planned, will probably be the end of August before I can work on it though :(


Top
 Post subject: Re: Is there any G'MIC filter for foreground/background extraction?
PostPosted: Thu Jul 25, 2013 2:05 pm  (#48) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12536
garagecoder wrote:
lylejk wrote:
I too hope the foreground/background extract preset gets the improvements necessary for fine hair extraction.


@lylejk

It's absolutely planned, will probably be the end of August before I can work on it though :(


Waited years for packed objects; can wait a month for hair extraction. lol

:)

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: Is there any G'MIC filter for foreground/background extraction?
PostPosted: Thu Jul 25, 2013 2:48 pm  (#49) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14730
Location: USA
lylejk wrote:
garagecoder wrote:
lylejk wrote:
I too hope the foreground/background extract preset gets the improvements necessary for fine hair extraction.


@lylejk

It's absolutely planned, will probably be the end of August before I can work on it though :(


Waited years for packed objects; can wait a month for hair extraction. lol

:)


Indeed! :bigthup :lol

_________________
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 new topic Reply to topic  [ 49 posts ]  Go to page Previous  1, 2, 3

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) background and foreground: discussion of a little GIMPWork with b/w

5

No new posts Change foreground and background color

2

No new posts Change Foreground Colour

0

No new posts Gimp always "not responding" when I use the foreground select tool.

1

No new posts Attachment(s) cli345's cartoon filter as a native GEGL Filter.

10



* Login  



Powered by phpBB3 © phpBB Group