All Projects → teachbase → Imatcher

teachbase / Imatcher

Licence: mit
Image comparison library

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Imatcher

Mindseye
Neural Networks in Java 8 with CuDNN and Aparapi
Stars: ✭ 8 (-81.82%)
Mutual labels:  image-analysis
Segment Open
Segment Source Distribution
Stars: ✭ 34 (-22.73%)
Mutual labels:  image-analysis
Photoassessment
Photo Assessment using Core ML and Metal.
Stars: ✭ 40 (-9.09%)
Mutual labels:  image-analysis
Chn Eolinker Ams Lite 4.0 For Php
中国最大的在线API管理平台EOLINKER 旗下API管理系统开源精简版,适合个人以及微型团队使用。
Stars: ✭ 869 (+1875%)
Mutual labels:  testing-tools
Pyats Docker
Dockerfile and scripts for pyATS
Stars: ✭ 34 (-22.73%)
Mutual labels:  testing-tools
Webmockr
R library for stubbing and setting expectations on HTTP requests
Stars: ✭ 37 (-15.91%)
Mutual labels:  testing-tools
Compare
image comparison tool
Stars: ✭ 25 (-43.18%)
Mutual labels:  image-analysis
Snapshottest
Snapshot testing tool for iOS and tvOS
Stars: ✭ 42 (-4.55%)
Mutual labels:  testing-tools
Mts
Project of Multi-protocol Test Tool opensourced by Ericsson
Stars: ✭ 34 (-22.73%)
Mutual labels:  testing-tools
Websocket Connection Smuggler
websocket-connection-smuggler
Stars: ✭ 40 (-9.09%)
Mutual labels:  testing-tools
Hoppscotch
👽 Open source API development ecosystem https://hoppscotch.io
Stars: ✭ 34,569 (+78465.91%)
Mutual labels:  testing-tools
Scarlet
Source separation in hyperspectral imaging data by Constrained Matrix Factorization
Stars: ✭ 27 (-38.64%)
Mutual labels:  image-analysis
Itkexamples
Cookbook examples for the Insight Toolkit documented with Sphinx
Stars: ✭ 38 (-13.64%)
Mutual labels:  image-analysis
Structured Acceptance Test
An open format definition for static analysis tools
Stars: ✭ 10 (-77.27%)
Mutual labels:  testing-tools
Pyspecs
Minimalistic BDD in Python
Stars: ✭ 40 (-9.09%)
Mutual labels:  testing-tools
Wufei
Async Kuberenetes Namespace Log Recorder / Streamer
Stars: ✭ 27 (-38.64%)
Mutual labels:  testing-tools
Rxschedulerrule
Simple JUnit rule for overriding RxJava/RxAndroid schedulers during unit tests
Stars: ✭ 35 (-20.45%)
Mutual labels:  testing-tools
Componentfixture
🛠️Interactive sandox playground for vue components
Stars: ✭ 44 (+0%)
Mutual labels:  testing-tools
Detox
High velocity native mobile development requires us to adopt continuous integration workflows, which means our reliance on manual QA has to drop significantly. Detox tests your mobile app while it’s running in a real device/simulator, interacting with it just like a real user.
Stars: ✭ 8,988 (+20327.27%)
Mutual labels:  testing-tools
Junit Extensions
JUnit5 extensions library including JUnit5 equivalents of some of the common JUnit4 rules: ExpectedException, TemporaryFolder etc
Stars: ✭ 39 (-11.36%)
Mutual labels:  testing-tools

Gem Version Build Status

Imatcher

Compare PNG images in pure Ruby (uses ChunkyPNG) using different algorithms. This is an utility library for image regression testing.

Installation

Add this line to your application's Gemfile:

gem 'imatcher'

And then execute:

$ bundle

Or install it yourself as:

$ gem install imatcher

Additionally, you may want to install oily_png to improve performance when using MRI. Just install it globally or add to your Gemfile.

Modes

Imatcher supports different ways (modes) of comparing images.

Source images used in examples:

Base (RGB) mode

Compare pixels by values, resulting score is a ratio of unequal pixels. Resulting diff represents per-channel difference.

Grayscale mode

Compare pixels as grayscale (by brightness and alpha), resulting score is a ratio of unequal pixels (with respect to provided tolerance).

Resulting diff contains grayscale version of the first image with different pixels highlighted in red and red bounding box.

Delta

Compare pixels using Delta E distance. Resulting diff contains grayscale version of the first image with different pixels highlighted in red (with respect to diff score).

Usage

# create new matcher with default threshold equals to 0
# and base (RGB) mode
cmp = Imatcher::Matcher.new
cmp.mode #=> Imatcher::Modes::RGB

# create matcher with specific threshold
cmp = Imatcher::Matcher.new threshold: 0.05
cmp.threshold #=> 0.05

# create zero-tolerance grayscale matcher 
cmp = Imatcher::Matcher.new mode: :grayscale, tolerance: 0
cmp.mode #=> Imatcher::Modes::Grayscale

res = cmp.compare(path_1, path_2)
res #=> Imatcher::Result

res.match? #=> true

res.score #=> 0.0

# Return diff image object
res.difference_image #=> Imatcher::Image

res.difference_image.save(new_path)

# without explicit matcher
res = Imatcher.compare(path_1, path_2, options) 

# equals to
res = Imatcher::Matcher.new(options).compare(path_1, path_2)

Excluding rectangle

You can exclude rectangle from comparing by passing :exclude_rect to compare. E.g., if path_1 and path_2 contain images above

Imatcher.compare(path_1, path_2, exclude_rect: [200, 150, 275, 200]).match? # => true

[200, 150, 275, 200] is array of two vertices of rectangle -- (200, 150) is left-top vertex and (275, 200) is right-bottom.

Including rectangle

You can set bounds of comparing by passing :include_rect to compare with array similar to previous example

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/teachbase/imatcher.

License

The gem is available as open source under the terms of the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].