On Wed, Oct 6, 2010 at 8:22 AM, 黄毅 <yi.codepla...@gmail.com> wrote:
> I'm trying to write a plugin to apply effects like
> this(http://mrdoob.com/projects/harmony/) to any path.
> I've done the coding, but it runs too slow, it speed several minutes
> to draw 7000 lines on my laptop.
> Currently i use following methods to draw lines:
>    pdb.gimp_context_set_opacity(alpha)
>    pdb.gimp_paintbrush_default(drawable, 4, [x1,y1,x2,y2])
> I guess the overhead of pdb api is too heavy. Is there any alternate
> way to achieve my purpose?
> I can't find a proper one in pdb, maybe i should use cairo api to draw
> a back buffer, then send it to gimp, but i have no idea how to do
> that.

Several minutes for 7000 strokes to me seems pretty much on par or
even above with paint core normal performance. You can try drawing on
a drawable/image that isn't visible, if you aren't already, but other
than that... Painting is rather expensive operation and is generally
optimized to keep up with human speeds, that usually at best do 4 or 5
strokes per second and I have to admit, with large brushes even there
it sometimes isn't good enough.

Gimp-developer mailing list

Reply via email to