Posts: 5
Threads: 2
Joined: May 2019
Reputation:
0
I've created a custom brush of some grass blades. They are full color. Because they are so small (sub pixel), it's essential that they have transparency in order to blend properly when I paint them.
However, it appears that transparency is ignored when I use the brush with the Pencil tool. It works fine when I use the Brush tool. However, there's a problem with that.
The Brush tool appears to do some kind of subpixel sampling in an attempt to make a brush appear to be centered exactly where you click. This means if you created a brush image that needs to be stamped so that exact per-pixel detail matches the brush as it was originally created, you can't. It gets distorted along the edges. Sometimes, the distortion is quite significant.
On the other hand, the pencil tool acts like an exact pixel-per-pixel map that "stamps" the exact brush shape without any distortion or alteration. I need the exact pencil mapping, but it appears to ignore transparency in the brush image.
Is there a configuration setting I'm missing?
Posts: 851
Threads: 11
Joined: Oct 2016
Reputation:
89
Operating system(s):
- Windows (Vista and later)
Gimp version: 2.10
You have just discovered the difference between the Pencil and the Paintbrush. The Pencil is a hard brush ie it does not have antialiasing pixels around the edge. The Paintbrush is a soft brush. It does has antialiasing pixels around the edge. This can be set by choosing a suitable brush. For example, the different circle brushes with hardness 0.50, 0.75, etc.
For both the Pencil and Paintbrush have a look at the Tool Options. There is an Opacity slider. This will affect all the pixels, not just the edge pixels.
Also see here:
https://www.gimp-forum.net/Thread-Where-...Windows-10
Posts: 5
Threads: 2
Joined: May 2019
Reputation:
0
05-21-2019, 11:32 PM
(This post was last modified: 05-22-2019, 12:19 AM by pha3z.)
So in conclusion:
There's no way to get a stamped effect with transparency and without antialiasing? Presently in GIMP, the two are mutually exclusive.
I can have:
a) An RGB brush with anti-aliased edges and transparency
b) An RGB pencil without anti-aliased edges and without transparency.
Is this correct?
In the meantime, while waiting for a final answer to my question, I tested Paint Shop Pro picture tube.
The PSP Picture Tube does precisely what I want. You get per-pixel stamps with transparency and no anti-aliasing.
Unfortunately, the tool settings are absolutely terrible compared to GIMP.
Its starting to look like I might have to modify GIMP to get what I need.
All that would be necessary is to modify the Pencil tool to use transparency when blitting the brush onto the layer. Such a change sounds incredibly simple --- the worst problem would be adding a UI option to turn on or off the transparency behavior. Is there anyone here who knows enough about the GIMP source code to know how easy this change might be and where to direct me to look if the change were feasible for a newcomer?
Posts: 851
Threads: 11
Joined: Oct 2016
Reputation:
89
Operating system(s):
- Windows (Vista and later)
Gimp version: 2.10
(05-21-2019, 11:32 PM)pha3z Wrote: I can have:
a) An RGB brush with anti-aliased edges and transparency
b) An RGB pencil without anti-aliased edges and without transparency.
Is this correct?
No, that is not correct.
You can have
An RGB brush with anti-aliased edges with or without transparency
An RGB pencil without anti-aliased edges with or without transparency
This difference is the transition from the transparent to the non-transparent areas.
Posts: 7,137
Threads: 155
Joined: Oct 2016
Reputation:
1,006
Operating system(s):
Gimp version: 2.10
05-22-2019, 07:49 AM
(This post was last modified: 05-22-2019, 08:58 AM by rich2005.
Edit Reason: Edit
)
@pha3z It would help if you gave an example of the brush you are using. Even then Gimp is a raster (bitmap) editor so you are constrained to pixel sizes. The best way to learn Gimp capabilities is experiment, so set up a small image and make a 1-pixel grid.
You might make a brush like this, a mixture of 'solid' and 50% opacity pixels. Never going to work as a pencil as previous posts.
With that brush active, (1) is using the pencil - this will snap to a pixel. (2) Using the brush tool if the brush center is not on a pixel (sub-pixel) you get anti-aliasing. (3) To avoid that ensure the brush coincides with a pixel boundary.
Not easy to guarantee, but some steps to take.
(4) When you make the bush, make it symmetrical (preferably both ways )
(5) (6) Set up snap to grid. This can be done on an image-per-image basis but you might want to set up globally in Edit -> Preferences. The grid does not have to be visible to be active All in the View menu.
Edit: Just seen the reason - Making a game, Gimp / PSP / Krita - all probably overkill. Although, a look around at what is available, I can see the problem is making a bespoke brush
Posts: 5
Threads: 2
Joined: May 2019
Reputation:
0
05-25-2019, 03:07 AM
(This post was last modified: 05-25-2019, 03:25 AM by pha3z.
Edit Reason: added author
)
Thank you to everyone who posted.
I brought this up on the developer mail list. It's been acknowledged as a known issue that is sort of just sitting there with a big question mark. I asked where I would need to look to modify the code to support transparency with the pencil tool, and I got helpful directions. Here's the two responses I got that were most helpful:
Quote:Right, the pencil tool lumps together both binary transparency and
pixel-grid alignment, which are really two independent things. It has
come up before, and I agree that being able to control these separately
would be useful. It's one of those simple features where generality and
consistency get in the way: Should we add this to the pencil tool, or
the paintbrush tool? What about the other paint tools, which already
suffer from an annoying lack of consistency? Should we just merge the
pencil and paintbrush tools? Or, if this separation is convenient, why
not generalize this and allow creating new tools from arbitrary tool
presets, etc.? It's a slippery slope Ultimately, though, I agree
that it's a useful feature.
- Ell
And how to modify the pencil tool:
Quote:the regular paintbrush and the pencil tool are both using the
gimppaintcore for painting the brushes. The difference between pencil
and paintbrush is controlled by the "brush mode" property of the paint
options. If it is == GIMP_BRUSH_HARD then the pencil behaviour is used.
In app/paint/gimpbrushcore.c this is used to request the "solidified"
variant of the brush, in app/paint/gimppaintcore.c it is used to round
the coordinates.
If you want to just change it in your personal copy without changes to
the UI it seems to be fairly trivial. If you want to offer a UI it might
be a bit trickier, but it should be doable.
- Simon
Also, Blighty said this:
Quote:No, that is not correct.
You can have
An RGB brush with anti-aliased edges with or without transparency
An RGB pencil without anti-aliased edges with or without transparency
This difference is the transition from the transparent to the non-transparent areas.
Where is this option to use transparency with the RGB pencil?
The developer list acknowledged there is no way to do it, unless the conversation with them was a miscommunication.
I can't find any option anywhere in the UI that lets you use transparency on an RGB pencil.
Wait.. Ok i think I get what you're saying. When you said "This difference is the transition from the transparent to the non-transparent areas.":
Are you meaning to say that the brush will allow graduated transparency (shades of transparency) between full opaque and full transparency.... while the pencil will not?
If that's what you're saying, then that's precisely what I'm trying to point out is the problem. There's no way to do graduated transparency without anti-aliasing as the tool is currently implemented.
Posts: 851
Threads: 11
Joined: Oct 2016
Reputation:
89
Operating system(s):
- Windows (Vista and later)
Gimp version: 2.10
(05-21-2019, 07:24 PM)pha3z Wrote: I've created a custom brush of some grass blades.
Gimp brushes are flexible enough to get exactly what you want.
(05-22-2019, 07:49 AM)rich2005 Wrote: @pha3z It would help if you gave an example of the brush you are using.
We are still guessing what you want.
(05-25-2019, 03:07 AM)pha3z Wrote: There's no way to do graduated transparency without anti-aliasing as the tool is currently implemented.
Which tool are you referring to? Pencil is designed not to have anti-aliasing. If you want anti-aliasing don't use the Pencil tool, use the Paintbrush instead.
There are several ways to get a graduated transparency if you are making your own brushes. Layer masks and gradients, for example.
As I said, Gimp brushes are flexible enough to get exactly what you want. Give an example and then let's see the best way to do it.
Posts: 6,361
Threads: 275
Joined: Oct 2016
Reputation:
565
Operating system(s):
Gimp version: 2.10
(05-25-2019, 05:21 AM).Blighty Wrote: Which tool are you referring to? Pencil is designed not to have anti-aliasing. If you want anti-aliasing don't use the Pencil tool, use the Paintbrush instead.
There are several ways to get a graduated transparency if you are making your own brushes. Layer masks and gradients, for example.
As I said, Gimp brushes are flexible enough to get exactly what you want. Give an example and then let's see the best way to do it.
I think the OP makes a difference between partial opacity, which is built in the brush: soft parametric brush or partially opaque pixels in bitmap brushes), and anti-aliasing, which is added when painting. And with all types of brushes I tested the Pencil tresholds the alpha:
- soft parametric
- grayscale (black-to-white gradient)
- full color (blue-to-transparency gradient)
Posts: 7,137
Threads: 155
Joined: Oct 2016
Reputation:
1,006
Operating system(s):
Gimp version: 2.10
Can I quote from the developers mailing list post.
Quote:I tried the grid brush technique. While it works for making explicit individual stamps, it does not work for holding the button down and continuously painting. That makes it not an option for my needs: as I'd have to click thousands of times, since I can't use the scatter settings to have the brush do the work for me. Only adding transparency to the pencil would fix the issue...
So we have gone from a 'stamp' to really a paint tool. It is a bit of a niche desire and for what end. I suspect maybe a pixel-art type game. I do hope the OP does find some application better suited to his needs.
Otherwise for regular use the mypaint grass brush(s) works very well.
Apologies for that.
Posts: 5
Threads: 2
Joined: May 2019
Reputation:
0
"So we have gone from a 'stamp' to really a paint tool. It is a bit of a niche desire and for what end. I suspect maybe a pixel-art type game. I do hope the OP does find some application better suited to his needs."
It's "sort of" a pixel-art game. I am doing quasi-realistic graphics in a very small window. The scene scale is an oblique overhead view from very high up (above a forest, for instance and you see dozens and dozens of quasi-realistic trees). As a result, of the large scale constrained to a small window, I need to milk every detail out of every pixel. I can't have blurred, messy pixels caused by subpixel sampling methods. I'm working with incredibly small details (8x8 pixels or smaller) as brush tips and I need to scatter these around with very fine control.
Rich used the term that the pencil tool "thresholds the alpha". That's probably the best way of explaining the problem that I've heard so far. That's exactly what it does, and that's not what I want. I need full alpha support in the brush tip with exact per-pixel mapping. Making the pencil tool support full alpha (Not thresholded) would get that effect.
At this point, I don't think there is any option other than to modify the source code for my purposes, which doesn't sound too difficult from what I was told on the dev list.
|