Exemplo 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(
			"  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)
	}
}
Exemplo n.º 2
0
Arquivo: contrast.go Projeto: hawx/img
func runContrast(cmd *hadfield.Command, args []string) {
	i, data := utils.ReadStdin()

	if contrastSigmoidal {
		i = contrast.Sigmoidal(i, contrastFactor, contrastMidpoint)
	} else if contrastLinear {
		i = contrast.Linear(i, contrastFactor)
	} else {
		i = contrast.Adjust(i, contrastFactor)
	}

	utils.WriteStdout(i, data)
}