How to crop the border of an image to the shape i need

It’s possible to manipulate GUI elements with shaders. There are some useful informations in this thread : The material of a GUI element - #7 by mawa

I don’t know if there is an easier way to achieve it.