# Re: [Gimp-developer] Thin lines

```Hi,

Henning Makholm <[EMAIL PROTECTED]> writes:```
```
> I hereby offer my programming skills to the task.

great. You have the job.

> In greater detail: I understand that the Gimp draws lines by stamping
> the brush image at equidistant places along the line. The problem with
> thin lines is that those equidistant places are computed in floating
> point without any particular attention to pixel boundaries. This gives
> ugly lines when the brush is only one or a few pixels across, no
> matter (but in different ways) whether the pixel stamps are
> anti-aliased or not.

right.

> As long as we're only drawing straight lines with an 1x1 brush and
> spacing 1.0, the solution is clear: just adjust the positions of the
> brush centers along the abstract line such that they all have
> integral-plus-one-half x coordinates if the slope is horizontalish,
> and integral-plus-one-half y coordinates if the slope is verticalish.
>
> The challenge is to let this scale to (a) larger spacing, bigger
> brushes, and (b) stroking of cubic spline paths.
>
> Regarding (b), the "obvious" idea is to divide the spline into
> segments according to the octant of tangent. However, it becomes
> difficult to find a simple way to make two segments with different
> orientations always meet seamlessly in case of a 1x1 brush with
> antialiasing. Instead I propose another solution: compute all points
> along the spline where *either* the x coordinate *or* the y coordinate
> has fractional part equal to 1/2 - then select a suitable subset of
> these points to draw, according to the brush spacing (see below).
>
> These "extra" brush positions will be invisible if all points are
> painted with a 1x1 brush - if the paint from neighbouring brush
> positions is combined by "maximum" rather than "addition", the "extra"
> brush stamps will always have lower intensity than their "ordinary"
> neighbours combined. This holds for the pencil as well as for the
> brush, as long as the spline is locally approximated by a line. But
> the admission of "extra" positions means that there will be no
> discontinuity when the spline's tangent passes from one octant to
> another.
>
> Brush spacing now becomes a matter of choosing among the candidate
> points (defined as those where one or both coordinates is n+1/2)
> such that the (euclidean) distance between successive actiual painting
> operations is at least <spacing>.
>
>
> So, do you think this is worth wasting time on? If so, what is the
> protocol for "outsider"s contributing to the Gimp - does one just post
> patches to this list, or must I find a sponsor with commit priveleges,
> or what?

line drawing is definitely worth to improve. We would like to see this
development take place in the 1.3 tree. The prefered protocol for
contributions is to use Bugzilla (http://bugzilla.gnome.org/). You
open a bug-report (marked as enhancement probably) and attach your
patches to it. This way the patch isn't lost even if none of the core
developers finds the time to apply it immidiately. Bugzilla also
allows us to comment on the patches and keeps everything together in
one place. Patches should preferably be generated against the CVS tree
but the latest tarball should also do fine. You can also get CVS write
access but we prefer to see a couple of patches first.

Salut, Sven
_______________________________________________
Gimp-developer mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer
```