effect

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2024 License: MIT Imports: 11 Imported by: 61

Documentation

Overview

Package effect provides the functionality to manipulate images to achieve various looks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dilate added in v0.7.0

func Dilate(img image.Image, radius float64) *image.RGBA

Dilate picks the local maxima from the neighbors of each pixel and returns the resulting image. The parameter radius corresponds to the radius of the neighbor area to be searched, for example a radius of R will result in a search window length of 2R+1 for each dimension.

func EdgeDetection

func EdgeDetection(src image.Image, radius float64) *image.RGBA

EdgeDetection returns a copy of the image with its edges highlighted.

func Emboss

func Emboss(src image.Image) *image.RGBA

Emboss returns a copy of the image in which each pixel has been replaced either by a highlight or a shadow representation.

func Erode added in v0.7.0

func Erode(img image.Image, radius float64) *image.RGBA

Erode picks the local minima from the neighbors of each pixel and returns the resulting image. The parameter radius corresponds to the radius of the neighbor area to be searched, for example a radius of R will result in a search window length of 2R+1 for each dimension.

func Grayscale

func Grayscale(img image.Image) *image.RGBA

Grayscale returns a copy of the image in Grayscale using the weights 0.3R + 0.6G + 0.1B as a heuristic.

func GrayscaleWithWeights added in v0.11.0

func GrayscaleWithWeights(img image.Image, r, g, b float64) *image.RGBA

GrayscaleWithWeights returns a copy of the image in Grayscale using the given weights. The weights should be in the range 0.0 to 1.0 inclusive.

func Invert

func Invert(src image.Image) *image.RGBA

Invert returns a negated version of the image.

func Median

func Median(img image.Image, radius float64) *image.RGBA

Median returns a new image in which each pixel is the median of its neighbors. The parameter radius corresponds to the radius of the neighbor area to be searched, for example a radius of R will result in a search window length of 2R+1 for each dimension.

func Sepia added in v0.7.0

func Sepia(img image.Image) *image.RGBA

Sepia returns a copy of the image in Sepia tone.

func Sharpen

func Sharpen(src image.Image) *image.RGBA

Sharpen returns a sharpened copy of the image by detecting its edges and adding it to the original.

func Sobel

func Sobel(src image.Image) *image.RGBA

Sobel returns an image emphasising edges using an approximation to the Sobel–Feldman operator.

func UnsharpMask added in v0.10.0

func UnsharpMask(img image.Image, radius, amount float64) *image.RGBA

UnsharpMask returns a copy of the image with its high-frecuency components amplified. Parameter radius corresponds to the radius to be samples per pixel. Parameter amount is the normalized strength of the effect. A value of 0.0 will leave the image untouched and a value of 1.0 will fully apply the unsharp mask.

Types

This section is empty.

Jump to

Keyboard shortcuts

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