imagecolor

package module
v0.0.0-...-e9edd25 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2019 License: MIT Imports: 9 Imported by: 1

README

imageColor

License Godoc ReportCard Coverage Status Build

Work in Progress

Used for calculating prominent colors from an image.Image

Example

see example/main.go

LICENSE

Copyright (c) 2019, Evan Oberholster & Contributors

BSD-2-Clause License

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalcCompositionBoxes

func CalcCompositionBoxes(imgR image.Image)

CalcCompositionBoxes - Experimental

Types

type Box

type Box struct {
	Rect    image.Rectangle
	Focused float64
	Score   float64
	MeanL   float64
	StdL    float64
	SkewL   float64
	// contains filtered or unexported fields
}

Box - x1, y1, x2, y2 int

func NewBox

func NewBox(x1, y1, x2, y2 int) *Box

NewBox - Create a new Box

func ThirdsBoxes

func ThirdsBoxes(width, height int) (boxes []*Box)

ThirdsBoxes - Create boxes for thirds composition. 4 Boxes with centers at 1/3 and 2/3 horizontal and vertical.

func (*Box) Distance

func (b *Box) Distance(b2 *Box) float64

Distance -

func (*Box) FocusScore

func (b *Box) FocusScore()

FocusScore -

func (*Box) FocusedPixels

func (b *Box) FocusedPixels(m image.Image)

FocusedPixels - Create ImageColors array from an image

func (Box) ImageEdges

func (b Box) ImageEdges(img image.Image, radius float64) image.Image

ImageEdges -

func (*Box) MeanStd

func (b *Box) MeanStd()

MeanStd - Get Mean and StandardVariation for values

func (*Box) Skew

func (b *Box) Skew()

Skew - Get the skew of the normal distribution curve for values

type ColorHSL

type ColorHSL [3]float64

ColorHSL - Color defined in the HSL colorspace (Hue, Saturation, Value)

func NewColorHSL

func NewColorHSL(cf colorful.Color) ColorHSL

NewColorHSL - Create ColorHSL from colorful.Color

func (ColorHSL) Distance

func (c ColorHSL) Distance(c2 ColorHSL) float64

Distance is the equludian distance between 2 Colors in the HSL colorspace (Hue, Saturation, Lightness)

func (ColorHSL) DistanceHue

func (c ColorHSL) DistanceHue(c2 ColorHSL) float64

DistanceHue is the distance between 2 Hues on the HSL colorspace (Hue, Saturation, Lightness)

type ImageColors

type ImageColors [][]ColorHSL

ImageColors - Array of ColorHSL

func GetImageColors

func GetImageColors(m image.Image) *ImageColors

GetImageColors - Create ImageColors array from an image

func (*ImageColors) AddColor

func (ic *ImageColors) AddColor(x, y int, cf colorful.Color)

AddColor - Add Color to ColorHSL in ImageColors with Coords x and y

func (*ImageColors) AddHSL

func (ic *ImageColors) AddHSL(x, y int, hsl ColorHSL)

AddHSL - Add ColorHSL to Coordinates x and y of ImageColors

func (ImageColors) MeanHue

func (ic ImageColors) MeanHue() (float64, float64)

MeanHue -

func (ImageColors) MeanLightness

func (ic ImageColors) MeanLightness() (float64, float64)

MeanLightness -

func (ImageColors) MeanSaturation

func (ic ImageColors) MeanSaturation() (float64, float64)

MeanSaturation -

func (*ImageColors) ProminentColors

func (ic *ImageColors) ProminentColors(limit float64) ProminentColors

ProminentColors - Return Prominent Colors (limit) percentage limit of promiment colors to return

func (ImageColors) QuantileLightness

func (ic ImageColors) QuantileLightness() float64

QuantileLightness -

func (ImageColors) QuantileSaturation

func (ic ImageColors) QuantileSaturation() float64

QuantileSaturation -

type MaterialColor

type MaterialColor uint8

MaterialColor -

func (MaterialColor) String

func (mc MaterialColor) String() string

String - format MaterialColor as a String

type ProminentColor

type ProminentColor struct {
	Color MaterialColor
	W     float64
}

ProminentColor - Prominent Color Color and Weight

func (ProminentColor) String

func (p ProminentColor) String() string

type ProminentColors

type ProminentColors struct {
	Colors       []ProminentColor
	Hue          [2]float64
	Saturation   [2]float64
	Lightness    [2]float64
	Colorfulness float64
	Qlightness   float64
}

ProminentColors - Slice of ProminentColor

func (ProminentColors) Len

func (pc ProminentColors) Len() int

func (ProminentColors) Less

func (pc ProminentColors) Less(i, j int) bool

func (ProminentColors) Swap

func (pc ProminentColors) Swap(i, j int)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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