Compound Path is a tool that group multiple objects into one and the fill and lining which is applied to the most back object applies to all the other objects. Furthermore, you can cut the overlapping parts and display them transparent.
To take a simple example, imagine overlapping different sized circles and create a donut shaped illustration which has a hold in the middle.
You can also apply it as clipping mask.
It is hard to understand just with words. Let’s see what we can do with images
There are two ways to create compound path. 1. [Object > Compound Path> Create] in Menu Bar. 2. [Right Click > Create Compound Path]. Do this after selecting more than two objects.
When removing compound path, follow the same step mentioned above.
Arrange three filled no line objects to overlap. Arrange the pink object at most bottom (most back) and create compound path.
Three objects are compounded, all of them turned pink like the most bottom object, and holes are created on the overlapping parts.
Like what you see, the layers are compounded as well.
Compound Path is different from Union. When multiple objects are compounded, 1) the path shape remains the same, 2) most back object setting applies to everything, 3) overlapping parts cut 4) and path can be removed.
They look similar but there are many differences.
Compound Path is also different from Exclude, 1) it cannot be modified individually with Appearance or Direct Group Selection Tool and 2) the most back setting applies to everything.
I created compound path with the most back pink object. Every line has turned pink.
The most back pink line object setting is applied to other filled objects. Everything has turned into pink line circles.
The most back filled object setting is applied to other objects. Everything turned into filled objects and holes are created on the overlapping parts.
All the objects has transformed according to the most back objects. The overlapping part cut.
When overlapping parts are many, some of them do not cut.
To cut the parts where they should be cut, adjust them with <Attributes Panel>. Use [Window > Attribute > Use Even Odd Fill Rule].
With the [Attributes Panel], you can cut the parts where did not.
However, you cannot cut parts where more than three objects are overlapping even with [Even Odd Fill Rule]. Remember you can only cut parts where two objects are overlapped.
Object shape is restored when compound path is removed. However, the colors do not change back.
Outline the text, create Compound Path, and create Clipping Mask.
For further information, refer to How to Clip Image with Multiple Objects (Illustrator).
You do not need to outline the objects when clipping only with text. Refer to How to clip text with image in Illustrator.
Clipping Mask clipped the objects with text and star shape. Now you can see the image under. Usually Clipping Mask hides but when Compound Path is involved, it shows hidden elements.
The drawback is it overlaps everything.
In this tutorial, we demonstrated how to use Compound Path with images. You can create many effects using Compound Path.
Start overlapping objects by yourself and learn from experience. For further information on Clipping Mask, refer to How to clip a picture with Illustrator.