This article mainly introduces the Python implementation based on two images to generate rounded corner of the effect of the method, example analysis of Python using PIL module for image processing skills, with a certain reference value, the need for friends can refer to the
This article describes the Python implementation method based on two pictures to generate rounded corner icon effect. Share to everyone for your reference. The specific analysis is as follows:
Using the PiL mask feature, overlay the original picture and fillet picture, and use the fillet picture as a mask to generate a new fillet picture
?
| 1 2 3 4 5 6 |
From pil import Image flower = Image.open (' flower.png ') border = Image.open (' border.png ') Source = Border.convert (' RGB ') f Lower.paste (source, Mask=border) flower.save ("Round.png") |
I hope this article will help you with your Python programming.