It is currently Wed Apr 24, 2024 7:44 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 153 posts ]  Go to page 1, 2, 3, 4, 5 ... 8  Next
Author Message
 Post subject: Path Blend Script
PostPosted: Fri Apr 13, 2012 2:17 pm  (#1) 
Offline
Script Coder
User avatar

Joined: Jul 14, 2010
Posts: 697
A question was asked on whether my selection blend script could be made to blend arbitrarily... The answer was no, but this new script goes where no one has gone before in terms of sheer slow performance, mind-numbing lack of feedback, and moderately interesting results.

Get it here: http://silent9.com/incoming/sc ... _blend.scm

It registers under Filters->Render->Path Blend.

You have to select two paths (they must be different, and the script only looks at the first segment of compound paths) and one gradient. The script finds the shorter path, and walks it 1px at a time, and creates a selection between that and the correspond point of the longer path.

A variety of results:
Attachment:
pathblend.jpg
pathblend.jpg [ 80.5 KiB | Viewed 7771 times ]


Upper left: Full saturation gradient between a path and an enlarged duplicate of itself.
Upper Right: Some terrain gradient between two random path squiggles
Lower Left: A transparent gradient ("Neon Cyan") between two random path squigles
Lower Right: A partially transparent gradient ("Flare Radial 101") between overlapping paths.

The interesting effects come with transparent or partially transparent gradients. Here is an example with one called (appropriately) "Red Tube (which took a good 5 minutes to run on my machine):
Attachment:
retdtube.jpg
retdtube.jpg [ 32.77 KiB | Viewed 7771 times ]


Have fun (and patience!)

-Rob A>

_________________
Image
Fantasy Cartography and Mapping by RobA


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: Path Blend Script
PostPosted: Fri Apr 13, 2012 2:26 pm  (#2) 
Offline
Global Moderator
User avatar

Joined: Apr 07, 2010
Posts: 14182
wow, that one I am going to grab, patience might be the stickler. :teeth

Thanks Rob

_________________
Image


Top
 Post subject: Re: Path Blend Script
PostPosted: Fri Apr 13, 2012 3:06 pm  (#3) 
Offline
Script Coder
User avatar

Joined: Jul 14, 2010
Posts: 697
Another quick example using a spiral path imported from inkscape that was rotated and scaled to make the second path... then added a quick drop shadow...

Attachment:
spiral.jpg
spiral.jpg [ 47.24 KiB | Viewed 7747 times ]


-Rob A>

_________________
Image
Fantasy Cartography and Mapping by RobA


Top
 Post subject: Re: Path Blend Script
PostPosted: Fri Apr 13, 2012 4:11 pm  (#4) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4739
RobA wrote:
A question was asked on whether my selection blend script could be made to blend arbitrarily... The answer was no, but this new script goes where no one has gone before in terms of sheer slow performance, mind-numbing lack of feedback, and moderately interesting results.

Indeed. WrapMap is dwarfed :).
RobA wrote:
You have to select two paths (they must be different, and the script only looks at the first segment of compound paths) and one gradient. The script finds the shorter path, and walks it 1px at a time, and creates a selection between that and the correspond point of the longer path.
Quote:
Gives nice and surprising clean results... But when the paths are of very different lengths there is a "scale" effect in some cases:


Attachments:
Reflection-Blue.ggr [252 Bytes]
Downloaded 295 times
PathBlendScaleEffect.xcf [429.85 KiB]
Downloaded 317 times

_________________
Image
Top
 Post subject: Re: Path Blend Script
PostPosted: Fri Apr 13, 2012 5:26 pm  (#5) 
Offline
GimpChat Member
User avatar

Joined: Feb 14, 2012
Posts: 426
This script is Great! Aspesially since I can make very accurate blends using the sample along a path script to use with it. I'm going to try and blend two paths on one side of an O ring and two on the other.

Better than Illustrator blends.

Nice script RobA!

Alan


Top
 Post subject: Re: Path Blend Script
PostPosted: Fri Apr 13, 2012 9:21 pm  (#6) 
Offline
GimpChat Member
User avatar

Joined: Feb 14, 2012
Posts: 426
I have always wanted to be able to do this.

Image

I made this with two paths blended with a straight FG to BG color and then used the curves on the blend to make it ridged in the middle. Then I got the taper by drawing with the airbrush tool set to use color from gradient and a layer mask around it on its own layer. I set the masked blend layer mode to screen to taper the blend layer below it. If the point was black then it would be raised all the way up in the 3D preview. Dark pixels are high and light ones low when working with these height maps.

It felt like Christmas when I saw the details of this script. I will definetely use it a lot.

In 3D software it would take some know how to do this usign rails etc.

Alan


Top
 Post subject: Re: Path Blend Script
PostPosted: Sat Apr 14, 2012 4:49 am  (#7) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
Very nice Rob thanks! :)

_________________
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: Path Blend Script
PostPosted: Sat Apr 14, 2012 2:38 pm  (#8) 
Offline
Script Coder
User avatar

Joined: Jul 14, 2010
Posts: 697
ofnuts wrote:
Gives nice and surprising clean results... But when the paths are of very different lengths there is a "scale" effect in some cases:


I was lazy :oops:

But you made me pull out the maths:
Attachment:
IMG_2854.JPG
IMG_2854.JPG [ 463.45 KiB | Viewed 7671 times ]


So I could have it calculate the point along a line closest to another point - i.e. the perpendicular intersect. I'm sure there are fancier ways to do this, but mine worked so I've left it :geek

Here is your sample:
Attachment:
PathBlendScaleEffectfixed.jpg
PathBlendScaleEffectfixed.jpg [ 10.51 KiB | Viewed 7673 times ]


Of course, each blend section is the length of the ratio of the two lines, so if they get an order of magnitude or more different you can see the flats in the blended segments.

The linked file has been updated - you may need to refresh your browser to get the latest one.

-Rob A>

_________________
Image
Fantasy Cartography and Mapping by RobA


Top
 Post subject: Re: Path Blend Script
PostPosted: Sat Apr 14, 2012 3:00 pm  (#9) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4739
Looks perfect now

_________________
Image


Top
 Post subject: Re: Path Blend Script
PostPosted: Sat Apr 14, 2012 6:02 pm  (#10) 
Offline
Script Coder
User avatar

Joined: Jul 14, 2010
Posts: 697
Another small update:

-Reversing the path selection reverses the direction of the blend.
-I've exposed the overlap parameter as a slider, as this might be useful to adjust when dealing with transparent gradients to minimize banding effects.

-Rob A>

_________________
Image
Fantasy Cartography and Mapping by RobA


Top
 Post subject: Re: Path Blend Script
PostPosted: Sat Apr 14, 2012 6:22 pm  (#11) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12517
RobA wrote:
ofnuts wrote:
Gives nice and surprising clean results... But when the paths are of very different lengths there is a "scale" effect in some cases:


I was lazy :oops:

But you made me pull out the maths:
Attachment:
IMG_2854.JPG


So I could have it calculate the point along a line closest to another point - i.e. the perpendicular intersect. I'm sure there are fancier ways to do this, but mine worked so I've left it :geek

Here is your sample:
Attachment:
PathBlendScaleEffectfixed.jpg


Of course, each blend section is the length of the ratio of the two lines, so if they get an order of magnitude or more different you can see the flats in the blended segments.

The linked file has been updated - you may need to refresh your browser to get the latest one.

-Rob A>


It's been way too long since I've seen math like this and believe it or not, I enjoyed doing it in the day, but now, I'm happy to say it's all but a dream to me now. lol

Glad you shared that though Rob; brought back a lot of memories. :)

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: Path Blend Script
PostPosted: Sat Apr 14, 2012 7:50 pm  (#12) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12517
2nd try (not showing first) using your Script-fu Rob. The only issue I see in the scan like lines at only one point in the render; happened with the other render too with a different gradient). Not sure why it is; it might have something to do with GIMP 2.8 rc1 64-bit, but not sure. For this one, it's just one circular selection turned into path and a smaller one doing the same. :)


Attachments:
bigsmall.png
bigsmall.png [ 320.1 KiB | Viewed 1492 times ]

_________________
Lyle

Psalm 109:8

Image
Top
 Post subject: Re: Path Blend Script
PostPosted: Sat Apr 14, 2012 8:32 pm  (#13) 
Offline
Script Coder
User avatar

Joined: Jul 14, 2010
Posts: 697
lylejk wrote:
2nd try (not showing first) using your Script-fu Rob. The only issue I see in the scan like lines at only one point in the render; happened with the other render too with a different gradient). Not sure why it is; it might have something to do with GIMP 2.8 rc1 64-bit, but not sure. For this one, it's just one circular selection turned into path and a smaller one doing the same. :)


Mainly because turning a circular selection into a path makes a bad circular path ;)

Here is the same thing using two circular paths from inkscape:
Attachment:
ring.png
ring.png [ 109.24 KiB | Viewed 1489 times ]


There is still a seam at the join however - it is an artifact from making two selection butted up against each other having the same end points. You see the background bleeding through the join. It is reduced if the start/end of the paths are not horizontal or vertical to each other (different gradient, btw):
Attachment:
ring_rot.png
ring_rot.png [ 99.15 KiB | Viewed 1489 times ]


-Rob A>

_________________
Image
Fantasy Cartography and Mapping by RobA


Top
 Post subject: Re: Path Blend Script
PostPosted: Sat Apr 14, 2012 8:40 pm  (#14) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12517
That's cool Rob; thanks for the explanation; not hard to clean of course, but just curious to know. :)

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: Path Blend Script
PostPosted: Sat Apr 14, 2012 10:22 pm  (#15) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12517
Might as well do something with the ring I made earlier. Erisian might like this one. ;)

Created a seamless interlinked texture and used Droste for the result. :)


Attachments:
interlink.png
interlink.png [ 551.39 KiB | Viewed 1485 times ]
somethingwithit.png
somethingwithit.png [ 1.52 MiB | Viewed 1485 times ]

_________________
Lyle

Psalm 109:8

Image
Top
 Post subject: Re: Path Blend Script
PostPosted: Sun Apr 15, 2012 12:57 pm  (#16) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 5242
Location: Gimpville
Very nice results with this script! :bigthup

_________________
“If you reach for the stars, you just might land on a decently sized hill.” - Stuart Hill


Top
 Post subject: Re: Path Blend Script
PostPosted: Sun Apr 15, 2012 5:37 pm  (#17) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
Thanks for the updated script Rob. As always nice results. :)

_________________
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: Path Blend Script
PostPosted: Sun Apr 15, 2012 6:05 pm  (#18) 
Offline
GimpChat Member
User avatar

Joined: Nov 09, 2011
Posts: 726
Wow! I think this may be useful to draw ribbons:
viewtopic.php?f=8&t=3089&start=0

I'll keep trying because I can not find how to use this script :oops:

_________________
Image
Be patient, English is not my language.


Top
 Post subject: Re: Path Blend Script
PostPosted: Wed Apr 18, 2012 9:37 am  (#19) 
Offline
Script Coder
User avatar

Joined: Jul 14, 2010
Posts: 697
Fun stuff using scaled copies of paths:
Attachment:
boom.jpg
boom.jpg [ 30.81 KiB | Viewed 1438 times ]


.... And one more update to the script (same download location)...

It now will support paths with multiple segments, so long as the two paths have the same number of segments. This works particularly well with transparent gradients. Here I turned text to a path and then copies, scaled and translated the path to get a second version to blend to:
Attachment:
multi-stroke-path-blend-example.jpg
multi-stroke-path-blend-example.jpg [ 17.22 KiB | Viewed 1438 times ]


-Rob A>

_________________
Image
Fantasy Cartography and Mapping by RobA


Top
 Post subject: Re: Path Blend Script
PostPosted: Wed Apr 18, 2012 10:07 am  (#20) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12517
That result looks cool Rob. :)

_________________
Lyle

Psalm 109:8

Image


Top
Post new topic Reply to topic  [ 153 posts ]  Go to page 1, 2, 3, 4, 5 ... 8  Next

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) i struggle with the option to copy the path - the path where a file i

3

No new posts Attachment(s) BLEND - GRADIENT TOOL

17

No new posts Attachment(s) New GEGL Extrusion filter - USE THE BEHIND BLEND MODE!

18

No new posts Attachment(s) Is there anyway to add blend modes inbetween operations in Bimp?

2

No new posts Attachment(s) How to reproduce Gimp's levels using blend modes of color fills

0



* Login  



Powered by phpBB3 © phpBB Group