Comparator rework and fixes

This commit is contained in:
nxshock 2017-06-25 16:52:58 +05:00
parent ab1c13e694
commit eff44ff1cc
5 changed files with 117 additions and 16 deletions

View file

@ -14,12 +14,18 @@ Import package with
import "github.com/nxshock/colorcrop"
```
Crop white borders with 50% of thresold:
Crop **white** borders with **50%** of thresold:
```go
croppedImage := colorcrop.Crop(sourceImage, color.RGBA{255, 255, 255, 255}, 0.5)
```
You may use custom comparator of colors:
```go
croppedImage := colorcrop.CropWithComparator(sourceImage, color.RGBA{255, 255, 255, 255}, 0.5, colorcrop.CmpCIE76)
```
## Examples
See in "examples".