public static Bitmap DropShadowIMG(Bitmap img, int RangeX, int RangeY, Color C, float sigma, int range, float Opacity) { Bitmap coloredIMG = ImageConstruct.MatchColorImage(img, C); Bitmap getAlpha = ImageUtil.getARGBA(img).Item4; coloredIMG = ImageMultiFilter.RGBA_replaceChannel(coloredIMG, null, null, null, getAlpha); Bitmap movedIMG = ImageUtil.moveImage(coloredIMG, RangeX, RangeY); Bitmap BluredIMG = BlurImage(movedIMG, sigma, range); //Bitmap intersectIMG = ImageMultiFilter.operationImages(BluredIMG, coloredIMG, Operations.operations["Intersect"]); Bitmap OpacityIMG = opacityFilter(BluredIMG, Opacity); return(OpacityIMG); }
//Colorize Rename, Colorize Using IMG public static Bitmap TintImage(Bitmap img, Color C, float Value) { Bitmap coloredIMG = ImageConstruct.MatchColorImage(img, C); Bitmap greyScale = Grayscale.CommonAlgorithms.RMY.Apply(img); Bitmap getAlpha = ImageUtil.getARGBA(greyScale).Item1; coloredIMG = ImageMultiFilter.RGBA_replaceChannel(coloredIMG, null, null, null, getAlpha); coloredIMG = opacityFilter(coloredIMG, Value); List <Bitmap> imgsToOverlay = new List <Bitmap>(); imgsToOverlay.Add(img); imgsToOverlay.Add(coloredIMG); return(ImageMultiFilter.OverlayImages(imgsToOverlay, 1, 1)); }
public static Bitmap maskImage(Bitmap img, Bitmap mask) { Bitmap greyscale = ImageFilter.FilterImage(mask, Filters.filters["Greyscale"]); //greyscale = FormatUtil.convert(greyscale, PixelFormat.Format32bppArgb); Bitmap invert = ImageFilter.FilterImage(greyscale, Filters.filters["Invert"]); //invert = FormatUtil.convert(invert, PixelFormat.Format32bppArgb); Bitmap toAddMask = ImageUtil.convert(img, PixelFormat.Format32bppArgb); Bitmap withAlpha = ImageMultiFilter.RGBA_replaceChannel(toAddMask, null, null, null, invert); return(withAlpha); //return ImageMultiFilter.OverlayImages(img, withAlpha, 1, 1); }