Documentation
¶
Overview ¶
Package adjust provides basic color correction functions.
Index ¶
- func Apply(img image.Image, fn func(color.RGBA) color.RGBA) *image.RGBA
- func Brightness(src image.Image, change float64) *image.RGBA
- func Contrast(src image.Image, change float64) *image.RGBA
- func Gamma(src image.Image, gamma float64) *image.RGBA
- func Hue(img image.Image, change int) *image.RGBA
- func Saturation(img image.Image, change float64) *image.RGBA
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Apply ¶
Apply returns a copy of the provided image after applying the provided color function to each pixel.
func Brightness ¶
Brightness returns a copy of the image with the adjusted brightness. Change is the normalized amount of change to be applied (range -1.0 to 1.0).
func Contrast ¶
Contrast returns a copy of the image with its difference in high and low values adjusted by the change param. Change is the normalized amount of change to be applied, in the range of -1.0 to 1.0. If Change is set to 0.0, then the values remain the same, if it's set to 0.5, then all values will be moved 50% away from the middle value.
func Gamma ¶
Gamma returns a gamma corrected copy of the image. Provided gamma param must be larger than 0.
func Hue ¶ added in v0.7.0
Hue adjusts the overall hue of the provided image and returns the result. Parameter change is the amount of change to be applied and is of the range -360 to 360. It corresponds to the hue angle in the HSL color model.
func Saturation ¶ added in v0.7.0
Saturation adjusts the saturation of the image and returns the result. Parameter change is the amount of change to be applied and is of the range -1.0 to 1.0. It's applied as relative change. For example if the current color saturation is 1.0 and the saturation change is set to -0.5, a change of -50% will be applied so that the resulting saturation is 0.5 in the HSL color model.
Types ¶
This section is empty.