Documentation ¶
Index ¶
- Constants
- func AppendHorizontally(img1 image.Image, img2 image.Image) image.Image
- func ColorDepth(src image.Image) uint
- func CropImage(src image.Image, rect image.Rectangle) image.Image
- func FuzzFromPercent(fp float64) float64
- func GetRMSEDistortion(img1 image.Image, r image.Rectangle, img2 image.Image, sp image.Point) float64
- func IsColorSimilar(u color.Color, v color.Color, fuzzP float64) bool
- func NewCanvasSameColor(src image.Image, r image.Rectangle) draw.Image
- func ParseColorHex(str string) (color.Color, error)
- func QuantizeAndDither(img image.Image, numColor int) *image.Paletted
- func Resize(src image.Image, size image.Point) image.Image
- func Rotate(src image.Image, degree float64) image.Image
- func SquaredDistortion(u color.Color, v color.Color) float64
- func ToHexString(c color.Color) string
- func TransformToGrayColorModel(img image.Image) image.Image
- func TrimRect(img image.Image, bgColor color.Color, fuzzP float64) (image.Rectangle, error)
Constants ¶
View Source
const ColorRange = 0xffff // 16-bit color
View Source
const Epsilon = 1.0e-12
Variables ¶
This section is empty.
Functions ¶
func ColorDepth ¶
func FuzzFromPercent ¶
func GetRMSEDistortion ¶
func IsColorSimilar ¶
This function compares two colors within certain distance in a linear 3D color space. Two colors are similar when
fuzz >= sqrt(color_distance^2 * (u.a/qr) * (v.a/qr) + (u.a - v.a)^2)
where
color_distance^2 = ((u.r-v.r)^2 + (u.g-v.g)^2 + (u.b-v.b)^2) / 3
func ToHexString ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.