1
0

base image + skeleton for loading config file

This commit is contained in:
2022-05-01 09:36:52 +02:00
parent 1b9d943ab3
commit e889f5d515
2 changed files with 33 additions and 3 deletions

10
main.go
View File

@ -2,6 +2,7 @@ package main
import (
"flag"
"image"
_ "image/jpeg"
_ "image/png"
)
@ -10,10 +11,17 @@ 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.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
img1 := loadImage(getRandomImage())
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