0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

解像度変換方式(PhotoshopとImageMagickの比較)

Posted at

はじめに

PhotoshopとImageMagickとで解像度変換処理に差があるのか調べたので、まとめる。
NearestNeighbor(NN)とBiLinear(BL)を対象とする。

環境

Photoshop: PhotoshopCC(2015) 32bit版 (20150529.r.88)
ImageMagick: ImageMagick-6.9.1-4-Q16-x86-dll

対象画像

640x480のグレースケール画像。
一番左端から右端に向かって階調が連続している。
これを8bitRAW画像として保存。

sample-640x480.png

比較条件

まずは横軸方向での解像度変換を実施する。

解像度変換方式
50%NN
50%BL
33%NN
33%BL
200%NN
200%BL

解像度変換手法

Photoshop

画像を開き、メニュー「イメージ」-「画像解像度」にて変換する。
開いたウィンドウにて変換方式を指定する。

ImageMagick

以下のコマンドにて解像度変換を行う。

convert -size 640x480 -depth 8 gray:sample-640x480.raw -filter point -interpolate Nearest -distort Resize 50%x100% -depth 8 gray:sample-50per-320x480-IM-NN.raw
convert -size 640x480 -depth 8 gray:sample-640x480.raw -filter point -interpolate Bilinear -distort Resize 50%x100% -depth 8 gray:sample-50per-320x480-IM-BL.raw
など

結果

解像度変換方式 Photoshop/ImageMagickの比較
50%NN 一致
50%BL 一致
33%NN 一致
33%BL 不一致
200%NN 一致
200%BL 不一致

33%Bilinearは、不一致。画像中に差が点在している。
整数倍の処理(50%と200%)は一致すると思っていたが、200%のBilinearが不一致であった。
ImageMagickでの解像度変換では、画像の右端の1ピクセル列が191(=0xBF)となっており、Photoshopでの結果255(=0xFF)と差があった。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?