Curved Gradients

Post questions on how to use or achieve an effect in Inkscape.
marciokoko
Posts: 14
Joined: Wed Jan 11, 2012 7:35 am

Curved Gradients

Postby marciokoko » Fri Jan 13, 2012 2:39 am

I have a shape i created with the bezier tool. Its kinda like an engine turbine, its all i can think of. Ive attached it.

The thing is the linear gradient doesn't. do it justice. I want the gradient to curve along the outer edge of the engine, like shown by a black arrow i drew alongside.
How do I achieve this effect?
Attachments
Screen Shot 2012-01-12 at 10.37.14 AM.png
Screen Shot 2012-01-12 at 10.37.14 AM.png (13.15 KiB) Viewed 14708 times

Uktrunie
Posts: 154
Joined: Sun Jul 18, 2010 4:48 am

Re: Curved Gradients

Postby Uktrunie » Fri Jan 13, 2012 4:04 am

Well, sorry to say this, but it can't be done. :( The reason is that the SVG standard (the one Inkscape follows) doesn't support such a thing. There are plans to add these capabilities to SVG, but don't expect them to be available in the near future.

For simple thing, I've used shapes, blur and clipping. You draw your shape, and then another one with the "gradient", blur it ... something like this:

Image

So, you draw the two shapes, duplicate the bottom one for clipping purposes, then add some (50%) blur and clip it with the duplicate... Ugly as hell, I know.

Another method could be this one: http://simarilius.wordpress.com/2006/10/21/faking-irregular-gradients-in-inkscape/.

Let's wait until a more knowledgeable fella comes with better ideas. :)

User avatar
Grobe
Posts: 411
Joined: Tue Feb 02, 2010 2:20 am

Re: Curved Gradients

Postby Grobe » Fri Jan 13, 2012 4:23 am

Hi.

I have one method that works for me:

  1. Draw a filled shape with a solid background color.
  2. Draw an ellipse. Place and resize the elipse so that it's edge touches the outer limit of where you want your "gradient" to be.
  3. Make the ellipse's edge transparent and set fill to radial gradient.
  4. Insert a couple of gradient nodes (one may be enough).
  5. Make the innermost and the outermost gradient handle transparent. Now it will look like a blurry circle.
  6. Make any neccesary adjustments so it looks right.
  7. Select the object below and duplicate it. The duplicated version wil now be the uppermost object.
  8. Select this duplicated object AND the blurry ellipse.
  9. Click Object --> Clip --> Set
  10. Done.
Attachments
BendGradient2.svg
(3.85 KiB) Downloaded 384 times
bitmap.png
bitmap.png (36.97 KiB) Viewed 14695 times
:lol:

ChrisLo
Posts: 14
Joined: Fri Feb 10, 2012 8:11 am

Re: Curved Gradients

Postby ChrisLo » Tue Jun 12, 2012 10:28 pm

Thank you for the tutorials here. I think curved gradients are very requested for advanced drawing. I have the problem that shaping a curved gradient with linear pieces, the PDF output was oddly different - see screens:
Image Image
Can anybody tell something about that PDF export behaviour (possible bugs: 168610, 511791) and how you suppress or optimize it?

I will now try the methods and it looks like "faking-irregular-gradients-in-inkscape" is the most interesting for "tubes" that should outputted also to PDF format (without rasterization).
Image

EDIT: much better solution now (32 interpolation steps)
Image

User avatar
flamingolady
Posts: 687
Joined: Wed Jun 10, 2009 1:40 pm

Re: Curved Gradients

Postby flamingolady » Wed Jun 13, 2012 4:55 am

Grobe - wow, great idea to use the eclipse! you're a genious! I learn something new here everyday (just luv this forum).
dee

llogg
Posts: 443
Joined: Tue Mar 11, 2008 7:30 am

Re: Curved Gradients

Postby llogg » Wed Jun 13, 2012 12:58 pm

I always forget about that interpolation trick, and it's really a great way to achieve this effect. Glad you figured it out.

aungsitt
Posts: 1
Joined: Fri Aug 22, 2014 1:27 pm

Re: Curved Gradients

Postby aungsitt » Fri Aug 22, 2014 1:30 pm

I used a curved line, stroke with colour and increase blur. It works great.

Lowen
Posts: 1
Joined: Thu Jun 16, 2016 7:19 am

Re: Curved Gradients

Postby Lowen » Thu Jun 16, 2016 7:24 am

1. Draw (pink) rectangle.
2. Draw (red) shape on top of (pink) rectangle. This will be the shape of the gradient. (Tip: use nodes).
3. Blur (red) shape.
4. Draw desired shape (blue) on top of first two shapes, leaving their edges sticking out to be cut away in the next step.
5. Select everything and choose Object>Clip>Set. You might have to delete topmost (blue) shape.
Voila! You are left with the shape from the top and the colouring from underneath.
shaped gradient.png
shaped gradient.png (33.28 KiB) Viewed 10172 times

User avatar
druban
Posts: 1917
Joined: Fri Nov 20, 2009 10:48 pm

Re: Curved Gradients

Postby druban » Thu Jun 16, 2016 4:39 pm

Level 10 thread necromancy at the very least! But since you've gone to this much trouble, check out the WIP gradient mesh tool which is more scaleable than using masked/clipped blur.
Your mind is what you think it is.

User avatar
Xav
Posts: 1209
Joined: Fri May 08, 2009 1:18 am
Location: UK
Contact:

Re: Curved Gradients

Postby Xav » Fri Jun 17, 2016 1:03 am

druban wrote:Level 10 thread necromancy at the very least! But since you've gone to this much trouble, check out the WIP gradient mesh tool which is more scaleable than using masked/clipped blur.


Just be aware that it uses features from an in-progress version of the SVG spec. We've been here before - Inkscape's flowed text implementation is based on an earlier spec that never got ratified, leaving the rest of us forever trying to explain to people why they shouldn't use it for files they want to use outside of Inkscape. Gradient mesh is in a similar situation at the moment, and there's no guarantee that files saved in one version of Inkscape will open in a later one if you use it, as the spec is still in a state of flux.

I don't want to put you off using it, but I think it should be an informed decision, given the history of SVG specs.
Co-creator of The Greys and Monsters, Inked - Inkscape drawn webcomics
Web SiteFacebookTwitter

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Curved Gradients

Postby Lazur » Fri Jun 17, 2016 1:56 am

May worth mentioning as an alternative that linear gradients and displacement map filter primitive can also be used for some effects.

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Curved Gradients

Postby Lazur » Fri Jun 17, 2016 3:32 am

Quick example:

Image


Image

seans_potato_biz
Posts: 138
Joined: Mon Apr 07, 2008 6:01 am

Re: Curved Gradients

Postby seans_potato_biz » Mon Jul 10, 2017 5:12 am

^^ I don't know what that is but it's gorgeous!

I also came here looking for a way to make a curved gradient line.
Win 7/10, Inkscape 0.92.2

We don't inherit the Earth from our parents; we borrow it from our children.

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Curved Gradients

Postby Lazur » Mon Jul 10, 2017 5:19 am

Thank you!

If on 0.92, give gradient meshes a try.
For example check this svg

Mesh tool is available by Alt+M.


Return to “Help with using Inkscape”