README
shigehachi (繁八)
Compare two sets of images and generate difference images
This tool reads a folder, searching for images and then tries to find matching ones from another folder. These pairs are compared and an image is created to a third folder, which visualises the differences of the first two.
Background for the name
The name of the project is for honouring the legacy of Mr Sonobe Shigehachi (園部 繁八), who was the 16th head master of Jikishinkageryu Naginatajutsu (直心影流薙刀術), which is an ancient Japanese martial art, focusing the handling of a long pole like weapon called naginata.
Getting started
Make sure you have GraphicMagick installed and available
in the PATH
, before trying to use shigehachi
. This can be tested by running for example
the following command which should provide plenty of information when successful:
gm version
The version tested of GraphicMagick is 1.3.34
.
Install the shigehachi
command line utility globally with npm.
Elevated privileges might be needed via sudo
, depending on the platform. In most cases just:
npm install --global shigehachi
Please note that the minimum supported version of Node.js is 10.13.0
, which is the active Long Term Support (LTS) version.
Run from the command line, for example getting the help output:
shigehachi -h
Compare two directories with the default comparison algorithm and store
differentiation images to a folder called images-diff
:
shigehachi -P images-previous -C images-current -O images-diff
Along with the "compare" image, there will also be a "negate" and "composite" images, which should help to determine which metric algorithm is the most suitable for the given comparison.
Comparison example
By running the following command on two screen captures of naginata.fi that were taken while adjusting paddings:
shigehachi --current-dir tests/fixtures/curr/website \
--previous-dir tests/fixtures/prev/website \
--output-dir tests/expected/website \
--match '\.(png)