imageutils

package
v0.0.0-...-28fdd3c Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2016 License: MIT Imports: 15 Imported by: 1

Documentation

Index

Constants

View Source
const THUMBNAIL_WIDTH = 128

Variables

This section is empty.

Functions

func CreateImageMosaic

func CreateImageMosaic(inputImagePath string, outputImagePath string, outputImageWidth int, tileSize int, mosaicType string) error

func CreateThumbnails

func CreateThumbnails(thumbnailImagesDir string) error

create a thumbnail for each image in db

func DrawGrid

func DrawGrid(sourceImage image.Image, tileWidth int, tileHeight int) image.Image

Create a new image with grid lines drawn over it

func FindAverageColourInTile

func FindAverageColourInTile(sourceImage image.Image, targetRect image.Rectangle) color.NRGBA

func FindColourInTile

func FindColourInTile(sourceImage image.Image, targetRect image.Rectangle) color.RGBA

func FindProminentColour

func FindProminentColour(myImage image.Image) color.RGBA

func LoadImage

func LoadImage(imagePath string) (image.Image, string, error)

func ResizeImage

func ResizeImage(originalImage image.Image, newWidth int, newHeight int) image.Image

func SaveImage

func SaveImage(imagePath string, imageToSave *image.Image) error

Types

type Analyzer

type Analyzer interface {
	// function will analyze the pixels in the targetRect to find the most prominent colour
	FindColourInTile(sourceImage image.RGBA, targetRect image.Rectangle) color.RGBA
}

type ThumbnailRequest

type ThumbnailRequest struct {
	InputImage    models.ImageDetail
	Width         int
	ThumbnailsDir string
}

thumbnailing

type ThumbnailResponse

type ThumbnailResponse struct {
	ThumbnailImage models.ImageDetail
}

Jump to

Keyboard shortcuts

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