How to control the shape of button so I make it to custom shape and only clicked inside its border?

Hi every body.
I want to make a button rounded like circle or any other custom shape and only clicked inside its border.
How is this done?

A component of a UI button is an Image, so maybe you could achieve any desired shape through an image