1
0
mirror of https://github.com/fumiama/imago.git synced 2026-06-05 16:30:27 +08:00
2021-08-10 18:00:40 +08:00
2021-08-10 16:14:04 +08:00
2021-08-10 16:26:59 +08:00
2021-08-10 17:22:56 +08:00
2021-08-10 17:22:56 +08:00
2021-08-10 17:22:56 +08:00
2021-08-10 16:14:04 +08:00
2021-08-10 18:00:40 +08:00
2021-08-10 18:00:40 +08:00

imago

Image saving & comparing tool for go based on webp.

Functions

func Str2bytes(s string) []byte

Fast convert

func Bytes2str(b []byte) string

Fast convert

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

Get image dhash encoded by go-base16384

func HammDistance(img1 string, img2 string) (int, error)

Get hamming distance between two dhash strings

func Scanimgs(imgdir string) error

Scan all images like 编码后哈希.webp

func Pick(exclude []string) string

Pick a random image

func Saveimgbytes(b []byte, imgdir string, uid string, force bool, samediff int) (string, string)

func Saveimg(r io.Reader, imgdir string, uid string, samediff int) (string, string)

Save image into imgdir with name like 编码后哈希.webp Return value: status, dhash

func Addimage(name string)

manually add an image name into map

func Imgexsits(name string) bool

Return whether the name is in map

func Setloglevel(level log.Level)

Description
Image saving & comparing tool for go.
Readme GPL-3.0 92 KiB
Languages
Go 100%