Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fumiama/imago
Image saving & comparing tool for go.
https://github.com/fumiama/imago
Last synced: 16 days ago
JSON representation
Image saving & comparing tool for go.
- Host: GitHub
- URL: https://github.com/fumiama/imago
- Owner: fumiama
- License: gpl-3.0
- Created: 2021-08-10T08:14:03.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-02-17T07:17:31.000Z (almost 3 years ago)
- Last Synced: 2024-10-30T17:08:51.945Z (2 months ago)
- Language: Go
- Size: 56.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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](https://github.com/fumiama/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, force bool, samediff int) (string, string)
### func Saveimg(r io.Reader, imgdir 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)