It is currently Fri Apr 26, 2024 9:27 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: SVG Stroke with Gradient (with Miter [Sharp Pointy Edges])
PostPosted: Fri Sep 29, 2017 4:13 pm  (#1) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
Pegleg44 asked for a script to generate something like this with a path.
Image

I searched for SVG Path/Stroke and Gradients related to Path/Stroke and couldn't find anything that does it. I only ran into Gradients along a path (not gradient that is perpendicular to points on a path).

So the only thing left to try was to manually emulate the gradient effect by drawing multiple SVG strokes of varying width and calculated transitioning colors from one color to another color.

So here's a script that generates the above if anyone is interested.
https://www.gimplearn.net/viewtopic.php?p=10409#p10409

Script options preview:
Image

_________________
TinT


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: SVG Stroke with Gradient (with Miter [Sharp Pointy Edges])
PostPosted: Fri Sep 29, 2017 11:55 pm  (#2) 
Offline
GimpChat Member

Joined: May 12, 2015
Posts: 4694
Just had to try it!
Attachment:
TinTran.Stroke Path Ver.3.Triangles.jpg
TinTran.Stroke Path Ver.3.Triangles.jpg [ 738.16 KiB | Viewed 3442 times ]


Top
 Post subject: Re: SVG Stroke with Gradient (with Miter [Sharp Pointy Edges])
PostPosted: Sat Sep 30, 2017 7:05 am  (#3) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
Image

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: SVG Stroke with Gradient (with Miter [Sharp Pointy Edges])
PostPosted: Sat Sep 30, 2017 11:23 am  (#4) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
Thanks Rod, we should thank Pegleg44 for the idea/suggestion.
And ofnuts for suggesting code version 4 which will work on Linux and OSX as well as Windows.

_________________
TinT


Top
 Post subject: Re: SVG Stroke with Gradient (with Miter [Sharp Pointy Edges])
PostPosted: Sat Sep 30, 2017 4:37 pm  (#5) 
Offline
GimpChat Member

Joined: May 12, 2015
Posts: 4694
Attachment:
TinTran.Stroke Path Ver.3.Star.jpg
TinTran.Stroke Path Ver.3.Star.jpg [ 552.81 KiB | Viewed 3344 times ]

Attachment:
TinTran.Stroke Path Ver.3.Star.Gradient Map.jpg
TinTran.Stroke Path Ver.3.Star.Gradient Map.jpg [ 724.09 KiB | Viewed 3344 times ]



Attachment:
TinTran.Stroke Path Ver.3.Text.Gradient Map.jpg
TinTran.Stroke Path Ver.3.Text.Gradient Map.jpg [ 317.09 KiB | Viewed 3344 times ]


Top
 Post subject: Re: SVG Stroke with Gradient (with Miter [Sharp Pointy Edges])
PostPosted: Sun Oct 01, 2017 11:10 am  (#6) 
Offline
GimpChat Member
User avatar

Joined: May 10, 2013
Posts: 1389
Location: FInland
Nice one, thank you! Now when do we get a plugin that uses custom gradient on a path same way?
That's something I've been trying to find out.

Image


Top
 Post subject: Re: SVG Stroke with Gradient (with Miter [Sharp Pointy Edges])
PostPosted: Sun Oct 01, 2017 12:15 pm  (#7) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
Nidhogg wrote:
Nice one, thank you! Now when do we get a plugin that uses custom gradient on a path same way?
That's something I've been trying to find out.

[ Image ]

According to Pegleg44, you can use custom gradient fine. His method is create a black and white work with the script then use Colors > Map > Gradient Map with your custom gradient.

PS: Since you mentioned it: I added version 5 which allows you to say YES to "Use Custom Gradient" and select a Custom Gradient to use.
Image

_________________
TinT


Top
 Post subject: Re: SVG Stroke with Gradient (with Miter [Sharp Pointy Edges])
PostPosted: Sun Oct 01, 2017 3:55 pm  (#8) 
Offline
GimpChat Member
User avatar

Joined: Jul 04, 2010
Posts: 2253
Location: Retired Moderator Slowly Returning to the Living.
Sweet new script!!
Attachment:
StrokePathGradient.png
StrokePathGradient.png [ 123.2 KiB | Viewed 3270 times ]


Attachments:
StrokePathGradient3D.png
StrokePathGradient3D.png [ 936.55 KiB | Viewed 3270 times ]

_________________
Artists aren't crazy! We're eccentric! ~G.M. Ross

Image

My Sigs = My Photos
Check out my work at http://www.flickr.com/photos/photomastergreg.
Top
 Post subject: Re: SVG Stroke with Gradient (with Miter [Sharp Pointy Edges])
PostPosted: Sun Oct 01, 2017 4:37 pm  (#9) 
Offline
GimpChat Member
User avatar

Joined: Jul 04, 2010
Posts: 2253
Location: Retired Moderator Slowly Returning to the Living.
Trying a little gear.


Attachments:
CoolWovenGear.png
CoolWovenGear.png [ 1.57 MiB | Viewed 3265 times ]

_________________
Artists aren't crazy! We're eccentric! ~G.M. Ross

Image

My Sigs = My Photos
Check out my work at http://www.flickr.com/photos/photomastergreg.
Top
 Post subject: Re: SVG Stroke with Gradient (with Miter [Sharp Pointy Edges])
PostPosted: Mon Oct 02, 2017 11:14 am  (#10) 
Offline
GimpChat Member
User avatar

Joined: May 10, 2013
Posts: 1389
Location: FInland
Wohoo this is awesome plugin, the stroke amount emulation gives lot of possibilities.
Still need Path Blend script as it can create oddly shaped gradients but this can do some of the stuff I used Path Blend for and is faster.
Was about to ask how to increase the maximum width over 100 pixels but found it on line 117.
Thanks again :bigthup


Top
 Post subject: Re: SVG Stroke with Gradient (with Miter [Sharp Pointy Edges])
PostPosted: Wed Oct 04, 2017 2:23 pm  (#11) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
Now version 7 which generates 1 .svg file per run which is an entry in Document History (Recent files).
This .svg can be opened using other programs or imported into GIMP.

Previously the script would generate multiple .svg (one for each time it strokes so) the .svg files are partial data and were removed.

Now you can generate the gradient path and use it in other programs (programs that use .svg files like Inkscape i guess I don't know I don't know too much about Inkscape).

Cheers.

_________________
TinT


Top
 Post subject: Re: SVG Stroke with Gradient (with Miter [Sharp Pointy Edges])
PostPosted: Wed Oct 04, 2017 10:34 pm  (#12) 
Offline
GimpChat Member
User avatar

Joined: May 10, 2013
Posts: 1389
Location: FInland
Thanks man, too busy to play with gimp have to wait till weekend.


Top
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Stroke: how to remove space between test & stroke

3

No new posts Attachment(s) stroke selection/stroke path

2

No new posts Attachment(s) sharp outlines

4

No new posts Attachment(s) GEGL Sharp Bevel - A new classic

2

No new posts Attachment(s) Efficacy of the new Canny edges in G'MIC

11



* Login  



Powered by phpBB3 © phpBB Group