kluge

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

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

Go to latest
Published: Feb 27, 2021 License: MIT Imports: 4 Imported by: 0

README

go-kluge

This repository is an adaptation from christiankastner/klugen-portrait, which is a implementation of Espen Kluge Alternatives. Basically the algorithm generate random points on image and connect them with lines based on a minimum distance (provided by user, in pixels).

Installing

Install the command with go:

go install github.com/WendelHime/go-kluge/cmd/kluge

Usage

kluge -h
Usage of kluge: kluge -filepath images/ada_in_blank.png -threshold 0.35 -minDist 50 -output images/ada_output.png
  -filepath string
        the filepath for a segmented image (default "/home/wotan/Pictures/ada_in_blank.png")
  -minDist float
        minimum distance of points (default 70)
  -output string
        output filepath (default "./output.png")
  -threshold float
        a threshold for random creation of points, the value must be in the range 0, 100. (default 0.25)

Examples

Command:

kluge -filepath images/ada_in_blank.png -threshold 0.35 -minDist 50 -output images/ada_output.png
original image output

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildLines

func BuildLines(w, h int, points []*Point, minDist float64) *gg.Context

BuildLines create a new image and draw lines between points with a minimum distance

Types

type Point

type Point struct {
	X int
	Y int
	R uint8
	G uint8
	B uint8
}

Point represents a point, speciying the coordinate and the RGB color at the same position

func GeneratePoints

func GeneratePoints(img image.Image, threshold float64) []*Point

GeneratePoints run through the image creating random points

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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