How to fill a gradient along a shape (or morph image)

Post questions on how to use or achieve an effect in Inkscape.
mortoray
Posts: 6
Joined: Fri Jan 25, 2013 5:38 am

How to fill a gradient along a shape (or morph image)

Postby mortoray » Thu Aug 14, 2014 5:27 am

How can I fill a shape with a gradient that follows the border of the shape?

I have an image like this:
Image

And want it to look something like this (just the inside fill):
Image

Essentially I want to mark the beginning and end of the path and have the gradient follow that path. It's okay if I have to do this in two steps: one gradient in each direction (the desired output is a red along the narrow axis and green along the long axis).

Alternately, is there a way to morph the borders of an image? Then I could import a plain gradient and morph it's shape to match what I want.

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

Re: How to fill a gradient along a shape (or morph image)

Postby Lazur » Thu Aug 14, 2014 5:46 am

Hello, have a look at this topic:
gradient meshes.

Other than that, it's all a matter of hacking a solution to mimmick the look.

For example custom markers can be used to bend a gradient along a path.
http://forum.inkscapecommunity.com/index.php?action=articles;sa=view;article=22
http://forum.inkscapecommunity.com/index.php?action=articles;sa=view;article=23

You can also try to blur and clip objects.
http://www.inkscapeforum.com/viewtopic.php?f=5&t=16411

mortoray
Posts: 6
Joined: Fri Jan 25, 2013 5:38 am

Re: How to fill a gradient along a shape (or morph image)

Postby mortoray » Thu Aug 14, 2014 5:52 am

I'll try to figure out the meshes thing. Mimicking the look won't be sufficient I'm actually producing some game assets that need a rather precise fill on this region.

hulf2012
Posts: 716
Joined: Sat Nov 24, 2012 12:37 pm

Re: How to fill a gradient along a shape (or morph image)

Postby hulf2012 » Thu Aug 14, 2014 9:07 am

Hello,

I have to say that I did a tutorial some time ago about a method to simulate a gradient, without using a gradient mesh:

http://hul78.deviantart.com/art/Complex-Color-Tutorial-402171236

I think it's there in some place, in one of those links that Lazur shared with you.
I wish that my method idea could dig into your requirement. It's true that involve some advanced features thatn some one can find on inkscape. The shortest method, of course is to use the gradient mesh tool that it can be found if you download the last development version of inkscape. Allthough, I don't know if is still there because the development version changes constantly.

Anyway, other similar procedure, but maybe easier is something that I also did:
http://hul78.deviantart.com/art/Curvedgrad07-376481675
If you have problems:
1.- Post a sample (or samples) of your file please.
2.- Please check here:
http://tavmjong.free.fr/INKSCAPE/MANUAL/html/index.html
3.- If you manage to solve your problem, please post here your solution.


Return to “Help with using Inkscape”