Build a zero-retention image step into your publishing pipeline
Use PiPic’s open-source CLI in a release script, but scope the privacy promise to remote processing and keep local build artifacts under control.
Compress source images before the site generator copies them, then review the built output before deployment.
Documentation sites collect images quietly. A few screenshots land in a guide, then more arrive with each release. The generator copies them into the published site, and the output folder grows even when the text barely changes.
A reliable fix is to compress selected source images before the site build. PiPic’s open-source CLI can fit into that step, but there is an important distinction: the command runs from your development environment; compression itself is remote. PiPic says it deletes uploaded files immediately after processing. Treat the images as uploads, not as files that never leave your machine.
Find the directory that holds images tracked with the documentation: perhaps a shared assets folder or images beside individual pages. Do not begin by compressing the generated output directory. Most static generators recreate that directory during a build, so a change there may disappear on the next run. It can also leave you with a build whose media differs from the source files in the repository.
Make a list of eligible files in that source location. PiPic supports JPG, PNG, WebP and AVIF images up to 8 MB per file. Leave other formats out of the compression step. Be selective: diagrams with fine text and screenshots used to demonstrate interface details deserve a closer check than decorative photos.
The exact wiring depends on the generator and repository layout. Keep the compression step narrow: target the documentation image directory, not every image the build happens to produce. That makes it easier to see what changed and avoids processing logos, generated charts or unrelated assets by accident.
Compression is not resizing. PiPic preserves image dimensions, so a screenshot exported at several thousand pixels wide will remain that size. Resize oversized source images separately when the page does not need their full dimensions. Also compare important images in the rendered documentation. A smaller file is not a win if small labels or diagram edges become hard to read.
Remember that PiPic’s CLI sends the chosen image to PiPic for processing. PiPic says files are deleted immediately after compression, and its homepage says the CLI sends the image requested and no telemetry. That is a stated handling policy, not the same as local-only processing. Check whether your documentation images are suitable for that workflow before adding it to an unattended build. Our earlier guide to scoping a zero-retention image step in a publishing pipeline covers the distinction between remote processing and local build artifacts.
There is also a quota to plan around. PiPic’s CLI tier includes 100 free images per month, with a Pro plan for 5,000. Avoid recompressing the entire library on every build. Run the step when eligible source images change, and retain the uncompressed originals so a future edit does not start from a lossy copy. If the project’s asset volume exceeds the available allowance, decide which images merit the step rather than sending the whole repository.
After a trial run, compare the generated asset folder with a clean build from the same commit. Check that pages still reference the intended paths, that formats remain usable in the target browsers, and that the visuals hold up at their displayed size. Track the output size over time if asset bloat is a recurring problem; a single successful compression run does not prevent future uploads from growing the folder again.
This approach works because it puts image-size reduction at the boundary between source assets and generated site output. The generator and hosting platform can stay unchanged. PiPic handles selected files; the project’s build remains responsible for copying and publishing them. Keep the target narrow, protect the originals, and make the rendered site—not the compression percentage—the final test.
Use PiPic’s open-source CLI in a release script, but scope the privacy promise to remote processing and keep local build artifacts under control.
A diff-based workflow sends only eligible, modified images to PiPic, keeping routine monorepo work from spending a monthly compression allowance on untouched assets.
Choose a compression workflow by where assets live, how much control you need and who must check the result—not by batch size alone.