Documentation ¶
Overview ¶
package imgo is a golang image process lib
Index ¶
- func AdjustBrightness(src [][][]uint8, light float64) (imgMatrix [][][]uint8, err error)
- func Base64ToImg(encodeString string, dstFile string) error
- func Binaryzation(src [][][]uint8, threshold int) [][][]uint8
- func CosineSimilarity(src1 string, src2 string) (cossimi float64, err error)
- func DecodeImage(filePath string) (img image.Image, err error)
- func Dot(x []uint8, y []uint8) float64
- func GetFingerprint(src string) (fp string, err error)
- func GetImageHeight(img image.Image) int
- func GetImageWidth(img image.Image) int
- func HorizontalMirror(src [][][]uint8) [][][]uint8
- func HorizontalMirrorPart(src [][][]uint8) [][][]uint8
- func ImageFusion(src1 string, src2 string) (imgMatrix [][][]uint8, err error)
- func Img2Base64(filepath string) (encodeString string, err error)
- func Img2Base64ByGoImage(img image.Image) (encodeString string, err error)
- func Iterator(filepath string, iter IterFunc) (imgMatrix [][][]uint8, err error)
- func Matrix2Vector(imgMatrix [][][]uint8) (vector []uint8)
- func MustRead(filepath string) (imgMatrix [][][]uint8)
- func NegativeFilmEffect(src [][][]uint8) [][][]uint8
- func New3DSlice(x int, y int, z int) (theSlice [][][]uint8)
- func NewRGBAMatrix(height int, width int) (rgbaMatrix [][][]uint8)
- func RGB2Gray(src [][][]uint8) [][][]uint8
- func Read(imgOrPath interface{}) (imgMatrix [][][]uint8, err error)
- func Resize(src *image.NRGBA, width int, height int) *image.NRGBA
- func ResizeForMatrix(filepath string, width int, height int) (imgMatrix [][][]uint8, err error)
- func Rotate(src [][][]uint8) [][][]uint8
- func SaveAsJPEG(filepath string, imgMatrix [][][]uint8, quality int) error
- func SaveAsPNG(filepath string, imgMatrix [][][]uint8) error
- func SetOpacity(src [][][]uint8, opacity float64) (imgMatrix [][][]uint8, err error)
- func SunsetEffect(src [][][]uint8) [][][]uint8
- func VerticalMirror(src [][][]uint8) [][][]uint8
- func VerticalMirrorPart(src [][][]uint8) [][][]uint8
- type IterFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AdjustBrightness ¶
func Base64ToImg ¶
Base64ToImg create a image file named dstFile from base64 encodeString.
func Binaryzation ¶
binaryzation process of image matrix , threshold can use 127 to test
func CosineSimilarity ¶
calculate Cosine Similarity of two images, input two file path
func DecodeImage ¶
decode a image and retrun golang image interface
func GetFingerprint ¶
GetFingerprint use Perceptual Hash Algorithm to get fingerprint from a pircture
func GetImageHeight ¶
func GetImageWidth ¶
func HorizontalMirror ¶
func HorizontalMirrorPart ¶
make a mirror of src
func ImageFusion ¶
fuse two images(filepath) and the size of new image is as src1
func Img2Base64 ¶
Img2Base64 produce a base64 string from a image file.
func Img2Base64ByGoImage ¶
Img2base64ByGoImage produce a base64 string from Image interface.
func Matrix2Vector ¶
func NegativeFilmEffect ¶
input a image as src , return a image matrix by negativefilmeffect process
func New3DSlice ¶
create a three dimenson slice
func NewRGBAMatrix ¶
create a new rgba matrix
func ResizeForMatrix ¶
func SaveAsJPEG ¶
save a image matrix as a jpeg,if unsuccessful it will return a error,quality must be 1 to 100
func SetOpacity ¶
set the opacity of image matrix , opacity must be 0.0 to 1.0
func SunsetEffect ¶
input a image matrix as src , return a image matrix by sunseteffect process