This package wraps the core functionality of libvips image processing library by exposing all image operations on first-class types in Go. Additionally, it exposes raw access to call operations directly, for forward compatibility.
How fast is libvips? See this: Speed and Memory Use
This library was inspired primarily based on the C++ wrapper in libvips.
The intent for this is to enable developers to build extremely fast image processors in Go, which is suited well for concurrent requests.
Libvips is generally 4-8x faster than other graphics processors such as GraphicsMagick and ImageMagick.
This library supports all known operations available to libvips found here:
- libvips 8+ (8.3+ recommended for GIF, PDF, SVG support)
- C compatible compiler such as gcc 4.6+ or clang 3.0+
- Go 1.4+
go get -u gopkg.in/davidbyttow/vips.v0
Govips aims to provide a mostly "at the metal" implementation of libvips in Go. If you're interested in a higher level abstraction, see gotransform, a library built on top of this to make image transformations easy.
// Find the average value in an image across all bands.
buf, err := ioutil.ReadFile(file)
if err != nil {
return err
}
image, err := vips.NewImageFromBuffer(buf)
if err != nil {
return err
}
avg := image.Avg()
fmt.Printf("avg=%0.2f\n", avg)
In short, feel free to file issues or send along pull requests. See this guide on contributing for more information.
Thank you to John Cupitt for maintaining libvips and providing feedback on vips.
MIT - David Byttow