You are on page 1of 8

UsingVectormasksandclippingpathstoremovebackgroundsfrombitmap imagesinInkscape

Clippingandmaskingaremethodsforrestrictingwhatpartofanobject(orGroupofobjects)isvisible.Forclipping,a clippingpathdefinesthevisiblepartoftheobjectwhileformasking,thetransparencyorlightnessofoneobject determinestheopacityofasecondobject.Inbothcases,thetargetobjectisnotchangedandcanbeunclippedor unmaskedifneeded.

Simpleexamplesofclipping(top)andmasking(bottom).Theleftcolumnshowsthetextthatservesastheclippingpathandthe textformasking,bothoverlayingbluerectanglesthatarethetargetsoftheclippingandmasking.Intherightcolumnarethe resultsoftheclippingandmasking.

WhileInkscapeisprimarilyascalablevectorgraphiceditoranddoesnotprovideforeditingofbitmapsyoucan importbitmapimages(photos,scansetc)touseasdesignelements,texturesandpatterns. Masksandclippingpathsareveryusefulwhenyouneedtohide/removebackgroundsfrombitmapimagesuchas photographsortocreateinterestingdesignsandeffects.

Thisphotohasamaskofrectanglesandtextappliedtocreatethegrideffectshown.

Masking
Any object can be used to mask another object. The opacity and lightness of the mask determines the opacity of the masked objects. A masked object will be fully opaque only at places that are: inside the mask path, where the mask has maximum lightness (i.e., white), and the mask has maximum Alpha. So to summarize:

Regions with minimum lightness (i.e., black) will be fully transparent. Regions with minimum Alpha (zero alpha) will be fully transparent. Regions outside the mask will be fully transparent.

All this sounds complex but in action it is quite simple: For example if you place a white circle over a bitmap image and then set the circle to mask the image, only the area covered by the white circle will be visible.

HereIhavedrawnawhitecircleobjectoverthetopofthepicture.Thecircleissetwithmaximumopacityand lightness(purewhite).Iamgoingtousethecircletocreateamaskoverthebitmapimage.

TocreateamaskedimageIneedtomakesure bothobjectsareselected(shift+clicktoselect multipleobjectsorclickdragoverbothwiththe selectiontool. andthenuseObject>Mask>Settocreatethe mask

Oncethemaskissetonlytheareacoveredbythe whitecircleisvisible. Itsimportanttorealisethattherestoftheimage isstillexistsandyoucanundothemaskbyusing Object>Mask<Release. Wehavenotcroppedawayanyofthepicture (likesomephotoeditingsoftwareallows)just hiddenthepartwedidnotwanttosee.IfIplace anobjectbehindtheimagemaskitwillbevisible astheareaoutsidethecirclehasbeenmade transparent.

Morecomplexmaskscanbecreatedbyusing theBezierpentooltodrawacustomshapeand thenmakingthefillontheshapewhite. Tip:themoreaccurateyouareincreatingyour maskthebettertheresultswillbe:)thisoneis abithaphazard..... Herethecustomshapehasbeensetasamask andarectangledrawnbehindtheimageto showthetransparency. Tip:Usingasmallamountofbluronyourmask objectwillsoftentheedgesofyourfinalmask.

Usinggradientfillsonyourmaskingobject createsinterestingeffects.Awhitetoblack gradientwilllookasiftheimageisfadingout.

Clipping
Clippingcanbeusedtohidebackgroundsjustlikeamaskbutusesthepathorshapeasaguidetosettheborderof thevisiblearea. Anypath,regularshape,orregulartextobjectcanbeusedasaclippingpath. Toclipanobject(orGroup),selectboththeobjectandtheclippingpath.Theclippingpathmustbeabovethe objecttobeclippedinzorder.ThenusetheObject>Clip>Setcommand.Tounclipaclippedobject,selectthe objectandusetheObject>Clip>Releasecommand.Theclippingpathisthenrestoredasaregularobject,placed justabovetheformerlyclippedobjectinzorder. HereIhavedrawntheclipping pathwiththeBezierpentooland thenmovedittotheleftand exaggeratedthestrokesizeand coloursothatititsclearlyvisible

Makesureboththeimageandthepathare selectedandthenuseobject>clip>settocreate theclip. Theclippingpathsetmakesallareasoutside theboundingpathtransparent

You might also like