Compare two engineering drawings in PDF format and output a diff image.
This script makes use of a anaglyph algorithm to compare two PDF drawing files or two folders of PDF drawing files. The files are first converted to PNG format, then the PNG files are processed. The output file is a composite of the two input files with deleted pixels highlighted in magenta and new pixels highlighted in green. A watermark is also added to the diff drawing to designate it as an uncontrolled copy.
Unfortunately the original source of the anaglyph algorithm doesn't appear to exist any more. If you know where I can give proper credit for this, please let me know.
At the moment, the script is only compatible with Windows.
- PyMuPDF
- Python Image Library (PIL)
- Numpy
Use pip install -r requirements.txt to install the packages.
- Launch the script with "python diff-dwg.pyw"
- Choose if you would like to do a single file comparison or batch file comparison.
- If doing a single file comparison, choose the old file, new file, and output location.
- If doing a batch file comparison, choose the location of the old files, location of the new files, and output location.
- Check the output location for the "DIFF" images.