[solved] "Background" Stroke?

Post questions on how to use or achieve an effect in Inkscape.
MikeTacular
Posts: 3
Joined: Thu Aug 21, 2008 6:40 am

[solved] "Background" Stroke?

Postby MikeTacular » Thu Aug 21, 2008 7:16 am

I recently created a logo thing in photoshop, but since photoshop doesn't have nearly the same power when it comes to vectors as Inkscape, I figured I'd remake it in Inkscape. I had to fudge a couple things in photoshop, so I'm hoping Inkscape can do what photoshop couldn't. Basically I have a few layers, each one containing a different vector graphic. However, I want to have some space in between the each vector graphic, kind of like one vector "clipping" another vector and leaving some space in between. Is there some way to select a "background" stroke style for an object in Inkscape? So that an object's stroke color will be the same as the background? I have a transparent background, and I'd like to have my objects have a stroke that matches my background (setting an object's stroke to 0 alpha just makes it so I can see objects behind the stroke, but I want to cover up the objects behind the stroke with my "background" stroke).

Here is an example of what I mean:
Image
I meant to have placed the blue on top of the red on the left hand side, but oh well. As you can see, I can fudge it by erasing certain parts manually, but I'd love to have Inkscape calculate it so it's perfect (as you can see in the picture, it's not exactly correct when I do it by hand). Is there a way to do this? I wouldn't even mind creating my own stroke style if I had to. Just wondering if it's possible, and if so, how I'd go about doing it. Thanks in advance!

Simarilius
Posts: 626
Joined: Wed Jun 06, 2007 2:37 am

Re: "Background" Stroke?

Postby Simarilius » Thu Aug 21, 2008 7:21 am

In the example there you could just set a white stroke on the blue shape and it would have the effect your after.

MikeTacular
Posts: 3
Joined: Thu Aug 21, 2008 6:40 am

Re: "Background" Stroke?

Postby MikeTacular » Thu Aug 21, 2008 7:48 am

Simarilius wrote:In the example there you could just set a white stroke on the blue shape and it would have the effect your after.

Except my background in my actual image isn't white, it's transparent, which means a white stroke won't work (since it's a transparent background, not white), and setting a stroke's alpha to 0 doesn't work because it makes it as if there isn't any stroke at all.

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: "Background" Stroke?

Postby brynn » Thu Aug 21, 2008 8:54 am

Hi MikeTacular,
I'm not a very accomplished Inkscape user, although I am learning. Others will probably come along with a better idea, but I thought I'd share mine.

I may have to put up an example, but I'll try the words 1st.
I think I would copy or duplicate the segment of the blue path, where it "clips" the red object. Then replace the current segment of the red path, that you want to be 10 pixels away from the blue, with the identical (copied or duplicated) segment from the blue. That way it will be the same distance from the blue, along the full length of the segment.

I don't have any ideas about making the space a perfect 10 pixels though :(

There may be some way to manipulate them with a stroke, and then remove the stroke. I mean using the stroke to measure the 10 pixels, and then remove it. Snapping nodes and/or paths might be useful here.

Other than that, I'm not sure how to do what you want. But as I said, I'm sure others will have a better answer. I'll be interested to hear them. Good luck!

User avatar
microUgly
Site Admin
Posts: 2985
Joined: Sat Jun 02, 2007 3:13 pm
Contact:

Re: "Background" Stroke?

Postby microUgly » Thu Aug 21, 2008 9:31 am

Here's a demo of how I would do it. I used semi-transparent objects just so you could see how they interact.
Image
  1. First step is what you have
  2. I select the blue object and create "linked offset". This creates a duplicate of the blue object with a single handle that you can drag to make it larger. This is an "offset"-- it's not the same as scaling.
  3. I then select the offset object and the red object and apply a "difference" on them.

You can use guides to create an exact 10px offset.

User avatar
aho
Posts: 180
Joined: Sun Nov 04, 2007 9:51 am
Contact:

Re: "Background" Stroke?

Postby aho » Thu Aug 21, 2008 12:23 pm

>You can use guides to create an exact 10px offset.

Or you can use the XML editor. Just set inkscape:radius to 10.

User avatar
EarlyBlake
Posts: 302
Joined: Tue Jun 03, 2008 5:42 pm

Re: "Background" Stroke?

Postby EarlyBlake » Thu Aug 21, 2008 4:02 pm

Does inset/outset work right. Because you could go Inkscape Prefernces shift ctr P > Steps set outset to 10. Then change the size with outset ctr ) from the same menu as dynamic offset.

User avatar
microUgly
Site Admin
Posts: 2985
Joined: Sat Jun 02, 2007 3:13 pm
Contact:

Re: "Background" Stroke?

Postby microUgly » Thu Aug 21, 2008 4:42 pm

EarlyBlake wrote:Does inset/outset work right. Because you could go Inkscape Prefernces shift ctr P > Steps set outset to 10. Then change the size with outset ctr ) from the same menu as dynamic offset.

Yes, you're right. In fact Shift+Alt+) will do it by 10px already. When I was thinking about the problem originally I chose dynamic offset so it could be used as a clip so you could easily widden or narrow it later, but using clips made it more complicated than I realised when I went to do it myself.

MikeTacular
Posts: 3
Joined: Thu Aug 21, 2008 6:40 am

Re: "Background" Stroke?

Postby MikeTacular » Thu Aug 21, 2008 5:21 pm

I want to say thanks to everyone who has replied. You've all given me a lot of great information and taught me a lot about Inkscape! microUgly, that is exactly what I wanted, thanks! It works perfectly!


Return to “Help with using Inkscape”