How can I apply a gradient overlay to *only* non-white areas of a group?

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?

Answer

Part 1:

To select the objects, use the Magic Wand ToolY 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

Attribution
Source : Link , Question Author : Jack Nagy , Answer Author : WELZ

Leave a Comment