// We set a better contrast and better brightness public Bitmap ApplyFilter(Bitmap image) { Bitmap copy = (Bitmap)image.Clone(); SetContrast(20, copy); BrightnessFilter filter = new BrightnessFilter(); Bitmap returningImage = filter.ApplyFilter(copy, 30); return(returningImage); }
public System.Drawing.Bitmap ApplyFilter(Image image, EFilter filtro, Color color = default(Color), int brightness = 0, int noise = 60, RotateFlipType RFT = RotateFlipType.RotateNoneFlipNone) { switch (filtro) { case EFilter.AutomaticAdjustmentFilter: AutomaticAdjustmentFilter AAF = new AutomaticAdjustmentFilter(); return(AAF.ApplyFilter(image.BitmapImage)); case EFilter.BlackNWhiteFilter: BlackNWhiteFilter BNWF = new BlackNWhiteFilter(); return(BNWF.ApplyFilter(image.BitmapImage)); case EFilter.BrightnessFilter: BrightnessFilter BF = new BrightnessFilter(); return(BF.ApplyFilter(image.BitmapImage, brightness)); case EFilter.ColorFilter: ColorFilter CF = new ColorFilter(); return(CF.ApplyFilter(image.BitmapImage, color)); case EFilter.InvertFilter: InvertFilter IF = new InvertFilter(); return(IF.ApplyFilter(image.BitmapImage)); case EFilter.MirrorFilter: MirrorFilter MF = new MirrorFilter(); return(MF.ApplyFilter(image.BitmapImage)); case EFilter.OldFilmFilter: OldFilmFilter OFF = new OldFilmFilter(); return(OFF.ApplyFilter(image.BitmapImage, noise)); case EFilter.RotateFlipFilter: RotateFlipFilter RFF = new RotateFlipFilter(); return(RFF.RotateFlip(image.BitmapImage, RFT)); case EFilter.SepiaFilter: SepiaFilter SF = new SepiaFilter(); return(SF.ApplyFilter(image.BitmapImage)); case EFilter.WindowsFilter: WindowsFilter WF = new WindowsFilter(); return(WF.ApplyFilter(image.BitmapImage)); } return(image.BitmapImage); }