blend

package
v0.0.0-...-55700be Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddGray

func AddGray(img1 *image.Gray, img2 *image.Gray) (*image.Gray, error)

AddGray accepts two grayscale images and adds their pixel values. If the result for a given position overflows uint8, the result will be clamped to max uint8 (255). Example of usage:

res, err := blend.AddGray(gray1, gray2)

func AddGrayWeighted

func AddGrayWeighted(img1 *image.Gray, w1 float64, img2 *image.Gray, w2 float64) (*image.Gray, error)

AddGrayWeighted accepts two grayscale images and adds their pixel values using the following equation: res(x, y) = img1(x, y) * w1 + img2(x, y) * w2 If the result for a given position overflows uint8, the result will be clamped to max uint8 (255). If the result for a given position is negative, then it will be clamped to 0. Example of usage:

res, err := blend.AddGrayWeighted(gray1, 0.25, gray2, 0.75)

func AddScalarToGray

func AddScalarToGray(img *image.Gray, value int) *image.Gray

AddScalarToGray takes a grayscale image and and adds an integer value to all pixels of the image. If the result overflows uint8, the result will be clamped to max uint8 (255). Example of usage:

res := blend.AddScalarToGray(img, 56)

Types

This section is empty.

Jump to

Keyboard shortcuts

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