欢迎大家赞助一杯啤酒🍺 我们准备了下酒菜:Formal mathematics/Isabelle/ML, Formal verification/Coq/ACL2, C++/F#/Lisp
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.
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')
分享您的观点