Skip to main content
Interwork Corporation
IDR Solutions Product Support Portal
モードの切替 ダーク/ライト/自動 モードの切替 ダーク/ライト/自動 モードの切替 ダーク/ライト/自動

画像をSuperscale2xで拡大する

機能について

SuperScale2x操作を使用すると、指定された画像を2倍にスケールアップし、新しい拡大画像を返すことができます。この処理には畳み込みニューラルネットワークが使用されます。

JavaでBufferedImageを2倍に拡大する

ImageProcessingOperations operations = new ImageProcessingOperations();

// ここでscale、blurなど複数の操作をチェーンできます
operations.superScale2x(); 
        
// BufferedImageに操作を適用します
BufferedImage modifiedImage = operations.apply(BufferedImage originalImage);

superscale操作のJavadocを表示

追加のコード例

以下のコード例を使用して、画像形式間の処理と変換を行います:

Fileを使用する場合

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

InputStreamと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);

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);