Skip to main content

Visual raster diff tool for Gerber/Excellon PCB design files

Project description

gerberdiff

CI PyPI Python License: Apache-2.0

Diff tool for Gerber/Excellon PCB design files, with two complementary engines:

  • Raster diff (diff) -- visual overlay PNGs of changed pixels.
  • Geometry diff (geomdiff) -- resolution-independent, attributed changes (moved / resized / added / removed) computed on the parsed vector geometry, down to micrometre displacements.

Install

pip install gerberdiff

Requires Python >= 3.11. The raster engine needs the system Cairo library (libcairo2 on Debian/Ubuntu, cairo via Homebrew); the geometry engine is Cairo-free.

Quick start

# Geometry diff: what moved, resized, was added or removed -- and by how much
gerberdiff geomdiff before/ after/ --out-json report.json --out-svg overlays/

# Raster diff: visual overlay PNGs
gerberdiff diff before/ after/ --out-json report.json --out-png diffs/

# Exit 1 if any changes detected (useful in CI)
gerberdiff geomdiff before/ after/ --fail-on-diff
import gerberdiff
from pathlib import Path

result = gerberdiff.compute_geometry_diff(Path("before/"), Path("after/"))
for layer in result.layers:
    for change in layer.changes:
        print(f"{layer.name}: {change.kind} {change.op_kind} "
              f"dx={change.dx_mm} dy={change.dy_mm}")

Docs

Topic File
CLI reference docs/cli.md
Python API docs/api.md
JSON report schemas docs/schema.md
Architecture docs/architecture.md
Geometry diff engine docs/geometry-diff.md

Known limitations

  • Excellon rout mode: only drill hits are processed; routing paths produce a Warning diagnostic but no geometry.
  • Deprecated RS-274X commands (%MI%, %OF%, %SF%, %AS%): ignored with an Info diagnostic.
  • Rectangle/obround aperture strokes: the raster engine strokes with max(width, height); the geometry engine computes the exact Minkowski sum for linear strokes (see docs/geometry-diff.md).

Development

See CONTRIBUTING.md.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gerberdiff-0.29.0.tar.gz (2.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gerberdiff-0.29.0-py3-none-any.whl (82.6 kB view details)

Uploaded Python 3

File details

Details for the file gerberdiff-0.29.0.tar.gz.

File metadata

  • Download URL: gerberdiff-0.29.0.tar.gz
  • Upload date:
  • Size: 2.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for gerberdiff-0.29.0.tar.gz
Algorithm Hash digest
SHA256 99d459aa4b09ec23f484f71570e60d6793835e99408c6a582e231eabf5950be6
MD5 97c90200b5cd3255fed204464619d6b7
BLAKE2b-256 d2abfbad5a4230f51941d488c4b408c19f0798a7ca6992bba900d2923b4f9ce9

See more details on using hashes here.

Provenance

The following attestation bundles were made for gerberdiff-0.29.0.tar.gz:

Publisher: release.yml on CameronBrooks11/gerberdiff

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gerberdiff-0.29.0-py3-none-any.whl.

File metadata

  • Download URL: gerberdiff-0.29.0-py3-none-any.whl
  • Upload date:
  • Size: 82.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for gerberdiff-0.29.0-py3-none-any.whl
Algorithm Hash digest
SHA256 765cb9eddc56956c9fe30d19477e67092c2312bb766b3d529740ff8cdf834aa2
MD5 572abd801ccd46f4383c6f49ac96773b
BLAKE2b-256 d0577becc4c3f9df5b56631e4a01266c7563b24687c4470ba81355ee399b8c7e

See more details on using hashes here.

Provenance

The following attestation bundles were made for gerberdiff-0.29.0-py3-none-any.whl:

Publisher: release.yml on CameronBrooks11/gerberdiff

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page