欢迎大家赞助一杯啤酒🍺 我们准备了下酒菜:Formal mathematics/Isabelle/ML, Formal verification/Coq/ACL2, C++/F#/Lisp
RMagick
来自开放百科 - 灰狐
(版本间的差异)
(未显示2个用户的7个中间版本) | |||
第1行: | 第1行: | ||
− | RMagick is an interface between the Ruby programming language and the ImageMagick and GraphicsMagick image processing libraries. | + | RMagick is an interface between the Ruby programming language and the [[ImageMagick]] and [[GraphicsMagick]] image processing libraries. |
− | + | ||
− | + | ||
+ | [[Image:RMagick-framed_wave.jpg|thumb|right|Wave]] | ||
require 'RMagick' | require 'RMagick' | ||
clown = Magick::ImageList.new("clown.jpg") | clown = Magick::ImageList.new("clown.jpg") | ||
clown = clown.wave(10, 200) | clown = clown.wave(10, 200) | ||
clown.write('wave.jpg') | clown.write('wave.jpg') | ||
+ | |||
+ | [[Image:RMagick-framed_monochrome.jpg|thumb|right|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== | ||
+ | *[http://hi.baidu.com/rainchen/blog/item/089ef7364497de320a55a9a3.html 在CentOS 5 中安装Rmagick] | ||
+ | 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;" | ||
+ | |||
+ | [[Category:Graphics]] | ||
+ | [[Category:Ruby]] |
2010年8月22日 (日) 02:39的最后版本
RMagick is an interface between the Ruby programming language and the ImageMagick and GraphicsMagick image processing libraries.
require 'RMagick' clown = Magick::ImageList.new("clown.jpg") clown = clown.wave(10, 200) clown.write('wave.jpg')
require 'RMagick' clown = Magick::ImageList.new("clown.jpg") clown = clown.quantize(256, Magick::GRAYColorspace) clown.write('monochrome.jpg')
[编辑] 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;"
分享您的观点