RMagick User's Guide and Reference
class Image::Info - Optional method arguments
Some RMagick methods, such as read and write, accept an "optional arguments" block in which you can set attributes that modify the method's output. These attributes belong to the Image::Info class. The Image::Info class exists only to accept optional arguments for those Image and ImageList methods.

This page explains the methods defined in the Image::Info class. Generally, each Image or ImageList method that uses the Image::Info class to get optional arguments will only accept some of the attributes defined in the class, that is, only those attributes that are meaningful for the particular method. Any other attributes that you set are ignored. Also, some attributes are only used by a subset of the image formats. See the ImageMagick documentation for more information.

Note You do not ever need to create an Image::Info object. The object is created for you before the block is entered and destroyed after the block is exited.

Table Of Contents

antialias= self.antialias= true or false
  Control antialiasing of rendered Postscript and Postscript or TrueType fonts. The default is true.
background_color= self.background_color= aString
self.background_color= aPixel
  Set the image background color. The argument may be a color name or a aPixel.The default is "white".
border_color= self.border_color= aString
self.border_color= aPixel
  Set the image border color. The argument may be a color name or a aPixel.The default is "#dfdfdf".
colorspace= self.colorspace= aColorspaceType
  Specify the image pixel interpretation. The argument is a ColorspaceType constant.
compression= self.compression= aCompressionType
  Specify the image compression type. Not all compression types are supported for all image formats. If you specify an unsupported compression type, the default compression type is used instead.
density= self.density= aString
  Specify the vertical and horizontal resolution in pixels. The argument is a string in the form "XxY" where "X" is the horizontal resolution and "Y" is the vertical resolution. You can also specify simply "X", in which case the vertical resolution is set equal to "X". The default is "72.0x72.0".
depth= self.depth= aNumber
  Specify the image depth, either 8 or 16. You can specify 16 only if ImageMagick was compiled with QuantumDepth=16.
dither= self.dither= true or false
  Apply Floyd/Steinberg error diffusion to the image. The basic strategy of dithering is to trade intensity resolution for spatial resolution by averaging the intensities of several neighboring pixels. Images which suffer from severe contouring when reducing colors can be improved with this option.
extract= (5.5.6) self.extract= aString
 

Specify a portion of an image to be extracted when the image is constituted. The argument is a geometry string. For example: self.extract = "200x200+100+100". This attribute can be used to identify a subset of an image that is otherwise too large to keep in memory.

Note: This attribute replaces the tile= attribute, which is deprecated in ImageMagick 5.5.6 and later.

filename=  self.filename= aString
 

See Image#capture.

font= self.font= aString
  Set the text rendering font. See Draw#font= and Draw#annotate.
format= self.format= aString
  Set the image format, "GIF" or "JPG" for example. See File Formats.
fuzz= self.fuzz= anInteger
  Set the level of "fuzziness" for comparing pixels. By default the pixels must be identical to be considered equal. The larger the fuzz value the more difference is tolerated.
image_type= self.image_type= anImageType
  The image type classification. For example, GrayscaleType. Don't confuse this attribute with the format, that is "GIF" or "JPG".
interlace= self.interlace= anInterlaceType
  Set the interlacing scheme. The default is NoInterlace. This option is used to specify the type of interlacing scheme for raw image formats such as RGB or YUV. NoInterlace means do not interlace, LineInterlace uses scanline interlacing, and PlaneInterlace uses plane interlacing. PartitionInterlace is like PlaneInterlace except the different planes are saved to individual files (e.g. image.R, image.G, and image.B). Use LineInterlace or PlaneInterlace to create an interlaced GIF or progressive JPEG image.
matte_color= self.matte_color= aString
self.matte_color= aPixel
  Set the image transparent color. The argument may be a color name or a aPixel.The default is "#bdbdbd".
monochrome= self.monochrome= aString
self.monochrome= aPixel
  Transform the image to black and white on input. Only the ETP, PDF, and PS formats respect this attribute.
number_scenes=  (5.5.6) self.number_scenes= anInteger
 

Used in conjunction with scene= to specify the range of frames to be extracted when constituting a multi-frame image.

Note: this attribute replaces the subrange= attribute, which is deprecated in ImageMagick 5.5.6 and later. If number_scenes= is used with a version of ImageMagick prior to 5.5.6, it is a synonym for the subrange= attribute.

page= self.page= aString
  Set the equivalent size of the Postscript page. The argument is a geometry string. The default is "612x792>".
quality= self.quality= anInteger
  Set the compression level to use when writing JPEG, MIFF, and PNG images. The default is 75.
scene=  (5.5.6) self.scene= anInteger
 

Used in conjunction with number_scenes= to specify the range of frames to be extracted when constituting a multi-frame image.

Note: this attribute replaces the subimage= attribute, which is deprecated in ImageMagick 5.5.6 and later. If scene= is used with a version of ImageMagick prior to 5.5.6, it is a synonym for the subimage= attribute.

server_name= self.server_name= aString
  Set the X11 display to obtain fonts from.
size= self.size= aString
  Set the width and height of the image when reading a built-in image format that does not have an inherent size, or when reading an image from a multi-resolution file format such as Photo CD, JBIG, or JPEG.
subimage= self.subimage= anInteger
 

Specify a base image of an image sequence in a multi-frame image.

Note: This attribute is deprecated in ImageMagick 5.5.6 and later. Use the scene= attribute instead.

subrange= self.subrange= anInteger
 

Specify the number of images relative to the base image. See subimage=.

Note: This attribute is deprecated in ImageMagick 5.5.6 and later. Use the number_scenes= attribute instead.

tile= self.tile= aString
 

Specify a portion of an image to be extracted when the image is constituted. The argument is a geometry string. For example: self.tile = "200x200+100+100". This attribute can be used to identify a subset of an image that is otherwise too large to keep in memory.

Note: This attribute is deprecated in ImageMagick 5.5.6 and later. Use the extract= attribute instead.

units= self.units= aResolutionType
  Specify the units of image resolution. See ResolutionType.
view= self.view= aString
  FlashPix viewing parameters.