mirror of
https://github.com/talgo-cloud/bimg.git
synced 2026-03-08 15:08:16 -07:00
merge
This commit is contained in:
commit
68316a6449
1 changed files with 11 additions and 16 deletions
27
README.md
27
README.md
|
|
@ -1,6 +1,6 @@
|
|||
# bimg [](https://travis-ci.org/h2non/bimg) [](https://github.com/h2non/bimg/releases) [](https://godoc.org/github.com/h2non/bimg) [](https://coveralls.io/r/h2non/bimg?branch=master)
|
||||
# bimg [](https://travis-ci.org/h2non/bimg) [](https://github.com/h2non/bimg/releases) [](https://godoc.org/github.com/h2non/bimg) [](https://coveralls.io/r/h2non/bimg?branch=master)
|
||||
|
||||
Small [Go](http://golang.org) library for fast and efficient image processing based on [libvips](https://github.com/jcupitt/libvips) using C bindings. It provides a simple, elegant and fluent [programmatic API](#examples).
|
||||
Small [Go](http://golang.org) library for fast high-level image processing and transformation using [libvips](https://github.com/jcupitt/libvips) via C bindings. It provides a simple, elegant and fluent [programmatic API](#examples).
|
||||
|
||||
bimg was designed to be a small and efficient library with a generic and useful features.
|
||||
It uses internally libvips, a powerful library written in C for binary image processing which requires a [low memory footprint](http://www.vips.ecs.soton.ac.uk/index.php?title=Speed_and_Memory_Use)
|
||||
|
|
@ -10,11 +10,8 @@ It can read JPEG, PNG, WEBP and TIFF formats and output to JPEG, PNG and WEBP, i
|
|||
|
||||
For getting started, take a look to the [examples](#examples) and [API](https://godoc.org/github.com/h2non/bimg) documentation.
|
||||
If you're looking for a HTTP-based image processing solution, see [imaginary](https://github.com/h2non/imaginary).
|
||||
|
||||
bimg was heavily inspired in [sharp](https://github.com/lovell/sharp), its homologous package built for node.js by [Lovell Fuller](https://github.com/lovell).
|
||||
|
||||
**Note**: bimg is still beta. Do not use in compromised environments yet
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- [libvips](https://github.com/jcupitt/libvips) v7.40.0+ (7.42.0+ recommended)
|
||||
|
|
@ -185,19 +182,17 @@ if err != nil {
|
|||
fmt.Fprintln(os.Stderr, err)
|
||||
}
|
||||
|
||||
options := bimg.Watermark{
|
||||
Watermark{
|
||||
Text: "Chuck Norris (c) 2315",
|
||||
Opacity: 0.25,
|
||||
Width: 200,
|
||||
DPI: 100,
|
||||
Margin: 150,
|
||||
Font: "sans bold 12",
|
||||
Background: bimg.Color{255, 255, 255},
|
||||
}
|
||||
watermark := bimg.Watermark{
|
||||
Text: "Chuck Norris (c) 2315",
|
||||
Opacity: 0.25,
|
||||
Width: 200,
|
||||
DPI: 100,
|
||||
Margin: 150,
|
||||
Font: "sans bold 12",
|
||||
Background: bimg.Color{255, 255, 255},
|
||||
}
|
||||
|
||||
newImage, err := bimg.NewImage(buffer).Watermark(options)
|
||||
newImage, err := bimg.NewImage(buffer).Watermark(watermark)
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue