# How do you verify that an exported PNG or PDF matches its HTML source?

Updated 2026-11-21 · https://briefatto.com/guides/verify-exported-png-matches-html/

List the files in `deliverables.json` and run `board check .`: each PNG is decoded and must match every RGBA pixel of its HTML source, and each PDF page is rasterized and compared within the published tolerances. The receipt records the SHA-256 of the checked bytes.

## List the files

In `deliverables.json` at the project root, name each delivery file, its editable HTML source and the exact comparison size:

```json
[
  {"file":"delivery/card.png","html":"outputs/post.html","width":1080,"height":1080}
]
```

Add `"transparent":true` for a transparent PNG and `"fullPage":true` for a full-page capture. For a PDF, `pageSizeMm` checks the visible page box to within 0.1 mm on each axis.

## What is compared

- **PNG:** decoded and compared with the HTML render; every RGBA pixel must match.
- **PDF:** rasterized with PDF.js and compared with the HTML in print media. The mean maximum-channel difference is at most 2 on a 0 to 255 scale, with at most 2% of pixels differing by more than 32.
- **Receipt:** the SHA-256 of the checked bytes, so the file you send is the file that passed.

## Run it

`npx briefatto-board check .` validates the listed files. `npx briefatto-board kit .` adds the layout checks and writes the results to `outputs/kit-check.json`. After editing an HTML piece, `board render <file.html>` regenerates its PNG.

## Questions and answers

### Why compare the export with its HTML?

So the PNG or PDF you hand over is the design that passed the floor, byte for byte on record.

### Does a failed export stop the run?

Yes. `board check` sets exit status 1 when any piece fails, so a hook, CI or the agent stops on it.

### Is Briefatto Board free?

Yes. It is open source under the Apache-2.0 licence and installs with `npx briefatto-board install`.

## Try it

```
npx briefatto-board install
```

Briefatto Board is free and open source under Apache-2.0: https://github.com/Briefatto/briefatto-board

## Related guides

- [How do you make a brand kit with Claude Code?](https://briefatto.com/guides/claude-code-brand-kit/)
- [How do you enforce design checks in a pre-commit hook?](https://briefatto.com/guides/design-check-in-pre-commit-hook/)
- [How to make an AI agent follow your design rules](https://briefatto.com/guides/make-an-agent-follow-your-design-rules/)
- [Can you design without Figma when agents write the HTML?](https://briefatto.com/guides/design-without-figma/)

## Sources

- https://github.com/Briefatto/briefatto-board/blob/main/README.md
- https://github.com/Briefatto/briefatto-board/blob/main/skill/briefatto-board/SKILL.md
- https://github.com/Briefatto/briefatto-board/blob/main/src/board/cli.ts
- https://github.com/Briefatto/briefatto-board/blob/main/LICENSE
