xgif

package
v0.0.0-...-4e3f732 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2017 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CurrentOS string
View Source
var CurrentPath string

Functions

func CompressByGifsicle

func CompressByGifsicle(source string, out string, colorNum string)

使用gifsicle,压缩单张gif colorNum范围1-256,最佳128

func CompressGif

func CompressGif(sourceGif string, outGif string, quality int)

压缩gif

func CompressGifDir

func CompressGifDir(fromDir string, outDir string, maxSize string, colorNum string)

压缩文件夹下的所有gif文件

func CompressGifSize

func CompressGifSize(source string, out string, targetSize string)

使用gifsicle,压缩单张gif,达到目标尺寸

func DecodeGifFrame

func DecodeGifFrame(gifPath string, outDir string)

解析出gif的所有图片

func EncodeFileToGif

func EncodeFileToGif(filelist []string, outpath string)

func EncodeImagesToGif

func EncodeImagesToGif(listimage []*image.Image, outpath string)

Types

type GifHandler

type GifHandler struct {
	ImageMagickDirPath string
	GifsicleDirPath    string
}

gif 压缩,加水印

func (*GifHandler) AddWatermark

func (gif *GifHandler) AddWatermark(gifsourcepath string, watermarkpath string, outgif string, converPath string) error

添加水印

func (*GifHandler) AddWatermarkCompress

func (gif *GifHandler) AddWatermarkCompress(sourceGif string, outgif string, watermark string, colornum string,
	tarhetSize float32, convertPath string, gifsiclepath string) error

先添加水印,然后压缩

func (*GifHandler) Compress

func (gif *GifHandler) Compress(sourcegif string, outgif string, colornum string, targetSize float32) error

压缩,使用gifsicle targetSize 单位为M,例如2.0 colornum (1-256)色值越小图片越小,质量越低,最佳值128,若targetSize>0,则忽略此参数

func (*GifHandler) CompressByColornum

func (gif *GifHandler) CompressByColornum(sourcegif string, outgif string, colornum string, gifsiclepath string) error

func (*GifHandler) CompressByTargetsize

func (gif *GifHandler) CompressByTargetsize(sourcegif string, outgif string, targtesize float32, gifsiclepath string) error

targtesize 单位为M,例如2.3M

func (*GifHandler) WatermarkCompressDir

func (gif *GifHandler) WatermarkCompressDir(fromDir string, outDir string, watermark string, colornum string, targetSize string) error

添加水印,压缩文件夹下的所有gif文件

Jump to

Keyboard shortcuts

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