GitXplorerGitXplorer
c

goimagehash

public
735 stars
71 forks
12 issues

Commits

List of commits on branch master.
Verified
d8115886f3603fc5951521bf095d0c1ee73b9b47

gh-63: Return error if other is nil (#64)

ccorona10 committed 8 months ago
Verified
d68e89bd8fdfaf6da9ed739ba0041ac894413d5b

Increase test coverage to 96.6% (#61)

eelliotwutingfeng committed a year ago
Verified
464cef2de9ecd41cb6a8be0ae6d5607a34dccd68

fix: typo in README.md (#58)

pp3ddd committed 2 years ago
Verified
571ae3865a7a3ace7dabce28255ecf6714f12ae1

Performance improvement (#56)

eevanoberholster committed 2 years ago
Verified
4662ac93206e3c2c61de03de07b2cb52a96fd5fd

github: Update CIs (#55)

ccorona10 committed 2 years ago
Unverified
9b83979be0f543a4be60e557d3ee9770469c3d09

README: Release v1.1.0

ccorona10 committed 2 years ago

README

The README file for this repository.

GitHub Action GoDoc Go Report Card

goimagehash

Inspired by imagehash

A image hashing library written in Go. ImageHash supports:

Installation

go get github.com/corona10/goimagehash

Special thanks to

Usage

func main() {
        file1, _ := os.Open("sample1.jpg")
        file2, _ := os.Open("sample2.jpg")
        defer file1.Close()
        defer file2.Close()

        img1, _ := jpeg.Decode(file1)
        img2, _ := jpeg.Decode(file2)
        hash1, _ := goimagehash.AverageHash(img1)
        hash2, _ := goimagehash.AverageHash(img2)
        distance, _ := hash1.Distance(hash2)
        fmt.Printf("Distance between images: %v\n", distance)

        hash1, _ = goimagehash.DifferenceHash(img1)
        hash2, _ = goimagehash.DifferenceHash(img2)
        distance, _ = hash1.Distance(hash2)
        fmt.Printf("Distance between images: %v\n", distance)
        width, height := 8, 8
        hash3, _ := goimagehash.ExtAverageHash(img1, width, height)
        hash4, _ := goimagehash.ExtAverageHash(img2, width, height)
        distance, _ = hash3.Distance(hash4)
        fmt.Printf("Distance between images: %v\n", distance)
        fmt.Printf("hash3 bit size: %v\n", hash3.Bits())
        fmt.Printf("hash4 bit size: %v\n", hash4.Bits())

        var b bytes.Buffer
        foo := bufio.NewWriter(&b)
        _ = hash4.Dump(foo)
        foo.Flush()
        bar := bufio.NewReader(&b)
        hash5, _ := goimagehash.LoadExtImageHash(bar)
}

Release Note

v1.1.0

  • The performance of Perceptionhash is enhanced.

v1.0.3

  • Add workflow for GithubAction
  • Fix typo on the GoDoc for LoadImageHash

v1.0.2

  • go.mod is now used for install goimagehash

v1.0.1

  • Perception/ExtPerception hash creation times are reduced

v1.0.0

IMPORTANT goimagehash v1.0.0 does not have compatible with the before version for future features

v0.3.0

  • Support DifferenceHashExtend.
  • Support AverageHashExtend.
  • Support PerceptionHashExtend by @TokyoWolFrog.

v0.2.0

  • Perception Hash is updated.
  • Fix a critical bug of finding median value.

v0.1.0

  • Support Average hashing
  • Support Difference hashing
  • Support Perception hashing
  • Use bits.OnesCount64 for computing Hamming distance by @dominikh
  • Support hex serialization methods to ImageHash by @brunoro