随笔-167  评论-65  文章-0  trackbacks-0
环境:ubuntu + ruby1.8.7
前提是你ruby里要先装了rmagick类库,下面demo的四个100分别是x坐标,y坐标,width,height
图片处理更多的功能,一定要看rmagic的api
demo:test.rb

  require 'rubygems'
  require 'RMagick'
  include Magick
    image=Image.read("/home/feng/Img/1.jpg").first
    face=image.crop!(100,100,100,100)
    face.write("/home/feng/Img/crop.jpg")

ref:
http://www.genlinux.org/2009/03/ruby-program-to-crop-image-using.html



write by feng
posted on 2009-06-19 19:09 fl1429 阅读(370) 评论(0)  编辑  收藏 所属分类: Rails

只有注册用户登录后才能发表评论。


网站导航:
 
已访问数:
free counters