You are here

Sample a Gradient Along a Path

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
Rate this item!
sample-gradient-along-path.scm5.85 KB

A script to create a new gradient by sampling along a path drawn in an image.

Example and usage are here:

This was tested under 2.6 but should work under 2.4

Please note the script registers under the Gradient Menu (from the gradient dialog). It will error out if called on an image that has no paths defined.

-Rob A>

Code License: 
GIMP Version: 
Scripting Engine: 


Hi, I cant seem to find where you run this script in the GIMP.

I'm not sure if its because I haven't installed the script correctly or I'm not looking in the correct place.
This is what I did to install/use it. Please can you suggest where I might have gone wrong.

Copied file to here...
(This is where I've placed other scripts and they have worked successfully.)

Re-launched GIMP.
Drew a path.
Went to the Gradients dockable dialogue (tool-tip says 'gradients' when you hover over it).
Clicked on the left pointing little arrow on the RHS
Select 'Gradients Menu' -> I get a dialogue popping up - but no 'sample gradient ' option.

I also tried right clicking over the gradient tab below the window that has the list of tool icons (when you hover over this tab you get a 'Gradients editor' tool-tip).

I have also tried clicking on the left pointing arrow near this gradient tab.

Can you tell me which thing I click on to activate this tool please.

I'm on GIMP 2.8.0 Windows7 64-bit.

It works perfectly. Triangle->Gradient menu->"Sample gradient along a path", which gives You a pop-up window with settings. After execution You have it somewhere in the gradients. I had it between my customs and Abstract 1.
If You don´t see "sample gradient along a path" You might have forgotten to unblock the script. Right-click the sample-gradient-along-path.scm and select properties. Click unblock, apply, ok. Restart Gimp.

Thanks Evilsson,

I 'm sure it does work perfectly - if only the option would appear to let me run it.

........... "Triangle->Gradient menu->Sam"........

Where do you do this from? Can yo tell me exactly where this is please (see my question for where I have looked already).

........ "You might have forgotten to unblock the script. Right-click the sample-gradient-along-path.scm and select properties. Click unblock, apply, ok."...........

Where do I find the the script to do this please? It

Or maybe its a version thing. What version are you usign. And Platform?

Just figured out what was going wrong.

I had found the script on this page.......[subpage]=download...
But if you try to download it from this link you get a corrupted file.

You need to download it from this page to get a sound version...

Place file in your gimp scripts folder. E.g. it appears something like...

To run it...
Go to the Gradients dockable dialogue (tool-tip says 'gradients' when you hover over the tab).
(Not to be confused with the gradients editor window).
Click on the little left pointing arrow on the RHS.
Select 'Gradients Menu' -> get a dialogue popping up.
You should see an entry for 'Sample Gradient Along A Path' just above 'Save as CSS'

I don't have a 'Gradients Menu' ANYWHERE!!! What Am I doing wrong??? all I have an option is to select a gradient!!! I have NO MENU, NO dialogue popping up option or ANYTHING in regards to these instructions!!! I am using Gimp 2.8

The gradients dock has a menu, too.

if one point of the path is set out of the borders or on the border (0,y) it will go on forever, and the only way out is to terminate script-fu process (GIMP needs to restart after that).

Otherwise, very useful, thanks.
The next step: auto-find the most fitting interpolation method and auto-kill redundant segments, i.e. (1,1,1) to (1,1,1) to (1,1,1) to (1,1,1) -> one big (1,1,1) to (1,1,1).

Came across this script. I installed it, found it, and attempted to use it but nothing happens. Tried the usage page but it's no longer there.

Okay. Turns out it was working all along- shame on me. I had expected to see the gradient layered in the image or a new image with the gradient. But looking through my gradients I found like a dozen gradients there from prior attempts. Thanks.

You can always view the cache of any website. They usually get crawled every week, so for the most part they are still available, usually minus graphics and web formatting.


Subscribe to Comments for "Sample a Gradient Along a Path"