Documentation ¶
Overview ¶
Package blend provides common image blending modes.
Index ¶
- func Add(bg image.Image, fg image.Image) *image.RGBA
- func Blend(bg image.Image, fg image.Image, ...) *image.RGBA
- func ColorBurn(bg image.Image, fg image.Image) *image.RGBA
- func ColorDodge(bg image.Image, fg image.Image) *image.RGBA
- func Darken(bg image.Image, fg image.Image) *image.RGBA
- func Difference(bg image.Image, fg image.Image) *image.RGBA
- func Divide(bg image.Image, fg image.Image) *image.RGBA
- func Exclusion(bg image.Image, fg image.Image) *image.RGBA
- func Lighten(bg image.Image, fg image.Image) *image.RGBA
- func LinearBurn(bg image.Image, fg image.Image) *image.RGBA
- func LinearLight(bg image.Image, fg image.Image) *image.RGBA
- func Multiply(bg image.Image, fg image.Image) *image.RGBA
- func Normal(bg image.Image, fg image.Image) *image.RGBA
- func Opacity(bg image.Image, fg image.Image, percent float64) *image.RGBA
- func Overlay(bg image.Image, fg image.Image) *image.RGBA
- func Screen(bg image.Image, fg image.Image) *image.RGBA
- func SoftLight(bg image.Image, fg image.Image) *image.RGBA
- func Subtract(bg image.Image, fg image.Image) *image.RGBA
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Add ¶
Add combines the foreground and background images by adding their values and returns the resulting image.
func Blend ¶ added in v0.12.0
func Blend(bg image.Image, fg image.Image, fn func(fcolor.RGBAF64, fcolor.RGBAF64) fcolor.RGBAF64) *image.RGBA
Blend two images together by applying the provided function for each pixel. If images differ in size, the minimum width and height will be picked from each one when creating the resulting image.
func ColorBurn ¶
ColorBurn combines the foreground and background images by dividing the inverted background by the foreground image and then inverting the result which is then returned.
func ColorDodge ¶
ColorDodge combines the foreground and background images by dividing background by the inverted foreground image and returns the result.
func Darken ¶
Darken combines the foreground and background images by picking the darkest value per channel for each pixel. The result is then returned.
func Difference ¶
Difference calculates the absolute difference between the foreground and background images and returns the resulting image.
func Divide ¶
Divide combines the foreground and background images by diving the values from the background by the foreground and returns the resulting image.
func Exclusion ¶
Exclusion combines the foreground and background images applying the Exclusion blend mode and returns the resulting image.
func Lighten ¶
Lighten combines the foreground and background images by picking the brightest value per channel for each pixel. The result is then returned.
func LinearBurn ¶
LinearBurn combines the foreground and background images by adding them and then subtracting 255 (1.0 in normalized scale). The resulting image is then returned.
func LinearLight ¶
LinearLight combines the foreground and background images by a mix of a Linear Dodge and Linear Burn operation. The resulting image is then returned.
func Multiply ¶
Multiply combines the foreground and background images by multiplying their normalized values and returns the resulting image.
func Normal ¶
Normal combines the foreground and background images by placing the foreground over the background using alpha compositing. The resulting image is then returned.
func Opacity ¶
Opacity returns an image which blends the two input images by the percentage provided. Percent must be of range 0 <= percent <= 1.0
func Overlay ¶
Overlay combines the foreground and background images by using Multiply when channel values < 0.5 or using Screen otherwise and returns the resulting image.
func Screen ¶
Screen combines the foreground and background images by inverting, multiplying and inverting the output. The result is a brighter image which is then returned.
Types ¶
This section is empty.