imageprocessing

package
v0.0.0-...-85d6a38 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const HueMaxValue = 360

Variables

View Source
var (
	ErrUnsupported = errors.New("unsupported")
	ErrInternal    = errors.New("internal")
)

Functions

func ConvertToBase64

func ConvertToBase64(img []byte) []byte

func DecodeImage

func DecodeImage(img []byte) (decoded image.Image, mimeType *mimetype.MIME, err error)

func EncodeImage

func EncodeImage(img image.Image, extension string) ([]byte, error)

func GetMimeTypeExt

func GetMimeTypeExt(img []byte) string

Types

type ImagesProcessing

type ImagesProcessing interface {
	Resize(ctx context.Context, img image.Image, width, height int, resampleMethod string) image.Image
	Crop(ctx context.Context, img image.Image, x0, y0, x1, y1 int) image.Image
	Desaturate(ctx context.Context, img image.Image) image.Image
	Hue(ctx context.Context, img image.Image, hue int) image.Image
	Blur(ctx context.Context, img image.Image, radius float64, method string) image.Image
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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