binarize

package
v0.0.0-...-5315466 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 25, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CoordPool = sync.Pool{
	New: func() interface{} {
		return []Coordinate{}
	},
}

Functions

func Crop

func Crop(img SubImager) image.Image

func Difference

func Difference(img1, img2 *image.Gray) int

func Encode

func Encode(w io.Writer, img image.Image, format string, jpgQuality int) error

func Init

func Init()

func Load

func Load(name string) (image.Image, error)

func Save

func Save(name string, img image.Image, format string, jpgQuality int) error

func Trim

func Trim(img *image.Gray, index []Coordinate) *image.Gray

Types

type Coordinate

type Coordinate struct {
	X, Y int
}

func Binarize

func Binarize(img image.Image) (*image.Gray, []Coordinate)

func Optimize

func Optimize(source image.Image, img *image.Gray, index []Coordinate) (*image.Gray, []Coordinate)

type SubImager

type SubImager interface {
	image.Image
	SubImage(image.Rectangle) image.Image
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL