3

I have 2 closed paths, one inside another:

enter image description here

I want to get a smooth color gradient between their outlines. Something like this, but smooth:

enter image description here

(done with path interpolation an manual coloring)

Is there any simple operation, gradient type, filter or extension to achieve this?

3

Draw manually a black intermediate shape and blur it, There's Blur slider in the fill coloring dialog. This can be used if the exact form isn't critical and a linear gradient isn't a must.

Inkscape's extension Generate from Path > Interpolate can make automatically several intermediate versions and by interpolating the style one gets also intermediate colors:

enter image description here

In the objects panel there's a group which contains the intermediate shapes + the originals (=endpaths) duplicated, if that's wanted

Smoother appearance is possible by increasing steps. Here's 30 intermediate shapes:

enter image description here

A few intermediate shapes can be enough if they are blurred. Unfortunately the blur spreads over the border of the bottom object, but that can be fixed by using a copy of the bottom object as clipping mask.

Warning: The interpolation result can be unpredictable if the paths have different directions or their node distributions differ radically.

  • I tried it, and so far I haven't found anything better than that. But it's more a workaround than a solution. This intermediate blurred shape requires to be fine-tuned very carefully. The transition would either be not smooth enough, or there would still be visible edges between the intermediate and the inner shape, it may also spread outside the outer shape. Ideally, I'd want to be able to edit my shapes and have the gradient adjusted automatically (strictly linearly between the inner outline and the outer one). – Andrii Zymohliad Aug 14 at 13:55
  • @AndriiZymohliad There's a better explanation. – user287001 Aug 14 at 20:22
  • cool, I didn't notice "Interpolate style" checkbox. This is probably the best possible solution. – Andrii Zymohliad Aug 15 at 8:14
  • Inkscape also has mesh gradients - they are a bit difficult to use, but they were made for exactly this purpose. However, they will currently not yet work if the SVG file is used directly with another application, and I'm not sure what happens when one tries to export to pdf. So depending on your goal, it might not be what you need. wiki.inkscape.org/wiki/index.php/Mesh_Gradients – Moini Aug 15 at 12:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.