指定サイズに縮小、クリッピングした画像を生成します Clusterのワールドサムネ画像など
2048x1080 -> 1920x1080
画像を中心として両端の余分なピクセルを削除してトリミングします
ファイル名末尾に-trimを付けて保存します
image.png -> image-trim.png
同一ファイル名があった場合上書きします
- Python 3.8.x をインストール
- 必要パッケージをインストール
$ pip install -r requirements.txt# 指定した画像を変換して保存します
$ python auto_clip.py image.png
# サイズ指定も可能
$ python auto_clip.py image.png -W 1920 -H 1080
auto_clip.batに画像をドラック&ドロップするだけ
$ python auto_clip.py -h
usage: auto_clip.py [-h] [-W WIDTH] [-H HEIGHT] image_path
positional arguments:
image_path
optional arguments:
-h, --help show this help message and exit
-W WIDTH, --width WIDTH
-H HEIGHT, --height HEIGHT