Increase the brightness and contrast of the image after capturing from the camera in android

I am making one application in which I capture a camera image and make a PDF from it.

But the image quality is poor. Therefore, I want to set the brightness and contrast of the image .....

1) Is there a way to increase the brightness and contrast of the image after capturing from the camera in android?

2) After capturing the image, when I cropped it and then displayed it in pdf format, the bottom of the image was cut out.

To use pdf in this application, I used iText.jar (5.0.6).

Please, help.

Greetings

-Bhavik

+4
source share
1 answer

To get the full image displayed in pdf format, try applying 'scaleAbsolute' to the image.

File newFile = new File(pdfPath); newFile.createNewFile(); FileOutputStream pdfFile = new FileOutputStream(newFile); Document document = new Document(); PdfWriter.getInstance(document, pdfFile); ocument.open(); Rectangle rectangle = document.getPageSize(); Image image = Image.getInstance(imagePath); image.scaleAbsolute((rectangle.getWidth() - 75.0f), (rectangle.getHeight() - 75.0f)); 
+1
source

Source: https://habr.com/ru/post/1347848/


All Articles