Documentation
¶
Overview ¶
Package phash computes a perceptual hash of an image.
Hash values are highly dependent on the scaling function used.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ScaleFunc ¶
ScaleFunc is a function Get uses to scale image to a 32×32 if needed.
An example of a ScaleFunc, using github.com/disintegration/imaging package:
scalefunc := func(img image.Image, w, h int) image.Image { return imaging.Resize(img, w, h, imaging.Lanczos) }
Note that hash value depends highly on a scaling algorithm, smoother scaling algorithms usually work better.
Function must return a 32×32 image with its top left point having 0, 0 coordinates.
Click to show internal directories.
Click to hide internal directories.