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 344684 - Greyscale (no alpha) clipboard brushes are of the wrong type.
Greyscale (no alpha) clipboard brushes are of the wrong type.
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: General
git master
Other All
: Normal normal
: 2.10
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2006-06-12 18:06 UTC by david gowers
Modified: 2018-01-02 22:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Shape of Clipboard Mask is different of original shape selection (180.54 KB, image/png)
2017-05-02 19:40 UTC, jose americo gobbo
Details
Comparison between different origins of clipboard masks in the three kind layers (29.82 KB, image/x-xcf)
2017-05-08 19:59 UTC, jose americo gobbo
Details
Schema to test the issue via .xcf file and a short movie showing the behavior of two clipboard options. (12.45 KB, image/x-xcf)
2017-05-13 19:24 UTC, jose americo gobbo
Details
Test with clipboard image versus clipboard mask and issue around changes of the gray balance. (25.05 KB, image/png)
2017-05-14 15:21 UTC, jose americo gobbo
Details
Shapes of Clipboard Mask with different methods to build them... (28.42 KB, image/png)
2017-05-21 22:38 UTC, jose americo gobbo
Details
Test with clipboard image versus clipboard mask and issue around changes of the gray balance. (117.11 KB, image/x-xcf)
2017-05-30 15:01 UTC, jose americo gobbo
Details

Description david gowers 2006-06-12 18:06:34 UTC
GRAY clipboard brushes draw like pixmap brushes instead of just being a mask for where to place FGcolor, like normal GRAY brushes are.

Actually, GRAYA being interpreted literally doesn't make much sense to me either.. I thought the logical behaviour there would be to multiply the pixel data by the mask data and then consider the whole thing a mask.
Hmm.
Comment 1 Michael Natterer 2006-06-14 08:37:51 UTC
Actually this was intentional, so you can grab a piece of the image
to draw with, just as with the clone tool. I don't see why it would
work different for RGB and GRAY sources.
Comment 2 david gowers 2006-06-14 12:16:06 UTC
I thought 'paste to new brush' interpreted GRAY as a mask, but apparently not.
(actually, it was the script-fu 'selection to.. brush' script that did this.. because it had knowledge whether the source image had an alpha channel or not.)

Aaargh. I can see how the current behaviour could be useful, but personally it just gets in my way. I've drawn with clipbrushed pixmaps about 4 times vs 40 masked (using the trick of enabling pressure sensitivity to color and setting FG and BG to the same color) so far.

What do you think of the idea of a 'Treat clipbrush as mask' toggle? Probably as an action that could be shortcutted.. I don't see anywhere such a thing could go in the menus. That could just swap two pointers' values (a field in the ClipBrush struct that begins as NULL(or whatever will indicate 'no pixmap data for this brush'), and the actual clipbrush's pixmap pointer.), could it?. I hope you agree, then I would code that, change the summary, and hope the patch gets committed by 2.4.
Comment 3 Michael Schumacher 2009-04-24 08:47:44 UTC
It would be nice if all brushes could be either used as pixmaps or masks. 

Until then, it is probably an easy solution to create both a pixmap clipboard brush and a mask clipboard brush when copying something.
Comment 4 Michael Natterer 2011-03-18 11:00:11 UTC
That sounds like a pretty obvious solution, UI wise, and quick and easy
to implement. Let's run it through the GUI dpt and think about it for 2.10.
Comment 5 Ángel Guzmán Maeso (shakaran) 2016-11-08 23:15:15 UTC
Doing bug triaging for 2.10: this is oldest bug in milestone for 2.10 (at this moment only 56 are remaining)

https://bugzilla.gnome.org/buglist.cgi?bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&list_id=166021&order=changeddate%2Cbug_status%2Cpriority%2Cassigned_to%2Cbug_id&product=GIMP&query_based_on=&query_format=advanced&target_milestone=2.10

Could some core developer provide more info/update the general status of this bug?
Comment 6 Michael Natterer 2017-04-19 20:38:02 UTC
Fixed in master:

commit bcc3437f5f197d0ae4b359f44ba27199a7ac22d5
Author: Michael Natterer <mitch@gimp.org>
Date:   Wed Apr 19 17:33:44 2017 -0300

    Bug 344684 - Greyscale (no alpha) clipboard brushes are of the wrong type
    
    Add a "mask-only" property to GimpBrushClipboard. When TRUE, only
    create a brush mask (not a pixmap brush with mask and image).
    
    Keep two clipboard brushes around: one classic "Clipboard Image" one
    to be used as "stamp", and one new "Clipboard Mask" one that turns the
    clipboard into a brush mask.

 app/core/gimp-data-factories.c  |  29 ++++++-----
 app/core/gimpbrushclipboard.c   | 103 +++++++++++++++++++++++++++++-----------
 app/core/gimpbrushclipboard.h   |   4 +-
 app/core/gimppatternclipboard.c |   2 +-
 4 files changed, 95 insertions(+), 43 deletions(-)
Comment 7 jose americo gobbo 2017-05-02 19:40:29 UTC
Created attachment 350904 [details]
Shape of Clipboard Mask is different of original shape selection

I have tested with rounded shape selections to create clipboard images to use as brush, but the 'Clipboard Mask' do not use the same shape. The original rounded shape becomes an square shape.
Comment 8 jose americo gobbo 2017-05-02 19:46:33 UTC
Sometimes, the mask obey the same shape, more-less, but is necessary repeat more times the copy...(as the first sample on the image) is a bit difficult understand the reason because is possible sometimes to have the same shape of the original selection. In my test, normally it is modified.
Comment 9 jose americo gobbo 2017-05-08 19:59:33 UTC
Created attachment 351389 [details]
Comparison between different origins of clipboard masks in the three kind layers

I have noted that the clipboard masks printed on white layers (with or withour alpha channel) are resulting more darken of my original copied.

I have tested with 3 kind of clipboard masks:
1 - from white layer no alpha,
2 - from white layer with alpha,
3 - from transparent layer.

I have applied each clipboard mask kind also in these three layer types, and resulting when the clipboard masks kind are applied on:

# white layer no alpha - Change all - NOT OK (more darken)
# white layer with alpha - Change all - NOT OK (more darken)
# transparent layer are working nice.
Comment 10 jose americo gobbo 2017-05-08 20:01:14 UTC
(In reply to jose americo gobbo from comment #7)
> Created attachment 350904 [details]
> Shape of Clipboard Mask is different of original shape selection
> 
> I have tested with rounded shape selections to create clipboard images to
> use as brush, but the 'Clipboard Mask' do not use the same shape. The
> original rounded shape becomes an square shape.

In my tests when we use clipboard from transparent layers the shape is modified.
Comment 11 jose americo gobbo 2017-05-13 19:24:24 UTC
Created attachment 351791 [details]
Schema to test the issue via .xcf file and a short movie showing the behavior of two clipboard options.

I have made an schema in a xcf file to simplify the check of the clipboard options issues.
A short screencast video, helps perhaps, understand how use the test and/or understand the problems with clipboard options.
https://youtu.be/3aBZdrOcmdU
Comment 12 Michael Natterer 2017-05-13 20:22:26 UTC
If you comment on a closed bug, you should reopen it if you think there
is work to be done :)
Comment 13 jose americo gobbo 2017-05-13 20:28:26 UTC
The bug report is not my ... and I have verified and I don't have the privileges to modify the status ;)
Comment 14 Michael Natterer 2017-05-13 22:35:33 UTC
Ok, reopening for checking the issue.
Comment 15 jose americo gobbo 2017-05-14 15:21:33 UTC
Created attachment 351833 [details]
Test with clipboard image versus clipboard mask and issue around changes of the gray balance.

I have made only to have the data how the clipboard is altering the gray balance of original stain used as pattern.
Apparently the changes are not linear.
Comment 16 jose americo gobbo 2017-05-21 22:38:43 UTC
Created attachment 352323 [details]
Shapes of Clipboard Mask with different methods to build them...

The test was made using a circle selection of 100 pixels.
1) White layers (no matters if with or not alpha channel).
When we have stains completely full, without some white zones on the borders, the clip mask becomes an square shape (Figure 1 and 2).
2) Transparent layers.
All kind stains on transparent becomes always square shapes (fig. 3, 4 and 5).
Comment 17 jose americo gobbo 2017-05-30 15:01:37 UTC
Created attachment 352880 [details]
Test with clipboard image versus clipboard mask and issue around changes of the gray balance.

I have made another test, more understandable ;).
Is a comparison of the dabs made with a simple .gbr with:

# clipboard image dab;
# clipboard mask dab;
# brush dab (original).

In the .xcf we have the dabs printed on Normal layers (legacy and default), for each case I have copied from respective blend set, or rather, the clipboard dabs are copied directly from each kind blend set (default clipboard dabs are copied from a Normal default blend). I did this, only to be sure if the clipboard origin caused this effect, seen that Legacy Normal blend has a different behavior of the default normal blend.

The clipboard mask of both cases are identical, but is resulting more darker than of the original brush dab and of clipboard image dab.
Comment 18 Michael Natterer 2018-01-02 22:30:43 UTC
I don't know what you expect here, I think we are talking about two entirely
different problems. You can't just paint a dab with any brush, copy it from
the image and expect the resulting clipboard brush to have exactly the
same effect. It most often won't.

The clipboard *image* brush simply paints with the clipboard buffer as
if it were a colored gimp brush, no additional magic.

The clipboard *mask* brush turns a grayscale version of the clipboard
into a brush mask, and paints with whatever else is set on the used
paint tool (color, whatever).

Closing again as FIXED, I see no bug here.