<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          python實(shí)現(xiàn)橫向拼接圖片

          共 1299字,需瀏覽 3分鐘

           ·

          2021-04-10 10:16


          本文實(shí)例為大家分享了python實(shí)現(xiàn)橫向拼接圖片的具體代碼,供大家參考,具體內(nèi)容如下:


          import osfrom PIL import Image #單個(gè)圖片的大小為150*150UNIT_SIZE = 150TARGET_WIDTH = 5 * UNIT_SIZE path = "存儲(chǔ)圖片的文件夾地址"images = []imagefile = []#存儲(chǔ)所有圖片文件名稱for root, dirs, files in os.walk(path): for f in files:  images.append(f)#我這里是將五張圖片橫向拼接for i in range(5): imagefile.append(path+'/'+images[i])target = Image.new('RGB',(TARGET_WIDTH, UNIT_SIZE))left = 0right = UNIT_SIZEfor image in imagefile: #print(image) #將現(xiàn)有圖片復(fù)制到新的上面 參數(shù)分別為圖片文件和復(fù)制的位置(左上角, 右下角) target.paste(Image.open(image), (left, 0, right, UNIT_SIZE)) left += UNIT_SIZE right += UNIT_SIZE #圖片的質(zhì)量 0~100 quantity_value = 100 target.save(path+'/end.jpg', quantity = quantity_value) 

           

          實(shí)現(xiàn)的圖片效果:

          「?? 感謝大家」

          如果你覺得這篇內(nèi)容對(duì)你挺有有幫助的話:

          1. 點(diǎn)贊支持下吧,讓更多的人也能看到這篇內(nèi)容(收藏不點(diǎn)贊,都是耍流氓 -_-)
          2. 歡迎在留言區(qū)與我分享你的想法,也歡迎你在留言區(qū)記錄你的思考過程。
          3. 覺得不錯(cuò)的話,也可以閱讀近期梳理的文章(感謝鼓勵(lì)與支持??????):

          老鐵,三連支持一下,好嗎?↓↓↓


          歡迎大家加入到知識(shí)星球這個(gè)大家庭,這里一定有與你志同道合的小伙伴,在這里大家可以一起交流,一起學(xué)習(xí),一同吹逼,一同玩耍。。。


          長(zhǎng)按按鈕  “識(shí)別二維碼” 關(guān)注我
          更多精彩內(nèi)容等著你哦

          點(diǎn)分享

          點(diǎn)點(diǎn)贊

          點(diǎn)在

          瀏覽 79
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          分享
          舉報(bào)
          評(píng)論
          圖片
          表情
          推薦
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          分享
          舉報(bào)
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  无码人妻一区二区三区免费n狂飙 | 北条麻妃无码91 | 人妻精品导航 | 好吊视频一区二区三区四区 | 家庭乱轮av |