Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Last active August 11, 2022 16:34
Show Gist options
  • Save aspose-com-gists/1bd8410d9f9b1b69a2becdb54d136735 to your computer and use it in GitHub Desktop.
Save aspose-com-gists/1bd8410d9f9b1b69a2becdb54d136735 to your computer and use it in GitHub Desktop.
using Aspose.Imaging;
using System.IO;
string templatesFolder = @"c:\Users\USER\Downloads\templates\";
string dataDir = templatesFolder;
// Get rid of the skewed scan with default parameters
using (RasterImage image = (RasterImage)Image.Load(dataDir + "template.jpg"))
{
image.NormalizeAngle(false /*do not resize*/, Color.LightGray /*background color*/);
image.Save(Path.Combine(dataDir, "result.jpg"));
}
File.Delete(dataDir + "result.jpg");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment