Questions about gradients (and bucket Fill tool)

Post questions on how to use or achieve an effect in Inkscape.
thegreatinkscape
Posts: 9
Joined: Fri Dec 02, 2016 6:50 am

Questions about gradients (and bucket Fill tool)

Postby thegreatinkscape » Sat Dec 03, 2016 12:52 am

I'm an inkscape newbie. I have a bit of a crest design, with lots of different fillable areas, and I have been experimenting with different gradients in different sections to see what looks best. My lack of inkscape knowledge is frustrating me.

I'd be interested in any in-depth help for gradients, such as online resources. I understand how to create them, change the colors, set stops and angles, but I keep running into unexpected behavior that slows or roadblocks me.

Besides any resources to learn from, I'll throw out a few questions in the hope that someone will reply.

- Why are gradients both a stroke and a fill? My newbie approach assumed they were simply a fill, after trying lots of gradients, I tried to clear them by selecting all objects and setting the fill to none. Took me a while to figure out where all these lines were coming from which were a pain to remove.

- So gradients are both a stroke and a fill, with both set to the same gradient? Is that true? When I tried setting the stroke width to 0, there would be a tiny gap where the fill didn't fill in all the way.

- Should the stroke width be set to 1? My stroke width keeps reverting to odd widths, like 0.298 when I use the fill tool. This also seems to leave a gap, and I need to keep changing it. I didn't see a setting to retain the value, like with the pen tool. Why is it changing?

- What is the best way to apply a gradient across multiple objects? I was able to do this by grouping them, filling the gradient, then ungrouping, but is there an easier way?

- When trying out multiple gradients in different sections, what is the easiest way to remove all the gradients, leaving the paths/lines, and start again? My method of selecting all and setting the fill to none didn't work. and selecting each gradient separately wouldn't seem to work so well either.
Last edited by thegreatinkscape on Fri Dec 09, 2016 11:11 am, edited 2 times in total.

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

Re: Questions about gradients

Postby Lazur » Sat Dec 03, 2016 1:56 am

Welcome aboard!

That's alot of questions, seems you are on the right track.


It is not the gradient that can be fill or a stroke, but the other way around -objects/paths can have stroke and fill attributes, which can contain gradients.
Usually gradients are not set both to the fill and the stroke and to be honest I hardly set gradients on strokes.

The other problem you see with the 0 width (?) gap is an issue produced by anti-aliasing and the way how the alpha values of the pixels are computed-composited. The best solution is overlapping the objects.
For example if you have a crest shape with a lion shape on it in the centre, draw the lion atop the crest that doesn't have a hole for the lion shape -unlike silkscreen printing-.

Applying a gradient on a group attribute is the best way to ensure the same appearance.
That way you can change them all at once too.

thegreatinkscape
Posts: 9
Joined: Fri Dec 02, 2016 6:50 am

Re: Questions about gradients

Postby thegreatinkscape » Sat Dec 03, 2016 5:23 am

Thank you Lazur,

It was a lot of questions. I think I better understand today what is going wrong, although I'm still not sure about how to approach what I what to do.

I'm drawing the shapes, then going back and filling with the Fill tool. The fill tool creates a fill object with a stroke and a fill. I really just want the fill, and I can't fill the objects because the fill boundaries are created by overlapping paths. For example, if you created 2 overlapping rectangles, then filled the intersection. This creates the fill object with it's own path and fill.

So it's the fill tool that beguiles me.

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

Re: Questions about gradients

Postby Lazur » Sat Dec 03, 2016 5:38 am

A-ha.

Just to clarify, which tool do you use for drawing the outlines?

thegreatinkscape
Posts: 9
Joined: Fri Dec 02, 2016 6:50 am

Re: Questions about gradients

Postby thegreatinkscape » Sat Dec 03, 2016 5:44 am

I've drawn a bunch of overlapping paths with the Bezier tool that now look somewhat like Celtic knotwork. So there are ribbons that go under and over each other. I want to add gradients it.

The Fill tool creates objects with both a stroke and a fill, yes? And should the stroke width be 1? I wish the Fill tool could simply be all fill and no bounding stroke.

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

Re: Questions about gradients

Postby Lazur » Sat Dec 03, 2016 6:13 am

The bucket fill tool uses the last used style settings by default. If you change the settings to no stroke and select the tool once again is should work as expected.
Also there are settings in the bucket fill tool to increase the fill.

Other than that, vectorgraphics in general is something like cutting out shapes with scissors >>>filled paths.
Like, you can use the pen tool to create such closed paths that can have a gradient fill attribute without any further bucket filling.
Asked the tool because there is the calligraphy tool and some people are using tablets and "freehand" sketching, not editing node by node.

thegreatinkscape
Posts: 9
Joined: Fri Dec 02, 2016 6:50 am

Re: Questions about gradients

Postby thegreatinkscape » Sat Dec 03, 2016 9:37 am

Thank you for your help, Lazur.

Here is a simple example. I took 2 rectangles, overlapped them, then bucket filled the overlap. With the stroke set to 0 width, there is a noticeable gap between the gradient and the line. What is going on there?

Image

thegreatinkscape
Posts: 9
Joined: Fri Dec 02, 2016 6:50 am

Re: Questions about gradients

Postby thegreatinkscape » Sat Dec 03, 2016 9:45 am

I think the bucket fill uses the stroke to create a path, then fills in the remainder with a gradient. Once I reduce the stroke width, the bucket fill doesn't extend all the way to fill the area.

Perhaps if I already had the stroke set to 0 width it would work properly, but to draw the rectangles I need to have it set to a something greater than 0.

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: Questions about gradients

Postby Moini » Sat Dec 03, 2016 10:43 am

The bucket fill tool works with a 'photo' of the image. It does not take the stroke width per se into account, only the area that has the same color. There are a couple of settings for the tool in its tool control bar at the top, that are intended to help with the problem.

But the recommended way would be to duplicate the two rectangles, then to do Path -> Intersection to get a rectangle that fits precisely into the overlapping part. You can then set that rectangle's style as needed.
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

NoeyLab
Posts: 1
Joined: Sat Dec 03, 2016 8:46 pm

Re: Questions about gradients

Postby NoeyLab » Sat Dec 03, 2016 8:51 pm

I tried to clear them by selecting all objects and setting the fill to none.

thegreatinkscape
Posts: 9
Joined: Fri Dec 02, 2016 6:50 am

Re: Questions about gradients

Postby thegreatinkscape » Sun Dec 04, 2016 12:55 am

NoeyLab wrote:I tried to clear them by selecting all objects and setting the fill to none.


That's what I initially tried to do but it didn't delete the fill object or the fill's stroke path, only the gradient fill was removed.

Also, welcome to the forum! I joined yesterday. :)

thegreatinkscape
Posts: 9
Joined: Fri Dec 02, 2016 6:50 am

Re: Questions about gradients

Postby thegreatinkscape » Sun Dec 04, 2016 1:04 am

Moini wrote:The bucket fill tool works with a 'photo' of the image. It does not take the stroke width per se into account, only the area that has the same color. There are a couple of settings for the tool in its tool control bar at the top, that are intended to help with the problem.

But the recommended way would be to duplicate the two rectangles, then to do Path -> Intersection to get a rectangle that fits precisely into the overlapping part. You can then set that rectangle's style as needed.


Thanks, Moini. I don't see why it would leave a gap and not extend all the way to the color though. I have played around a bit with the settings, but they don't quite see to fix things. Maybe I'll run through my current discoveries in a separate post.

Perhaps you are correct about needing to create a separate object for the intersection. Unfortunately that was a simplification to illustrated the problem. I have dozens and dozens of overlapping paths that I would like to fill, so turning each into an object is something I'd rather avoid.

Plus it makes me question the usefulness of the bucket fill tool.

thegreatinkscape
Posts: 9
Joined: Fri Dec 02, 2016 6:50 am

Re: Questions about gradients and (bucket Fill tool)

Postby thegreatinkscape » Sun Dec 04, 2016 1:19 am

I've discovered a few things about gradients and the bucket tool:

- Check the Edit->Preferences->Paint Bucket. If it's set to "Last Style Used" it seems to give odd results, such as a stroke with an weird width (0.848 last time might be based on the zoom level), and doesn't retain to use a gradient fill (reverts to none every time). Better to use the "This tools own style" setting.

- The gap that the bucket fill leaves appears to depend on the zoom level! Zoom out, fill a gradient, then zoom in, and there is a bigger gap than if zoomed in when applying the fill. Yikes! This is tough to work around.

- The gap around the fill object doesn't seem to be the same size all around. It's larger on two sides. This means using the "Grow/Shrink" settings doesn't exactly fix the problem.

Most perplexing tool. :?

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: Questions about gradients and (bucket Fill tool)

Postby Moini » Sun Dec 04, 2016 5:25 am

Yes, the zoom relationship is correct. Inkscape takes its 'photo' at the zoom level you use when you use the bucket tool. You can use that to your advantage, to get more precise filling ;-)

But, honestly, to me, the bucket tool is mostly a raster graphics concept transplanted into the vector graphics world, so I really don't find it an ideal tool for creating precise vector graphics. It's not meant for doing that, either.

The manual has more info: http://tavmjong.free.fr/INKSCAPE/MANUAL ... ucket.html
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

User avatar
prkos
Posts: 1625
Joined: Tue Nov 06, 2007 8:45 am
Location: Croatia

Re: Questions about gradients and (bucket Fill tool)

Postby prkos » Sun Dec 04, 2016 8:24 am

I agree with Moini, if you want precice mathematical overlapping of curves edges you're better of using Path operations ;)

http://tavmjong.free.fr/INKSCAPE/MANUAL ... ining.html
just hand over the chocolate and nobody gets hurt

Inkscape Manual on Floss
Inkscape FAQ
very comprehensive Inkscape guide
Inkscape 0.48 Illustrator's Cookbook - 109 recipes to learn and explore Inkscape - with SVG examples to download

thegreatinkscape
Posts: 9
Joined: Fri Dec 02, 2016 6:50 am

Re: Questions about gradients and (bucket Fill tool)

Postby thegreatinkscape » Sun Dec 04, 2016 8:27 am

Moini wrote:Yes, the zoom relationship is correct. Inkscape takes its 'photo' at the zoom level you use when you use the bucket tool. You can use that to your advantage, to get more precise filling ;-)

But, honestly, to me, the bucket tool is mostly a raster graphics concept transplanted into the vector graphics world, so I really don't find it an ideal tool for creating precise vector graphics. It's not meant for doing that, either.

The manual has more info: http://tavmjong.free.fr/INKSCAPE/MANUAL ... ucket.html


Thanks, somehow I missed that manual bit, perhaps because I initially thought this was a gradient issue. It explained a lot.

You are correct, also, that I am using the wrong tool. For some reason, I thought the paint bucket fill would be equivalent to filling a closed path, and would let me experiment more easily with different gradients.

I need to rethink how I am going about this. I kind of took the long way, but now at least I understand the bucket fill. :D

prkos wrote:I agree with Moini, if you want precice mathematical overlapping of curves edges you're better of using Path operations ;)

http://tavmjong.free.fr/INKSCAPE/MANUAL ... ining.html


Yes, it took me a bit to figure that out. Thanks.

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: Questions about gradients and (bucket Fill tool)

Postby Moini » Sun Dec 04, 2016 9:20 am

You're not the first to stumble about this, many people who use Inkscape for the first time just go on using the tools in the way they are used to from bitmap graphics editors (e.g. draw with the pencil tool and calligraphy tool, fill shapes with bucket tool, not yet having formed an idea about what 'vector' means, and what 'objects', 'paths' and 'nodes' are). It's normal ;-)

The step from raster to vector is a big one, in terms of concepts and workflow, and having the bucket tool available (while it *does* have its uses, of course) is rather often misleading for new users than being useful in developing skills in using the program effectively.
I like to point at my own tutorial in these cases :oops: , which starts with the concepts:
http://localhost:8000/posts/2015/Dec/in ... en-en.html
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)


Return to “Help with using Inkscape”