public void InvertColorsEffect1 () { var src = GetSourceImage ("input.png"); var effect = new InvertColorsEffect (); effect.Render (src); Compare (src, "invertcolors.png"); }
/// <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 (); }
/// <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(); }