It is currently Mon Apr 15, 2024 7:47 am


All times are UTC - 5 hours [ DST ]


Switch to mobile style

Post new topic Reply to topic  [ 30 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: path-in-the-middle? of a closed contour?
PostPosted: Wed Aug 10, 2016 10:16 am  (#21) 
Offline
Administrator
User avatar

Joined: Aug 10, 2012
Posts: 13001
Location: Native to NYC living in Arizona, Gimp 2.8 & 2.10, Win 11 PC.
@ gramp

I agree that a new, or different algorithm/path tool of some type may be what's required.
As it stands, Gimp's path tool can't create open paths from selections.
There may also be a need to have a corresponding selection tool, just for creating open paths using selections.
This also brings to mind, that a selection tool that could create selections, which can be made into open paths.
Wouldn't actually be what is "normally" known as a "selection".

Just a thought...
It would be interesting to be able to use a "paint brush" kind of tool,
which would paint paths as you move it across the canvas.

_________________
Image
"A wise man learns more from a foolish question than a fool can learn from a wise answer"
Image


Top
 Post subject: Re: path-in-the-middle? of a closed contour?
PostPosted: Thu Aug 11, 2016 5:36 pm  (#22) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4734
The problem with a middle-path is that it assumes there is a "middle"... Which is very hard to define for Bezier curves, because
1) Two Bezier curves are rarely very parallel,
2) When you can make them roughly parallel, they have very different anchors and tangents.
3) And you would need a good algorithm to open a closed curve at the right spots to obtain the two curves needed.

PS: instead of reverse-engineering path-csv, you could have read the doc.

_________________
Image


Top
 Post subject: Re: path-in-the-middle? of a closed contour?
PostPosted: Fri Aug 12, 2016 6:01 am  (#23) 
Offline
GimpChat Member
User avatar

Joined: Apr 20, 2011
Posts: 287
Location: Dane-ish Co., West Gonsin
@ofnuts

A long time ago, when I was a student, a very wise professor offered me his observed opinion that there are two types of people in the world: Newtonians, and Edisonians. I can't remember, sadly, how he described each group, but he did not speak disparagingly of either and made sure I understood him to mean the world definitely needs both.

In my several years of teaching, I definitely saw two types (and a third which I simplistically assumed could be classified when more information became available). I came to view them as a group that wants to understand above all and a group that wants to proceed above all. In my case, I feel time running out and I need (need) to get my stuff done: at any given moment, the thing I need to get done, typically, is not even even (rarely) the goal, from which I seem always to be distracted by obstacles. My "approach" is a gamble--maybe I'll find an answer quickly, or maybe my time would have been better spent reading. Yes, I "could" have read your specific documentation, but also, I could have read document after document after document (in fact, did) without learning from words on paper what, precisely, was going to be the effect on the screen. In another sense, I "can't" read any more documentation when the pressure to see something becomes too much.

I meant that as a response to your suggestion that I could have read the documentation.

However, it might also explain our two views of the problem. You conclude it can't be done because there is no middle, but given a crayon, I can draw and make a case for a number of middles. When you read "path", you immediately think of nodes on Bezier curves. When I read it, unschooled, I picture connected pixels. If the problem cannot be addressed well in a Bezier-curves representation, perhaps--I ask myself--another representation might be tried, even an lowly ignorant one, like my stripping out the curvature to see the results. With no experience, I'd never be able to "picture" the result as a Newtonian likely would.

I'll say that I would be thrilled with a "middle" which was the result of shrinking the selection, in a novel way which maintains continuity of the contour, to a 1-pixel wide figure.

Edisonians believe in the Principle that "Even a blind pig finds an acorn once in a while." :^) (In fact, every meeting opens with it.)

With heart-felt thanks for your, scripters', work, a sine qua non
--
David

_________________
--
GraMP
"Once you sit on your glasses, the rest of getting old seems obvious."


Top
 Post subject: Re: path-in-the-middle? of a closed contour?
PostPosted: Fri Aug 12, 2016 8:05 am  (#24) 
Offline
GimpChat Member

Joined: Mar 04, 2011
Posts: 2418
Appologies for a bit off topic, but getting a single path out of Gimp alone will be a task.

A couple of minutes to do this.

Fuzzy select and tidy up a bit to fill with colour. http://imgur.com/ehR5fVx

Export the selection 'skeleton' in a suitable format and run through Autotrace. http://imgur.com/qkDSboh

Import the generated svg path back into Gimp. http://imgur.com/cO4ZRyE

Opacities reduced to show nodes a bit better.
There is a working Autotrace for Windows, recently compiled, somewhere on this forum.

_________________
Image


Top
 Post subject: Re: path-in-the-middle? of a closed contour?
PostPosted: Fri Aug 12, 2016 11:30 am  (#25) 
Offline
Global Moderator
User avatar

Joined: Nov 16, 2011
Posts: 5128
Location: Metro Vancouver, BC
gramp wrote:
@Odinbc

Thank you for that link. I've had a very hard time (I suspect it's my search history) getting links to definitive pages like that. I typically have to wade through reams of consumer links.

I have to ask: is there a similar reference for GIMP? (I don't know, but it will also help to have a pointer
in this thread.)

As I was saying, what's needed is a new way to simplify paths which (identifies and) preserves the general orientation of their strokes.
Read through GIMP Path help, 2.3. Paths Dialog & Glossary.
My old standby Grokking the GIMP, it's for an older version of GIMP but very good at explaining concepts.
3.1.1.4 Bezier Paths
3.3.12 The To Path Function
3.4 The Paths Dialog

Consider starting with Inkscape, tweak with it's XML Editor and importing your results to GIMP.

I found an interesting PDF of GIMP Path author's brainstorming.


Attachments:
File comment: PDF of GIMP Path author's brainstorming.
A-new-path-tool-for-GIMP.zip [1.93 MiB]
Downloaded 83 times

_________________
Image
Gimp 2.8.18, Linux, median user
Gimp Chat Tutorials Index
Spirit Bear (Kermode)
Top
 Post subject: Re: path-in-the-middle? of a closed contour?
PostPosted: Fri Aug 12, 2016 6:52 pm  (#26) 
Offline
GimpChat Member
User avatar

Joined: Apr 20, 2011
Posts: 287
Location: Dane-ish Co., West Gonsin
@Rich2005
You only appear off-topic because the OP went off-topic; you've brought it back to the subject.

I had been down the autotrace route, but ended up with a "path" that was differently sized than the original and had "over-simplified" in the sense of leaving me with a large number of "orphan" nodes.

However, your successful example recommends to me my solution probably lies in the direction of autotrace.

And could GIMP call autotrace for me as you did?

@Odinbc

Wait... there's that part about "reading" again. :mrgreen:

I did read a good bit of the link you provided (looks like ca. 2007 maybe) which I found interesting, and I was impressed with the developers' thought processes (and the fact they saw fit to document them).

Thanks, @TwoYou.

_________________
--
GraMP
"Once you sit on your glasses, the rest of getting old seems obvious."


Top
 Post subject: Re: path-in-the-middle? of a closed contour?
PostPosted: Sat Aug 13, 2016 1:29 pm  (#27) 
Offline
Script Coder
User avatar

Joined: Jul 14, 2010
Posts: 697
There was a post a while back about autotrace:

viewtopic.php?f=4&t=8553&start=10

it appears to still be the best (only) solution, thought as you can see there, even those results are so-so.

-Rob A>

_________________
Image
Fantasy Cartography and Mapping by RobA


Top
 Post subject: Re: path-in-the-middle? of a closed contour?
PostPosted: Sun Aug 14, 2016 9:31 pm  (#28) 
Offline
GimpChat Member
User avatar

Joined: Apr 20, 2011
Posts: 287
Location: Dane-ish Co., West Gonsin
Hi, Rob,

I had seen that thread (and even referred to it earlier: viewtopic.php?f=9&t=14391#p198127 :) ).

Given what autotrace was able to accomplish on that task, I agree it's till the most promising. If its proper use could be determined for the purpose I, and Esper, proposed, I wondered, idly at this point, if autotrace could be called via a GIMP script.

Thank you.
--
David

_________________
--
GraMP
"Once you sit on your glasses, the rest of getting old seems obvious."


Top
 Post subject: Re: path-in-the-middle? of a closed contour?
PostPosted: Sat Aug 20, 2016 7:52 am  (#29) 
Offline
Script Coder
User avatar

Joined: Jul 14, 2010
Posts: 697
gramp wrote:
I and Esper, proposed, I wondered, idly at this point, if autotrace could be called via a GIMP script.


I'm not familiar with the options of autotrace. A small modification to something like shellout (to bring back a svg rather than a png) or a while python front-end like MareroQ wrote for Reshade viewtopic.php?f=9&t=14308 is certainly doable.

-Rob A>

_________________
Image
Fantasy Cartography and Mapping by RobA


Top
 Post subject: Re: path-in-the-middle? of a closed contour?
PostPosted: Sat Aug 20, 2016 8:19 am  (#30) 
Offline
GimpChat Member
User avatar

Joined: Apr 20, 2011
Posts: 287
Location: Dane-ish Co., West Gonsin
@RobA

I'm no autotrace virtuoso: on the contrary, I picked it up and tried to hammer my nail with it, giving it all the consideration that Mr. Toad ever did on any of his wild adventures (with deference to the author).

Autotrace does seem to have a powerful daunt of options...

[However, simply googling "autotrace find centerline" to find the options list upturned a host of new possibilities for learning more.]

_________________
--
GraMP
"Once you sit on your glasses, the rest of getting old seems obvious."


Top
Post new topic Reply to topic  [ 30 posts ]  Go to page Previous  1, 2

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Find and fill paths if closed, convert closed paths to transparent

1

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) Path copy rotate shift plus + Path copy rotate shift walk Play

79

No new posts Attachment(s) Path

9

No new posts Attachment(s) Path animations

4



* Login  



Powered by phpBB3 © phpBB Group