It is currently 18 Jan 2018, 01:30

GIMP Python Fu ScriptsStroke Path With Gradient (With Miter [sharp edges]) (Showcase | Slideshow)

Share your Python Fu scripts for GIMP here
Post Reply
User avatar
tim

Administrator
View: Showcase | Slideshow
Topic Posts: 14/49
Posts: 2058
Joined: 25 Sep 2016, 17:16
Cash on hand: 6,937.46 GLP
Bank: 42,250.25 GLP
Gender: Guy
Location: Victoria, BC
Website: https://gimplearn.net
Operating System: Windows
GIMP Version: 2.8.22
My Personal Blog
My FineArtAmerica
x 1092
x 236
Contact:
Canada

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

Post#1 by tim » 29 Sep 2017, 11: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.

:download:
stroke_path_with_gradient.zip #
zipped .py file (unzip, put in your GIMP's /plug-ins/ folder)
(2.4 KiB) Downloaded 29 times
:download:
stroke_path_with_gradient (2).zip #
version 2. Added Semiflatten step when done stroking
(2.43 KiB) Downloaded 23 times
:download:
stroke_path_with_gradient (3).zip #
version 3. Added Semiflatten toggle option instead of always performing it.
(2.5 KiB) Downloaded 41 times
:download:
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 27 times
:download:
stroke_path_with_gradient (5).zip #
version 5. Added Custom Gradient capability.
(2.58 KiB) Downloaded 34 times
:download:
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 21 times
:download:
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 56 times
:download:
stroke_path_with_gradient.py #
version 8. Fixed an error on my Ubuntu Linux machine so it would work Linux
(7.65 KiB) Downloaded 71 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 733 times (Watermarked | Thumbnail)

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 757 times (Watermarked | Thumbnail)
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 599 times (Watermarked | Thumbnail)
0 x



aka Tin
Image gimplearn.net                                              

Registered members enjoy ads-free content
User avatar
tim

Administrator
View: Showcase | Slideshow
Topic Posts: 14/49
Posts: 2058
Joined: 25 Sep 2016, 17:16
Cash on hand: 6,937.46 GLP
Bank: 42,250.25 GLP
Gender: Guy
Location: Victoria, BC
Website: https://gimplearn.net
Operating System: Windows
GIMP Version: 2.8.22
My Personal Blog
My FineArtAmerica
x 1092
x 236
Contact:
Canada

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


It's been a while since I created any script, so this script made me happy.
I hope it satisfies PegLeg44's needs.
0 x



aka Tin
Image gimplearn.net                                              

User avatar
gnerd
Forum Member
View: Showcase | Slideshow
Topic Posts: 4/49
Posts: 1091
Joined: 19 Jun 2017, 15:29
Cash on hand: 7,270.84 GLP
Gender: Gal
Location: NC
Operating System: Windows
GIMP Version: 2.9.5
x 172
x 390
United States of America

Post#3 by gnerd » 29 Sep 2017, 13: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 729 times (Watermarked | Thumbnail)
0 x




User avatar
tim

Administrator
View: Showcase | Slideshow
Topic Posts: 14/49
Posts: 2058
Joined: 25 Sep 2016, 17:16
Cash on hand: 6,937.46 GLP
Bank: 42,250.25 GLP
Gender: Guy
Location: Victoria, BC
Website: https://gimplearn.net
Operating System: Windows
GIMP Version: 2.8.22
My Personal Blog
My FineArtAmerica
x 1092
x 236
Contact:
Canada

Post#4 by tim » 29 Sep 2017, 14: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.
0 x



aka Tin
Image gimplearn.net                                              

User avatar
gnerd
Forum Member
View: Showcase | Slideshow
Topic Posts: 4/49
Posts: 1091
Joined: 19 Jun 2017, 15:29
Cash on hand: 7,270.84 GLP
Gender: Gal
Location: NC
Operating System: Windows
GIMP Version: 2.9.5
x 172
x 390
United States of America

Post#5 by gnerd » 29 Sep 2017, 14: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 x




User avatar
tim

Administrator
View: Showcase | Slideshow
Topic Posts: 14/49
Posts: 2058
Joined: 25 Sep 2016, 17:16
Cash on hand: 6,937.46 GLP
Bank: 42,250.25 GLP
Gender: Guy
Location: Victoria, BC
Website: https://gimplearn.net
Operating System: Windows
GIMP Version: 2.8.22
My Personal Blog
My FineArtAmerica
x 1092
x 236
Contact:
Canada

Post#6 by tim » 29 Sep 2017, 14: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.
1 x



aka Tin
Image gimplearn.net                                              

User avatar
gnerd
Forum Member
View: Showcase | Slideshow
Topic Posts: 4/49
Posts: 1091
Joined: 19 Jun 2017, 15:29
Cash on hand: 7,270.84 GLP
Gender: Gal
Location: NC
Operating System: Windows
GIMP Version: 2.9.5
x 172
x 390
United States of America

Post#7 by gnerd » 29 Sep 2017, 15: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 698 times (Watermarked | Thumbnail)
hummingbird sizedscript test no bg.png
hummingbird sizedscript test no bg.png # (12.18 KiB) Viewed 698 times (Watermarked | Thumbnail)
0 x




Post Reply

Last 20 Members Who Visited This Topic

User avatar leopardo-40 (1), User avatar Issabella (6), User avatar Conbagui (4), User avatar LucivaldoSP (1), User avatar gnerd (73), User avatar Pat625 (93), User avatar tim (167), User avatar RJKD (24), User avatar Wallace (1), User avatar animicule (13), User avatar Pegleg44 (25), User avatar oldmangrumpy (7)

  • Similar Topics
    Replies
    Views
    Last post
• Featuring Members' Works (Image Attachments Only) •
1: Ella
2: RJKD
3: Wallace
4: oldmangrumpy
5: animicule
6: RJKD
7: oldmangrumpy

Who is online

Users browsing this forum: No registered users and 2 guests