2007/07/14
PILとImageMagick、どっちがエライ?
by
Papasan
—
posted at
2007-07-14 08:39
last modified
2007-07-14 08:39
PythonのイメージングライブラリPILとImageMagickでサムネイルを作ってみました。
- PILをPythonから:
# python Python 2.3.6 (#1, Jun 26 2007, 12:01:23) [GCC 3.3.6 release (Vine Linux 3.3.6-0vl7)] on linux2 Type "help", "copyright", "credits" or "license" for more information. # >>> import Image >>> origin = Image.open('origin.jpg') # >>> size = (128, 96) >>> pil128x96 = origin.resize(size) >>> pil128x96.save('pil128x96.jpg') # >>> size = (64, 48) >>> pil64x48 = origin.resize(size) >>> pil64x48.save('pil64x48.jpg') - ImageMagickをコマンドラインから:
# # convert origin.jpg -resize 128x96 im128x96.jpg # convert origin.jpg -resize 64x48 im64x48.jpg
- 結論として、ImageMagickの方がきれい(?)ですがPythonからは使いづらいのでPILの方がエライ!!、以前(数年前)PILでサムネイルを作ったときはひどくて使いものになりませんでした。これだとフィルターをとおせば十分つかえますねえ。
- Category(s)
-
Python
- The URL to Trackback this entry is:
- http://papasan.org/papablog/305/tbping
(トラックバック元のページには"Papasan"や"papasan"または言及リンクの記述が必要です。)