This question already has an answer here:
I have created an object and set it's opacity to 30% however I want the object to get less opacity as it goes down how can I apply gradient opacity?
This question already has an answer here:
I have created an object and set it's opacity to 30% however I want the object to get less opacity as it goes down how can I apply gradient opacity?
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
I will assume you have an object, that you want to mask - although your question is not really very clear. So, this is a guess. But anyway, this technique works on vector objects and raster objects in Illustrator.
I used this image as an example:
Draw a rectangle with no stroke, over the object to be masked - I assume if it's a vector, then object itself should be grouped.
Use the Gradient Tool on the rectangle to apply a gradient that goes from 100% white to 100% black.
When you make the mask, the white end of the gradient will be 100% opaque, and the black end will be 100% transparent.
Select both the object for masking, and the rectangle with the gradient.
Open the Transparency panel - if you cant already see it, click Window
> Transparency
. Hit the Make Mask
button.
Open the gradient panel in Illustrator.
You can find the colors which you have used for the gradient.
Then click one of the colors you have to reduce the opacity in the options below:
If you cant find the gradient panel in the right side widget, please go to Window and click on Gradient for the panel to appear.