It is currently Thu Oct 30, 2014 2:11 pm


Latest GIMP Scripts & Plug-ins

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 20 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Concentric line tool, is it at all possible?
PostPosted: Thu Jul 07, 2011 1:40 pm  (#1) 
Offline
GimpChat Member
User avatar

Joined: Feb 17, 2011
Posts: 211
I'm wondering how hard it would be to implement a new tool. I assume this exceeds plugin's scope, but I am no expert.

Imagine a tool where you would at first define a point. It could be shown as dot, but it would not be visible in final image. Then you click once in another point. Now, Gimp would begin drawing a line so, that it draws "outward" or "inward" from second point towards or outwards the first point (follow the mouse...). When you have line lenght you want, you click. Now you have line which is concentric with first point but doesn't begin from the first point.

What's the use of this, you might ask. It's very useful in drawing in perspective. For example, click in vanishing point and with two more clicks you have line that "points" to vanishing point but doesn't extend there... Quick and easy.

Now, I know two applications which at least partially implement this (Manga Studio and AZDrawing). The real question is, how would you implement this in Gimp? Plugin? New tool? Something else?

I assume these neat new Cairo vector tools could be used. It could be very elegant solution in drawing phase, rendering would then be normal line drawing or path stroking operation.

Please advise, if this kind of tool is feasible. I can code in C or Python, but Gimp internals are where the real wizardry happens.


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Profile  
 
 Post subject: Re: Concentric line tool, is it at all possible?
PostPosted: Thu Jul 07, 2011 1:44 pm  (#2) 
Offline
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 11495
Location: "Looking for my eraser" =P
Hrmmm... i see 3-D implementation being possible also. YAY!

_________________
Image
____________
OK, . . . . so what's the speed of dark?


Top
 Profile  
 
 Post subject: Re: Concentric line tool, is it at all possible?
PostPosted: Thu Jul 07, 2011 1:50 pm  (#3) 
Online
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 6650
G'MIC's Edges offset with a dot in the middle to start things off. :)


Attachments:
likethis.png
likethis.png [ 26.48 KiB | Viewed 1340 times ]

_________________
Lyle

Psalm 109:8

Image
Top
 Profile  
 
 Post subject: Re: Concentric line tool, is it at all possible?
PostPosted: Thu Jul 07, 2011 1:57 pm  (#4) 
Offline
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 11495
Location: "Looking for my eraser" =P
Cool Lyle! :)

_________________
Image
____________
OK, . . . . so what's the speed of dark?


Top
 Profile  
 
 Post subject: Re: Concentric line tool, is it at all possible?
PostPosted: Thu Jul 07, 2011 2:48 pm  (#5) 
Offline
GimpChat Member
User avatar

Joined: Feb 17, 2011
Posts: 211
Image

Quick mock-up for line drawing, numbers indicate the order of clicks.

Maybe setting first point should be separate so that several concentric lines could use same "vanishing point"?


Top
 Profile  
 
 Post subject: Re: Concentric line tool, is it at all possible?
PostPosted: Thu Jul 07, 2011 4:00 pm  (#6) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1303
Location: not from Guildford after all
kimppi wrote:
The real question is, how would you implement this in Gimp? Plugin? New tool? Something else?

My approach would be to introduce a new constraint mechanism to the existing paint tools which would employ a "topology" channel to restrict the motion of the brush. "Topology channels" would be managed using the existing Channels Dialog and edited as regular channels, though their thumbnail previews would ideally appear as a topological map of the contents of that channel.

For example, if we have the following channel:
Attachment:
channel.png
channel.png [ 19.93 KiB | Viewed 1277 times ]

It might be viewed as the following topological map:
Attachment:
topology.png
topology.png [ 15.09 KiB | Viewed 1277 times ]

If our paint tool had the option, we could specify the channel as a constraint and thus all paint strokes would be "coerced" to follow the direction of the topological lines. In other words, if the channel were considered a height map, painting would be constrained such that going either "uphill" or "downhill" with the brush would be more difficult than staying at the same altitude on the map. The amount of "coercion" should be configurable so that the artist is not forced to follow the lines exactly; in fact, this parameter should be associate-able with pen pressure, velocity, or other available input controls.

Once such a mechanism were in place, problems would be reduced to creating suitable constraint topologies. For example, your vanishing point problem would be represented by the following channel:
Attachment:
vp-topology.png
vp-topology.png [ 55.2 KiB | Viewed 1277 times ]

A new tool might be provided for facilitating the creation of various common topologies, though they can also be generated manually (the above channel was created using the "Conical" option of the Blend Tool).

I am not suggesting that implementing such an approach would be trivial*, however, I do think the user interface would be quite elegant, intuitive, and provide digital images with that artistic, human touch.


* I suspect that calculating the directional gradients around a given point might be computationally intensive and it may be necessary to create a "motion vector" array for the image after selecting a particular topology channel. This would require significant amounts of memory and might in itself take a lot of time (though it shouldn't interfere with the painting itself).

NOTE: The University of Waterloo has done some coding of a similar constraint mechanism for brushes, however, their approach relied upon mathematical formulas to specify the direction of the drawing constraint.

_________________
A man who does not read good books has no advantage over a man who cannot read them. -- Mark Twain


Top
 Profile  
 
 Post subject: Re: Concentric line tool, is it at all possible?
PostPosted: Thu Jul 07, 2011 4:29 pm  (#7) 
Offline
GimpChat Member
User avatar

Joined: Feb 17, 2011
Posts: 211
Hey! VERY low cost workaround could be devised! saulgoode's word "constraint" is the key.

Guides! If we could have sloping or diagonal (not only horizontal or vertical) guides, they could be used for exact measuring or drawing! Are such beasts possible?


Top
 Profile  
 
 Post subject: Re: Concentric line tool, is it at all possible?
PostPosted: Thu Jul 07, 2011 4:35 pm  (#8) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 2422
kimppi wrote:
Image

Quick mock-up for line drawing, numbers indicate the order of clicks.

Maybe setting first point should be separate so that several concentric lines could use same "vanishing point"?


May I suggest the following method:

  • Position guide for the vanishing points
  • Position guides for a few strategic lines (verticals...)
  • then, to draw several segments at once using the path editor:
    • Draw you segments by clicking on outer point, then close to the vanishing point, then drag that point to the vanishing point (clicking on the vanishing point directly won't work for the 2nd and next segments)
    • On each segment, Ctrl-click on inner point to add a path control point. Shift click on the handles to remove them. Shift-click on the segment between inner and vanishing points to remove it.
    • At that point you may want to add a few more guides, then reenter the Path editor on exiting path to suppress a few more segments.
    • Once done stroke the path.
Attachment:
Perspective.png
Perspective.png [ 13.07 KiB | Viewed 1256 times ]


See also attached XCF for implementation details


Attachments:
Perspective.xcf [31.57 KiB]
Downloaded 55 times

_________________
Image
Top
 Profile  
 
 Post subject: Re: Concentric line tool, is it at all possible?
PostPosted: Thu Jul 07, 2011 4:45 pm  (#9) 
Offline
GimpChat Member
User avatar

Joined: Feb 17, 2011
Posts: 211
Holy... ofnuts, that combination of Ctrl-Shift-clicking, I did not even know it existed!

Wow! Only plain vanilla cross guides and normal paths needed for all the functionality I need!

It must be Christmas!

Thanks again all you wonderful gurus!


Top
 Profile  
 
 Post subject: Re: Concentric line tool, is it at all possible?
PostPosted: Thu Jul 07, 2011 5:05 pm  (#10) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 2422
Some more, with two vanishing points:
Attachment:
Perspective2.png
Perspective2.png [ 8.14 KiB | Viewed 1242 times ]


Attachments:
Perspective2.xcf [24.42 KiB]
Downloaded 46 times

_________________
Image
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 20 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

* Login  

* Subscribe to Gimp Chat's RSS Feed    * Subscribe to Gimp Chat's Tutorial Feed    * Subscribe to Gimp Chat's G'MIC Feed


Powered by phpBB3 © phpBB Group