Reputation: 1232
I've got a jpg image and I want to return the same image, with a "highlight" effect.
Basically, I want to pass the script the xy coords, and redraw the image darkened, with an ellipse that remains in the original colouring.
Initially I did this by creating a second image, same dimensions, and drawing a white elipse, then merging them together at 40% or so. The effect works, but the "highlighted" area is obviously a bit washed out.
Anyone know how I can basically delete that ellipse so it is purely transparent and then merge it on top of the original for a clear highlight?
Upvotes: 2
Views: 503
Reputation: 1458
You can use a png for the second image with the elipse being completely transparent while the area that you want darkened has an alpha of 20% (or whatever works best). When you merge the images, you can use imagecopy instead of imagecopymerge as the alpha (transparent) value is included in the second image already.
Upvotes: 1