GnuTux wrote:
Stroking the path does what stroking the selection with a paint brush is supposed to do, but doesn't.
When GIMP paints colors onto a layer, it does so with sub-pixel accuracy (unless the Pencil is used). What this means is that if you specify coordinates with fractional components, GIMP shades the neighboring (integral) pixels by proportional amounts of the specified color as shown in the following diagrams:
Attachment:
sub-pixel-paint.png [ 8.91 KiB | Viewed 2132 times ]
Unless you are zoomed into the image to see those discrete pixels, your eyes will interpolate the amount of color in each of the neighboring pixels and the end result is that you perceive the full color as appearing proportionally at a single point "between" the pixels. I'm sure you are aware of all this, but it is necessary background for explaining the difference between stroking a selection and stroking a path.
When GIMP strokes a selection, what it actually is stroking is the "marching ants" outline of the selection (what some other image editors call a "marquee"). These marching ants run along the pixels where the selection transitions from below 50% to above 50% and, being the actual coordinates of the pixel, they are always integer values with no fractional components (zoom in to an elliptical selection and note the "stair-stepping" of the marching ants). While a brush stroke from one point on the marching ants to the next may include interpolated points containing fractional components, the end points of that stroke will always fall exactly on a pixel with integer coordinates (because they are on the marching ants).
When stroking a path, there is no restriction of the points on the path being integer values (zoom in while an elliptical path is shown and you will see that it does not follow the shape of the pixels like the marching ants do). This is why stroking a path renders the shape more accurately than stroking a selection, because the painting of the strokes is done with sub-pixel accuracy of all points along the stroke.