画像の一括リサイズ・WebP変換と位置情報の削除
Batch image resize, WebP conversion and EXIF/GPS removal
フォルダ内の画像を最大幅をそろえて縮小し、WebP や JPEG に変換して別フォルダへ書き出します。撮影場所(GPS)を含む EXIF 情報は削除し、事前に試運転レポートで確認できます。
できること
ブログやサイトに載せる画像をまとめて軽くします。元の画像は変更せず、別のフォルダに書き出します。
- 最大幅・最大高さに合わせて縮小(拡大はしません)
- WebP・JPEG・PNG への変換と画質の指定(WebP のロスレスも可)
- 撮影日時・カメラ情報・GPS 位置情報などの EXIF、XMP、コメントを削除し、書き出し後に残っていないか再確認
- カメラの回転情報を反映してから削除するので、縦向き写真が横倒しになりません
- 試運転(
--dry-run)で、出力サイズ・ファイル名・GPS を含む画像を事前に一覧表示 - サブフォルダ構成の維持、透過画像を JPEG にする際の背景色指定、CSV/JSON のレポート出力
使い方
python scripts/batch_resize.py photos/ --out web/ --max-width 1600 --format webp --quality 80 --dry-run
python scripts/batch_resize.py photos/ --out web/ --max-width 1600 --format webp --quality 80 --report report.csv
エージェントに「この写真をブログ用に軽くして、位置情報も消して」と頼むと、設定を確認して試運転の結果を見せ、了承後に書き出して、容量の変化と GPS を削除した画像を報告します。
必要な環境
- Python 3
- Pillow(
python -m pip install Pillow)。入っていない場合はインストール方法を表示して止まります。
注意点
- 写真に写っているもの(顔・看板・画面など)は消せません。
- アニメーション GIF/WebP は処理せずスキップします。HEIC/AVIF は標準では読み込めません。
- 色が変わらないよう、カラープロファイル(ICC)は初期設定で残します(個人情報は含みません)。
English description
Shrink a folder of images to a maximum width, convert to WebP or JPEG into a separate folder, remove EXIF data including GPS, and preview everything with a dry run.
What it does
Makes a batch of images web-ready for a blog or website. Originals are never changed; results go to a separate folder.
- Shrinks to a maximum width and/or height (never upscales)
- Converts to WebP, JPEG or PNG with a chosen quality (lossless WebP available)
- Removes EXIF (date, camera, GPS location), XMP and comments, then reopens each output to confirm nothing is left
- Applies the camera's rotation before removing EXIF, so portrait photos stay upright
- A dry run (
--dry-run) lists output sizes, file names and which images contain GPS data before anything is written - Keeps sub-folder structure, sets a background colour when transparent images become JPEG, writes CSV or JSON reports
How to use
python scripts/batch_resize.py photos/ --out web/ --max-width 1600 --format webp --quality 80 --dry-run
python scripts/batch_resize.py photos/ --out web/ --max-width 1600 --format webp --quality 80 --report report.csv
Ask your agent to make photos blog-ready and strip location data. It confirms the settings, shows the dry run, writes the files once you agree, and reports the size savings and which images had GPS data removed.
Requirements
- Python 3
- Pillow (
python -m pip install Pillow). If it is missing, the script stops and shows how to install it.
Caveats
- It cannot remove what is visible in a photo (faces, signs, screens).
- Animated GIF/WebP files are skipped. HEIC/AVIF are not readable without extra plugins.
- The ICC colour profile is kept by default so colours do not shift (it contains no personal data).
インストール方法
- ダウンロードしたZIPを展開します(中に
image-batch-resize/フォルダとSKILL.mdがあります)。 - フォルダごと、使うエージェントのスキル置き場にコピーします。
- Claude:
~/.claude/skills/(プロジェクト単位なら.claude/skills/) - Hermes Agent:
~/.hermes/skills/ - Codex:
~/.agents/skills//Cursor:~/.cursor/skills/ - Claude アプリ(claude.ai):「カスタマイズ → スキル」からZIPをアップロード
- Claude:
- エージェントを再起動し、スキル一覧に表示されることを確認します。
出品者
出品スキル 44 件