It is currently Tue May 07, 2024 1:53 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 58 posts ]  Go to page Previous  1, 2, 3
Author Message
 Post subject: Re: Is script that turns path to selection to layer possible?
PostPosted: Mon May 16, 2016 10:59 am  (#41) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
PegLeg44 wrote:
trandoductin wrote:
try this and let me know if it works like you wanted. I followed every single step.
Attachment:
The attachment path_to_selection_for_PegLeg44.scm is no longer available

It'll be available under Script-Fu/path-to-selection-for-PegLeg44
it'll select the active/selected path (just in case you have multiple paths defined/drawn)


trandoductin

I've gotten some good use out of this script already and have come up with one way that it could be just a tiny bit better. If you could add at the end of the script lets say step 10 run the [Layer] [Transparency] [Alpha to Selection] and then step 11 [Layer] [Crop to Selection]. You see this would make the file size of my images smaller.

And I would like it if you could call the script (Path to Darken Layer). This name would more suit the function.

I have noticed another thing while doing my work. I often times skip using the path. I just quickly make a selection using the fuzzy selection tool and then the layer etc. If you could alter the script to skip step 1 (starting with path to make a selection) but instead if I could have another script that just starts with a selection and then does the rest of the steps from 2 to 11 that would be useful to me. I was thinking that this could be called maybe (Selection to Darken Layer).

I just want to say that I appreciate all the script work that you do.

Thanks, Alan


okay, so here are the scripts (you can delete the old one since these are renamed file names too).
They'll be available under
<Image>/Script-Fu/Path To Darken Layer
Attachment:
Path_to_Darken_Layer.scm [3.59 KiB]
Downloaded 96 times

<Image>/Script-Fu/Sel To Darken Layer
Attachment:
Selection_To_Darken_Layer.scm [3.63 KiB]
Downloaded 115 times


Note: it's registered under "Sel To Darken Layer" and not "Selection To Darken Layer" (not sure why but when i tried to register it under "Selection To Darken Layer" the script wouldn't get registered)

_________________
TinT


Top
 Post subject: Re: Is script that turns path to selection to layer possible?
PostPosted: Wed May 18, 2016 11:08 am  (#42) 
Offline
GimpChat Member
User avatar

Joined: Feb 14, 2012
Posts: 426
Hi trandoductin

These two scripts work but the end - step 10 and 11 don't seem to be cropping the layer. I wonder if maybe the crop can be done after, or as part of step two where the selection is already there and has created a the layer already.

2. I create a new white layer.
(set! new-layer (car (gimp-layer-new image width height
RGBA-IMAGE "new white" 100 NORMAL-MODE)))
(gimp-drawable-fill new-layer WHITE-FILL) ;fills background with white
(gimp-image-insert-layer image new-layer 0 0) ;parent 0, insert layer on top position(0)


Top
 Post subject: Re: Is script that turns path to selection to layer possible?
PostPosted: Wed May 18, 2016 11:42 am  (#43) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
My bad... I ran into a problem when i forgot to set foreground color as black and thought the script was broken so i commented out step 10 and step 11. And then when selected foreground color as black, the scripts work again but i forgot to uncomment step 10 and step 11.
So here are versions where step 10 and step 11 are uncommented.
Attachment:
Path_to_Darken_Layer.scm [3.59 KiB]
Downloaded 86 times

Attachment:
Selection_To_Darken_Layer.scm [3.63 KiB]
Downloaded 101 times



PS: would this Height Stretch Selection Script be of any use to you?

_________________
TinT


Top
 Post subject: Re: Is script that turns path to selection to layer possible?
PostPosted: Wed May 18, 2016 2:13 pm  (#44) 
Offline
GimpChat Member
User avatar

Joined: Feb 14, 2012
Posts: 426
Got them...

Yes, now they work good.

I have an idea for a script that would use a little noise, blur and desaturate for smoothing. I may be able to put some info together soon.

Thanks


Top
 Post subject: Re: Is script that turns path to selection to layer possible?
PostPosted: Wed May 18, 2016 2:31 pm  (#45) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
PegLeg44 wrote:
Got them...

Yes, now they work good.

I have an idea for a script that would use a little noise, blur and desaturate for smoothing. I may be able to put some info together soon.

Thanks

alright hurray for ideas. can't wait.

_________________
TinT


Top
 Post subject: Re: Is script that turns path to selection to layer possible?
PostPosted: Mon May 23, 2016 10:56 am  (#46) 
Offline
GimpChat Member
User avatar

Joined: Feb 14, 2012
Posts: 426
trandoductin

I've been playing around with ways of smoothing out gradients, either air brushed or filled, and have come up with a way that seems to work the best.

A script that could give the user a choice to change the Gaussian blur and then followed by two other blur methods that don't need to be set by the user, would be the best. It would go like this.

1. [Filters] [Blur] [Gaussian Blur] with the ability to set it at what you want.
2. [Filters] [Blur] [Pixelize] With the Width and Height set at 3
3. [Filters] [Blur] [Selective Gaussian Blur] with a blur radius of 5 and max delta of 50 (which is the default I believe)

Now the first step would basically smooth out really jagged edges depending on what kind of pixels you have on the image layer, either gradient fills or airbrushed pixels can be very blotchy. But other stuff like lines and details might need less blur. But those other two functions would work very well at the same settings every time. You could just make them editable if you want though. Well just see if you can make them editable by the user.

This whole process works fine on the Darken Only Layers that have the Alpha channel Lock turned on. These are the kind of layers that I would be using it on. No selection is required but it would be able to work on only a selection too. At least it does when I do it manually.


Top
 Post subject: Re: Is script that turns path to selection to layer possible?
PostPosted: Mon May 23, 2016 11:26 am  (#47) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
PegLeg44 wrote:
trandoductin

I've been playing around with ways of smoothing out gradients, either air brushed or filled, and have come up with a way that seems to work the best.

A script that could give the user a choice to change the Gaussian blur and then followed by two other blur methods that don't need to be set by the user, would be the best. It would go like this.

1. [Filters] [Blur] [Gaussian Blur] with the ability to set it at what you want.
2. [Filters] [Blur] [Pixelize] With the Width and Height set at 3
3. [Filters] [Blur] [Selective Gaussian Blur] with a blur radius of 5 and max delta of 50 (which is the default I believe)

Now the first step would basically smooth out really jagged edges depending on what kind of pixels you have on the image layer, either gradient fills or airbrushed pixels can be very blotchy. But other stuff like lines and details might need less blur. But those other two functions would work very well at the same settings every time. You could just make them editable if you want though. Well just see if you can make them editable by the user.

This whole process works fine on the Darken Only Layers that have the Alpha channel Lock turned on. These are the kind of layers that I would be using it on. No selection is required but it would be able to work on only a selection too. At least it does when I do it manually.


Here it is... I have set the defaults to your described settings for the pixelize blur and selective gaussian blur (but options are there to change it if user chooses to).
Image
Will be available under Script-Fu/Multiple Blurs...
Attachment:
Multiple_Blurs.scm [2.87 KiB]
Downloaded 88 times

It works on the whole image if there isn't a selection and works on the selection if there is one (this is what it does automatically just like when you're doing it manually).

_________________
TinT


Top
 Post subject: Re: Is script that turns path to selection to layer possible?
PostPosted: Mon May 23, 2016 12:28 pm  (#48) 
Offline
GimpChat Member
User avatar

Joined: Feb 14, 2012
Posts: 426
It works great! I noticed that I need to have at least a 1 for the Guassian Blur (can't have a zero). Otherwise it give an error. I've already given it a keyboard shortcut. This will come in handy.

Thanks, you're pretty good at this script stuff. I appreciate it.


Top
 Post subject: Re: Is script that turns path to selection to layer possible?
PostPosted: Mon May 23, 2016 12:55 pm  (#49) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
PegLeg44 wrote:
It works great! I noticed that I need to have at least a 1 for the Guassian Blur (can't have a zero). Otherwise it give an error. I've already given it a keyboard shortcut. This will come in handy.

Thanks, you're pretty good at this script stuff. I appreciate it.

yeah it's weird if you do it manual you can enter for 0.0 for gaussian blur.
But if you do it with script you have to pass in a value > 0.0...should add set the minimum value to 0.1 instead of 0.0?

_________________
TinT


Top
 Post subject: Re: Is script that turns path to selection to layer possible?
PostPosted: Mon May 23, 2016 1:10 pm  (#50) 
Offline
GimpChat Member
User avatar

Joined: Feb 14, 2012
Posts: 426
Oh, yes I will do that.


Top
 Post subject: Re: Is script that turns path to selection to layer possible?
PostPosted: Mon May 23, 2016 1:17 pm  (#51) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
PegLeg44 wrote:
Oh, yes I will do that.

Oh, I was asking you if i should put 0.1 as the minimum value for the user's input prompt.

_________________
TinT


Top
 Post subject: Re: Is script that turns path to selection to layer possible?
PostPosted: Mon May 23, 2016 6:19 pm  (#52) 
Offline
GimpChat Member
User avatar

Joined: Feb 14, 2012
Posts: 426
Yes I think that would work good. I will be using different values for different kinds of stuff but starting with .1 would be good.

Would I just replace the 5 with a 0.1 in this part of the code: (0.1 0 2000 1 50 1 0)


SF-ADJUSTMENT "Gausian Blur Radius" '(5 0 2000 1 50 1 0)
SF-ADJUSTMENT "Pixelize Blur Width/Height" '(3 0 2000 1 50 0 0)
SF-ADJUSTMENT "Selective Guasian Blur Radius" '(5 0 2000 1 50 2 0)
SF-ADJUSTMENT "Selective Guasian Blur Max. delta" '(50 0 255 1 50 0 0)


Top
 Post subject: Re: Is script that turns path to selection to layer possible?
PostPosted: Mon May 23, 2016 6:28 pm  (#53) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
PegLeg44 wrote:
Yes I think that would work good. I will be using different values for different kinds of stuff but starting with .1 would be good.

Would I just replace the 5 with a 0.1 in this part of the code: (0.1 0 2000 1 50 1 0)


SF-ADJUSTMENT "Gausian Blur Radius" '(5 0 2000 1 50 1 0)
SF-ADJUSTMENT "Pixelize Blur Width/Height" '(3 0 2000 1 50 0 0)
SF-ADJUSTMENT "Selective Guasian Blur Radius" '(5 0 2000 1 50 2 0)
SF-ADJUSTMENT "Selective Guasian Blur Max. delta" '(50 0 255 1 50 0 0)


nope 1st number is default second number the 0 is minimum (you'll want to change the 0 to 0.1 so that it's
(5 0.1 2000 1 50 1 0)
Attachment:
Multiple_Blurs.scm [2.87 KiB]
Downloaded 88 times


UPDATE: oh you want it to default to starting with 0.1 then yeah you were right... I just thought to change the minimum too since 0 will give error when run.

_________________
TinT


Top
 Post subject: Re: Is script that turns path to selection to layer possible?
PostPosted: Mon May 23, 2016 7:49 pm  (#54) 
Offline
GimpChat Member
User avatar

Joined: Feb 14, 2012
Posts: 426
I put in (0.1 0.1 2000 1 50 1 0) and it opens first time with 0.1 as the default but if I scroll the arrow down it just goes to 0 anyway and gives error messages.


Top
 Post subject: Re: Is script that turns path to selection to layer possible?
PostPosted: Mon May 23, 2016 8:48 pm  (#55) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
PegLeg44 wrote:
I put in (0.1 0.1 2000 1 50 1 0) and it opens first time with 0.1 as the default but if I scroll the arrow down it just goes to 0 anyway and gives error messages.

that's odd it doesn't scroll down to zero for me, it stops at 0.1

_________________
TinT


Top
 Post subject: Re: Is script that turns path to selection to layer possible?
PostPosted: Mon May 23, 2016 9:17 pm  (#56) 
Offline
GimpChat Member
User avatar

Joined: Feb 14, 2012
Posts: 426
I went in a changed the 0.1 back to 5 and it stops now.

Before: (0.1 0.1 2000 1 50 1 0)

Now: (5 0.1 2000 1 50 1 0)


Top
 Post subject: Re: Is script that turns path to selection to layer possible?
PostPosted: Wed Jun 01, 2016 12:06 pm  (#57) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
These scripts will change FG and BG colors to default Black and White before running script
then restoring context colors after script is done.
Attachment:
Path_to_Darken_Layer.scm [3.83 KiB]
Downloaded 89 times

Attachment:
Selection_To_Darken_Layer.scm [3.87 KiB]
Downloaded 79 times

_________________
TinT


Top
 Post subject: Re: Is script that turns path to selection to layer possible?
PostPosted: Wed Jun 01, 2016 6:34 pm  (#58) 
Offline
GimpChat Member
User avatar

Joined: Feb 14, 2012
Posts: 426
Ah much better. Now I don't have to have the default chosen at the time of using the script.

Thanks,


Top
Post new topic Reply to topic  [ 58 posts ]  Go to page Previous  1, 2, 3

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) ofn-text-path-selection

14

No new posts Attachment(s) selection path help GIMP 2.10

3

No new posts Selection of a path component

1

No new posts How do I script a new white layer to the bottom of the layer stack

7

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

6



* Login  



Powered by phpBB3 © phpBB Group