image_hash

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package imagehash processes a Perception hash and Average hash from an image.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrImageObject = errors.New("image object can not be nil")
)

Variables

Functions

func EncodeBlurHashFast

func EncodeBlurHashFast(img image.Image) (string, error)

Types

type Ahash

type Ahash uint64

Ahash is a 64bit Average Hash

func NewAHash

func NewAHash(img image.Image) (ahash Ahash, err error)

NewAHash is an Average Hash fuction that returns a hash computation of average hash. Implementation follows http://www.hackerfactor.com/blog/index.php?/archives/432-Looks-Like-It.html

type PHash256

type PHash256 [4]uint64

PHash256 is a 256bit Perception Hash

func NewPHash256

func NewPHash256(img image.Image) (phash PHash256, err error)

NewPHash256 is a Perception Hash function returns a 256bit hash computation Implementation follows: http://www.hackerfactor.com/blog/index.php?/archives/432-Looks-Like-It.html Optimized for performance and reduced memory footprint.

func (*PHash256) Decode

func (ph *PHash256) Decode(buf []byte)

func (PHash256) Distance

func (ph PHash256) Distance(hash PHash256) uint

Distance between Phash values

func (PHash256) Encode

func (ph PHash256) Encode(buf []byte)

func (PHash256) String

func (ph PHash256) String() string

type PHash64

type PHash64 uint64

PHash64 is a 64bit Perception Hash

func NewPHash64

func NewPHash64(img image.Image) (phash PHash64, err error)

NewPHash64 is a Perception Hash function returns a hash computation of phash. Implementation follows: http://www.hackerfactor.com/blog/index.php?/archives/432-Looks-Like-It.html Optimized for performance and reduced memory footprint.

func (*PHash64) Decode

func (ph *PHash64) Decode(src []byte)

func (PHash64) Distance

func (ph PHash64) Distance(hash PHash64) uint8

Distance between Phash values

func (PHash64) Encode

func (ph PHash64) Encode(dst []byte)

func (PHash64) String

func (ph PHash64) String() string

type Phash

type Phash = PHash64

Phash is a type alias for PHash64

Directories

Path Synopsis
Package transforms provides the transformations for imagehash
Package transforms provides the transformations for imagehash

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL