$Id: manual.rd,v 1.2 2001/08/02 20:29:13 tam Exp $
This manual is far from complete. Sorry for inconviniece.
Magick::Image.new()
This class method only initializes Magick::Image object, without any image entity. You need to have this object create a new image, or read image(s) from some external file(s) by either of following ways.
Magick::Image.new("filename1" [, "filename2", ...])
Creates a new Magick::Image from filename. If multiple filename are specified, an image sequence is generated.
Magick::Image.ping("filename")
returns an Array object whose elements are the width, height, size(in byte), format of the image in filename. Image format is a string such as "GIF".
Magick::Image#read("filename1" [, "filename2", ...])
you can specify the following special arguments provided by ImageMagick.
creates a new image with specified color name. If some image attributes has been set by Magick::Image#set in advance of using this method, the generated image will have these attributes.
the 'Wizard' image provided by ImageMagick will be created.
Besides using Magick::Image#read with mulitple arguments, you can create an image sequence by Magick::Image#push
Magick::Image#push(image)
If a sequence is pushed, the top of the image sequence of image object will be added to the destination object. Each of the image sequence is indexed from 0.
RubyMagick provides the following methods to refer or access each image.
Magick::Image#at(pos) { |im| block... }
the pos-th image is passed to block as the block argument im.
Magick::Image#each { |im| block... }
You can access members of Image and ImageInfo structure(image attributes) by Magick::Image#get or Magick::Image#set.
Magick::Image#get("attr1" [, "attr2", ...])
get values specified by the attributes attr1, attr2. When multiple attributes are specified, it returns an Array consists of corresponding attribute values.
Magick::Image#set({"attr1"=>value1 [, "attr2"=>value2, ...]})
set the values of attributes attr1, attr2 as "key"=>"value" pair(Hash).
See Image.html, or ImageInfo.html in ImageMagick distribution for details.
str is a string representing color name. See color.html in ImageMagick distribution.
ColorspaceType is a constant defined in Magick::ColorspaceType.
CompressType is a constant defined in Magick::CompressType.
FilterType is a constant defined in Magick::FileterType
InterlaceType is a constants defined in Magick::InterlaceType
RenderingIntent is a constant defined in Magick::RenderingIntent.
ResolutionType is a constant defined in Magick::ResolutionType
Magick::Image#write({"attr1"=>val, ...})
Write a (possibly sequence of) image with specified attriburtes given as hash.
Magick::Image#add_noise(NoiseType)
Magick::Image#blur(radius, sigma)
Magick::Image#colorize(opacity, color)
Magick::Image#convolve(coef)
Magick::Image#despeckle
Magick::Image#edge(radius)
Magick::Image#emboss(radius, sigma)
Magick::Image#enhance
Magick::Image#gaussian_blur(radius, sigma)
Magick::Image#implode(factor)
Magick::Image#median_filter(radius)
Magick::Image#morph(frames)
Magick::Image#mortion_blur(radius, sigma, amount)
Magick::Image#oilpaint(radius)
Magick::Image#plasma(segment, attenuate, depth)
Magick::Image#reduce_noise(radius)
Magick::Image#shade(color_shading, azimuth, elevation)
true
or false
Magick::Image#sharpen(radius, sigma)
Magick::Image#solarize(factor)
Magick::Image#spread(amount)
Magick::Image#stegano(image)
Magick::Image#stereo(offset_image)
Magick::Image#swirl(degree)
Magick::Image#threshold(val)
Magick::Image#transparent(color, opacity)
To create full transparent image, set opacity to
Magick::TransparentOpacity
Magick::Image#unsharp_mask(radius, sigma, amount, threshold)
Magick::Image#wave(amplitude, wave_length)
Magick::Image#chop(geom)
Magick::Image#coalesce
Magick::Image#crop(geom)
Magick::Image#deconstruct
Magick::Image#flatten
Magick::Image#flip
Magick::Image#flop
Magick::Image#profile(profname, filename)
nil
nil
Magick::Image#roll(offset_x, offset_y)
Magick::Image#shave(geom)
Magick::Image#transform(geom, crop_geom)
Magick::Image#magnify
Magick::Image#minify
Magick::Image#resize(geom, FilterType, blur)
Magick::Image#sample(geom)
Magick::Image#scale(geom)
Magick::Image#zoom(geom)
Magick::Image#annotate("key"=>"value")
Magick::Image#draw(drawable1 [,drawable2, ...])
Magick::Image#montage({"key1"=>val1 [,"key2"=>val2, ...])
options for generating a montage image are given as hash keys.
CompositeOp is a constant defined in Magick::CompositeOp
Magick::Image#compress_colormap
Magick::Image#number_colors([io])
Magick::Image#is_grayscale_image?
Magick::Image#is_monochrome_image?
Magick::Image#is_opaque_image?
Magick::Image#is_pseudo_class?
Magick::Image#border(geom, color)
Magick::Image#frame(geom)
Magick::Image#raise(geom, raised)
Magick::Image#contrast(sharpen)
Magick::Image#equalize
Magick::Image#gamma(level)
Specify level as "r,g,b,o"
.
r, g, b, o are red, green, blue, opacity value, respectively.
Magick::Image#modulate(modulation)
Specify modulation as "b,s,h"
Magick::Image#negate(grayscale)
Magick::Image#normalize
Magick::Image#map(image, dither_flag)
Magick::Image#map_images(image, dither_flag)
Magick::Image#ordered_dither
Magick::Image#quantize({"key"=>value ["key2"=>value2,...]})
quantizes a image with specified option given as hash keys. Available options are listed below.
ColorspaceType is a constants defined in Magick::ColorspaceType
true
or false
true
or false
Magick::Image#quantize_images({"key"=>value ["key2"=>value2,...]})
Magick::Image#segment(Colorspace, verbose, cluster, smooth)
Magick::Image#rotate(degree)
Magick::Image#shear(x_shear, y_shear)
Magick::Image#channel(ChannelType)
Magick::Image#composite(image, CompositeOp, offset_x, offset_y)
Magick::Image#cycle_colormap(amount)
Magick::Image#describe(dest_io, [verbose_flag])
Magick::Image#animate
Magick::Image#append(horizontal_direction=true)
Magick::Image#display
Magick::Image#bounding_box
Magick::Image#depth
Magick::Image#image_type
Magick::Image#scenes
Magick::Image#mogrify(option1 [, option2, ...])
options is the command line options given to mogrify(1).
Magick::Image#mosaic
Magick::Image#rgb_transform(ColorspaceType)
Magick::Image#texture(image)
This modules collects the classes which define primitive drawables available in ImageMagick. see also "magick.rb"
Instances of theses classes become arguments of Magick::Image#draw. You can draw primitives on an image by following ways.
1. use class method 'new' whose arguments are parameters that determines the primitives of interest, create a new instance. Parameters are arguments listed at the section of Drawing Primitives in 'DrawInfo.html' in ImageMagick documentation. 2. set attributes with using the instance method 'set' to this object. Attributes are members of DrawInfo structure. See 'DrawInfo.html' in ImageMagick documentation for available attributes and desriptions. 3. take it as an argument of ((<Magick::Image#draw>)).
Magick::Drawable::Point.new(image, x, y)
Magick::Drawable::Point#set
Magick::Drawable::Line.new(image, x1, x2, y1, y2)
Magick::Drawable::Rectangle.new(image, x1, x2, y1, y2)
Magick::Drawable::Arc.new(image, startX,startY,endX,endY,startDegree,endDegree)
Magick::Drawable::Ellipse.new(image, origX,origY,width,height,arcStart,arcEnd)
Magick::Drawable::Circle.new(image, origX,origY,perimX,perimY)
Magick::Drawable::Polyline.new(image, x1,y1,x2,y2,...)
Magick::Drawable::Polygon.new(image, x1,y1,x2,y2,...)
Magick::Drawable::Bezier.new(image, x1,y1,x2,y2,...)
Magick::Drawable::Text.new(image, text, x, y)