You are here

Draw arrow

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
Rate this item!
Description.png47.5 KB
arrow.scm11.24 KB

Update [11/15/2009] : Added fixed brush width and double headed error, removed bug 1) one-point-paths, 2) horizontal paths
Update [11/16/2009] : Fixed image type restriction string
Update [11/19/2009] : Added feature for absolute wing length, fixed handling gray-scale images
Update [25/01/2010]: Fixed fixed opacity bug (thanks to Richard)

This plugin enables GIMP to draw an arbitrary arrow into an image or a new layer. The plugin has reasonable default values for every paramtere but is freely adjustable to ones needs. Parameters are:

  • wing length and line width freely adjustable (relative & absolute)
  • angle between arrow tail and wing
  • optional draw arrow in new layer
  • optional filled or not filled head
  • optional notch in arrow head
  • optional delete used path
  • optional draw double headed arrow

Create a path (usually <B>) with the head of the arrow (first anchor point) and the end of the tail (second anchor point). Then call the script which adds itself to the "Tools" menu (I use <AltGr+P> as the shortcut as "Pfeil" is the german word for arrow).


  • Write documentation (any one can help me with that and knows how to?)
  • Open for suggestions
  • Enable a more angularly arrow

You can also contact me via ICQ #52712314 and Jabber/XMPP

Code License: 
GIMP Version: 
Scripting Engine: 


Apparently, between the last updates on the script something got changed, because arrow.scm is doing the same thing with me (draws arrow head but no tail).

I have just looked at this again. If I don't have a brush type tool selected I get a 'ragged' arrow. I noticed that I get the same effect if I have a brush type tool selected with the layer mode set to dissolve. I have therefore modified the script so that it temporarily sets the brushes paint mode to Normal.

In total I added 4 extra lines of code. I added the three lines with "; 6.3.2010" in the following section:

(PreviousOpacity 100.0)
(PreviousPaintMode 0) ; 6.3.2010
(set! PreviousOpacity (car (gimp-context-get-opacity)))
(gimp-context-set-opacity 100.0)
(set! PreviousPaintMode (car (gimp-brushes-get-paint-mode))); 6.3.2010
(gimp-brushes-set-paint-mode NORMAL-MODE) ; 6.3.2010

; collect points for arrow-tail and draw them

(aset points 0 inPointToX) (aset points 1 inPointToY)
(aset points 2 inPointFromX) (aset points 3 inPointFromY)

and the line with "; 6.3.2010" in the following section:

(gimp-selection-none image)
(gimp-brushes-set-paint-mode PreviousPaintMode) ; 6.3.2010
(gimp-context-set-opacity PreviousOpacity)

(I will email the whole script to Berengar on Monday when I have his email to hand.)

Hope this helps

Thanks for the code updates, p_c. Arrow.scm is now working properly. :)

This removes a niggle from a script that i find very useful.

I have noticed this morning that the gimp-brushes-set-paint-mode and its companion get function are deprecated and should be replaced by the gimp-context-set-paint-mode and gimp-context-get-paint-mode functions respectively (the script still seems to work in exactly the same way).

I am using the default settings for the script with the foreground colour set to white.

The filled in centres of the arrow-heads always appear to be at 100% opacity.

If the selected tool is the paths tool, the select by colour tool, the rectangular selection tool .... (i.e. a non-drawing tool) then the remainder of the arrow appears at less than 100% opacity.

If the selected tool is the brush, pencil, eraser ... all parts of the arrow appear to be 100% opaque.

Update 22.1.2010
The problem is caused by the context opacity not being set to 100% - what controls the context opacity at the GUI level?

Bug Fixed :-)

Club Mate is healthy sleep in pint bottles

Thank you for this plugin. For me advanced arrow tool was the killer feature of Paint.NET. I hope one day this plugin will be as powerful. Very promising as for something less than 1 month old. :)

The arrow is always straight line and does not really follow the path spline.
The parameter to control thickness is very counter-intuitive. Human readable thickness number (preferably always positive) and better documentation would be nice.

I see that it is a problem to want to offer the possibility to use relative and absolute values at once, I will have to think about a good solution. I should probably add more drop-down boxes that enable the user to decide how he wants his arrows.
I my self stumbled across the length-dependent thickness when I wanted to draw to arrows with different length into my image. Maybe the script should be redone as a plugin...
I will add the drawing of splines and not-one-line-arrows to the todo-list. Are there any more features in Paint.NET that should be included?
Club Mate is healthy sleep in pint bottles

count me in as someone else who wants curvy, spline-hugging arrows. Badly enough, as it is, that I started thinking about how to do it. The hardest part, I think, is how the arrow head should be drawn. I see three ways to do it:
1a: stick to straight lines for the arrow head, and orient it so that the tangent to the arrow body at the arrow tip bisects the arrow head.
1b: stick to straight lines for the arrow head, and orient it so that the arrow body intersects it at the midpoint of the base of the arrow head.
2: use curved lines for the arrow head (basically, by rotating the spline by appropriate angles (and truncating it) and (for the base of the arrow head) moving the rotated spline so it intersects the other 2 forming the arrow head in the appropriate positions.

1a and 1b are reasonably straightforward (maybe more so for 1b, because it doesn't require figuring out that tangent), but will look ugly, or at least weird, if the arrow body is very curvy (in extreme cases, the body may stick out one side of the arrow head. On the flip side, 2 would require more work (maybe significantly so) to create the boundary of the arrowhead, but I think it's worth the effort.

What do you think? Is there something I missed? (Either another way to do it or a pro or con of one or more of 1a, 1b, and 2?)

Hi, great script, works well. I just have one problem, the fact that the arrow head size is always relative to the size of the length of the arrow. I would like to be able to draw a set of arrows of different length, but with the same head size. as it is now if I want to draw a long arrow the head ends up being quite large, at a minimum of 1/5th the size of the arrow length.

A small other thing I don't quite understand how the line thickness in the scrip is related to line thickness of brushes. In a figure I was working on arrow thickness of 2 seemed to correspond to brush size 5-6 pixels.

Cheers, thanks for this.


Subscribe to Comments for "Draw arrow"