I am constructing a graphine, used in place of any user’s photograph that does not have such. I have constructed it by using a login and transforming it into geometrical shapes on white background. All is working fine, but i would like to have gradual gradient into transparent at the border of the image.
Currently the generated image looks like
I would like to make it be something like
The way i have produced the desired image in Gimp is:
- Add a layer mask with full transparency
- Select entire image
- Feather selection by 30 px
- Fill the layer mask with white within the selection
Can i perform similar transformations in PHP with Image Magic?
2
Answers
I have managed to alter the approach of Oyinlade Demola and came up with the different way to create the mask, that suited my purpose:
The result that i get is
I wasn't aware that
COMPOSITE_COPYOPACITY
exists, and that was a large part of this question, but usinggradient
is not suitable for the mask.Yes i believe so below is a sample syntax to do so
Please not that the code is not tested when I get in front of my machine I can test and review the code.