EADST

Python: Merge Two Images

Python: Merge Two Images

from PIL import Image

def get_concat_h(im1, im2):
    dst = Image.new('RGB', (im1.width + im2.width, im1.height))
    dst.paste(im1, (0, 0))
    dst.paste(im2, (im1.width, 0))
    return dst

def get_concat_v(im1, im2):
    dst = Image.new('RGB', (im1.width, im1.height + im2.height))
    dst.paste(im1, (0, 0))
    dst.paste(im2, (0, im1.height))
    return dst

save_dir = "./merge"
for root, _, imgs in os.walk("./left_imgs/"):
        for img in imgs:
            im1 = Image.open('./left_imgs/{}'.format(img))
            im2 = Image.open('./right_imgs/{}'.format(img))
            new = get_concat_h(im1, im2)
            new.save(os.path.join(save_dir, img))
相关标签
About Me
XD
Goals determine what you are going to be.
Category
标签云
CC Disk Linux ChatGPT Hilton JSON Bert Safetensors TSV Hungarian Llama 关于博主 WebCrawler Paddle GIT 长期记忆 阿里云 COCO Template PyCharm 飞书 云服务器 Card 财报 Land TensorFlow Google Review scipy Streamlit Shortcut Search 域名 Docker Use PDF git SAM RGB HuggingFace EXCEL UNIX MD5 XML Agent Attention 论文速读 Qwen2 uWSGI icon CSV CLAP Python SPIE Statistics Conda Bin CEIR NLTK Pillow FP16 VPN Sklearn Tracking Clash Git LeetCode 多进程 LoRA GoogLeNet LLAMA BeautifulSoup Django NLP LaTeX Miniforge 算法题 News Password Augmentation VSCode 第一性原理 Pandas Video 搞笑 Food OCR SVR 图标 Mixtral 公式 InvalidArgumentError AI 报税 PyTorch 强化学习 个人博客 CV Ubuntu torchinfo printf Anaconda Zip 继承 腾讯云 Web Windows 多线程 OpenAI Magnet 版权 Jev VGG-16 Vim ONNX 证件照 XGBoost 签证 DeepSeek Baidu Plate Vmess PIP FlashAttention Crawler Paper transformers Tensor OpenCV ModelScope API网关 GPT4 Jupyter Michelin logger ResNet-50 Harness Pickle SQLite QWEN Proxy Website 自我改进 顶会 CUDA Hotel Tiktoken Numpy CAM Math Knowledge Markdown BF16 llama.cpp v2ray v0.dev Domain Firewall FP64 TTS Github Input Qwen Jetson NameSilo PDB Distillation Translation Nginx CTC 递归学习法 Quantize 图形思考法 Permission WAN 音频 GPTQ 论文 Animate Data BTC Color Interview Algorithm UI Cloudreve RL Rebuttal Bitcoin tar Claude Diagram Breakpoint Logo TensorRT HaggingFace Random Dataset Datetime Ptyhon Image2Text FP32 ms-swift Plotly RAR mmap DeepStream hf SQL API Base64 IndexTTS2 Heatmap tqdm FastAPI Qwen2.5 Gemma 净利润 YOLO Bipartite Transformers Freesound git-lfs C++ FP8 uwsgi GGML LLM Quantization diffusers Pytorch Excel
站点统计

本站现有博文340篇,共被浏览1004678次

本站已经建立2714天!

热门文章
文章归档
回到顶部