Image Conversion, Editing, and Composition



images/logo.png



John Cristy
ImageMagick Studio LLC
http://www.imagemagick.org

Copyright

Copyright (C) 2000 ImageMagick Studio, a non-profit organization dedicated to making software imaging solutions freely available.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (ÏmageMagick"), to deal in ImageMagick without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of ImageMagick, and to permit persons to whom the ImageMagick is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of ImageMagick.

The software is provided äs is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall ImageMagick Studio be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with ImageMagick or the use or other dealings in ImageMagick.

Except as contained in this notice, the name of the ImageMagick Studio shall not be used in advertising or otherwise to promote the sale, use or other dealings in ImageMagick without prior written authorization from the ImageMagick Studio.

Contents

Part 1: Quick Start Guide
            1  Introduction
    1.1  What is ImageMagick
        1.1.1  Command-line Utility
        1.1.2  Application Programming Interface
        1.1.3  Scripting Language
        1.1.4  General Purpose Imaging Solution
    1.2  Getting Help
        1.2.1  Web Site
        1.2.2  Mailing List
        1.2.3  Defect Tracking System
            2  Image Primer
    2.1  What is an Image
    2.2  Image Depth
    2.3  Colormapped Images
    2.4  Compression
        2.4.1  Lossless
        2.4.2  Lossy
    2.5  Colorspace
        2.5.1  RGB
        2.5.2  CMYK
    2.6  Meta-Information
    2.7  Image Formats
            3  Image Tools
        3.0.1  Identify
        3.0.2  Convert
        3.0.3  Mogrify
        3.0.4  Combine
        3.0.5  Display
        3.0.6  Animate
            4  Image Transformations
    4.1  How to specify an image
        4.1.1  Implicitly
        4.1.2  Explicitly
        4.1.3  By URL
    4.2  Convert from one Image Format to Another
    4.3  Colormap Manipulation
    4.4  Resize an Image
    4.5  Crop
    4.6  Enhance
    4.7  Effects
        4.7.1  Special Effects
        4.7.2  Image Preview
    4.8  Decorate
    4.9  Annotate
    4.10  Draw
    4.11  Composite
    4.12  Meta-Information
        4.12.1  Comment
    4.13  Miscellanious Transforms
        4.13.1  Append
            5  Advanced ImageMagick Features
    5.1  Working with Multi-resolution Images
        5.1.1  PCD
        5.1.2  PTIF
    5.2  Working with an Image Sequence
        5.2.1  Animation
        5.2.2  Delay
        5.2.3  Loop
    5.3  Working with a Group of Images
    5.4  Working with Raw Images
        5.4.1  Size
        5.4.2  Depth
        5.4.3  Interlace
    5.5  Using ImageMagick from a Web Browser
Part 2: Installation And Administration Guide
            6  C Application Programming Interface
    6.1  Working with Blobs
    6.2  Working with Threads
        6.2.1  Posix
        6.2.2  Windows
            7  C++ Application Programming Interface
    7.1  Working with Blobs
    7.2  Working with Threads
        7.2.1  Posix
        7.2.2  Windows
            8  Perl Application Programming Interface
    8.1  Background
            9  PHP Application Programming Interface
    9.1  Background
            10  Other Application Programming Interfaces
    10.1  Java
    10.2  Python
    10.3  ImageMagick Integration Project
Part 3: User's Guide
            11  Image Channels
    11.1  Working with Image Channels
            12  Image Painting
    12.1  Image Painting
        12.1.1  Paint Type
        12.1.2  Paint Method
        12.1.3  Fuzz Factor
            13  Color Profiles
    13.1  Working with Color Profiles
            14  Image Drawing
    14.1  SVG
    14.2  MVG
Part 4: Application Programming Interface
            15  Installing from Binary
    15.1  Downloading
        15.1.1  web
        15.1.2  ftp
    15.2  Linux RPM
    15.3  Windows
    15.4  VMS
    15.5  Unix
    15.6  Other
            16  Installing from Source
    16.1  Downloading
        16.1.1  FTP
        16.1.2  CVS
    16.2  Unix
        16.2.1  Configure
        16.2.2  Modules
    16.3  Windows
        16.3.1  Configure
        16.3.2  Modules
    16.4  Macintosh
    16.5  VMS
            17  Customizing ImageMagick
    17.1  Image Depth
        17.1.1  8-bit
        17.1.2  16-bit
    17.2  Image Cache
        17.2.1  Persistent Cache
    17.3  Delegates
        17.3.1  Library Delegates
        17.3.2  Delegates.mgk
    17.4  magic.mgk
Part 5: Reference Manual
            18  Supported Image Formats
            19  Command-line Options
            20  C API Methods
    20.1  Methods to Constitute an Image
        20.1.1  ConstituteImage
        20.1.2  DispatchImage
        20.1.3  PingImage
        20.1.4  ReadImage
        20.1.5  ReadImages
        20.1.6  WriteImage
    20.2  ImageMagick Image Methods
        20.2.1  AllocateImage
        20.2.2  AllocateImageColormap
        20.2.3  AllocateNextImage
        20.2.4  AnimateImages
        20.2.5  AppendImages
        20.2.6  AverageImages
        20.2.7  ChannelImage
        20.2.8  CloneImage
        20.2.9  CloneImageInfo
        20.2.10  CompositeImage
        20.2.11  CycleColormapImage
        20.2.12  DescribeImage
        20.2.13  DestroyImage
        20.2.14  DestroyImageInfo
        20.2.15  DestroyImages
        20.2.16  DisplayImages
        20.2.17  GetImageBoundingBox
        20.2.18  GetImageDepth
        20.2.19  GetImageInfo
        20.2.20  GetImageType
        20.2.21  GetNextImage
        20.2.22  GetNumberScenes
        20.2.23  GetPageInfo
        20.2.24  GetPixelPacket
        20.2.25  IsGeometry
        20.2.26  IsImagesEqual
        20.2.27  IsImageTainted
        20.2.28  IsSubimage
        20.2.29  ListToGroupImage
        20.2.30  MogrifyImage
        20.2.31  MogrifyImages
        20.2.32  MosaicImages
        20.2.33  ParseImageGeometry
        20.2.34  RGBTransformImage
        20.2.35  SetImage
        20.2.36  SetImageDepth
        20.2.37  SetImageInfo
        20.2.38  SetImageOpacity
        20.2.39  SetImageType
        20.2.40  SortColormapByIntentsity
        20.2.41  SyncImage
        20.2.42  TextureImage
        20.2.43  TransformRGBImage
        20.2.44  TransmitImage
    20.3  Methods to Resize an Image
        20.3.1  MagnifyImage
        20.3.2  MinifyImage
        20.3.3  ResizeImage
        20.3.4  SampleImage
        20.3.5  ScaleImage
        20.3.6  ZoomImage
    20.4  Methods to Transform an Image
        20.4.1  ChopImage
        20.4.2  CoalesceImages
        20.4.3  CropImage
        20.4.4  DeconstructImages
        20.4.5  FlipImage
        20.4.6  FlopImage
        20.4.7  ProfileImage
        20.4.8  RollImage
        20.4.9  TransformImage
    20.5  Methods to Draw on an Image
        20.5.1  CloneDrawInfo
        20.5.2  ColorFloodfillImage
        20.5.3  DestroyDrawInfo
        20.5.4  DrawImage
        20.5.5  GetDrawInfo
        20.5.6  MatteFloodfillImage
        20.5.7  OpaqueImage
        20.5.8  TransparentImage
    20.6  Methods to Annotate an Image
        20.6.1  AnnotateImage
        20.6.2  GetFontMetrics
    20.7  Methods to Count the Colors in an Image
        20.7.1  CompressColormap
        20.7.2  GetNumberColors
        20.7.3  IsGrayImage
        20.7.4  IsMonochromeImage
        20.7.5  IsOpaqueImage
        20.7.6  IsPseudoClass
        20.7.7  ListColors
        20.7.8  QueryColorDatabase
        20.7.9  QueryColorName
    20.8  ImageMagick Image Decoration Methods
        20.8.1  BorderImage
        20.8.2  FrameImage
        20.8.3  RaiseImage
    20.9  Methods to Create a Montage.
        20.9.1  CloneMontageInfo
        20.9.2  DestroyMontageInfo
        20.9.3  GetMontageInfo
        20.9.4  MontageImages
    20.10  ImageMagick Image Effects Methods
        20.10.1  AddNoiseImage
        20.10.2  BlurImage
        20.10.3  ColorizeImage
        20.10.4  ConvolveImage
        20.10.5  DespeckleImage
        20.10.6  EdgeImage
        20.10.7  EmbossImage
        20.10.8  EnhanceImage
        20.10.9  GaussianBlurImage
        20.10.10  ImplodeImage
        20.10.11  MedianFilterImage
        20.10.12  MorphImages
        20.10.13  OilPaintImage
        20.10.14  PlasmaImage
        20.10.15  ReduceNoiseImage
        20.10.16  ShadeImage
        20.10.17  SharpenImage
        20.10.18  SolarizeImage
        20.10.19  SpreadImage
        20.10.20  SteganoImage
        20.10.21  StereoImage
        20.10.22  SwirlImage
        20.10.23  ThresholdImage
        20.10.24  UnsharpMaskImage
        20.10.25  WaveImage
    20.11  Methods to Enhance an Image
        20.11.1  ContrastImage
        20.11.2  EqualizeImage
        20.11.3  GammaImage
        20.11.4  ModulateImage
        20.11.5  MotionBlurImage
        20.11.6  NegateImage
        20.11.7  NormalizeImage
    20.12  Methods to Reduce the Number of Unique Colors in an Image
        20.12.1  CloneQuantizeInfo
        20.12.2  DestroyQuantizeInfo
        20.12.3  GetQuantizeInfo
        20.12.4  MapImage
        20.12.5  MapImages
        20.12.6  QuantizationError
        20.12.7  QuantizeImage
        20.12.8  QuantizeImages
    20.13  Methods to Segment an Image with Thresholding Fuzzy c-Means
        20.13.1  SegmentImage
    20.14  Methods to Shear or Rotate an Image by an Arbitrary Angle
        20.14.1  RotateImage
        20.14.2  ShearImage
    20.15  Methods to Compute a Digital Signature for an Image
        20.15.1  SignatureImage
    20.16  Image Pixel FIFO
        20.16.1  ReadStream
        20.16.2  WriteStream
    20.17  Image Text Attributes Methods
        20.17.1  DestroyImageAttributes
        20.17.2  GetImageAttribute
        20.17.3  GetImageInfoAttribute
        20.17.4  SetImageAttribute
        20.17.5  StoreImageAttribute
    20.18  Methods to Get or Set Image Pixels
        20.18.1  ClosePixelCache
        20.18.2  DestroyPixelCache
        20.18.3  GetIndexesFromCache
        20.18.4  GetOnePixelFromCache
        20.18.5  GetPixelCache
        20.18.6  GetPixelsFromCache
        20.18.7  SetPixelCache
        20.18.8  SyncPixelCache
        20.18.9  WriteCacheInfo
    20.19  Methods to Read or Write Binary Large Objects
        20.19.1  BlobToImage
        20.19.2  DestroyBlobInfo
        20.19.3  GetBlobInfo
        20.19.4  ImageToBlob
        20.19.5  SetBlobQuantum
    20.20  Methods to Read or List ImageMagick Image formats
        20.20.1  DestroyMagickInfo
        20.20.2  GetImageMagick
        20.20.3  GetMagickConfigurePath
        20.20.4  GetMagickInfo
        20.20.5  GetMagickVersion
        20.20.6  ListMagickInfo
        20.20.7  MagickIncarnate
        20.20.8  RegisterMagickInfo
        20.20.9  SetMagickInfo
        20.20.10  UnregisterMagickInfo
    20.21  ImageMagick Error Methods
        20.21.1  CatchImageException
        20.21.2  DestroyExceptionInfo
        20.21.3  GetExceptionInfo
        20.21.4  GetImageException
        20.21.5  MagickError
        20.21.6  MagickWarning
        20.21.7  SetErrorHandler
        20.21.8  SetWarningHandler
        20.21.9  ThrowException
    20.22  ImageMagick Memory Allocation Methods
        20.22.1  AcquireMemory
        20.22.2  LiberateMemory
        20.22.3  ReacquireMemory
    20.23  ImageMagick Progress Monitor Methods
        20.23.1  MagickMonitor
        20.23.2  SetMonitorHandler
    20.24  Methods to Interactively Animate an Image Sequence
        20.24.1  XAnimateBackgroundImage
        20.24.2  XAnimateImage
    20.25  Methods to Interactively Display and Edit an Image
        20.25.1  XDisplayBackgroundImage
        20.25.2  XDisplayImage
    20.26  ImageMagick Cache Views Methods
        20.26.1  CloseCacheView
        20.26.2  GetCacheView
        20.26.3  GetCacheViewIndexes
        20.26.4  GetCacheViewPixels
        20.26.5  OpenCacheView
        20.26.6  SetCacheView
        20.26.7  SyncCacheView
    20.27  API Structures
        20.27.1  AffineMatrix
        20.27.2  ColorPacket
        20.27.3  DrawInfo
        20.27.4  ExceptionInfo
        20.27.5  Image
        20.27.6  ImageAttribute
        20.27.7  ImageInfo
        20.27.8  MagickInfo
        20.27.9  PixelPacket
        20.27.10  ProfileInfo
        20.27.11  RectangleInfo
    20.28  API Enumerations
        20.28.1  CacheType
        20.28.2  ChannelType
        20.28.3  ClassType
        20.28.4  ColorspaceType
        20.28.5  CompositeOperator
        20.28.6  CompressionType
        20.28.7  DecorationType
        20.28.8  ExceptionType
        20.28.9  FilterTypes
        20.28.10  GeometryFlags
        20.28.11  GravityType
        20.28.12  ImageType
        20.28.13  InterlaceType
        20.28.14  LineCap
        20.28.15  LineJoin
        20.28.16  MapMode
        20.28.17  MontageMode
        20.28.18  NoiseType
        20.28.19  PaintMethod
        20.28.20  ProfileType
        20.28.21  PreviewType
        20.28.22  PrimitiveType
        20.28.23  PrimitiveType
        20.28.24  RenderingIntent
        20.28.25  ResolutionType
            21  C++ API Methods
            22  Perl API Methods
    22.1  Image::Magick Attributes
    22.2  Image::Magick Methods
    22.3  Image::Magick Errors
            23  Recognized Color Keyword Names
            A  Appendix A
Index

Chapter 1
Preface

About This Book

Acknowledgement


Part 1
Quick Start Guide


Introduction

Introduction

Abstract

Please start every chapter with a short summary of what the reader may expect.

To start with we suggest that every heading is followed by at least a short passage of text in order to avoid a simple listing of different hierarchies.

1  What is ImageMagick

1.1  Command-line Utility

1.2  Application Programming Interface

1.3  Scripting Language

1.4  General Purpose Imaging Solution

2  Getting Help

2.1  Web Site

2.2  Mailing List

2.3  Defect Tracking System

Image Primer

Image Primer

Abstract

Please start every chapter with a short summary of what the reader may expect.

To start with we suggest that every heading is followed by at least a short passage of text in order to avoid a simple listing of different hierarchies.

3  What is an Image

4  Image Depth

5  Colormapped Images

6  Compression

6.1  Lossless

6.2  Lossy

7  Colorspace

7.1  RGB

7.2  CMYK

8  Meta-Information

9  Image Formats

Image Tools

Image Tools

Abstract

Please start every chapter with a short summary of what the reader may expect.

To start with we suggest that every heading is followed by at least a short passage of text in order to avoid a simple listing of different hierarchies.

9.1  Identify

9.2  Convert

9.3  Mogrify

9.4  Combine

9.5  Display

9.6  Animate

Image Transformations

Image Transformations

Abstract

Please start every chapter with a short summary of what the reader may expect.

To start with we suggest that every heading is followed by at least a short passage of text in order to avoid a simple listing of different hierarchies.

10  How to specify an image

10.1  Implicitly

10.2  Explicitly

10.3  By URL

11  Convert from one Image Format to Another

12  Colormap Manipulation

13  Resize an Image

14  Crop

15  Enhance

16  Effects

16.1  Special Effects

16.2  Image Preview

17  Decorate

18  Annotate

19  Draw

20  Composite

21  Meta-Information

21.1  Comment

22  Miscellanious Transforms

22.1  Append

Advanced ImageMagick Features

Advanced ImageMagick Features

Abstract

Please start every chapter with a short summary of what the reader may expect.

To start with we suggest that every heading is followed by at least a short passage of text in order to avoid a simple listing of different hierarchies.

23  Working with Multi-resolution Images

23.1  PCD

23.2  PTIF

24  Working with an Image Sequence

24.1  Animation

24.2  Delay

24.3  Loop

25  Working with a Group of Images

26  Working with Raw Images

26.1  Size

26.2  Depth

26.3  Interlace

27  Using ImageMagick from a Web Browser


Part 2
Installation And Administration Guide


C Application Programming Interface

C Application Programming Interface

Abstract

Please start every chapter with a short summary of what the reader may expect.

To start with we suggest that every heading is followed by at least a short passage of text in order to avoid a simple listing of different hierarchies.

28  Working with Blobs

29  Working with Threads

29.1  Posix

29.2  Windows

C++ Application Programming Interface

C++ Application Programming Interface

Abstract

Please start every chapter with a short summary of what the reader may expect.

To start with we suggest that every heading is followed by at least a short passage of text in order to avoid a simple listing of different hierarchies.

30  Working with Blobs

31  Working with Threads

31.1  Posix

31.2  Windows

Perl Application Programming Interface

Perl Application Programming Interface

Abstract

Please start every chapter with a short summary of what the reader may expect.

To start with we suggest that every heading is followed by at least a short passage of text in order to avoid a simple listing of different hierarchies.

32  Background

PHP Application Programming Interface

PHP Application Programming Interface

Abstract

Please start every chapter with a short summary of what the reader may expect.

To start with we suggest that every heading is followed by at least a short passage of text in order to avoid a simple listing of different hierarchies.

33  Background

Other Application Programming Interfaces

Other Application Programming Interfaces

Abstract

Please start every chapter with a short summary of what the reader may expect.

To start with we suggest that every heading is followed by at least a short passage of text in order to avoid a simple listing of different hierarchies.

34  Java

35  Python

36  ImageMagick Integration Project


Part 3
User's Guide


Image Channels

Image Channels

Abstract

Please start every chapter with a short summary of what the reader may expect.

To start with we suggest that every heading is followed by at least a short passage of text in order to avoid a simple listing of different hierarchies.

37  Working with Image Channels

Image Painting

Image Painting

Abstract

Please start every chapter with a short summary of what the reader may expect.

To start with we suggest that every heading is followed by at least a short passage of text in order to avoid a simple listing of different hierarchies.

38  Image Painting

38.1  Paint Type

38.1.1  Color

38.1.2  Matte

38.2  Paint Method

38.2.1  Floodfill

38.2.2  Point

38.2.3  Replace

38.2.4  FillToBorder

38.2.5  Reset

38.3  Fuzz Factor

Color Profiles

Color Profiles

Abstract

Please start every chapter with a short summary of what the reader may expect.

To start with we suggest that every heading is followed by at least a short passage of text in order to avoid a simple listing of different hierarchies.

39  Working with Color Profiles

Image Drawing

Image Drawing

Abstract

Please start every chapter with a short summary of what the reader may expect.

To start with we suggest that every heading is followed by at least a short passage of text in order to avoid a simple listing of different hierarchies.

40  SVG

41  MVG


Part 4
Application Programming Interface


Installing from Binary

Installing from Binary

Abstract

Please start every chapter with a short summary of what the reader may expect.

To start with we suggest that every heading is followed by at least a short passage of text in order to avoid a simple listing of different hierarchies.

42  Downloading

42.1  web

42.2  ftp

43  Linux RPM

44  Windows

45  VMS

46  Unix

47  Other

Installing from Source

Installing from Source

Abstract

Please start every chapter with a short summary of what the reader may expect.

To start with we suggest that every heading is followed by at least a short passage of text in order to avoid a simple listing of different hierarchies.

48  Downloading

48.1  FTP

48.2  CVS

49  Unix

49.1  Configure

49.2  Modules

50  Windows

50.1  Configure

50.2  Modules

51  Macintosh

52  VMS

Customizing ImageMagick

Customizing ImageMagick

Abstract

Please start every chapter with a short summary of what the reader may expect.

To start with we suggest that every heading is followed by at least a short passage of text in order to avoid a simple listing of different hierarchies.

53  Image Depth

53.1  8-bit

53.2  16-bit

54  Image Cache

54.1  Persistent Cache

55  Delegates

55.1  Library Delegates

55.2  Delegates.mgk

56  magic.mgk


Part 5
Reference Manual


Supported Image Formats

Supported Image Formats

Command-line Options

Command-line Options

C API Methods

C API Methods

57  Methods to Constitute an Image

57.1  ConstituteImage

Method ConstituteImage is a convenience routine that creates an image from the pixel data you supply and returns it. It allocates the memory necessary for the new Image structure and returns a pointer to the new image. The pixel data must be in scanline order top-to-bottom. The data can be character, short int, integer, float, or double. Float and double require the pixels to be normalized [0..1]. The other types are [0..MaxRGB]. For example, to create a 640x480 image from unsigned red-green-blue character data, use

image=ConstituteImage (640, 480, "RGB", 0, pixels, &exception)

Image \*ConstituteImage (const unsigned int width, const unsigned int height, const char \*map, const StorageType type, const void \*pixels, ExceptionInfo \*exception)

image

Method Constitute returns a pointer to the image. A null image is returned if there is a memory shortage or if the image cannot be read.

width

Specifies the width in pixels of the image.

height

Specifies the height in pixels of the image.

map

This character string can be any combination or order of R = red, G = green, B = blue, A = alpha, C = cyan, Y = yellow, M = magenta, and K = black. The ordering reflects the order of the pixels in the supplied pixel array.

type

pixel type where 0 = unsigned char, 1 = short int, 2 = int, 3 = float, and 4 = double. Float and double types are expected to be normalized [0..1] otherwise [0..MaxRGB].

pixels

This array of values contain the pixel components as defined by the map and type parameters. The length of the arrays must equal the area specified by the width and height values and type parameters.

exception

return any errors or warnings in this structure.

57.2  DispatchImage

Method DispatchImage is a convenience routine. Use it to extract pixel data from an image and place it in a buffer you supply. The data is saved either as char, short int, integer, float or double format in the order specified by the type parameter. For example, we want to extract scanline 1 of a 640x480 image as character data in red-green-blue order:

DispatchImage (image, 0, 0, 640, 1, "RGB", 0, pixels)

unsigned int DispatchImage (Image \*image, const int x, const int y, const unsigned int columns, const unsigned int rows, const char \*map, const StorageType type, void \*pixels)

image

Specifies a pointer to a Image structure returned from ReadImage.

x, y, columns, rows

These values define the perimeter of a region of pixels you want to extract.

map

This character string can be any combination or order of R = red, G = green, B = blue, A = alpha, C = cyan, Y = yellow, M = magenta, and K = black. The ordering reflects the order of the pixels in the supplied pixel array.

type

pixel type where 0 = unsigned char, 1 = short int, 2 = int, 3 = float, and 4 = double. Float and double types are expected to be normalized [0..1] otherwise [0..MaxRGB].

pixels

This array of values contain the pixel components as defined by the map and type parameters. The length of the arrays must equal the area specified by the width and height values and type parameters.

57.3  PingImage

Method PingImage returns the image size in bytes if it exists and can be the image is returned as well. Note, only the first image in a multi-frame image file is pinged.

Image \*PingImage (const ImageInfo \*image_info, ExceptionInfo \*exception)

Image

Method PingImage returns the image size in bytes if the image file exists and it size can be determined otherwise 0.

image_info

Specifies a pointer to an ImageInfo structure.

exception

return any errors or warnings in this structure.

57.4  ReadImage

Method ReadImage reads an image and returns it. It allocates the memory necessary for the new Image structure and returns a pointer to the new image. By default, the image format is determined by its magic number. To specify a particular image format, precede the filename with an explicit image format name and a colon (i.e. ps:image) or as the filename suffix (i.e. image.ps).

Image \*ReadImage (const ImageInfo \*image_info, ExceptionInfo \*exception)

image

Method ReadImage returns a pointer to the image after reading. A null image is returned if there is a memory shortage or if the image cannot be read.

image_info

Specifies a pointer to an ImageInfo structure.

exception

return any errors or warnings in this structure.

57.5  ReadImages

Method ReadImages reads a list of image names from a file and then returns the images as a linked list.

Image \*ReadImages (const ImageInfo \*image_info, ExceptionInfo \*exception)

image

Method ReadImage returns a pointer to the image after reading. A null image is returned if there is a memory shortage or if the image cannot be read.

image_info

Specifies a pointer to an ImageInfo structure.

57.6  WriteImage

Method WriteImage writes an image to a file as defined by image->filename. You can specify a particular image format by prefixing the file with the image type and a colon (i.e. ps:image) or specify the image type as the filename suffix (i.e. image.ps). The image may be modified to adapt it to the requirements of the image format. For example, DirectClass images must be color-reduced to PseudoClass if the format is GIF.

unsigned int WriteImage (const ImageInfo \*image_info, Image \*image)

status

Method WriteImage return True if the image is written. False is returned is there is a memory shortage or if the image file fails to write.

image_info

Specifies a pointer to an ImageInfo structure.

image

A pointer to a Image structure.

58  ImageMagick Image Methods

58.1  AllocateImage

Method AllocateImage allocates an Image structure and initializes each field to a default value.

Image \*AllocateImage (const ImageInfo \*image_info)

allocate_image

Method AllocateImage returns a pointer to an image structure initialized to default values. A null image is returned if there is a memory shortage.

image_info

Specifies a pointer to an ImageInfo structure.

58.2  AllocateImageColormap

Method AllocateImageColormap allocates an Image colormap and initializes it. The minimum number of colormap cells allocated is 256.

unsigned int AllocateImageColormap (Image \*image, const unsigned int colors)

status

Method AllocateImageColormap returns True if the colormap is successfully allocated and initialized, otherwise False.

image

The address of a structure of type Image.

colors

The number of colors in the image colormap.

58.3  AllocateNextImage

Method AllocateNextImage allocates an Image structure and initializes each field to a default value.

void AllocateNextImage (const ImageInfo \*image_info, Image \*image)

image_info

Specifies a pointer to an ImageInfo structure.

image

The address of a structure of type Image.

58.4  AnimateImages

Method AnimateImages displays one or more images to an X window.

unsigned int AnimateImages (const ImageInfo \*image_info, Image \*image)

status

Method AnimateImages returns True if the images are displayed in an X window, otherwise False is returned.

image_info

Specifies a pointer to an ImageInfo structure.

image

The address of a structure of type Image.

58.5  AppendImages

Method AppendImages appends a sequence of images. All the input images must have the same width or height. Images of the same width are stacked top-to-bottom. Images of the same height are stacked left-to-right. If stack is false, rectangular images are stacked left-to-right otherwise top-to-bottom.

Image \*AppendImages (Image \*image, const unsigned int stack, ExceptionInfo \*exception)

image

The address of a structure of type Image returned from ReadImage.

stack

An unsigned value other than stacks rectangular image top-to-bottom otherwise left-to-right.

exception

return any errors or warnings in this structure.

58.6  AverageImages

Method AverageImages averages a sequence of images. All the input image must be the same size in pixels.

Image \*AverageImages (const Image \*image, ExceptionInfo \*exception)

average_image

Method AverageImages returns the mean pixel value for an image sequence.

image

The address of a structure of type Image returned from ReadImage.

exception

return any errors or warnings in this structure.

58.7  ChannelImage

Method ChannelImage extracts the specified channel from the referenced image.

unsigned int ChannelImage (Image \*image, const ChannelType channel)

image

The address of a structure of type Image returned from ReadImage.

channel

A value of type ChannelType that identifies which channel to extract.

58.8  CloneImage

Method CloneImage clones an image. If the specified columns and rows is 0, an exact copy of the image is returned, otherwise the pixel data is undefined and must be initialized with SetImagePixels() and SyncImagePixels() methods.

Image \*CloneImage (Image \*image, const unsigned int columns, const unsigned int rows, const unsigned int orphan, ExceptionInfo \*exception)

clone_image

Method CloneImage returns a pointer to the image after copying. A null image is returned if there is a memory shortage.

image

The address of a structure of type Image.

columns

An integer that specifies the number of columns in the copied image.

rows

An integer that specifies the number of rows in the copied image.

orphan

if true, consider this image an orphan.

exception

return any errors or warnings in this structure.

58.9  CloneImageInfo

Method CloneImageInfo makes a duplicate of the given image info, or if image info is NULL, a new one.

ImageInfo \*CloneImageInfo (const ImageInfo \*image_info)

clone_info

Method CloneImageInfo returns a duplicate of the given image info, or if image info is NULL a new one.

image_info

Specifies a pointer to an ImageInfo structure.

58.10  CompositeImage

Method CompositeImage returns the second image composited onto the first at the specified offsets.

unsigned int CompositeImage (Image \*image, const CompositeOperator compose, Image \*composite_image, const int x_offset, const int y_offset)

image

The address of a structure of type Image.

compose

Specifies an image composite operator.

composite_image

The address of a structure of type Image.

x_offset

An integer that specifies the column offset of the composited image.

y_offset

An integer that specifies the row offset of the composited image.

58.11  CycleColormapImage

Method CycleColormapImage cycles the image colormap by a specified amount.

CycleColormapImage (image, amount)

image

The address of a structure of type Image returned from ReadImage.

amount

An unsigned value that specifies the offset of the colormap.

58.12  DescribeImage

Method DescribeImage describes an image by printing its attributes to stdout.

void DescribeImage (Image \*image, FILE \*file, const unsigned int verbose)

image

The address of a structure of type Image.

file

send the image attributes to this file.

verbose

an unsigned value other than zero prints detailed information about the image.

58.13  DestroyImage

Method DestroyImage deallocates memory associated with an image.

void DestroyImage (Image \*image)

image

The address of a structure of type Image.

58.14  DestroyImageInfo

Method DestroyImageInfo deallocates memory associated with an ImageInfo structure.

void DestroyImageInfo (ImageInfo \*image_info)

image_info

Specifies a pointer to an ImageInfo structure.

58.15  DestroyImages

Method DestroyImages deallocates memory associated with a linked list of images.

void DestroyImages (Image \*image)

image

The address of a structure of type Image.

58.16  DisplayImages

Method DisplayImages displays one or more images to an X window.

unsigned int DisplayImages (const ImageInfo \*image_info, Image \*image)

status

Method DisplayImages returns True if the images are displayed in an X window, otherwise False is returned.

image_info

Specifies a pointer to an ImageInfo structure.

image

The address of a structure of type Image.

58.17  GetImageBoundingBox

Method GetImageBoundingBox returns the bounding box of an image canvas.

RectangleInfo GetImageBoundingBox (Image \*image)

bounds

Method GetImageBoundingBox returns the bounding box of an image canvas.

image

The address of a structure of type Image.

58.18  GetImageDepth

Method GetImageDepth returns the depth of the image.

unsigned int GetImageDepth (Image \*image)

depth

Method GetImageDepth returns the depth of the image.

image

The address of a structure of type Image.

58.19  GetImageInfo

Method GetImageInfo initializes the ImageInfo structure.

void GetImageInfo (ImageInfo \*image_info)

image_info

Specifies a pointer to an ImageInfo structure.

58.20  GetImageType

Method GetImageType returns the type of image (e.g. bilevel, palette, etc).

ImageType GetImageType (Image \*image)

type

Method GetImageType returns a ImageType enum that specifies the type of the specified image (e.g. bilevel, palette, etc).

image

The address of a structure of type Image.

58.21  GetNextImage

Method GetNextImage returns the next image in an image sequence.

Image \*GetNextImage (Image \*image)

next

Method GetNextImage returns the next image in an image sequence.

image

The address of a structure of type Image.

58.22  GetNumberScenes

Method GetNumberScenes returns the number of scenes in an image sequence.

unsigned int GetNumberScenes (const Image \*image)

scenes

Method GetNumberScenes returns the number of scenes in an image sequence.

image

The address of a structure of type Image.

58.23  GetPageInfo

Method GetPageInfo initializes the image page structure.

void GetPageInfo (RectangleInfo \*page)

page

Specifies a pointer to a RectangleInfo structure.

58.24  GetPixelPacket

Method GetPixelPacket initializes the PixelPacket structure.

void GetPixelPacket (PixelPacket \*pixel)

pixel

Specifies a pointer to a PixelPacket structure.

58.25  IsGeometry

Method IsGeometry returns True if the geometry specification is valid as determined by ParseGeometry.

unsigned int IsGeometry (const char \*geometry)

status

Method IsGeometry returns True if the geometry specification is valid otherwise False is returned.

geometry

This string is the geometry specification.

58.26  IsImagesEqual

Method IsImagesEqual measures the difference between two images. The error is computed by summing over all pixels in an image the distance squared in RGB space between each image pixel and its corresponding pixel in the reference image. These values are computed:

mean_error_per_pixel

This value is the mean error for any single pixel in the image.

normalized_mean_square_error

This value is the normalized mean quantization error for any single pixel in the image. This distance measure is normalized to a range between 0 and 1. It is independent of the range of red, green, and blue values in the image.

normalized_maximum_square_error

Thsi value is the normalized maximum quantization error for any single pixel in the image. This distance measure is normalized to a range between 0 and 1. It is independent of the range of red, green, and blue values in your image.

unsigned int IsImagesEqual (Image \*image, Image \*reference)

image

Specifies a pointer to an Image structure.

reference

Specifies a pointer to an Image structure.

58.27  IsImageTainted

Method IsImageTainted returns True if the image has been altered since it was first read or if any image in the sequence has a difference magic or filename.

unsigned int IsImageTainted (const Image \*image)

status

Method IsImageTainted returns True if the image has been altered since it was first read.

image

The address of a structure of type Image.

58.28  IsSubimage

Method IsSubimage returns True if the geometry is a valid subimage specification (e.g. [1], [1-9], [1, 7, 4]).

unsigned int IsSubimage (const char \*geometry, const unsigned int pedantic)

status

Method IsSubimage returns True if the geometry is a valid subimage specification otherwise False is returned.

geometry

This string is the geometry specification.

pedantic

A value other than 0 invokes a more restriction set of conditions for a valid specification (e.g. [1], [1-4], [4-1]).

58.29  ListToGroupImage

Method ListToGroupImage converts a linked list of images to a sequential array.

Image \*\*ListToGroupImage (Image \*image, unsigned int \*number_images)

images

Method ListToGroupImage converts a linked list of images to a sequential array and returns the array..

images

The address of a structure of type Image returned from ReadImage.

number_images

A pointer to an unsigned integer. The number of images in the image array is returned here.

58.30  MogrifyImage

Method MogrifyImage applies image processing options to an image as prescribed by command line options.

unsigned int MogrifyImage (const ImageInfo \*image_info, const int argc, char \*\*argv, Image \*\*image)

image_info

Specifies a pointer to an ImageInfo structure.

argc

Specifies a pointer to an integer describing the number of elements in the argument vector.

argv

Specifies a pointer to a text array containing the command line arguments.

image

The address of a structure of type Image returned from ReadImage.

58.31  MogrifyImages

Method MogrifyImages applies next processing options to a sequence of images as prescribed by command line options.

unsigned int MogrifyImages (const ImageInfo \*next_info, const int argc, char \*\*argv, Image \*\*image)

next_info

Specifies a pointer to an ImageInfo structure.

argc

Specifies a pointer to an integer describing the number of elements in the argument vector.

argv

Specifies a pointer to a text array containing the command line arguments.

image

The address of a structure of type Image returned from ReadImage.

58.32  MosaicImages

Method MosaicImages inlays a number of image to form a single coherent picture.

Image \*MosaicImages (const Image \*image, ExceptionInfo \*exception)

image

The address of a structure of type Image returned from ReadImage.

exception

return any errors or warnings in this structure.

58.33  ParseImageGeometry

Method ParseImageGeometry parses a geometry specification and returns the width, height, x, and y values. It also returns flags that indicates which of the four values (width, height, xoffset, yoffset) were located in the string, and whether the x and y values are negative. In addition,

int ParseImageGeometry (const char \*geometry, int \*x, int \*y, unsigned int \*width, unsigned int \*height)

flags

Method ParseImageGeometry returns a bitmask that indicates which of the four values were located in the geometry string.

image_geometry

Specifies a character string representing the geometry specification.

x, y

A pointer to an integer. The x and y offset as determined by the geometry specification is returned here.

width, height

A pointer to an unsigned integer. The width and height as determined by the geometry specification is returned here.

58.34  RGBTransformImage

Method RGBTransformImage converts the reference image from RGB to an alternate colorspace. The transformation matrices are not the standard ones: the weights are rescaled to normalized the range of the transformed values to be [0..MaxRGB].

unsigned int RGBTransformImage (Image \*image, const ColorspaceType colorspace)

image

The address of a structure of type Image returned from ReadImage.

colorspace

An unsigned integer value that indicates which colorspace to transform the image.

58.35  SetImage

Method SetImage initializes the reference image to the background color.

void SetImage (Image \*image, opacity)

image

The address of a structure of type Image returned from ReadImage.

opacity

The transparency of the background color.

58.36  SetImageDepth

Method SetImageDepth sets the depth of the image.

unsigned int SetImageDepth (Image \*image, const unsigned int)

status

Method SetImageDepth returns True if the image depth is set.

image

The address of a structure of type Image.

depth

specified the image depth.

58.37  SetImageInfo

Method SetImageInfo initializes the `magick' field of the ImageInfo structure. It is set to a type of image format based on the prefix or suffix of the filename. For example, `ps:image' returns PS indicating a Postscript image. JPEG is returned for this filename: `image.jpg'. The filename prefix has precendence over the suffix. Use an optional index enclosed in brackets after a file name to specify a desired subimage of a multi-resolution image format like Photo CD (e.g. img0001.pcd[4]).

unsigned int SetImageInfo (ImageInfo \*image_info, const unsigned int rectify)

image_info

Specifies a pointer to an ImageInfo structure.

rectify

an unsigned value other than zero rectifies the attribute for multi-frame support (user may want multi-frame but image format may not support it).

58.38  SetImageOpacity

Method SetImageOpacity initializes the opacity channel of the reference image to the specified value. If the image already has a matte channel it is attenuated with the opacity value.

void SetImageOpacity (Image \*image, const unsigned int opacity)

image

The address of a structure of type Image returned from ReadImage.

opacity

The level of transparency.

58.39  SetImageType

Method SetImageType sets the image type.

void SetImageType (Image \*image, const ImageType image_type)

image

The address of a structure of type Image returned from ReadImage.

image_type

image type.

58.40  SortColormapByIntentsity

Method SortColormapByIntensity sorts the colormap of a PseudoClass image by decreasing color intensity.

unsigned int SortColormapByIntensity(Image \*image)

image

A pointer to a Image structure.

58.41  SyncImage

Method SyncImage initializes the red, green, and blue intensities of each pixel as defined by the colormap index.

void SyncImage (Image \*image)

image

The address of a structure of type Image.

58.42  TextureImage

Method TextureImage layers a texture onto the background of an image.

void TextureImage (Image \*image, Image \*texture)

image

The address of a structure of type Image returned from ReadImage.

texture

This image contains the texture to layer on the background.

58.43  TransformRGBImage

Method TransformRGBImage converts the reference image from an alternate colorspace. The transformation matrices are not the standard ones: the weights are rescaled to normalize the range of the transformed values to be [0..MaxRGB].

unsigned int TransformRGBImage (Image \*image, const ColorspaceType colorspace)

image

The address of a structure of type Image returned from ReadImage.

colorspace

An unsigned integer value defines which colorspace to transform the image to.

58.44  TransmitImage

Method TransmitImage transmit an image to a variety of destinations. It is used primarily in CGI and ISAPI programs to send an image to a client using either disk, blobs, streaming, or via the normal in memory image structure.

unsigned int TransmitImage (Image \*image, ImageInfo \*image_info, const TransmitType sendmode, void \*param1, void \*param2)

image

The address of a structure of type Image returned from ReadImage.

image_info

Specifies a pointer to an ImageInfo structure.

sendmode

An unsigned integer value defines which transmit mode to send the image with.

param1

An void pointer whose meaning depends on the transmit mode.

param2

An void pointer whose meaning depends on the transmit mode.

59  Methods to Resize an Image

59.1  MagnifyImage

Method MagnifyImage creates a new image that is a integral size greater than an existing one. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.

MagnifyImage scans the reference image to create a magnify image by bilinear interpolation. The magnify image columns and rows become:

number_columns << 1 number_rows << 1

magnify_image=MagnifyImage (image, ExceptionInfo \*exception)

magnify_image

Method MagnifyImage returns a pointer to the image after magnification. A null image is returned if there is a memory shortage.

image

The address of a structure of type Image.

exception

return any errors or warnings in this structure.

59.2  MinifyImage

Method MinifyImage creates a new image that is a integral size less than an existing one. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.

MinifyImage scans the reference image to create a minified image by computing the weighted average of a 4x4 cell centered at each reference pixel. The target pixel requires two columns and two rows of the reference pixels. Therefore the minified image columns and rows become:

number_columns/2 number_rows/2

Weights assume that the importance of neighboring pixels is negately proportional to the square of their distance from the target pixel.

The scan only processes pixels that have a full set of neighbors. Pixels in the top, bottom, left, and right pairs of rows and columns are omitted from the scan.

Image \*MinifyImage (Image \*image, ExceptionInfo \*exception)

minify_image

Method MinifyImage returns a pointer to the image after reducing. A null image is returned if there is a memory shortage or if the image size is less than IconSize\*2.

image

The address of a structur of type Image.

exception

return any errors or warnings in this structure.

59.3  ResizeImage

Method ResizeImage creates a new image that is a scaled size of an existing one. It allocates the memory necessary for the new Image structure and returns a pointer to the new image. The Point filter gives fast pixel replication, Triangle is equivalent to bi-linear interpolation, and Mitchel giver slower, very high-quality results. See Graphic Gems III for details on this algorithm.

Image \*ResizeImage (Image \*image, const unsigned int columns, const unsigned int rows, const FilterType filter, const double blur, ExceptionInfo \*exception)

resize_image

Method ResizeImage returns a pointer to the image after scaling. A null image is returned if there is a memory shortage.

image

the address of a structure of type Image.

columns

an integer that specifies the number of columns in the resize image.

rows

an integer that specifies the number of rows in the scaled image.

filter

specifies which image filter to use.

blur

specifies the blur factor where > 1 is blurry, < 1 is sharp.

exception

return any errors or warnings in this structure.

59.4  SampleImage

Method SampleImage creates a new image that is a scaled size of an existing one using pixel sampling. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.

Image \*SampleImage (Image \*image, const unsigned int columns, const unsigned int rows, ExceptionInfo \*exception)

sample_image

Method SampleImage returns a pointer to the image after scaling. A null image is returned if there is a memory shortage.

image

The address of a structure of type Image.

columns

An integer that specifies the number of columns in the sampled image.

rows

An integer that specifies the number of rows in the sampled image.

exception

return any errors or warnings in this structure.

59.5  ScaleImage

Method ScaleImage creates a new image that is a scaled size of an existing one. It allocates the memory necessary for the new Image structure and returns a pointer to the new image. To scale a scanline from x pixels to y pixels, each new pixel represents x/y old pixels. To read x/y pixels, read (x/y rounded up) pixels but only count the required fraction of the last old pixel read in your new pixel. The remainder of the old pixel will be counted in the next new pixel.

The scaling algorithm was suggested by rjohnson@shell.com and is adapted from pnmscale(1) of PBMPLUS by Jef Poskanzer.

Image \*ScaleImage (Image \*image, const unsigned int columns, const unsigned int rows, ExceptionInfo \*exception)

scale_image

Method ScaleImage returns a pointer to the image after scaling. A null image is returned if there is a memory shortage.

image

The address of a structure of type Image.

columns

An integer that specifies the number of columns in the scaled image.

rows

An integer that specifies the number of rows in the scaled image.

exception

return any errors or warnings in this structure.

59.6  ZoomImage

Method ZoomImage creates a new image that is a scaled size of an existing one. It allocates the memory necessary for the new Image structure and returns a pointer to the new image. The Point filter gives fast pixel replication, Triangle is equivalent to bi-linear interpolation, and Mitchel giver slower, very high-quality results. See Graphic Gems III for details on this algorithm.

The filter member of the Image structure specifies which image filter to use. Blur specifies the blur factor where > 1 is blurry, < 1 is sharp.

Image \*ZoomImage (Image \*image, const unsigned int columns, const unsigned int rows, ExceptionInfo \*exception)

zoom_image

Method ZoomImage returns a pointer to the image after scaling. A null image is returned if there is a memory shortage.

image

The address of a structure of type Image.

columns

An integer that specifies the number of columns in the zoom image.

rows

An integer that specifies the number of rows in the scaled image.

exception

return any errors or warnings in this structure.

60  Methods to Transform an Image

60.1  ChopImage

Method ChopImage creates a new image that is a subregion of an existing one. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.

Image \*ChopImage (Image \*image, const RectangleInfo \*chop_info) ExceptionInfo \*exception)

chop_image

Method ChopImage returns a pointer to the chop image. A null image is returned if there is a memory shortage or if the image width or height is zero.

image

The address of a structure of type Image.

chop_info

Specifies a pointer to a RectangleInfo which defines the region of the image to crop.

exception

return any errors or warnings in this structure.

60.2  CoalesceImages

Method CoalesceImages merges a sequence of images. This is useful for GIF and MNG animation sequences that have page offsets and disposal methods.

Image \*CoalesceImages (Image \*image, ExceptionInfo \*exception)

image

The address of a structure of type Image returned from ReadImage. It points to the first image in the group to be coalesced.

exception

return any errors or warnings in this structure.

60.3  CropImage

Method CropImage creates a new image that is a subregion of an existing one. It allocates the memory necessary for the new Image structure and returns a pointer to the new image. This method is optimized to preserve the runlength encoding. That is, the crop image will always use less memory than the original.

Image \*CropImage (Image \*image, const RectangleInfo \*crop_info, ExceptionInfo \*exception)

crop_image

Method CropImage returns a pointer to the crop image. A null image is returned if there is a memory shortage or if the image width or height is zero.

image

The address of a structure of type Image.

crop_info

Specifies a pointer to a RectangleInfo which defines the region of the image to crop.

exception

return any errors or warnings in this structure.

60.4  DeconstructImages

Method DeconstructImages breaks down an image sequence into constituent parts. This is useful for creating GIF or MNG animation sequences.

Image \*DeconstructImages (Image \*image, ExceptionInfo \*exception)

image

The address of a structure of type Image returned from ReadImage. It points to the first next in the group to be deconstructed.

exception

return any errors or warnings in this structure.

60.5  FlipImage

Method FlipImage creates a new image that reflects each scanline in the vertical direction It allocates the memory necessary for the new Image structure and returns a pointer to the new image.

Image \*FlipImage (Image \*image, ExceptionInfo \*exception)

flip_image

Method FlipImage returns a pointer to the image after reflecting. A null image is returned if there is a memory shortage.

image

The address of a structure of type Image.

exception

return any errors or warnings in this structure.

60.6  FlopImage

Method FlopImage creates a new image that reflects each scanline in the horizontal direction It allocates the memory necessary for the new Image structure and returns a pointer to the new image.

Image \*FlopImage (Image \*image, ExceptionInfo \*exception)

flop_image

Method FlopImage returns a pointer to the image after reflecting. A null image is returned if there is a memory shortage.

image

The address of a structure of type Image.

exception

return any errors or warnings in this structure.

60.7  ProfileImage

Method ProfileImage removes or adds a ICM, IPTC, or generic profile to an image. If the profile name is specified it is deleted from the image. If a filename is specified, one or more profiles are read and added to the image.

unsigned int ProfileImage (Image \*image, const char \*profile_name, const char \*filename)

status

Method ProfileImage returns True if the profile is successfully added or removed from the image, otherwise False.

image

The address of a structure of type Image.

profile_name

Specifies the type of profile to add or remove.

filename

Specifies the filename of the ICM or IPTC profile.

60.8  RollImage

Method RollImage rolls an image vertically and horizontally. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.

Image \*RollImage (Image \*image, const int x_offset, const int y_offset, ExceptionInfo \*exception)

roll_image

Method RollImage returns a pointer to the image after rolling. A null image is returned if there is a memory shortage.

image

The address of a structure of type Image.

x_offset

An integer that specifies the number of columns to roll in the horizontal direction.

y_offset

An integer that specifies the number of rows to roll in the vertical direction.

exception

return any errors or warnings in this structure.

60.9  TransformImage

Method TransformImage creates a new image that is a transformed size of of existing one as specified by the crop and image geometries. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.

If a crop geometry is specified a subregion of the image is obtained. If the specified image size, as defined by the image and scale geometries, is smaller than the actual image size, the image is first minified to an integral of the specified image size with an antialias digital filter. The image is then scaled to the exact specified image size with pixel replication. If the specified image size is greater than the actual image size, the image is first enlarged to an integral of the specified image size with bilinear interpolation. The image is then scaled to the exact specified image size with pixel replication.

void TransformImage (Image \*\*image, const char \*crop_geometry, const char \*image_geometry)

image

The address of an address of a structure of type Image. The transformed image is returned as this parameter.

crop_geometry

Specifies a pointer to a crop geometry string. This geometry defines a subregion of the image.

image_geometry

Specifies a pointer to a image geometry string. The specified width and height of this geometry string are absolute.

61  Methods to Draw on an Image

61.1  CloneDrawInfo

Method CloneDrawInfo makes a duplicate of the given draw info, or if draw info is NULL, a new one.

DrawInfo \*CloneDrawInfo (const ImageInfo \*image_info, const DrawInfo \*draw_info)

clone_info

Method CloneDrawInfo returns a duplicate of the given annotate info, or if annotate info is NULL a new one.

image_info

a structure of type ImageInfo.

draw_info

a structure of type DrawInfo.

61.2  ColorFloodfillImage

Method ColorFloodfillImage floodfills the designated area with a color. The floodfill algorithm is strongly based on a similar algorithm in "Graphics Gems" by Paul Heckbert.

unsigned int ColorFloodfillImage (Image \*image, const DrawInfo \*draw_info, const PixelPacket target, const int x_offset, const int y_offset, const PaintMethod method)

image

The address of a structure of type Image.

draw_info

a structure of type DrawInfo.

target

A PixelPacket structure. This is the RGB value of the target color.

x, y

Unsigned integers representing the current location of the pen.

method

drawing method of type PrimitiveType: floodfill or fill to border.

61.3  DestroyDrawInfo

Method DestroyDrawInfo deallocates memory associated with an DrawInfo structure.

void DestroyDrawInfo (DrawInfo \*draw_info)

draw_info

Specifies a pointer to an DrawInfo structure.

61.4  DrawImage

Method DrawImage draws a primitive (line, rectangle, ellipse) on the image.

unsigned int DrawImage (Image \*image, const DrawInfo \*draw_info)

image

The address of a structure of type Image.

draw_info

The address of a DrawInfo structure.

61.5  GetDrawInfo

Method GetDrawInfo initializes the DrawInfo structure.

void GetDrawInfo (const ImageInfo \*image_info, DrawInfo \*draw_info)

image_info

Specifies a pointer to an ImageInfo structure.

draw_info

Specifies a pointer to a DrawInfo structure.

61.6  MatteFloodfillImage

Method MatteFloodfillImage floodfills the designated area with a matte value. The floodfill algorithm is strongly based on a similar algorithm in "Graphics Gems" by Paul Heckbert.

unsigned int MatteFloodfillImage (Image \*image, const PixelPacket target, const unsigned int matte, const int x_offset, const int y_offset, const PaintMethod method)

image

The address of a structure of type Image.

target

A PixelPacket structure. This is the RGB value of the target color.

matte

A integer value representing the amount of transparency.

x, y

Unsigned integers representing the current location of the pen.

method

drawing method of type PrimitiveType: floodfill or fill to border.

61.7  OpaqueImage

Method OpaqueImage changes the color of an opaque point to the pen color.

unsigned int OpaqueImage (Image \*image, const PixelPacket target, const PixelPacket pen_color)

image

The address of a structure of type Image returned from ReadImage.

target

the color to search for in the image.

pen_color

the color to replace it with.

61.8  TransparentImage

Method TransparentImage creates a matte image associated with the image. All pixel locations are initially set to opaque. Any pixel that matches the specified color are set to transparent.

unsigned int TransparentImage (Image \*image, const PixelPacket target)

image

The address of a structure of type Image returned from ReadImage.

target

The color to search for in the image.

62  Methods to Annotate an Image

62.1  AnnotateImage

Method AnnotateImage annotates an image with text. Optionally the annotation can include the image filename, type, width, height, or scene

unsigned int AnnotateImage (Image \*image, DrawInfo \*draw_info)

status

Method AnnotateImage returns True if the image is annotated otherwise False.

image

The address of a structure of type Image.

draw_info

The address of a DrawInfo structure.

62.2  GetFontMetrics

Method GetFontMetrics returns the following information for the specified font and text:

o

character width, expressed in integer pixels o character height, expressed in integer pixels o ascent, expressed in 26.6 fixed point pixels o descent, expressed in 26.6 fixed point pixels o text width, expressed in 26.6 fixed point pixels o text height, expressed in 26.6 fixed point pixels o maximum horizontal advance, expressed in 26.6 fixed point pixels

unsigned int GetFontMetrics (Image \*image, const DrawInfo \*draw_info, FontMetric metrics)

status

Method GetFontMetrics returns True if the metrics are available otherwise False.

image

The address of a structure of type Image.

draw_info

Specifies a pointer to a DrawInfo structure.

metrics

Method GetFontMetrics returns the font metrics.

63  Methods to Count the Colors in an Image

63.1  CompressColormap

Method CompressColormap compresses an image colormap removing any duplicate and unused color entries.

void CompressColormap (Image \*image)

image

The address of a structure of type Image.

63.2  GetNumberColors

Method GetNumberColors returns the number of unique colors in an image.

number_colors=GetNumberColors (image, file)

number_colors

Method GetNumberColors returns the number of unique colors in the specified image.

image

The address of a byte (8 bits) array of run-length encoded pixel data of your source image. The sum of the run-length counts in the source image must be equal to or exceed the number of pixels.

file

An pointer to a FILE. If it is non-null a list of unique pixel field values and the number of times each occurs in the image is written to the file.

63.3  IsGrayImage

Method IsGrayImage returns True if the image is grayscale otherwise False is returned. If the image is DirectClass and grayscale, it is demoted to PseudoClass.

unsigned int IsGrayImage (Image \*image)

status

Method IsGrayImage returns True if the image is grayscale otherwise False is returned.

image

The address of a structure of type Image returned from ReadImage.

63.4  IsMonochromeImage

Method IsMonochromeImage returns True if the image is monochrome otherwise False is returned. If the image is DirectClass and grayscale (including monochrome), it is demoted to PseudoClass.

status=IsMonochromeImage (image)

status

Method IsMonochromeImage returns True if the image is monochrome otherwise False is returned.

image

The address of a structure of type Image returned from ReadImage.

63.5  IsOpaqueImage

Method IsOpaqueImage returns False if the image has one or more pixels that are transparent otherwise True is returned.

unsigned int IsOpaqueImage (Image \*image)

status

Method IsOpaqueImage returns False if the image has one or more pixels that are transparent otherwise True is returned.

image

The address of a structure of type Image returned from ReadImage.

63.6  IsPseudoClass

Method IsPseudoClass returns True if the image is PseudoClass and has 256 unique colors or less. If the image is DirectClass and has 256 colors or less, the image is demoted to PseudoClass.

unsigned int IsPseudoClass (Image \*image)

status

Method IsPseudoClass returns True is the image is PseudoClass or has 256 color or less.

image

The address of a structure of type Image.

63.7  ListColors

Method ListColors reads the X client color database and returns a list of colors contained in the database sorted in ascending alphabetic order.

filelist=ListColors (pattern, number_colors)

filelist

Method ListColors returns a list of colors contained in the database. If the database cannot be read, a NULL list is returned.

pattern

Specifies a pointer to a text string containing a pattern.

number_colors

This integer returns the number of colors in the list.

63.8  QueryColorDatabase

Method QueryColorDatabase looks up a RGB values for a color given in the target string.

unsigned int QueryColorDatabase (const char \*target, PixelPacket \*color)

status

Method QueryColorDatabase returns True if the RGB values of the target color is defined, otherwise False is returned.

target

Specifies the color to lookup in the X color database.

color

A pointer to an PixelPacket structure. The RGB value of the target color is returned as this value.

63.9  QueryColorName

Method QueryColorName returns the name of the color that is closest to the supplied color in RGB space.

unsigned int QueryColorName (const PixelPacket \*color, char \*name)

distance

Method QueryColorName returns the distance-squared in RGB space as well as the color name that is at a minimum distance.

color

This is a pointer to a PixelPacket structure that contains the color we are searching for.

name

The name of the color that is closest to the supplied color is returned in this character buffer.

64  ImageMagick Image Decoration Methods

64.1  BorderImage

Method BorderImage takes an image and puts a border around it of a particular color. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.

Image \*BorderImage (const Image \*image, const RectangleInfo \*border_info, ExceptionInfo \*exception)

border_image

Method BorderImage returns a pointer to the border image. A null image is returned if there is a memory shortage.

image

The address of a structure of type Image.

border_info

Specifies a pointer to a structure of type Rectangle which defines the border region.

exception

return any errors or warnings in this structure.

64.2  FrameImage

Method FrameImage takes an image and puts a frame around it of a particular color. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.

Image \*FrameImage (Image \*image, const FrameInfo \*frame_info, ExceptionInfo \*exception)

frame_image

Method FrameImage returns a pointer to the framed image. A null image is returned if there is a memory shortage.

image

The address of a structure of type Image.

frame_info

Specifies a pointer to a FrameInfo structure which defines the framed region.

exception

return any errors or warnings in this structure.

64.3  RaiseImage

Method RaiseImage lightens and darkens the edges of an image to give a 3-D raised or lower effect.

unsigned int RaiseImage (Image \*image, const RectangleInfo \*raise_info, const int raised)

image

The address of a structure of type Image.

raise_info

Specifies a pointer to a XRectangle which defines the raised region.

raised

A value other than zero causes the image to have a 3-D raised effect, otherwise it has a lowered effect.

65  Methods to Create a Montage.

65.1  CloneMontageInfo

Method CloneMontageInfo makes a duplicate of the given montage info, or if montage info is NULL, a new one.

MontageInfo \*CloneMontageInfo (const ImageInfo \*image_info, const MontageInfo \*montage_info)

clone_info

Method CloneMontageInfo returns a duplicate of the given annotate info, or if annotate info is NULL a new one.

image_info

a structure of type ImageInfo.

montage_info

a structure of type MontageInfo.

65.2  DestroyMontageInfo

Method DestroyMontageInfo deallocates memory associated with an MontageInfo structure.

void DestroyMontageInfo (MontageInfo \*montage_info)

montage_info

Specifies a pointer to an MontageInfo structure.

65.3  GetMontageInfo

Method GetMontageInfo initializes the MontageInfo structure.

void GetMontageInfo (const ImageInfo \*image_info, MontageInfo \*montage_info)

image_info

a structure of type ImageInfo.

montage_info

Specifies a pointer to a MontageInfo structure.

65.4  MontageImages

Method MontageImages creates a composite image by combining several separate images.

Image \*MontageImages (Image \*image, const MontageInfo \*montage_info, ExceptionInfo \*exception)

image

Specifies a pointer to an array of Image structures.

montage_info

Specifies a pointer to a MontageInfo structure.

exception

return any errors or warnings in this structure.

66  ImageMagick Image Effects Methods

66.1  AddNoiseImage

Method AddNoiseImage creates a new image that is a copy of an existing one with noise added. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.

Image \*AddNoiseImage (Image \*image, const NoiseType noise_type, ExceptionInfo \*exception)

noise_image

Method AddNoiseImage returns a pointer to the image after the noise is minified. A null image is returned if there is a memory shortage.

image

The address of a structure of type Image returned from ReadImage.

noise_type

The type of noise: Gaussian, multiplicative Gaussian, impulse, laplacian, or Poisson.

exception

return any errors or warnings in this structure.

66.2  BlurImage

Method BlurImage creates a blurred copy of the input image. We convolve the image with a Gaussian operator of the given width and standard deviation (sigma).

Each output pixel is set to a value that is the weighted average of the input pixels in an area enclosing the pixel. The width parameter determines how large the area is. Each pixel in the area is weighted in the average according to its distance from the center, and the standard deviation, sigma. The actual weight is calculated according to the Gaussian distribution (also called normal distribution), which looks like a Bell Curve centered on a pixel. The standard deviation controls how 'pointy' the curve is. The pixels near the center of the curve (closer to the center of the area we are averaging) contribute more than the distant pixels.

In general, the width should be wide enough to include most of the total weight under the Gaussian for the standard deviation you choose. the width parameter to the method specifies the radius of the Gaussian convolution mask in pixels, not counting the centre pixel, the width parameter should be chosen larger than the standard deviation, perhaps about twice as large to three times as large. A width of 1 will give a (standard) 3x3 convolution mask, a width of 2 gives a 5 by 5 convolution mask. Using non-integral widths will result in some pixels being considered 'partial' pixels, in which case their weight will be reduced proportionally.

Pixels for which the convolution mask does not completely fit on the image (e.g. pixels without a full set of neighbours) are averaged with those neighbours they do have. Thus pixels at the edge of images are typically less blur.

Since a 2d Gaussian is seperable, we perform the Gaussian blur by convolving with two 1d Gaussians, first in the x, then in the y direction. For an n by n image and Gaussian width w this requires 22 multiplications, while convolving with a 2d Gaussian requres w2n2 mults.

We blur the image into a copy, and the original is left untouched. We must process the image in two passes, in each pass we change the pixel based on its neighbors, but we need the pixel's original value for the next pixel's calculation. For the first pass we could use the original image but that's no good for the second pass, and it would imply that the original image have to stay around in ram. Instead we use a small (size=width) buffer to store the pixels we have overwritten.

This method was contributed by runger@cs.mcgill.ca.

Image \*BlurImage (Image \*image, const double radius, const double sigma, ExceptionInfo \*exception)

blur_image

Method BlurImage returns a pointer to the image after it is blur. A null image is returned if there is a memory shortage.

radius

The radius of the Gaussian, in pixels, not counting the center pixel.

sigma

The standard deviation of the Gaussian, in pixels.

exception

return any errors or warnings in this structure.

66.3  ColorizeImage

Method ColorizeImage creates a new image that is a copy of an existing one with the image pixels colorized. The colorization is controlled with the pen color and the opacity levels.

Image \*ColorizeImage (Image \*image, const char \*opacity, const PixelPacket target, ExceptionInfo \*exception)

image

The address of a structure of type Image returned from ReadImage.

opacity

A character string indicating the level of opacity as a percentage (0-0.5).

target

A color value.

exception

return any errors or warnings in this structure.

66.4  ConvolveImage

Method ConvolveImage applies a general image convolution kernel to an image returns the results. ConvolveImage allocates the memory necessary for the new Image structure and returns a pointer to the new image.

Image \*ConvolveImage (Image \*image, const unsigned int order, const double \*kernel, ExceptionInfo \*exception)

convolve_image

Method ConvolveImage returns a pointer to the image after it is convolved. A null image is returned if there is a memory shortage.

image

The address of a structure of type Image returned from ReadImage.

order

The number of columns and rows in the filter kernel.

kernel

An array of double representing the convolution kernel.

exception

return any errors or warnings in this structure.

66.5  DespeckleImage

Method DespeckleImage creates a new image that is a copy of an existing one with the speckle noise minified. It uses the eight hull algorithm described in Applied Optics, Vol. 24, No. 10, 15 May 1985, "Geometric filter for Speckle Reduction", by Thomas R Crimmins. Each pixel in the image is replaced by one of its eight of its surrounding pixels using a polarity and negative hull function. DespeckleImage allocates the memory necessary for the new Image structure and returns a pointer to the new image.

Image \*DespeckleImage (Image \*image, ExceptionInfo \*exception)

despeckle_image

Method DespeckleImage returns a pointer to the image after it is despeckled. A null image is returned if there is a memory shortage.

image

The address of a structure of type Image returned from ReadImage.

exception

return any errors or warnings in this structure.

66.6  EdgeImage

Method EdgeImage creates a new image that is a copy of an existing one with the edges enhanced. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.

Image \*EdgeImage (Image \*image, const double radius, ExceptionInfo \*exception)

edge_image

Method EdgeImage returns a pointer to the image after it is edge. A null image is returned if there is a memory shortage.

image

the address of a structure of type Image returned from ReadImage.

radius

the radius of the pixel neighborhood.

exception

return any errors or warnings in this structure.

66.7  EmbossImage

Method EmbossImage creates a new image that is a copy of an existing one with the edge highlighted. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.

Image \*EmbossImage (Image \*image, const double radius, const double sigma, ExceptionInfo \*exception)

emboss_image

Method EmbossImage returns a pointer to the image after it is embossed. A null image is returned if there is a memory shortage.

image

The address of a structure of type Image returned from ReadImage.

radius

the radius of the pixel neighborhood.

sigma

The standard deviation of the Gaussian, in pixels.

exception

return any errors or warnings in this structure.

66.8  EnhanceImage

Method EnhanceImage creates a new image that is a copy of an existing one with the noise minified. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.

EnhanceImage does a weighted average of pixels in a 5x5 cell around each target pixel. Only pixels in the 5x5 cell that are within a RGB distance threshold of the target pixel are averaged.

Weights assume that the importance of neighboring pixels is negately proportional to the square of their distance from the target pixel.

The scan only processes pixels that have a full set of neighbors. Pixels in the top, bottom, left, and right pairs of rows and columns are omitted from the scan.

Image \*EnhanceImage (Image \*image, ExceptionInfo \*exception)

enhance_image

Method EnhanceImage returns a pointer to the image after it is enhanced. A null image is returned if there is a memory shortage.

image

The address of a structure of type Image returned from ReadImage.

exception

return any errors or warnings in this structure.

66.9  GaussianBlurImage

Method GaussianBlurImage creates a new image that is a copy of an existing one with the pixels blur. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.

Image \*GaussianBlurImage (Image \*image, const double radius, const double sigma, ExceptionInfo \*exception)

blur_image

Method GaussianBlurImage returns a pointer to the image after it is blur. A null image is returned if there is a memory shortage.

radius

the radius of the Gaussian, in pixels, not counting the center pixel.

sigma

the standard deviation of the Gaussian, in pixels.

exception

return any errors or warnings in this structure.

66.10  ImplodeImage

Method ImplodeImage creates a new image that is a copy of an existing one with the image pixels ïmplode" by the specified percentage. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.

Image \*ImplodeImage (Image \*image, const double factor, ExceptionInfo \*exception)

implode_image

Method ImplodeImage returns a pointer to the image after it is implode. A null image is returned if there is a memory shortage.

image

The address of a structure of type Image returned from ReadImage.

factor

A double value that defines the extent of the implosion.

exception

return any errors or warnings in this structure.

66.11  MedianFilterImage

Method MedianFilterImage creates a new image that is a copy of an existing one with each pixel component replaced with the median color in a pixel neighborhood.

Image \*MedianFilterImage (Image \*image, const double radius, ExceptionInfo \*exception)

median_image

Method MedianFilterImage returns a pointer to the image after it is `filtered'. A null image is returned if there is a memory shortage.

image

the address of a structure of type Image returned from ReadImage.

radius

the radius of the pixel neighborhood.

exception

return any errors or warnings in this structure.

66.12  MorphImages

Method MorphImages morphs a sequence of images. Both the next pixels and size are linearly interpolated to give the appearance of a meta-morphosis from one next to the next.

Image \*MorphImages (Image \*image, const unsigned int number_frames, ExceptionInfo \*exception)

morph_images

Method MorphImages returns an next sequence that has linearly interpolated pixels and size between two input image.

image

The address of a structure of type Image returned from ReadImage.

number_frames

This unsigned integer reflects the number of in-between image to generate. The more in-between frames, the smoother the morph.

exception

return any errors or warnings in this structure.

66.13  OilPaintImage

Method OilPaintImage creates a new image that is a copy of an existing one with each pixel component replaced with the color of greatest frequency in a circular neighborhood.

Image \*OilPaintImage (Image \*image, const double radius, ExceptionInfo \*exception)

paint_image

Method OilPaintImage returns a pointer to the image after it is `painted'. A null image is returned if there is a memory shortage.

image

The address of a structure of type Image returned from ReadImage.

radius

The radius of the circular neighborhood.

exception

return any errors or warnings in this structure.

66.14  PlasmaImage

Method PlasmaImage initializes an image with plasma fractal values. The image must be initialized with a base color and the random number generator seeded before this method is called.

unsigned int PlasmaImage (Image \*image, const SegmentInfo \*segment, int attenuate, int depth)

status

Method PlasmaImage returns True when the fractal process is complete. Otherwise False is returned.

image

The address of a structure of type Image returned from ReadImage.

segment

specifies a structure of type SegmentInfo that defines the boundaries of the area where the plasma fractals are applied.

attenuate

specifies the plasma attenuation factor.

depth

this integer values define the plasma recursion depth.

66.15  ReduceNoiseImage

Method ReduceNoiseImage creates a new image that is a copy of an existing one with the noise minified with a noise peak elimination filter. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.

The principal function of noise peak elimination filter is to smooth the objects within an image without losing edge information and without creating undesired structures. The central idea of the algorithm is to replace a pixel with its next neighbor in value within a window, if this pixel has been found to be noise. A pixel is defined as noise if and only if this pixel is a maximum or minimum within the window.

Image \*ReduceNoiseImage (Image \*image, const double, ExceptionInfo \*exception)

noise_image

Method ReduceNoiseImage returns a pointer to the image after the noise is minified. A null image is returned if there is a memory shortage.

image

the address of a structure of type Image returned from ReadImage.

radius

the radius of the pixel neighborhood.

exception

return any errors or warnings in this structure.

66.16  ShadeImage

Method ShadeImage creates a new image that is a copy of an existing one with the image pixels shaded using a distance light source. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.

Image \*ShadeImage (Image \*image, const unsigned int color_shading, double azimuth, double elevation, ExceptionInfo \*exception)

shade_image

Method ShadeImage returns a pointer to the image after it is shaded. A null image is returned if there is a memory shortage.

image

The address of a structure of type Image returned from ReadImage.

color_shading

A value other than zero shades the red, green, and blue components of the image.

azimuth, elevation

A double value that indicates the light source direction.

exception

return any errors or warnings in this structure.

66.17  SharpenImage

Method SharpenImage creates a new image that is sharpened version of the original image using a Laplacian convolution kernel.

Image \*SharpenImage (Image \*image, const double radius, const double sigma, ExceptionInfo \*exception)

sharp_image

Method SharpenImage returns a pointer to the image after it is sharp. A null image is returned if there is a memory shortage.

radius

The radius of the Gaussian, in pixels, not counting the center pixel.

sigma

The standard deviation of the Laplacian, in pixels.

exception

return any errors or warnings in this structure.

66.18  SolarizeImage

Method SolarizeImage produces a 'solarization' effect seen when exposing a photographic film to light during the development process.

void SolarizeImage (Image \*image, const double factor)

image

The address of a structure of type Image returned from ReadImage.

factor

An double value that defines the extent of the solarization.

66.19  SpreadImage

Method SpreadImage creates a new image that is a copy of an existing one with the image pixels randomly displaced. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.

Image \*SpreadImage (Image \*image, const unsigned int amount, ExceptionInfo \*exception)

spread_image

Method SpreadImage returns a pointer to the image after it is spread. A null image is returned if there is a memory shortage.

image

The address of a structure of type Image returned from ReadImage.

amount

An unsigned value constraining the "vicinity" for choosing a random pixel to swap.

exception

return any errors or warnings in this structure.

66.20  SteganoImage

Method SteganoImage hides a digital watermark within the image.

Image \*SteganoImage (Image \*image, Image \*watermark, ExceptionInfo \*exception)

stegano_image

Method SteganoImage returns a pointer to the steganographic image with the watermark hidden. A null image is returned if there is a memory shortage.

image

The address of a structure of type Image.

watermark

The address of a structure of type Image.

exception

return any errors or warnings in this structure.

66.21  StereoImage

Method StereoImage combines two images and produces a single image that is the composite of a left and right image of a stereo pair. The left image is converted to gray scale and written to the red channel of the stereo image. The right image is converted to gray scale and written to the blue channel of the stereo image. View the composite image with red-blue glasses to create a stereo effect.

Image \*StereoImage (Image \*image, Image \*offset_image, ExceptionInfo \*exception)

stereo_image

Method StereoImage returns a pointer to the stereo image. A null image is returned if there is a memory shortage.

image

The address of a structure of type Image.

offset_image

The address of a structure of type Image.

exception

return any errors or warnings in this structure.

66.22  SwirlImage

Method SwirlImage creates a new image that is a copy of an existing one with the image pixels ßwirl" at a specified angle. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.

Image \*SwirlImage (Image \*image, double degrees, ExceptionInfo \*exception)

swirl_image

Method SwirlImage returns a pointer to the image after it is swirl. A null image is returned if there is a memory shortage.

image

The address of a structure of type Image returned from ReadImage.

degrees

An double value that defines the tightness of the swirling.

exception

return any errors or warnings in this structure.

66.23  ThresholdImage

Method ThresholdImage thresholds the reference image.

unsigned int ThresholdImage (Image \*image, const double threshold)

image

The address of a structure of type Image returned from ReadImage.

threshold

A double indicating the threshold value.

66.24  UnsharpMaskImage

Method UnsharpMaskImage creates a new image that is sharpened version of the original image using the unsharp mask algorithm.

Image \*UnsharpMaskImage (Image \*image, const double radius, const double sigma, const double amount, const double threshold, ExceptionInfo \*exception)

unsharp_image

Method UnsharpMaskImage returns a pointer to the image after it is blur. A null image is returned if there is a memory shortage.

radius

The radius of the Gaussian, in pixels, not counting the center pixel.

sigma

The standard deviation of the Gaussian, in pixels.

amount

The percentage of the difference between the original and the blur image that is added back into the original.

threshold

The threshold in pixels needed to apply the diffence amount.

exception

return any errors or warnings in this structure.

66.25  WaveImage

Method WaveImage creates a new image that is a copy of an existing one with the image pixels altered along a sine wave. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.

Image \*WaveImage (Image \*image, const double amplitude, const double wave_length, ExceptionInfo \*exception)

wave_image

Method WaveImage returns a pointer to the image after it is waved. A null image is returned if there is a memory shortage.

image

The address of a structure of type Image returned from ReadImage.

amplitude, frequency

A double value that indicates the amplitude and wave_length of the sine wave.

exception

return any errors or warnings in this structure.

67  Methods to Enhance an Image

67.1  ContrastImage

Method ContrastImage enhances the intensity differences between the lighter and darker elements of the image.

unsigned int ContrastImage (Image \*image, const unsigned int sharpen)

image

The address of a structure of type Image returned from ReadImage.

sharpen

If True, the intensity is increased otherwise it is decreased.

67.2  EqualizeImage

Method EqualizeImage performs histogram equalization on the reference image.

unsigned int EqualizeImage (Image \*image)

image

The address of a structure of type Image returned from ReadImage.

67.3  GammaImage

Method GammaImage converts the reference image to gamma corrected colors.

unsigned int GammaImage (Image \*image, const char \*gamma)

image

The address of a structure of type Image returned from ReadImage.

gamma

A character string indicating the level of gamma correction.

67.4  ModulateImage

Method ModulateImage modulates the hue, saturation, and brightness of an image.

unsigned int ModulateImage (Image \*image, const char \*modulate)

image

The address of a structure of type Image returned from ReadImage.

modulate

A character string indicating the percent change in brightness, saturation, and hue in floating point notation separated by commas (e.g. 110.1, 100.0, 83.1).

67.5  MotionBlurImage

Method MotionBlurImage creates a new image that is a copy of an existing one with the pixels blur. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.

Image \*MotionBlurImage (Image \*image, const double radius, const double sigma, ExceptionInfo \*exception)

blur_image

Method MotionBlurImage returns a pointer to the image after it is blur. A null image is returned if there is a memory shortage.

radius

the radius of the Motion, in pixels, not counting the center pixel.

sigma

the standard deviation of the Motion, in pixels.

exception

return any errors or warnings in this structure.

67.6  NegateImage

Method NegateImage negates the colors in the reference image. The Grayscale option means that only grayscale values within the image are negated.

unsigned int NegateImage (Image \*image, const unsigned int grayscale)

image

The address of a structure of type Image returned from ReadImage.

67.7  NormalizeImage

Method NormalizeImage normalizes the pixel values to span the full range of color values. This is a contrast enhancement technique.

unsigned int NormalizeImage (Image \*image)

image

The address of a structure of type Image returned from ReadImage.

68  Methods to Reduce the Number of Unique Colors in an Image

68.1  CloneQuantizeInfo

Method CloneQuantizeInfo makes a duplicate of the given quantize info structure, or if quantize info is NULL, a new one.

QuantizeInfo \*CloneQuantizeInfo (const QuantizeInfo \*quantize_info)

clone_info

Method CloneQuantizeInfo returns a duplicate of the given quantize info, or if image info is NULL a new one.

quantize_info

a structure of type info.

68.2  DestroyQuantizeInfo

Method DestroyQuantizeInfo deallocates memory associated with an QuantizeInfo structure.

DestroyQuantizeInfo (QuantizeInfo \*quantize_info)

quantize_info

Specifies a pointer to an QuantizeInfo structure.

68.3  GetQuantizeInfo

Method GetQuantizeInfo initializes the QuantizeInfo structure.

GetQuantizeInfo (QuantizeInfo \*quantize_info)

quantize_info

Specifies a pointer to a QuantizeInfo structure.

68.4  MapImage

MapImage replaces the colors of an image with the closest color from a reference image.

unsigned int MapImage (Image \*image, Image \*map_image, const unsigned int dither)

image

Specifies a pointer to an Image structure.

map_image

Specifies a pointer to a Image structure. Reduce image to a set of colors represented by this image.

dither

Set this integer value to something other than zero to dither the quantized image.

68.5  MapImages

MapImages replaces the colors of a sequence of images with the closest color from a reference image.

unsigned int MapImages (Image \*images, Image \*map_image, const unsigned int dither)

image

Specifies a pointer to a set of Image structures.

map_image

Specifies a pointer to a Image structure. Reduce image to a set of colors represented by this image.

dither

Set this integer value to something other than zero to dither the quantized image.

68.6  QuantizationError

Method QuantizationError measures the difference between the original and quantized images. This difference is the total quantization error. The error is computed by summing over all pixels in an image the distance squared in RGB space between each reference pixel value and its quantized value. These values are computed:

mean_error_per_pixel

This value is the mean error for any single pixel in the image.

normalized_mean_square_error

This value is the normalized mean quantization error for any single pixel in the image. This distance measure is normalized to a range between 0 and 1. It is independent of the range of red, green, and blue values in the image.

normalized_maximum_square_error

Thsi value is the normalized maximum quantization error for any single pixel in the image. This distance measure is normalized to a range between 0 and 1. It is independent of the range of red, green, and blue values in your image.

unsigned int QuantizationError (Image \*image)

image

Specifies a pointer to an Image structure returned from ReadImage.

68.7  QuantizeImage

Method QuantizeImage analyzes the colors within a reference image and chooses a fixed number of colors to represent the image. The goal of the algorithm is to minimize the difference between the input and output image while minimizing the processing time.

unsigned int QuantizeImage (const QuantizeInfo \*quantize_info, Image \*image)

quantize_info

Specifies a pointer to an QuantizeInfo structure.

image

Specifies a pointer to a Image structure.

68.8  QuantizeImages

QuantizeImages analyzes the colors within a set of reference images and chooses a fixed number of colors to represent the set. The goal of the algorithm is to minimize the difference between the input and output images while minimizing the processing time.

unsigned int QuantizeImages (const QuantizeInfo \*quantize_info, Image \*images)

quantize_info

Specifies a pointer to an QuantizeInfo structure.

images

Specifies a pointer to a list of Image structures.

69  Methods to Segment an Image with Thresholding Fuzzy c-Means

69.1  SegmentImage

Method SegmentImage segment an image by analyzing the histograms of the color components and identifying units that are homogeneous with the fuzzy c-means technique.

Specify cluster threshold as the number of pixels in each cluster must exceed the the cluster threshold to be considered valid. Smoothing threshold eliminates noise in the second derivative of the histogram. As the value is increased, you can expect a smoother second derivative. The default is 1.5.

unsigned int SegmentImage (Image \*image, const ColorspaceType colorspace, const unsigned int verbose, const double cluster_threshold, const double smoothing_threshold)

colors

The SegmentImage function returns this integer value. It is the actual number of colors allocated in the colormap.

image

Specifies a pointer to an Image structure returned from ReadImage.

colorspace

An unsigned integer value that indicates the colorspace. Empirical evidence suggests that distances in YUV or YIQ correspond to perceptual color differences more closely than do distances in RGB space. The image is then returned to RGB colorspace after color reduction.

verbose

A value greater than zero prints detailed information about the identified classes.

70  Methods to Shear or Rotate an Image by an Arbitrary Angle

70.1  RotateImage

Method RotateImage creates a new image that is a rotated copy of an existing one. Positive angles rotate counter-clockwise (right-hand rule), while negative angles rotate clockwise. Rotated images are usually larger than the originals and have 'empty' triangular corners. X axis. Empty triangles left over from shearing the image are filled with the color defined by the pixel at location (0, 0). RotateImage allocates the memory necessary for the new Image structure and returns a pointer to the new image.

Method RotateImage is based on the paper Ä Fast Algorithm for General Raster Rotatation" by Alan W. Paeth. RotateImage is adapted from a similar method based on the Paeth paper written by Michael Halle of the Spatial Imaging Group, MIT Media Lab.

Image \*RotateImage (Image \*image, const double degrees, ExceptionInfo \*exception)

status

Method RotateImage returns a pointer to the image after rotating. A null image is returned if there is a memory shortage.

image

The address of a structure of type Image returned from ReadImage.

degrees

Specifies the number of degrees to rotate the image.

exception

return any errors or warnings in this structure.

70.2  ShearImage

Method ShearImage creates a new image that is a shear_image copy of an existing one. Shearing slides one edge of an image along the X or Y axis, creating a parallelogram. An X direction shear slides an edge along the X axis, while a Y direction shear slides an edge along the Y axis. The amount of the shear is controlled by a shear angle. For X direction shears, x_shear is measured relative to the Y axis, and similarly, for Y direction shears y_shear is measured relative to the X axis. Empty triangles left over from shearing the image are filled with the color defined by the pixel at location (0, 0). ShearImage allocates the memory necessary for the new Image structure and returns a pointer to the new image.

Method ShearImage is based on the paper Ä Fast Algorithm for General Raster Rotatation" by Alan W. Paeth.

Image \*ShearImage (Image \*image, const double x_shear, const double y_shear, ExceptionInfo \*exception)

status

Method ShearImage returns a pointer to the image after rotating. A null image is returned if there is a memory shortage.

image

The address of a structure of type Image returned from ReadImage.

x_shear, y_shear

Specifies the number of degrees to shear the image.

exception

return any errors or warnings in this structure.

71  Methods to Compute a Digital Signature for an Image

71.1  SignatureImage

Method SignatureImage computes a digital signature from an image. This signature uniquely identifies the image and is convenient for determining if the colormap of a sequence of images is identical when animating. The digital signature is from RSA Data Security MD5 Digest Algorithm described in Internet draft [MD5], July 1992, computed on the pixels after expanding them to 64-bit RGBA representation, with the two bytes of each 16-bit sample ordered most significant byte first. The signature is in RGBA or CMYK order depending on the colorspace of the image. If the image does not have any alpha information, an opaque value (65535) is used.

unsigned int SignatureImage (Image \*image)

image

The address of a structure of type Image.

72  Image Pixel FIFO

72.1  ReadStream

Method ReadStream makes the image pixels available to a user supplied callback method immediately upon reading a scanline with the ReadImage() method.

unsigned int ReadStream (const ImageInfo \*image_info, void (\*Stream) (const Image \*, const void \*, const size_t), ExceptionInfo \*exception)

status

Method ReadStream returns True if the image pixels are streamed to the user supplied callback method otherwise False.

image_info

Specifies a pointer to an ImageInfo structure.

stream

a callback method.

exception

return any errors or warnings in this structure.

72.2  WriteStream

Method WriteStream makes the image pixels available to a user supplied callback method immediately upon writing pixel data with the WriteImage() method.

unsigned int WriteStream (const ImageInfo \*image_info, Image \*, int (\*Stream) (const Image \*, const void \*, const size_t))

status

Method WriteStream returns True if the image pixels are streamed to the user supplied callback method otherwise False.

image_info

Specifies a pointer to an ImageInfo structure.

stream

a callback method.

73  Image Text Attributes Methods

73.1  DestroyImageAttributes

Method DestroyImageAttributes deallocates memory associated with the image attribute list.

DestroyImageAttributes (Image \*image)

image

The address of a structure of type Image.

73.2  GetImageAttribute

Method GetImageAttribute searches the list of image attributes and returns a pointer to attribute if it exists otherwise NULL.

ImageAttribute \*GetImageAttribute (const Image \*image, const char \*key)

attribute

Method GetImageAttribute returns the attribute if it exists otherwise NULL.

image

The address of a structure of type Image.

key

These character strings are the name of an image attribute to return.

73.3  GetImageInfoAttribute

Method GetImageInfoAttribute returns a "fake" attribute based on data in the image info or image structures.

ImageAttribute \*GetImageAttribute(const Image \*image, const char \*key)

attribute

Method GetImageInfoAttribute returns the attribute if it exists otherwise NULL.

image_info

The address of a structure of type ImageInfo.

image

The address of a structure of type Image.

key

These character strings are the name of an image attribute to return.

73.4  SetImageAttribute

Method SetImageAttribute searches the list of image attributes and replaces the attribute value. If it is not found in the list, the attribute name and value is added to the list. If the attribute exists in the list, the value is concatenated to the attribute. SetImageAttribute returns True if the attribute is successfully concatenated or added to the list, otherwise False. If the value is NULL, the matching key is deleted from the list.

unsigned int SetImageAttribute (Image \*image, const char \*key, const char \*value)

status

Method SetImageAttribute returns True if the attribute is successfully replaced or added to the list, otherwise False.

image

The address of a structure of type Image.

key, value

These character strings are the name and value of an image attribute to replace or add to the list.

73.5  StoreImageAttribute

Method StoreImageAttribute is used to store an image attribute from a text string with the syntax: NAME=VALUE.

StoreImageAttribute (Image \*image, char \*text)

image

The address of a structure of type Image.

text

The text string that is parsed and used to determine the name and value of the new attribute.

74  Methods to Get or Set Image Pixels

74.1  ClosePixelCache

Method ClosePixelCache closes the pixel cache. Use this method to prevent the too many file descriptors from being allocated when reading an image sequence. File descriptors are only used for a disk-based cache. This is essentially a no-op for a memory-based cache.

void ClosePixelCache (Image \*image)

image

The address of a structure of type Image.

74.2  DestroyPixelCache

Method DestroyPixelCache deallocates memory associated with the pixel cache.

void DestroyPixelCache (Image \*image)

image

The address of a structure of type Image.

74.3  GetIndexesFromCache

Method GetIndexesFromCache returns the colormap indexes associated with the last call to the SetPixelCache() or GetPixelCache() methods.

IndexPacket \*GetIndexesFromCache (const Image \*image)

indexes

Method GetIndexesFromCache returns the colormap indexes associated with the last call to the SetPixelCache() or GetPixelCache() methods.

image

The address of a structure of type Image.

74.4  GetOnePixelFromCache

Method GetOnePixelFromCache returns a single pixel at the specified (x, y) location. The image background color is returned if an error occurs.

PixelPacket \*GetOnePixelFromCache (const Image image, const int x, const int y)

pixels

Method GetOnePixelFromCache returns a pixel at the specified (x, y) location.

image

The address of a structure of type Image.

x, y

These values define the location of the pixel to return.

74.5  GetPixelCache

Method GetPixelCache gets pixels from the in-memory or disk pixel cache as defined by the geometry parameters. A pointer to the pixels is returned if the pixels are transferred, otherwise a NULL is returned.

PixelPacket \*GetPixelCache (Image \*image, const int x, const int y, const unsigned int columns, const unsigned int rows)

status

Method GetPixelCache returns a pointer to the pixels is returned if the pixels are transferred, otherwise a NULL is returned.

image

The address of a structure of type Image.

x, y, columns, rows

These values define the perimeter of a region of pixels.

74.6  GetPixelsFromCache

Method GetPixelsFromCache returns the pixels associated with the last call to the SetPixelCache() or GetPixelCache() methods.

PixelPacket \*GetPixelsFromCache (const Image image)

pixels

Method GetPixelsFromCache returns the pixels associated with the last call to the SetPixelCache() or GetPixelCache() methods.

image

The address of a structure of type Image.

74.7  SetPixelCache

Method SetPixelCache allocates an area to store image pixels as defined by the region rectangle and returns a pointer to the area. This area is subsequently transferred from the pixel cache with method SyncPixelCache. A pointer to the pixels is returned if the pixels are transferred, otherwise a NULL is returned.

PixelPacket \*SetPixelCache (Image \*image, const int x, const int y, const unsigned int columns, const unsigned int rows)

pixels

Method SetPixelCache returns a pointer to the pixels is returned if the pixels are transferred, otherwise a NULL is returned.

image

The address of a structure of type Image.

x, y, columns, rows

These values define the perimeter of a region of pixels.

74.8  SyncPixelCache

Method SyncPixelCache saves the image pixels to the in-memory or disk cache. The method returns True if the pixel region is synced, otherwise False.

unsigned int SyncPixelCache (Image \*image)

status

Method SyncPixelCache returns True if the image pixels are transferred to the in-memory or disk cache otherwise False.

image

The address of a structure of type Image.

74.9  WriteCacheInfo

Method WriteCacheInfo writes the persistent cache meta information to a file on disk.

unsigned int WriteCacheInfo (Image \*image)

status

Method WriteCacheInfo returns True if the cache meta information is written to the specified file, otherwise False.

image

The address of a structure of type Image.

75  Methods to Read or Write Binary Large Objects

75.1  BlobToImage

Method BlobToImage implements direct to memory image formats. It returns the blob as an image.

Image \*BlobToImage (const ImageInfo \*image_info, const void \*blob, const size_t length, ExceptionInfo \*exception)

image

Method BlobToImage returns an image from the supplied blob. If an error occurs NULL is returned.

image_info

Specifies a pointer to an ImageInfo structure.

blob

The address of a character stream in one of the image formats understood by ImageMagick.

length

This size_t integer reflects the length in bytes of the blob.

exception

return any errors or warnings in this structure.

75.2  DestroyBlobInfo

Method DestroyBlobInfo deallocates memory associated with an BlobInfo structure.

void DestroyBlobInfo (BlobInfo \*blob)

blob

Specifies a pointer to a BlobInfo structure.

75.3  GetBlobInfo

Method GetBlobInfo initializes the BlobInfo structure.

void GetBlobInfo (BlobInfo \*blob)

blob

Specifies a pointer to a BlobInfo structure.

75.4  ImageToBlob

Method ImageToBlob implements direct to memory image formats. It returns the image as a blob and its length. The magick member of the Image structure determines the format of the returned blob (GIG, JPEG, PNG, etc.).

void \*ImageToBlob (const ImageInfo \*image_info, Image \*image, size_t \*length, ExceptionInfo \*exception)

blob

Method ImageToBlob returns a chunk of memory written in the desired image format (e.g. JPEG, GIF, etc.). If an error occurs NULL is returned.

image_info

Specifies a pointer to an ImageInfo structure.

image

The address of a structure of type Image.

length

This pointer to a size_t integer sets the initial length of the blob. On return, it reflects the actual length of the blob.

exception

return any errors or warnings in this structure.

75.5  SetBlobQuantum

Method SetBlobQuantum set the current value of the blob quantum. This is the size in bytes to add to a blob when writing to a blob exceeds its current length.

void SetBlobQuantum (BlobInfo \*blob, const size_t quantum)

blob

A pointer to a BlobInfo structure.

quantum

A size_t that reflects the number of bytes to increase a blob.

76  Methods to Read or List ImageMagick Image formats

76.1  DestroyMagickInfo

Method DestroyMagickInfo deallocates memory associated MagickInfo list.

void DestroyMagickInfo (void)

76.2  GetImageMagick

Method GetImageMagick searches for an image format that matches the specified magick string. If one is found the tag is returned otherwise NULL.

char \*GetImageMagick (const unsigned char \*magick, const unsigned int length)

tag

Method GetImageMagick returns a tag that matches the specified magick string.

magick

a character string that represents the image format we are looking for.

length

The length of the binary string.

76.3  GetMagickConfigurePath

Method GetMagickConfigurePath searches a number of pre-defined locations for the specified ImageMagick configuration file and returns the path. The search order follows:

MagickModulesPath HOME/.magick/ MAGICK_HOME/ <program directory>/ MagickLibPath MagickSharePath X11ConfigurePath

char \*GetMagickConfigurePath (const char \*filename)

path

Method GetMagickConfigurePath returns the path if the configuration file is found, otherwise NULL is returned.

filename

A character string representing the desired configuration file.

76.4  GetMagickInfo

Method GetMagickInfo returns a pointer MagickInfo structure that matches the specified tag. If tag is NULL, the head of the image format list is returned.

MagickInfo \*GetMagickInfo (const char \*tag)

magick_info

Method GetMagickInfo returns a pointer MagickInfo structure that matches the specified tag.

tag

a character string that represents the image format we are looking for.

76.5  GetMagickVersion

Method GetMagickVersion returns the ImageMagick API version as a string and as a number.

char \*GetMagickVersion (unsigned int \*version)

string

Method GetMagickVersion returns the ImageMagick version string.

version

The ImageMagick version is returned as a number.

76.6  ListMagickInfo

Method ListMagickInfo lists the image formats to a file.

void ListMagickInfo (FILE \*file)

file

A pointer to a FILE structure.

76.7  MagickIncarnate

Method MagickIncarnate initializes the ImageMagick environment.

MagickIncarnate (const char \*path)

path

Specifies a pointer to the execution path of the current ImageMagick client.

76.8  RegisterMagickInfo

Method RegisterMagickInfo adds attributes for a particular image format to the list of supported formats. The attributes include the image format tag, a method to read and/or write the format, whether the format supports the saving of more than one frame to the same file or blob, whether the format supports native in-memory I/O, and a brief description of the format.

MagickInfo \*RegisterMagickInfo (MagickInfo \*entry)

magick_info

Method RegisterMagickInfo returns a pointer MagickInfo structure that contains the specified tag info.

entry

A pointer to a structure of type MagickInfo.

76.9  SetMagickInfo

Method SetMagickInfo allocates a MagickInfo structure and initializes the members to default values.

MagickInfo \*SetMagickInfo (const char \*tag)

magick_info

Method SetMagickInfo returns the allocated and initialized MagickInfo structure.

tag

a character string that represents the image format associated with the MagickInfo structure.

76.10  UnregisterMagickInfo

Method UnregisterMagickInfo removes a tag from the magick info list. It returns False if the tag does not exist in the list otherwise True.

unsigned int UnregisterMagickInfo (const char \*tag)

status

Method UnregisterMagickInfo returns False if the tag does not exist in the list otherwise True.

tag

a character string that represents the image format we are looking for.

77  ImageMagick Error Methods

77.1  CatchImageException

Method CatchImageException returns if no exceptions are found in the image sequence, otherwise it determines the most severe exception and reports it as a warning or error depending on the severity.

CatchImageException (Image \*image)

image

Specifies a pointer to a list of one or more images.

77.2  DestroyExceptionInfo

Method DestroyExceptionInfo deallocates memory associated with an ExceptionInfo structure.

void DestroyExceptionInfo (ExceptionInfo \*exception)

exception

Specifies a pointer to an ExceptionInfo structure.

77.3  GetExceptionInfo

Method GetExceptionInfo initializes the ExceptionInfo structure.

GetExceptionInfo (ExceptionInfo \*exception)

error_info

Specifies a pointer to a ExceptionInfo structure.

77.4  GetImageException

Method GetImageException traverses an image sequence and returns any error more severe than noted by the exception parameter.

GetImageException (Image \*image, ExceptionInfo \*exception)

image

Specifies a pointer to a list of one or more images.

exception

return the highest severity exception.

77.5  MagickError

Method MagickError calls the error handler methods with an error reason.

void MagickError (const ExceptionType error, const char \*reason, const char \*description)

exception

Specifies the numeric error category.

reason

Specifies the reason to display before terminating the program.

description

Specifies any description to the reason.

77.6  MagickWarning

Method MagickWarning calls the warning handler methods with a warning reason.

void MagickWarning (const ExceptionType warning, const char \*reason, const char \*description)

warning

Specifies the numeric warning category.

reason

Specifies the reason to display before terminating the program.

description

Specifies any description to the reason.

77.7  SetErrorHandler

Method SetErrorHandler sets the error handler to the specified method and returns the previous error handler.

ErrorHandler SetErrorHandler (ErrorHandler handler)

handler

Specifies a pointer to a method to handle errors.

77.8  SetWarningHandler

Method SetWarningHandler sets the warning handler to the specified method and returns the previous warning handler.

ErrorHandler SetWarningHandler (ErrorHandler handler)

handler

Specifies a pointer to a method to handle warnings.

77.9  ThrowException

Method ThrowException throws an exception with the specified severity code, reason, and optional description.

void ThrowException (ExceptionInfo \*exception, const ExceptionType severity, const char \*reason, const char \*description)

exception

Specifies a pointer to the ExceptionInfo structure.

severity

This ExceptionType declares the severity of the exception.

reason

Specifies the reason to display before terminating the program.

description

Specifies any description to the reason.

78  ImageMagick Memory Allocation Methods

78.1  AcquireMemory

Method AcquireMemory returns a pointer to a block of at least size bytes suitably aligned for any use.

void \*AcquireMemory (const size_t size)

memory

Method AcquireMemory returns a pointer to a block of at least size bytes suitably aligned for any use.

size

Specifies the size of the memory to return.

78.2  LiberateMemory

Method LiberateMemory frees memory that has already been allocated.

void LiberateMemory (void \*\*memory)

span

Specifies the pointer to a block memory to free for reuse.

78.3  ReacquireMemory

Method ReacquireMemory changes the size of the memory and returns a pointer to the (possibly moved) block. The contents will be unchanged up to the lesser of the new and old sizes.

void ReacquireMemory (void \*\*memory, const size_t size)

memory

Method ReacquireMemory returns a pointer to a block of at least size bytes suitably aligned for any use.

size

Specifies the size of the memory to return.

79  ImageMagick Progress Monitor Methods

79.1  MagickMonitor

Method MagickMonitor calls the monitor handler methods with a text string that describes the task and a measure of completion.

void MagickMonitor (const char \*text, const off_t quantum, const off_t span)

quantum

Specifies the quantum position within the span which represents how much progress has been made in completing a task.

span

Specifies the span relative to completing a task.

79.2  SetMonitorHandler

Method SetMonitorHandler sets the monitor handler to the specified method and returns the previous monitor handler.

MonitorHandler SetMonitorHandler (MonitorHandler handler)

handler

Specifies a pointer to a method to handle monitors.

80  Methods to Interactively Animate an Image Sequence

80.1  XAnimateBackgroundImage

Method XAnimateBackgroundImage animates an image sequence in the background of a window.

void XAnimateBackgroundImage (Display \*display, XResourceInfo \*resource_info, Image \*image)

display

Specifies a connection to an X server returned from XOpenDisplay.

resource_info

Specifies a pointer to a X11 XResourceInfo structure.

image

Specifies a pointer to a Image structure returned from ReadImage.

80.2  XAnimateImage

Method XAnimateImages displays an image via X11.

Image \*XAnimateImages(Display \*display, XResourceInfo \*resource_info, char \*\*argv, const int argc, Image \*image)

display

Specifies a connection to an X server returned from XOpenDisplay.

resource_info

Specifies a pointer to a X11 XResourceInfo structure.

argv

Specifies the application's argument list.

argc

Specifies the number of arguments.

image

Specifies a pointer to a Image structure returned from ReadImage.

81  Methods to Interactively Display and Edit an Image

81.1  XDisplayBackgroundImage

Method XDisplayBackgroundImage displays an image in the background of a window.

unsigned int XDisplayBackgroundImage (Display \*display, XResourceInfo \*resource_info, Image \*image)

status

Method XDisplayBackgroundImage returns True if the designated window is the root window.

display

Specifies a connection to an X server returned from XOpenDisplay.

resource_info

Specifies a pointer to a X11 XResourceInfo structure.

image

Specifies a pointer to a Image structure returned from ReadImage.

81.2  XDisplayImage

Method XDisplayImage displays an image via X11. A new image is created and returned if the user interactively transforms the displayed image.

Image \*XDisplayImage (Display \*display, XResourceInfo \*resource_info, char \*\*argv, int argc, Image \*\*image, unsigned long \*state)

nexus

Method XDisplayImage returns an image when the user chooses 'Open Image' from the command menu or picks a tile from the image directory. Otherwise a null image is returned.

display

Specifies a connection to an X server returned from XOpenDisplay.

resource_info

Specifies a pointer to a X11 XResourceInfo structure.

argv

Specifies the application's argument list.

argc

Specifies the number of arguments.

image

Specifies an address to an address of an Image structure returned from ReadImage.

82  ImageMagick Cache Views Methods

82.1  CloseCacheView

Method CloseCacheView closes the specified view returned by a previous call to OpenCacheView().

void CloseCacheView (ViewInfo \*view)

view

The address of a structure of type ViewInfo.

82.2  GetCacheView

Method GetCacheView gets pixels from the in-memory or disk pixel cache as defined by the geometry parameters. A pointer to the pixels is returned if the pixels are transferred, otherwise a NULL is returned.

PixelPacket \*GetCacheView (ViewInfo \*view, const int x, const int y, const unsigned int columns, const unsigned int rows)

pixels

Method GetCacheView returns a null pointer if an error occurs, otherwise a pointer to the view pixels.

view

The address of a structure of type ViewInfo.

x, y, columns, rows

These values define the perimeter of a region of pixels.

82.3  GetCacheViewIndexes

Method GetCacheViewIndexes returns the colormap indexes associated with the specified view.

IndexPacket \*GetCacheViewIndexes (const ViewInfo \*view)

indexes

Method GetCacheViewIndexes returns the colormap indexes associated with the specified view.

view

The address of a structure of type ViewInfo.

82.4  GetCacheViewPixels

Method GetCacheViewPixels returns the pixels associated with the specified specified view.

PixelPacket \*GetCacheViewPixels (const ViewInfo \*view)

pixels

Method GetCacheViewPixels returns the pixels associated with the specified view.

view

The address of a structure of type ViewInfo.

82.5  OpenCacheView

Method OpenCacheView opens a view into the pixel cache.

ViewInfo \*OpenCacheView (Image \*image)

image

The address of a structure of type Image.

82.6  SetCacheView

Method SetCacheView gets pixels from the in-memory or disk pixel cache as defined by the geometry parameters. A pointer to the pixels is returned if the pixels are transferred, otherwise a NULL is returned.

PixelPacket \*SetCacheView (ViewInfo \*view, const int x, const int y, const unsigned int columns, const unsigned int rows)

pixels

Method SetCacheView returns a null pointer if an error occurs, otherwise a pointer to the view pixels.

view

The address of a structure of type ViewInfo.

x, y, columns, rows

These values define the perimeter of a region of pixels.

82.7  SyncCacheView

Method SyncCacheView saves the view pixels to the in-memory or disk cache. The method returns True if the pixel region is synced, otherwise False.

unsigned int SyncCacheView (ViewInfo \*view)

status

Method SyncCacheView returns True if the view pixels are transferred to the in-memory or disk cache otherwise False.

view

The address of a structure of type ViewInfo.

83  API Structures

83.1  AffineMatrix

The members of the AffineMatrix structure are shown in the following table:

Table 1: ColorPacket Structure
Matrix Structure
Member Type Description
Matrix Structure (continued)
Member Type Description
sx x scale.
sy y scale.
rx x rotate.
ry y rotate.
tx x translate.
ty y translate.

83.2  ColorPacket

The ColorPacket structure is used to represent color options as well as the color palette for PseudoColor images in ImageMagick.

The members of the ColorPacket structure are shown in the following table:

Table 2: ColorPacket Structure
ColorPacket Structure
Member Type Description
ColorPacket Structure (continued)
Member Type Description
red red.
green green.
blue blue.
index index.

83.3  DrawInfo

The DrawInfo structure is used to support annotating an image using drawing commands.

The members of the DrawInfo structure are shown in the following table. The structure is initialized to reasonable defaults by first initializing the equivalent members of ImageInfo, and then initializing the entire structure using GetDrawInfo().

Table 3: DrawInfo Structure
DrawInfo Structure
Member Type Description
DrawInfo Structure (continued)
Member Type Description
affine Coordinate transformation (rotation, scaling, and translation).
border_color Border color.
box Text solid background color.
decorate Text decoration type.
density Text rendering density in DPI (effects scaling font according to pointsize). E.g. "72x72".
fill Object internal fill (within outline) color.
font Font to use when rendering text.
gravity Text placement preference (e.g. NorthWestGravity).
linewidth Stroke (outline) drawing width in pixels.
pointsize Font size (also see density).
primitive Space or new-line delimited list of text drawing primitives (e.g "text 100, 100 Cockatoo"). See the table Drawing Primitives for the available drawing primitives.
stroke PixelPacket Object stroke (outline) color.
stroke_antialias Set to True (non-zero) to obtain anti-aliased stroke rendering.
text_antialias Set to True (non-zero) to obtain anti-aliased text rendering.
tile Image texture to draw with. Use an image containing a single color (e.g. a 1x1 image) to draw in a solid color.

83.4  ExceptionInfo

The members of the ExceptionInfo structure are shown in the following table:

Table 4: ImageInfo Structure
ExceptionInfo Structure
Member Type Description
ImageInfo Structure (continued)
Member Type Description
severity warning or error severity.
reason warning or error message.
description warning or error description.

83.5  Image

The structure represents an ImageMagick image. It is initially allocated by AllocateImage() and deallocated by DestroyImage(). The functions ReadImage(), ReadImages(), BlobToImage() and CreateImage() return a new image. Use CloneImage() to copy an image. An image consists of a structure containing image attributes as well as the image pixels.

The image pixels are represented by the structure PixelPacket and are cached in-memory, or on disk, depending on the cache threshold setting. This cache is known as the "pixel cache". Pixels in the cache may not be edited directly. They must first be made visible from the cache via a pixel view. A pixel view is a rectangular view of the pixels as defined by a starting coordinate, and a number of rows and columns. When considering the varying abilities of multiple platforms, the most reliably efficient pixel view is comprized of part, or all, of one image row.

There are two means of accessing pixel views. When using the default view, the pixels are made visible and accessable by using the GetImagePixels() method which provides access to a specified region of the image. After the view has been updated, thhe pixels may be saved back to the cache in their original positions via SyncImagePixels(). In order to create an image with new contents, or to blindly overwrite existing contents, the method SetImagePixels() is used to reserve a pixel view corresponding to a region in the pixel cache. Once the pixel view has been updated, it may be written to the cache via SyncImagePixels(). The function GetIndexes() provides access to the image colormap, represented as an array of type IndexPacket.

A more flexible interface to the image pixels is via the CacheView interface. This interface supports multiple pixel cache views (limited by the number of image rows), each of which are identified by a handle (of type ViewInfo*). Use OpenCacheView() to obtain a new cache view, CloseCacheView() to discard a cache view, GetCacheView() to access an existing pixel region, SetCacheView() to define a new pixel region, and SyncCacheView() to save the updated pixel region. The function GetCacheViewIndexes() provides access to the colormap indexes associated with the pixel view.

When writing encoders and decoders for new image formats, it is convenient to have a high-level interface available which supports converting between external pixel representations and ImageMagick's own representation. Pixel components (red, green, blue, opacity, RGB, or RGBA) may be transferred from a user-supplied buffer into the default view by using PushImagePixels(). Pixel components may be transferred from the default view into a user-supplied buffer by using PopImagePixels(). Use of this high-level interface helps protect image coders from changes to ImageMagick's pixel representation and simplifies the implementation.

The members of the Image structure are shown in the following table:

Table 5: ImageInfo Structure
ImageInfo Structure
Member Type Description
ImageInfo Structure (continued)
Member Type Description
attributes ImageAttribute Image attribute list. Consists of a doubly-linked-list of ImageAttribute structures, each of which has an associated key and value. Access/update list via SetImageAttribute() and GetImageAttribute(). Key-strings used by ImageMagick include "Comment" (image comment) , "Label" (image label), and "Signature" (image signature).
background_color PixelPacket Image background color
blur double Blur factor to apply to the image when zooming
border_color PixelPacket Image border color
chromaticity ChromaticityInfo Red, green, blue, and white-point chromaticity values.
color_class ClassType Image storage class. If DirectClass then the image packets contain valid RGB or CMYK colors. If PseudoClass then the image has a colormap referenced by pixel's index member.
color_profile ProfileInfo ICC color profile. Specifications are available from the International Color Consortium for the format of ICC color profiles.
colormap PixelPacket PseudoColor palette array.
colors unsigned int The desired number of colors. Used by QuantizeImage().
colorspace ColorspaceType Image pixel interpretation.If the colorspace is RGB the pixels are red, green, blue. If matte is true, then red, green, blue, and index. If it is CMYK, the pixels are cyan, yellow, magenta, black. Otherwise the colorspace is ignored.
columns unsigned int Image width
comments char * Image comments
compression CompressionType Image compresion type. The default is the compression type of the specified image file.
delay unsigned int Time in 1/100ths of a second (0 to 65535) which must expire before displaying the next image in an animated sequence. This option is useful for regulating the animation of a sequence of GIF images within Netscape.
depth unsigned int Image depth (8 or 16). QuantumLeap must be defined before a depth of 16 is valid.
directory char * Tile names from within an image montage. Only valid after calling MontageImages() or reading a MIFF file which contains a directory.
dispose unsigned int GIF disposal method. This option is used to control how successive frames are rendered (how the preceding frame is disposed of) when creating a GIF animation.
exception ExceptionInfo Record of any error which occurred when updating image.
file FILE * Stdio stream to read image from or write image to. If set, ImageMagick will read from or write to the stream rather than opening a file. Used by ReadImage() and WriteImage(). The stream is closed when the operation completes.
filename char[MaxTextExtent] Image file name to read or write.
filesize long int Number of bytes of the encoded file.
filter FilterTypes Filter to use when resizing image. The reduction filter employed has a significant effect on the time required to resize an image and the resulting quality. The default filter is Lanczos which has been shown to produce high quality results when reducing most images.
fuzz int Colors within this distance are considered equal. A number of algorithms search for a target color. By default the color must be exact. Use this option to match colors that are close to the target color in RGB space.
gamma double Gamma level of the image. The same color image displayed on two different workstations may look different due to differences in the display monitor. Use gamma correction to adjust for this color difference.
geometry char * Preferred size of the image when encoding.
interlace InterlaceType The type of interlacing scheme (default 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.
iptc_profile ProfileInfo IPTC profile. Specifications are available from the International Press Telecommunications Council for IPTC profiles.
iterations unsigned int Number of iterations to loop an animation (e.g. Netscape loop extension) for.
list struct _Image * Undo image list (used only by 'display')
magick char[MaxTextExtent] Image encoding format (e.g. "GIF").
magick_columns unsigned int Base image width (before transformations)
magick_filename char[MaxTextExtent] Base image filename (before transformations)
magick_rows unsigned int Base image height (before transformations)
matte unsigned int If non-zero, then the index member of pixels represents the alpha channel.
matte_color PixelPacket Image matte (transparent) color
mean_error_per_pixel unsigned int The mean error per pixel computed when an image is color reduced. This parameter is only valid if verbose is set to true and the image has just been quantized.
montage char * Tile size and offset within an image montage. Only valid for montage images.
next struct _Image * Next image frame in sequence
normalized_maximum_error double The normalized max error per pixel computed when an image is color reduced. This parameter is only valid if <i>verbose</i> is set to true and the image has just been quantized.
normalized_mean_error double The normalized mean error per pixel computed when an image is color reduced. This parameter is only valid if verbose is set to true and the image has just been quantized.
offset int Number of initial bytes to skip over when reading raw image.
page RectangleInfo Equivalent size of Postscript page.
pipe int Set to <i>True</i> if image is read/written from/to a POSIX pipe. To read from (or write to) an open pipe, set this member to True, set the file member to a stdio stream representing the pipe (obtained from popen()), and invoke ReadImage(), WriteImage(). The pipe is automatically closed via pclose() when the operation completes.
pixels PixelPacket Image pixels retrieved via GetPixelCache() or initialized via SetPixelCache().
previous struct _Image * Previous image frame in sequence.
rendering_intent RenderingIntent The type of rendering intent.
rows unsigned int Image height
scene unsigned int Image frame scene number.
tainted int Set to non-zero (True) if the image pixels have been modified.
tile_info RectangleInfo Describes a tile within an image. For example, if your images is 640x480 you may only want 320x256 with an offset of +128+64. It is used for raw formats such as RGB and CMYK as well as for TIFF.
timer TimerInfo Support for measuring actual (user + system) and elapsed execution time.
total_colors unsigned long The number of colors in the image after QuantizeImage(), or QuantizeImages() if the verbose flag was set before the call. Calculated by GetNumberColors().
units ResolutionType Units of image resolution
x_resolution double Horizontal resolution of the image.
y_resolution double Vertical resolution of the image

83.6  ImageAttribute

The ImageAttribute structure is used to add arbitary textual attributes to an image. Each attribute has an associated key and value. Add new attributes, or update an existing attribute, via SetImageAttribute() and obtain the value of an existing attribute via GetImageAttribute(). Key-strings used by ImageMagick include "Comment" (image comment), "Label" (image label), and "Signature" (image signature).

The members of the ImageAttribute structure are shown in the following table:

Table 6: ImageAttribute Structure
ImageAttribute Structure
Member Type Description
ImageAttribute Structure (continued)
Member Type Description
key key.
value value.
compression compression.

83.7  ImageInfo

The structure is used to supply option information to the methods AllocateImage(), AnimateImages(), BlobToImage(), CloneAnnotateInfo(), DisplayImages(), GetAnnotateInfo(), ImageToBlob(), PingImage(), ReadImage(), ReadImages(), and, WriteImage(). These methods update information in ImageInfo to reflect attributes of the current image.

Use CloneImageInfo() to duplicate an existing ImageInfo structure or allocate a new one. Use DestroyImageInfo() to deallocate memory associated with an ImageInfo structure. Use GetImageInfo() to initialize an existing ImageInfo structure. Use SetImageInfo() to set image type information in the ImageInfo structure based on an existing image.

The members of the ImageInfo structure are shown in the following table:

Table 7: ImageInfo Structure
ImageInfo Structure
Member Type Description
ImageInfo Structure (continued)
Member Type Description
adjoin unsigned int Join images into a single multi-image file.
antialias unsigned int Control antialiasing of rendered graphic primitives and text fonts.
background_color PixelPacket Image background color.
border_color PixelPacket Image border color.
box char * Base color that annotation text is rendered on.
colorspace ColorspaceType Image pixel interpretation. If the colorspace is RGB the pixels are red, green, blue. If matte is true, then red, green, blue, and index. If it is CMYK, the pixels are cyan, yellow, magenta, black. Otherwise the colorspace is ignored.
compression CompressionType Image compresion type. The default is the compression type of the specified image file.
delay char * Time in 1/100ths of a second (0 to 65535) which must expire before displaying the next image in an animated sequence. This option is useful for regulating the animation of a sequence of GIF images within Netscape.
density char * Vertical and horizontal resolution in pixels of the image. This option specifies an image density when decoding a Postscript or Portable Document page. Often used with page.
depth unsigned int Image depth (8 or 16). QuantumLeap must be defined before a depth of 16 is valid.
dispose char * GIF disposal method. This option is used to control how successive frames are rendered (how the preceding frame is disposed of) when creating a GIF animation.
dither unsigned int 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. The colors or monochrome option must be set for this option to take effect.
file FILE * Stdio stream to read image from or write image to. If set, ImageMagick will read from or write to the stream rather than opening a file. Used by ReadImage() and WriteImage(). The stream is closed when the operation completes.
filename char[MaxTextExtent] Image file name to read or write.
fill PixelPacket Drawing object fill color.
font char * Text rendering font. If the font is a fully qualified X server font name, the font is obtained from an X server. To use a TrueType font, precede the TrueType filename with an @. Otherwise, specify a Postscript font name (e.g. "helvetica").
fuzz int Colors within this distance are considered equal. A number of algorithms search for a target color. By default the color must be exact. Use this option to match colors that are close to the target color in RGB space.
interlace InterlaceType The type of interlacing scheme (default 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.
iterations char * Number of iterations to loop an animation (e.g. Netscape loop extension) for.
linewidth unsigned int Line width for drawing lines, circles, ellipses, etc.
magick char[MaxTextExtent] Image encoding format (e.g. "GIF").
matte_color PixelPacket Image matte (transparent) color.
monochrome unsigned int Transform the image to black and white.
page char * Equivalent size of Postscript page.
ping unsigned int Set to True to read enough of the image to determine the image columns, rows, and filesize. The columns, rows, and size attributes are valid after invoking ReadImage() while ping is set. The image data is not valid after calling ReadImage() if ping is set.
pointsize double Text rendering font point size.
preview_type PreviewType Image manipulation preview option. Used by 'display'.
quality unsigned int JPEG/MIFF/PNG compression level (default 75).
server_name char * X11 display to display to obtain fonts from, or to capture image from.
size char * Width and height of a raw image (an image which does not support width and height information). Size may also be used to affect the image size read from a multi-resolution format (e.g. Photo CD, JBIG, or JPEG.
stroke PixelPacket Drawing object outline color.
subimage unsigned int Subimage of an image sequence.
subrange unsigned int Number of images relative to the base image.
texture char * Image filename to use as background texture.
tile char * Tile name.
units ResolutionType Units of image resolution.
verbose unsigned int Print detailed information about the image if True.
view char * FlashPix viewing parameters.

83.8  MagickInfo

The MagickInfo structure is used by ImageMagick to register support for an Image format. The MagickInfo structure is allocated with default parameters by calling SetMagickInfo(). Image formats are registered by calling RegisterMagickInfo() which adds the initial structure to a linked list (at which point it is owned by the list). A pointer to the structure describing a format may be obtained by calling GetMagickInfo(). Pass the argument NULL to obtain the first member of this list. A human-readable list of registered image formats may be printed to a file descriptor by calling ListMagickInfo().

Support for formats may be provided as a module which is part of the ImageMagick library, provided by a module which is loaded dynamically at run-time, or directly by the linked program. Users of ImageMagick will normally want to create a loadable-module, or support encode/decode of an image format directly from within their program.

Table 8: MagickInfo Structure
MagickInfo Structure
Member Type Description
MagickInfo Structure (continued)
Member Type Description
tag Magick string (e.g. "GIF") to call this format.
decoder Function to decode image data and return ImageMagick Image.
encoder Function to encode image data with options passed via ImageInfo and image represented by Image.
adjoin Set to non-zero (True) if this file format supports multi-frame images.
blob_support Set to non-zero (True) if the encoder and decoder for this format supports operating arbitrary BLOBs (rather than only disk files).
raw Image format does not contain size (must be specified in ImageInfo).
description Long form image format description (e.g. "CompuServe graphics interchange format").
module Name of module (e.g. "GIF") which registered this format. Set to NULL if format is not registered by a module.
data User specified data. A way to pass any sort of data structure to the endoder/decoder. To set this, GetMagickInfo() must be called to first obtain a pointer to the registered structure since it can not be set via a RegisterMagickInfo() parameter.
previous Previous MagickInfo struct in linked-list. NULL if none.
next Next MagickInfo struct in linked-list. NULL if none.

83.9  PixelPacket

The PixelPacket structure is used to represent DirectClass color pixels in ImageMagick. If the image is indicated as a PseudoClass image, its DirectClass representation is only valid immediately after calling SyncImage(). If an image is set as PseudoClass and the DirectClass representation is modified, the image should then be set as DirectClass. Use QuantizeImage() to restore the PseudoClass colormap if the DirectClass representation is modified.

The members of the PixelPacket structure are shown in the following table:

Table 9: PixelPacket Structure
PixelPacket Structure
Member Type Description
PixelPacket Structure (continued)
Member Type Description
red red.
green green.
blue blue.
opacity opacity.

83.10  ProfileInfo

The ProfileInfo structure is used to represent ICC or IPCT profiles in ImageMagick (stored as an opaque BLOB).

The members of the ProfileInfo structure are shown in the following table:

Table 10: ProfileInfo Structure
ProfileInfo Structure
Member Type Description
ProfileInfo Structure (continued)
Member Type Description
length length.
info data.

83.11  RectangleInfo

The RectangleInfo structure is used to represent positioning information in ImageMagick.

The members of the RectangleInfo structure are shown in the following table:

Table 11: RectangleInfo Structure
RectangleInfo Structure
Member Type Description
RectangleInfo Structure (continued)
Member Type Description
width width.
height height.
x x.
y y.

84  API Enumerations

84.1  CacheType

84.2  ChannelType

ChannelType is used as an argument when doing color separations. Use ChannelType when extracting a channel from an image. MatteChannel is useful for extracting the opacity values from an image.

Table 12: ChannelType Enumeration
ChannelType Enumeration
Enumeration Description
ChannelType Enumeration (continued)
Enumeration Description
UndefinedChannel Unset value.
RedChannel Select red channel.
GreenChannel Select green channel.
BlueChannel Select blue channel.
MatteChannel Select matte (opacity values) channel.

84.3  ClassType

ClassType specifies the image storage class.

Table 13: ClassType Enumeration
ClassType Enumeration
Enumeration Description
ClassType Enumeration (continued)
Enumeration Description
UndefinedClass Unset value.
DirectClass Image is composed of pixels which represent literal color values.
PseudoClass Image is composed of pixels which specify an index in a color palette.

84.4  ColorspaceType

The ColorspaceType enumeration is used to specify the colorspace that quantization (color reduction and mapping) is done under or to specify the colorspace when encoding an output image. Colorspaces are ways of describing colors to fit the requirements of a particular application (e.g. Television, offset printing, color monitors). Color reduction, by default, takes place in the RGBColorspace. Empirical evidence suggests that distances in color spaces such as YUVColorspace or YIQColorspace correspond to perceptual color differences more closely han do distances in RGB space. These color spaces may give better results when color reducing an image. Refer to quantize for more details.

When encoding an output image, the colorspaces RGBColorspace, CMYKColorspace, and GRAYColorspace may be specified. The CMYKColorspace option is only applicable when writing TIFF, JPEG, and Adobe Photoshop bitmap (PSD) files.

Table 14: ColorspaceType Enumeration
ColorspaceType Enumeration
Enumeration Description
ColorspaceType Enumeration (continued)
Enumeration Description
UndefinedColorspace Unset value.
RGBColorspace Red-Green-Blue colorspace.
GRAYColorspace
TransparentColorspace The Transparent color space behaves uniquely in that it preserves the matte channel of the image if it exists.
OHTAColorspace
XYZColorspace
YCbCrColorspace
YCCColorspace
YIQColorspace
YPbPrColorspace
YUVColorspace Y-signal, U-signal, and V-signal colorspace. YUV is most widely used to encode color for use in television transmission.
CMYKColorspace Cyan-Magenta-Yellow-Black colorspace. CYMK is a subtractive color system used by printers and photographers for the rendering of colors with ink or emulsion, normally on a white surface.
sRGBColorspace

84.5  CompositeOperator

CompositeOperator is used to select the image composition algorithm used to compose a composite image with an image. By default, each of the composite mage pixels are replaced by the corresponding image tile pixel. Specify CompositeOperator to select a different algorithm.

Table 15: CompositeOperator Enumeration
CompositeOperator Enumeration
Enumeration Description
CompositeOperator Enumeration (continued)
Enumeration Description
UndefinedCompositeOp Unset value.
OverCompositeOp The result is the union of the the two image shapes with the composite image obscuring image in the region of overlap.
InCompositeOp The result is a simply composite image cut by the shape of image. None of the image data of image is included in the result.
OutCompositeOp The resulting image is composite image with the shape of image cut out.
AtopCompositeOp The result is the same shape as image image, with composite image obscuring image there the image shapes overlap. Note that this differs from OverCompositeOp because the portion of composite image outside of image's shape does not appear in the result.
XorCompositeOp The result is the image data from both composite image and image that is outside the overlap region. The overlap region will be blank.
PlusCompositeOp The result is just the sum of the image data. Output values are cropped to 255 (no overflow). This operation is independent of the matte channels.
MinusCompositeOp The result of composite image - image, with overflow cropped to zero. The matte chanel is ignored (set to 255, full coverage).
AddCompositeOp The result of composite image + image, with overflow wrapping around (mod 256).
SubtractCompositeOp The result of composite image - image, with underflow wrapping around (mod 256). The add and subtract operators can be used to perform reverible transformations.
DifferenceCompositeOp The result of abs(composite image - image). This is useful for comparing two very similar images.
BumpmapCompositeOp The result image shaded by composite image.
ReplaceCompositeOp The resulting image is image replaced with composite image. Here the matte information is ignored.
ReplaceRedCompositeOp The resulting image is the red channel in image replaced with the red channel in composite image. The other channels are copied untouched.
ReplaceGreenCompositeOp The resulting image is the green channel in image replaced with the green channel in composite image. The other channels are copied untouched.
ReplaceBlueCompositeOp The resulting image is the blue channel in image replaced with the blue channel in composite image. The other channels are copied untouched.
ReplaceMatteCompositeOp The resulting image is the matte channel in image replaced with the matte channel in composite image. The other channels are copied untouched. The image compositor requires a matte, or alpha channel in the image for some operations. This extra channel usually defines a mask which represents a sort of a cookie-cutter for the image. This is the case when matte is 255 (full coverage) for pixels inside the shape, zero outside, and between zero and 255 on the boundary. For certain operations, if image does not have a matte channel, it is initialized with 0 for any pixel matching in color to pixel location (0, 0), otherwise 255 (to work properly borderWidth must be 0).

84.6  CompressionType

CompressionType is used to express the desired compression type when encoding an image. Be aware that most image types only support a sub-set of the available compression types. If the compression type specified is incompatable with the image, ImageMagick selects a compression type compatable with the image type.

Table 16: CompressionType Enumeration
CompressionType Enumeration
Enumeration Description
CompressionType Enumeration (continued)
Enumeration Description
UndefinedCompression Unset value.
NoCompression No compression.
BZipCompression BZip (Burrows-Wheeler block-sorting text compression algorithm and Huffman coding) as used by bzip2 utilities.
FaxCompression CCITT Group 3 FAX compression.
Group4Compression CCITT Group 4 FAX compression (used only for TIFF).
JPEGCompression JPEG compression.
LZWCompression Lempel-Ziv-Welch (LZW) compression.
RunlengthEncodedCompression Run-Length encoded (RLE) compression.
ZipCompression Lempel-Ziv compression (LZ77) as used in PKZIP and GNU gzip.

84.7  DecorationType

84.8  ExceptionType

84.9  FilterTypes

FilterTypes is used to adjust the filter algorithm used when resizing images. Different filters experience varying degrees of success with various images and can take sipngicantly different amounts of processing time. ImageMagick uses the LanczosFilter by default since this filter has been shown to provide the best results for most images in a reasonable amount of time. Other filter types (e.g. TriangleFilter) may execute much faster but may show artifacts when the image is re-sized or around diagonal lines. The only way to be sure is to test the filter with sample images.

Table 17: FilterTypes Enumeration
FilterTypes Enumeration
Enumeration Description
FilterTypes Enumeration (continued)
Enumeration Description
UndefinedFilter Unset value.
PointFilter Point Filter
BoxFilter Box Filter
TriangleFilter Triangle Filter
HermiteFilter Hermite Filter
HanningFilter Hanning Filter
HammingFilter Hamming Filter
BlackmanFilter Blackman Filter
GaussianFilter Gaussian Filter
QuadraticFilter Quadratic Filter
CubicFilter Cubic Filter
CatromFilter Catrom Filter
MitchellFilter Mitchell Filter
LanczosFilter Lanczos Filter
BesselFilter Bessel Filter
SincFilter Sinc Filter

84.10  GeometryFlags

84.11  GravityType

GravityType specifies positioning of an object (e.g. text, image) within a bounding region (e.g. an image). Gravity provides a convenient way to locate objects irrespective of the size of the bounding region, in other words, you don't need to provide absolute coordinates in order to position an object. A common default for gravity is NorthWestGravity.

Table 18: GravityType Enumeration
GravityType Enumeration
Enumeration Description
GravityType Enumeration (continued)
Enumeration Description
ForgetGravity Don't use gravity.
NorthWestGravity Position object at top-left of region.
NorthGravity Postiion object at top-center of region.
NorthEastGravity Position object at top-right of region.
WestGravity Position object at left-center of region.
CenterGravity Position object at center of region.
EastGravity Position object at right-center of region.
SouthWestGravity Position object at left-bottom of region.
SouthGravity Position object at bottom-center of region.
SouthEastGravity Position object at bottom-right of region.

84.12  ImageType

ImageType indicates the type classification of the image.

Table 19: ImageType Enumeration
ImageType Enumeration
Enumeration Description
ImageType Enumeration (continued)
Enumeration Description
UndefinedType Unset value.
BilevelType Monochrome image.
GrayscaleType Grayscale image.
PaletteType Indexed color (palette) image.
PaletteMatteType Indexed color (palette) image with opacity.
TrueColorType Truecolor image.
TrueColorMatteType Truecolor image with opacity.
ColorSeparationType Cyan/Yellow/Magenta/Black (CYMK) image.

84.13  InterlaceType

InterlaceType specifies the ordering of the red, green, and blue pixel information in the image. Interlacing is usually used to make image information available to the user faster by taking advantage of the space vs time tradeoff. For example, interlacing allows images on the Web to be recognizable sooner and satellite images to accumulate/render with image resolution increasing over time.

Use LineInterlace or PlaneInterlace to create an interlaced GIF or progressive JPEG image.

Table 20: InterlaceType Enumeration
InterlaceType Enumeration
Enumeration Description
InterlaceType Enumeration (continued)
Enumeration Description
UndefinedInterlace Unset value.
NoInterlace Don't interlace image (RGBRGBRGBRGBRGBRGB...).
LineInterlace Use scanline interlacing (RRR...GGG...BBB...RRR...GGG...BBB...).
PlaneInterlace Use plane interlacing (RRRRRR...GGGGGG...BBBBBB...).
PartitionInterlace Similar to plane interlaing except that the different planes are saved to individual files (e.g. image.R, image.G, and image.B).

84.14  LineCap

84.15  LineJoin

84.16  MapMode

84.17  MontageMode

84.18  NoiseType

NoiseType is used as an argument to select the type of noise to be added to the image.

Table 21: NoiseType Enumeration
NoiseType Enumeration
Enumeration Description
NoiseType Enumeration (continued)
Enumeration Description
UniformNoise Uniform noise.
GaussianNoise Gaussian noise.
MultiplicativeGaussianNoise Multiplicative Gaussian noise.
ImpulseNoise Impulse noise.
LaplacianNoise Laplacian noise.
PoissonNoise Poisson noise.

84.19  PaintMethod

PaintMethod specifies how pixel colors are to be replaced in the image. It is used to select the pixel-filling algorithm employed.

Table 22: PaintMethod Enumeration
PaintMethod Enumeration
Enumeration Description
PaintMethod Enumeration (continued)
Enumeration Description
PointMethod Replace pixel color at point.
ReplaceMethod Replace color for all image pixels matching color at point.
FloodfillMethod Replace color for pixels surrounding point until encountering pixel that fails to match color at point.
FillToBorderMethod Replace color for pixels surrounding point until encountering pixels matching border color.
ResetMethod Replace colors for all pixels in image with pen color.

84.20  ProfileType

84.21  PreviewType

84.22  PrimitiveType

84.23  PrimitiveType

84.24  RenderingIntent

Rendering intent is a concept defined by ICC Spec ICC.1:1998-09, "File Format for Color Profiles". ImageMagick uses RenderingIntent in order to support ICC Color Profiles.

From the specification: "Rendering intent specifies the style of reproduction to be used during the evaluation of this profile in a sequence of profiles. It applies specifically to that profile in the sequence and not to the entire sequence. Typically, the user or application will set the rendering intent dynamically at runtime or embedding time."

Table 23: RenderingIntent Enumeration
RenderingIntent Enumeration
Enumeration Description
RenderingIntent Enumeration (continued)
Enumeration Description
UndefinedIntent Unset value.
SaturationIntent A rendering intent that specifies the saturation of the pixels in the image is preserved perhaps at the expense of accuracy in hue and lightness.
PerceptualIntent A rendering intent that specifies the full gamut of the image is compressed or expanded to fill the gamut of the destination device. Gray balance is preserved but colorimetric accuracy might not be preserved.
AbsoluteIntent Absolute colorimetric.
RelativeIntent Relative colorimetric.

84.25  ResolutionType

By default, ImageMagick defines resolutions in pixels per inch. ResolutionType provides a means to adjust this.

Table 24: ResolutionType Enumeration
ResolutionType Enumeration
Enumeration Description
ResolutionType Enumeration (continued)
Enumeration Description
UndefinedResolution Unset value.
PixelsPerInchResolution Density specifications are specified in units of pixels per inch (english units).
PixelsPerCentimeterResolution Density specifications are specified in units of pixels per centimeter (metric units).

C++ API Methods

C++ API Methods

Perl API Methods

Perl API Methods

85  Image::Magick Attributes

An image has certain attributes associated with it such as width, height, number of colors in the colormap, page geometry, and others. Many of the image methods allow you to set relevant attributes directly in the method call, or you can use Set(), as in:

    $image->Set(loop=>100);
    $image->[$x]->Set(dither=>1);

To get an imageattribute, use Get():

    ($width, $height, $depth) = $image->Get('width', 'height', 'depth');
    $colors = $image->[2]->Get('colors');

The methods GetAttribute() and SetAttribute() are aliases for Get() and Set() and may be used interchangeably.

Following is a list of image attributes acceptable to either Set() or Get() as noted.

85.0.1  adjoin

join images into a single multi-image file.

$image- > Set(adjoin= > )
$image- > Get('adjoin')

Certain file formats accept multiple images within a single file (e.g. a GIF animation). If adjoin is value other than 0 and the image is a multi-image format, multiple reads to the same image object will join the images into a single file when you call the Write() method. Set adjoin to 0 if you do not want the images output to a single file.

85.0.2  antialias

remove pixel aliasing.

$image- > Set(antialias= > )
$image- > Get('antialias')

The visible effect of antialias is to blend the edges of any text or graphics with the image background. This attribute affects how text and graphics are rendered when certain image formats are read (e.g. Postscript or SVG) or when certain Image::Magick methods are called (e.g. Annotate() or Draw()).

85.0.3  background

image background color.

$image- > Set(background= > )
$image- > Get('background')

This attribute sets (or gets) the background color of an image. Image formats such as GIF, PICT, PNG, and WMF retain the background color information.

85.0.4  base-filename

base image filename (before transformations).

$image- > Get('base-filename'')

The original filename is returned as a string.

85.0.5  base-height

base image height (before transformations).

$image- > Get('base-height'')

This attribute returns the original height of image before any resizing operation.

85.0.6  base-width

base image width (before transformations).

$image- > Get('base-width'')

This attribute returns the original width of image before any resizing operation.

85.0.7  blue-primary

chromaticity blue primary point.

$image- > Set(blue-primary= > ,)
$image- > Get('blue-primary')

This attribute sets or returns the chromaticity blue primary point. This is a color management option.

85.0.8  cache-threshold

cache threshold.

$image- > Set(cache-threshold= > )
$image- > Get('cache-threshold')

Image pixels are stored in your computer's memory until it has been consumed or the cache threshold is exceeded. Subsequent pixel operations are cached to disk. Operations to memory are significantly faster, but if your computer does not have a sufficient amount of free memory to read or transform an image, you may need to set this threshold to a small megabyte value (e.g. 32). Use 0 to cache all images to disk.

85.0.9  class

image class.

$image- > Get('class')

A Direct class image is a continuous tone image and is stored as a sequence of red-green-blue and optional opacity intensity values. A Pseudo class image is an image with a colormap, where the image is stored as a map of colors and a sequence of indexes into the map.

85.0.10  colormap

color of a particular colormap entry.

$image- > Set('colormap[]'= > )
$image- > Get('colormap[]')

This attribute returns the red, green, blue, and opacity values at colormap position . You can set the color with a colorname (e.g. red) or color hex value (e.g. #ccbdbd).

85.0.11  colors

number of distinct colors in the image.

$image- > Get('colors')

This attribute returns the number of distinct colors in the image.

85.0.12  comment

image comment.

$image- > Get('comment')

Set or return the image comment.

85.0.13  compress

type of compression.

$image- > Set(compress= > )
$image- > Get('compress')

Compress defaults to the compression type of the image when it was first read. The value of compress can be one of the following:

0000¯1111111111111111¯2222222222222222¯3333333333333333  None  BZip  Fax
 Group4  JPEG  LosslessJPEG
 LZW  RLE  Zip

If you set a compression type that is incompatible with the output file type, a compatible compression value is used instead (e.g. a PNG image ignores a compress value of JPEG and saves with Zip compression).

85.0.14  delay

interframe delay.

$image- > Set(delay= > )
$image- > Get('delay')

Delay regulates the playback speed of a sequence of images. The value is the number of hundredths of a second that must pass before displaying the next image. The default is 0 which means there is no delay and the animation will play as fast as possible.

85.0.15  density

image resolution.

$image- > Set(density= > )
$image- > Get('density')

This attribute to set the vertical and horizontal resolution of an image. Use attribute units to define the units of resolution. The default is 72 dots-per-inch.

85.0.16  depth

color component depth.

$image- > Get('depth')

Return the color component depth of the image, either 8 or 16. A depth of 8 represents color component values from 0 to 255 while a depth of 16 represents values from 0 to 65535.

85.0.17  directory

thumbnail names of an image montage.

$image- > Get('directory')

A montage is one or more image thumbnails regularly spaced across a color or textured background created by the Montage() method or montage program. Directory returns the filenames associated with each thumbnail.

85.0.18  dispose

GIF disposal method.

$image- > Set(dispose= > )
$image- > Get('dispose')

The dispose attribute sets the GIF disposal method that defines how an image is refreshed when flipping between scenes in a sequence. The disposal methods are defined as:

0000¯1111111111¯222222222222222  0  replace one full-size, non-transparent frame with another
 1  any pixels not covered up by the next frame continue to display
 2  background color or background tile shows through transparent pixels
 3  restore to the state of a previous, undisposed frame

85.0.19  dither

apply dithering to the image.

$image- > Set(dither= > )
$image- > Get('dither')

Color reduction is performed implicitly when an image is converted from a file format that allows many colors to one that allows fewer (e.g. JPEG to GIF). Dithering helps smooth out the apparent contours produced when sharply reducing colors. The default is to dither an image during color reduction.

85.0.20  error

mean error per pixel.

$image- > Get('error')

This value reflects the mean error per pixel introduced when reducing the number of colors in an image either implicitedly or explicitly:

  1. Explicitly, when you use the Quantize() method.
  2. Implicitly, when an image is converted from a file format that allows many colors to one that allows fewer (e.g. JPEG to GIF).

The mean error gives one measure of how well the color reduction algorithm performed and how similiar the color reduced image is to the original.

85.0.21  file

Perl filehandle.

$image- > Set(file= > )
$image- > Get('file')

The Read() and Write() methods accept an already opened Perl filehandle and the image is read or written directly from or to the specified filehandle.

85.0.22  filename

filename of image.

$image- > Set(filename= > )
$image- > Get('filename')

The default filename is the name of the file from which the image was read. Write() accepts a filename as a parameter, however, if you do not specify one, it uses the name defined by the filename attribute. For example:

    $image->Read('logo.gif');
    $image->Write();                   # write image as logo.gif
    $image->Set(filename=>'logo.png');
    $image->Write();                   # write image as logo.png

85.0.23  filesize

size of file in bytes.

$image- > Get('filesize')

Returns the number of bytes the image consumes in memory or on disk.

85.0.24  font

text font.

$image- > Set(font= > )
$image- > Get('filesize')

Both Annotate() and Draw() require a font to render text to an image. A font can be Truetype (Arial.ttf), Postscript (Helvetica), or a fully-qualified X11 font (-*-helvetica-medium-r-*-*-12-*-*-*-*-*-iso8859-*) name.

85.0.25  format

descriptive image format.

$image- > Get('format')

Attribute magick returns the abbreviated image format (e.g. JPEG) while format returns more descriptive text about the format (e.g. Joint Photographic Experts Group JFIF format).

85.0.26  fuzz

close colors are treated as equal.

$image- > Set(fuzz= > )
$image- > Get('fuzz')

A number of image methods (e.g. ColorFloodfill()) compare a target color to a color within the image. By default these colors must match exactly. However, in many cases two colors may differ by a small amount. Fuzz defines how much tolerance is acceptable to consider two different colors as the same. For example, set fuzz to 10 and the color red at intensities of 100 and 102 respectively are now interpreted as the same color.

85.0.27  gamma

image gamma.

$image- > Set(gamma= > )
$image- > Get('gamma')

Set or return the image gamma value. Unlike Gamma() that actually applies the gamma value to the image pixels, here we just set the value. This is useful if the correct gamma is already known about a particular image.

85.0.28  geometry

shortcut for specifying width and height.

$image- > Set(geometry= > )
$image- > Get('geometry')

The geometry attribute is a convenient way to specify the width, height, and any offset of an image region as a single string. For example,

    geometry=>'640x80'

is equivalent to:

    width=>640, height=>480

To refer to a 20 x 20 region of pixels starting at coordinate (100, 150), use:

    geometry=>'20x20+100+150'

85.0.29  green-primary

chromaticity green primary point.

$image- > Set(green-primary= > ,)
$image- > Get('green-primary')

This attribute sets or returns the chromaticity green primary point. This is a color management option.

85.0.30  height

image height.

$image- > Get('height'')

This attribute returns the height (in pixel rows) of the image.

85.0.31  index

colormap index at a particular pixel location.

$image- > Set('index[]'= > )
$image- > Get('index[]')

This attribute sets or returns the colormap index at position (). The result is undefined if the image does not have a colormap or the specified location lies outside the the image area.

85.0.32  interlace

type of interlacing scheme.

$image- > Set(interlace= > )
$image- > Get('interlace')

The interlace attribute allows you to specify the interlacing scheme used by certain image formats such as GIF, JPEG, RGB, and CMYK. The default is None but can be any of the following:

0000¯1111111111¯222222222222222  None  no interlacing
 Line  scanline interlacing
 Plane  plane interlacing
 Partition  partition interlacing

85.0.33  label

image label.

$image- > Set(label= > )
$image- > Get('label')

Use labels to optionally annotate a Postscript or PDF image or the thumbnail images of a montage created by the Montage() method or montage program. A label can include any of the special formatting characters described in the Comment() method description.

85.0.34  loop

add loop extension to your image sequence.

$image- > Set(label= > )
$image- > Get('loop')

The loop attribute adds the Netscape looping extension to an image sequence. A value of 0 causes the animation sequence to loop continuously. Any other value results in the animation being repeated for the specified number of times. The default value is 1.

85.0.35  magick

image file format.

$image- > Set(magick= > )
$image- > Get('magick')

The default image format is whatever format the image was in when it was read. Write() accepts an image format as a parameter, however, if you do not specify one, it uses the format defined by the magick attribute. For example:

    $image->Read('logo.gif');
    $image->Write();                   # write image as GIF
    $image->Set(magick=>'PNG');
    $image->Write();                   # write image as PNG

85.0.36  matte

transparency boolean.

$image- > Set(matte= > )
$image- > Get('magick')

Some images have a transparency mask associated with each pixel ranging from opaque (pixel obscures background) to fully transparent (background shows thru). The transparency mask, if it exists, is ignored if the matte attribute is 0 and all pixels are treated as opaque.

85.0.37  maximum-error

normalized maximum mean error per pixel.

$image- > Get('maximum-error')

This value reflects the normalized maximum per pixel introduced when reducing the number of colors in an image either implicitedly or explicitly:

  1. Explicitly, when you use the Quantize() method.
  2. Implicitly, when an image is converted from a file format that allows many colors to one that allows fewer (e.g. JPEG to GIF).

The normalized maximum error gives one measure of how well the color reduction algorithm performed and how similiar the color reduced image is to the original.

85.0.38  mean-error

normalized mean mean error per pixel.

$image- > Get('mean-error')

This value reflects the normalized mean per pixel introduced when reducing the number of colors in an image either implicitedly or explicitly:

  1. Explicitly, when you use the Quantize() method.
  2. Implicitly, when an image is converted from a file format that allows many colors to one that allows fewer (e.g. JPEG to GIF).

The normalized mean error gives one measure of how well the color reduction algorithm performed and how similiar the color reduced image is to the original.

85.0.39  montage

tile size and offset within an image montage.

$image- > Get('montage')

A montage is one or more image thumbnails regularly spaced across a color or textured background returned by the Montage() method or montage program. The montage attribute returns the geometry of the region associated with each image thumbnail (e.g. 160x120+10+10). This information is useful for creating image maps for dynamic web pages.

85.0.40  page

perferred size and location of the image canvas.

$image- > Set(page= > )
$image- > Get('page')

Page declares the image canvas size and location. Typically this is only useful for the Postscript, text, and GIF formats. The value of string can be:

0000¯1111111111111111¯2222222222222222¯3333333333333333  Letter  Tabloid  Ledger
 Legal  Statement  Executive
 A3  A4  A5
 B4  B5  Folio
 Quarto  10x14  

or a geometry (612x792). The default value is Letter.

85.0.41  pointsize

pointsize of a font.

$image- > Set(pointsize= > )
$image- > Get('pointsize')

The pointsize attribute determines how large to draw a Postscript or TrueType font with the Annotate() or Draw() methods. The default is 12.

85.0.42  preview

type of image preview.

$image- > Set(preview= > )
$image- > Get('preview')

Set or get the type of preview for the Preview image format.

0000¯1111111111111111¯2222222222222222¯3333333333333333  Rotate Shear Roll
 Hue Saturation Brightness
 Gamma Spiff Dull
 Grayscale Quantize
 Despeckle ReduceNoise
 AddNoise Sharpen Blur
 Threshold EdgeDetect
 Spread Solarize Shade
 Raise Segment Swirl
 Implode Wave OilPaint
 CharcoalDrawing JPEG

Suppose we want to determine an ideal gamma setting for our image:

    $image->Write(filename=>'model.png',preview=>'Gamma');
    $image->Display();

85.0.43  quality

compression level.

$image- > Set(quality= > )
$image- > Get('quality')

The quality attribute sets the JPEG, MIFF, or PNG compression level. The range is 0 (worst) to 100 (best). The default is 75.

Quality is a trade-off between image size and compression speed for the MIFF and PNG formats. The higher the quality, the smaller the resulting image size but with a requisite increase in compute time. The JPEG trade-off is between image size and image appearance. A high quality returns an image nearly free of compression artifacts but with a larger image size. If you can accept a lower quality image appearance, the resulting image size would be considerably less.

85.0.44  red-primary

chromaticity red primary point.

$image- > Set(red-primary= > ,)
$image- > Get('red-primary')

This attribute sets or returns the chomaticity red primary point. This is a color management option.

85.0.45  rendering-intent

intended rendering model.

$image- > Set(rendering-intent= > )
$image- > Get('rendering-intent')

This is a color management option. Choose from these models:

0000¯1111111111111111¯2222222222222222¯3333333333333333  Undefined  Saturation  Perceptual
 Absolute  Relative  

85.0.46  scene

image scene number.

$image- > Set(scene= > )
$image- > Get('scene')

By default each image in a sequence has a scene number that starts at 0 and each subsequent image in the sequence increments by 1. Use scene to reset this value to whatever is appropriate for your needs.

85.0.47  signature

MD5 public key signature.

$image- > Get('signature')

Retrieves the MD5 public key signature associated with the image. A signature is generated across all the image pixels. If a single pixel changes, the signature will change as well. The signature is mostly useful for quickly determining if two images are identical or if an image has been modified.

85.0.48  size

width and height of a raw image.

$image- > Set(size= > )
$image- > Get('size')

Set the size attribute before reading an image from a raw data file format such as RGB, GRAY, TEXT, or CMYK (e.g. 640x480) or identify a desired resolution for Photo CD images (e.g. 768x512).

    $image->Set(size=>'640x480');
    $image->Read('gray:protein');

85.0.49  server

X server to contact.

$image- > Set(server= > )
$image- > Get('server')

Display(), Animate(), or any X11 font use with Annotate() require contact with an X server. Use server to specify which X server to contact (e.g. mysever:0).

85.0.50  taint

pixel change boolean.

$image- > Get('taint')

Taint returns a value other than 0 if any image pixel has modified since it was first read.

85.0.51  texture

name of texture to tile.

$image- > Set(texture= > )
$image- > Get('texture')

The texture attribute assigns a filename of a texture to be tiled onto the image background when any TXT or WMF image formats are read.

85.0.52  type

image type.

$image- > Set(type= > )
$image- > Get('type')

The image type can be any of the following

0000¯1111111111111111¯2222222222222222¯3333333333333333  Bilevel  Grayscale  GrayscaleMatte
 Palette  PaletteMatte  TrueColor
 TrueColorMatte  ColorSeparation  ColorSeparationMatte

When getting this attribute, the value reflects the type of image pixels. For example a colormapped GIF image would most likely return Palette as the image type. You can also force a particular type with Set(). For example if you want to force your color image to black and white, use:

    $image->Set(type=>'Bilevel');

85.0.53  units

units of resolution.

$image- > Set(units= > )
$image- > Get('units')

Return or set the units in which the image's resolution are defined. Values may be:

0000¯111111111111111  Undefined
 pixels/inch
 pixels/centimeter

85.0.54  verbose

print details.

$image- > Set(units= > )
$image- > Get('units')

When set, verbose causes some image operations to print details about the operation as it progresses.

85.0.55  white-point

chromaticity white point.

$image- > Set(white-point= > ,)
$image- > Get('white-point')

This attribute sets or returns the chomaticity white point. This is a color management option.

85.0.56  width

image width.

$image- > Get('width')

Returns the width (integer number of pixel columns) of the image.

85.0.57  x-resolution

horizontal resolution.

$image- > Get('x-resolution')

Returns the x resolution of the image in the units defined by the units attribute (e.g. 72 pixels/inch). Use the density attribute to change this value.

85.0.58  y-resolution

vertical resolution.

$image- > Get('y-resolution')

Returns the y resolution of the image in the units defined by the units attribute (e.g. 72 pixels/inch). Use the density attribute to change this value.

86  Image::Magick Methods

86.0.59  AddNoise()

add noise to an image.

$image- > AddNoise(noise= > )

This method adds random noise to the image, where specifies one of the following types:

0000¯1111111111111111¯2222222222222222¯3333333333333333  Uniform  Gaussian  Multiplicative
 Impulse  Laplacian  Poisson

86.0.60  Animate()

animate an image sequence.

$image- > Animate()

Animate() repeatedly displays an image sequence to any X window screen. This method accepts the same parameters as Set() as described in section 22.1.

86.0.61  Annotate()

annotate an image with text.

$image- > Annotate(text= > , antialias= > , box= > , density= > , fill= > , font= > , geometry= > , gravity= > , pointsize= > , rotate= > , scale= > , skewX= > , skewY= > stroke= > , stroke_width= > , translate= > , x= > , y= > )

Annotate() allows you to scribble text across an image. The text may be represented as a string or filename. Precede the filename with an ampersand (@) and the contents of the file are drawn on the image. You can affect how text is drawn by specifying one or more of the following parameters:

antialias
The visible effect of antialias is to smooth out the rounded corners of text characters. Set to 0 to keep crisp edges.
box
By default text is blended with the image background. Set the box color to give a uniform background to your text of the color you choose.
density
This parameter sets the vertical and horizontal resolution of the font. The default is 72 pixels/inch.
fill
The fill color paints any areas inside the outline of the text.
font
A font can be a Truetype (arial.ttf), Postscript (Helvetica), or a fully-qualified X11 font (-*-helvetica-medium-r-*-*-12-*-*-*-*-*-iso8859-*).
geometry
Geometry defines the baseline position where text is rendered (e.g. +100+50).
gravity
Gravity affects how the text is rendered relative to the () baseline position. By default gravity is NorthWest which renders text above the baseline position. Choose from these gravities:

0000¯1111111111111111¯2222222222222222¯3333333333333333  NorthWest,  North  NorthEast
 West  Center  East
 SouthWest  South  SouthEast

pointsize
The font pointsize. The default is 12.
rotate
Specifies a rotation by the specified number of degrees about a given point.
scale
Specifies a scale operation by and .
skewX
Specifies a skew transformation along the x-axis.
skewY
Specifies a skew transformation along the y-axis.
stroke
A stroke color paints along the outline of the text.
stroke_width
The width of the stroke on the text. A zero value causes no stroke to be painted.
translate
Specifies a translation by and .
x
Specifies the baseline position of the text.
y
Specifies the baseline position of the text.

86.0.62  Append()

append a set of images.

$image- > Append()

The Append() method takes a set of images and appends them to each other. Each image in the set must have the equal width or equal height (or both). Append() returns a single image where each image in the original set is side-by-side if all the heights are equal or stacked on top of each other if all widths are equal.

    $append = $image->Append();

86.0.63  Average()

average a set of images.

$image- > Average()

The Average() method takes a set of images and averages them together. Each image in the set must have the same width and the same height. Average() returns a single image with each corresponding pixel component of each image averaged.

86.0.64  BlobToImage()

return an image from a Binary Large OBject.

$image- > BlobToImage()

Read() returns an image from a file on disk, whereas, BlobToImage() performs the same function if the image format is stored in memory:

    $blob = $db->GetImage();    # get blob from database
    $image = Image::Magick->New(magick=>'jpg');
                                # the blob is a JPEG image
    $image->BlobToImage($blob); # convert blob to Image::Magick object

86.0.65  Blur()

blur the image.

$image- > Blur(geometry= > , radius= > , sigma= > )

Blur() blurs an image. We convolve the image with a Gaussian operator of the given radius and standard deviation (sigma). For reasonable results, the radius should be larger than sigma. Use a radius of 0 and Blur() selects a suitable radius for you. Geometry represents radius x sigma as one parameter (e.g. 0x1).

86.0.66  Border()

frame the image with a border.

$image- > Border(geometry= > , width= > , height= > , fill= > )

This method surrounds the image with a border of the specified color. Geometry represents width x height as one parameter (e.g. 10x5).

86.0.67  Channel()

extract a channel from the image.

$image- > Channel(channel= > );

Extract a channel from the image. A channel is a particular color component of each pixel in the image. Choose from these components:

0000¯111111  Red
 Green
 Blue
 Matte

86.0.68  Charcoal()

special effect filter.

$image- > Charcoal(geometry= > , radius= > , sigma= > )

Charcoal() is a special effect filter that simulates a charcoal drawing. We convolve the image with a Gaussian operator of the given radius and standard deviation (sigma). For reasonable results, radius should be larger than sigma. Use a radius of 0 and Charcoal() selects a suitable radius for you. Geometry represents radius x sigma as one parameter (e.g. 0x1).

86.0.69  Chop()

chop an image.

$image- > Chop(geometry= > geometry, width= > integer, height= > integer, x= > integer, y= > integer)

Chop() removes a region of an image and collapses the image to occupy the removed portion. Columns x through x+width and the rows y through y+height are chopped. Use Geometry as a shortcut for width x height + x + y (e.g. 100x50+10+20).

86.0.70  Clone()

create a new copy of an image.

$image- > Clone()

The Clone() method copies a set of images and returns the copy as a new image object. For example

    $clone = $image=>Clone();

copies all of the images from $image to $clone.

86.0.71  Coalesce()

coalesce a set of images.

$image- > Coalesce()

This method composites a set of images while respecting any page offsets and disposal methods. GIF, MIFF, and MNG animation sequences typically start with an image background and each subsequent image varies in size and offset. Coalesce() returns a new sequence where each image in the sequence is the same size as the first and composited with the next image in the sequence.

86.0.72  ColorFloodfill()

floodfill the designed area with color.

$image- > ColorFloodfill(geometry= > , x= > , y= > , fill= > , bordercolor= > , fuzz= > )

ColorFloodfill() changes the color value of any pixel that matches fill and is an immediate neighbor. If bordercolor is specified, the color value is changed for any neighbor pixel that is not bordercolor. Use Geometry as a shortcut for x + y (e.g. +10+20).

By default fill must match a particular pixel color exactly. However, in many cases two colors may differ by a small amount. Fuzz defines how much tolerance is acceptable to consider two colors as the same. For example, set fuzz to 10 and the color red at intensities of 100 and 102 respectively are now interpreted as the same color for the purposes of the floodfill.

86.0.73  Colorize()

colorize an image.

$image- > Colorize(fill= > , opacity= > )

Colorize() blends the fill color with each pixel in the image. A percentage blend is specified with opacity. Control the application of different color components by specifying a different percentage for each component (e.g. 90/100/10 is 90% red, 100% green, and 10% blue).

86.0.74  Comment()

add a comment to an image.

$image- > Comment(comment= > )

Add a comment to an image. Optionally you can include any of the following bits of information about the image by embedding the appropriate special characters:

0000¯1111¯222222222222222  %b  file size in bytes.
 %c  comment.
 %d  directory in which the image resides.
 %e  extension of the image file.
 %f  original filename of the image.
 %h  height of image.
 %i  filename of the image.
 %l  image label.
 %m  image file format.
 %n  number of images in a image sequence.
 %o  output image filename.
 %p  page number of the image.
 %q  image depth (8 or 16).
 %s  image scene number.
 %t  image filename without any extension.
 %u  a unique temporary filename.
 %w  image width.
 %x  x resolution of the image.
 %y  y resolution of the image.

Given an image whose filename is logo.gif and dimensions of 640 pixels in width and 480 pixels in height, this statement:

    $image->Comment('%f %m %wx%h')

generates a comment that reads: logo.gif GIF 640x480.

86.0.75  Composite

composite one image to another.

$image- > Composite(image= > , compose= > , geometry= > , x= > , y= > , gravity= > , opacity= > =, rotate= > , tile= > )

Composite() allows you to overlay one image to another. You can affect how and where the composite is overlaid by specifying one or more of the following options:

compose
This operator affects how the composite is applied to the image. The default is Over. Choose from these operators:

0000¯1111111111111111¯2222222222222222¯3333333333333333  Over,  In  Out
 Atop  Xor  Plus
 Minus  Add  Subtract
 Difference  Bumpmap  Copy
 Displace

geometry
Geometry defines the baseline position where the composite is placed (e.g. +100+50).
x
Specifies the baseline position of the composite.
y
Specifies the baseline position of the composite.
gravity
Gravity affects how the image is placed relative to the () baseline position. By default gravity is NorthWest which renders the image just below the baseline position. Choose from these gravities:

0000¯1111111111111111¯2222222222222222¯3333333333333333  NorthWest,  North  NorthEast
 West  Center  East
 SouthWest  South  SouthEast

opacity
Blend composite with the image background. Opacity is expressed as percent transparency.
rotate
Rotate image before it is composited, expressed in degrees.
tile
A value other than 0 tiles the composite repeatedly across and down the image.

86.0.76  Contrast()

enhance or reduce the image contrast.

$image- > Contrast(sharpen= > )

Contrast() enhances the intensity differences between the lighter and darker elements of the image. Set sharpen to a value other than 0 to increase the image contrast otherwise the contrast is reduced.

86.0.77  Convolve()

apply a convolution kernel to the image.

$image- > Convolve(coefficients= > )

Apply a custom convolution kernel to the image. Given a particular kernel , you must supply float values. For example, a kernel of order 3 implies 9 values (3x3):

    $image->Convolve([1, 2, 1, 2, 4, 2, 1, 2, 1]);

86.0.78  Crop

crop an image.

$image- > Crop(geometry= > , width= > , height= > , x= > , y= > )

Crop() extracts a region of the image starting at the offset defined by x and y and extending for width and height. Geometry is a shorthard method to define a region. To crop 100 x 50 region that begins at position (10, 20), use

    $image->Crop('100x50+10+20');

86.0.79  CycleColormap

displace a colormap.

$image- > CycleColormap(display= > )

CycleColormap() displaces an image's colormap by a given number of positions. If you cycle the colormap a number of times you can produce a psychodelic effect.

86.0.80  Deconstruct

return the constituent parts of an image sequence.

$image- > Deconstruct()

Deconstruct() returns a new sequence that consists of the first image in the sequence followed by the maximum bounding region of any differences in subsequent images. This method can undo a coalesced sequence returned by Coalesce().

86.0.81  Despeckle

filter speckles.

$image- > Despeckle()

Despeckle() reduces the speckle noise in an image while perserving the edges of the original image.

86.0.82  Display()

display image.

$image- > Display(server= > )

Display() displays the image to any X window screen.

86.0.83  Draw

annotate an image with a graphic primitive.

$image- > Draw(primitive= > , antialias= > , bordercolor= > , density= > , fill= > , font= > , geometry= > , method= > , points= > , pointsize= > , rotate= > , scale= > , skewX= > , skewY= > stroke= > , stroke_width= > , translate= >

Draw() allows you to draw a graphic primitive on your image. The primitive may be represented as a string or filename. Precede the filename with an ampersand (@) and the contents of the file are drawn on the image. You can affect how text is drawn by specifying one or more of the following parameters:

primitive
The primitive describes the type of graphic to draw. Choose from these primitives:

0000¯1111111111111111¯2222222222222222¯3333333333333333  Point  Line  Rectangle
 roundRectangle  Arc  Ellipse
 Circle  Polyline  Polygon
 Bezier  Path  Color
 Matte  Text  Image

antialias
The visible effect of antialias is to smooth out the rounded corners of the drawn shape. Set to 0 to keep crisp edges.
bordercolor
The Color primitive with a method of FloodFill changes the color value of any pixel that matches fill and is an immediate neighbor. If bordercolor is specified, the color value is changed for any neighbor pixel that is not fill.
density
This parameter sets the vertical and horizontal resolution of the font. The default is 72 pixels/inch.
fill
The fill color paints any areas inside the outline of drawn shape.
font
A font can be a Truetype (arial.ttf), Postscript (Helvetica), or a fully-qualified X11 font (-*-helvetica-medium-r-*-*-12-*-*-*-*-*-iso8859-*).
geometry
Geometry defines the baseline position where the graphic primitive is rendered (e.g. +100+50).
method
Primitives Matte and Image behavior depends on the painting method you choose:

0000¯1111111111111111¯2222222222222222¯3333333333333333  Point  Replace  Floodfull
 FillToBorder  Reset

points
List one or more sets of coordinates as required by the graphic primitive you selected.
pointsize
The font pointsize. The default is 12.
rotate
Specifies a rotation of degrees about a given point.
scale
Specifies a scale operation by and .
skewX
Specifies a skew transformation along the x-axis.
skewY
Specifies a skew transformation along the y-axis.
stroke
A stroke color paints along the outline of the shape.
stroke_width
The width of the stroke of the shape. A zero value means no stroke is painted.
translate
Specifies a translation by and .

86.0.84  Edge

detect edges within an image.

$image- > Edge(radius= > )

Edge() finds edges in an image. Radius defines the radius of the convolution filter. Use a radius of 0 and Edge() selects a suitable radius for you.

86.0.85  Emboss

emboss the image.

Emboss() returns a grayscale image with a three-dimensional effect. We convolve the image with a Gaussian operator of the given radius and standard deviation (sigma). For reasonable results, radius should be larger than sigma. Use a radius of 0 and Emboss() selects a suitable radius for you. Geometry represents radius x sigma as one parameter (e.g. 0x1).

86.0.86  Enhance

filter a noisy image.

$image- > Enhance()

Enhance() applies a digital filter that improves the quality of a noisy image.

86.0.87  Equalize

equalize an image.

$image- > Equalize()

Perform a histogram equalization on the image.

86.0.88  Flatten()

flatten a sequence of images.

$image- > Coalesce()

This method composites a sequence of images while respecting any page offsets. A Photoshop image typically starts with an image background and each subsequent layer varies in size and offset. Flatten() returns a single image with all the layers composited onto the first image in the sequence.

86.0.89  Flip

reflect an image vertically.

$image- > Flip()

Flip() creates a vertical mirror image by reflecting the pixels around the central x-axis.

86.0.90  Flop

reflect an image horizontally.

$image- > Flop()

Flop() creates a horizontal mirror image by reflecting the pixels around the central y-axis.

86.0.91  Frame

surround the image with a border.

$image- > Frame(geometry= > , width= > , height= > , inner= > =, outer= > , fill= > )

Frame() adds a simulated three-dimensional border around the image. The color of the border is defined by fill. Width and height specify the border width of the vertical and horizontal sides of the frame. The inner and outer parameters indicate the width of the inner and outer shadows of the frame. Use Geometry as a shortcut for width, height, inner, and outer (e.g. 10x10+3+3).

86.0.92  Gamma

gamma-correct the image.

$image- > Gamma(gamma= > , red= > , green= > , blue= > )

Use Gamma() to gamma-correct an image. The same image viewed on different devices will have perceptual differences in the way the image's intensities are represented on the screen. Specify individual gamma levels for the red, green, and blue channels, or adjust all three with the gamma parameter. Values typically range from 0.8 to 2.3.

You can also reduce the influence of a particular channel with a gamma value of 0.

86.0.93  Get()

get an image attribute.

$image- > Get(, ...)

Get() accepts one or more image attributes listed in section 22.1 and return their value.

86.0.94  ImageToBlob()

return image as a Perl variable.

$image- > ImageToBlob()

ImageToBlob() behaves just like Write() except the image is returned as a Perl variable rather than written to disk. This method accepts the same parameters as Set() as described in section .

86.0.95  Implode()

apply an implosion/explosion filter.

$image- > Implode(amount= > )

Implode() applies a special effects filter to the image where amount determines the amount of implosion. Use a negative amount for an explosive effect.

86.0.96  Label()

add a label to an image.

$image- > Label(label= > )

Use labels to optionally annotate a Postscript or PDF image or the thumbnail images of a montage created by the Montage() method or montage program. A label can include any of the special formatting characters described in the Comment() method description.

86.0.97  Magnify()

scale the image to twice its size.

$image- > Magnify()

Magnify() is a convenience method that scales an image proportionally to twice its size.

86.0.98  Map()

choose a set of colors from another image.

$image- > Map(image= > , dither= > )

Map() changes the colormap of the image to that of the image given by image. Use this method to change the colormap in an image or image sequence to a set of predetermined colors. Set dither to a value other than zero to helps smooth out the apparent contours produced when sharply reducing colors.

One useful example of mapping is to convert an image to the Netscape 216-color web safe palette:

    $safe = new Image::Magick;
    $safe->Read('Netscape:');
    $image->Map(image=>$safe, dither=>'True');

86.0.99  MatteFloodfill()

floodfill an area with transparency.

$image- > MatteFloodfill(geometry= > , x= > , y= > , matte= > , bordercolor= > , fuzz= > )

MatteFloodfill() changes the transparency value of any pixel that matches matte and is an immediate neighbor. If bordercolor is specified, the transparency value is changed for any neighbor pixel that is not bordercolor. Use Geometry as a shortcut for x + y (e.g. +10+20).

By default matte must match a particular pixel transparency exactly. However, in many cases two transparency values may differ by a small amount. Fuzz defines how much tolerance is acceptable to consider two transparency values as the same. For example, set fuzz to 10 and the opacity values of 100 and 102 respectively are now interpreted as the same value for the purposes of the floodfill.

86.0.100  MedianFilter()

filter a noisy image.

$image- > MedianFilter(radius= > )

MedianFilter() applies a digital filter that improves the quality of a noisy image. Each pixel is replaced by the median in a set of neighboring pixels as defined by radius.

86.0.101  Minify()

scale the image to half its size.

$image- > Magnify()

Minify() is a convenience method that scales an image proportionally to half its size.

86.0.102  Modulate

adjust the brightness, saturation, and hue.

$image- > Modulate(factor= > , brightness= > , saturation= > , hue= > )

Modulate() lets you control the brightness, saturation, and hue of an image. Each parameter is in the form of a percentage relative to 100. For example, to decrease the brightness by 10

    $image->Modulate(brightness=$>$90, saturation=$>$150);

Factor represents the brightness, saturation, and hue as one parameter (e.g. 90/150/100).

86.0.103  Mogrify()

alternative calling scheme.

$image- > Mogrify(method, ...)

The Mogrify() method is convenience function that allows you to call any image manipulation method by giving a method name followed by one or parameters to pass to the method. The following calls have the same result:

    $image->Crop('340x256+0+0')
    $image->Mogrify('Crop', '340x256+0+0')

86.0.104  MogrifyRegion()

apply method to a region.

$image- > MogrifyRegion(geometry, method, ...)

MogrifyRegion() applies an image manipulation method to a region of the image as defined by . For example if you want to sharpen a 100 x 100 region starting at position (20, 20), use: result:

    $image->MogrifyRegion('100x100+20+20', Sharpen, '0x1')

86.0.105  Montage()

uniformly tile thumbnails across an image canvas.

$image- > Montage(background= > , bordercolor= > , borderwidth= > , compose= > , fill= > , font= > , frame= > , geometry= > , gravity= > , label= > , mattecolor= > , mode= > , pointsize= > , shadow= > , stroke= > , texture= > , tile= > , title= > , transparent= > )

The Montage() method is a layout manager that lets you tile one or more thumbnails across an image canvas. Use these parameters to control how the layout manager places the thumbnails:

background
The color name for the montage background.
bordercolor
The color name for the thumbnail border.
borderwidth
The width of the thumbnail border.
compose
This operator affects how the thumbnail is composited on the image canvas. The default is Over. Choose from these operators:

0000¯1111111111111111¯2222222222222222¯3333333333333333  Over,  In  Out
 Atop  Xor  Plus
 Minus  Add  Subtract
 Difference  Bumpmap  Copy
 Displace

fill
The fill color paints any areas inside the outline of the thumbnail label.
font
A font can be a Truetype (arial.ttf), Postscript (Helvetica), or a fully-qualified X11 font (-*-helvetica-medium-r-*-*-12-*-*-*-*-*-iso8859-*).
frame
Adds a simulated three-dimensional border around each thumbnail. The color of the border is defined by mattecolor. Specify the border width of the vertical and horizontal sides of the frame and the inner and outer shadows of the frame as a geometry (e.g. 10x10+3+3).
geometry
Geometry defines the baseline position where a thumbnail is composited (e.g. +100+50).
gravity
Gravity affects how the thumbnail is placed relative to the () baseline position. By default gravity is South which positions the thumbnail centered south of the baseline position. Choose from these gravities:

0000¯1111111111111111¯2222222222222222¯3333333333333333  NorthWest,  North  NorthEast
 West  Center  East
 SouthWest  South  SouthEast

label
A label optionally appears just below each thumbnail. Use this parameter to customize the label. See Comment() for a list of embedded formatting options for the thumbnail label.
mode
Define one of three thumbnail framing options:

0000¯1111111111111111¯2222222222222222¯3333333333333333  Frame  Unframe  Concatentate

The default is Frame which adds a simulated three-dimensional border around each thumbnail. Unframe tiles thumbnails without any border or frame, and Concatentate causes each image to be tightly packed without any border, frame, or space between them.

pointsize
The font pointsize. The default is 12.
shadow
Any value other than 0 will add a simulated shadow beneath and to the right side of each thumbnail.
stroke
The stroke color paints along the outline of any text labels.
texture
Tile this image across and down the image canvas before compositing the image thumbnails.
tile
Give the number of thumbnails across and down the canvas as a geometry string. The default is 5 x 4. If the number of thumbnails exceed this maximum, more then one image canvas is created.
title
Give a title to the montage. The title is centered near the top of the montage image.
transparent
Make this color transparent.

86.0.106  Mosaic()

form a single coherent picture.

$image- > Mosiac()

The Mosaic() method takes a set of images and inlays them to form a single coherent pictiure. Mosaic() returns a single image with each image in the sequence inlayed in the image canvas at an offset as defined in the image.

    $mosaic = $image->Mosaic();

86.0.107  MotionBlur()

simulate motion blur.

$image- > MotionBlur(geometry= > , radius= > , sigma= > , angle= > )

MotionBlur() simulates motion blur. We convolve the image with a Gaussian operator of the given radius and standard deviation (sigma). For reasonable results, radius should be larger than sigma. Use a radius of 0 and MotionBlur() selects a suitable radius for you. Geometry represents radius x sigma as one parameter (e.g. 0x1). Angle gives the angle of the blurring motion.

86.0.108  Morph()

morph a set of images.

$image- > Morph(frames= > )

The Morph() method requires a minimum of two images. The first image is transformed into the second by a number of intervening images as specified by frames. The result is returned as a new image sequence, for example:

    $morph = $image->Morph(30);

86.0.109  Negate

apply color inversion.

$image- > Negate(gray= > )

Negate() negates the intensities of each pixel in the image. If gray is a value other than 0, only the grayscale pixels are inverted.

86.0.110  New()

create an image object.

$image = new Image::Magick;
$image = Image::Magick->New()

New() instantiates an image object. As a convenience, you can set any image attribute that Set() knows about. See section for a list of known image attributes. Here is an example:

    $image = Image::Magick->New(size=>'160x120');
    $image->Read('gray:protein');

86.0.111  Normalize()

enhance image contrast.

$image- > Normalize()

The Normalize() method enhances the contrast of a color image by adjusting the pixels color to span the entire range of colors available.

86.0.112  OilPaint()

simulate an oil painting.

$image- > OilPaint(radius= > )

OilPaint() applies a special effect filter that simulates an oil painting. Each pixel is replaced by the most frequent color occurring in a circular region defined by radius.

86.0.113  Opaque()

globally change a color.

$image- > Opaque(color= > , fill= > , fuzz= > )

Opaque() changes any pixel that matches color with the color defined by fill.

By default color must match a particular pixel color exactly. However, in many cases two colors may differ by a small amount. Fuzz defines how much tolerance is acceptable to consider two colors as the same. For example, set fuzz to 10 and the color red at intensities of 100 and 102 respectively are now interpreted as the same color.

86.0.114  OrderedDither()

reduce the image to black and white.

$image- > OrderedDither()

The OrderedDither() method reduces the image to black and white.

86.0.115  Ping()

get information about an image.

$image- > Ping(filename= > , file= > )

Ping() is a convenience method that returns information about an image without having to read the image into memory. It returns the width, height, file size in bytes, and the file format of the image. For an image sequence, only the information for the first image in the sequence is returned. You can specify more than one filename but only one filehandle:

    ($width, $height, $size, $format) = $image->Ping('logo.gif');
    ($width, $height, $size, $format) = $image->Ping(file=>\*IMAGE);

86.0.116  Profile()

add, remove, or apply an image profile.

$image- > Profile(filename= > , profile= > )

The Profile() method adds, removes, or applies an image profile. The two most common profiles are ICC, a color management option, and IPTC, a newswire profile. Profile is a Perl variable representing the binary profile information.

86.0.117  Quantize()

set the maximum number of colors in an image.

$image- > Quantize(colors= > , colorspace= > , dither= > , global_colormap= > measure_error= > , tree_depth= > )

The Quantize() method sets the maximum number of colors in an image. If the number of colors in the image exceeds colors, a color reduction algorithm repeatly merges pixels of similar color until the total number of unique colors is less or equal to the maximum. Here is a description of the color reduction parameters:

colors
Set the maximum number of colors in the image.
colorspace
By default, color merging is performed in the RGB colorspace. However, RGB is not perceptually uniform like YCbCr for example. You may get better results by trying one of the following colorspaces:

0000¯1111111111111111¯2222222222222222¯3333333333333333  CMYK  Gray  OHTA
 RGB  sRGB  Transparent
 XYZ  YCbCr  YCC
 YIQ  YPbPr  YUV

dither
Images which suffer from severe contouring when reducing colors can be improved with this option.
global_colormap
A value other than 0 creates one global colormap for a sequence of images.
measure_error
A value other than 0 returns a measure of how closely the color reduced image matches the original. The mean error, normalized mean error, and normalized maximum mean error per pixel are computed. Obtain these values with the Get() method.
tree_depth
By default, the color reduction uses a Oct-tree algorithm whose depth ranges from 1-8 which is optimally determined to allow the best representation of the image with the fastest computational speed and least amount of memory consumption. You can override the default with this parameter.

86.0.118  QueryColor()

return numerical values corresponding to a color name.

$image- > QueryColor( ... )

QueryColor() accepts one or more color names and returns their respective red, green, blue, and opacity values:

    ($red, $green, $blue, $opacity) = $image->QueryColor('red');

86.0.119  QueryColorName()

return a color name corresponding to the numerical values.

$image- > QueryColorName( ... )

QueryColorName() accepts one or more numerical values and returns their respective color name:

    $color = $image->QueryColorName('rgba(65535,0,0,0)');

86.0.120  QueryFontMetric()

query font metrics.

$image- > QueryFontMetrics(font=>, ... )

QueryFontMetrics() accepts a font name and any parameter acceptable to Annotate(). The method returns these attributes associated with the given font:

For example,

    @metrics = $image->QueryFontMetrics(font=>'arial.ttf', pointsize=>24);

86.0.121  Raise()

lighten or darken edges to create a 3-D effect.

$image- > Raise(geometry= > , width= > , height= > , raise= > )

Raise() creates a simulated three-dimensional button-like effect by lightening and darkening the edges of the image. Width and height specify the width of the vertical and horizontal edge of the effect. Use Geometry as a shortcut for width and height (e.g. 10x10).

A value other than 0 for raise simulates a raised button-like effect otherwise a sunken button-like effect is applied to the image.

86.0.122  Read()

read one or more image files.

$image- > Read(filename= > , file= > )

filename
the name of an image file.
file-handle
read the image from an open filehandle.

The Read() method reads an image or image sequence from one or more filenames or the filehandle you specify. You can specify more than one filename but only one filehandle:

    $image->Read(filename=$>$'logo.gif');    # read a single GIF into
                                             # $image object.
    $image->Read('logo.jpg', 'button.gif');  # read two images.
    $image->Read('*.png');                   # read all the PNG files in the
                                             # current directory.
    $image->Read(file=$>$\*IMAGE);           # read from open Perl filehandle.

Read() returns the number of images that were successfully read.

86.0.123  ReduceNoise()

smooth an image.

$image- > ReduceNoise(radius= > )

The ReduceNoise() method smooths the contours of an image while still preserving edge information. The algorithm works by replacing each pixel with its neighbor closest in value. A neighbor is defined by radius. Use a radius of 0 and ReduceNoise() selects a suitable radius for you.

86.0.124  Resize()

scale an image with a filter.

$image- > Resize(geometry= > , width= > , height= > , filter= > , blur= > )

Resize() scales an image to the desired dimensions with one of these filters:

0000¯1111111111111111¯2222222222222222¯3333333333333333  Bessel  Blackman  Bessel
 Catrom  Cubic  Gaussian
 Hanning  Hermite  Lanczos
 Mitchell  Point  Quadratic
 Sinc  Triangle  

The default is Lanczos.

Use width and height to specify the image size, or use geometry as a shortcut (e.g. 640x480).

Set Blur to a value greater than 1 to blur the image as it is scaled. A value less than 1 sharpens as the image is scaled.

86.0.125  Roll()

offset and roll over an image.

$image- > Roll(geometry= > , x= > , y= > )

Roll() offsets an image as defined by x and y. Geometry represents + x + y as one parameter (e.g. +10+20).

86.0.126  Rotate()

rotate an image.

$image- > Rotate(degrees= > , color= > )

Rotate() rotates an image around the x axis by the number of degrees by degrees. Any empty spaces are filled with color.

86.0.127  Sample()

sample an image.

$image- > Sample(geometry= > , width= > , height= > )

Sample() scales an image to the desired dimensions with pixel sampling. Unlike other scaling methods, this method does not introduce any additional color into the scaled image.

Use width and height to specify the image size, or use geometry as a shortcut (e.g. 640x480).

86.0.128  Scale()

Scale an image to given dimensions.

$image- > Scale(geometry= > , width= > , height= > )

Scale() changes the size of an image to the given dimensions. Use width and height to specify the image size, or use geometry as a shortcut (e.g. 640x480).

86.0.129  Segment()

segment an image.

$image- > Segment(geometry= > , cluster_threshold= > , smoothing_threshold= > , colorspace= > , verbose= > )

Segment() segments an image by by analyzing the histograms of the color components and identifying units that are homogeneous. The default value for cluster_threshold is 1.0 and smoothing_threshold is 1.5. This can be represented with a shortcut geometry of 1.0x1.5.

86.0.130  Set()

set an image attribute.

$image- > Set(, ...)

Set() accepts one or more image attributes listed in section 22.1 and sets their value.

86.0.131  Shade()

shade the image with light source.

$image- > Shade(geometry= > , azimuth= > , elevation= > , color= > )

Shade() shines a distant light on an image to create a three-dimensional effect. You control the positioning of the light with and ; azimuth is measured in degrees off the x axis and elevation is measured in pixels above the Z axis. The geometry parameter is a shortcut for azimuth x elevation (e.g. 30x30).

86.0.132  Sharpen()

sharpen an image.

$image- > Sharpen(geometry= > , radius= > , sigma= > )

Sharpen() sharpens an image. We convolve the image with a Gaussian operator of the given radius and standard deviation (sigma). For reasonable results, radius should be larger than sigma. Use a radius of 0 and Sharpen() selects a suitable radius for you. Geometry represents radius x sigma as one parameter (e.g. 0x1).

86.0.133  Shear()

shear an image.

$image- > Shear(geometry= > , x= > , y= > , color= > )

Shear() transforms an image by shearing it along the x or y axis. The x and y parameters specify the degree of shear and ranges from -179.9 to 179.9. Geometry represents x x y as one parameter (e.g. 30x60). Any empty spaces created when shearing are filled with color.

86.0.134  Signature()

generate an MD5 signature.

$image- > Signature()

Signature() generates an MD5 digital signature. The signature can later be used to verify the color integrity of the image. Two images with the same signature are identical.

86.0.135  Solarize()

apply solorization special effect.

$image- > Solarize(threshold= > )

Solarize() applies a special effect to the image, similar to the effect achieved in a photo darkroom by selectively exposing areas of photo sensitive paper to light. Threshold ranges from 0 to MaxRGB and is a measure of the extent of the solarization.

86.0.136  Spread()

randomly displace pixels.

$image- > Spread(amount= > )

Spead() is a special effects method that randomly displaces each pixel in a block defined by the amount parameter.

86.0.137  Stereo()

create a stereo special effect.

$image- > Stereo(image= > )

Stereo() combines two images and produces a single image that is the composite of a left and right image of a stereo pair. Special red-green stereo glasses are required to view this effect.

86.0.138  Stegano()

hide a digital watermark.

$image- > Stegano(image= > , offset= > )

Use Stegano() to hide a digital watermark within the image. Recover the hidden watermark later to prove that the authenticity of an image. textttOffset defines the start position within the image to hide the watermark.

86.0.139  Swirl()

swirl pixels about image center.

$image- > Swirl(degrees= > )

The Swirl() method swirls the pixels about the center of the image, where degrees indicates the sweep of the arc through which each pixel is moved. You get a more dramatic effect as the degrees move from 1 to 360.

86.0.140  Texture()

tile a texture on image background.

$image- > Texture(texture= > )

Texture() repeatedly tiles the texture image across and down the image canvas.

86.0.141  Threshold()

divide pixels based on intensity values.

$image- > Threshold(threshold= > )

Threshold() changes the value of individual pixels based on the intensity of each pixel compared to threshold. The result is a high-contrast, two color image.

86.0.142  Transform()

resize or crop.

$image- > Transform(geometry= > , crop= > )

Transform() behaves like Resize() or Crop() but rather than acting on the image, it returns a new image handle:

    $slices = $image->Transform(crop=>'100x100')

86.0.143  Transparent()

make color transparent.

$image- > Transparent(color= > , opacity= > fuzz= > )

Transparent() changes the opacity value associated with any pixel that matches color to the value defined by opacity.

By default color must match a particular pixel color exactly. However, in many cases two colors may differ by a small amount. Fuzz defines how much tolerance is acceptable to consider two colors as the same. For example, set fuzz to 10 and the color red at intensities of 100 and 102 respectively are now interpreted as the same color.

86.0.144  Trim()

remove background color from edges of image.

$image- > Trim(fuzz= > )

Trim() crops a rectangular box around the image to remove edges that are the background color.

By default the edge pixels must match in color exactly to be trimmed. However, in many cases two colors may differ by a small amount. Fuzz defines how much tolerance is acceptable to consider two colors as the same. For example, set fuzz to 10 and the color red at intensities of 100 and 102 respectively are now interpreted as the same color.

86.0.145  UnsharpMask()

sharpen an image.

$image- > UnsharpMask(geometry= > , radius= > , sigma= > , amount= > , threshold= > )

UnsharpMask() sharpens an image. We convolve the image with a Gaussian operator of the given radius and standard deviation (sigma). For reasonable results, radius should be larger than sigma. Use a radius of 0 and UnsharpMask() selects a suitable radius for you. Geometry represents radius x sigma as one parameter (e.g. 0x1).

86.0.146  Wave()

special effects filter.

$image- > Wave(geometry= > , amplitude= > , wavelength= > )

The Wave() filter creates a "ripple" effect in the image by shifting the pixels vertically along a sine wave whose amplitude and wavelength is specified by the given parameters. Geometry represents amplitude x wavelength as one parameter (e.g. 30x30).

86.0.147  Write()

write one or more image files.

$image- > Write(filename= > , file= > )

Write() allows you to write a single or image or a sequence to a file or filehandle. You can specify more than one filename but only one filehandle:

    $image->Write(filename=>'logo.gif');     # write a single GIF image.
    $image->Write('logo.jpg', 'button.gif'); # write two images.
    $image->Write('gif:-');                  # write to STDOUT.
    $image->[0]->Write('logo.png');          # write only first image
                                             # in a sequence.
    $image->Write(file=>\*IMAGE);            # write to a open Perl filehandle.

Write() returns the number of images that were written.

87  Image::Magick Errors

Most Image::Magick methods return an undefined value if the operation was successful. When an error occurs, a message is returned with an embedded numeric status code. Look up the status code in table to determine the reason the operation failed. The mnemonics are aliases for the the corresponding numeric codes.

Table 25: Error and Warning Codes
Error and Warning Codes
Code Mnemonic Description
Error and Warning Codes (continued)
Code Mnemonic Description
0 Success Method completed without an error or warning.
300 ResourceLimitWarning A program resource is exhausted (e.g. not enough memory).
305 XServerWarning An X resource is unavailable.
310 OptionWarning An option parameter was malformed.
315 DelegateWarning An ImageMagick delegate returned a warning.
320 MissingDelegateWarning The image type can not be read or written because the required delegate is missing.
325 CorruptImageWarning The image file may be corrupt.
330 FileOpenWarning The image file could not be opened.
335 BlobWarning A Binary Large OBject could not be allocated.
340 CacheWarning Pixels could not be saved to the pixel cache.
400 ResourceLimitError A program resource is exhausted (e.g. not enough memory).
405 XServerError An X resource is unavailable.
410 OptionError An option parameter was malformed.
415 DelegateError An ImageMagick delegate returned a warning.
420 MissingDelegateError The image type can not be read or written because the required delegate is missing.
425 CorruptImageError The image file may be corrupt.
430 FileOpenError The image file could not be opened.
435 BlobError A Binary Large OBject could not be allocated.
440 CacheError Pixels could not be saved to the pixel cache.

Recognized Color Keyword Names

Recognized Color Keyword Names

The following is the list of recognized color keywords that can be used whenever a color is needed for the ImageMagick command-line utilities or API methods. The color keyword names follow the W3C SVG 1.0 Specification with the addition of gray color names gray1 thru gray100.

Table 26: Color Names
ImageMagick Colors
Color Name Color Name
ImageMagick Colors (continued)
Color Name Color Name
aliceblue rgba(240, 248, 255, 0)            gray71 rgba(181, 181, 181, 0)
antiquewhite rgba(250, 235, 215, 0)            gray72 rgba(184, 184, 184, 0)
aqua rgba(0, 255, 255, 0)            gray73 rgba(186, 186, 186, 0)
aquamarine rgba(127, 255, 212, 0)            gray74 rgba(189, 189, 189, 0)
azure rgba(240, 255, 255, 0)            gray75 rgba(191, 191, 191, 0)
beige rgba(245, 245, 220, 0)            gray76 rgba(194, 194, 194, 0)
bisque rgba(255, 228, 196, 0)            gray77 rgba(196, 196, 196, 0)
black rgba(0, 0, 0, 0)            gray78 rgba(199, 199, 199, 0)
blanchedalmond rgba(255, 235, 205, 0)            gray79 rgba(201, 201, 201, 0)
blue rgba(0, 0, 255, 0)            gray8 rgba(20, 20, 20, 0)
blueviolet rgba(138, 43, 226, 0)            gray80 rgba(204, 204, 204, 0)
brown rgba(165, 42, 42, 0)            gray81 rgba(207, 207, 207, 0)
burlywood rgba(222, 184, 135, 0)            gray82 rgba(209, 209, 209, 0)
cadetblue rgba(95, 158, 160, 0)            gray83 rgba(212, 212, 212, 0)
chartreuse rgba(127, 255, 0, 0)            gray84 rgba(214, 214, 214, 0)
chocolate rgba(210, 105, 30, 0)            gray85 rgba(217, 217, 217, 0)
coral rgba(255, 127, 80, 0)            gray86 rgba(219, 219, 219, 0)
cornflowerblue rgba(100, 149, 237, 0)            gray87 rgba(222, 222, 222, 0)
cornsilk rgba(255, 248, 220, 0)            gray88 rgba(224, 224, 224, 0)
crimson rgba(220, 20, 60, 0)            gray89 rgba(227, 227, 227, 0)
cyan rgba(0, 255, 255, 0)            gray9 rgba(23, 23, 23, 0)
darkblue rgba(0, 0, 139, 0)            gray90 rgba(229, 229, 229, 0)
darkcyan rgba(0, 139, 139, 0)            gray91 rgba(232, 232, 232, 0)
darkgoldenrod rgba(184, 134, 11, 0)            gray92 rgba(235, 235, 235, 0)
darkgray rgba(169, 169, 169, 0)            gray93 rgba(237, 237, 237, 0)
darkgreen rgba(0, 100, 0, 0)            gray94 rgba(240, 240, 240, 0)
darkgrey rgba(169, 169, 169, 0)            gray95 rgba(242, 242, 242, 0)
darkkhaki rgba(189, 183, 107, 0)            gray96 rgba(245, 245, 245, 0)
darkmagenta rgba(139, 0, 139, 0)            gray97 rgba(247, 247, 247, 0)
darkolivegreen rgba(85, 107, 47, 0)            gray98 rgba(250, 250, 250, 0)
darkorange rgba(255, 140, 0, 0)            gray99 rgba(252, 252, 252, 0)
darkorchid rgba(153, 50, 204, 0)            green rgba(0, 128, 0, 0)
darkred rgba(139, 0, 0, 0)            greenyellow rgba(173, 255, 47, 0)
darksalmon rgba(233, 150, 122, 0)            grey rgba(128, 128, 128, 0)
darkseagreen rgba(143, 188, 143, 0)            honeydew rgba(240, 255, 240, 0)
darkslateblue rgba(72, 61, 139, 0)            hotpink rgba(255, 105, 180, 0)
darkslategray rgba(47, 79, 79, 0)            indianred rgba(205, 92, 92, 0)
darkslategrey rgba(47, 79, 79, 0)            indigo rgba(75, 0, 130, 0)
darkturquoise rgba(0, 206, 209, 0)            ivory rgba(255, 255, 240, 0)
darkviolet rgba(148, 0, 211, 0)            khaki rgba(240, 230, 140, 0)
deeppink rgba(255, 20, 147, 0)            lavender rgba(230, 230, 250, 0)
deepskyblue rgba(0, 191, 255, 0)            lavenderblush rgba(255, 240, 245, 0)
dimgray rgba(105, 105, 105, 0)            lawngreen rgba(124, 252, 0, 0)
dimgrey rgba(105, 105, 105, 0)            lemonchiffon rgba(255, 250, 205, 0)
dodgerblue rgba(30, 144, 255, 0)            lightblue rgba(173, 216, 230, 0)
firebrick rgba(178, 34, 34, 0)            lightcoral rgba(240, 128, 128, 0)
floralwhite rgba(255, 250, 240, 0)            lightcyan rgba(224, 255, 255, 0)
forestgreen rgba(34, 139, 34, 0)            lightgoldenrodyellow rgba(250, 250, 210, 0)
fractal rgba(128, 128, 128, 0)            lightgray rgba(211, 211, 211, 0)
fuchsia rgba(255, 0, 255, 0)            lightgreen rgba(144, 238, 144, 0)
gainsboro rgba(220, 220, 220, 0)            lightgrey rgba(211, 211, 211, 0)
ghostwhite rgba(248, 248, 255, 0)            lightpink rgba(255, 182, 193, 0)
gold rgba(255, 215, 0, 0)            lightsalmon rgba(255, 160, 122, 0)
goldenrod rgba(218, 165, 32, 0)            lightseagreen rgba(32, 178, 170, 0)
gray rgba(126, 126, 126, 0)            lightskyblue rgba(135, 206, 250, 0)
gray0 rgba(0, 0, 0, 0)            lightslategray rgba(119, 136, 153, 0)
gray1 rgba(3, 3, 3, 0)            lightslategrey rgba(119, 136, 153, 0)
gray10 rgba(26, 26, 26, 0)            lightsteelblue rgba(176, 196, 222, 0)
gray100 rgba(255, 255, 255, 0)            lightyellow rgba(255, 255, 224, 0)
gray11 rgba(28, 28, 28, 0)            lime rgba(0, 255, 0, 0)
gray12 rgba(31, 31, 31, 0)            limegreen rgba(50, 205, 50, 0)
gray13 rgba(33, 33, 33, 0)            linen rgba(250, 240, 230, 0)
gray14 rgba(36, 36, 36, 0)            magenta rgba(255, 0, 255, 0)
gray15 rgba(38, 38, 38, 0)            maroon rgba(128, 0, 0, 0)
gray16 rgba(41, 41, 41, 0)            mediumaquamarine rgba(102, 205, 170, 0)
gray17 rgba(43, 43, 43, 0)            mediumblue rgba(0, 0, 205, 0)
gray18 rgba(46, 46, 46, 0)            mediumorchid rgba(186, 85, 211, 0)
gray19 rgba(48, 48, 48, 0)            mediumpurple rgba(147, 112, 219, 0)
gray2 rgba(5, 5, 5, 0)            mediumseagreen rgba(60, 179, 113, 0)
gray20 rgba(51, 51, 51, 0)            mediumslateblue rgba(123, 104, 238, 0)
gray21 rgba(54, 54, 54, 0)            mediumspringgreen rgba(0, 250, 154, 0)
gray22 rgba(56, 56, 56, 0)            mediumturquoise rgba(72, 209, 204, 0)
gray23 rgba(59, 59, 59, 0)            mediumvioletred rgba(199, 21, 133, 0)
gray24 rgba(61, 61, 61, 0)            midnightblue rgba(25, 25, 112, 0)
gray25 rgba(64, 64, 64, 0)            mintcream rgba(245, 255, 250, 0)
gray26 rgba(66, 66, 66, 0)            mistyrose rgba(255, 228, 225, 0)
gray27 rgba(69, 69, 69, 0)            moccasin rgba(255, 228, 181, 0)
gray28 rgba(71, 71, 71, 0)            navajowhite rgba(255, 222, 173, 0)
gray29 rgba(74, 74, 74, 0)            navy rgba(0, 0, 128, 0)
gray3 rgba(8, 8, 8, 0)            none rgba(0, 0, 0, 255)
gray30 rgba(77, 77, 77, 0)            oldlace rgba(253, 245, 230, 0)
gray31 rgba(79, 79, 79, 0)            olive rgba(128, 128, 0, 0)
gray32 rgba(82, 82, 82, 0)            olivedrab rgba(107, 142, 35, 0)
gray33 rgba(84, 84, 84, 0)            orange rgba(255, 165, 0, 0)
gray34 rgba(87, 87, 87, 0)            orangered rgba(255, 69, 0, 0)
gray35 rgba(89, 89, 89, 0)            orchid rgba(218, 112, 214, 0)
gray36 rgba(92, 92, 92, 0)            palegoldenrod rgba(238, 232, 170, 0)
gray37 rgba(94, 94, 94, 0)            palegreen rgba(152, 251, 152, 0)
gray38 rgba(97, 97, 97, 0)            paleturquoise rgba(175, 238, 238, 0)
gray39 rgba(99, 99, 99, 0)            palevioletred rgba(219, 112, 147, 0)
gray4 rgba(10, 10, 10, 0)            papayawhip rgba(255, 239, 213, 0)
gray40 rgba(102, 102, 102, 0)            peachpuff rgba(255, 218, 185, 0)
gray41 rgba(105, 105, 105, 0)            peru rgba(205, 133, 63, 0)
gray42 rgba(107, 107, 107, 0)            pink rgba(255, 192, 203, 0)
gray43 rgba(110, 110, 110, 0)            plum rgba(221, 160, 221, 0)
gray44 rgba(112, 112, 112, 0)            powderblue rgba(176, 224, 230, 0)
gray45 rgba(115, 115, 115, 0)            purple rgba(128, 0, 128, 0)
gray46 rgba(117, 117, 117, 0)            red rgba(255, 0, 0, 0)
gray47 rgba(120, 120, 120, 0)            rosybrown rgba(188, 143, 143, 0)
gray48 rgba(122, 122, 122, 0)            royalblue rgba(65, 105, 225, 0)
gray49 rgba(125, 125, 125, 0)            saddlebrown rgba(139, 69, 19, 0)
gray5 rgba(13, 13, 13, 0)            salmon rgba(250, 128, 114, 0)
gray50 rgba(127, 127, 127, 0)            sandybrown rgba(244, 164, 96, 0)
gray51 rgba(130, 130, 130, 0)            seagreen rgba(46, 139, 87, 0)
gray52 rgba(133, 133, 133, 0)            seashell rgba(255, 245, 238, 0)
gray53 rgba(135, 135, 135, 0)            sienna rgba(160, 82, 45, 0)
gray54 rgba(138, 138, 138, 0)            silver rgba(192, 192, 192, 0)
gray55 rgba(140, 140, 140, 0)            skyblue rgba(135, 206, 235, 0)
gray56 rgba(143, 143, 143, 0)            slateblue rgba(106, 90, 205, 0)
gray57 rgba(145, 145, 145, 0)            slategray rgba(112, 128, 144, 0)
gray58 rgba(148, 148, 148, 0)            slategrey rgba(112, 128, 144, 0)
gray59 rgba(150, 150, 150, 0)            snow rgba(255, 250, 250, 0)
gray6 rgba(15, 15, 15, 0)            springgreen rgba(0, 255, 127, 0)
gray60 rgba(153, 153, 153, 0)            steelblue rgba(70, 130, 180, 0)
gray61 rgba(156, 156, 156, 0)            tan rgba(210, 180, 140, 0)
gray62 rgba(158, 158, 158, 0)            teal rgba(0, 128, 128, 0)
gray63 rgba(161, 161, 161, 0)            thistle rgba(216, 191, 216, 0)
gray64 rgba(163, 163, 163, 0)            tomato rgba(255, 99, 71, 0)
gray65 rgba(166, 166, 166, 0)            turquoise rgba(64, 224, 208, 0)
gray66 rgba(168, 168, 168, 0)            violet rgba(238, 130, 238, 0)
gray67 rgba(171, 171, 171, 0)            wheat rgba(245, 222, 179, 0)
gray68 rgba(173, 173, 173, 0)            white rgba(255, 255, 255, 0)
gray69 rgba(176, 176, 176, 0)            whitesmoke rgba(245, 245, 245, 0)
gray7 rgba(18, 18, 18, 0)            yellow rgba(255, 255, 0, 0)
gray70 rgba(179, 179, 179, 0)            yellowgreen rgba(154, 205, 50, 0)
gray71 rgba(181, 181, 181, 0)           

References

[1]
Holzwarth F., Lenz J. et al. (1999) 1readme. Further Details on Layout and LATEX code. Springer, Berlin Heidelberg

[13]
Turner, J. S. (1974) Double-diffusive phenomena. Ann. Rev. Fluid Mech. 6, 37-56

[14]
Turner, J. S. (1968) Double-diffusive phenomena. Ann. Rev. Fluid Mech. 33, 168-200

[15]
Normand, C., Pomeau, Y. (1977) Convective instability: a physicist's approach. Rev. Mod. Phys. 49, 581-623

[5]
Holzwarth F., Lenz J. et al. (1998) 1readme. Further Details on Layout and LATEX code. Springer, Berlin Heidelberg

[6]
Turner, J. S. (1974) Double-diffusive phenomena. Ann. Rev. Fluid Mech. 6, 37-56

[7]
Turner, J. S. (1968) Double-diffusive phenomena. Ann. Rev. Fluid Mech. 33, 168-200

[8]
Normand, C., Pomeau, Y. (1977) Convective instability: a physicist's approach. Rev. Mod. Phys. 49, 581-623

[9]
Holzwarth F., Lenz J. et al. (1998) 1readme. Further Details on Layout and LATEX code. Springer, Berlin Heidelberg

[10]
Turner, J. S. (1974) Double-diffusive phenomena. Ann. Rev. Fluid Mech. 6, 37-56

[16]
Turner, J. S. (1968) Double-diffusive phenomena. Ann. Rev. Fluid Mech. 33, 168-200

[17]
Normand, C., Pomeau, Y. (1977) Convective instability: a physicist's approach. Rev. Mod. Phys. 49, 581-623

[13]
Turner, J. S. (1974) Double-diffusive phenomena. Ann. Rev. Fluid Mech. 6, 37-56

[14]
Turner, J. S. (1968) Double-diffusive phenomena. Ann. Rev. Fluid Mech. 33, 168-200

[15]
Normand, C., Pomeau, Y. (1977) Convective instability: a physicist's approach. Rev. Mod. Phys. 49, 581-623

[16]
Turner, J. S. (1968) Double-diffusive phenomena. Ann. Rev. Fluid Mech. 33, 168-200

[17]
Normand, C., Pomeau, Y. (1977) Convective instability: a physicist's approach. Rev. Mod. Phys. 49, 581-623

Appendix A

Appendix A

Index (showing section)

ExceptionInfo, 83-4
ImageInfo, 83-7




File translated from TEX by TTH, version 2.88.
On 10 May 2001, 20:27.