CuteReimu / neuquant

Golang implementation of the NeuQuant image quantization algorithm by Anthony Dekker. Go语言版NeuQuant图像量化算法,算法原作者Anthony Dekker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NeuQuant 图像量化算法

Neural network based color quantizer. Can be used to transform image.Image to image.Paletted.

颜色量化的神经网络算法。可以用来把任意图像转化为image.Paletted图像。

Install 安装方法

go get github.com/CuteReimu/neuquant

Usage 使用方法

package main

import (
	"github.com/CuteReimu/neuquant"
	"image/gif"
	"image/png"
	"os"
)

func main() {
	f, _ := os.Open("1.png")
	defer f.Close()
	img, _ := png.Decode(f)

	f2, _ := os.Create("1.gif")
	defer f2.Close()
	_ = gif.Encode(f2, img, neuquant.Opt())
}

License

The original NeuQuant Algorithm was developed by Anthony Dekker, 1994. See 'LICENSE'.

Golang implementation of NeuQuant Algorithm was done by CuteReimu, 2021.

About

Golang implementation of the NeuQuant image quantization algorithm by Anthony Dekker. Go语言版NeuQuant图像量化算法,算法原作者Anthony Dekker

License:Other


Languages

Language:Go 100.0%