It is currently Tue Jul 23, 2024 3:10 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Why can not I apply the gradient only in the selection?
PostPosted: Mon Jul 14, 2014 1:49 pm  (#1) 
Offline
GimpChat Member
User avatar

Joined: Jan 10, 2013
Posts: 863
GIMP Version: 2.8.10
Operating System: Windows
GIMP Experience: Basic Level



Hi!

In a selection in the image (inner circle), I try to apply a gradient using Layer Effects.
Image

But the resulting gradient is applied the whole image, but not in the selection.
Image

If I remove the alpha channel, the gradient is applied the whole image. And not only in the selection.
Image


Why can not I apply the gradient (using layer effects - gradient overlay) only in the selection?
Thanks in advance

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


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: Why can not I apply the gradient only in the selection?
PostPosted: Mon Jul 14, 2014 3:43 pm  (#2) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4757
If you have the alpha-lock and nothing opaque in the selection, nothing will happen. But it seems the selection you have is th exterior of the circle (use the "Quikmask" to check).

_________________
Image


Top
 Post subject: Re: Why can not I apply the gradient only in the selection?
PostPosted: Tue Jul 15, 2014 3:02 am  (#3) 
Offline
GimpChat Member
User avatar

Joined: Jan 10, 2013
Posts: 863
ofnuts wrote:
If you have the alpha-lock and nothing opaque in the selection, nothing will happen.

Not alpha-lock.
The selection is a transparent area. :(

ofnuts wrote:
But it seems the selection you have is th exterior of the circle (use the "Quikmask" to check).

My selection was created using path to selection.
In the image below, I drew a red line horizontally and used the Quikmask to show the selected area.
Image


Using the Blend Tool I can only fill the selected area, but it is precisely what can not using layer effects - gradient overlay

The only solution I found is to create a new transparent layer, apply a color to the selected area and then after you apply layer effects - gradient overlay, merge down.


It is amazing that both scripts (py and scm) apply the gradient outside the selection. :hoh

Thanks Ofnuts!

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


Top
 Post subject: Re: Why can not I apply the gradient only in the selection?
PostPosted: Tue Jul 15, 2014 3:24 am  (#4) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
It is only by convention that scripts or plug-ins limit their filtering to the selected region of the layer, though it is a rather strong convention and filters should have some sound reasoning for ignoring the selection*. In this case, I suspect the anomalous behavior is attributable to a bug in the Layer Effects script, which you should report to its author.


* I myself have written several scripts where I do not use the selection conventionally, but instead use it for other purposes. For example, Align Down will center a layer within the selection and Fit Within Selection scales a layer to fit within the selection. Quantize and Extend To Image Size both use the selection to protect regions of the image from the filtering effect. And Copy Mask From Above either ignores the selection or creates a layermask from it depending upon the situation. Nonetheless, these are exceptions to the rule and most filters should honor the selection and use it to mask the filtering effect.

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: Why can not I apply the gradient only in the selection?
PostPosted: Tue Jul 15, 2014 4:34 am  (#5) 
Offline
GimpChat Member
User avatar

Joined: Jan 10, 2013
Posts: 863
saulgoode wrote:
It is only by convention that scripts or plug-ins limit their filtering to the selected region of the layer, though it is a rather strong convention and filters should have some sound reasoning for ignoring the selection*. In this case, I suspect the anomalous behavior is attributable to a bug in the Layer Effects script, which you should report to its author.

The filter layer effects (scm and py) is very good, I was unaware of this information. :(
saulgoode wrote:
* I myself have written several scripts where I do not use the selection conventionally, but instead use it for other purposes. For example, Align Down will center a layer within the selection and Fit Within Selection scales a layer to fit within the selection. Quantize and Extend To Image Size both use the selection to protect regions of the image from the filtering effect. And Copy Mask From Above either ignores the selection or creates a layermask from it depending upon the situation. Nonetheless, these are exceptions to the rule and most filters should honor the selection and use it to mask the filtering effect.

The fact that some scripts work with selections gave me a wrong expectation about what I could get this case.


Tried the Gradient Stroke Script V1.0 GnuTux, and almost got the expected results.
Although it is to stroke, tried to adapt it to my needs.

But always remains an internal area without being filled.

ImageImage

That's even better than I got with the filter layer effects.

Thx Saulgoode!

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


Top
 Post subject: Re: Why can not I apply the gradient only in the selection?
PostPosted: Tue Jul 15, 2014 5:15 am  (#6) 
Offline
GimpChat Member
User avatar

Joined: Jan 10, 2013
Posts: 863
GnuTux wrote:
Akros,
It's very easy to adapt my Gradient Stroke Script to also allow fills. I will add this feature momentarily .

Wow!
At the moment I'm already having some fun with the Gradient Stroke V1.1, if this implementation is added, it would be too much! :jumpclap :clap
:bowdown Thx very much GnuTux :tyspin

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


Top
 Post subject: Re: Why can not I apply the gradient only in the selection?
PostPosted: Tue Jul 15, 2014 5:17 am  (#7) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 5242
Location: Gimpville
Akros,

I've updated my Gradient Stroke Script V1.2 to perform gradient fills on a selection. Setting the "Stroke Width" to zero will direct the script to fill with the gradient.

_________________
“If you reach for the stars, you just might land on a decently sized hill.” - Stuart Hill


Top
 Post subject: Re: Why can not I apply the gradient only in the selection?
PostPosted: Tue Jul 15, 2014 5:49 am  (#8) 
Offline
GimpChat Member
User avatar

Joined: Jan 10, 2013
Posts: 863
GnuTux wrote:
Akros,

I've updated my Gradient Stroke Script V1.2 to perform gradient fills on a selection. Setting the "Stroke Width" to zero will direct the script to fill with the gradient.

:jumpclap :clap :yes :yr
Using Gradient Stroke V1.2
Image
With two clicks, and voila!
I still need to improve the technique, but that was what I was trying to get before with LE filter.

:tyspin Thx a lot GnuTux! :hi5

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


Top
 Post subject: Re: Why can not I apply the gradient only in the selection?
PostPosted: Tue Jul 15, 2014 6:13 am  (#9) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 5242
Location: Gimpville
Very cool, Akros! :cool :paint
Glad I could assist. :hi5

_________________
“If you reach for the stars, you just might land on a decently sized hill.” - Stuart Hill


Top
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) Custom Font Apply Selection v0.1

4

No new posts Attachment(s) Apply Selection to Layer with LIVE PREVIEW

6

No new posts Attachment(s) GEGL selection modification filter to apply on layer mask

8

No new posts Apply filter to all layers

6

No new posts Attachment(s) GEGL Jelly - Apply on Duplicate Layer above and use eraser

3



* Login  



Powered by phpBB3 © phpBB Group