Re: Thanks and a question/suggestion
From: Tony Cook (email@example.com)
Date: Tue 12 Nov 2002 - 02:15:21 GMT
Next message: Arnar Mar Hrafnkelsson: "Re: Thanks and a question/suggestion"
On Tue, Nov 12, 2002 at 03:00:12AM +0100, Georg Rehfeld wrote:
> Dear Tony and all others,
> > > ... photoshop/gimp ... brushes ...
> > This is the mechanism I'd been planning on using for greyscale brushes,
> > though I'm not sure it would work for colour brushes. I'd also planned
> > on having the ability to apply a texture to the brush.
> I'm unsure what you mean by 'apply a texture to the brush', is it
> a RGBA brush? Or something more complex? Photoshop only seems to
> have greyscale brushes (with alpha), but uses the current fg color when
> painting. Having that (with a generated or a loaded brush image) would
> help a lot. Besides, photoshop has options for brush painting similar
> to the combine settings as documented in Imager::Fill.
Using intermediate greyscale image we produce for the drawn line as the
alpha channel in applying a texture to the target image.
So your "line" can be polka dotted if you like ;)
> my $poly = GD::Polyline->new();
> $poly->addPt(0, 0);
> $poly->addPt(10, 20);
> $poly->addPt(100, 5);
> # use GD::Polygon method to offset the polyline
> $poly->offset(42, 47.11);
> # rotate 60 degrees, about the centroid
> $poly->rotate(3.14159/3, $polyline->centroid());
> # make a spline from the polyline (spline is a GD::Polyline too)
> my $spline = $poly->addControlPoints()->toSpline();
> my @points = $spline->vertices();
> $img->polyline(points=>\@points, color=>$color, aa=>1);
This is pretty cool :)