How to Create a Script for Feathering Edges?

related: python - Best way to feather edges in opencv? - Stack Overflow