This is a tool to compare images in 2 directories based on pixelmatch.
-
Install nodejs globally (if it's not installed yet)
-
Get
compare-screenshots
tool. You have 2 options here:
Download source files from here.
Click on Code
dropdown, then choose Download ZIP
. Then extract this ZIP archive in some folder - in this tutorial compare-screenshots
.
OR:
Clone this repo to your machine (you need git installed globally):
git clone https://github.com/kivils/compare-screenshots
-
Open terminal in project's root folder (
compare-screenshots
in case of git installation). -
Put base images to
src/images/base
folder -
Put images which should be compared upon base images to
src/images/new
folder -
In terminal run
npm start
- You should see this message in terminal:
All images were compared. Please check "src/images/diff" folder
.
- You should see this message in terminal:
-
Diff files are in
src/images/diff
folder
Find differences in pdf file versions.
Steps:
- Save base
pdf
aspng
- Go to
compare-screenshots
folder - Put all generated
png
s tosrc/images/base
folder insidecompare-screenshots
folder - Save edited
pdf
aspng
- Put all generated
png
s tosrc/images/new
folder insidecompare-screenshots
folder - In
compare-screenshots
folder open terminal, and runnpm start
- You should see this message in terminal:
All images were compared. Please check "src/images/diff" folder
.
- You should see this message in terminal:
- Diff files are in
src/images/diff
folder
- nodejs installed globally
- Only
png
is supported currently - Images in both directories should have the same filenames
- Images in both directories should have the same dimensions (resolutions)
- Treshold is set to
0.1
, it's not possible to change it manually
- Add other formats
- Add possibility to compare files with different dimensions