Change color intensity stroking along a path - Printable Version +- Gimp-Forum.net (https://www.gimp-forum.net) +-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP) +--- Forum: General questions (https://www.gimp-forum.net/Forum-General-questions) +--- Thread: Change color intensity stroking along a path (/Thread-Change-color-intensity-stroking-along-a-path) |
RE: Change color intensity stroking along a path - Ofnuts - 09-27-2021 (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... 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 RE: Change color intensity stroking along a path - denzjos - 09-27-2021 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. RE: Change color intensity stroking along a path - Ottia Tuota - 09-27-2021 (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 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 http://kmarkku.arkku.net/Path_modify_files/Gimp_master.html and click the bottom Download button. Unzip. Put the file chop_path.py 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. RE: Change color intensity stroking along a path - denzjos - 09-27-2021 @ 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. RE: Change color intensity stroking along a path - denzjos - 09-27-2021 Playing with this plugin on paths and blurred a little : https://gimplearn.net/viewtopic.php?t=980 [attachment=6762] RE: Change color intensity stroking along a path - PixLab - 09-28-2021 Wow denzjos, I like this. Can you explain how you did it/the process? RE: Change color intensity stroking along a path - Ottia Tuota - 09-28-2021 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: [attachment=6766] I noted that in Ofnuts' plugin one must use Cap style=Butt. Little blurring hides the small faults that are left at the joints. RE: Change color intensity stroking along a path - denzjos - 09-28-2021 @ PixLab. I just made a harmonograph with the help of a Ottia Tuota plugin (https://www.gimp-forum.net/Thread-Parametric-curves-2) : Filters / Render / Parametric curves / Special curves / Simple harmonograph. Then I used the Ottia Tuota chop plugin (http://kmarkku.arkku.net/Path_modify_files/Gimp_master.html) 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. RE: Change color intensity stroking along a path - Ottia Tuota - 09-28-2021 I, on the other hand, instead of the 'stroke_paths_with_gradient' plugin, used Ofnuts' plugin which is created by ofn-stroke-fill-paths.py 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... RE: Change color intensity stroking along a path - denzjos - 09-28-2021 @ 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. [attachment=6772] |