mashup

package module
v0.0.0-...-3ad0221 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Mashup

func Mashup(src, dst *Input, out *Output, maxColors int) error

Mashup creates a color mashup of src and dst by computing their most prominent colors. Most prominent colors in dst will be replaced by the most prominent colors of src.

Specify the maximum amount of colors that should be replaced using the maxColors parameter. If the amount of colors in either src or dst is less than the maxColors value, this amount will become the maximum.

Additionally, if the src and dst are not of the same type, both formats are registered.

Types

type DecodeConfigFunc

type DecodeConfigFunc func(io.Reader) (image.Config, error)

type DecodeFunc

type DecodeFunc func(io.Reader) (image.Image, error)

type EncodeFunc

type EncodeFunc func(io.Writer, image.Image) error

type Input

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

func NewCustomInput

func NewCustomInput(r io.Reader, name, magic string, decodeFunc DecodeFunc, decodeConfigFunc DecodeConfigFunc) *Input

NewCustomInput creates a new Input for types not supported by this library

func NewJPEGInput

func NewJPEGInput(r io.Reader) *Input

NewJPEGInput creates a new Input for JPEGs

func NewPNGInput

func NewPNGInput(r io.Reader) *Input

NewPNGInput creates a new Input for PNGs

type Output

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

func NewCustomOutput

func NewCustomOutput(w io.Writer, encodeFunc EncodeFunc) *Output

NewCustomOutput creates a new Output for types not supported by this library

func NewJPEGOutput

func NewJPEGOutput(w io.Writer, quality int) *Output

NewJPEGOutput creates a new Output for JPEGs with the given quality

func NewPNGOutput

func NewPNGOutput(w io.Writer) *Output

NewPNGOutput creates a new Output for PNGs

Jump to

Keyboard shortcuts

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