It is currently Thu Jun 04, 2026 1:31 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 58 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject: Re: Is script that turns path to selection to layer possible?
PostPosted: Tue May 10, 2016 9:26 pm  (#21) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 4469
Location: Canada
yeah the script can show any number of gradients so 2 is fine...
I could default them both 2 show active gradient and then user can change 1 or both its up to them when they run the script.

like for example this test script right now just is a shell it does nothing but it lets you select 2 gradients
this script will be available under Script-Fu/test-for-PegLeg44
Attachment:
test_for_PegLeg44.scm [1.26 KiB]
Downloaded 138 times

_________________
TinT
My GIMP 2.10 plug-in writer Fiverr Gig
Plaid Community Forum
Imageplaid-patterns.com


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

Joined: May 07, 2014
Posts: 4469
Location: Canada
everytime i see this "is...possible?" question I keep thinking about
http://zombo.com/

_________________
TinT
My GIMP 2.10 plug-in writer Fiverr Gig
Plaid Community Forum
Imageplaid-patterns.com


Top
 Post subject: Re: Is script that turns path to selection to layer possible?
PostPosted: Wed May 11, 2016 10:10 am  (#23) 
Offline
Administrator
User avatar

Joined: Aug 10, 2012
Posts: 14011
Location: Native to NYC living in Arizona, Gimp 2.8 - 3.0, Win 11 PC.
trandoductin wrote:
everytime i see this "is...possible?" question I keep thinking about
http://zombo.com/

I signed up for the zombo.com news letter. :hehe

_________________
Image
"A wise man learns more from a foolish question than a fool can learn from a wise answer"
Image


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

Joined: May 07, 2014
Posts: 4469
Location: Canada
:hehe hahaha you did? I wonder what they send out...
I just leave the sound on and browse on a different page and giggle as i hear the guy repeats himself in different words :hehe

UPDATE: I too tried to sign up for their newsletter :hehe ,

_________________
TinT
My GIMP 2.10 plug-in writer Fiverr Gig
Plaid Community Forum
Imageplaid-patterns.com


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

Joined: Feb 14, 2012
Posts: 426
I have a hard time believing that eny ting is possobo because I don't know how scripting works. That's a funny web site zombocom. Let's see if your still laughing after trying to make this script because I don't think it's possible.

Here's a video that will show how I do this manually:

www.youtube.com Video from : www.youtube.com


After Creating a symmetrical profile the script would then start like this.

1. Run the script that you have made on the path that is already created - [Script-Fu] [path-to-selection]
2. [Layer] [Transparency] [Alpha to Selection]
3. [Image] [Crop to Selection]
4. Run the [Select] [Selection Blend] script that RobA made with a gradient that I have created called 01RoundFull or I would prefer to select it.
5. [Layer] [Duplicate Layer]
6. [Select] [All]
7. [Select] [Selection Blend] RobA script with a different gradient (FG to BG RGB] or I will be able to select.
8. [Colors] [Levels] and the far right input level field at 127
9. [Layer] [Duplicate Layer]
10. Set layer mode to [Darken Only]
11. [Layer] [Transform] [Offset] X value of 1, (2, 4, 8, 16, 32, 64, 128, 256)
12. [Layer] [Merge Down]
13. Step 9 thru 12 need to be repeated with the other X values from 2 to 256 (up to 256 would work best or 512 if you want)
14. Finally the layer mode needs to be set to Screen

I think the script should stop there with the two layers and a background of white. This gives the result I need and still is editable if I need to do something else. I would then be able to copy and paste the image into other designs easily.


Top
 Post subject: Re: Is script that turns path to selection to layer possible?
PostPosted: Wed May 11, 2016 1:48 pm  (#26) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 4469
Location: Canada
please give this a test and let me know if it's right ;)

will be available under Script-Fu/round-raster-for-PegLeg44
Attachment:
round_raster_for_PegLeg44.scm [8.71 KiB]
Downloaded 95 times

user options
Image
I tried to create a white to black to white gradient for testing purposes and was able to to create this
Image

_________________
TinT
My GIMP 2.10 plug-in writer Fiverr Gig
Plaid Community Forum
Imageplaid-patterns.com


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

Joined: Feb 14, 2012
Posts: 426
BOOM!

That's some fast scripting! And it works fantastically. I tried it and it works without a hitch.

I've attached my round gradient that I use. This gradient would need to be used on step 4.

I'll go test this out some more. I used to dream about this script years ago but it wouldn't have been possible without the other script that you made called (path-to-selection-for-pegleg44)

Alan


Attachments:
File comment: This needs to go in the gradients folder inside User/Gimp-2.8
01RoundFull.ggr [248 Bytes]
Downloaded 136 times
Top
 Post subject: Re: Is script that turns path to selection to layer possible?
PostPosted: Wed May 11, 2016 4:36 pm  (#28) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 4469
Location: Canada
glad to help make your dream come true.... i don't think i could've done it with out RMA_selection_blend script (I think that script is way more complicated than anything i have done).

btw, i copied RMA_selection_blend script code and path_to_selection code so that script is stand alone on its own. So if we end up making changes to RMA or path_to_selection, we should propagate that change to this script as well.

And what about the script(s) that uses Color Curves? I've figured out how to apply Color Curves from an external file as well as a saved presets..but with presets..if you add a new preset you'll have to refresh script-fu scripts. But yeah just letting you know just in case you got other ideas for other script(s) that uses color curves.

_________________
TinT
My GIMP 2.10 plug-in writer Fiverr Gig
Plaid Community Forum
Imageplaid-patterns.com


Top
 Post subject: Re: Is script that turns path to selection to layer possible?
PostPosted: Wed May 11, 2016 5:46 pm  (#29) 
Offline
GimpChat Member
User avatar

Joined: Feb 14, 2012
Posts: 426
trandoductin wrote:
glad to help make your dream come true.... i don't think i could've done it with out RMA_selection_blend script (I think that script is way more complicated than anything i have done).

btw, i copied RMA_selection_blend script code and path_to_selection code so that script is stand alone on its own. So if we end up making changes to RMA or path_to_selection, we should propagate that change to this script as well.

And what about the script(s) that uses Color Curves? I've figured out how to apply Color Curves from an external file as well as a saved presets..but with presets..if you add a new preset you'll have to refresh script-fu scripts. But yeah just letting you know just in case you got other ideas for other script(s) that uses color curves.


So the RMA-selection-blend script and the path-to-selection script are all in the code for this script. Sounds good to me. That way anybody can just use it without having the others.

I was talking about including a [colors] [curves] funtion in this script earlier before I knew you could make it work with gradients. I was thinking that the curves could actually change the straight FG to BG gradient to a rounded one. But going right to the gradients for the script is better.

The next step in this kind of script might be to make a profile with the pen tool and put a color gradient into it and have the script do a function that would use that (Sample-Gradient-along-path) script to make new color gradients. It would give some control over the creation of the gradient. That's something that a lot of people might find useful. I've not played around with that kind of idea yet.


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

Joined: May 07, 2014
Posts: 4469
Location: Canada
That's starting to sound challenging for me heheh: but we can always try.

_________________
TinT
My GIMP 2.10 plug-in writer Fiverr Gig
Plaid Community Forum
Imageplaid-patterns.com


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

Joined: May 07, 2014
Posts: 4469
Location: Canada
Do you mean to use something like this?
Create New Gradient Along Path (python fu script).

_________________
TinT
My GIMP 2.10 plug-in writer Fiverr Gig
Plaid Community Forum
Imageplaid-patterns.com


Top
 Post subject: Re: Is script that turns path to selection to layer possible?
PostPosted: Thu May 12, 2016 6:55 pm  (#32) 
Offline
GimpChat Member
User avatar

Joined: Feb 14, 2012
Posts: 426
I have tried to use the regular Sample-Gradient-along-path script but found that if I made the path a shape like a wood profile it didn't work that accurately when I used the gradient for Height map stuff. The spacing between the segments wasn't quite right. I'll try this one. Did you use the other one to make it? It seems to do about the same thing by the way you have described it. I'll try it out later.

What I was really thinking about was doing something with offset layers to create a color across the screen and then getting the gradient from a straight path. By the way I think that if someone wants to get a good accurate gradient then the path should be perhaps exactly 256 pixels. But that's just my thoughts.


Top
 Post subject: Re: Is script that turns path to selection to layer possible?
PostPosted: Thu May 12, 2016 9:09 pm  (#33) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 4469
Location: Canada
Do you mean like equal distance sampling for a straight line path?
If so, then check out this second version here --> http://gimpchat.com/viewtopic.php?f=9&t=14068#p192230

_________________
TinT
My GIMP 2.10 plug-in writer Fiverr Gig
Plaid Community Forum
Imageplaid-patterns.com


Top
 Post subject: Re: Is script that turns path to selection to layer possible?
PostPosted: Thu May 12, 2016 11:22 pm  (#34) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 4469
Location: Canada
I was bored... and wondered if you already have something like this or maybe this will be of any use to you.
I call it Create New Gradient from Black Drawing
It scans the active layer from left to right, then from top to bottom and looks for black pixels.
the first pixel it finds from the top down and save the y coordinate
Then it creates a new gradient with (layer width-1) number of segments so that it has layer's width's number of colors.
The it loops through and sets the colors to a gray scale of the y coordinate..
for example if it finds a black pixel at y coordinate 0, it'll make that color on the gradient to be (0,0,0) (pure black)
if it doesn't find a black pixel at y coordinate for a certain x, it'll make that color on the gradient to be (255,255,255) (pure white).
so basically you can have an active layer that is (a width of your choice) x (a height of 255) and you can create gradients to use as height map.
Here i'll just show you an example.
here's a simple drawing i used to run the script on.
Image
and then i run the script and i get a gradient that is like this
Image

Is this script useful to you at all? Or do you already have something that helps with this?
Anyways here's the script. Let me know what's up.
It'll be available under <Image>/Tools/Create New Gradient From Black Drawing...
Attachment:
create_new_gradient_from_black_drawing.zip [1.51 KiB]
Downloaded 138 times


I was just playing around and was able to create gradient that is very similar to your 01RoundFull Gradient. I even tried to compare them by blending one layer with your 01RoundFull Gradient and another layer with my gradient from image below and set top layer to difference and the image is all black (don't know if they're pureblack but definitely close)
here's the screen shot of how i created the similar to your 01RoundFull Gradient.
Image

_________________
TinT
My GIMP 2.10 plug-in writer Fiverr Gig
Plaid Community Forum
Imageplaid-patterns.com


Last edited by trandoductin on Fri May 13, 2016 9:11 pm, edited 1 time in total.

Top
 Post subject: Re: Is script that turns path to selection to layer possible?
PostPosted: Fri May 13, 2016 7:59 am  (#35) 
Offline
GimpChat Member
User avatar

Joined: Jan 13, 2011
Posts: 2637
Location: Poland
My request:

I created a layer: A, B, C .....
I created a path: A, B, C ...
Is it possible to script-fu (for all layers):
stroke path A on the layer A
stroke path B on the layer B
................................................
and so on (when the layer name = path name)?


Attachments:
Stroke layers in sequence.png
Stroke layers in sequence.png [ 346.1 KiB | Viewed 1844 times ]

_________________
Image
Top
 Post subject: Re: Is script that turns path to selection to layer possible?
PostPosted: Fri May 13, 2016 12:04 pm  (#36) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 4469
Location: Canada
MareroQ wrote:
My request:

I created a layer: A, B, C .....
I created a path: A, B, C ...
Is it possible to script-fu (for all layers):
stroke path A on the layer A
stroke path B on the layer B
................................................
and so on (when the layer name = path name)?


Here it is it'll available under
<Image>/Python-Fu/Stroke Layers With Samely Named Paths...
Attachment:
stroke_layers_with_samely_named_paths.zip [722 Bytes]
Downloaded 144 times

Just unzip it to get the .py file and toss that into your gimp's plug-ins folder (and restart GIMP)
What the script does is it loops through all your layers and loops through all your paths if it finds a match it's stroke that layer with matching path using the active brush and foreground color.

_________________
TinT
My GIMP 2.10 plug-in writer Fiverr Gig
Plaid Community Forum
Imageplaid-patterns.com


Top
 Post subject: Re: Is script that turns path to selection to layer possible?
PostPosted: Fri May 13, 2016 12:59 pm  (#37) 
Offline
GimpChat Member
User avatar

Joined: Jan 13, 2011
Posts: 2637
Location: Poland
Super :yes


Attachments:
New good  plugin TT.png
New good plugin TT.png [ 837.42 KiB | Viewed 1830 times ]

_________________
Image
Top
 Post subject: Re: Is script that turns path to selection to layer possible?
PostPosted: Sat May 14, 2016 8:18 am  (#38) 
Offline
GimpChat Member
User avatar

Joined: Feb 14, 2012
Posts: 426
trandoductin wrote:
I was bored... and wondered if you already have something like this or maybe this will be of any use to you.
I call it Create New Gradient from Black Drawing
It scans the active layer from left to right, then from top to bottom and looks for black pixels.
the first pixel it finds from the top down and save the y coordinate
Then it creates a new gradient with (layer width-1) number of segments so that it has layer's width's number of colors.
The it loops through and sets the colors to a gray scale of the y coordinate..
for example if it finds a black pixel at y coordinate 0, it'll make that color on the gradient to be (0,0,0) (pure black)
if it doesn't find a black pixel at y coordinate for a certain x, it'll make that color on the gradient to be (255,255,255) (pure white).
so basically you can have an active layer that is (a width of your choice) x (a height of 255) and you can create gradients to use as height map.
Here i'll just show you an example.
here's a simple drawing i used to run the script on.
[ Image ]
and then i run the script and i get a gradient that is like this
[ Image ]

Is this script useful to you at all? Or do you already have something that helps with this?
Anyways here's the script. Let me know what's up.
It'll be available under <Image>/Tools/Create New Gradient From Black Drawing...
Attachment:
create_new_gradient_from_black_drawing.zip


I was just playing around and was able to create gradient that is very similar to your 01RoundFull Gradient. I even tried to compare them by blending one layer with your 01RoundFull Gradient and another layer with my gradient from image below and set top layer to difference and the image is all black (don't know if they're pureblack but definitely close)
here's the screen shot of how i created the similar to your 01RoundFull Gradient.
[ Image ]


I tried this script yesterday and it works pretty good on a canvas that is 256 pixels in height.


Top
 Post subject: Re: Is script that turns path to selection to layer possible?
PostPosted: Sat May 14, 2016 10:25 am  (#39) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 4469
Location: Canada
PegLeg44 wrote:
trandoductin wrote:
I was bored... and wondered if you already have something like this or maybe this will be of any use to you.
I call it Create New Gradient from Black Drawing
It scans the active layer from left to right, then from top to bottom and looks for black pixels.
the first pixel it finds from the top down and save the y coordinate
Then it creates a new gradient with (layer width-1) number of segments so that it has layer's width's number of colors.
The it loops through and sets the colors to a gray scale of the y coordinate..
for example if it finds a black pixel at y coordinate 0, it'll make that color on the gradient to be (0,0,0) (pure black)
if it doesn't find a black pixel at y coordinate for a certain x, it'll make that color on the gradient to be (255,255,255) (pure white).
so basically you can have an active layer that is (a width of your choice) x (a height of 255) and you can create gradients to use as height map.
Here i'll just show you an example.
here's a simple drawing i used to run the script on.
[ Image ]
and then i run the script and i get a gradient that is like this
[ Image ]

Is this script useful to you at all? Or do you already have something that helps with this?
Anyways here's the script. Let me know what's up.
It'll be available under <Image>/Tools/Create New Gradient From Black Drawing...
Attachment:
create_new_gradient_from_black_drawing.zip


I was just playing around and was able to create gradient that is very similar to your 01RoundFull Gradient. I even tried to compare them by blending one layer with your 01RoundFull Gradient and another layer with my gradient from image below and set top layer to difference and the image is all black (don't know if they're pureblack but definitely close)
here's the screen shot of how i created the similar to your 01RoundFull Gradient.
[ Image ]


I tried this script yesterday and it works pretty good on a canvas that is 256 pixels in height.


Yeah i wrote it thinking that it should be 256 in height to define gray scale values. so yeah 256, if your height is larger it just ignores pixels lower than 255 on the image (with a higher y-coordinate) and consider them 255.

_________________
TinT
My GIMP 2.10 plug-in writer Fiverr Gig
Plaid Community Forum
Imageplaid-patterns.com


Top
 Post subject: Re: Is script that turns path to selection to layer possible?
PostPosted: Mon May 16, 2016 8:55 am  (#40) 
Offline
GimpChat Member
User avatar

Joined: Feb 14, 2012
Posts: 426
trandoductin wrote:
try this and let me know if it works like you wanted. I followed every single step.
Attachment:
path_to_selection_for_PegLeg44.scm

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


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

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group