pixelate

package
v0.0.0-...-6cd0f2a Latest Latest
Warning

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

Go to latest
Published: May 1, 2015 License: MIT Imports: 7 Imported by: 1

Documentation

Overview

Package pixelate implements various functions for pixelating images.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AliasedPxl

func AliasedPxl(img image.Image, size utils.Dimension, triangle Triangle, style Style) image.Image

AliasedPxl does the same as Pxl, but does not smooth diagonal edges of the triangles. It is faster, but will produce bad results if size is non-square.

func Hxl

func Hxl(img image.Image, width int) image.Image

Hxl pixelates the Image into equilateral triangles with the width given. These are arranged into hexagonal shapes.

func Pixelate

func Pixelate(img image.Image, size utils.Dimension, style Style) image.Image

Pixelate takes an Image and pixelates it into rectangles with the dimensions given. The colour values in each region are averaged to produce the resulting colours.

func Pxl

func Pxl(img image.Image, size utils.Dimension, triangle Triangle, style Style) image.Image

Pxl pixelates an Image into right-angled triangles with the dimensions given. The triangle direction can be determined by passing the required value as triangle; either BOTH, LEFT or RIGHT.

func Vxl

func Vxl(img image.Image, height int, flip bool, top, left, right float64) image.Image

Vxl pixelates the Image into isometric cubes. It averages the colours and naïvely darkens and lightens the colours to mimic highlight and shade.

Types

type Style

type Style int
const (
	CROPPED Style = iota
	FITTED
)

type Triangle

type Triangle int

Triangle types for Pxl

const (
	// Decide base on closeness of colours in each quadrant
	BOTH Triangle = iota

	// Create only left triangles
	LEFT

	// Create only right triangles
	RIGHT
)

Jump to

Keyboard shortcuts

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