首先上來給了一張gif,一條細細的線。思路:將其分成單一的圖片再進行拼接。
這裏使用python3利用PIL庫寫的代碼。
import os
from PIL import Image
im = Image.new('RGB', (2*201,600))#new(mode,size) size is long and width
PATH = '你的路徑'
FILE_NAME = [i for i in os.listdir(PATH)]//這纔是python的正確寫法,kukuku
width = 0
for i in FILE_NAME:
im.paste(Image.open(PATH+i),(width,0,width+2,600))#box is 左,上,右,下
width += 2
im.show()
im.paste(Image.open(PATH+i),(width,0,width+2,600))
如果不加0 ,600的話就成了這樣。。。
這裏用到了PIL的幾個庫,回頭我再專門寫一篇關於PIL的文章。
點擊鏈接