Ejemplo n.º 1
0
func main() {
	var (
		long  = flag.Bool("long", false, "")
		short = flag.Bool("short", false, "")
		usage = flag.Bool("usage", false, "")
	)

	os.Args = utils.GetOutput(os.Args)
	flag.Parse()

	if *long {
		fmt.Println(
			"  Take equal sized slices from a list of images, and glue them together.\n" +
				"  This can be used to create a not-a-timelapse type effect when used with\n" +
				"  photos of the same subject, taken over the course of a month (for instance).\n" +
				"  \n" +
				"  Unlike other img tools, this takes a list of filenames, for instance,\n" +
				"  \n" +
				"    img timelapse Trees/photo-*.png > output.png",
		)

	} else if *short {
		fmt.Println("glue slices of images together")

	} else if *usage {
		fmt.Println("timeslice <images...>")

	} else {
		run(flag.Args())
	}
}
Ejemplo n.º 2
0
func main() {
	var (
		long  = flag.Bool("long", false, "")
		short = flag.Bool("short", false, "")
		usage = flag.Bool("usage", false, "")

		skip = flag.Int("skip", DEFAULT_SKIP, "")
	)

	os.Args = utils.GetOutput(os.Args)
	flag.Parse()

	if *long {
		fmt.Println(
			"  Databends the image by applying 'The Wordpad Effect' to it. This should\n" +
				"  be used on BMP or TIFF files, it may not play well with images that use\n" +
				"  some form of compression. (If you do want to go down that rabbit hole play\n" +
				"  with the --skip parameter, it will generally need to be larger).\n" +
				"  \n" +
				"    --skip <n>      # Bytes to skip (default: 4)",
		)

	} else if *short {
		fmt.Println("applies 'the wordpad effect' to an image")

	} else if *usage {
		fmt.Println("databend [options]")

	} else {
		run(*skip)
	}
}
Ejemplo n.º 3
0
func main() {
	var (
		long  = flag.Bool("long", false, "")
		short = flag.Bool("short", false, "")
		usage = flag.Bool("usage", false, "")
	)

	os.Args = utils.GetOutput(os.Args)
	flag.Parse()

	if *long {
		fmt.Println(
			"  Applies a simple lomo effect to the image, boosting its saturation and\n" +
				"  composing with a black edged mask.",
		)

	} else if *short {
		fmt.Println("applies a simple lomo effect to the image")

	} else if *usage {
		fmt.Println("lomo [options]")

	} else {
		img, data := utils.ReadStdin()

		// http://the.taoofmac.com/space/blog/2005/08/23/2359
		img = contrast.Adjust(img, 1.2)
		img = channel.Adjust(img, utils.Multiplier(1.2), channel.Saturation)
		img = blend.Multiply(img, maskFor(img))

		utils.WriteStdout(img, data)
	}
}
Ejemplo n.º 4
0
func main() {
	var (
		long  = flag.Bool("long", false, "")
		short = flag.Bool("short", false, "")
		usage = flag.Bool("usage", false, "")

		scale = flag.Float64("scale", DEFAULT_SCALE, "")

		triangle = flag.Bool("triangle", false, "")
		square   = flag.Bool("square", false, "")
	)

	os.Args = utils.GetOutput(os.Args)
	flag.Parse()

	f := crop.Circle
	if *triangle {
		f = crop.Triangle
	} else if *square {
		f = crop.Square
	}

	if *long {
		fmt.Println(
			"  Flips a central circle of the image (size of which can be controlled\n" +
				"  with the --scale flag), and overlays it on the original image.\n" +
				"  \n" +
				"    --scale <n>     # Scale factor for central circle (default: 0.66)\n" +
				"    --triangle      # Use a triangle instead\n" +
				"    --square        # Use a square instead",
		)

	} else if *short {
		fmt.Println("spin a circle")

	} else if *usage {
		fmt.Println("wlsn [options]")

	} else {
		run(*scale, f)
	}
}