Lookalike

Visual regression testing · Ruby

See the pixels that changed.

Compare rendered images in Ruby and turn mismatches into useful diffs.

gem install lookalike

EXPECTEDACTUAL
Snapshot comparisonexpected / actual / diff

A mismatch should be actionable.

Choose pixel or perceptual comparison, set tolerances, and inspect the affected region.

01

Compare deliberately

Channel deltas or YIQ comparison with allowed-pixel limits.

02

Get useful output

Bounding boxes, diff images, and optional antialiasing detection.

03

Fit your test stack

RSpec, Minitest, Test::Unit, and local snapshot approval.

A small first step

Start with one example.

Install the gem, then follow the project guide for platform requirements and the full API.

Read the installation guide ↗

require "lookalike"
require "tessel"

actual = Tessel.read("actual.png")
result = Lookalike.compare(
  "expected.png", actual,
  mode: :channel, max_delta: 1
)
abort result.inspect unless result.match?