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 703468 - Brush from Clipboard: Imperfections painting with some dynamics
Brush from Clipboard: Imperfections painting with some dynamics
Status: RESOLVED OBSOLETE
Product: GIMP
Classification: Other
Component: Tools
2.8.6
Other All
: Normal minor
: ---
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2013-07-02 14:40 UTC by YAFU
Modified: 2018-05-24 13:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
forcy_dynamics_artefacts (7.64 KB, image/png)
2013-07-02 15:41 UTC, Przemysław Gołąb (n-pigeon)
  Details
Clipboard brush with and without transparent edges (49.10 KB, image/jpeg)
2013-07-03 11:56 UTC, strata_ranger
  Details
Only occurs with different colors along opposing edges of tbe brush. (25.72 KB, image/jpeg)
2013-07-03 12:03 UTC, strata_ranger
  Details
proposed patch (2.11 KB, patch)
2013-07-05 06:32 UTC, Massimo
rejected Details | Review

Description YAFU 2013-07-02 14:40:48 UTC
In this example:
http://nsae01.casimages.net/img/2013/07/01/130701034929273527.png

I used the colored brush from clipboard that you can see in the image to paint, and Paintbrush tool with brush "Spacing=1". The problem is noticeable when is used a colored brush from clipboard. The imperfections that can be seen are the blue lines on the red strip, and the red lines on the blue strip.
The problem occurs with Dynamics Off and some other dynamics.
I am using GIMP 2.8.6 on Kubuntu Linux 64 bits.
Comment 1 Przemysław Gołąb (n-pigeon) 2013-07-02 15:41:44 UTC
Created attachment 248242 [details]
forcy_dynamics_artefacts
Comment 2 Przemysław Gołąb (n-pigeon) 2013-07-02 15:42:37 UTC
Confirmed.

Notes: It seem that turning on any type of Angle dynamics fixes problem but then Force dynamics introduce artefacts. [Attachment]
Comment 3 strata_ranger 2013-07-03 11:56:36 UTC
Created attachment 248304 [details]
Clipboard brush with and without transparent edges

Some interesting information to add:

- If the clipboard brush contains transparent pixels around its edge, the behavior is correct.
- The bug only occurs if the clipboard brush contains different colors on opposing sides.  (In the original example note it only occurs along the top and bottom edges; in this example it occurs along all four sides.)
Comment 4 strata_ranger 2013-07-03 12:03:10 UTC
Created attachment 248305 [details]
Only occurs with different colors along opposing edges of tbe brush.

With this brush, note there are no problems with the blue, only the red/green and yellow/magenta portions of the edges experience any problems.
Comment 5 Massimo 2013-07-05 06:32:37 UTC
Created attachment 248431 [details] [review]
proposed patch

A patch to force the external edges of the clipboard image
to be transparent. With angle dynamics it works better than
enlarging the image. 

Please test.
Comment 6 Michael Natterer 2013-07-05 08:27:39 UTC
I still don't quite get *why* this is happening. That a 1px transparent
border will fix it seems quite obvious.
Comment 7 Michael Schumacher 2013-07-05 08:52:48 UTC
Off-by-one / Lookup issues that wrap around?

I'm pretty sure this happens with same colors and transparent parts as well, and just isn't noticeable (anyone tried transparent edges with different colors for different edges?).
Comment 8 Michael Natterer 2013-07-05 10:03:12 UTC
Yes but I don't see it in the code :)
Comment 10 Michael Natterer 2013-07-05 12:25:16 UTC
Indeed. And it's apparently not limited to clipboard brushes. I suggest
we fix the bug here.
Comment 11 Michael Natterer 2013-08-11 23:07:18 UTC
When looking at bug 166622, it seems like the "weird code" that is
causing this was actually supposed to fix it.
Comment 12 Massimo 2013-08-12 17:55:10 UTC
I'm observing artifacts with an odd size brush (23x93) and (25x95),
so the "weird code" is not relevant.

BTW, it is possible to write it more succintly like this:

  ulx = ROUND (coords->x - 0.5 * pixmap_mask->width);
  uly = ROUND (coords->y - 0.5 * pixmap_mask->height);

which is no longer weird.

if ROUND(a) was defined as 'floor (a + 0.5)' it would be identical

in gimp ROUND is ((int) ((x) + 0.5)) 
and so it is identical only for positive values of

  coords->x - 0.5 * pixmap_mask->width
Comment 13 Alexandre Prokoudine 2014-11-13 01:23:36 UTC
Did we forget to push this fix, or is it incomplete?
Comment 14 Massimo 2014-11-13 08:08:18 UTC
(In reply to comment #13)
> Did we forget to push this fix, or is it incomplete?

It was rejected in comment #10 where mitch volounteered to
fix the general bug.

My thought was that brushes are designed and if designing
them with a surrounding transparent rectangle make them
work better it is a once fix, OTOH clipboard brushes must
be fixed on the fly and so makes sense to special case them.

The general problem is that if you want hard edges then even
sized brushes should have their center mapped to the corner of
a pixel whereas odd brushes should have the center mapped to
the center of a pixel. Conciliate this two cases preserving
hard edges would make the code a little more complex.

I'm not volounteering.
Comment 15 Michael Natterer 2014-11-13 09:59:11 UTC
I did do something about this, will have to dig in my stashes...
Comment 16 Michael Schumacher 2016-05-28 22:26:09 UTC
mitch, any chance you cam across that in your stashes?
Comment 17 Michael Schumacher 2017-02-14 13:08:26 UTC
Mitch?
Comment 18 Michael Schumacher 2017-02-19 14:16:45 UTC
Comment on attachment 248431 [details] [review]
proposed patch

see comment #14
Comment 19 GNOME Infrastructure Team 2018-05-24 13:45:15 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gimp/issues/480.