0image - ImageMagick Image Methods;/


NAME



!image - ImageMagick Image Methods




(

SYNOPSIS



:allocated_image=AllocateImage(image_info)

3AnnotateImage(image,annotate_info)

+AppendImages(images,stack)

5averaged_image=AverageImages(images)

>bordered_image=BorderImage(image,border_info)

6chop_image=ChopImage(image,chop_info)

Hcloned_info=CloneAnnotateInfo(image_info,annotate_info)

Hclone_image=CloneImage(image,columns,rows,clone_pixels)

7cloned_info=CloneImageInfo(image_info)

"CloseImage(image)

BColorFloodfillImage(image,target,tile,x,y,method)

<ColorizeImage(image,opaque_color,pen_color)

-CommentImage(image,comments)

PCompositeImage(image,compose,composite_image,x_offset,y_offset)

(CompressColormap(image)

%CondenseImage(image)

-ContrastImage(image,sharpen)

Gimage=CreateImage(width,height,red,green,blue,opacity)

9cropped_image=CropImage(image,crop_info)

1CycleColormapImage(image,amount)

2DescribeImage(image,file,verbose)

3DestroyAnnotateInfo(annotate_info)

$DestroyImage(image)

-DestroyImageInfo(image_info)

%DestroyImages(image)

1DestroyMontageInfo(montage_info)

/DrawImage(image,annotate_info)

%EqualizeImage(image)

/flipped_image=FlipImage(image)

/flopped_image=FlopImage(image)

:framed_image=FrameImage(image,frame_info)

(GammaImage(image,gamma)

:GetAnnotateInfo(image_info,annotate_info)

)GetImageInfo(image_info)

)type=GetImageType(image)

-GetMontageInfo(montage_info)

.scenes=GetNumberScenes(image)

8GetPixels(image,red,green,blue,opacity)

,status=IsGeometry(geometry)

*status=IsGrayImage(image)

0status=IsMonochromeImage(image)

5status=IsSubimage(geometry,pedantic)

(status=IsTainted(image)

(LabelImage(image,label)

(LayerImage(image,layer)

>images=ListToGroupImage(images,number_images)

4magnified_image=MagnifyImage(image)

CMatteFloodfillImage(image,target,matte,x,y,method)

"MatteImage(image)

2minified_image=MinifyImage(image)

.ModulateImage(image,modulate)

9MogrifyImage(image_info,argc,argv,image)

;MogrifyImages(image_info,argc,argv,images)

3MontageImages(images,montage_info)

@morphed_image=MorphImages(images,number_frames)

-NegateImage(image,grayscale)

&NormalizeImage(image)

1OpenImage(image_info,image,type)

Jflags=ParseImageGeometry(image_geometry,x,y,width,height)

<filesize=PingImage(image_info,columns,rows)

4RGBTransformImage(image,colorspace)

@rolled_image=RollImage(image,x_offset,y_offset)

>sampled_image=SampleImage(image,columns,rows)

<scaled_image=ScaleImage(image,columns,rows)

SetImage(image)

1SetImageInfo(image_info,rectify)

<stegano_image=SteganoImage(image,watermark)

Astereo_image=StereoImage(left_image,right_image)

!SyncImage(image)

,TextureImage(image,texture)

0ThresholdImage(image,threshold)

CTransformImage(image,crop_geometry,image_geometry)

4TransformRGBImage(image,colorspace)

.TransparentImage(image,color)

;zoomed_image=ZoomImage(image,columns,rows)




B

FUNCTION DESCRIPTIONS






2

AllocateImage



FMethod AllocateImage allocates an Image structure and initializes eachfield to a default value.

+The format of the AllocateImage routine is:

6

        allocated_image=AllocateImage(image_info)


(A description of each parameter follows:

>
allocated_image:


KMethod AllocateImage returns a pointer to an image structure initialized toGdefault values. A null image is returned if there is a memory shortage.$

image_info:


.Specifies a pointer to an ImageInfo structure.






:

AllocateNextImage



JMethod AllocateNextImage allocates an Image structure and initializes eachfield to a default value.

/The format of the AllocateNextImage routine is:

(

    AllocateImage(image_info,image)


(A description of each parameter follows:

$
image_info:


.Specifies a pointer to an ImageInfo structure.

image:


)The address of a structure of type Image.






2

AnnotateImage



AMethod AnnotateImage annotates an image with text. Optionally theHannotation can include the image filename, type, width, height, or scene.number by embedding special format characters.

+The format of the AnnotateImage routine is:

/

        AnnotateImage(image,annotate_info)


(A description of each parameter follows:


image:


)The address of a structure of type Image.'

annotate_info:


(The address of a AnnotateInfo structure.






0

AppendImages



KMethod AppendImages appends a set of images. All the input images must have>the same width or height. Images of the same width are stackedJtop-to-bottom. Images of the same height are stacked left-to-right. If theFstack is false, rectangular images are stacked left-to-right otherwisetop-to-bottom.

)The format of the AppendImage routine is:

'

        AppendImages(images,stack)


(A description of each parameter follows:

images:


BThe address of a structure of type Image; returned from ReadImage.

stack:


DAn unsigned value other than stacks rectangular images top-to-bottomotherwise left-to-right.






2

AverageImages



KMethod AverageImages averages a set of images. All the input images must bethe same size in pixels.

*The format of the AverageImage routine is:

1

        averaged_image=AverageImages(images)


(A description of each parameter follows:

(
averaged_image:


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

images:


BThe address of a structure of type Image; returned from ReadImage.






.

BorderImage



BMethod BorderImage takes an image and puts a border around it of aEparticular color. It allocates the memory necessary for the new Image1structure and returns a pointer to the new image.

)The format of the BorderImage routine is:

:

        bordered_image=BorderImage(image,border_info)


(A description of each parameter follows:

(
bordered_image:


KMethod BorderImage returns a pointer to the bordered image. A null image is'returned if there is a memory shortage.

image:


)The address of a structure of type Image.%

border_info:


FSpecifies a pointer to a structure of type Rectangle which defines theborder region.






*

ChopImage



GMethod ChopImage creates a new image that is a subregion of an existingFone. It allocates the memory necessary for the new Image structure and#returns a pointer to the new image.

'The format of the ChopImage routine is:

2

        chop_image=ChopImage(image,chop_info)


(A description of each parameter follows:

$
chop_image:


EMethod ChopImage returns a pointer to the chop image. A null image isIreturned if there is a memory shortage or if the image width or height iszero.

image:


)The address of a structure of type Image.#

chop_info:


FSpecifies a pointer to a RectangleInfo which defines the region of theimage to crop.






:

CloneAnnotateInfo



IMethod CloneAnnotateInfo makes a duplicate of the given annotate info, or$if annotate info is NULL, a new one.

/The format of the CloneAnnotateInfo routine is:

D

        cloned_info=CloneAnnotateInfo(image_info,annotate_info)


(A description of each parameter follows:

%
cloned_info:


KMethod CloneAnnotateInfo returns a duplicate of the given annotate info, or#if annotate info is NULL a new one.$

image_info:


a structure of type info.'

annotate_info:


a structure of type info.






,

CloneImage



JMethod CloneImage returns a copy of all fields of the input image. The the;pixel memory is allocated but the pixel data is not copied.

(The format of the CloneImage routine is:

D

        clone_image=CloneImage(image,columns,rows,clone_pixels)


(A description of each parameter follows:

%
clone_image:


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

image:


)The address of a structure of type Image.!

columns:


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

rows:


AAn integer that specifies the number of rows in the copied image.&

clone_pixels:


ISpecifies whether the pixel data is copied. Must be either True or False;






4

CloneImageInfo



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

,The format of the CloneImageInfo routine is:

3

        cloned_info=CloneImageInfo(image_info)


(A description of each parameter follows:

%
cloned_info:


HMethod CloneImageInfo returns a duplicate of the given image info, or ifimage info is NULL a new one.$

image_info:


a structure of type info.






,

CloseImage



JMethod CloseImage closes a file associated with the image. If the filename?prefix is '|', the file is a pipe and is closed with PipeClose.

(The format of the CloseImage routine is:



        CloseImage(image)


(A description of each parameter follows:


image:


)The address of a structure of type Image.






2

CoalesceImage



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

,The format of the CoalesceImages routine is:



    CoalesceImages(image)


(A description of each parameter follows:


image:


BThe address of a structure of type Image; returned from ReadImage.






>

ColorFloodfillImage



KMethod ColorFloodfillImage floodfills the designated area with a color. TheJfloodfill algorithm is strongly based on a similar algorithm in ``GraphicsGems'' by Paul Heckbert.

1The format of the ColorFloodfillImage routine is:

>

        ColorFloodfillImage(image,target,tile,x,y,method)


(A description of each parameter follows:


image:


)The address of a structure of type Image.

target:


GA RunlengthPacket structure. This is the RGB value of the target color.

tile:


<An image representing the image to tile onto the floodplane.

x,y:


?Unsigned integers representing the current location of the pen.

method:


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






2

ColorizeImage



IMethod ColorizeImage colorizes an image with the pen color. The amount of3the coloring is controlled with the opacity levels.

+The format of the ColorizeImage routine is:

8

        ColorizeImage(image,opaque_color,pen_color)


(A description of each parameter follows:


image:


BThe address of a structure of type Image; returned from ReadImage.1

opaque_color, pen_color:


4A character string that contain an X11 color string.






0

CommentImage



HMethod CommentImage initializes an image comment. Optionally the commentGcan include the image filename, type, width, height, or scene number by$embedding special format characters.

*The format of the CommentImage routine is:

)

        CommentImage(image,comments)


(A description of each parameter follows:


image:


)The address of a structure of type Image."

comments:


@The address of a character string containing the comment format.






8

CompressColormap



KMethod CompressColormap compresses an image colormap removing any duplicateand unused color entries.

.The format of the CompressColormap routine is:

$

        CompressColormap(image)


(A description of each parameter follows:


image:


)The address of a structure of type Image.






4

CompositeImage



KMethod CompositeImage returns the second image composited onto the first atthe specified offsets.

,The format of the CompositeImage routine is:

L

        CompositeImage(image,compose,composite_image,x_offset,y_offset)


(A description of each parameter follows:


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:


DAn integer that specifies the column offset of the composited image."

y_offset:


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






2

CondenseImage



AMethod CondenseImage compresses an image to the minimum number ofrunlength-encoded packets.

+The format of the CondenseImage routine is:

!

        CondenseImage(image)


(A description of each parameter follows:


image:


)The address of a structure of type Image.






2

ContrastImage



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

+The format of the ContrastImage routine is:

)

        ContrastImage(image,sharpen)


(A description of each parameter follows:


image:


BThe address of a structure of type Image; returned from ReadImage.!

sharpen:


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






.

CreateImage



GMethod CreateImage creates an image from the specified normalized pixelHdata and returns it. It allocates the memory necessary for the new Image1structure and returns a pointer to the new image.

)The format of the CreateImage routine is:

C

        image=CreateImage(width,height,red,green,blue,opacity)


(A description of each parameter follows:


image:


GMethod CreateImage returns a pointer to the image after reading. A nullIimage is returned if there is a memory shortage or if the image cannot beread.

width:


+Specifies the width in pixels of the image.

height:


,Specifies the height in pixels of the image.0

red,green,blue,opacity:


JThis array of normalized float values [0..1] contain the red, green, blue,Gand opacity components of the pixel data. The length of the arrays mustKequal the area specified by the width and height values. If you do not want9to initialize a particular component, specify it as NULL.






*

CropImage



GMethod CropImage creates a new image that is a subregion of an existingFone. It allocates the memory necessary for the new Image structure andIreturns a pointer to the new image. This routine is optimized to preserveGthe runlength encoding. That is, the cropped image will always use lessmemory than the original.

'The format of the CropImage routine is:

5

        cropped_image=CropImage(image,crop_info)


(A description of each parameter follows:

'
cropped_image:


HMethod CropImage returns a pointer to the cropped image. A null image isIreturned if there is a memory shortage or if the image width or height iszero.

image:


)The address of a structure of type Image.#

crop_info:


FSpecifies a pointer to a RectangleInfo which defines the region of theimage to crop.






<

CycleColormapImage



JMethod CycleColormapImage cycles the image colormap by a specified amount.

0The format of the CycleColormapImage routine is:

-

        CycleColormapImage(image,amount)


(A description of each parameter follows:


image:


BThe address of a structure of type Image; returned from ReadImage.

amount:


<An unsigned value that specifies the offset of the colormap.






2

DescribeImage



EMethod DescribeImage describes an image by printing its attributes tostdout.

+The format of the DescribeImage routine is:

.

        DescribeImage(image,file,verbose)


(A description of each parameter follows:


image:


)The address of a structure of type Image.

file:


'send the image attributes to this file.!

verbose:


Gan unsigned value other than zero prints detailed information about theimage.






>

DestroyAnnotateInfo



@Method DestroyAnnotateInfo deallocates memory associated with anAnnotateInfo structure.

1The format of the DestroyAnnotateInfo routine is:

/

        DestroyAnnotateInfo(annotate_info)


(A description of each parameter follows:

'
annotate_info:


1Specifies a pointer to an AnnotateInfo structure.






0

DestroyImage



@Method DestroyImage deallocates memory associated with an image.

*The format of the DestroyImage routine is:

        DestroyImage(image)


(A description of each parameter follows:


image:


)The address of a structure of type Image.






8

DestroyImageInfo



GMethod DestroyImageInfo deallocates memory associated with an ImageInfo structure.

.The format of the DestroyImageInfo routine is:

)

        DestroyImageInfo(image_info)


(A description of each parameter follows:

$
image_info:


.Specifies a pointer to an ImageInfo structure.






2

DestroyImages



HMethod DestroyImages deallocates memory associated with a linked list ofimages.

+The format of the DestroyImages routine is:

!

        DestroyImages(image)


(A description of each parameter follows:


image:


)The address of a structure of type Image.






<

DestroyMontageInfo



KMethod DestroyMontageInfo deallocates memory associated with an MontageInfo structure.

0The format of the DestroyMontageInfo routine is:

-

        DestroyMontageInfo(montage_info)


(A description of each parameter follows:

&
montage_info:


0Specifies a pointer to an MontageInfo structure.






*

DrawImage



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

'The format of the DrawImage routine is:

+

        DrawImage(image,annotate_info)


(A description of each parameter follows:


image:


)The address of a structure of type Image.'

annotate_info:


$The address of a DrawInfo structure.






2

EqualizeImage



EMethod EqualizeImage performs histogram equalization on the referenceimage.

+The format of the EqualizeImage routine is:

!

        EqualizeImage(image)


(A description of each parameter follows:


image:


BThe address of a structure of type Image; returned from ReadImage.






*

FlipImage



GMethod FlipImage creates a new image that reflects each scanline in theFvertical direction It allocates the memory necessary for the new Image1structure and returns a pointer to the new image.

'The format of the FlipImage routine is:

+

        flipped_image=FlipImage(image)


(A description of each parameter follows:

'
flipped_image:


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

image:


)The address of a structure of type Image.






*

FlopImage



GMethod FlopImage creates a new image that reflects each scanline in theHhorizontal direction It allocates the memory necessary for the new Image1structure and returns a pointer to the new image.

'The format of the FlopImage routine is:

+

        flopped_image=FlopImage(image)


(A description of each parameter follows:

'
flopped_image:


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

image:


)The address of a structure of type Image.






,

FrameImage



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

(The format of the FrameImage routine is:

6

        framed_image=FrameImage(image,frame_info)


(A description of each parameter follows:

&
framed_image:


HMethod 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:


ESpecifies a pointer to a FrameInfo structure which defines the framedregion.






,

GammaImage



IMethod GammaImage converts the reference image to gamma corrected colors.

(The format of the GammaImage routine is:

$

        GammaImage(image,gamma)


(A description of each parameter follows:


image:


BThe address of a structure of type Image; returned from ReadImage.

gamma:


<A character string indicating the level of gamma correction.






6

GetAnnotateInfo



>Method GetAnnotateInfo initializes the AnnotateInfo structure.

-The format of the GetAnnotateInfo routine is:

6

        GetAnnotateInfo(image_info,annotate_info)


(A description of each parameter follows:

$
image_info:


.Specifies a pointer to an ImageInfo structure.'

annotate_info:


0Specifies a pointer to a AnnotateInfo structure.






0

GetImageInfo



8Method GetImageInfo initializes the ImageInfo structure.

*The format of the GetImageInfo routine is:

%

        GetImageInfo(image_info)


(A description of each parameter follows:

$
image_info:


.Specifies a pointer to an ImageInfo structure.






0

GetImageType



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

*The format of the GetImageType routine is:

%

        type=GetImageType(image)


(A description of each parameter follows:


type:


KMethod 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.






4

GetMontageInfo



<Method GetMontageInfo initializes the MontageInfo structure.

,The format of the GetMontageInfo routine is:

)

        GetMontageInfo(montage_info)


(A description of each parameter follows:

&
montage_info:


/Specifies a pointer to a MontageInfo structure.






6

GetNumberScenes



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

-The format of the GetNumberScenes routine is:

*

        scenes=GetNumberScenes(image)


(A description of each parameter follows:

scenes:


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

image:


)The address of a structure of type Image.






*

GetPixels



FMethod GetPixels returns the pixel data of an image as normalized red, green, blue, and opacity values.

'The format of the GetPixels routine is:

4

        GetPixels(image,red,green,blue,opacity)


(A description of each parameter follows:


image:


BSpecifies a pointer to a Image structure; returned from ReadImage.0

red,green,blue,opacity:


EThese arrays are returned with the correponding red, green, blue, andKopacity values from the image. The length of the arrays must equal the areaIspecified by the columns and row values values of the Image structure. IfIyou do not want to initialize a particular component, specify it as NULL.






,

IsGeometry



HMethod IsGeometry returns True if the geometry specification is valid asdetermined by XParseGeometry.

(The format of the IsGeometry routine is:

(

        status=IsGeometry(geometry)


(A description of each parameter follows:

status:


EMethod IsGeometry returns True if the geometry specification is validotherwise False is returned."

geometry:


*This string is the geometry specification.






.

IsGrayImage



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

)The format of the IsGrayImage routine is:

&

        status=IsGrayImage(image)


(A description of each parameter follows:

status:


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

image:


BThe address of a structure of type Image; returned from ReadImage.






:

IsMonochromeImage



JMethod IsMonochromeImage returns True if the image is monochrome otherwiseDFalse is returned. If the image is DirectClass and monochrome, it isdemoted to PseudoClass.

/The format of the IsMonochromeImage routine is:

,

        status=IsMonochromeImage(image)


(A description of each parameter follows:

status:


JMethod IsMonochromeImage returns True if the image is monochrome otherwiseFalse is returned.

image:


BThe address of a structure of type Image; returned from ReadImage.






,

IsSubimage



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

(The format of the IsSubimage routine is:

1

        status=IsSubimage(geometry,pedantic)


(A description of each parameter follows:

status:


BMethod IsSubimage returns True if the geometry is a valid subimage*specification otherwise False is returned."

geometry:


*This string is the geometry specification."

pedantic:


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






*

IsTainted



HMethod IsTainted returns True if the image has been altered since it wasDfirst read or if any image in the sequence has a difference magic or filename.

'The format of the IsTainted routine is:

$

        status=IsTainted(image)


(A description of each parameter follows:

status:


HMethod IsTainted returns True if the image has been altered since it was first read.

image:


)The address of a structure of type Image.






,

LabelImage



FMethod LabelImage initializes an image label. Optionally the label canCinclude the image filename, type, width, height, or scene number by$embedding special format characters.

(The format of the LabelImage routine is:

$

        LabelImage(image,label)


(A description of each parameter follows:


image:


)The address of a structure of type Image.

label:


>The address of a character string containing the label format.






,

LayerImage



IMethod LayerImage extracts the specified layer from the references image.

(The format of the LayerImage routine is:

$

        LayerImage(image,layer)


(A description of each parameter follows:


image:


BThe address of a structure of type Image; returned from ReadImage.

layer:


AA value of type LayerType that identifies which layer to extract.






8

ListToGroupImage



HMethod ListToGroupImage converts a linked list of images to a sequentialarray.

.The format of the ListToGroupImage routine is:

:

        images=ListToGroupImage(images,number_images)


(A description of each parameter follows:

images:


HMethod ListToGroupImage converts a linked list of images to a sequentialarray and returns the array..

images:


BThe address of a structure of type Image; returned from ReadImage.'

number_images:


IA pointer to an unsigned integer. The number of images in the image arrayis returned here.






0

MagnifyImage



GMethod MagnifyImage creates a new image that is a integral size greaterIthan an existing one. It allocates the memory necessary for the new Image1structure and returns a pointer to the new image.

EMagnifyImage scans the reference image to create a magnified image byDbilinear interpolation. The magnified image columns and rows become:

  number_columns << 1




  number_rows << 1


*The format of the MagnifyImage routine is:

0

        magnified_image=MagnifyImage(image)


(A description of each parameter follows:

)
magnified_image:


IMethod MagnifyImage returns a pointer to the image after magnification. A5null image is returned if there is a memory shortage.

image:


)The address of a structure of type Image.






>

MatteFloodfillImage



FMethod MatteFloodfillImage floodfills the designated area with a matteJvalue. The floodfill algorithm is strongly based on a similar algorithm in#``Graphics Gems'' by Paul Heckbert.

1The format of the MatteFloodfillImage routine is:

?

        MatteFloodfillImage(image,target,matte,x,y,method)


(A description of each parameter follows:


image:


)The address of a structure of type Image.

target:


GA RunlengthPacket structure. This is the RGB value of the target color.

matte:


8A integer value representing the amount of transparency.

x,y:


?Unsigned integers representing the current location of the pen.

method:


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






,

MatteImage



IMethod MatteImage initializes the matte channel of the reference image toopaque.

(The format of the MatteImage routine is:



        MatteImage(image)


(A description of each parameter follows:


image:


BThe address of a structure of type Image; returned from ReadImage.






.

MinifyImage



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

CMinifyImage scans the reference image to create a minified image byGcomputing the weighted average of a 4x4 cell centered at each referenceJpixel. 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


DWeights assume that the importance of neighboring pixels is negatelyCproportional to the square of their distance from the target pixel.

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

)The format of the MinifyImage routine is:

.

        minified_image=MinifyImage(image)


(A description of each parameter follows:

(
minified_image:


HMethod MinifyImage returns a pointer to the image after reducing. A nullGimage is returned if there is a memory shortage or if the image size isless than IconSize*2.

image:


)The address of a structure of type Image.






2

ModulateImage



HMethod ModulateImage modulates the hue, saturation, and brightness of animage.

+The format of the ModulateImage routine is:

*

        ModulateImage(image,modulate)


(A description of each parameter follows:


image:


BThe address of a structure of type Image; returned from ReadImage."

modulate:


KA character string indicating the percent change in brightness, saturation,Kand hue in floating point notation separated by commas (e.g. 10.1,0.0,3.1).






0

MogrifyImage



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

*The format of the MogrifyImage routine is:

5

        MogrifyImage(image_info,argc,argv,image)


(A description of each parameter follows:

$
image_info:


.Specifies a pointer to an ImageInfo structure.

argc:


JSpecifies a pointer to an integer describing the number of elements in theargument vector.

argv:


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

image:


BThe address of a structure of type Image; returned from ReadImage.






2

MogrifyImages



FMethod MogrifyImages applies image processing options to a sequence of-images as prescribed by command line options.

*The format of the MogrifyImage routine is:

7

        MogrifyImages(image_info,argc,argv,images)


(A description of each parameter follows:

$
image_info:


.Specifies a pointer to an ImageInfo structure.

argc:


JSpecifies a pointer to an integer describing the number of elements in theargument vector.

argv:


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

images:


BThe address of a structure of type Image; returned from ReadImage.






2

MontageImages



CMethod MontageImages creates a composite image by combining severalseparate images.

+The format of the MontageImages routine is:

/

        MontageImages(images,montage_info)


(A description of each parameter follows:

images:


4Specifies a pointer to an array of Image structures.&

montage_info:


/Specifies a pointer to a MontageInfo structure.






.

MorphImages



IMethod MorphImages morphs a set of images. both the image pixels and sizeIare linearly interpolated to give the appearance of a meta-morphosis fromone image to the next.

(The format of the MorphImage routine is:

<

        morphed_image=MorphImages(images,number_frames)


(A description of each parameter follows:

'
morphed_image:


KMethod MorphImages returns an image sequence that has linearly interpolated)pixels and size between two input images.

images:


BThe address of a structure of type Image; returned from ReadImage.'

number_frames:


KThis unsigned integer reflects the number of in-between images to generate.3The more in-between frames, the smoother the morph.






.

NegateImage



KMethod NegateImage negates the colors in the reference image. The GrayscaleEoption means that only grayscale values within the image are negated.

)The format of the NegateImage routine is:

)

        NegateImage(image,grayscale)


(A description of each parameter follows:


image:


BThe address of a structure of type Image; returned from ReadImage.






4

NormalizeImage



KMethod NormalizeImage normalizes the pixel values to span the full range of7color values. This is a contrast enhancement technique.

,The format of the NormalizeImage routine is:

"

        NormalizeImage(image)


(A description of each parameter follows:


image:


BThe address of a structure of type Image; returned from ReadImage.






.

OpagueImage



IMethod OpaqueImage changes the color of an opaque pixel to the pen color.

)The format of the OpaqueImage routine is:

2

    OpaqueImage(image,opaque_color,pen_color)


(A description of each parameter follows:


image:


BThe address of a structure of type Image; returned from ReadImage.1

opaque_color, pen_color:


4A character string that contain an X11 color string.






*

OpenImage



JMethod OpenImage open a file associated with the image. A file name of '-'Csets the file to stdin for type 'r' and stdout for type 'w'. If theHfilename suffix is '.gz' or '.Z', the image is decompressed for type 'r'Jand compressed for type 'w'. If the filename prefix is '|', it is piped toor from a system command.

'The format of the OpenImage routine is:

-

        OpenImage(image_info,image,type)


(A description of each parameter follows:

$
image_info:


.Specifies a pointer to an ImageInfo structure.

image:


)The address of a structure of type Image.

type:


!'r' for reading; 'w' for writing.






<

ParseImageGeometry



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

0The format of the ParseImageGeometry routine is:

F

        flags=ParseImageGeometry(image_geometry,x,y,width,height)


(A description of each parameter follows:


flags:


GMethod ParseImageGeometry returns a bitmask that indicates which of the0four values were located in the geometry string.(

image_geometry:


ESpecifies a character string representing the geometry specification.

x,y:


IA pointer to an integer. The x and y offset as determined by the geometryspecification is returned here.&

width,height:


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






*

PingImage



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

'The format of the PingImage routine is:

8

        filesize=PingImage(image_info,columns,rows)


(A description of each parameter follows:

"
filesize:


IMethod 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.!

columns:


GAn unsigned integer pointer that specifies the number of columns in theimage.

rows:


KAn unsigned integer pointer that specifies the number of rows in the image.






:

RGBTransformImage



DMethod RGBTransformImage converts the reference image from RGB to anFalternate colorspace. The transformation matrices are not the standardIones: the weights are rescaled to normalized the range of the transformedvalues to be [0..MaxRGB].

/The format of the RGBTransformImage routine is:

0

        RGBTransformImage(image,colorspace)


(A description of each parameter follows:


image:


BThe address of a structure of type Image; returned from ReadImage.$

colorspace:


JAn unsigned integer value that indicates which colorspace to transform theimage.






*

RollImage



IMethod RollImage rolls an image vertically and horizontally. It allocatesIthe memory necessary for the new Image structure and returns a pointer tothe new image.

'The format of the RollImage routine is:

<

        rolled_image=RollImage(image,x_offset,y_offset)


(A description of each parameter follows:

&
rolled_image:


KMethod 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:


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

y_offset:


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






.

SampleImage



KMethod SampleImage creates a new image that is a scaled size of an existingGone using pixel sampling. It allocates the memory necessary for the new7Image structure and returns a pointer to the new image.

)The format of the SampleImage routine is:

:

        sampled_image=SampleImage(image,columns,rows)


(A description of each parameter follows:

'
sampled_image:


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

image:


)The address of a structure of type Image.!

columns:


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

rows:


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






,

ScaleImage



JMethod ScaleImage creates a new image that is a scaled size of an existingFone. It allocates the memory necessary for the new Image structure andJreturns a pointer to the new image. To scale a scanline from x pixels to yJpixels, each new pixel represents x/y old pixels. To read x/y pixels, readH(x/y rounded up) pixels but only count the required fraction of the lastHold pixel read in your new pixel. The remainder of the old pixel will becounted in the next new pixel.

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

(The format of the ScaleImage routine is:

8

        scaled_image=ScaleImage(image,columns,rows)


(A description of each parameter follows:

&
scaled_image:


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

image:


)The address of a structure of type Image.!

columns:


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

rows:


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






(

SetImage



HMethod SetImage initializes the reference image to the background color.

&The format of the SetImage routine is:



        SetImage(image)


(A description of each parameter follows:


image:


BThe address of a structure of type Image; returned from ReadImage.






0

SetImageInfo



CMethod SetImageInfo initializes the `magick' field of the ImageInfoEstructure. It is set to a type of image format based on the prefix orGsuffix of the filename. For example, `ps:image' returns PS indicating aFPostscript image. JPEG is returned for this filename: `image.jpg'. TheFfilename prefix has precendence over the suffix. Use an optional indexIenclosed in brackets after a file name to specify a desired subimage of aBmulti-resolution image format like Photo CD (e.g. img0001.pcd[4]).

*The format of the SetImageInfo routine is:

-

        SetImageInfo(image_info,rectify)


(A description of each parameter follows:

$
image_info:


.Specifies a pointer to an ImageInfo structure.!

rectify:


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






H

SortColormapByIntentsity



KMethod SortColormapByIntensity sorts the colormap of a PseudoClass image bydecreasing color intensity.

5The format of the SortColormapByIntensity routine is:

'

    SortColormapByIntensity(image)


(A description of each parameter follows:


image:


A pointer to a Image structure.






0

SteganoImage



?Method SteganoImage hides a digital watermark within the image.

*The format of the SteganoImage routine is:

8

        stegano_image=SteganoImage(image,watermark)


(A description of each parameter follows:

'
stegano_image:


JMethod SteganoImage returns a pointer to the steganographic image with theIwatermark 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.






.

StereoImage



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

)The format of the StereoImage routine is:

=

        stereo_image=StereoImage(left_image,right_image)


(A description of each parameter follows:

&
stereo_image:


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

left_image:


)The address of a structure of type Image.%

right_image:


)The address of a structure of type Image.






*

SyncImage



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

'The format of the SyncImage routine is:



        SyncImage(image)


(A description of each parameter follows:


image:


)The address of a structure of type Image.






0

TextureImage



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

*The format of the TextureImage routine is:

(

        TextureImage(image,texture)


(A description of each parameter follows:


image:


BThe address of a structure of type Image; returned from ReadImage.!

texture:


;This image contains the texture to layer on the background.






4

ThresholdImage



5Method ThresholdImage thresholds the reference image.

,The format of the ThresholdImage routine is:

,

        ThresholdImage(image,threshold)


(A description of each parameter follows:


image:


BThe address of a structure of type Image; returned from ReadImage.#

threshold:


(A double indicating the threshold value.






4

TransformImage



JMethod TransformImage creates a new image that is a transformed size of ofHexisting one as specified by the crop and image geometries. It allocatesIthe memory necessary for the new Image structure and returns a pointer tothe new image.

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

,The format of the TransformImage routine is:

?

        TransformImage(image,crop_geometry,image_geometry)


(A description of each parameter follows:


image:


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

crop_geometry:


FSpecifies a pointer to a crop geometry string. This geometry defines asubregion of the image.(

image_geometry:


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






:

TransformRGBImage



GMethod TransformRGBImage converts the reference image from an alternateFcolorspace. The transformation matrices are not the standard ones: theIweights are rescaled to normalized the range of the transformed values tobe [0..MaxRGB].

/The format of the TransformRGBImage routine is:

0

        TransformRGBImage(image,colorspace)


(A description of each parameter follows:


image:


BThe address of a structure of type Image; returned from ReadImage.$

colorspace:


DAn unsigned integer value that indicates the colorspace the image is<currently in. On return the image is in the RGB color space.






8

TransparentImage



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

.The format of the TransparentImage routine is:

*

        TransparentImage(image,color)


(A description of each parameter follows:


image:


BThe address of a structure of type Image; returned from ReadImage.

color:


4A character string that contain an X11 color string.






6

UncompressImage



IMethod UncondenseImage uncompresses runlength-encoded pixels packets to arectangular array of pixels.

-The format of the UncondenseImage routine is:

&

    status=UncondenseImage(image)


(A description of each parameter follows:

status:


JMethod UncondenseImage returns True if the image is uncompressed otherwiseFalse.

image:


)The address of a structure of type Image.






*

ZoomImage



IMethod ZoomImage creates a new image that is a scaled size of an existingFone. It allocates the memory necessary for the new Image structure andEreturns a pointer to the new image. The Point filter gives fast pixelKreplication, Triangle is equivalent to bi-linear interpolation, and MitchelIgiver slower, very high-quality results. See Graphic Gems III for detailson this algorithm.

'The format of the ZoomImage routine is:

7

        zoomed_image=ZoomImage(image,columns,rows)


(A description of each parameter follows:

&
zoomed_image:


KMethod 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:


DAn integer that specifies the number of columns in the zoomed image.

rows:


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