RMagick

来自开放百科 - 灰狐
(版本间的差异)
跳转到: 导航, 搜索
第2行: 第2行:
  
 
[[Image:RMagick-framed_wave.jpg|thumb|right|Wave]]
 
[[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')

2006年9月16日 (六) 12:44的版本

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')
分享您的观点
个人工具
名字空间

变换
操作
导航
工具箱