I watched everyone diligently practice what they liked. Then I looked at my exercises and looked at them with shame.
Let's get down to the point. These two days, they watched Tianya participate in the T-shirt competition. It was very interesting. Although they did not make a picture, they also planned to make some contributions to the curve and build a T-shirt Synthesis System.
The first step is to combine the two images into one, since the post is written, it is obvious that we want to use python to do, download Pil (http://www.pythonware.com/products/pil/) first)
Select two clips:
Images related to this topic
Images related to this topic
OK. The next task is to paste the thumbnail to the big image. Take a look at the Pil documentation. The procedure is as follows:
1. read two images 2. Set the two images to the rgba or l mode. For details, see the document. 3. Create a whiteboard with the same size as a large image. 4. Add paste to the whiteboard. 5. Combine the whiteboard and big image |
Python follows this step, and the entire code is very concise:
Logo = image. Open ("logo.gif") # read two images Dog = image. Open ("dog.jpg") # read two images Layer = image. New ('rgba', logo. Size, (,) # create a whiteboard image of the same size as a large image. Layer. paste (DOG) # upload the small image paste to the whiteboard. Img1 = image. Composite (layer, logo, layer) # combine the whiteboard and big image Img1.show () # view the merged image |
The synthesis result is as follows:
Images related to this topic
OK. With this foundation, we can do more things :)