imagecat

package module
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: May 16, 2023 License: MIT Imports: 4 Imported by: 0

README

imagecat

Concatenate images into a single image on x or y axis with optional alignment centering

GoDoc badge GoDoc badge GoReport badge GoReport badge

Installation

go get github.com/dillonstreator/imagecat/v2

Usage

import (
    "image"

    "github.com/dillonstreator/imagecat/v2"
)

func main () {

    images := []image.Image{
        // ... images
    }

    // concat on x-axis with no alignment
    img, err := imagecat.Concat(images)
    if err != nil { /* handle error */ }

    // concat on y-axis with center alignment
    img, err = imagecat.Concat(images, imagecat.WithAxis(imagecat.AxisY), imagecat.WithAlignment(imagecat.AlignmentCenter))
    if err != nil { /* handle error */ }

}

Examples

Input images

concat on x-axis with no alignment

concat on x-axis with center alignment

concat on y-axis with no alignment

concat on y-axis with center alignment

Documentation

Index

Constants

View Source
const (
	// Specifies the axis with which the images will be concatenated on
	AxisX Axis = iota
	AxisY

	// Specifies the alignment that will be applied to the images
	AlignmentNone Alignment = iota
	AlignmentCenter
)

Variables

This section is empty.

Functions

func Concat

func Concat(images []image.Image, options ...OptionFn) (*image.RGBA, error)

Types

type Alignment

type Alignment int

type Axis

type Axis int

type OptionFn

type OptionFn func(*config)

func WithAlignment

func WithAlignment(alignment Alignment) OptionFn

func WithAxis

func WithAxis(axis Axis) OptionFn

func WithDrawOp

func WithDrawOp(op draw.Op) OptionFn

Jump to

Keyboard shortcuts

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