After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 69773 - drawing slim lines with a 1x1 brush has issues
drawing slim lines with a 1x1 brush has issues
Status: VERIFIED FIXED
Product: GIMP
Classification: Other
Component: Tools
1.x
Other All
: Normal enhancement
: 1.2
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks: 50730
 
 
Reported: 2002-01-26 23:54 UTC by Jakub Steiner
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
Proposed fix relative to 1.3.x cvs tree (6.21 KB, patch)
2002-06-11 00:53 UTC, Henning Makholm
none Details | Review
I see the problem. What about this version (which reverts to the usual algorithm for larger brush spacings), then? (10.95 KB, patch)
2002-06-12 15:40 UTC, Henning Makholm
none Details | Review
FWIW, here's a backport to 1.2.4-pre1 (11.15 KB, patch)
2002-06-21 19:19 UTC, Henning Makholm
none Details | Review

Description Jakub Steiner 2002-01-26 23:54:09 UTC
I hope to describe the IMHO wrong way GIMP draws lines with a brush. It's
not obvious, so I have mockups too.

take a default 1x1 picel brush, default spacing set to 25. Draw a straight
diagonal line with the pencil tool. Notice the stairs. On each pixel row,
there's one extra pixel that makes the line appear thicker. With
anti-aliased lines, the result is not so obvious, but you can see the final
diagonal lines appear thicker than perfect horizontals or verticals. Please
look at the following image to see what I am talking about.

http://jimmac.musichall.cz/stuff/brushes.png

I have experimented with the spacing value to get rid of the artefact. With
the pencil tool, it is possible to get quite good results with setting of 
80. However each angle requires a different setting for the line to be
perfect. See

http://jimmac.musichall.cz/stuff/perfect-brush.png

The problem with higher settings is that although they work fine for, say,
60 degrees or so, there are gaps introduced for 0 or 90 degrees.
Antialiased lines are even worse in this respect.

I have fired up Photoshop to see how things are done there. Photoshop (5.5
trial I tried) was making perfect thin lines with a default 1x1 brush. The
important thing is that setting the spacing value to a lower value did not
make the lines thicker as it does in GIMP. 

I consider making thin lines important. One can draw thinner lines either
by setting the opacity of the brush to lower value and drawing the same
line over and over or by doing it pixel by pixel. Having an alternative way
of rendering lines would be of a great help though. Can I beg and cry in a
bug report? ;) It'll make me make better icons dudes =)
Comment 1 Henning Makholm 2002-06-11 00:53:36 UTC
Created attachment 9122 [details] [review]
Proposed fix relative to 1.3.x cvs tree
Comment 2 Sven Neumann 2002-06-11 07:23:24 UTC
I like the effect of this patch but I think I've also found a problem.
The rounding introduces artefacts for certain spacing values. Try the
Paintbrush with the Circle Fuzzy 3x3 brush and set the spacing to 39
pixels. Now draw a straight line. You'll notice that the rounding
introduces gaps in the drawn line at regular intervals.
Comment 3 Henning Makholm 2002-06-12 15:40:16 UTC
Created attachment 9172 [details] [review]
I see the problem. What about this version (which reverts to the usual algorithm for larger brush spacings), then?
Comment 4 Sven Neumann 2002-06-13 12:19:08 UTC
Looks good. I've slightly reformatted your change so it conforms to the
GIMP coding style and committed it to the HEAD branch. Very nice work!

I don't think we want to backport this change to 1.2 so we should
probably close the bug-report as FIXED ?!
Comment 5 Raphaël Quinet 2002-06-13 12:37:35 UTC
It would be nice to backport it to 1.2.x, though.  It will be a while
before 1.4 is ready and many artists working on icons and other small
images would probably appreciate having this bug fixed in 1.2 because
this is the version that they will use until 1.4 is out.

Although the data structures are different, the structure of the code
in 1.2 and 1.3 is still similar.  Backporting the patch should not be
too hard.  Do you want me to give it a try?
Comment 6 Henning Makholm 2002-06-21 19:19:44 UTC
Created attachment 9382 [details] [review]
FWIW, here's a backport to 1.2.4-pre1
Comment 7 Dave Neary 2003-05-20 16:12:32 UTC
For the record, is this bug CLOSEDable?

Dave.
Comment 8 Henning Makholm 2003-05-20 17:13:53 UTC
The bug has been fixed in the head branch, but apparently a consensus was never reached about whether it ought to be backported to 1.2. There's a backported patch sitting in Bugzilla but it has not been applied to the gimp-1-2 branch of cvs.
Comment 9 Sven Neumann 2003-05-20 17:56:24 UTC
I still think we should not apply it and close the report as FIXED.
But I could be persuaded to accept it although I don't believe in 1.2.5.
Comment 10 Dave Neary 2003-05-20 18:40:04 UTC
Of course you don't believe in it, it doesn't exist :)

Personally I think there will be a 1.2.5 before we get pre-releases
for the current 1.3 series going. I'd definitely like to see a stable
release around the end of June or start of July if we get bug fixes in
the branch.

In any case, I think this change is clean enough to go in stable, and
would be in favour of having it merged early (like, now) rather than
later.

Setting a 1.2.5 target milestone, I will merge the fix and close the
bug as FIXED.

Cheers,
Dave.
Comment 11 Dave Neary 2003-05-22 09:21:15 UTC
Would someone else mind merging this? It doesn't look like I will get
any computer time to do so before we will be shipping 1.2.5

Cheers,
Dave.
Comment 12 Raphaël Quinet 2003-05-23 21:01:01 UTC
The patch against 1.2.4-pre1 worked without problems with 1.2.4.  The
thin lines look much better now.  Closing this bug.

2003-05-23  Raphael Quinet  <quinet@gamers.org>

        * app/paint_core.[ch]: applied a patch (backported from HEAD) from
        Henning Makholm <henning@makholm.net> that vastly improves the
        drawing of thin lines.  Fixes bug #69773.
Comment 13 Raphaël Quinet 2003-06-20 17:27:46 UTC
The fix is part of the stable release 1.2.5.  Closing this bug.