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:
- require 'RMagick'
- include Magick
- pic = ImageList.new("vd2.png")
- l = pic.columns > pic.rows ?
pic.columns : pic.rows
- f = 128.0/l;
- thumb = pic.thumbnail(f)
- 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