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

画像にエンボス効果を適用する

これは何をするものですか?

エンボス操作は、3*3のカーネル行列を使用して画像にエンボス効果を適用するために使用できます。

JavaでBufferedImageにエンボス効果を適用する

ImageProcessingOperations operations = new ImageProcessingOperations();

// ここでスケール、ぼかしなど、複数の操作を連結できます
operations.emboss(); 
        
// BufferedImageに操作を適用します
BufferedImage modifiedImage = operations.apply(BufferedImage originalImage);

エンボス操作のJavadocを見る

追加のコード例

以下のコード例を使用して、画像フォーマット間の処理と変換を行います:

Fileを使用する場合

File inputFile = new File("path/to/file");
File outputFile = new File("path/to/output-embossed-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);