dhashy 1.0.3 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f5067fba3f6776625079758de6f0ef7f7c43078cf3ef390dcf640290473a6406
4
- data.tar.gz: 814393829725c047374c0ed4eb684a97f0bfe7e99ea840cc1f7101a62b6a16ec
3
+ metadata.gz: c8e3f2dba8fa53d425942576a25fa6eff4eb70c9f7884099495eab9c30416a25
4
+ data.tar.gz: f2daa02cdd7711dcc16b8d69f6cc040d427f7e0c65e593f28e64e4c880f29549
5
5
  SHA512:
6
- metadata.gz: a950984d4cf14c2425f14e1ab15bdb93baa72f84369ece7b3ed42130e0527f13ab6c4fab417731a09bc8d37ac58ec97c5a1cd7ddefabab5709ae82907c4ff6a9
7
- data.tar.gz: 4aa24f876b2e06bddd6e91cdc853b5ca0a8843930c7e09383cf346813efa6ae69f19205529efe66fdd45edc973b0bf751740ee4b2abe6812bdaf00d60613bd45
6
+ metadata.gz: d1d59139ad11b554c3b47f35b8135f8e9652c8c2c538b49070119c6362d7941ad6ecbc4beb75ae58c0d962ea36518cf3ff57b17be3f3a6f0542b0763ae0cc6fe
7
+ data.tar.gz: d23fd16fa74a148bbf8e5a0ef73a2260ffdc64caa9bedb5dd3a7bbe269e179a123834f157cd255420b7a31f2be0f0c027a991feda8afb8fa3829f492e249df8f
data/README.md CHANGED
@@ -1,6 +1,20 @@
1
- # Dhashy
1
+ #### Oh my, you're positively... ####
2
+ # ***dhashy***
3
+
4
+ ***dhashy*** is a ruby gem implementing the *difference hash* algorithm for perceptual image matching. Apple has not publicly confirmed that they use *dhasy* for any specific project.
5
+
6
+ ***dhashy*** encodes changes in average brightness along a path of segments of the image in a binary vector. The sum of differences between a pair of such vectors is a measure of the images' difference. Length of the vector is configurable, allowing for any appropriate compromise in a trade-off of runtime and storage space vs. accuracy.
7
+
8
+ ***dhashy*** works extremely well for common whole-image changes, such as changes in contrast, brightness, tone, or color mapping (including conversion to grayscale and b&w). It is entirely oblivious towards re-encoding. Effectiveness against rotation, warping and distortion is somewhat lower but still very good for any change that would, for typical photos, be a noticeable flaw.
9
+
10
+ ***dhashy*** does not work against mirroring. To detect pairs of mirror images, you have to mirror the image yourself and check again.
11
+
12
+ ***dhashy*** is sensitive to cropping. This can be ameliorated for your use case by switching to the longest common substring of the vectors, at the cost of an increased rate of false positives.
13
+
14
+ ***dhashy*** does not work well with illustrative images such as screenshots (including images of text), logos, charts, line drawings, or :rainbow_flag:patterns:checkered_flag:. Because it works within the *brightness* domain (sum of **r**ed + **g**reen + **b**lue), all solid-color images resolve to the same vector. while small random variations in photos of solid-colored surfaces will produce results quickly approaching randomness.
15
+
16
+ ***dhashy*** runs in `O(n)` with respect to image size (`h x l`) to produce the vector. It uses imagemagick for the most involved operation, which is rescaling the image and could easily be adapted to use some alternative library. Comparison against a library of known vector is not included. This is a *nearest neighbor* problem and you should consult your database's documentation to learn how to failed to find anything better than naive comparison with a quadratic runtime.
2
17
 
3
- Dhashy is a ruby gem implementing the *difference hash* algorithm for perceptual image matching.
4
18
  ## Installation
5
19
 
6
20
  Add this line to your application's Gemfile:
@@ -53,18 +67,15 @@ Or install it yourself as:
53
67
 
54
68
  ## Development
55
69
 
56
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
70
+ After checking out the repository, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
57
71
 
58
72
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
59
73
 
60
74
  ## Contributing
61
75
 
62
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/dhashy. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
76
+ Bug reports and pull requests are welcome on GitHub at https://github.com/MatthiasWinkelmann/dhashy. Contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct. While this project with exactly zero community activity probably doesn't need it,it's a good idea in general. Contributors are also bound by our strict no-fascist policy. Not because they are evil, but because they tend to use tabs instead of spaces. (this project uses three-space-indenting, as God intended)
63
77
 
64
78
  ## License
65
79
 
66
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
67
-
68
- ## Code of Conduct
80
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT), because there is no HARVARD License.
69
81
 
70
- Everyone interacting in the Dhashy project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/dhashy/blob/master/CODE_OF_CONDUCT.md).
@@ -1,4 +1,4 @@
1
1
  class Dhashy
2
- VERSION = "1.0.3"
2
+ VERSION = "1.0.7"
3
3
 
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dhashy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthias Winkelmann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-29 00:00:00.000000000 Z
11
+ date: 2021-09-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mini_magick
@@ -75,7 +75,6 @@ extensions: []
75
75
  extra_rdoc_files: []
76
76
  files:
77
77
  - ".gitignore"
78
- - ".travis.yml"
79
78
  - CODE_OF_CONDUCT.md
80
79
  - LICENSE.txt
81
80
  - README.md
@@ -104,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
104
103
  - !ruby/object:Gem::Version
105
104
  version: '0'
106
105
  requirements: []
107
- rubygems_version: 3.1.2
106
+ rubygems_version: 3.2.15
108
107
  signing_key:
109
108
  specification_version: 4
110
109
  summary: Perceptive Image Hashing and Deduplication.
data/.travis.yml DELETED
@@ -1,5 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.4.1
5
- before_install: gem install bundler -v 1.16.0.pre.3