Skip to content

Instantly share code, notes, and snippets.

@ESidenko
Created September 15, 2019 09:38
Show Gist options
  • Save ESidenko/bebebc4ed244cf6d9b2d8cd4399606d4 to your computer and use it in GitHub Desktop.
Save ESidenko/bebebc4ed244cf6d9b2d8cd4399606d4 to your computer and use it in GitHub Desktop.
Aspose.Imaging for Java
import com.aspose.imaging.Color;
import com.aspose.imaging.Image;
import com.aspose.imaging.RasterImage;
import com.aspose.imaging.examples.Utils;
public class Deskew
{
public static void main(String... args)
{
// The path to the documents directory.
String dataDir = "ModifyingImages/";
String fileName = "skewed.png";
String output = "skewed.out.png";
String inputFileName = dataDir + fileName;
// Get rid of the skewed scan with default parameters
try (RasterImage image = (RasterImage) Image.load(inputFileName))
{
image.normalizeAngle(false /*do not resize*/, Color.getLightGray() /*background color*/);
image.save(dataDir + output);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment