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

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

本站已经建立2719天!

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