using System.Drawing;
using System.Drawing.Imaging;

namespace ZionGraphics.Filtering
{
    class InterativeThreshold : IFilter
    {
        public override Bitmap Apply(Bitmap bitmap)
        {
            PixelFormat originalFormat = bitmap.PixelFormat;
            bitmap = SetPixelFormat(bitmap, PixelFormat.Format8bppIndexed);
            AForge.Imaging.Filters.Threshold filter = new AForge.Imaging.Filters.Threshold(Intensity);
            return filter.Apply(bitmap);
        }
    }
}
