imagetools

package
v0.0.0-...-ed7710a Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalcAverageGrayLevel

func CalcAverageGrayLevel(img *image.Gray) uint8

CalcAverageGrayLevel iterates over all pixel in the image and calcuates the average gray level

func CalcContrastAndBrightness

func CalcContrastAndBrightness(rangeBlock *image.Gray, domainBlock *image.Gray) (float64, float64)

CalcContrastAndBrightness using this function: http://einstein.informatik.uni-oldenburg.de/rechnernetze/fraktal.htm

func CalcSquarredEuclideanDistance

func CalcSquarredEuclideanDistance(rangeBlock *image.Gray, domainBlock *image.Gray) float64

CalcSquarredEuclideanDistance calculates the euclidean distance between a range and a domain block it returns the euclidean distance, and the parameters s and g

func CreateFractalFromImage

func CreateFractalFromImage(img *image.Gray, numberOfIterations int, transformations []Transformation) *image.Gray

CreateFractalFromImage is a Function to create fractal from ISF

func Decompress

func Decompress(encoding [][]EncodingParams, iterations int) *image.Gray

Decompress sad

func DivideImage

func DivideImage(img *image.Gray, pixelSize int) [][]*image.Gray

DivideImage slices an image into pixelSize*pixelSize smaller images and returning them in an array

func FindBestMatchingDomains

func FindBestMatchingDomains(ranges [][]*image.Gray, domains [][]*image.Gray) [][]EncodingParams

FindBestMatchingDomains finds the best matching domain

func GrayTransformImage

func GrayTransformImage(img *image.Gray, s float64, g float64) *image.Gray

GrayTransformImage applies contrast and brightness transformation to image

func ImageToBW

func ImageToBW(img *image.Image) *image.Gray

ImageToBW takes an image.Image pointer and return it as image.Gray where only pixelvalues of 0 and 255 are allowed (only black and white)

func ImageToGray

func ImageToGray(img *image.Image) *image.Gray

ImageToGray takes an image.Image pointer and returns it as image.Gray

func LoadImageFromFile

func LoadImageFromFile(filename string) *image.Image

LoadImageFromFile returns a pointer to an image.Image by providing a filename

func SaveImageToFile

func SaveImageToFile(img *image.Gray, filename string)

SaveImageToFile saves a i*mg.Gray pointer to the specified filename with the *_edited* filepostix

func ScaleImage

func ScaleImage(img *image.Gray, scalingFactor float64) *image.Gray

ScaleImage scales a given image pointer by *scalingFactor* and returns the result Use only scalingFactor <= 1 and > 0!

func ScaleImage2

func ScaleImage2(img *image.Gray, scalingFactor float64) *image.Gray

ScaleImage2 scales via an ifs is ok for minimal scaling, but doesnt do well on more extreme scalings

func TransformImage

func TransformImage(img *image.Gray, transformationType uint8) *image.Gray

TransformImage applies one of 8 transformations to the image 0 - Identity 1 - Rotation by 90° 2 - Rotation by 180° 3 - Rotation by 270° 4 - Flip at y axis 5 - Flip at x axis 6 - Mirror at y=x 7 - Mirror at y=-x

Types

type EncodingParams

type EncodingParams struct {
	S  float64
	G  float64
	Dx int
	Dy int
}

EncodingParams saves the encoding parameters for every range which shall be recreated

type Transformation

type Transformation struct {
	A, B, C, D, E, F float64
}

Transformation is a struct to describe a ISF transformation

Jump to

Keyboard shortcuts

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