refactor(colourspace)

This commit is contained in:
Tomas Aparicio 2015-07-11 20:16:39 +01:00
parent fa55264a97
commit 851e65e71e
4 changed files with 42 additions and 11 deletions

View file

@ -175,6 +175,25 @@ if size.Width != 1000 || size.Height != 500 {
}
```
#### Custom colour space (black & white)
```go
buffer, err := bimg.Read("image.jpg")
if err != nil {
fmt.Fprintln(os.Stderr, err)
}
newImage, err := bimg.NewImage(buffer).Colourspace(bimg.INTERPRETATION_B_W)
if err != nil {
fmt.Fprintln(os.Stderr, err)
}
colourSpace, _ := bimg.ImageInterpretation(newImage)
if colourSpace != bimg.INTERPRETATION_B_W {
fmt.Fprintln(os.Stderr, "Invalid colour space")
}
```
#### Custom options
See [Options](https://godoc.org/github.com/h2non/bimg#Options) struct to discover all the available fields