画像の色を反転する
このクラスは、提供された画像を使用して、負のARGB値を含む反転された画像を返します。これにより、画像が反転して表示されます。
ImageProcessingOperations operations = new ImageProcessingOperations();
// You can chain several operations here such as scale, blur, etc
operations.invertColors();
// Apply the operations to a BufferedImage
BufferedImage modifiedImage = operations.apply(BufferedImage originalImage);
以下のコード例を使用して、画像形式間で処理および変換を行います:
File inputFile = new File("path/to/file");
File outputFile = new File("path/to/output-inverted-file");
JDeli.convert(inputFile, outputFile, operations);
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);
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);
