示例#1
0
 /// <summary>
 /// Emboss function
 /// </summary>
 /// <param name="Image">Image to manipulate</param>
 /// <returns>A bitmap image</returns>
 public static Bitmap Emboss(Bitmap Image)
 {
     Filter TempFilter = new Filter(3, 3);
     TempFilter.MyFilter[0, 0] = -2;
     TempFilter.MyFilter[0, 1] = -1;
     TempFilter.MyFilter[1, 0] = -1;
     TempFilter.MyFilter[1, 1] = 1;
     TempFilter.MyFilter[2, 1] = 1;
     TempFilter.MyFilter[1, 2] = 1;
     TempFilter.MyFilter[2, 2] = 2;
     TempFilter.MyFilter[0, 2] = 0;
     TempFilter.MyFilter[2, 0] = 0;
     return TempFilter.ApplyFilter(Image);
 }
示例#2
0
 /// <summary>
 /// Does smoothing using a box blur
 /// </summary>
 /// <param name="Image">Image to manipulate</param>
 /// <param name="Size">Size of the aperture</param>
 public static Bitmap BoxBlur(Bitmap Image, int Size)
 {
     Filter TempFilter = new Filter(Size, Size);
     for (int x = 0; x < Size; ++x)
     {
         for (int y = 0; y < Size; ++y)
         {
             TempFilter.MyFilter[x, y] = 1;
         }
     }
     return TempFilter.ApplyFilter(Image);
 }
示例#3
0
 /// <summary>
 /// Sharpens an image
 /// </summary>
 /// <param name="Image">Image to manipulate</param>
 /// <returns>A bitmap image</returns>
 public static Bitmap Sharpen(Bitmap Image)
 {
     Filter TempFilter = new Filter(3,3);
     TempFilter.MyFilter[0, 0] = -1;
     TempFilter.MyFilter[0, 2] = -1;
     TempFilter.MyFilter[2, 0] = -1;
     TempFilter.MyFilter[2, 2] = -1;
     TempFilter.MyFilter[0, 1] = -2;
     TempFilter.MyFilter[1, 0] = -2;
     TempFilter.MyFilter[2, 1] = -2;
     TempFilter.MyFilter[1, 2] = -2;
     TempFilter.MyFilter[1, 1] = 16;
     return TempFilter.ApplyFilter(Image);
 }