protected override UIImage Transform(UIImage source) { using (var colorSpace = CGColorSpace.CreateDeviceGray()) { return(ColorSpaceTransformation.ToColorSpace(source, colorSpace)); } }
protected override UIImage Transform(UIImage sourceBitmap, string path, Work.ImageSource source, bool isPlaceholder, string key) { using (var colorSpace = CGColorSpace.CreateDeviceGray()) { return(ColorSpaceTransformation.ToColorSpace(sourceBitmap, colorSpace)); } }
public static Bitmap ToGrayscale(Bitmap source) { using (var colorMatrix = new ColorMatrix()) { colorMatrix.SetSaturation(0f); return(ColorSpaceTransformation.ToColorSpace(source, colorMatrix)); } }
public static UIImage ToSepia(UIImage source) { using (var filter = new CISepiaTone() { Intensity = 0.8f }) { return(ColorSpaceTransformation.ToFilter(source, filter)); } }
public static Bitmap ToSepia(Bitmap source) { using (ColorMatrix saturation = new ColorMatrix()) using (ColorMatrix rgbFilter = new ColorMatrix()) { saturation.SetSaturation(0f); rgbFilter.SetScale(1.0f, 0.95f, 0.82f, 1.0f); saturation.SetConcat(rgbFilter, saturation); return(ColorSpaceTransformation.ToColorSpace(source, saturation)); } }