imagex

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 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 MontageOpts = montageOptions{}
View Source
var UnsupportExtError = fmt.Errorf("unsupported image extension")

Functions

func CropCircle added in v1.0.0

func CropCircle(img image.Image) image.Image

func Decode added in v1.0.0

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

func DecodeFile added in v1.0.0

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

func DrawPureCircle added in v1.0.0

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

func DrawPureRect added in v1.0.0

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 added in v1.0.0

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

func FmtExt added in v1.0.0

func FmtExt(path string) string

func Montage added in v1.0.0

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

func NewRGBA added in v1.0.0

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

func Resize

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

func Save added in v1.0.0

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 added in v1.0.0

type Direction int

type MontageOption added in v1.0.0

type MontageOption func(opts *montageOptions)

type Option added in v1.0.0

type Option interface{}

func DefaultQuality added in v1.0.0

func DefaultQuality() Option

func HighQulity added in v1.0.0

func HighQulity() Option

func LowQulity added in v1.0.0

func LowQulity() Option

func NewGifOption added in v1.0.0

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

func NewJpgOption added in v1.0.0

func NewJpgOption(quality int) Option

Jump to

Keyboard shortcuts

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