Skip to content
Wraith — A responsive screenshot comparison tool
Ruby JavaScript HTML Dockerfile
Branch: master
Clone or download
Simon Taylor Simon Taylor
Simon Taylor and Simon Taylor Update version number for release
Latest commit 4f6eb0b Jun 26, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github added `wraith info` instruction to new issues Dec 10, 2016
assets New, improved, 'error' images. Aug 9, 2018
bin Rubocop Updates Mar 26, 2015
lib Update version number for release Jun 26, 2019
spec Change 'timeout_ms' to 'settle' (how long the browser should wait for… Aug 20, 2018
templates Merge branch 'master' into chromification Aug 13, 2018
.gemset adds gem set file Dec 29, 2013
.gitignore add specs Sep 21, 2017
.rubocop.yml Rubocop Updates Mar 26, 2015
.ruby-version try installing chrome this way on travis Oct 31, 2017
.travis.yml try installing chrome this way on travis Oct 31, 2017
Gemfile fix #352 Dec 22, 2015
LICENSE Updates LICENSE Aug 16, 2013 Merge pull request #523 from grzbielok/patch-1 Aug 13, 2018
Rakefile Add missing parameter to method call Apr 2, 2015
wraith.gemspec Improve ability to build Wraith as a Gem. Aug 13, 2018

Wraith logo

build status rubygems version codeclimate report

Wraith is a screenshot comparison tool, created by developers at BBC News.

DocumentationSourceResponsive News Website

What is it?

Wraith uses a headless browser to create screenshots of webpages on different environments (or at different moments in time) and then creates a diff of the two images; the affected areas are highlighted in blue.

Photo of BBC News with a diff


For instructions on how to install, set up and use Wraith and all of its features, visit the Wraith documentation.

A brief overview of how Wraith works is provided below.

Wraith modes

There are several ways in which Wraith can be used:

  1. Comparison of 2 domains (wraith capture). There are also some specialist options within this mode:
    • Spidering 2 domains for changes (wraith capture when no paths property is provided in the configuration file)
    • Running several comparisons at once (wraith multi_capture)
  2. Comparing the same domain over time (wraith history, then wraith latest)

Whichever mode you decide to run Wraith in, the process it follows is generally the same:

  • takes screenshots of your webpages
  • runs a comparison task across them
  • outputs a diff PNG file comparing the two images, and a data.txt file which contains the percentage of pixels that have changed
  • packages all of this up into a gallery.html, ready for you to view
  • if any screenshot's diff is above the threshold you specified in your configuration file, the task exits with a system error code (useful for CI)
  • the failed screenshot will also be highlighted in the gallery


ImageMagick is required to compare the screenshots and crop images.

Wraith also requires at least one of these headless browsers:

  • PhantomJS
  • CasperJS (which can be used to target specific selectors)
  • SlimerJS
  • Chrome (Currently using Selenium WebDriver + Chromedriver for Chrome; Can target specific selectors)


Please read how to contribute to Wraith.


Wraith is available to everyone under the terms of the Apache 2.0 open source license. Take a look at Wraith's LICENSE file.



Anyone interested in integrating selenium capability with Wraith should check out Selenium-Wraith (maintained by Mathew Hall), which was forked from BBC's Wraith on 16/04/14 and adds the following capabilities:

  1. Selenium integration, both running locally on a desktop or on a selenium grid
  2. Browser to browser screenshot comparison
  3. Page component-based comparison
You can’t perform that action at this time.