Example #1
0
// Enhances the intensity differences between the lighter and darker elements of the image. Set sharpen to a value other than 0 to increase the image contrast otherwise the contrast is reduced.
func (self *Canvas) Contrast(sharpen bool) error {
	status := C.MagickContrastImage(self.wand, magickBoolean(sharpen))

	if status == C.MagickFalse {
		return fmt.Errorf("Could not contrast image: %s", self.Error())
	}

	return nil
}
Example #2
0
// enhances the intensity differences between the lighter and darker elements of the image. Set sharpen to a value other than 0 to increase the image contrast otherwise the contrast is reduced.
func (self Canvas) Contrast(sharpen bool) error {
	var incr C.MagickBooleanType
	incr = C.MagickFalse
	if sharpen {
		incr = C.MagickTrue
	}
	success := C.MagickContrastImage(self.wand, incr)
	if success == C.MagickFalse {
		return fmt.Errorf("Could not contrast image: %s", self.Error())
	}
	return nil
}