Skip to main content

トリミング、crop

Python

py
img = Image.open(fname)
(w, h) = img.size
py
from PIL import Image

PILのインストール

bash
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade Pillow

Bash

bash
convert 変更前.jpg -crop '2048x1536+344+0' 変更後.jpg
  • Width, Height, OffsetX, OffsetY の潤
  • 例は、縦横比4:3にするために左右を切り取った例