imagex

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JPG  = "jpg"
	JPEG = "jpeg"
	PNG  = "png"
	GIF  = "gif"
	BMP  = "bmp"
	WEBP = "webp"
)

Variables

View Source
var ErrUnsupportExt = fmt.Errorf("unsupported image extension")
View Source
var MontageOpts = montageOptions{}

Functions

func CropCircle

func CropCircle(img image.Image) image.Image

func Decode

func Decode(r io.Reader) (image.Image, error)

func DecodeFile

func DecodeFile(path string) (image.Image, error)

func DrawPureCircle

func DrawPureCircle(color color.RGBA, radius int) image.Image

func DrawPureRect

func DrawPureRect(w, h int, color color.RGBA) image.Image

DrawPureRect draw a pure color rectangle image using the given size and color.

func DrawText

func DrawText(src image.Image, text string, color color.Color, face font.Face, x, y int) image.Image

func FmtExt

func FmtExt(path string) string

func Montage

func Montage(imgs []image.Image, opts ...MontageOption) image.Image

func NewRGBA

func NewRGBA(r, g, b, a uint8) color.RGBA

func Resize

func Resize(width, height uint, img image.Image) image.Image

func Save

func Save(img image.Image, path string, options ...Option) error

func Thumbnail

func Thumbnail(maxWidth, maxHeight uint, img image.Image) image.Image

Types

type Direction

type Direction int

type MontageOption

type MontageOption func(opts *montageOptions)

type Option

type Option interface{}

func DefaultQuality

func DefaultQuality() Option

func HighQulity

func HighQulity() Option

func LowQulity

func LowQulity() Option

func NewGifOption

func NewGifOption(numColors int, quantizer draw.Quantizer, drawer draw.Drawer) Option

func NewJpgOption

func NewJpgOption(quality int) Option

Jump to

Keyboard shortcuts

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