Batches
Pass one or more files or folders as inputs. Folder discovery filters for supported image formats and produces a plan for each discovered file.
rastry ./public ./marketing/hero.png --to webp --output ./optimized --dry-runIsolated results
Section titled “Isolated results”Batch execution keeps each file result separate. A file can be processed, skipped, failed, or cancelled; one invalid input does not hide successful results from the rest of the batch.
The summary includes:
- processed, skipped, failed, and cancelled counts;
- bytes before and after for processed files; and
- the input and planned output path for each file.
Use –json when a script needs to decide whether to fail a job:
rastry ./public --to webp --dry-run --jsonOutput directories
Section titled “Output directories”Use –output ./optimized to keep results away from source files. If no directory is provided, Rastry derives a sibling filename with the -rastry suffix. Existing outputs are reported as conflicts; they are not silently replaced. See safety for preflight details.