Difference between revisions of "Scratchpad clippingtutorial"

From Inkscape Wiki
Jump to navigation Jump to search
(→‎Author(s): Obfuscated email address with reCAPTCHA™ Mailhide)
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{| cellspacing="5" cellpadding="0" style="margin:0em 0em 1em 0em; border:1px solid #F3E533; background:#FCFFCD;width:100%"
{{Tutorial_scratchpad_header}}
| This is a tutorial scratchpad. When this tutorial gets to a level of "completeness" it will be converted into docbook xml format and commited to the SVN.
 
If you edit or add anything, feel free to add your name to the authors list, so you get credit where credit is due!
 
'''Translating this tutorial:''' please do not translate this tutorial yet, it is still in the early stages of development and will be modified drastically. Translations can take place once it has been migrated to the SVN. 
 
'''Images''' please upload SVG format images. However, the PNG thumbs are not working properly on the wiki, so just provide a link to the uploaded SVG on the wiki.
|}


=Title=
=Title=
Line 13: Line 5:


=Author(s)=
=Author(s)=
ryan lerch, ryanlerch at gmail dot com
[http://mailhide.recaptcha.net/d?k=014BL92re4Qx6Ek1NFbVVd4Q==&c=UYRc5kkHClccPOmuZCFhVWXDLSd_TIT0XezmKye1T0I= ryan lerch], josh andler, emailwillbe@in.docbook
 
=Abstract=
=Abstract=
This tutorial covers the usage of the clip and mask functions in inkscape, as well as how to create, apply and edit patterns to fills and strokes.
This tutorial covers the usage of the clip and mask functions in inkscape, as well as how to create, apply and edit patterns to fills and strokes. It is advised that you go through the Basic & Advanced tutorials first so that you will be familiar with
the terms used in this tutorial.
=Body=
=Body=
==Basics==
Clip paths, masks, and patterns are greatly useful additions to an artist or designers' tool set. A common property that all three share is the concept of boundaries. Clip paths and masks bound the contents of the items they contain, whereas patterns are only visible inside the bounds of the object they are applied to (in all three cases cropping visibility).
These methods do not delete parts of your objects, they merely tell the SVG renderer not to display them. This non-destructive editing makes it so that we can also release objects from from their bounded areas as well.
There are benefits to working with clip paths or masks combined with either individual or grouped objects.
==Clipping==
==Clipping==
The clip function in inkscape allows an object or a group of objects to be clipped(cropped) so that only parts of the elements are visible. Clipping can be applied to any object (including linked and imbedded bitmaps.)
The clip function in inkscape allows an object or a group of objects to be clipped (cropped) so that only parts of the elements are visible. Clipping can be applied to any object (including groups, layers, bitmaps, etc.)


The easiest way to understand clipping is to see it in action. Take the following assortment of objects:
The easiest way to understand clipping is to see it in action. Take the following assortment of objects:
Line 24: Line 25:
http://wiki.inkscape.org/wiki/images/Clipmaskpat-f01.svg
http://wiki.inkscape.org/wiki/images/Clipmaskpat-f01.svg


Now, place another object on top of all the others. This is what we are using for our clipping object. Note that the z-order of the clipping object is important, as Inkscape takes the top-most object as the clipping object. Also note that the style(fill, stroke, opacity etc) of the object is irrelevant, all that is used when clipping is the shape of the object.
Now, place another object on top of all the others. This is what we are using for our clipping object. Note that the z-order of the clipping object is important, as the default behavior in Inkscape takes the top-most object as the clipping object. Also note that the style (fill, stroke, opacity etc) of the object is irrelevant, all that is used when clipping is the shape of the object.


http://wiki.inkscape.org/wiki/images/Clipmaskpat-f02.svg
http://wiki.inkscape.org/wiki/images/Clipmaskpat-f02.svg


The next step is to select all the objects that you want clipped and the clipping object, and in the menus go to object > clip > set. The result is:
The next step is to select all the objects that you want clipped and the clipping object. Then in the menus, go to object > clip > set. The result is:


http://wiki.inkscape.org/wiki/images/Clipmaskpat-f03.svg
http://wiki.inkscape.org/wiki/images/Clipmaskpat-f03.svg


As you can see, only the parts of the objects that were inside the bounds of the clipping object are visible now.
Since this is all non-destructive editing, it means that we can also release objects from a clip. Do this by selecting the object that you wish to release, and in the menus go to object > clip release. In the following example, the blue star object was selected, and the clip was released:
 
Clipping does not delete parts of your objects, it merely tells the SVG renderer not to display them. This means that we can also release objects from a clip. Do this by selecting the object that you wish to release, and in the menus go to object > clip release. In the following example, the blue star object was selected, and the clip was released:


http://wiki.inkscape.org/wiki/images/Clipmaskpat-f04.svg
http://wiki.inkscape.org/wiki/images/Clipmaskpat-f04.svg


So the purple clipping object has now returned, and the blue star object is no longer clipped. Note that the other two objects are still clipped, as the clip was applied to 3 seperate objects. These clips still apply and can be released if needed. Because clipping paths can be applied to any object, if you wanted to treat the 3 objects as a whole, you would group them, then apply the clip to the group.
So the purple clipping object has now returned, and the blue star object is no longer clipped. Note that the other two objects are still clipped, as the clip was applied to 3 separate objects. These clips still apply and can be released if needed. Because clipping paths can be applied to any object, if you wanted to treat the 3 objects as a whole, you would group them, then apply the clip to the group.




Line 50: Line 49:


==Masking==
==Masking==
Like clip paths, masks allows an object or a group of objects to be visually cropped with the additional benefit of giving alpha transparency to the items it is applied to.
In the following example you will see both the masks and the items they're applied to. As you'll notice, masks offer the ability for you to texture objects, give them depth, and other things that clip paths can't provide:
- example goes here -
==Patterns==
==Patterns==
Patterns allow the fill or stroke of an object to be set to a repeated tessellation of 1 or more objects that have been defined previously. Below is and example of a pattern being applied to a the fill of a star shaped object:
http://wiki.inkscape.org/wiki/images/Clipmaskpat-f07.svg

Latest revision as of 04:17, 22 April 2010

This is a tutorial scratchpad. When this tutorial gets to a level of "completeness" it will be converted into DocBook XML format and commited to SVN.

If you edit or add anything, feel free to add your name to the authors list, so you get credit where credit is due!

Translating this tutorial

Please do not translate this tutorial yet, it is still in the early stages of development and will be modified drastically. Translations can be done once it has been migrated to SVN.

Illustrations

Please upload images in SVG format. If you use text in the illustrations, don't split sentences or phrases into multiple text objects, as this will make a proper translation impossible. Use a flowtext area and leave enough overflow room for languages which require more space to express the same thing. If appropriate, center the text. Please also start your images in the top left corner; don't leave space until the page border.

Note

the automatically generated PNG thumbs are not working properly on this wiki right now, so just provide a link to the uploaded SVG on the wiki. Try to keep the naming of the images similar, but don't worry too much about the image numbering order, that can be resolved later.


Title

Clipping, Masking and Patterns

Author(s)

ryan lerch, josh andler, emailwillbe@in.docbook

Abstract

This tutorial covers the usage of the clip and mask functions in inkscape, as well as how to create, apply and edit patterns to fills and strokes. It is advised that you go through the Basic & Advanced tutorials first so that you will be familiar with

the terms used in this tutorial.

Body

Basics

Clip paths, masks, and patterns are greatly useful additions to an artist or designers' tool set. A common property that all three share is the concept of boundaries. Clip paths and masks bound the contents of the items they contain, whereas patterns are only visible inside the bounds of the object they are applied to (in all three cases cropping visibility).

These methods do not delete parts of your objects, they merely tell the SVG renderer not to display them. This non-destructive editing makes it so that we can also release objects from from their bounded areas as well.

There are benefits to working with clip paths or masks combined with either individual or grouped objects.

Clipping

The clip function in inkscape allows an object or a group of objects to be clipped (cropped) so that only parts of the elements are visible. Clipping can be applied to any object (including groups, layers, bitmaps, etc.)

The easiest way to understand clipping is to see it in action. Take the following assortment of objects:

http://wiki.inkscape.org/wiki/images/Clipmaskpat-f01.svg

Now, place another object on top of all the others. This is what we are using for our clipping object. Note that the z-order of the clipping object is important, as the default behavior in Inkscape takes the top-most object as the clipping object. Also note that the style (fill, stroke, opacity etc) of the object is irrelevant, all that is used when clipping is the shape of the object.

http://wiki.inkscape.org/wiki/images/Clipmaskpat-f02.svg

The next step is to select all the objects that you want clipped and the clipping object. Then in the menus, go to object > clip > set. The result is:

http://wiki.inkscape.org/wiki/images/Clipmaskpat-f03.svg

Since this is all non-destructive editing, it means that we can also release objects from a clip. Do this by selecting the object that you wish to release, and in the menus go to object > clip release. In the following example, the blue star object was selected, and the clip was released:

http://wiki.inkscape.org/wiki/images/Clipmaskpat-f04.svg

So the purple clipping object has now returned, and the blue star object is no longer clipped. Note that the other two objects are still clipped, as the clip was applied to 3 separate objects. These clips still apply and can be released if needed. Because clipping paths can be applied to any object, if you wanted to treat the 3 objects as a whole, you would group them, then apply the clip to the group.


Clipping can be done on any object, even objects that have had filters applied to them. Below is an example of using clipping to create a bubble effect on a circle:

http://wiki.inkscape.org/wiki/images/Clipmaskpat-f05.svg

A clip can also be done on bitmaps that are embedded into or linked from an SVG:

http://wiki.inkscape.org/wiki/images/Clipmaskpat-f06.svg

Masking

Like clip paths, masks allows an object or a group of objects to be visually cropped with the additional benefit of giving alpha transparency to the items it is applied to.

In the following example you will see both the masks and the items they're applied to. As you'll notice, masks offer the ability for you to texture objects, give them depth, and other things that clip paths can't provide:

- example goes here -


Patterns

Patterns allow the fill or stroke of an object to be set to a repeated tessellation of 1 or more objects that have been defined previously. Below is and example of a pattern being applied to a the fill of a star shaped object:

http://wiki.inkscape.org/wiki/images/Clipmaskpat-f07.svg