Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Change color intensity stroking along a path
(09-27-2021, 06:25 AM)Ottia Tuota Wrote:
(09-26-2021, 09:24 PM)Ofnuts Wrote: Very hard programmatically if is is a single stroke because there is no API in Gimp to set the fade length...

I don't know how OT's paths look but if they are a sequence of closed strokes, you can use my various scripts to

1) Decompose the path into individual strokes (ofn-path-edits(Break path apart))
2) Stroke each path with a color taken from a gradient (ofn-stroke-fill-paths )

If we are talking about the paths generated by the Simple harmonograph plugin, then: Each path is a single open stroke. Exception: If Skip=0 and there is no damping then the stroke is closed.

But that denjos' path is one open very long stroke, containing a large number of anchors.

OK, good to know. So we just need a script that goes from a long string of anchors to multiple paths with just two anchors Smile
Thank you all for your information, I thought there was a script or plugin that calculated the blending between two colors along a path measured by 'path details' tool. In my previous example the result is 90242,0. Then calculate the blending between 2 colors by using this length and the amount of colors that are possible between two colors in gimp. Maybe someone find a solution for this.
(09-27-2021, 07:22 AM)Ofnuts Wrote: OK, good to know. So we just need a script that goes from a long string of anchors to multiple paths with just two anchors Smile

I don't know what you are after but I guess you know it best. I made such plugin: it chops a path at its anchors into small paths. I hope this is what you meant.

To get the plugin, go to

and click the bottom Download button. Unzip. Put the file in the user's plug-ins folder. Restart Gimp. In the Paths tab, right-click the path you want to chop. Follow the links

Tools > Modify path > ...

and click "Chop the path at its anchors". Press OK. See the result.

Optionally you can, instead of getting a long list of 2-anchor paths as the result, tell the plugin to merge them down into one path with 2-anchor strokes.

I must say that I am always very much amazed when I manage in something so easily. The secret here is the data structures that I developed for my Parametric curves. And all the other pieces of code that I have been amassing. And the experience. If I had to do this using only how Gimp represents paths natively (x,y,x,y,x,y,...) I probably wouldn't even have tried.

If the plugin works wrong or if it is not quite what was needed, just tell me. If instead of a plugin you need a function to be embedded in another plugin, please use the code freely.
@ Ottia Tuota, nice done. I chopped my earlier path example and it resulted in 893 paths. I don't know if there exist a plugin or script that blend a specific color from path 1 to another specified color towards path 893 using all the chopped paths. Now if I look at the chopped path, maybe someone have an idea to color the chopped paths from 0 to 893 (in this example) in series of 2 or more colors to create a running light from path 0 to path 893 (in this example) and export this as a gif file. That would be nice.
Playing with this plugin on paths and blurred a little : 
Wow denzjos, I like this.
Can you explain how you did it/the process?
Ok, I got a similar picture. Waiting for denzjos to describe his process.

But there is perhaps one drawback: The Simple harmonograph plugin occasionally makes local clusters of anchors, especially close to sharp points. That may cause that the result is not always so good if one looks too closely. (The Simple harmonograph would need to clean up such clusters. Maybe some day...)

Using a gradient that goes to transparency at one end might be an answer to what denzjos was after in post #1. This is what I got:

I noted that in Ofnuts' plugin one must use Cap style=Butt. Little blurring hides the small faults that are left at the joints.
@ PixLab. I just made a harmonograph with the help of a Ottia Tuota plugin ( : Filters / Render / Parametric curves / Special curves / Simple harmonograph. Then I used the Ottia Tuota chop plugin ( to chop the path in a lot of paths (in this case 893 paths). Then I used the 'stroke_paths_with_gradient' plugin. And then I had a long, long, long, coffee break (1h45min) to have the result. So don't panic if the plugin is working. I suggest to test this with a small amount of paths before you give your computer a big job.
I, on the other hand, instead of the 'stroke_paths_with_gradient' plugin, used Ofnuts' plugin which is created by and is then found in the Paths tab (right-click) at Render > Mass render > Stroke line on paths.

I explain this just because I already happened to mention Ofnuts' plugin. I haven't tried the other plugin. But I didn't get any coffee break...
@ Ottio Tuota. Good tip. Where would we be without Ofnuts? I've done (my computer) the same path and the result is as the one made with the other plugin. The other plugin is much slower because it build up a SVG file while coloring. Playing with backgrounds in the Ofnuts plugin give other variations.

Forum Jump: