It is currently Fri Jul 26, 2024 1:37 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 22 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Is there a way to create a busy threshold mask?
PostPosted: Wed Sep 25, 2013 1:52 pm  (#1) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12536
My motivation is th detect areas that a non changing such as a plain sky and isolate the areas of a photo that are busy so that I can apply adaptive contrast to the busy areas but no to the sky to keep the noise down. I currently try to isolate plain areas manually but it's a bore. lol

Just curious. :)

_________________
Lyle

Psalm 109:8

Image


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: Is there a way to create a busy threshold mask?
PostPosted: Wed Sep 25, 2013 2:38 pm  (#2) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12536
Yeah; I do use layer masks within GIMP to isolate resulting filter noise but again, this is a bore (i.e., a chore; lol). :)

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: Is there a way to create a busy threshold mask?
PostPosted: Wed Sep 25, 2013 3:05 pm  (#3) 
Offline
Script Coder
User avatar

Joined: Jul 14, 2010
Posts: 697
You could use frequency separation (high pass/low pass). That is the perfect use for such a thing.

-Rob A>

_________________
Image
Fantasy Cartography and Mapping by RobA


Top
 Post subject: Re: Is there a way to create a busy threshold mask?
PostPosted: Wed Sep 25, 2013 3:55 pm  (#4) 
Offline
Script Coder
User avatar

Joined: Jun 22, 2010
Posts: 1171
Location: Here and there
As RobA says, you're looking for frequency separation, which probably means Wavelet Decompose: http://registry.gimp.org/node/11742 as seen in Episode 161 of Meet The Gimp: http://blog.meetthegimp.org/episode-161 ... -wavelets/

And G'MIC has some spectral filters that might help - maybe frequency splitting

Kevin


Top
 Post subject: Re: Is there a way to create a busy threshold mask?
PostPosted: Wed Sep 25, 2013 4:31 pm  (#5) 
Offline
GimpChat Member
User avatar

Joined: Feb 14, 2012
Posts: 426
One method I use is to duplicate a layer, run the default emboss on it, then select all the flat areas of the image using the color select tool, then delete the layer, invert the selection.

I do this to select noise areas or gradient areas so that I can add a slight noise and then slight blur of 5 to smooth out those areas. This way the add noise doesn't put a bunch of noise in my flat areas.

I don't know if it would work out for what your doing. I'm only concerned with flat areas when I do this. And using emboss makes all flat areas the same color which is easy to select.

pugles


Top
 Post subject: Re: Is there a way to create a busy threshold mask?
PostPosted: Wed Sep 25, 2013 4:47 pm  (#6) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12536
RobA wrote:
You could use frequency separation (high pass/low pass). That is the perfect use for such a thing.

-Rob A>


Not accurate enough Rob; highpass will pass all noise and low pass blurs the transistions. I need an empty space detector in essence but it may be just too big a problem to easily solve. :)

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: Is there a way to create a busy threshold mask?
PostPosted: Wed Sep 25, 2013 4:48 pm  (#7) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12536
PegLeg44 wrote:
One method I use is to duplicate a layer, run the default emboss on it, then select all the flat areas of the image using the color select tool, then delete the layer, invert the selection.

I do this to select noise areas or gradient areas so that I can add a slight noise and then slight blur of 5 to smooth out those areas. This way the add noise doesn't put a bunch of noise in my flat areas.

I don't know if it would work out for what your doing. I'm only concerned with flat areas when I do this. And using emboss makes all flat areas the same color which is easy to select.

pugles


I think I know what you are going after and I'll give this a shot when I need to do flat area selections next time. Thanks for the idea. :)

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: Is there a way to create a busy threshold mask?
PostPosted: Wed Sep 25, 2013 4:52 pm  (#8) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4759
Poor man's method:
Let' say you have a photo of the most magnificent medieval castle in known space, so magnificent that even though it's in France, the Rosbifs from across the Channel have elected it as the set of one of their medieval TV series, and the logo of a well-known American entertainment company has been inspired by it. Unfortunately this photo lacks contrast on the castle:

Attachment:
NoSkySelection-PoorMans1.jpg
NoSkySelection-PoorMans1.jpg [ 92.62 KiB | Viewed 2999 times ]


Duplicate image layer, gaussian 2px and set to difference mode. New layer from visible, apply threshold (fairly low value). In my experiment there is a range of threshold values where you don't get any spots in the sky while the rest of the image starts to fill up.

Attachment:
NoSkySelection-PoorMans2.jpg
NoSkySelection-PoorMans2.jpg [ 127.59 KiB | Viewed 2999 times ]


Filter/generic/dilate a couple of times to join the pixels, and gaussian blur to feather the upcoming selection:

Attachment:
NoSkySelection-PoorMans3.jpg
NoSkySelection-PoorMans3.jpg [ 90.5 KiB | Viewed 2999 times ]

_________________
Image


Top
 Post subject: Re: Is there a way to create a busy threshold mask?
PostPosted: Wed Sep 25, 2013 4:54 pm  (#9) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4759
To finish, open the Channels view, right-click on a color channel, and Channel to selection. Apply completely overdone contrast:

Attachment:
NoSkySelection-PoorMans4.jpg
NoSkySelection-PoorMans4.jpg [ 116.15 KiB | Viewed 3000 times ]


PS: the images have have been scaled down to 33% to be posted here. I worked on an image that is 2136 by 1424.

_________________
Image


Top
 Post subject: Re: Is there a way to create a busy threshold mask?
PostPosted: Wed Sep 25, 2013 5:27 pm  (#10) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12536
Another nice approach offnuts and I've done something similar before but get the fringing effects as I see here but that can also be controlled (I know; had to do so) but still a lot of work. I guess I'm looking for a lazy man's method and there may indeed not be one.

As a side note, this is the type of application that I'm needing such a filter for. Sky isolation is tough and when you want to treat the sky separate then the rest of the image especially when you have clouds, then it's a pain. :)

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: Is there a way to create a busy threshold mask?
PostPosted: Wed Sep 25, 2013 6:14 pm  (#11) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4759
Somewhat less fringing: after the New from visible/threshold: make that the selection; the grow+shrink the selection a couple of times.

_________________
Image


Top
 Post subject: Re: Is there a way to create a busy threshold mask?
PostPosted: Wed Sep 25, 2013 8:42 pm  (#12) 
Offline
Script Coder
User avatar

Joined: Jul 14, 2010
Posts: 697
lylejk wrote:
RobA wrote:
You could use frequency separation (high pass/low pass). That is the perfect use for such a thing.

-Rob A>


Not accurate enough Rob; highpass will pass all noise and low pass blurs the transistions. I need an empty space detector in essence but it may be just too big a problem to easily solve. :)


I don't see why- can you post a sample?

-Rob A>

_________________
Image
Fantasy Cartography and Mapping by RobA


Top
 Post subject: Re: Is there a way to create a busy threshold mask?
PostPosted: Wed Sep 25, 2013 11:59 pm  (#13) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12536
Best that I could do using highpass, bilateral, auto-level and dilate Rob. A lot of work and still not complete. :)

ref:
Attachment:
L1000037crp.JPG
L1000037crp.JPG [ 459.22 KiB | Viewed 1450 times ]


result of said operation:
Attachment:
L1000037hp.png
L1000037hp.png [ 574.62 KiB | Viewed 1450 times ]

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: Is there a way to create a busy threshold mask?
PostPosted: Thu Sep 26, 2013 1:21 am  (#14) 
Offline
GimpChat Member

Joined: Sep 22, 2013
Posts: 27
Hi, I dont know exactly what the result should look like but I prepared two images, if any of them is nearing what you want, I can write more about it

Attachment:
NoSkySelection-PoorMans1-t95-v1.jpg
NoSkySelection-PoorMans1-t95-v1.jpg [ 99.29 KiB | Viewed 1448 times ]

Attachment:
NoSkySelection-PoorMans1-t95-v2.jpg
NoSkySelection-PoorMans1-t95-v2.jpg [ 109.36 KiB | Viewed 1448 times ]


Top
 Post subject: Re: Is there a way to create a busy threshold mask?
PostPosted: Thu Sep 26, 2013 1:59 am  (#15) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12536
Main motivation is to be able to apply adaptive contrast to a pastural scene (or buildings) but not the sky since I don't want the resulting noise to show in the sky. :)

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: Is there a way to create a busy threshold mask?
PostPosted: Thu Sep 26, 2013 2:25 am  (#16) 
Offline
GimpChat Member

Joined: Sep 22, 2013
Posts: 27
Well, you must know, but by my understanding this should work as desired, here is an example, my image was used as a mask over layer modified with standard unsharp mask

Attachment:
NoSkySelection-PoorMans1-t95-v3.jpg
NoSkySelection-PoorMans1-t95-v3.jpg [ 117.67 KiB | Viewed 1441 times ]


Top
 Post subject: Re: Is there a way to create a busy threshold mask?
PostPosted: Thu Sep 26, 2013 2:41 am  (#17) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12536
Nice result tibor. Look forward to trying your code when you are ready to share it. :)

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: Is there a way to create a busy threshold mask?
PostPosted: Thu Sep 26, 2013 2:50 am  (#18) 
Offline
GimpChat Member

Joined: Sep 22, 2013
Posts: 27
:)
I have no code for it.

I am (mis-)using selective color blur plugin, see screenshot
Attachment:
colorblurplugin.png
colorblurplugin.png [ 35.05 KiB | Viewed 1434 times ]


the procedure is
1. blur softly original image
2. use the colorblur plugin
3. and the output is a mask (must be blurred to make the masking effect gradual)

:)


Top
 Post subject: Re: Is there a way to create a busy threshold mask?
PostPosted: Thu Sep 26, 2013 7:27 am  (#19) 
Offline
Script Coder
User avatar

Joined: Jun 22, 2010
Posts: 1171
Location: Here and there
Using G'MICs Frequency splitting filter (smoothing 2.82) and then a threshold adjustment (125 135) on the structure layer (the grayscale one) I can get this as a first attempt:

Attachment:
L1000037crp.png
L1000037crp.png [ 91.49 KiB | Viewed 1423 times ]


Kevin


Top
 Post subject: Re: Is there a way to create a busy threshold mask?
PostPosted: Thu Sep 26, 2013 8:38 am  (#20) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12536
That's pretty much the highpass filter idea Kevin. Rob's idea does appear to hold promise. Still have to deal with the occasion hot bits though. Guess there isn't really a good way to test smooth voids. :)

_________________
Lyle

Psalm 109:8

Image


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

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Create Layer Mask From

8

No new posts Attachment(s) PYTON-FU-CREATE-LAYER-MASK-FROM...

3

No new posts Attachment(s) Fast Mask (Rel 2)

14

No new posts Removing a mask?

2

No new posts Help removing mask from face

2



* Login  



Powered by phpBB3 © phpBB Group