Quick start
The most basic comparison requires two PDF files:diff_output directory.
Understanding the output
When differences are detected, the tool will:- Print a summary to the console
- Create a timestamped output directory
- Generate diff images highlighting visual differences
- Save a JSON report with detailed results
Console output examples
- Identical PDFs
- Differences found
- Different page counts
Specifying an output directory
To save results to a custom location, use the--output flag:
The timestamp format is
YYYYDDMM_HHMMSS, ensuring each comparison run creates a unique output directory.Adjusting sensitivity
Control how strict the comparison is using the--threshold parameter:
1.0= Pixel-perfect match required0.999= Internal default when comparing- Lower values = More tolerant of differences
Common usage patterns
Comparing reports from different dates
Comparing reports from different dates
Testing PDF generation changes
Testing PDF generation changes
Batch comparison with shell script
Batch comparison with shell script
What gets compared
The tool performs visual comparison by:- Rendering each PDF page to an image at 144 DPI (2x zoom)
- Converting images to RGB arrays
- Computing Structural Similarity Index (SSIM) between pages
- Flagging pages below the threshold
- Generating highlighted diff images for flagged pages
The comparison is purely visual. Changes to PDF metadata, embedded fonts, or internal structure are ignored unless they affect the rendered appearance.
Handling different page sizes
If PDFs have different dimensions, the tool automatically:- Resizes images to match for comparison (using LANCZOS interpolation)
- Continues the comparison without error
Next steps
Command reference
Complete documentation of all CLI options
Output formats
Understanding generated files and JSON reports