とあるお仕事にて画像加工をひたすら行う事になったのでimagemagickを使うことにした
最初に、imagemagick を普通にyumでインストールしたが、一部機能が動かない
色々検索して、imagemagick-lastを入れると動く事が判明
まずはremiリポジトリ追加
1 |
# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm |
とりあえず検索
1 |
#yum search imagemagick |
結果
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
GraphicsMagick.x86_64 : An ImageMagick fork, offering faster image generation and better quality ImageMagick-c++.i686 : ImageMagick Magick++ library (C++ bindings) ImageMagick-c++.x86_64 : ImageMagick Magick++ library (C++ bindings) ImageMagick-c++-devel.i686 : C++ bindings for the ImageMagick library ImageMagick-c++-devel.x86_64 : C++ bindings for the ImageMagick library ImageMagick-devel.i686 : Library links and header files for ImageMagick app development ImageMagick-devel.x86_64 : Library links and header files for ImageMagick app development ImageMagick-doc.x86_64 : ImageMagick html documentation ImageMagick-last-c++.x86_64 : ImageMagick Magick++ library (C++ bindings) ImageMagick-last-c++-devel.x86_64 : C++ bindings for the ImageMagick library ImageMagick-last-devel.x86_64 : Library links and header files for ImageMagick app development ImageMagick-last-djvu.x86_64 : DjVu plugin for ImageMagick ImageMagick-last-doc.x86_64 : ImageMagick html documentation ImageMagick-last-libs.x86_64 : Commands for ImageMagick ImageMagick-last-perl.x86_64 : ImageMagick perl bindings ImageMagick-perl.x86_64 : ImageMagick perl bindings php-magickwand.x86_64 : PHP API for ImageMagick php-pecl-imagick.x86_64 : Provides a wrapper to the ImageMagick library GraphicsMagick.i686 : An ImageMagick fork, offering faster image generation and better quality ImageMagick.i686 : An X application for displaying and manipulating images ImageMagick.x86_64 : An X application for displaying and manipulating images ImageMagick-last.x86_64 : An X application for displaying and manipulating images php54-php-magickwand.x86_64 : PHP API for ImageMagick php54-php-pecl-imagick.x86_64 : Extension to create and modify images using ImageMagick php55-php-magickwand.x86_64 : PHP API for ImageMagick php55-php-pecl-imagick.x86_64 : Extension to create and modify images using ImageMagick php56-php-magickwand.x86_64 : PHP API for ImageMagick php56-php-pecl-imagick.x86_64 : Extension to create and modify images using ImageMagick |
情報確認
1 |
#yum info imagemagick-last |
結果
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
License : ImageMagick Description : ImageMagick is an image display and manipulation tool for the X : Window System. ImageMagick can read and write JPEG, TIFF, PNM, GIF, : and Photo CD image formats. It can resize, rotate, sharpen, color : reduce, or add special effects to an image, and when finished you can : either save the completed work in the original format or a different : one. : : ImageMagick-last includes the command line programs for creating animated or : transparent .gifs, creating composite images, creating thumbnail images, : and more. : : ImageMagick-last conflicts with ImageMagick official RPM and so can not : be installed together. Available Packages Name : ImageMagick-last Arch : x86_64 Version : 6.8.9.10 Release : 1.el6.remi Size : 58 k Repo : remi Summary : An X application for displaying and manipulating images URL : http://www.imagemagick.org/ License : ImageMagick Description : ImageMagick is an image display and manipulation tool for the X : Window System. ImageMagick can read and write JPEG, TIFF, PNM, GIF, : and Photo CD image formats. It can resize, rotate, sharpen, color : reduce, or add special effects to an image, and when finished you can : either save the completed work in the original format or a different : one. : : ImageMagick-last includes the command line programs for creating animated or : transparent .gifs, creating composite images, creating thumbnail images, : and more. : : ImageMagick-last conflicts with ImageMagick official RPM and so can not : be installed together. |
バージョンは6.8.9.10ですね早速インストール
1 |
# yum install ImageMagick-last --enablerepo=remi |
結果
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: www.ftp.ne.jp * epel: s3-mirror-ap-northeast-1.fedoraproject.org * extras: www.ftp.ne.jp * remi: remi.kazukioishi.net * remi-php55: remi.kazukioishi.net * updates: www.ftp.ne.jp Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package ImageMagick-last.x86_64 0:6.8.9.7-4.el6.remi will be updated ---> Package ImageMagick-last.x86_64 0:6.8.9.10-1.el6.remi will be an update --> Processing Dependency: ImageMagick-last-libs(x86-64) = 6.8.9.10-1.el6.remi for package: ImageMagick-last-6.8.9.10-1.el6.remi.x86_64 --> Running transaction check ---> Package ImageMagick-last-libs.x86_64 0:6.8.9.7-4.el6.remi will be updated ---> Package ImageMagick-last-libs.x86_64 0:6.8.9.10-1.el6.remi will be an update --> Finished Dependency Resolution Dependencies Resolved ================================================================================================================================================================ Package Arch Version Repository Size ================================================================================================================================================================ Updating: ImageMagick-last x86_64 6.8.9.10-1.el6.remi remi 58 k Updating for dependencies: ImageMagick-last-libs x86_64 6.8.9.10-1.el6.remi remi 6.1 M |
とりあえずconvertコマンドがあるか確認
1 |
# /usr/bin/convert -version |
結果
1 2 3 |
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC Features: DPC Modules OpenMP Delegates: bzlib cairo djvu fftw fontconfig freetype jng jpeg lcms ltdl openexr pangocairo png rsvg tiff webp wmf x xml zlib |
基本的なコマンド
- convert 一枚の画像のフォーマットや、サイズ変更、色々な加工を行う。
- mogrify 複数の画像のフォーマットや、サイズ変更、色々な加工を行う。
- montage 複数の画像の合成を行う。
- animate アニメーション画像の作成を行う
今回は、convertしか使わないな、ということで続く….