On Wed, 2009-03-11 at 22:22 +0530, sumith pandilwar wrote:
> by adding support for svg files i would like to add the feature to
> import svg file and modify its properties like colour, fade out etc
> and use it like a brush.This would be like totally creating a new
> brush of our own

OK, let's have a look at using SVG for brushes in GIMP. With the current
state of brush transformations in trunk, we are nicely prepared for
vector brushes. Brush transformations currently are affine
transformations and as such they can easily be applied on an SVG. So all
that is needed is to create a new brush type GimpBrushVector similar to
GimpBrushGenerated. This vector brush would load its data from an SVG
file. If we accept linking the core against librsvg we can easily import
any SVG file and render it using rsvg_handle_render_cairo(). Being able
to render the brush to a Cairo surface is an extra plus as that will
allow the paint tools to render a nice brush preview on the canvas as
soon as we finally port tool drawing to Cairo.

It's not clear though how exactly an SVG file that represents a brush
should be interpreted. What I described above basically means we just
treat it as a scalable image. Basically all SVG images could be used as
brushes then and would behave like pixmap brushes except that they would
look better when transformed. Probably not exactly what we want. We also
need the notion of grayscale vector brushes that define a brush mask
that is colored by the foreground color. We also need meta information
such as the brush name and the default brush spacing. It's not entirely
clear to me how such an SVG brush should look like. Do we expect
GIMP-specific XML elements in the SVG ?

In order to come to a conclusion whether GIMP should have support for
SVG brushes and if that would be a good project for GSoC we need a
clearer vision of what an SVG brush is. Perhaps someone else here wants
to share his ideas?


Gimp-developer mailing list

Reply via email to