On Thu, Nov 19, 2009 at 02:01:13PM +1030, David Gowers wrote:
> On Thu, Nov 19, 2009 at 11:17 AM, James Cox <jay...@gimp.org> wrote:
> > result = floor(input * opacity + g_random_double());
> If you pregenerate a lookup table (say 256 entries), keep a counter
> which cycles 0,1,2,....255,0,1,2,....255, and only add a random
> integer to that counter at the start of every dab, you could get that
> going at decent speeds.
I have implemented this in (historical) release 0.5.1 of MyPaint. Using 8
bytes of precalculated noise; brush_dab.c line 120 in case anyone cares.
I got sick of the noise, though. It tends to get visible when you use
brushes that really need this correction. Not worth the effort I think.
The better solution is to calculate in 16bpc, or use different brushes, or
don't use incremental mode (MyPaint supports only incremental). See
http://mypaint.intilinux.com/?p=19 for a sample.
Gimp-developer mailing list