image compression

Batch compressing store catalog images before platform uploads

A practical terminal workflow for shrinking raw product photos before bulk CSV uploads to Shopify or WooCommerce.

By Keisha Fairbairn·September 22, 2026·4 min read
What matters here
  1. E-commerce platforms frequently store raw uploaded photos without sufficient asset payload optimization.
  2. In-place CLI compression reduces catalog byte sizes while keeping file dimensions and extensions intact.
  3. Preserving input formats prevents broken image path references during bulk CSV product imports.

The problem with raw catalog uploads

E-commerce managers often inherit raw camera assets directly from photography teams. These files land on local drives as uncompressed 10-Megabyte JPEGs or massive PNGs with hidden metadata. When you upload these raw files directly to Shopify or WooCommerce, two things happen. First, the upload process stalls because of sheer file volume. Second, while platforms apply basic automatic resizing, they frequently preserve bloated payloads that degrade store load speeds on mobile networks.

Product listing pages require tight asset budgets. If a single collection grid loads twenty product cards, carrying unoptimized primary images easily pushes page weights past five megabytes. That payload directly degrades performance metrics. High bounce rates on mobile stores frequently stem from delayed Largest Contentful Paint spikes caused by uncompressed hero images. We detailed these asset thresholds in our review of LCP budgets, AVIF adoption, and asset payload caps.

Why format and dimension preservation matter for CSV imports

Bulk product management relies on CSV spreadsheets. Platforms like WooCommerce and Shopify map image columns to direct local or hosted image URLs. If an optimization tool renames files, alters file extensions, or changes pixel dimensions, it breaks your store staging environment.

A JPEG referenced in your CSV must remain a JPEG on disk. Changing extensions from product-01.jpg to product-01.webp during compression invalidates your spreadsheet references, forcing tedious manual corrections across hundreds of rows. Furthermore, changing image aspect ratios warps product layout grids in theme frontend templates. Store workflows require strict in-place compression: reducing byte size without touching dimensions, file names, or file types.

Setting up terminal batch compression

Running optimization scripts directly in the terminal gives catalog managers total control over pre-upload assets. Instead of dragging files through web interfaces or relying on heavy server-side WordPress plugins that strain hosting memory, you handle optimization locally before files touch the cloud.

The open-source terminal utility published as @pipic/cli on npm provides a straightforward pathway. It handles batch compression on raw folders, maintaining identical directory structures and filenames.

1. Direct CLI execution

You can run the command-line utility directly through Node package runners without complex installations. Open your terminal, navigate to your product staging directory, and execute the utility against your target image directory:

npx @pipic/cli process ./catalog-2026/spring-launch

The tool processes JPG, PNG, WebP, and AVIF files. It evaluates each asset, shrinks the file size, and writes the output. Because the utility performs atomic in-place replacement by default, file names and extensions remain completely unchanged. Your CSV image paths remain accurate.

2. Output directory isolation

If your workflow requires preserving untouched originals on a backup drive, route the compressed outputs to a dedicated folder instead of overwriting the source files:

npx @pipic/cli process ./raw-assets --output ./dist-assets

This structure ensures your high-resolution archival masters stay safe while producing a lean directory ready for bulk cloud upload via FTP, Shopify CLI, or standard admin interfaces.

Comparing web interfaces and CLI pipelines

For quick visual checks on a handful of marketing banners, browser tools work fine. The PiPic web interface allows dropping up to 100 images per batch at 8 MB per file with zero account setup. However, catalog operations rarely happen ten files at a time. Managing store refreshes with thousands of SKUs requires scripting and automation.

Terminal utilities fit directly into existing folder-based prep workflows. We previously evaluated these operational differences in our guide on image compression options compared: Web UI, build plugins, and CLIs. Command-line execution avoids browser memory crashes when working through dense asset trees.

Trade-offs and operational constraints

No asset pipeline is without trade-offs. You must plan around API quotas and batch boundaries when prepping large stores.

  • Monthly quotas: The free CLI tier provides 100 compressions per month. A Pro tier expands that limit to 5,000 compressions per month. Stores launching hundreds of new SKUs weekly will exhaust free allowances rapidly.
  • Batch file size limits: Individual source images must remain under 8 MB each. Camera RAW files or massive TIFF exports from photo studios must be exported to standard high-quality JPGs before passing through the CLI pipeline.
  • Data privacy guarantee: Server processing is strictly ephemeral. Images exist on remote processing infrastructure only for the duration of the compression job and are deleted immediately afterward. No telemetry or image content is retained or stored.
  • Format retention: Compression algorithms tune loss levels to maintain visual quality without altering image pixel dimensions. However, if your target is converting legacy JPEGs into modern WebP or AVIF formats to save additional bytes, in-place CLI replacement will not perform format translation. It preserves input formats strictly.

Integrating into store launch checklists

Before launching a store update, make asset optimization a mandatory gate step. Build a repeatable process for catalog managers:

  1. Export raw product images from photography retouching folders into a staged local directory.
  2. Verify that individual file sizes do not exceed 8 MB and conform to standard Web formats (JPG, PNG, WebP, AVIF).
  3. Run the terminal compression script across the staged folder using atomic in-place overwrite.
  4. Verify layout alignment and visual fidelity on a sample set of compressed product images.
  5. Execute your Shopify CSV import or WooCommerce product sync.

By shifting asset compression to the local terminal prior to ingestion, you keep cloud hosting lean, lower mobile payload sizes, and preserve exact CSV link references across your catalog.

More from PiPic News