imgutil

package module
v0.0.0-...-5dd8b4c Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2015 License: MIT Imports: 5 Imported by: 0

README

Documentation

Overview

Package imgutil provides an easy way to take an image and convert any color in it into another color. This also allows the conversion of a color image into a gray scale image. Supports the image formats image supports such as png and jpeg. This exclusively works with RGBA's from image.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ColorConverter

func ColorConverter(c1 color.Color, c2 color.Color) color.Model

ColorConverter compares a color to another. IF it matches, return the new color.

func ConvertImageColor

func ConvertImageColor(img image.Image, m color.Model) image.Image

ConvertImageColor takes an image and a color model and returns a copy of the image's color with provided replacement color.

func HexToRBGA

func HexToRBGA(hex1 string) (color.Color, error)

HexToRBGA returns a color.Color if it is provided with a hex code in the correct format. https://en.wikipedia.org/wiki/Web_colors

func ResizeImage

func ResizeImage(maxWidth, maxHeight int, img image.Image) image.Image

ResizeImage takes the dimensions of an image and then the image and returns a new image resized to that dimension. If either width or height is set as 0, the aspect ratio will be preserved and the counter part will be used as a determining factor for the size. Uses github.com/nfnt/resize

Types

This section is empty.

Jump to

Keyboard shortcuts

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