adjust

package
v0.0.0-...-358a119 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package adjust provides basic color correction functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(img image.Image, fn func(color.RGBA) color.RGBA) *image.RGBA

Apply returns a copy of the provided image after applying the provided color function to each pixel.

func Brightness

func Brightness(src image.Image, change float64) *image.RGBA

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

func Contrast(src image.Image, change float64) *image.RGBA

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

func Gamma(src image.Image, gamma float64) *image.RGBA

Gamma returns a gamma corrected copy of the image. Provided gamma param must be larger than 0.

func Hue

func Hue(img image.Image, change int) *image.RGBA

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

func Saturation(img image.Image, change float64) *image.RGBA

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 (-1.0 being -100% and 1.0 being 100%).

Types

This section is empty.

Jump to

Keyboard shortcuts

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