colorbot

package module
v0.0.0-...-92869c5 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2015 License: Apache-2.0 Imports: 6 Imported by: 1

README

colorbot

Build Status

A Go library which determines the dominant colors in an image.

To install:

  1. Have Go 1.4+ installed.
  2. Use godep.
  3. Run go get -d github.com/codahale/colorbot.
  4. Run cd $GOPATH/github.com/codahale/colorbot && godep go install ./...
  5. Run colorbot -h.

For documentation, check godoc.

Documentation

Overview

Package colorbot provides image analysis routines to determine the dominant colors in images.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrImageTooLarge is returned when the image is too large to be processed.
	ErrImageTooLarge = errors.New("image is too large")
)

Functions

func DecodeImage

func DecodeImage(r io.Reader, maxBytes, maxPixels int64) (image.Image, error)

DecodeImage decodes the given reader as either a GIF, JPEG, or PNG image.

If the image is larger than maxBytes or maxPixels, it returns ErrImageTooLarge.

func DominantColors

func DominantColors(img image.Image, n int) color.Palette

DominantColors returns the N most dominant colors in the given image.

This uses the median cut quantization algorithm.

Types

This section is empty.

Directories

Path Synopsis
Godeps
_workspace/src/github.com/soniakeys/quant
Quant provides an interface for image color quantizers.
Quant provides an interface for image color quantizers.
_workspace/src/github.com/soniakeys/quant/mean
Mean is a simple color quantizer.
Mean is a simple color quantizer.
_workspace/src/github.com/soniakeys/quant/median
Median implements basic median cut color quantization.
Median implements basic median cut color quantization.
cmd
colorbot
Command colorbot analyzes a given image and prints out a list of the N most dominant colors in the image.
Command colorbot analyzes a given image and prints out a list of the N most dominant colors in the image.

Jump to

Keyboard shortcuts

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