public void BrightnessContrastEffect2 ()
		{
			var src = GetSourceImage ("input.png");

			var effect = new BrightnessContrastEffect (80, 20);
			effect.Render (src);

			Compare (src, "brightnesscontrast2.png");
		}
コード例 #2
0
		/// <summary>
		/// Creates a new effect that will make the image look like a pencil sketch.
		/// </summary>
		/// <param name="pencilSize">Size of the pencil to use. Valid range is 1 - 20.</param>
		/// <param name="colorRange">Range of color to use. Valid range is -20 - 20.</param>
		public PencilSketchEffect (int pencilSize = 2, int colorRange = 0)
		{
			if (pencilSize < 1 || pencilSize > 20)
				throw new ArgumentOutOfRangeException ("pencilSize");
			if (colorRange < -20 || colorRange > 20)
				throw new ArgumentOutOfRangeException ("colorRange");

			this.pencil_size = pencilSize;
			this.color_range = colorRange;

			blur_effect = new GaussianBlurEffect (pencil_size);
			desaturate_op = new DesaturateOp ();
			invert_effect = new InvertColorsEffect ();
			bac_adjustment = new BrightnessContrastEffect (-color_range, -color_range);
			color_dodge_op = new ColorDodgeBlendOp ();
		}
コード例 #3
0
		/// <summary>
		/// Creates a new effect that will add a glowing effect to an image.
		/// </summary>
		/// <param name="radius">Radius used to blur the image (higher is blurrier). Valid range is 1 - 20.</param>
		/// <param name="brightness">Brightness amount to apply.</param>
		/// <param name="contrast">Contrast amount to apply.</param>
		public GlowEffect (int radius = 6, int brightness = 10, int contrast = 10)
		{
			if (radius < 1 || radius > 20)
				throw new ArgumentOutOfRangeException ("radius");
			if (brightness < -100 || brightness > 100)
				throw new ArgumentOutOfRangeException ("brightness");
			if (contrast < -100 || contrast > 100)
				throw new ArgumentOutOfRangeException ("contrast");

			this.radius = radius;
			this.brightness = brightness;
			this.contrast = contrast;

			blur_effect = new GaussianBlurEffect (radius);
			contrast_effect = new BrightnessContrastEffect (brightness, contrast);
			screen_op = new ScreenBlendOp ();
		}
コード例 #4
0
		/// <summary>
		/// Creates a new effect that will soften an image.
		/// </summary>
		/// <param name="softness">How much to soften the image. Valid range is 0 - 10.</param>
		/// <param name="lighting">Amount of lighting to apply. Valid range is -20 - 20.</param>
		/// <param name="warmth">Amount of warmth to apply. Valid range is 0 - 20.</param>
		public SoftenPortraitEffect (int softness = 5, int lighting = 0, int warmth = 10)
		{
			if (softness < 0 || softness > 10)
				throw new ArgumentOutOfRangeException ("softness");
			if (lighting < -20 || lighting > 20)
				throw new ArgumentOutOfRangeException ("lighting");
			if (warmth < 0 || warmth > 20)
				throw new ArgumentOutOfRangeException ("warmth");

			this.softness = softness;
			this.lighting = lighting;
			this.warmth = warmth;

			blur_effect = new GaussianBlurEffect (2);
			bac_adjustment = new BrightnessContrastEffect (0, 0);
			desaturate_op = new DesaturateOp ();
			overlay_op = new OverlayBlendOp ();
		}