Simple problem of filling a shape

Post questions on how to use or achieve an effect in Inkscape.
Interchangeable
Posts: 33
Joined: Mon May 07, 2012 1:52 am

Simple problem of filling a shape

Postby Interchangeable » Fri Aug 09, 2013 3:01 pm

How can I make the area within the borders in this image:

SVG Image

white instead of transparent? The Fill and Stroke dialog didn't seem to work.

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

Re: Simple problem of filling a shape

Postby Lazur » Fri Aug 09, 2013 6:52 pm

I assume that is drawn by a compound path.
There are more ways of filling it in.

Fastest way:
Convert outline to path (Ctrl+Alt+C),
Break it apart (Ctrl+Shift+K),
and use the Fill and Stroke dialog on each part.
Delete some unnecessary nodes with the node editor tool
and preferably group the objects together (Ctrl+G).

If you would like to change the line width later on,
do the mentioned steps on a duplicant of the original,
delete the biggest black filled path after the breaking apart,
and put the outlines over the fill parts, and,
use the dynamic offsetting to hide the fill's edges below the black strokes.

That solution produces a right looking result, but it could look much cleaner,
if those fills didn't had to be dynamic offsetted.
To do that, you would need to draw those outlines from three closed paths.
You can duplicate the original path and use the node editor tool
to delete some nodes, and connect unconnected ones.
Or you can use the pen tool to draw them quickly,when the snapping of nodes, cusp nodes are enabled.
By that, you will end up with three paths you can add right fills and
right strokes, but some outlines are drawn with double lines.
Which can result in rendering them a bit thicker.

So the most clean result is, when you have three closed paths for the fills,
set them no outline but fill, and put a duplicant of the original outlines over it,
and preferably group all of them together.

Interchangeable
Posts: 33
Joined: Mon May 07, 2012 1:52 am

Re: Simple problem of filling a shape

Postby Interchangeable » Sat Aug 10, 2013 1:31 am

I do not wish to change the line width. Pressing Ctrl-Alt-C gets me an error message "No Stroked Paths in the selection".

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

Re: Simple problem of filling a shape

Postby Lazur » Sat Aug 10, 2013 1:35 am

Does it mean it is a raster image, or is that already a compound path with a black fill?
Or a group of other objects?

Thought it was drawn most likely from path with stroke as you described it a simple one.
Can you attach the original svg?

Interchangeable
Posts: 33
Joined: Mon May 07, 2012 1:52 am

Re: Simple problem of filling a shape

Postby Interchangeable » Sat Aug 10, 2013 3:25 am

It is a vector image. You can get to it simply by right-clicking on it in the first post and selecting "view image", but I've attached it just in case.
Attachments
wr.svg
(4 KiB) Downloaded 188 times

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

Re: Simple problem of filling a shape

Postby Lazur » Sat Aug 10, 2013 4:48 am

Sorry I didn't check it was the svg already.

Here are some variants how the fill can be done.
SVG Image

At the top, the fill parts are separated from the "back", and are put over it, so
now there are no "outlines", just filled shapes on a black shape.

Below, the fill parts are "enlarged", and they are below the "outline".

For the first version, the original shape was broken apart by pressing Ctrl+Shift+K,
For the second, some more editing was done, maybe harder to be explained than to be done.

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

Re: Simple problem of filling a shape

Postby druban » Sat Aug 10, 2013 5:13 am

Ctrl A
ctrl U
ctrl D
Shift ctrl K
Ctrl + (Plus Key) (union)
click on desired color in palette...
End (key) (Lower to bottom)
If you see a color fringe give object a very thin black stroke.
Ctrl A
Ctrl G


Done.
wr.svg
(4.02 KiB) Downloaded 190 times
Your mind is what you think it is.

Interchangeable
Posts: 33
Joined: Mon May 07, 2012 1:52 am

Re: Simple problem of filling a shape

Postby Interchangeable » Mon Aug 12, 2013 2:42 am

Success! Thank you for your help.

Interchangeable
Posts: 33
Joined: Mon May 07, 2012 1:52 am

Re: Simple problem of filling a shape

Postby Interchangeable » Thu Aug 15, 2013 4:32 am

Okay, I have a new problem of the same kind. The attachment is a set of pieces for chess diagrams. On the two kings, and on the white bishop and knight, druban's method doesn't work. On the kings the small enclosed teardrop below the cross is still transparent, on the white bishop the two bottom curves won't fill in after Ctrl-Shift-K, and the white knight doesn't fill in at all. Also, there are some small imperfections on the white knight, in the diamonds on the white king and queen, and around the king's cross; how can I merge all the separate paths into a single path?
Attachments
Alpha.svg
(37.55 KiB) Downloaded 184 times

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

Re: Simple problem of filling a shape

Postby Lazur » Thu Aug 15, 2013 5:02 am

Here is how it would look when the fills were separated from the outlines:
hlp66.svg
(27.79 KiB) Downloaded 194 times

Interchangeable
Posts: 33
Joined: Mon May 07, 2012 1:52 am

Re: Simple problem of filling a shape

Postby Interchangeable » Thu Aug 15, 2013 6:03 am

What do you do to your SVGs to make the background gray, and can I change it back to white?

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

Re: Simple problem of filling a shape

Postby Lazur » Thu Aug 15, 2013 6:22 am

It's only appears that way in inkscape.
You can set it back to transparent if you like at the document's properties panel (Shift+Ctrl+D).
By a coloured background you could see the difference between the transparent and the white parts.

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

Re: Simple problem of filling a shape

Postby flamingolady » Fri Aug 16, 2013 3:12 am

I always tend to use Druban's method - I select all, then do a path/union, then delete and unnecessary nodes that didn't combine correctly, the it fills just fine. If you want various hues, then I'd use path/combine on each segment that I want as a different hue.
Also, fyi - Inkscape by default has a transparent background, that's because it's easier to draw on a white background. However, if you are used to the standard checkerboard look, and like it, you can draw one yourself and then use it as a default - just add it as a new template or as the default template. For instructions you can search these forums, there are several posts of instructions on where to save, etc. While I have kept my background white, I did make several new templates - so it now opens with 3 layers vs one, has no shadow on the border, changed the default size, and I changed all sorts of things!


Return to “Help with using Inkscape”