RSS/Atom feed Twitter
Site is read-only, email is disabled

Paths, selections, and stroking

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

2 of 2 messages available
Toggle history

Please log in to manage your subscriptions.

Paths, selections, and stroking Dov Grobgeld 11 May 09:14
  Paths, selections, and stroking Simon Budig 11 May 13:01
Dov Grobgeld
2018-05-11 09:14:10 UTC (over 6 years ago)

Paths, selections, and stroking

Hi all,

There is one issue with gimp that has been bothering me for several years, and that is that stroking selections usually generate non-equally thick lines. To see an extreme example of this do the following:

- Create a 64×64 image - Make an elliptical selection in the middle of the image of radius 16. - Stroke with line width 10

The result looks as follows (the result is not antialiased, even though I chose anti aliased stroking).

[image: circle.png] What I wanted was this (generated with inkscape):

[image: circle-inkscape.png] My guess is that this happens is that the original ellipse is first reduced from a contour to a bitmap "selection", and then the edges of this bitmap is somehow traced.

On the other hand the result may be improved by instead of stroking the selection, you convert the selection to a "path" and then stroke the path. This approach is practically identical to the Inkscape result: [image: stroke-path.png]
But why are these different? What use then is stroke selection? Shouldn't stroke selection use the same algorithm?

Simon Budig
2018-05-11 13:01:48 UTC (over 6 years ago)

Paths, selections, and stroking

Dov Grobgeld (dov.grobgeld@gmail.com) wrote:

My guess is that this happens is that the original ellipse is first reduced from a contour to a bitmap "selection", and then the edges of this bitmap is somehow traced.

On the other hand the result may be improved by instead of stroking the selection, you convert the selection to a "path" and then stroke the path. This approach is practically identical to the Inkscape result: [image: stroke-path.png]
But why are these different? What use then is stroke selection? Shouldn't stroke selection use the same algorithm?

You're right: Stroking a selection means, that the stroke follows the "marching ants" exactly, which means that there are a lot of 90° turns, which are executed according to the line-join property. Especially with the "miter" join style this leads to a pretty significant change in the perceived stroke width. It is slightly better with the "round" join style.

I've tried ages ago to address this problem, but it turns out it really is hard. There is some discussionn of this problem in https://bugzilla.gnome.org/show_bug.cgi?id=50730

I hope this helps, Simon

simon@budig.de              http://simon.budig.de/