Ruby Rmagick Installation Guide

Source: Internet
Author: User
Tags image processing library imagemagick ruby on rails

There are many Ruby-based development frameworks. Next we will introduce the Ruby Rmagick installation skills in detail, and hope to help you.

  • Ruby naming rules
  • Basic Syntax of common Ruby Libraries
  • Using pp () to output two-dimensional arrays in Ruby
  • Ruby on Rails directory files
  • Ruby function pointer concepts

Is RMagick ImageMagick? & GraphicsMagick: the Ruby version interface of the image processing library, which is easy to use and has powerful functions. Let's try it.
The Windows platform is used for installation as an example:

Ruby plugin.
Decompress the package first, and then enter the command in the decompressed directory to install the package:

Gem install rmagick-1.13.0-win32.gem

Then, click imagemagick-6.2.9-3-q8-windows-dll.exe to install the tool and place the installation path in the path environment variable. Otherwise, CORE_RL_magick _. dll cannot be found during Ruby Rmagick installation.

The following is an example of a. rb thumbnail:

 

 
 
  1. require 'RMagick'  
  2. include Magick  
  3. pic = ImageList.new("vd2.png")  
  4. l = pic.columns > pic.rows ?
     pic.columns : pic.rows  
  5. f = 128.0/l;  
  6. thumb = pic.thumbnail(f)  
  7. thumb.write("vd2_tb.png") 

Put a vd2.png image in the same directory and run ruby a. rb to see the thumbnail.
There are many examples. For details, refer to the official website:
Image size conversion, cropping, merging, Sample
Image effects, Sample
Provides the drawing function, Sample
You can also draw a vector chart, Sample

Ruby Rmagick installation command: gem install rails-v 1.1.6-r-y
Faster_csv installation command: gem I fastercsv

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.