Screenshot tests that show what changed.
gleon compares the screenshots of your tests with your goldens. It finds real changes and ignores font differences between operating systems. Use the CLI with each test runner, or an SDK in your test framework.
-
Golden
macos-aarch64 -
Candidate
linux-x86_64 -
Diff
counter_gleonDiff.png
$ gleon test -- flutter test
Run run-20261020T101500Z-1a2b3c4d: 128 case(s): 125 passed, 3 failed (2 mismatch, 1 missing)
$
One engine for all test runners
The CLI works with each test runner that writes PNG files. The SDKs work inside your test framework. All of them use the same Rust engine and the same .gleon/gleon.yaml file.
-
gleon CLI Available
For each test runner that writes PNG files
- A summary for each run, with one line for each failure
- An HTML report that shows the golden, the candidate and the diff
- Markdown, JUnit and JSON reports for your CI
- A comment on the pull request. Write
/gleon approveto commit the new goldens. - Goldens in Git, or manifests in Git and images in S3, R2 or Google Cloud Storage
gleon init --generic # once gleon stage # record gleon diff # compare gleon report html -
Flutter package Available
Replaces
matchesGoldenFile- 5 to 20 times faster than the built-in comparator
exact,pixelandssimtolerance, and ignore regions- The real fonts of your app. gleon compares text on the platform that recorded the golden.
- Works with alchemist, golden_toolkit and golden_screenshot
- No Rust toolchain is necessary
import 'package:flutter_test/flutter_test.dart'; import 'package:gleon/gleon.dart'; -
More SDKs Coming soon
For more test frameworks
- SDKs for more test frameworks are in development
- They use the same engine, configuration and reports
- Until then, use the CLI. It compares the PNG files of each test runner.
# .gleon/gleon.yaml screenshots: - include: "e2e/**/*.png" mode: pixel diff: threshold: 0.01
What changes when you use gleon
Most golden test suites have the same problems. This is what gleon does for each problem.
- A golden from macOS fails on Linux. Each operating system draws fonts differently.
- Each golden records the platform that made it. gleon compares text strictly on that platform and ignores text on other platforms. Layout stays exact. You can update goldens on each operating system, without Docker.
- A threshold of 1% lets a missing icon pass on a large screen.
- In
pixelmode, you set the ratio. Inssimmode, gleon uses the lowest local similarity. A small change on a large golden does not disappear in an average. - The test font draws each letter as the same box. The goldens cannot show text.
- The SDK loads the real fonts of your app. gleon compares only the text that is really painted. Hidden pages cannot hide a change.
- A failed CI job shows that something changed. It does not show where, or how near the other goldens were to failure.
- gleon gives a summary for each run and an HTML report with the golden, the candidate and the diff. It writes a comment on the pull request.
/gleon approvecommits the new goldens. Metrics show the margin of each golden that passed. - The built-in comparison is slow. Most of the time goes to PNG encoding.
- gleon compares raw pixels in Rust. It is 5 to 20 times faster than the built-in comparator, and
ssimmode is as fast asexactmode.
How it works
Use three commands on your computer and one step in CI. Your test command does not change.
-
Make a workspace
gleon initmakes the.gleon/gleon.yamlfile. This file sets the comparison rules for your goldens. Without a tolerance, gleon compares exactly.# .gleon/gleon.yaml baselines: goldens fallback_platform: macos-aarch64 screenshots: - include: "**/test/**/*.png" mode: ssim # or exact, pixel exclude: - "**/failures/**" -
Run your tests with gleon
gleon records one run. It shows the totals and one line for each failure. It exits with the exit code of your tests.
$ gleon test -- flutter test Run run-20261020T101500Z-1a2b3c4d: 128 case(s): 125 passed, 3 failed (2 mismatch, 1 missing) test/goldens/counter_3: Mismatch: 0.0167% (1 of 6000px) differ (.gleon/runs/latest/cases/macos-aarch64/test/goldens/counter_3.json) -
Examine and approve
The HTML report shows each failure with its golden, candidate and diff.
gleon approvewrites the accepted candidates over their goldens.$ gleon report html --out .gleon/runs/latest/report.html $ gleon approve
In CI
The GitHub Action runs your tests. It writes the failures in a comment on the pull request and uploads the run. Write /gleon approve in the pull request to commit the new goldens. On other CI systems, use the JUnit report from gleon report junit.
- uses: gleon-rs/gleon@main
with:
command: verify
test-command: flutter test
Speed and proof
The built-in comparator encodes a PNG file for each frame. gleon compares the raw pixels in Rust. It encodes a PNG file only to keep a failure.
| Result | Golden | Built-in | gleon | Speedup | Relative time |
|---|---|---|---|---|---|
| Passed | 400x300 | 9.60 ms | 0.43 ms | 22x | |
| Passed | 390x844 | 15.5 ms | 1.19 ms | 13x | |
| Passed | 1170x2532 | 89.4 ms | 7.3 ms | 12x | |
| Failed | 400x300 | 43.7 ms | 1.9 ms | 23x | |
| Failed | 390x844 | 77.5 ms | 4.2 ms | 18x |
Exact comparison, mean time on an Apple M3 Max. Built-in is the comparator of the Flutter SDK 3.47.6. The time to render the frame is the same for both and is not included. The package README has all tables. For PNG byte inputs, gleon is 4.8 to 20 times faster.
- 1,800 goldensof a real app run on gleon in
ssimmode. CI tests each change on all four hosts. - About 1 MBfor the native library. The SDK downloads it on the first test run, checks it against
SHA256SUMS.txtand keeps it for offline runs. - No Rust toolchainis necessary on the computers that run your tests. CLI releases have build provenance attestations.
- The margin of each goldenOptional metrics show how near each golden that passed was to its thresholds.
gleon ✓ test/goldens/swatch.png ssim 0.931 (≥0.800, +0.131) color 5.2 (≤8, +2.8) 12 ms
Where it runs
You can record goldens on each of these platforms. Each golden records the platform that made it.
gleon CLI
gleon-macos-aarch64macOS on Apple silicongleon-linux-x86_64Linux x86_64, Ubuntu 26.04 or newergleon-windows-x86_64.exeWindows x86_64, no extra runtime
Flutter package
- macOSarm64
- Linuxx64 and arm64, glibc of Ubuntu 26.04 or newer
- Windowsx64
- Flutter3.47.5 or newer
Not supported: macOS on Intel, Linux with musl (for example Alpine), web builds and tests on a device. gleon compares PNG images.
Pricing
gleon is free for all users until December 31, 2026. Commercial licenses and their prices come in 2027.
Free
$0
Business Source License 1.1
- Individuals and hobbyists
- Non-commercial open-source repositories
- Unlimited local development
- All other use, until December 31, 2026, with a current official release
Commercial license
Prices in 2027
For commercial CI/CD use
- An offline key for an owner, a repository pattern and an expiry date
- gleon does not send data to a server
- Set the key in
GLEON_LICENSE_KEYor in thelicense-keyinput of the Action - 14 days of grace after the key expires
What is open source
The comparison engine (gleon-engine, gleon-model, gleon-ffi) is MIT or Apache-2.0. The Flutter package is MIT. The CLI and gleon-core use the Business Source License 1.1. Each version becomes Apache-2.0 four years after its release, or on July 13, 2030, if that date is earlier.
Without a key, private CI shows a warning and continues. With --strict, the warning becomes exit code 42. In private CI without a key, use an official release that is less than 90 days old: older releases and builds from source stop with exit code 42. Read the full license.
Install
gleon CLI
Download the binary for your system from the releases page, or use gh:
gh release download --repo gleon-rs/gleon --pattern gleon-macos-aarch64
install -m 755 gleon-macos-aarch64 ~/.local/bin/gleon
On Linux, use gleon-linux-x86_64. On Windows, use gleon-windows-x86_64.exe. Each release has SHA256SUMS.txt and a build attestation for each file.
Homebrew support comes soon
Flutter package
Add the package from a release tag, then change one import:
dev_dependencies:
gleon:
git:
url: https://github.com/gleon-rs/flutter.git
ref: vX.Y.Z # a release tag
import 'package:flutter_test/flutter_test.dart';
import 'package:gleon/gleon.dart';
The package guide shows how to load the real fonts, set tolerances and configure a workspace.