Documentation ¶
Overview ¶
Package blend implements blending mode functions bewteen images, and some utility functions for image processing.
The fundamental part of the library is the type BlendFunc, the function is applied to each pixel where the top layer (src) overlaps the bottom layer (dst) of both given 'image' interfaces.
This library provides many of the widely used blending functions to be used either as 'mode' parameter to the Blend() primary function, or to be used individually providing two 'color' interfaces. You can implement your own blending modes and pass them into the Blend() function.
This is the list of the currently implemented blending modes:
Add, Color, Color Burn, Color Dodge, Darken, Darker Color, Difference, Divide, Exclusion, Hard Light, Hard Mix, Hue, Lighten, Lighter Color, Linear Burn, Linear Dodge, Linear Light, Luminosity, Multiply, Overlay, Phoenix, Pin Light, Reflex, Saturation, Screen, Soft Light, Substract, Vivid Light.
Check github for more details: http://github.com/phrozen/blend
Index ¶
- Variables
- func Add(dst, src color.Color) color.Color
- func BlendImage(dst draw.Image, src image.Image, mode BlendFunc)
- func BlendNewImage(dst, src image.Image, mode BlendFunc) image.Image
- func Color(dst, src color.Color) color.Color
- func ColorBurn(dst, src color.Color) color.Color
- func ColorDodge(dst, src color.Color) color.Color
- func Darken(dst, src color.Color) color.Color
- func DarkerColor(dst, src color.Color) color.Color
- func Difference(dst, src color.Color) color.Color
- func Divide(dst, src color.Color) color.Color
- func Exclusion(dst, src color.Color) color.Color
- func HardLight(dst, src color.Color) color.Color
- func HardMix(dst, src color.Color) color.Color
- func Hue(dst, src color.Color) color.Color
- func Lighten(dst, src color.Color) color.Color
- func LighterColor(dst, src color.Color) color.Color
- func LinearBurn(dst, src color.Color) color.Color
- func LinearDodge(dst, src color.Color) color.Color
- func LinearLight(dst, src color.Color) color.Color
- func Luminosity(dst, src color.Color) color.Color
- func Multiply(dst, src color.Color) color.Color
- func Overlay(dst, src color.Color) color.Color
- func Phoenix(dst, src color.Color) color.Color
- func PinLight(dst, src color.Color) color.Color
- func Reflex(dst, src color.Color) color.Color
- func Saturation(dst, src color.Color) color.Color
- func Screen(dst, src color.Color) color.Color
- func SoftLight(dst, src color.Color) color.Color
- func Substract(dst, src color.Color) color.Color
- func VividLight(dst, src color.Color) color.Color
- type BlendFunc
- type Renderer
- type ThreadedRenderer
Constants ¶
This section is empty.
Variables ¶
var Modes = map[string]BlendFunc{ "add": Add, "color": Color, "color_burn": ColorBurn, "color_dodge": ColorDodge, "darken": Darken, "darker_color": DarkerColor, "difference": Difference, "divide": Divide, "exclusion": Exclusion, "hard_light": HardLight, "hard_mix": HardMix, "hue": Hue, "lighten": Lighten, "lighter_color": LighterColor, "linear_burn": LinearBurn, "linear_dodge": LinearDodge, "linear_light": LinearLight, "luminosity": Luminosity, "multiply": Multiply, "overlay": Overlay, "phoenix": Phoenix, "pin_light": PinLight, "reflex": Reflex, "saturation": Saturation, "screen": Screen, "soft_light": SoftLight, "substract": Substract, "vivid_light": VividLight, }
Available Moodes map
Functions ¶
func BlendImage ¶
BlendImage blends src image (top layer) into dst image (bottom layer) using the BlendFunc provided by mode. BlendFunc is applied to each pixel where the src image overlaps the dst image and the result is stored in the original dst image, src image is unmutable.
func BlendNewImage ¶
BlendNewImage blends src image (top layer) into dst image (bottom layer) using the BlendFunc provided by mode. BlendFunc is applied to each pixel where the src image overlaps the dst image and returns the resulting image without modifying src, or dst as they are both unmutable.