[aklug] Re: [Gimp-developer] Airbrush/Brush Banding Effect At Low Pressure/Opacity

From: Christopher Howard <choward@indicium.us>
Date: Wed Nov 18 2009 - 13:21:27 AKST

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Christopher Howard wrote:
> Jay Cox wrote:
>> 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
>
> Thank you for your guidance in this matter. However, I am wondering:
> Wouldn't error diffusion tend to sharpen, rather than smooth out, the
> banding? It seems like some kind of blurring is more what we need.
>
> I played around in apply_mask_to_alpha_channel() a little bit and my
> results seemed to confirm that. But maybe I misunderstand error
> diffusion or precisely what you mean about how to use it?
>

Oops, wrong list. Sorry about that!

- --
Christopher Howard
http://indicium.us
http://theologia.indicium.us
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAksEc2YACgkQQ5FLNdi0BcV2LACgpg+NUu2vXJOjGR5EzLOd/2fS
PRAAoJM2q7oZD06Elvb2L0D2aJqjl2o7
=52Jy
-----END PGP SIGNATURE-----
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Wed Nov 18 13:22:53 2009

This archive was generated by hypermail 2.1.8 : Wed Nov 18 2009 - 13:22:53 AKST