Created
September 15, 2019 09:38
-
-
Save ESidenko/bebebc4ed244cf6d9b2d8cd4399606d4 to your computer and use it in GitHub Desktop.
Aspose.Imaging for Java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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