RMagick

来自开放百科 - 灰狐
跳转到: 导航, 搜索

RMagick is an interface between the Ruby programming language and the ImageMagick and GraphicsMagick image processing libraries.

Wave
require 'RMagick'
clown = Magick::ImageList.new("clown.jpg")
clown = clown.wave(10, 200)
clown.write('wave.jpg')
Turn it into black-and-white
require 'RMagick'
clown = Magick::ImageList.new("clown.jpg")
clown = clown.quantize(256, Magick::GRAYColorspace)
clown.write('monochrome.jpg')

http://rmagick.rubyforge.org/

Install

rpm -qa | grep -i 'ImageMagick' or yum list installed | grep ImageMagick

命令总结:

yum install ImageMagick.x86_64 -y
yum install ImageMagick-devel.x86_64 -y
yum install freetype
yum install gd-devel
wget http://www.osresources.com/files/centos-windows-fonts/msfonts.tbz
mkdir /usr/share/fonts/default/TrueType
tar xvjpf msfonts.tbz -C /usr/share/fonts/default/TrueType/
gem install rmagick

test:

ruby -rrubygems -e "require 'RMagick'; puts Magick::Long_version;"
分享您的观点
个人工具
名字空间

变换
操作
导航
工具箱