Answer
I have found out that this is operation is called:
And many algorithms for this have been proposed. None of the current graphics design applications implement this function but it should not be too hard to do so if one needs to.
Attribution
Source : Link , Question Author : reox , Answer Author : joojaa