It is currently Fri Mar 29, 2024 9:41 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Create New Gradient Along Path (python fu script).
PostPosted: Thu May 12, 2016 5:29 pm  (#1) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3970
Location: Canada
Will allow you to quickly create a gradient by sampling color values of an active layer along the active path.

To run the script just have the layer you want to grab colors out of selected and have a path active (some simple path drawn).
The script will divide the path (approximately) into number of segments and sample color values to use for new gradient.
After the script runs, you should have a new gradient created with the name you have specified as input for the script.

Will be available under <Image>/Tools/Create New Gradient Along Path...
Attachment:
create_new_gradient_along_path.zip [2.51 KiB]
Downloaded 263 times


2nd version allows STRAIGHT LINE equal distance sampling
This was an idea suggested by PegLeg44. At least that's way i understood him (hopefully I am right).

This is what the options look like for the script.
Image

I said approximately because as you can tell below it's not exact equal distance along the path but it's pretty close.
for a 5 segment gradient
Image
for a 25 segment gradient
Image

_________________
TinT


Last edited by trandoductin on Thu May 12, 2016 9:08 pm, edited 4 times in total.

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: Create New Gradient Along Path (python fu script).
PostPosted: Thu May 12, 2016 5:45 pm  (#2) 
Offline
GimpChat Member

Joined: May 12, 2015
Posts: 4694
Have yet not tried it but a great idea. Does it differ from the one in G'MIC?


Top
 Post subject: Re: Create New Gradient Along Path (python fu script).
PostPosted: Thu May 12, 2016 5:53 pm  (#3) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3970
Location: Canada
Pat625 wrote:
Have yet not tried it but a great idea. Does it differ from the one in G'MIC?

I didn't know there was one in GMIC so i don't know :oops:

_________________
TinT


Top
 Post subject: Re: Create New Gradient Along Path (python fu script).
PostPosted: Thu May 12, 2016 6:12 pm  (#4) 
Offline
GimpChat Member
User avatar

Joined: Dec 10, 2013
Posts: 1004
Thank you trandoductin! Just downloaded. :bigthup

_________________
Image
Macbook Air - MacOS Sierra 10.12
McGimp 2.8.14
G'mic 1.6.5


Top
 Post subject: Re: Create New Gradient Along Path (python fu script).
PostPosted: Thu May 12, 2016 7:04 pm  (#5) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3970
Location: Canada
Dalia wrote:
Thank you trandoductin! Just downloaded. :bigthup

Thank you for giving it a try :yes

_________________
TinT


Top
 Post subject: Re: Create New Gradient Along Path (python fu script).
PostPosted: Thu May 12, 2016 7:10 pm  (#6) 
Offline
Administrator
User avatar

Joined: Aug 10, 2012
Posts: 12978
Location: Native to NYC living in Arizona, Gimp 2.8 & 2.10, Win 11 PC.
I already have a script installed made by Rob A, that does this same thing.
Image

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


Top
 Post subject: Re: Create New Gradient Along Path (python fu script).
PostPosted: Thu May 12, 2016 8:52 pm  (#7) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3970
Location: Canada
I didn't know that Wallace.. :hehe

_________________
TinT


Top
 Post subject: Re: Create New Gradient Along Path (python fu script).
PostPosted: Thu May 12, 2016 9:05 pm  (#8) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3970
Location: Canada
Okay so I think PegLeg44 wants something that calculates from a straight path.
Currently this script treats it as a Cubic Bezier Curve so the sampling points are like this
for a 10 segment gradient.
Image
So from a straight path, we should just simple calculate equal distance like this
Image
So now i've added an option you can choose "YES" to calculate like the 2nd image above (with equal distance) and not like Bezier Curve like 1st image.
Image
This is the second version of this script.
Attachment:
create_new_gradient_along_path.zip [2.78 KiB]
Downloaded 257 times

_________________
TinT


Top
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Can a python script use gimpfu, run from terminal, and create new img?

2

No new posts Attachment(s) Create a red heart script

16

No new posts looking for help with a Python script

5

No new posts .py script not showing under Python-Fu

3

No new posts Attachment(s) Learning to do first Python script

6



* Login  



Powered by phpBB3 © phpBB Group