It is currently 04 Jun 2020, 00:54

• Featuring Members' Works (Image Attachments) •
1: member
2: member
3: member
4: member
5: member

GIMP/GL:  Tutorials | Tips | Questions | Interests | Script Requests
Recommendations:  Index | Top 10
Resources:  🡆 Python-Fu Plug-ins | Scheme-Fu Scripts | GIMP
Python:  Lessons | Questions | Exercises
The Arts:  GIMPed | GIMPed Photos | Other | Contests | Public Domain Images | Isolated Images | Blender
Inkscape
Social:  Say Hello | Anything Goes | Shares | FCSP

Stroke Path With Gradient (With Miter [sharp edges])

Share your Python Fu Scripts/plug-ins for GIMP here
tim
GL Blogger

Stroke Path With Gradient (With Miter [sharp edges])

Post#1 by tim » 29 Sep 2017, 18:32


This script originates from request by Pegleg44 found here -> Stroke Blend with Miter Limit Script

This script will stroke a path multiple times using SVG.
Each time with a calculated color and shrinking width to simulate gradient transition from one color to another.
This is because I couldn't find a way to define the gradient for the path in SVG. I only found ways to have a gradient along the path; not a gradient that is perpendicular to the path at each point like requested by PegLeg44.
stroke_path_with_gradient.zip
zipped .py file (unzip, put in your GIMP's /plug-ins/ folder)
(2.4 KiB) Downloaded 115 times
stroke_path_with_gradient (2).zip
version 2. Added Semiflatten step when done stroking
(2.43 KiB) Downloaded 98 times
stroke_path_with_gradient (3).zip
version 3. Added Semiflatten toggle option instead of always performing it.
(2.5 KiB) Downloaded 95 times
stroke_path_with_gradient (4).zip
version 4. Changed some code suggested by ofnuts so that it'll work on Linux and OSX as well.
(2.4 KiB) Downloaded 98 times
stroke_path_with_gradient (5).zip
version 5. Added Custom Gradient capability.
(2.58 KiB) Downloaded 88 times
stroke_path_with_gradient (6).zip
version 6. Create a single .svg file in Document History entry per run instead of multiples (number of strokes) entries.
(2.71 KiB) Downloaded 79 times
stroke_path_with_gradient (7).zip
version 7. Creates a single .svg file in Document History that can be opened via "Open Recent" instead of creating multiple .svg files and removing them.
(3.09 KiB) Downloaded 121 times
stroke_path_with_gradient.py
version 8. Fixed an error on my Ubuntu Linux machine so it would work Linux
(7.65 KiB) Downloaded 163 times
stroke_path_with_gradient(9).zip
version 9. Changed to use GIMP 2.10's constand names.
(3.19 KiB) Downloaded 154 times
Script Menu Location: Python-Fu/Stroke Path With Gradient...

Script Options:
Stroke_Path_With_Gradient_Options.jpg
Stroke_Path_With_Gradient_Options.jpg (61.59 KiB) Viewed 3233 times

Instructions:
1) Open a new image with an active path/vector.
2) Run Script (Python-Fu/Stroke Path With Gradient).
3) Enter Stroke Line Width, Number of Strokes to emulate gradient (suggested use is to use the same number of Stroke Line Width so that you get roughly 1 pixel width increments for each color but you could have more or less it's up to you). Pick center stroke color. Pick border stroke color.
4) Hit OK to run script and wait for it to stroke the path Number of Strokes times.

Sample result (of 25 Line Width and 25 Strokes).
Stroke_Path_With_Gradient_Star_Path.jpg
Stroke_Path_With_Gradient_Star_Path.jpg (16.24 KiB) Viewed 3257 times
Sample result (of 35 Line Width and 35 Strokes, with Custom Gradient).
Stroke_Path_With_Gradient_Star_Path_With_Custom_Gradient.png
Stroke_Path_With_Gradient_Star_Path_With_Custom_Gradient.png (65.94 KiB) Viewed 3099 times
aka Tin
:tree_02:
Tin's: Favorite Index | Simple Art === fb4yt video search | fb4yt recent video views report
Lottery numbers from image | Interested Members in TLF
Paying for hosting is to support my hobby, and donating money made from ads to The Red Cross.
         
0

tim
GL Blogger

Post#2 by tim » 29 Sep 2017, 18:47


It's been a while since I created any script, so this script made me happy.
I hope it satisfies PegLeg44's needs.
aka Tin
:tree_02:
Tin's: Favorite Index | Simple Art === fb4yt video search | fb4yt recent video views report
Lottery numbers from image | Interested Members in TLF
Paying for hosting is to support my hobby, and donating money made from ads to The Red Cross.
         
0

gnerd
Forum Member

Post#3 by gnerd » 29 Sep 2017, 20:56


Tin I shy away from scripts (because I don't know what i'm doing ) for the most part. But I just put a quick line art pic and boom it was magic :gimp_clap: !! Well done, now i'm ready to go play instead of popping in for a moment to check it out :D This only took a couple minutes so keep that in mind lol, not the best but the possibilities are endless!!
Attachments
squirrel play.png
squirrel play.png (31.24 KiB) Viewed 3229 times
0

tim
GL Blogger

Post#4 by tim » 29 Sep 2017, 21:05


The script draws paths transitioning from outside with thicker width and inner color.
Your art seems to only use half of that like one side of it.
Did you cut the other half out? or cover it up some how? because it looks like your paths only have one transition.
aka Tin
:tree_02:
Tin's: Favorite Index | Simple Art === fb4yt video search | fb4yt recent video views report
Lottery numbers from image | Interested Members in TLF
Paying for hosting is to support my hobby, and donating money made from ads to The Red Cross.
         
0

gnerd
Forum Member

Post#5 by gnerd » 29 Sep 2017, 21:18


I didn't cut anything out so I had to leave something out. Hmmm well my luck with scripts may still hold sketchy lol. But i'll keep trying! Still an awesome script, thank you.
0

tim
GL Blogger

Post#6 by tim » 29 Sep 2017, 21:22


I think I know what you did, you had a selection that is the path. Then it only works on the selection so that's only half of the effect.
If you Select All or None, then you'll see the other half on the other side of the path.
aka Tin
:tree_02:
Tin's: Favorite Index | Simple Art === fb4yt video search | fb4yt recent video views report
Lottery numbers from image | Interested Members in TLF
Paying for hosting is to support my hobby, and donating money made from ads to The Red Cross.
         
1

gnerd
Forum Member

Post#7 by gnerd » 29 Sep 2017, 22:31


I think I understand now, I may have some success with this one :D . The first one is just normal, then I tried to remove the background to play a bit more! Again thank you for a wonderful script as well as helping me understand it!
Attachments
hummingbird sizedscript test.png
hummingbird sizedscript test.png (11.26 KiB) Viewed 3198 times
hummingbird sizedscript test no bg.png
hummingbird sizedscript test no bg.png (12.18 KiB) Viewed 3198 times
0

Pat625
Tutorial Creator

Post#8 by Pat625 » 30 Sep 2017, 01:52


Tin, I think there will be many possibilities with this one!
TinTran.Stroke Path.Tin Rocks Gimp.jpg
TinTran.Stroke Path.Tin Rocks Gimp.jpg (476.36 KiB) Viewed 2467 times
Just need smoother edges. Is this from the path or the script?
1

tim
GL Blogger

Post#9 by tim » 30 Sep 2017, 02:07


The rough edges is because you're using version 2 it does a semi flatten so it makes your partial transparent pixel flatten with current background color. so you get rough pixels.
Try version 1 it's smooth.
aka Tin
:tree_02:
Tin's: Favorite Index | Simple Art === fb4yt video search | fb4yt recent video views report
Lottery numbers from image | Interested Members in TLF
Paying for hosting is to support my hobby, and donating money made from ads to The Red Cross.
         
0

Pat625
Tutorial Creator

Post#10 by Pat625 » 30 Sep 2017, 02:13


Had to try another one!
TinTran.Stroke Path.Pooh Bear.jpg
TinTran.Stroke Path.Pooh Bear.jpg (258.91 KiB) Viewed 2464 times
I cleaned the edges of my path before stroking, but still some jaggies.
0


GIMP/GL:  Tutorials | Tips | Questions | Interests | Script Requests
Recommendations:  Index | Top 10
Resources:  🡆 Python-Fu Plug-ins | Scheme-Fu Scripts | GIMP
Python:  Lessons | Questions | Exercises
The Arts:  GIMPed | GIMPed Photos | Other | Contests | Public Domain Images | Isolated Images | Blender
Inkscape
Social:  Say Hello | Anything Goes | Shares | FCSP

Post Reply
  • Similar Topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 13 guests