pixelweaver/main.go

35 lines
997 B
Go

package main
import (
"flag"
"image"
_ "image/jpeg"
_ "image/png"
)
func main() {
// command line arguments
flag.StringVar(&ConfigRegister.Method, "blending", "darken", "Blending methods : darken, lighten, fuckyfun")
flag.StringVar(&ConfigRegister.OutputDir, "output", "./", "Output directory")
flag.StringVar(&ConfigRegister.InputDir, "input", "/home/gator/Photos", "Input directory. Where to look the images from")
flag.StringVar(&ConfigRegister.BaseImage, "base-img", "", "Path to the base image to work with. Random image if not set")
flag.Parse()
// get two random images and load them
var img1 image.Image
if ConfigRegister.BaseImage != "" {
img1 = loadImage(ConfigRegister.BaseImage)
} else {
img1 = loadImage(getRandomImage())
}
img2 := loadImage(getRandomImage())
// pool of workers unionizing, ready to blend a new picture using the power of friendship
var pool blendWorkerPool
pool.InitWorkerPool()
// main blending routine
pool.BlendImages(img1, img2)
}