LinuxでJPEGのdpi値をロスレスに変更する

LinuxでJPEGのdpi値をロスレスに変更する

dpi実際に他のものに触れたり、画像を再圧縮せずにJPEGファイルに書き込まれた値をどのように変更できますか?

Linux互換ソリューションへようこそ。

このリンクは2011年からその時はおそらくそのようなことができるツールがなかったでしょう。

ベストアンサー1

使用できるexiftoolさまざまなファイル形式のEXIFデータを操作します。コマンドラインユーティリティを含むPerlライブラリ。

$ exiftool test.jpg | grep -i resolution
X Resolution                    : 72
Y Resolution                    : 72
Resolution Unit                 : inches
Focal Plane X Resolution        : 3959.322034
Focal Plane Y Resolution        : 3959.322034
Focal Plane Resolution Unit     : inches

この例では、EXIFデータはtest.jpg72×72 dpiの解像度を表します。この値を100×100に更新するには、exiftool次のように呼び出す必要があります。

$ exiftool -XResolution=100 -YResolution=100 test.jpg
1 image files updated

望むより:

$ exiftool test.jpg | grep -i resolution
X Resolution                    : 100
Y Resolution                    : 100
Resolution Unit                 : inches
Focal Plane X Resolution        : 3959.322034
Focal Plane Y Resolution        : 3959.322034
Focal Plane Resolution Unit     : inches

おすすめ記事