See below-

On 4 Feb 2001, Sven Neumann wrote:

> > There needs to be a way to select a texture before advanced tools can
> > be added to The GIMP.  I propose to create a new dialog box similar
> > to the pattern selector.  Instead of containing tilable RGB pixmaps, it
> > will contain tileable greyscale heightfield pixmaps.  These textures will
> > be used by some tools to simulate, for example, paper grain.


> Sounds like a reasonable idea if and only if we make almost all paint tools
> use this texture. Are there any algorithms which have proven to fit into
> the Gimp paint_core?

I haven't poked into the paint_core too deeply, however here's an
algorithm that should be easy to integrate:  Subtract the texture
from the already subpixel and pressure adjusted brush mask, clipping below
at zero.  Use the results as the new mask.  Basically the arithmetic looks
like this, assuming a mask value of zero means no composition and a
texture value of 0 represents the highest peak:

new_mask[x][y] = MAX (mask[x][y] - texture[x + offset_x][y + offset_y], 0)

If you set wax = 0% and opacity = 100% in DigiPencil, you will see
the effect described by the above algorithm.

> Before you think about writing code, we are are designing an abstract 
> GimpData object at the moment which will be the parent of all those brush,
> pattern, gradient, ... stuff. Those data objects will go into a GimpContainer
> (which has just appeared in CVS) which will handle the problems of keeping
> names unique, etc. We will also provide views on these objects so all data
> previews and all sort of brush, pattern, gradient, ... -dialogs can reuse
> the same code. 

Very cool, that should simplify the process of creating a texture selector
greatly.  In addition to providing UI elements for the user, there also
needs to be an API for scripts and the plug-ins to change the texture.

Thanks for the input,

Reply via email to