using ImageMagick;
using Ocr.Tesseract.Extensions;

const float factor = 4f;
const string downscaled = "downscaled.png";

using (var image = new MagickImage(args.Single()))
{
    image.ResizeImage(0.8f, FilterType.Catrom, PixelInterpolateMethod.Undefined);
    image.Write(downscaled);
}

using (var image = new MagickImage(downscaled))
{
    image.ResizeImage(factor, FilterType.Lanczos, PixelInterpolateMethod.Catrom);
    image.Write("Lanczos.png");
}

using (var image = new MagickImage(downscaled))
{
    image.ResizeImage(factor, FilterType.Point, PixelInterpolateMethod.Integer);
    image.Write("Nearest.png");
}

using (var image = new MagickImage(downscaled))
{
    image.ResizeImage(factor, FilterType.Hermite, PixelInterpolateMethod.Mesh);
    image.Write("Hermite.png");
}