61 Commits

Author SHA1 Message Date
Timmy Welch
fb3adaa0a1 Update pre-commit 2024-08-04 17:22:06 -07:00
Timmy Welch
aa1fe89e96 Performance
Reduce allocations by re-using uint8 slices where possible
Use github.com/disintegration/imaging for resizing
Add a module option to skip RGB conversion for YCbCr images
2024-08-04 17:21:58 -07:00
Timmy Welch
cb5a8237c4 Update module path 2024-05-01 18:06:48 -07:00
Timmy Welch
53bce1cdc2 Add testing system 2024-05-01 17:59:11 -07:00
Timmy Welch
1ca06a1968 Make compliant with python imagehash 2024-04-05 17:29:30 -06:00
Donghee Na
d8115886f3
gh-63: Return error if other is nil () 2024-01-21 22:47:06 +09:00
Wu Tingfeng
d68e89bd8f
Increase test coverage to 96.6% ()
* gitignore *.html for test coverage reports

* fix typos

* Increase hashcompute.go test coverage to 100 percent

* Add new Go versions. Upgrade GitHub Actions.

* Add tests for missing ext hashes

* Add test for hashing non-hexadecimal string

* Add tests for loading empty bytes buffer

* Run go fmt

* Fix comments

* Fix comments

* Fix spelling

* fix actions versions

* Upgrade to actions/setup-go@v4

* Add minimum Go version for go.mod
2023-05-03 23:52:14 +09:00
Petrichor
464cef2de9
fix: typo in README.md ()
Declare two undeclared variables
2022-10-09 20:42:03 +09:00
evanoberholster
571ae3865a
Performance improvement ()
* Performance improvement

* Added support fpr DCT2DFast256

* Update hashcompute.go

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>

Co-authored-by: Evan Oberholster <eroberholster@gmail.com>
Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2022-09-08 15:20:33 +09:00
Dong-hee Na
4662ac9320
github: Update CIs () 2022-05-26 22:58:40 +09:00
Dong-hee Na
9b83979be0 README: Release v1.1.0 2022-05-26 18:38:43 +09:00
evanoberholster
45da7a6fef
Refactored Perceptionhash for performance ()
* refactored Perceptionhash for performance

* update AUTHORS.md

* replaced PerceptionHash algorithm

* Update hashcompute_test.go

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>

* Update hashcompute_test.go

Co-authored-by: Evan Oberholster <eroberholster@gmail.com>
Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2022-05-26 15:56:47 +09:00
Dong-hee Na
3dc330e270
github: Fix github action () 2020-12-28 02:35:04 +09:00
Dong-hee Na
b94d000de0 github: Create FUNDING.yml 2020-12-26 19:21:45 +09:00
Dong-hee Na
5e074e7151
goimagehash: Update README.md () 2020-10-03 15:33:01 +09:00
Dong-hee Na
bcad56853e
.github: Add go 1.14.x () 2020-09-30 22:43:22 +09:00
Dong-hee Na
3496d08ef7
github: Add latest version () 2020-02-11 11:19:25 +09:00
Rafael Cossovan
c9ea1a6596 Update dependencies from go module and dep tool. () 2019-12-07 23:29:03 +09:00
Dong-hee Na
daf77da1c6
Update github action to use gomodule () 2019-12-07 10:50:05 +09:00
Dong-hee Na
cd85f5fb0f README: Update 2019-12-06 15:48:16 +09:00
Dong-hee Na
3a999480e9
gh-37: Add workflow file for Github Action ()
* Setting up Github Action

* remove Travis CI

* Update README.md
2019-12-06 15:36:49 +09:00
Eric Levine
8be960c20e Fix typo on the GoDoc for LoadImageHash. ()
The GoDoc incorrectly specified that the LoadImageHash function produces an ExtImageHash. This function produces an ImageHash, so this corrects the typo.
2019-11-26 14:07:35 +09:00
Berkant Ipek
9343c64188 Add go.mod. ()
* Add go.mod.

* Remove `go` directive in go.mod.
2019-11-22 06:34:50 +09:00
Dong-hee Na
0069c5147b
.travis.yml: Update .travis.yml () 2019-10-01 00:29:20 +09:00
dirtsea
32a1fdcbe8 Fix typo in README.md () 2019-09-08 01:03:41 +09:00
Dong-hee Na
6392b0bac9
all: Add more test ()
* hashcompute_test: Add benchmark

* all: Add more test
2019-03-19 23:10:52 +09:00
Dong-hee Na
14aa1e136f
dct: Improve DCT1D to O(nlogn) algorithm ()
* hashcompute_test: Add benchmark

* dct: Improve DCT1D to O(nlogn) algorithm

AS-IS:
BenchmarkPerceptionHash-8  500  2893930 ns/op  456698 B/op  4455 allocs/op

TO-BE:
BenchmarkPerceptionHash-8  2000  890306 ns/op  456382 B/op  4455 allocs/op

reference: DCT type II, unscaled. Algorithm by Byeong Gi Lee, 1984.
2019-03-19 13:52:44 +09:00
Dong-hee Na
c61f6c69fb .travis.yml: Update travis 2019-03-19 00:06:41 +09:00
Dong-hee Na
138a26ae46 README.md: Update README.md 2019-03-19 00:06:12 +09:00
Dong-hee Na
3e058be50d
hashcompute: Update Extend API ()
* hashcompute: Update Extend API

- AverageHashExtend -> ExtAverageHash
- PerceptionHashExtend -> ExtPerceptionHash
- DiffrenceHashExtend -> ExtDiffrenceHash

* imagehash: Update load api
2019-03-18 23:53:09 +09:00
Dong-hee Na
161b6f5676
hashcompute: Redesign XXXHashExtend API interface () 2019-03-18 21:40:16 +09:00
Dong-hee Na
0876a2adc2
dct: Process dct algorithm in multiple goroutine () 2019-03-18 21:09:40 +09:00
Dong-hee Na
47321c08d3
imagehash: Create a new API Bits() () 2019-03-17 15:42:07 +09:00
Dong-hee Na
84eb1859d0
imagehash: Add new serialization API dump/load. ()
Create a new APIs for serializing purpose which can use
standard io.Reader/io.Writer APIs.

ToString() API will be remain for debugging purpose and
ExtImageHashFromString, ImageHashFromString will be removed after next
version.

- New APIs are added: LoadExtImageHash, LoadImageHash, xxxHash.Dump
- These APIs are deprecated: ExtImageHashFromString, ImageHashFromString
2019-03-17 11:34:56 +09:00
Dong-hee Na
7558e00b90 README.md: Update 2019-03-16 23:23:56 +09:00
Dong-hee Na
20cafe6017
hashcompute: Fix 64bits unaligned size case () 2019-03-16 23:15:32 +09:00
Dong-hee Na
58a4aa88ab
hashcompute: Fix bit set index () 2019-03-16 17:22:57 +09:00
Dong-hee Na
5f00903fec README.md: Update README.md 2019-03-16 01:01:25 +09:00
Dong-hee Na
bafc8a21c3 readme: Update readme.md 2019-03-16 00:54:05 +09:00
Dong-hee Na
5f56e8609c
DifferenceHashExtend: Implement DifferenceHashExtend () 2019-03-16 00:47:57 +09:00
Dong-hee Na
b535580cae
AverageHashExtend: Implement AverageHashExtend and fix bugs () 2019-03-16 00:26:38 +09:00
Alex
c41a59a872 add PerceptionHashExtend function ()
goimagehash: Implement PerceptionHashExtend
2019-02-08 18:02:25 +09:00
Dong-hee Na
81672d7016 .travis.yml: Update Go 1.11 2018-10-01 17:34:07 +09:00
Dong-hee Na
d41c941ded transforms: Fix the logic which getting a size of image 2018-08-19 16:35:17 +09:00
Dong-hee Na
9435cae35d
Update README.md 2018-05-12 00:53:41 +09:00
Dong-hee Na
6995fa9b0c goimagehash: Add test 2018-05-10 11:54:51 +09:00
Dong-hee Na
e588da1f67 goimagehash: Update README.md 2018-05-09 09:37:49 +09:00
Dong-hee Na
1903317145 goimagehash: Fix quickselect algorithm to pick median value. 2018-05-08 13:33:43 +09:00
Dominik Honnef
ad2b6ded3b Use bits.OnesCount64 when available
Benchmark on i7-2600k, which has the POPCNT instruction:

name                 old time/op  new time/op  delta
DistanceIdentical-8  5.08ns ± 0%  1.01ns ± 1%  -80.07%  (p=0.008 n=5+5)
DistanceDifferent-8  81.5ns ± 2%   1.0ns ± 0%  -98.76%  (p=0.016 n=5+4)

Benchmark on Cavium Octeon, a MIPS64 platform with no dedicated
instruction:

name                 old time/op  new time/op  delta
DistanceIdentical-2   120ns ± 6%   144ns ± 5%  +19.93%  (p=0.008 n=5+5)
DistanceDifferent-2   656ns ± 4%   144ns ± 4%  -78.09%  (p=0.008 n=5+5)
2018-05-02 23:52:38 +09:00
Dong-hee Na
7f23d56ee5 goimagehash: Add badge 2018-04-01 16:55:03 +09:00