libimagequant-go

module
v0.1.1-0...-add34ea Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2019 License: MIT

README

libimagequant-go

GitHub release Go Report Card codecov CircleCI

A golang wrapper for libimagequant.

Used by

  • imagic: An easy and fast tool to process images.

Install

go get github.com/joway/libimagequant-go

Usage

High Level API
// compress png iamge
func Compress(img image.Image, quality int, speed int) (image.Image, error)
Low Level API

GoDoc

Example

package main

import (
	"fmt"
	"github.com/joway/libimagequant-go/pngquant"
	"image/png"
	"os"
)

func main() {
	source, _ := os.OpenFile("testdata/1.png", os.O_RDONLY, 0444)
	img, _ := png.Decode(source)
	quality := 70
	speed := 5 // 1~10
	output, err := pngquant.Compress(img, quality, speed)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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