This document summarizes recent CLI runs against test-imgs/ using different presets, formats, and bulk modes.
- Source:
./test-imgs/test1and./test-imgs/test2(PNG images) - Platform: macOS
- Node: >= 18
- Command:
optimg ./test-imgs/test1 --bulk --preset balanced --yes - Files processed: 7
- Overall reduction: 39.2% (21.96MB → 13.35MB)
- Average size reduction: 39.4%
- Total saved: 8.61MB
- Avg time/file: 1440ms
- Command:
optimg ./test-imgs/test1 --bulk --preset performant --yes - Files processed: 7
- Overall reduction: 39.2% (21.96MB → 13.35MB)
- Average size reduction: 39.4%
- Total saved: 8.61MB
- Avg time/file: 1459ms
Note: For this dataset, balanced and performant produced identical aggregate reductions.
- Commands:
node bin/cli.js ./test-imgs/test1 --bulk --preset default --yesnode bin/cli.js ./test-imgs/test1 --bulk --preset quality --yes
- Files processed: 7 (each run)
- Overall reduction: 39.2% (21.96MB → 13.35MB)
- Average size reduction: 39.4%
- Total saved: 8.61MB
- Observation: Identical results across
default,balanced,quality, andperformantdue to lossless WebP encoding.
- Command:
optimg ./test-imgs/test1 --bulk --format avif --quality 80 --yes - Files processed: 7
- Overall reduction: 2.2% (21.96MB → 21.49MB)
- Average size reduction: 0.2%
- Total saved: 487.32KB
- Avg time/file: 5109ms
- Observations:
- Some PNGs grew when converted to AVIF (e.g.,
geustral_init-5.rop_image1.0034.pngandScreenshot 2025-11-25 at 17.52.33.png). - AVIF may underperform on certain screenshot-style or synthetic textures at quality 80.
- Some PNGs grew when converted to AVIF (e.g.,
- Command:
optimg ./test-imgs/test2 --bulk-inplace --preset balanced --yes - Files processed: 21
- Overall reduction: 39.2% (65.88MB → 40.05MB)
- Average size reduction: 39.4%
- Total saved: 25.84MB
- Avg time/file: 1560ms
- Behavior: Outputs optimized files next to originals (preserves directory structure).
- WebP (
balancedandperformant) delivered consistent ~39% reductions on this dataset. - All presets currently run with
lossless: truefor WebP/AVIF; quality values have limited impact under lossless. - AVIF at quality 80 had mixed results and increased sizes for some files; use selectively and validate on your own assets.
--bulk-inplaceis useful when you want optimized files adjacent to sources without creating new folders.
Run locally:
optimg ./test-imgs/test1 --bulk --preset balanced --yes
optimg ./test-imgs/test1 --bulk --preset performant --yes
optimg ./test-imgs/test1 --bulk --format avif --quality 80 --yes
optimg ./test-imgs/test2 --bulk-inplace --preset balanced --yes