BMPをTIFFに変換
JDeli Java画像変換ライブラリは、BMP対応を備えており、Javaおよびその他の言語/スクリプトでBMPをTIFF画像ファイルに非常に簡単に変換できます。
コード例を実行するには、JDeli jarをダウンロードする必要があります:
- BMP画像をJavaに読み込む
BufferedImage bufferedImage = JDeli.read(new File("bmpImageFile.bmp"));
- 必要に応じて画像を処理 する(拡大縮小、シャープ化、明るさ調整、透かしなど)
bufferedImage = operations.apply(BufferedImage bufferedImage); // オプション
- BufferedImageをTIFF画像ファイルとして書き出す
JDeli.write(bufferedImage, "tiff", new File("tiffImageFile.tiff"));
JDeli.convert()メソッドを使用すると、わずか1行のコードでBMPをTIFFとして保存できます!
JDeli.convert(File inFile, File outFile);
JDeli.convert(InputStream inputStream, OutputStream outputStream, "tiff");
byte[] outputData = JDeli.convert(byte[] inputData, "tiff");
このオプションでは、EncoderOptions オブジェクトを指定して、画像圧縮などの出力設定を構成できます。
JDeli.convert(File inFile, EncoderOptions outputOptions, File outfile);
コマンドラインやbash、bat、powershellスクリプトから画像形式を変換します。この方法は、子プロセスを作成できる任意のプログラミング言語からJDeliを呼び出すためにも使用できます。
java -jar jdeli.jar --convert tiff "inputFileOrDir" "outputDir"
