anthonynsimon / bild
- четверг, 11 августа 2016 г. в 03:14:45
Go
A collection of image processing algorithms in Go
import "github.com/anthonynsimon/bild"
Simple image processing in Go with parallel processing support.
Package bild provides a collection of common image processing functions. The input images must implement the image.Image interface and the functions return an *image.RGBA.
The aim of this project is simplicity in use and development over high performance, but most algorithms are designed to be efficient and make use of parallelism when available. It is based on standard Go packages to reduce dependecy use and development abstractions.
bild requires Go version 1.4 or greater.
go get -u github.com/anthonynsimon/bild
http://godoc.org/github.com/anthonynsimon/bild
package main
import "github.com/anthonynsimon/bild"
func main() {
img, err := bild.Open("filename")
if err != nil {
panic(err)
}
result := bild.Invert(img)
if err := bild.Save("filename", result, bild.PNG); err != nil {
panic(err)
}
}
result := bild.Brightness(img, 0.25)
result := bild.Contrast(img, -0.5)
result := bild.Gamma(img, 2.2)
result := bild.Add(bg, fg)
result := bild.ColorBurn(bg, fg)
result := bild.ColorDodge(bg, fg)
result := bild.Darken(bg, fg)
result := bild.Difference(bg, fg)
result := bild.Divide(bg, fg)
result := bild.Exclusion(bg, fg)
result := bild.Lighten(bg, fg)
result := bild.LinearBurn(bg, fg)
result := bild.LinearLight(bg, fg)
result := bild.Multiply(bg, fg)
result := bild.Normal(bg, fg)
result := bild.Opacity(bg, fg, 0.5)
result := bild.Overlay(bg, fg)
result := bild.Screen(bg, fg)
result := bild.SoftLight(bg, fg)
result := bild.Subtract(bg, fg)
result := bild.BoxBlur(img, 3.0)
result := bild.GaussianBlur(img, 3.0)
result := bild.EdgeDetection(img, 1.0)
result := bild.Emboss(img)
result := bild.Grayscale(img)
result := bild.Invert(img)
result := bild.Median(img, 10.0)
result := bild.Sharpen(img)
result := bild.Sobel(img)
result := bild.FlipH(img)
result := bild.FlipV(img)