Batch Image Processing for Openclaw

Openclaw Skills for batch image processing compresses, converts, and reorganizes image libraries with resumable CLI workflows and server-friendly automation.

liuyunss
v1.0.0
Jul 17, 2026
0
422
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install batch-image-processing

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install batch-image-processing using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Batch Image Processing?

Batch Image Processing in Openclaw Skills is a filesystem-first workflow for handling large image collections without manual editing. It compresses JPEGs intelligently, normalizes mixed formats like PNG, WebP, GIF, BMP, and TIFF into JPEG, and can reorganize directories using name and metadata rules.

The skill is optimized for production constraints: it chooses jpegoptim for fast JPEG-only optimization, falls back to Pillow when recompression or format conversion is required, and supports CPU-aware threading, remote execution, and restart-safe runs. That makes Openclaw Skills a practical fit for bulk media cleanup, automated server jobs, and repeatable image pipelines.

Batch Image Processing Use Cases

  • Compressing high-quality JPG libraries with minimal visual loss
  • Recompressing already optimized images when jpegoptim would do nothing
  • Converting mixed image sets into one standardized JPEG output
  • Processing 10,000+ files on a CPU-bound server with multithreading
  • Running unattended jobs from cron or over SSH on a remote host
  • Resuming interrupted batch jobs by skipping already-generated outputs
  • Reorganizing flat folders into person-, date-, or category-based structures
  • Resolving naming edge cases with manual name and merge maps in Openclaw Skills

How Batch Image Processing Works

  1. Inspect the source images, file types, and current JPEG quality to decide whether the batch should use jpegoptim or Pillow.
  2. Set the output strategy: use jpegoptim for high-quality JPGs, or Pillow when you need forced recompression, transparency flattening, or mixed-format conversion.
  3. Process files with a ThreadPoolExecutor sized to available CPU cores, and create each destination parent directory before saving.
  4. Normalize image modes to RGB, flatten alpha channels onto a white background, and save the result as optimized JPEG output.
  5. Record status per file and skip existing outputs larger than 100B so interrupted runs can resume safely.
  6. If directory reorganization is required, run a dry-run first, extract metadata from folder names with regex rules, and apply NAME_MAP or MERGE_MAP overrides for edge cases.
  7. For remote or unattended execution, copy the script with scp, launch it over SSH in the background, and monitor progress through the log file with tail.

Batch Image Processing Setup

  1. Install Python 3 and Pillow. Add jpegoptim if you need the fast-path JPEG-only optimizer.
  2. Openclaw Skills works best when the script runs on the host that physically stores the image data.
  3. Copy the script to the machine, then configure SRC_DIR, DST_DIR, DEFAULT_QUALITY, and WORKERS.
  4. Size WORKERS according to nproc and keep a unique output directory for every run.
python3 -m pip install Pillow
sudo apt-get update && sudo apt-get install -y jpegoptim
nproc
scp -i /path/to/key scripts/compress_generic.py user@host:/data/scripts/compress_generic.py
ssh -i /path/to/key -o ConnectTimeout=5 -o StrictHostKeyChecking=no user@host 'python3 -u /data/scripts/compress_generic.py | tee /data/compress.log'
  1. For unattended runs, keep SSH non-interactive, write logs to a stable path, and inspect the tail of the log to confirm completion.

Batch Image Processing Data Schema & Taxonomy

Artifact layout

Artifact Rule Purpose
Source directory Original files on the host filesystem Input to the batch job
Output directory New path per task, typically {original_dir_name}_compressed Prevents run-to-run collisions
Output file JPEG-only .jpg written by Pillow Unified deliverable format
Log file compress.log or terminal output Progress, skip, and failure tracing
Reorg plan Dry-run output before moving folders Confirms grouping logic before changes

Metadata taxonomy

  • quality: JPEG target quality such as 65, 60, or 50 for aggressive compression
  • workers: Thread count derived from CPU core count
  • status: ok, skip, or fail:<error>
  • input_format: JPG, JPEG, PNG, WebP, GIF, BMP, TIFF
  • name_key: extracted folder-name token used for grouping
  • name_map: manual override for ambiguous folders
  • merge_map: alias consolidation map for the same subject
  • dry_run: planning mode that prints actions without moving files

Generated behavior

  • Creates destination parent directories on demand before every save
  • Converts alpha and transparency into a white background for JPEG output
  • Leaves already-generated files in place so reruns are idempotent
  • Supports directory reorganization by parsing folder names, then applying mapping rules

Batch Image Processing Advanced Features

  • Decision-tree routing between jpegoptim and Pillow based on source quality and format
  • CPU-aware multithreading with worker counts tuned to the host
  • Mixed-format normalization and transparency flattening into standard JPEG output
  • Restart-safe processing that skips existing outputs and supports interrupted runs
  • Remote-host execution with scp, SSH, background jobs, and tail-based monitoring
  • Cron-compatible automation with StrictHostKeyChecking and ConnectTimeout hardening
  • Dry-run-first directory reorganization with regex extraction and manual map overrides
  • Long-path fallback using mv when os.rename cannot handle edge cases
  • Output-path isolation per task to prevent collisions across concurrent Openclaw Skills jobs

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*