Prepare the next step by using the PIL synthesis image

xiaoxiao2021-03-05  29

Looking at everyone is diligently practicing what I like, and then look at my practice, sweat. The words retired, and they looked at the end of the world in the world. They were very interesting. Although they won't make pictures, they also intend to make a point to contribute, and be a T-Shirt synthesis system. The first step first combined two pictures into one. Since writing in this post, it is obvious that we have to use Python, first download PIL (http://www.pythonware.com/products/pil/) casual Pick two pieces picture: This topic Related Pictures This topic is OK, the next task is to post the small map to the big picture. After reading the PIL's documentation, the steps are as follows:

1. Read two pictures 2. Two images are specified for RGBA or L and other patterns. See Documentation for details 3. Create a whiteboard diagram of the same size as large map 4. Will small map Paste to this whiteboard 5. The whiteboard and big picture Python basically followed this step, the entire code is very simple:

Logo = image.open ("logo.gif") # 读 两 图 d ("Dog.jpg") # 读 两 图片 ('RGBA', LOGO.SIZE, (0,0,0,0)) # 建 一 一 大 大 小 小 图 图 图 小 图 到 图 到 到 到 到 到 到 到 到 到 到 到 到 到 到 到 到 到 到 到 到 到 到 到 到 到 到 这个Synthetic whiteboard and big picture img1.show () # 看 合 后 图成 成 效 如:: This topic related pictures OK, with this foundation, we can do more things :)

转载请注明原文地址:https://www.9cbs.com/read-34264.html

New Post(0)