glitch

package module
v0.0.0-...-06b2670 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2018 License: MIT Imports: 11 Imported by: 1

README

glitch

GoDoc

Glitch Images with Go (Golang)

Functions

NewGlitch
gl, err := glitch.NewGlitch("./example.jpg")
if err != nil {
  panic(err)
}

./example.jpg

example


Seed

Glitch is based off of the rand package. Everything parameter is a random value. To seed the random number generator use Seed.

gl.Seed(10)

Copy

Copies Input directly to Output with no manipulation. This is a good function to start with

gl.Copy()

copy


TransposeInput
gl.TransposeInput()

transposeinput


VerticalTransposeInput

VerticalTransposeInput will take random vertical slices of the input, shift them and write them to the output.

gl.VerticalTransposeInput()

verticaltransposeinput


CompressionGhost
gl.Copy()
gl.CompressionGhost()

compressionghost


GhostStreach
gl.Copy()
gl.GhostStreach()

ghoststreach


HalfLifeLeft
gl.Copy()
gl.HalfLifeLeft()

halflifeleft


HalfLifeRight
gl.Copy()
gl.HalfLifeRight()

halfliferight


ChannelShiftLeft
gl.Copy()
gl.ChannelShiftLeft()

channelshiftleft


ChannelShiftRight
gl.Copy()
gl.ChannelShiftRight()

channelshiftright


BlueBoost
gl.Copy()
gl.BlueBoost()

blueboost


GreenBoost
gl.Copy()
gl.GreenBoost()

greenboost


RedBoost
gl.Copy()
gl.RedBoost()

redboost


PrismBurst
gl.Copy()
gl.PrismBurst()

prismburst


Noise
gl.Copy()
gl.Noise()

noise

Documentation

Index

Constants

View Source
const MAXC = 1<<16 - 1

MAXC is the maxium value returned by RGBA() will have

Variables

This section is empty.

Functions

This section is empty.

Types

type Glitch

type Glitch struct {
	Input  image.Image
	Output draw.Image
	Bounds image.Rectangle
	// contains filtered or unexported fields
}

Glitch represents the two images needed to produce a glitch

func NewGlitch

func NewGlitch(filename string) (*Glitch, error)

NewGlitch creates a new glich from a filename

func (*Glitch) BlueBoost

func (gl *Glitch) BlueBoost()

BlueBoost boost the Blue color of the image

func (*Glitch) ChannelShiftLeft

func (gl *Glitch) ChannelShiftLeft()

ChannelShiftLeft shift all channels left on RGB

func (*Glitch) ChannelShiftRight

func (gl *Glitch) ChannelShiftRight()

ChannelShiftRight shift all channels right on RGB

func (*Glitch) CompressionGhost

func (gl *Glitch) CompressionGhost()

CompressionGhost will compress the image at the lowest value and ghost over it

func (*Glitch) Copy

func (gl *Glitch) Copy()

Copy just takes the image and copies to the output

func (*Glitch) GhostStreach

func (gl *Glitch) GhostStreach()

GhostStreach takes the Output and streches across RGB Alpha is random

func (*Glitch) GreenBoost

func (gl *Glitch) GreenBoost()

GreenBoost boost the Green color of the image

func (*Glitch) HalfLifeLeft

func (gl *Glitch) HalfLifeLeft(strikes, length int)

HalfLifeLeft takes points and drags color Left with a half life.

func (*Glitch) HalfLifeRight

func (gl *Glitch) HalfLifeRight(strikes, length int)

HalfLifeRight takes points and drags color right with a half life. Number of randomply placed streaks

func (*Glitch) Noise

func (gl *Glitch) Noise(r, g, b, a float64)

Noise add random values to the image

func (*Glitch) PrismBurst

func (gl *Glitch) PrismBurst()

PrismBurst spreads channesl around the original image

func (*Glitch) RedBoost

func (gl *Glitch) RedBoost()

RedBoost boost the red color of the image

func (*Glitch) Seed

func (gl *Glitch) Seed(seed int64)

Seed sets the rand Seed

func (*Glitch) SetBounds

func (gl *Glitch) SetBounds(newBounds image.Rectangle)

SetBounds sets the bounds used by the glitch functions

func (*Glitch) TransposeInput

func (gl *Glitch) TransposeInput(height, width int, transpose bool)

TransposeInput moves slices of the image. transpose if true will start with transposing the image

func (*Glitch) VerticalTransposeInput

func (gl *Glitch) VerticalTransposeInput(width, height int, transpose bool)

VerticalTransposeInput moves slices of the image.

func (*Glitch) Write

func (gl *Glitch) Write(out io.Writer) error

func (*Glitch) ZoomColor

func (gl *Glitch) ZoomColor(clrRaw color.Color, maxDistance float64, r int, maxT float64)

ZoomColor expands colors close to color

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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