RSS/Atom feed Twitter
Site is read-only, email is disabled

Airbrush/Brush Banding Effect At Low Pressure/Opacity

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

3 of 3 messages available
Toggle history

Please log in to manage your subscriptions.

Airbrush/Brush Banding Effect At Low Pressure/Opacity Christopher Howard 20 Oct 22:22
  Airbrush/Brush Banding Effect At Low Pressure/Opacity Sven Neumann 20 Oct 22:39
   Airbrush/Brush Banding Effect At Low Pressure/Opacity Jay Cox 21 Oct 12:18
Christopher Howard
2009-10-20 22:22:23 UTC (about 15 years ago)

Airbrush/Brush Banding Effect At Low Pressure/Opacity

Hi. To try to learn GIMP development, I have been looking into old bug #588681 (Airbrush tool produces banding with with soft brush). From the initial problem summary:

"The Airbrush produces bandings when its used with a soft brush and low pressure. The sharp edges in the bands is [sic] very visible when it occurs in a otherwise soft image. The low pressure is very useful when I want to have good control over the spray."

He uploaded an image as well of the effect, which I can easily reproduce. When using the airbrush, the severity of the effect is indirectly proportional to the pressure level selected. The exact same problem can be reproduced with a normal fuzzy brush, simply by selecting a low opacity, and repeatedly clicking on the canvas in the same location.

Initially I spent a lot of time looking at app/core/gimpbrushgenerated.c, and especially gauss(), gimp_brush_generated_calc_lut(), and gimp_brush_generated_calc(). This is because I mistakenly supposed that the problem lay in the construction of the lookup table used initially to create the brush mask. However I discovered that this is completely unaffected by the brush opacity or airbrush pressure.

Though having a far from sufficient understanding of how the GIMP brush painting process works, it seems to me like this is the fundamental problem: In making black-and-white brushes semi-transparent, GIMP somehow "levels out" the grey-scale, so that certain ranges of darkness become the same. On a fuzzy brush, the result is that the fine graduation is changed to appear stepped or banded.

I would appreciate any insight into this matter. I have started to look into how brushes are made (applied?) semi-transparent in the code, but there are quite a few functions in the paint-funcs directory to look through.

Sven Neumann
2009-10-20 22:39:03 UTC (about 15 years ago)

Airbrush/Brush Banding Effect At Low Pressure/Opacity

Hi,

On Tue, 2009-10-20 at 12:22 -0800, Christopher Howard wrote:

Though having a far from sufficient understanding of how the GIMP brush painting process works, it seems to me like this is the fundamental problem: In making black-and-white brushes semi-transparent, GIMP somehow "levels out" the grey-scale, so that certain ranges of darkness become the same. On a fuzzy brush, the result is that the fine graduation is changed to appear stepped or banded.

The problem here is that the brush masks are 8bit only. With such a limited set of values to start with, banding is basically unavoidable.

Sven

Jay Cox
2009-10-21 12:18:18 UTC (about 15 years ago)

Airbrush/Brush Banding Effect At Low Pressure/Opacity

On Oct 20, 2009, at 1:39 PM, Sven Neumann wrote:

Hi,

On Tue, 2009-10-20 at 12:22 -0800, Christopher Howard wrote:

Though having a far from sufficient understanding of how the GIMP brush
painting process works, it seems to me like this is the fundamental problem: In making black-and-white brushes semi-transparent, GIMP somehow "levels out" the grey-scale, so that certain ranges of darkness
become the same. On a fuzzy brush, the result is that the fine graduation is changed to appear stepped or banded.

The problem here is that the brush masks are 8bit only. With such a limited set of values to start with, banding is basically unavoidable.

Sven

You should be able to get rid of most of the banding by performing error diffusion when multiplying the opacity into the brush mask. I suspect that a simple 1d error diffusion algorithm will be sufficient and I wouldn't bother with a Floyd-Steinberg type algorithm unless you could come up with an example where the simpler algorithm showed visible artifacts.

I believe the function that introduces the banding is apply_mask_to_sub_region in paint-funcs.c or in the function apply_mask_to_alpha_channel depending on your point of view. I have not worked with that code in a long time and I could be wrong about that.

You will need to make the starting error term effectively random or you run the risk of letting the upper-left pixel in each tile get special treatment.

Good luck,
Jay Cox
jaycox@gimp.org