I am working with a vector image (not my design, bought as stock) and wish to overlay all of it with a gradient from the top to the bottom of the image.

enter image description here

Each of the many objects in the image is comprised of a compound path (as a grey outline... not all the greys are the same shade!) and a path in the middle (as a white fill). The fill therefore blocks out the objects behind it, which is essential.

I first tried to apply a fill to the whole group of objects, but found it covers both the outlines of the objects and the fills, which removes any distinction between them.

enter image description here

(Note ^ I want that behaviour over every object, not just one - e.g. the gradient will not 'restart' with each new object)

I have also selected one of the white fills and used Select > Same > Fill Color to remove all the white fills... but now you can see objects through each other!

I next tried selecting everything of the same stroke colour, but couldn't group them together to apply a fill (as they are already in many different groups sorted into individual trees, etc... with the fills included in each individual group). The ungroup function didn't seem to work here for some reason.

Is there any way for me to selectively apply a fill to only the outline compound paths?

  • Am I correct to assume that you want one single gradient across all objects?
    – Welz
    Sep 19, 2017 at 17:27
  • You should be able to apply a gradient as the outline of everything (I may be missing something)
    – Welz
    Sep 19, 2017 at 17:28
  • The strokes appear expanded. Is there a reason you can't simply apply the gradient tot he shapes which were strokes?
    – Scott
    Sep 19, 2017 at 17:55
  • Instead of selecting White select all gray.
    – joojaa
    Sep 19, 2017 at 18:02
  • @WELZ Yes, one gradient across all objects. When I select the entire group, the gradient 'fills' all the objects too, though. Is there a better way than having to manually select every outline and avoid selecting the inner fills?
    – Jack Nagy
    Sep 20, 2017 at 3:11

2 Answers 2


Part 1:

To select the objects, use the Magic Wand Tool - Y and select one (You can try adjusting the tolerance until you get it to select them all)

Part 2:

The only way to do what you're describing is to group the items together. (You may want to do it by layer individually. Lock all layers besides one you're doing and do one layer at a time).

  • Group the items Ctrl/Cmnd+G

  • Take away fill color and stroke color / (So it doesn't interfere/mix with the desired color)

  • Go to Appearance Panel Shift+F6

  • Click on the Drop-down Menu (on top right)

  • Select: Add New Stroke

  • Choose the color you want for the stroke.

Note: If you dont group the items than it wont work. It will just create the Gradient on each item (which is not the desired effect).

Without Grouping:

Image without grouping

With Grouping:

Image With Grouping

Quick Step by Step GIF:

Step by Step GIF


If the overlapping objects are causing issues and you don't mind destructively flattening the paths you can use Pathfinder's "Merge" on the group first.

Other than that it seems this is mostly a selection issue. So...

  1. Select the group you want to apply the gradient to and enter isolation mode (either double click the object or use the button in the control bar). This prevents you accidentally selecting objects outside the group.

  2. Select all the non-white objects within the group.

    • Select a single white object
    • Select → Same → Fill Color
    • Select → Inverse
  3. Apply a gradient across your selected objects with the Gradient Tool.

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.