Magick.colors { |color| block }
-> Magick
Magick.colors -> anArray
Lists the named colors. If the optional block is present, calls the block once for each color, passing a Magick::Color object. Otherwise, returns an array of Magick::Color objects, one for each color.
The Magick::Color class is a Struct class with the following attributes:
Attribute | Value |
---|---|
name | The color name. For example, "red". |
compliance | A ComplianceType value such as X11Compliance. |
color | A Pixel object containing the RGB values. |
If no block is associated with the call, returns an array of Magick::Color objects.
This is a small sample of colors.miff
, the
complete image created by the example program.
GetColorInfo
Magick.fonts { |font| block } ->
Magick
Magick.fonts -> anArray
Lists the fonts that ×Magick knows about. If the optional block is present, calls the block once for each font, passing a Magick::Font object. Otherwise, returns an array of Magick::Font objects, one for each font.
The Magick::Font class is a Struct class with the following attributes:
Attribute | Value |
---|---|
name | The font name. For example, "Palatino-Roman". |
description | The font description. For example, "Palatino Roman". |
family | The font family. For example, "Palatino", "Helvetica", or "Courier". |
style | A StyleType
value such as NormalStyle . |
stretch | A StretchType
value such as NormalStretch . |
weight | The font weight, one of 100, 200, 300, 400, 500, 600, 700, 800, or 900. |
encoding | The font encoding, such as "AppleRoman". May be
nil . |
foundry | The font foundry. "URW", for example. May be
nil . |
format | If the font is a Type1 font, has the value "type1",
otherwise nil . |
If no block is associated with the call, returns an array of Magick::Font objects.
GetFontInfo
Magick.formats { |f,v| block }
-> Magick
Magick.formats -> aHash
Describes the image formats supported by ×Magick. If the optional block is present, calls the block once for each image format. The first argument, f, is the format name. The second argument, v, is the properties string described below.
Code | Definition |
---|---|
B | is "*" if the format has native blob support, and "-" otherwise. |
R | is "r" if ×Magick can read the format, and "-" otherwise. |
W | is "w" if ×Magick can write the format, and "-" otherwise. |
A | is "+" if the format supports multi-image files, and "-" otherwise. |
p Magick.formats » {"TIF"=>"*rw+", "H"=>"*rw-", "MNG"=>"*rw+", "NULL"=>"*rw-", ... "G"=>"*rw+", "GIF"=>"*rw+", "PDB"=>"*rw+"}
GetMagickInfo
×Magick depends on external programs for some formats. Depending on how ×Magick was installed on your system, some formats may not be available. If you have questions, ask your system administrator.
Magick.limit_resource(resource_type [, limit]) -> old_limit
Sets a limit to the amount of a resource, or gets the current limit for the resource. When the limit is reached, ×Magick will fail in some fashion or take compensating actions if possible. The default limits vary according to the platform. See the ×Magick documentation for the -limit option for more information.
:disk
,
:file
, :map
, or
:memory
. You may use a string instead of a
symbol.:file
, the limit is the number of open files. If
:memory
or :map
, the limit is
measured megabytes. If :disk
, the limit is
measured in gigabytes. If this argument is omitted the limit
is not changed.The current resource limit. If a new limit is specified this is the limit before the change.
This method supercedes set_cache_threshold.
Magick.set_cache_threshold(n)
Sets the amount of free memory allocated for the pixel cache. Once this threshold is exceeded, all subsequent pixels cache operations are to/from disk.
An integer number of megabytes.
# set the cache threshold to 10Mb Magick.set_cache_threshold(10)
This method is obsolete. Use limit_resource instead. The code:
Magick.limit_resource(:memory, n) Magick.imit_resource(:map, 2*n)
is equivalent to
Magick.set_cache_threshold(n)
Magick.set_log_event_mask(event_list)
Specify which events to log.
A string composed of one or more of the following event types. If more than one event type is specified, separate the event types with commas.
All, Annotate, Blob, Cache, Coder, Configure,
Deprecate, Draw, Exception, Locale, Module, None, Resource,
Trace, Transform, User, Wand, X11
Magick.set_log_event_mask("Module,Coder")
SetLogEventMask
Magick logging is configured with the log.xml file in Magick's config directory. See Resources in the ImageMagick documenation for more information.
Use this command to find out about the current log configuration.
convert -list log
Magick.set_log_format(format)
Specify the event log format.
A fprintf-like format string composed of optional "normal" text (to which no meaning is assigned) and the following format characters:
Magick.set_monitor(aProc)
Note: This method is deprecated with ImageMagick 6.1.0 and later versions. Use Image#monitor= and Image::Info#monitor= instead.
Establish a monitor exit block. Some (see below) RMagick methods will call the monitor event block, passing parameters that describe how much work there is to be done and how much of that work has already been accomplished.
There can be at most one monitor block defined at a time. To
turn off monitoring, call
Magick.set_monitor(nil)
.
The argument is a Proc
object. The Proc should
accept 3 arguments:
span
that represents
the number of events that have been performed, images that
have been processed, etc.monitor = Proc.new { |text, quantum, span| printf("%s %3.0f%% complete\n", text, ((quantum/span.to_f)*100.0)) } Magick.set_monitor(monitor)
SetMonitorHandler
The list of methods which call the monitor block is
difficult to determine. The only sure way to find out is to
read the source code. In the Image class the list includes
add_noise
, blur_image
,
channel
, chop
, colorize
,
crop
, colors
, despeckle
,
enhance
, equalize
, flip
,
flop
, frame
,
gamma_correct
, implode
,
level
, magnify
,
median_filter
, minify
,
modulate
, morph
, negate
,
normalize
, oil_paint
,
opaque
, raise
,
reduce_noise
, resize
,
roll
, rotate
, sample
,
scale
, segment
, shade
,
sharpen
, shear
,
solarize
, spread
,
stegano
, stereo
, swirl
,
texture
threshold
,
transparent
, and wave
. In the
ImageList class, the list includes append
,
average
, and montage
.