I am using a clipping mask to cut out some shapes. These shapes are composed of a rectangular "base color" and then some extra shapes overlaid for shading. However, with the clipping mask I get bright outlines where the base shapes show through the shading. See the attached pics:

enter image description here enter image description here

Is this the wrong way of doing this? Is there a way to fix this? I thought it'd be convenient to define the shape in a single clipping mask, so I can modify the shape and coloring/shading separately.

  • 2
    What happens when you turn of anti-aliasing in the preferences? Generally hairlines such as this in Illustrator are due the anti-aliasing for screen preview and aren't actually part of the artwork. They traditionally vanish upon output. Another option may be to use multiple fills in the Appearance panel rather than multiple stacked objects.
    – Scott
    Sep 16, 2012 at 22:07
  • The lines disappear when I turn of AA — to be replaced by jagged edges — but they are still in the exported PNG. What do you mean by 'multiple fills'?
    – noio
    Sep 17, 2012 at 13:00
  • Use the Appearance panel to add fills. You've basically just got 3 fills, you don't need 3 separate objects. Just add 2 additional fills to the bottom shape.
    – Scott
    Sep 17, 2012 at 13:05

2 Answers 2


A clipping mask might be the long way around. Try using the compound path for all fills.

Start with your base layer (fill color).

Then copy and paste in front (CMD-F on Mac) fill with your gradient and adjust the transparency. This might give you the desired result without the headache of the thin lines.

If that fixes the problem, make sure you group them afterwards to ensure that they are being moved together.

As a rule (for me) I don't use clipping masks unless I am using rastered images. There are way more ways to create a vector without mucking up the process by putting it in a Clipping Mask. Use the Pathfinder tool as much as you can but be sure you are "Expanding" the vector.

If this option doesn't help with your issue. Try "Flatten Transparency" under object, although the above should give the desired result.

  • Heya! This is what I ended up doing, but hoped to avoid. I wanted to be able to edit the shape (clipping mask) without having to re-copy-paste the shading gradient. Separating fill colors and shape seems like one of the intuitive advantages of vector editing. Also, keeping the separate components in the shape (not expanding) allows me to adjust the details of that (e.g: moving a hole that is cut out from the shape). Sad but true, I found that expanding & copying is the easiest & cleanest solution, at the expense of flexibility.
    – noio
    Oct 10, 2012 at 11:28

This colored-edge effect can't be removed. Actually, there are two layers with the same mask, and illustrator rendering engine use approximation methods, that can't detect identical curves.

That is why white object placed behind identical black object gives a tiny line.

Render artwork in higher resolution, then downscale it.

p.s. Rendering in PNG gives very good results. Maybe, there are optimized algorithms triggered.

  • Or use Photoshop, which has far better masking (plus dithered gradients and better antialiasing). Clipping masks in Photoshop don't have this issue. Sep 21, 2012 at 3:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.