utils

package
v0.21.2 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyDir

func CopyDir(srcDir, dstDir string) error

CopyDir recursively copies a folder from src to dst

func DecodeImageFromBytes added in v0.8.0

func DecodeImageFromBytes(data []byte) (image.Image, error)

DecodeImageFromBytes decodes an image from a byte slice

func DiffImagesPink added in v0.8.0

func DiffImagesPink(img1, img2 image.Image) (diff *image.RGBA, mismatch float64)

DiffImagesPink compares two images and creates a diff image with pink highlights Only compares the overlapping region (intersection of both bounds)

func DiffImagesPinkWithBounds added in v0.18.0

func DiffImagesPinkWithBounds(img1, img2 image.Image) (diff *image.RGBA, mismatch float64)

DiffImagesPinkWithBounds compares two images and highlights out-of-bounds areas The diff image covers the union of both image bounds

func LoadImage added in v0.8.0

func LoadImage(path string) (image.Image, error)

LoadImage loads an image from a file path

func SaveImage added in v0.8.0

func SaveImage(path string, img image.Image) error

SaveImage saves an image to a file path

Types

type DimensionDiff added in v0.18.0

type DimensionDiff struct {
	WidthDiff  int // positive = test wider, negative = test narrower
	HeightDiff int // positive = test taller, negative = test shorter
}

DimensionDiff holds dimension difference information

func CompareDimensions added in v0.18.0

func CompareDimensions(img1, img2 image.Image) (same bool, diff DimensionDiff)

CompareDimensions checks if two images have the same dimensions

Jump to

Keyboard shortcuts

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