process

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: May 29, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FloydSteinBerg = *makeFloydSteinBerg()

FloydSteinBerg is the EDM used for FS dithering

View Source
var JarvisJudiceNinke = ErrorDiffusionMatrix{
	{1, 0, 7.0 / 48.0},
	{2, 0, 5.0 / 48.0},
	{-2, 1, 3.0 / 48.0},
	{-1, 1, 5.0 / 48.0},
	{0, 1, 7.0 / 48.0},
	{1, 1, 5.0 / 48.0},
	{2, 1, 3.0 / 48.0},
	{-2, 2, 1.0 / 48.0},
	{-1, 2, 3.0 / 48.0},
	{0, 2, 5.0 / 48.0},
	{1, 2, 3.0 / 48.0},
	{2, 2, 1.0 / 48.0},
}

JarvisJudiceNinke is the EDM used for JarvisJudiceNinke dithering

View Source
var Simple = *makeSimpleDiffuser()

Simple is the EDM used for simple 2d dithering

View Source
var Stucki = *makeStuckiDiffuser()

Stucki is the EDM used for Stucki dithering

Functions

func ApplyErrorDiffusion added in v0.7.0

func ApplyErrorDiffusion(img AdjustableImage, palette color.Palette, diffusers *ErrorDiffusionMatrix) *image.Paletted

ApplyErrorDiffusion will apply the error diffusion dithering, with the provided slice of error spreading ErrorDiffuser elements.

func Downscale

func Downscale(img image.Image, factor int) *image.RGBA

Downscale scales the image down with a given integer factor

func Resize added in v0.9.4

func Resize(img image.Image, x, y int) *image.RGBA

Resize resizes the input to the desired x, y specification

func Upscale

func Upscale(img image.Image, factor int) *image.RGBA

Upscale scales the input image up with the given integer factor

Types

type AdjustableImage added in v0.8.0

type AdjustableImage interface {
	ColorModel() color.Model
	Bounds() image.Rectangle
	RGBAAt(x, y int) color.RGBA
	Set(x, y int, c color.Color)
}

AdjustableImage is an interface to define images that implement the .Set() function

type ErrorDiffuser added in v0.7.0

type ErrorDiffuser struct {
	// contains filtered or unexported fields
}

ErrorDiffuser represents one spreaded error, with parameters x_offset, y_offset, and the fraction of the error to divide

type ErrorDiffusionMatrix added in v0.8.0

type ErrorDiffusionMatrix []ErrorDiffuser

ErrorDiffusionMatrix is the matrix that is used to spread the errors

Jump to

Keyboard shortcuts

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