Link
Skip to main content

Adjust image exposure

What does it do?

The Exposure operation will make the image lighter and expose additional image details. Value is any real positive number with larger numbers increasing brightness.

Adjust the exposure of a BufferedImage in Java

ImageProcessingOperations operations = new ImageProcessingOperations();

// You can chain several operations here such as scale, blur, etc
operations.exposure(20); 
        
// Apply the operations to a BufferedImage
BufferedImage modifiedImage = operations.apply(BufferedImage originalImage);

View Javadoc for the exposure operation

Additional Code Examples

Process and convert between image formats using the following code examples:

Using File

File inputFile = new File("path/to/file");
File outputFile = new File("path/to/output-exposureAdjusted-file");
JDeli.convert(inputFile, outputFile, operations);

Using InputStream and OutputSteam

final InputStream inputStream = new FileInputStream(inputFile);
final OutputStream outputStream = new FileOutputStream(outputFile);
final String outputFormat = "format"; // format of the output file eg. png, jpeg,...;
JDeli.convert(inputStream, outputStream, outputFormat, operations);

Using byte[]

byte[] inputData = Files.readAllBytes(Paths.get("/path/to/file"));
final String outputFormat = "format"; // format of the output file eg. png, jpeg,...;
byte[] outputData = JDeli.convert(inputData, outputFormat, operations);

Why JDeli?

  • Support image formats such as AVIF, HEIC and JPEG XL (AVIF soon) that are not supported in Java.
  • Process images up to 3x faster than ImageIO and alternative Java image libraries.
  • Prevent JVM crashes caused by native code in other image libraries such as ImageIO.
  • Handle JPEG, PNG, TIFF image file formats fully in Java.
  • Keep your Image files secure as JDeli makes no calls to any external system or third party library.

Start Your Free Trial