public static void DoSomething(string path) { var image = Image.Load(path); var fromRange = new ColorRange() { From = new Rgba32(250, 255, 255), To = new Rgba32(255, 255, 255), }; var toRange = new ColorRange() { From = new Rgba32(72, 110, 146), To = new Rgba32(152, 187, 214), }; var filter = new ColorSubstitutionFilter(image, ColorSubstitutionType.SubstitytionByLinearRange, fromRange, toRange); AdaptiveWorkflow workflow = new AdaptiveWorkflow(); image = workflow.AddFilter(filter); using (FileStream fs = new FileStream(@"C:\Users\r_bon\Pictures\Camera Roll\" + Guid.NewGuid() + ".png", FileMode.OpenOrCreate)) { image.SaveAsPng(fs); } }
public static void DoSomething(string path) { var image = Image.Load(path); var radiusByWidth = image.Width / 2; var radiusByHeigth = image.Height / 2; var radius = 0; if (radiusByHeigth > radiusByWidth) { radius = radiusByWidth; } if (radiusByHeigth <= radiusByWidth) { radius = radiusByHeigth; } // Here you can select only one shader type - ImageFrameType.Circle var filter = new ColoredFrameFilter(image, ImageFrameType.Circle, new Rgba32(255, 255, 255), radius); AdaptiveWorkflow workflow = new AdaptiveWorkflow(); image = workflow.AddFilter(filter); using (FileStream fs = new FileStream(@"C:\Users\r_bon\Pictures\Camera Roll\" + Guid.NewGuid() + ".png", FileMode.OpenOrCreate)) { image.SaveAsPng(fs); } }
public static void DoSomething(string path) { var image = Image.Load(path); // Here you can select any pixel shader type in ColorInversionPixelShaderType enum var filter = new NegativeFilter(image, ColorInversionPixelShaderType.FullInversionByBlue); AdaptiveWorkflow workflow = new AdaptiveWorkflow(); image = workflow.AddFilter(filter); using (FileStream fs = new FileStream(@"C:\Users\r_bon\Pictures\Camera Roll\" + Guid.NewGuid() + ".png", FileMode.OpenOrCreate)) { image.SaveAsPng(fs); } }