goimage

package module
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: May 18, 2025 License: MIT Imports: 17 Imported by: 0

README

MoGo Image

Go Report Card Docs License

Documentation

Index

Constants

View Source
const (
	FileExtensionWebp = ".webp"

	FormatNameJPG  = "jpeg"
	FormatNamePNG  = "png"
	FormatNameWEBP = "webp"
)
View Source
const (
	JPEGQualityDefault int = 80
	JPEGQualityMax     int = 100
)

Variables

This section is empty.

Functions

func ColsFilteredColor

func ColsFilteredColor(img image.Image, c ...color.Color) []int

func ColumnsFilter

func ColumnsFilter(img image.Image, tolerance float64, want ...color.Color) []uint

ColumnsFilter returns a list of column indexes that matches the wanted colors within the provided tolerane.

func CropImage

func CropImage(img image.Image, retain image.Rectangle) (image.Image, error)

CropImage takes an image and crops it to the specified rectangle. `CropImage` is from: https://stackoverflow.com/a/63256403.

func CropImageColor

func CropImageColor(img image.Image, tolerance float64, remove ...color.Color) (image.Image, error)

func CropImageColorCaption

func CropImageColorCaption(img image.Image, paddingPct, tolerance float64, remove ...color.Color) (image.Image, error)

func DecodeWebpRGBA

func DecodeWebpRGBA(r io.Reader) (image.Image, string, error)

func IsImageExt

func IsImageExt(imagePath string) bool

func ReadImageAny

func ReadImageAny(location string) (image.Image, string, error)

func ReadImageDimensions

func ReadImageDimensions(imagePath string) (int, int, error)

func ReadImageFile

func ReadImageFile(filename string) (image.Image, string, error)

func ReadImageHTTP

func ReadImageHTTP(imageURL string) (image.Image, string, error)

func ReadImages

func ReadImages(locations []string) ([]image.Image, error)

func ResizeFileJPEG

func ResizeFileJPEG(inputFile, outputFile string, outputWidth, outputHeight, quality int) error

func RowMatch

func RowMatch(img image.Image, rowIdx int, tolerance float64, want ...color.Color) bool

RowMatch checks to see if an image row matches the want colors.

func RowMatchCaption

func RowMatchCaption(paddingPct, tolerance float64, wantColorsUnique micolors.ColorsDistance, candidate []color.Color) bool

RowCaptionMatch matches a row with a caption. paddingPct is what is considered for matching. padding is left or right. Padding 0.5 or greater means matching the entire row. Padding <= 0 means no matching is necessary to succeed. Negative padding is not supported and converted to 0.

func RowsFilter

func RowsFilter(img image.Image, tolerance float64, want ...color.Color) []uint

RowsFilter returns a list of row indexes that matches the wanted colors within the provided tolerane.

func RowsFilterCaption

func RowsFilterCaption(img image.Image, paddingPct, tolerance float64, want ...color.Color) []uint

RowsFilterCaption returns a list of column indexes that matches the wanted colors within the provided tolerane.

func RowsFilteredColor

func RowsFilteredColor(img image.Image, c color.Color, cmore ...color.Color) []int

func ToPalettedMedianCut

func ToPalettedMedianCut(src image.Image) *image.Paletted

func WriteFileJPEG

func WriteFileJPEG(filename string, img image.Image, quality int) error

func WriteFilePNG

func WriteFilePNG(filename string, img image.Image) error

func WriteFileWEBP

func WriteFileWEBP(filename string, img image.Image, lossless bool, perm os.FileMode) error

Types

This section is empty.

Directories

Path Synopsis
cmd
examples
facialrecog
pdf
qrutil provides wrapper functions for https://github.com/skip2/go-qrcode
qrutil provides wrapper functions for https://github.com/skip2/go-qrcode

Jump to

Keyboard shortcuts

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