[solved] Raster-image exclusion outside vector-path? How to?

Post questions on how to use or achieve an effect in Inkscape.
Mojo McCracken
Posts: 4
Joined: Sat Feb 09, 2008 1:21 am

[solved] Raster-image exclusion outside vector-path? How to?

Postby Mojo McCracken » Sat Feb 09, 2008 1:37 am

Alright. This is a bit tricky to explain, so I've made a quick sketch concerning my problem:

Image

As you might have figured out, I wan't to do what the sketch implies... But the way I did it when brewing the sketch, is by far optimal (IE: It's extremely time consuming and you can't move the zombie or the bubble without starting all over). I was wondering if it's possible to command the bubble path to exclude the image (.jpeg) from outside it's path?

I really hope this is understandable. If it isn't, then yell up!

User avatar
kelan
Posts: 178
Joined: Thu Sep 06, 2007 12:55 am
Location: Unicorn of Open Source
Contact:

Re: Raster-image exclusion outside vector-path? How to?

Postby kelan » Sat Feb 09, 2008 2:55 am

Sure, it's pretty easy. The simplest method is to clip the image with a copy of the cloud shape. Here are the steps:
  • Select the cloud shape and duplicate it (Ctrl-D).
  • The cloud copy will still be selected, so now select the image by holding Shift and clicking it.
  • Go to Object menu, choose Clip -> Set.

That will get what you want. If you group the cloud and image, you can move them around and they'll stay in the same positions relative to each other so it still looks right. However, if you need to edit the cloud shape, the clipping won't line up any more. To fix it, select the image, go to Object -> Clip -> Release. Delete the copy cloud shape that appears and redo the clipping steps above.

If you think you'll do a lot of editing to the cloud, you can keep the image automatically clipped correctly by using a Clone of the cloud instead of a duplicate. So in step 1 from above, use Alt-D instead of Ctrl-D. Now when you edit the original cloud shape, the clipping shape changes and the image is still clipped correctly.

There's another nifty thing you can do with object clipping, but I'll put it in a separate post below. The steps above give you the basic method.

User avatar
kelan
Posts: 178
Joined: Thu Sep 06, 2007 12:55 am
Location: Unicorn of Open Source
Contact:

Re: Raster-image exclusion outside vector-path? How to?

Postby kelan » Sat Feb 09, 2008 3:10 am

You can clip the image in a way so that you can actually move the image around behind the clipping region. Essentially it lets you move the image while the "window" that the image shows through stays put. This would be useful if you wanted to more precisely position the image without having to Release and Set the clip over and over. Here's how.

  • You need to put the image in group by itself. Version 0.46 lets you do this directly, by just selecting the image and pressing Ctrl-G. Earlier versions force you to select more than one object for grouping to work. So create a dummy object and group it with the image. Then use Ctrl-click to select the dummy object and delete it. The image will be left by itself in the group.
  • Now follow the steps above to clip image, like normal.
  • Ctrl-click the image. This selects the image object itself, rather than the group object that would be selected if you clicked without holding Ctrl.
  • Here's the fun part. Move the image around, and you'll see that it moves, but the "window" shape (in this case the cloud) stays put.

Mojo McCracken
Posts: 4
Joined: Sat Feb 09, 2008 1:21 am

Re: Raster-image exclusion outside vector-path? How to?

Postby Mojo McCracken » Sat Feb 09, 2008 3:18 am

kelan wrote:Sure, it's pretty easy. The simplest method is to clip the image with a copy of the cloud shape. Here are the steps:
  • Select the cloud shape and duplicate it (Ctrl-D).
  • The cloud copy will still be selected, so now select the image by holding Shift and clicking it.
  • Go to Object menu, choose Clip -> Set.

That is nearly exactly what i want!

The only problem is, that the zombie doesen't seem to mind the width of the cloud's stroke, and ignores the inline padding:

Image

And thank you for the extra bag of tricks. I'll check them out!

EDIT: Well spank my ass and call me Betty! - What I need is the Object -> Mask -> Set!

Victory is at hand!

User avatar
RobA
Posts: 335
Joined: Fri Aug 10, 2007 1:22 am

Re: Raster-image exclusion outside vector-path? How to?

Postby RobA » Tue Feb 12, 2008 2:52 am

Better to just raise the cloud path on top and stick with clip. Using Mask will mask the contents based on the colour of the mask object (Black will make the object appear transparent and white will make it opaque, with shades of grey in between.) This requires more horsepower than simple clipping to a shape.

-Rob A>


Return to “Help with using Inkscape”