It is currently Tue Nov 17, 2026 6:33 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 58 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: Re: Is script that turns path to selection to layer possible?
PostPosted: Mon May 09, 2016 1:48 pm  (#11) 
Offline
GimpChat Member
User avatar

Joined: Feb 14, 2012
Posts: 426
I made a video to show what I mean by colorizing a height map.

The script that I would want starts after the layer is placed on the top of the stacking order manually. And the script would start like this.

1. Set the layer mode to Grain Extract
2. Select the alpha of the layer [Layer] [Tranceparency] [Alpha to Selection].
3. Copy Visible [Edit] [Copy Visible]
4. Paste (Standard Paste should center automatically)
5. [Layer] [Anchor Layer]
6. [Colors] [Invert]
7. Threshold with the left field at 128 [Colors] [Threshold] (No need to change the layer to normal)
8. [Layer] [Transparency] [Color to Alpha]
9. Set layer mode to [Color]


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


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

Joined: May 07, 2014
Posts: 4561
Location: Canada
okay here it is. will be available under /Script-Fu/colorize-heightmap-for-PegLeg44
Attachment:
colorize_heightmap_for_PegLeg44.scm [2.82 KiB]
Downloaded 180 times


I added a 10th step for fun. it just renames the selected lay on top to apply script to whatever
the name was previously before appending " - colorize" at the end.
so for example if your layer's name was "horizontal copy" it'll now be renamed to "horizontal copy - colorize"

I thought it would be friendlier this way. If you don't want it i can remove it.

_________________
Image
Visualize your and others dreams coming true.


Top
 Post subject: Re: Is script that turns path to selection to layer possible?
PostPosted: Mon May 09, 2016 4:20 pm  (#13) 
Offline
GimpChat Member
User avatar

Joined: Feb 14, 2012
Posts: 426
trandoductin wrote:
okay here it is. will be available under /Script-Fu/colorize-heightmap-for-PegLeg44
Attachment:
colorize_heightmap_for_PegLeg44.scm


I added a 10th step for fun. it just renames the selected lay on top to apply script to whatever
the name was previously before appending " - colorize" at the end.
so for example if your layer's name was "horizontal copy" it'll now be renamed to "horizontal copy - colorize"
I thought it would be friendlier this way. If you don't want it i can remove it.


A tenth step is fine. I don't hardly ever name layers anymore. I usually just click on a layer while I have the move tool selected to figure out what layer it is.

The script works good. This is not a script that I would use much but I thought this thing up a while back. And since you can make it so fast I thought I'd see if it is possible. It works. Thanks.

I have another script in mind that I will describe tomorrow. It is for making a rounded profile. Like making a bottle or baseball bat height map. I don't have time now but will tomorrow. It would need to use another script that I have. I don't know if that is possible.

Your photo looks a lot like my wife's brother. My wife is Taiwanese.

Alan


Top
 Post subject: Re: Is script that turns path to selection to layer possible?
PostPosted: Mon May 09, 2016 4:35 pm  (#14) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 4561
Location: Canada
yes it is possible just give me the script and describe what you want like how you've been doing in steps that's really simple to understand..

Maybe all asians do look the same :hehe I am Vietnamese.

_________________
Image
Visualize your and others dreams coming true.


Top
 Post subject: Re: Is script that turns path to selection to layer possible?
PostPosted: Tue May 10, 2016 9:18 am  (#15) 
Offline
GimpChat Member
User avatar

Joined: Feb 14, 2012
Posts: 426
trandoductin

can you make a script open the curves dialog box and choose a saved curve to use on the pixels on the layer?


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

Joined: May 07, 2014
Posts: 4561
Location: Canada
I have looked and there doesn't seem to be away to load a saved curve's configuration.
maybe some expert can let me know if i am wrong.

_________________
Image
Visualize your and others dreams coming true.


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

Joined: Feb 14, 2012
Posts: 426
How about changing the gradient to be used?

You see the script I'm thinking about would use a script that I have called Selection Blend by RobA

Attachment:
RMA_selection_blend.scm [4.9 KiB]
Downloaded 166 times


This script uses whatever gradient is selected at the time.

If this isn't possible then the script would have to be just the last part of the process, after selecting the correct gradient.


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

Joined: May 07, 2014
Posts: 4561
Location: Canada
I can write a script to call his script, yes.

Also I found some code in python fu that can apply curves from a curve file. While in colors/curves window you can click on the top right corner for an option to export the curve to a file into the gimp's curves folder.
Then whenever you run the script it can give you an option to select the curve file, you just have to browse to the curve file.
And I can call script to apply the curves settings from the curve file.
Of course you only have to do this browsing to a curve file once everytime GIMP starts, after that if you want to use the same curve file you just leave it as is as it's defaulted to the last selected value just like any other options in scripts.

Does that makes sense or would that work for you...
So instead of selecting a preset curve, we can import an exported curve file and apply a curve.

Let me know

_________________
Image
Visualize your and others dreams coming true.


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

Joined: May 07, 2014
Posts: 4561
Location: Canada
RMA_selection_blend.scm accepts gradient as input.

I could make a script to also accept gradient as input (that lets user choose gradient).

Or grab the currently active selected gradient from the context and input that into RMA_selection_blend call.
it's totally up to you.

_________________
Image
Visualize your and others dreams coming true.


Top
 Post subject: Re: Is script that turns path to selection to layer possible?
PostPosted: Tue May 10, 2016 8:39 pm  (#20) 
Offline
GimpChat Member
User avatar

Joined: Feb 14, 2012
Posts: 426
I like the idea of user chosen gradient, but the script would actually need to select two gradients, for two separate layers. It would be one long set of things that it needs to do. And duplicating a layer and then using a different gradient will be one of them.

It could use one gradient but then would also need to alter the second one with the curves if you can't choose two.

I'm going to put the idea on screen tomorrow. I know what it needs to do but I just need to write it all out. You would have to look at it and see if it's possible.


Top
 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: 4561
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 156 times

_________________
Image
Visualize your and others dreams coming true.


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: 4561
Location: Canada
everytime i see this "is...possible?" question I keep thinking about
http://zombo.com/

_________________
Image
Visualize your and others dreams coming true.


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: 14276
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: 4561
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 ,

_________________
Image
Visualize your and others dreams coming true.


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: 4561
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 106 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

_________________
Image
Visualize your and others dreams coming true.


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 152 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: 4561
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.

_________________
Image
Visualize your and others dreams coming true.


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: 4561
Location: Canada
That's starting to sound challenging for me heheh: but we can always try.

_________________
Image
Visualize your and others dreams coming true.


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

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group