PhotoSanitize Enterprise Command-Line Processing

PhotoSanitize Enterprise includes a command-line interface for analyzing and sanitizing images without using the normal graphical workflow. It can be invoked from Windows Terminal, Command Prompt, PowerShell, or an application that launches external processes.

The interface is intended for repeatable operations such as inspecting an incoming image directory, removing metadata from a collection, or generating sanitized outputs through an organization’s existing automation procedures.

An activated Enterprise license is required for command-line image processing.

Running PhotoSanitize from the command line

The installed application executable is named PhotoSanitize.exe. You can run it from its installation directory or provide its full path.

Command-line processing begins with --cli, followed by either analyze or sanitize.

For example, to analyze a single JPEG:

PhotoSanitize.exe --cli analyze "C:\Images\Photo.jpg"

This inspects the file without creating a sanitized output. The console reports information such as the detected format, image dimensions, SHA-256 fingerprint, number of findings, and available capability information.

If C2PA Content Credentials were inspected, the output may also include their validation status.

Analyzing a folder

The command-line interface accepts individual files, folders, and multiple input arguments.

To analyze a directory:

PhotoSanitize.exe --cli analyze "C:\Images\Incoming"

PhotoSanitize searches the selected directory tree for supported images and analyzes them individually. This is useful when files are collected into a shared incoming folder and need to be examined before further processing.

For software integration, add --json:

PhotoSanitize.exe --cli analyze "C:\Images\Incoming" --json

The result is provided in structured JSON rather than the normal human-readable console presentation. Your script can then examine individual file results and handle failures appropriately.

Sanitizing an image

Use the sanitize command when you want PhotoSanitize to create cleaned output files.

For example:

PhotoSanitize.exe --cli sanitize "C:\Images\Photo.jpg" --profile standard

This applies the Standard profile and creates a separate sanitized output using the normal output behavior.

Verification is enabled by default. The command reports the processing results, including output information and verification details when available.

You can select a different supported profile:

PhotoSanitize.exe --cli sanitize "C:\Images\Photo.jpg" --profile metadata

The metadata profile prioritizes conservative hidden-information cleanup, while rebuild requests reconstruction of the picture into a new output container.

When no profile is specified, Standard is used.

Sanitizing a directory

The command-line interface can also process an image directory tree.

For example:

PhotoSanitize.exe --cli sanitize "C:\Images\Incoming" --profile standard --output "C:\Images\Processed"

PhotoSanitize expands the supported image files under the input directory and creates sanitized outputs beneath the destination directory.

When a custom output folder is used, relative source folder structure is preserved by default. This helps retain organization when the source contains several nested directories.

For example, a business might receive photographs in subfolders arranged by project. Preserving that structure allows the processed outputs to remain associated with the correct projects without needing to rename every file.

Profiles available in command-line mode

The supported command-line profiles are Metadata Only, Standard, and Rebuild.

Maximum Privacy is intentionally unavailable in headless processing because it requires automatic visual detection followed by interactive human review. Custom is also unavailable as a command-line profile.

The command-line interface does not provide interactive manual redaction. If an image may expose faces, documents, or other confidential visible content, use the graphical interface for the relevant review and redaction work.

This distinction is important in organizational automation. Removing hidden information does not automatically make the visible photograph suitable for publication.

Understanding the results

For each file, PhotoSanitize reports the applicable processing outcome. With JSON output, a calling script can examine the structured results rather than attempting to interpret formatted console text.

The command also returns an exit code. A nonzero code indicates a problem that should be investigated, even when other files in the batch completed successfully.

When integrating PhotoSanitize into a recurring workflow, evaluate both the overall exit code and the individual file results. A single failed image should not cause incomplete or unverified material to be treated as part of an approved output collection.

Using PhotoSanitize with scheduled jobs

An organization can call the Enterprise command-line interface from its existing task scheduling or scripting environment.

The Windows account running the job must have permission to read the sources and create files in the destination. A script that works when run manually by an administrator may fail under a different account with fewer permissions.

Before scheduling routine processing, test the command using the actual image formats, folder structure, account permissions, and output settings expected in normal use.

Keep verification enabled when the workflow relies on successfully sanitized files, and arrange for nonzero exit codes or unsuccessful file results to be reported rather than ignored.