mirror of
https://github.com/nxshock/colorcrop.git
synced 2025-07-02 00:23:44 +05:00
Update readme
This commit is contained in:
parent
eff44ff1cc
commit
b6ca62e80b
1 changed files with 10 additions and 3 deletions
13
README.md
13
README.md
|
@ -14,16 +14,23 @@ 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)
|
||||
croppedImage := colorcrop.Crop(
|
||||
sourceImage, // for source image
|
||||
color.RGBA{255, 255, 255, 255}, // crop white border
|
||||
0.5) // with 50% thresold
|
||||
```
|
||||
|
||||
You may use custom comparator of colors:
|
||||
|
||||
```go
|
||||
croppedImage := colorcrop.CropWithComparator(sourceImage, color.RGBA{255, 255, 255, 255}, 0.5, colorcrop.CmpCIE76)
|
||||
croppedImage := colorcrop.CropWithComparator(
|
||||
sourceImage, // for source image
|
||||
color.RGBA{255, 255, 255, 255}, // crop white border
|
||||
0.5, // with 50% thresold
|
||||
colorcrop.CmpCIE76) // using CIE76 standart for defining color difference
|
||||
```
|
||||
|
||||
## Examples
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue