Exemplo n.º 1
0
        private static Bitmap overlay(Bitmap below, Bitmap over)
        {
            Bitmap invertBelow   = ImageFilter.FilterImage(below, Filters.filters["Invert"]);
            Bitmap myMask        = maskImage(over, invertBelow);
            Bitmap overlayImages = OverlayImages(below, myMask, 1, 1);

            return(operationImages(overlayImages, below, Filters.mode["Merge"]));
        }
Exemplo n.º 2
0
 public static int countColorPixels(Bitmap img, Color C)
 {
     if (Color.Black != C)
     {
         Bitmap rangedIMG = ImageFilter.rangeRGBFilter(img, C, Color.Black, 1, true);
         return(countNonBlackPixels(rangedIMG));
     }
     else
     {
         int totalPixels = img.Width * img.Height;
         return(totalPixels - countNonBlackPixels(img));
     }
 }
Exemplo n.º 3
0
        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);
        }