Mobile app version of vmapp.org
Login or Join
Turnbaugh909

: Shading an SVG shape using control points I'm using Inkscape to produce an SVG image which is supposed to reproduce a photo. I have some arbitrarily drawn shape, and I need to shade it. Here's

@Turnbaugh909

Posted in: #Gradient #Interpolation #Shadows #Svg #Vector

I'm using Inkscape to produce an SVG image which is supposed to reproduce a photo. I have some arbitrarily drawn shape, and I need to shade it. Here's an example photo:

a lump of clay potteryblog.com/uploaded_images/first_lump_of_clay-708195.jpg
Here's how I would like to define the shading of the clay in the image above: define the color at a small set of control points, and have the color at every other point in the shape defined by interpolating between those control points. Or more sophisticatedly: define a set of control lines of constant color, so that the other pixels' colors interpolate between these lines. (I don't know what the interpolation algorithm should be; I imagine something like 2D Gouraud shading.)

However, I can't find how to do this. SVG only seems to provide linear and radial gradients. Other people seem to very carefully draw their naturalistic images in SVG using many shapes with combinations of these two shaders. For example:



This method is time-consuming, and only seems to work well for smooth, shiny things with a lot of specular highlights.

Is it possible to do something like my suggested shading method in SVG? I can imagine something which compiles a shading definition like the one I suggested, and produces an SVG approximation.

Alternatively, do technologies outside of SVG provide something like what I suggested?

10% popularity Vote Up Vote Down


Login to follow query

More posts by @Turnbaugh909

0 Comments

Sorted by latest first Latest Oldest Best

Back to top | Use Dark Theme