 |
About RMagick 2 |
What is RMagick 2?
RMagick 2 is the future of RMagick. This is the version that
will get new methods and support new ImageMagick features.
What's new in RMagick 2?
Image objects are big. Most of the memory they use is
allocated directly from the operating system and isn't managed by
Ruby. RMagick 2 has two new methods to help you manage that
memory.
- Image#destroy!
- This method returns all the unmanaged memory used by an
image to the system, making it available for reuse. After an
image is destroyed, if you try to call any method (except
#inspect and the
new #destroyed?
method), RMagick raises a DestroyedImageError exception.
You no longer have to call GC.start to forcibly clean up unused
images.
- Magick.trace_proc=
- This attribute helps you keep track of the images being
used by your program. trace_proc accepts a Proc value
which is called each time an image is created or destroyed. The
proc gets a unique identifier for the image and a string that
describes the image. If the image originated from a file, the
description includes the filename.
Other new features:
- 6 new animation optimization methods
- 6 new resizing filters
- Combine RGB layers with Image.combine
- Separate an image into RGB layers with Image#separate
- Fast cropping with Image#excerpt
- Support for the Q32 version of ImageMagick
- Numerous improvements, big and small, to the
documentation
Prerequisites
- Ruby 1.8.2 and later, including Ruby 1.9
- ImageMagick 6.3.0-7 or later
RMagick 2 does not support GraphicsMagick.
Installation
If you're installing RMagick 2 on Windows,
use the RMagick 2.0.0 binary gem for Ruby 1.8.6. This gem is
bundled with a a copy of the ImageMagick Windows installer so you
don't need to download your own copy. Download the gem from the
rmagick-win32
project on RubyForge, unzip it into a temporary directory, and
follow the instructions in the README.html file you'll find in
the package.
On Linux, BSD, OS X, and other systems, the
process for installing RMagick 2 with RubyGems is identical to
the process for installing RMagick 1. See the installation FAQ for your system.
If you've installed RMagick 1 in the past using a tarball,
note that RMagick 2 is installed with Minero
Aoki's setup.rb command. Install ImageMagick normally (see
the installation FAQ for your
system), download and untar the RMagick 2 tarball, change to the
RMagick 2 directory, and enter
ruby setup.rb
sudo ruby setup.rb install
to install RMagick. You can read more about this procedure in
the README.html file.
Documentation
As always, installing RMagick 2 also installs a complete copy
of the The RMagick User's Guide and Reference. The doc
is also available online here.
FAQ
- How should I decide between RMagick 1 and
RMagick 2?
-
Choose RMagick 2 if
- You want to test your programs with Ruby 1.9.
- You want to use functionality that has been added in
ImageMagick 6.3.0 and later.
- You want to have more control over RMagick's memory
usage.
Choose RMagick 1 if
- You want to use a release of Ruby prior to 1.8.2 or
ImageMagick prior to 6.3.0.
- You want to use RMagick with GraphicsMagick.
- You have existing scripts that use methods that have
been removed from RMagick 2.
- Can I use my existing RMagick scripts with
RMagick 2?
- Almost certainly. RMagick 2 removes support for a handful
of rarely-used and long-deprecated methods such as
Image#grayscale_pseudo_class and Image#statistics. Usually
these methods have been replaced by methods that are
supported. For a complete list of methods that have been
removed in RMagick 2 see the ChangeLog.
- What's going to happen to RMagick 1?
- Nothing. I still support RMagick 1 and will fix bugs as
they are reported. As of this writing I've produced 12 update
releases. If some change to ImageMagick breaks RMagick, I'll do
my best to fix it, just like I always have. However, changes to
RMagick will be limited to bug fixes. I don't plan to add any
new functionality.
- Will RMagick 1 ever support Ruby 1.9?
- No.
- Do you plan to add support for GraphicsMagick
to RMagick 2?
- No.
- Why did you change the prerequisites?
- RMagick 1 supports ImageMagick 6.0.0 (released in April,
2004) through the current release, GraphicsMagick 1.0.0
(released in May, 2003) through the current release, and Ruby
1.6.7 (released in March, 2003) through Ruby 1.8.6. The work of
supporting so many releases has become more than I want to
handle, so I decided to focus my efforts on newer and more
widely-used releases of Ruby and ImageMagick.