transform - Methods to Transform an Image

- NAME
- SYNOPSIS
- FUNCTION DESCRIPTIONS

- ChopImage
- CoalesceImages
- CropImage
- DeconstructImages
- FlattenImage
- FlipImage
- FlopImage
- MosaicImages
- ProfileImage
- RollImage
- ShaveImage
- TransformImage

# NAME

transform - Methods to Transform an Image

# SYNOPSIS

Image * ChopImage( Image *image, const RectangleInfo *chop_info );

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

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

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

Image * FlattenImage( Image *image, ExceptionInfo *exception );

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

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

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

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

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

Image * ShaveImage( Image *image, const RectangleInfo *shave_info, ExceptionInfo *exception );

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

# FUNCTION DESCRIPTIONS

## ChopImage

Chop removes a region of an image and collapses the image to occupy the removed portion. If a NULL image is returned, check exception to determine why the operation failed.

The format of the ChopImage method is:

> Image *ChopImage ( Image *image, const RectangleInfo *chop_info );

          ExceptionInfo *exception)

A description of each parameter follows:

image:
  The image.

chop_info:
  Defines the region of the image to chop.

exception:
  Return any errors or warnings in this structure.

## CoalesceImages

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. On failure, check exception to determine the reason why the operation failed.

The format of the CoalesceImages method is:

> Image *CoalesceImages ( Image *image, ExceptionInfo *exception );

A description of each parameter follows:

image:
  The image sequence.

exception:
  Return any errors or warnings in this structure.

## CropImage

CropImage extracts a region of the image starting at the offset defined by crop_info. If a NULL image is returned, check exception to determine the reason why the operation failed.

The format of the CropImage method is:

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

A description of each parameter follows:

image:
  The image.

crop_info:
  Defines the region of the image to crop with members x, y, width, and height.

exception:
  Return any errors or warnings in this structure.

## DeconstructImages

DeconstructImages 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 CoalesceImages.

The format of the DeconstructImages method is:

> Image *DeconstructImages ( Image *image, ExceptionInfo *exception );

A description of each parameter follows:

image:
  The image.

exception:
  Return any errors or warnings in this structure.

## FlattenImage

Method FlattenImage merges a sequence of images. This is useful for combining Photoshop layers into a single image.

The format of the FlattenImage method is:

> Image *FlattenImage ( Image *image, ExceptionInfo *exception );

A description of each parameter follows:

image:
  The 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.

## FlipImage

FlipImage creates a vertical mirror image by reflecting the pixels around the central x-axis. If a NULL image is returned, check exception to determine the reason why the operation failed.

The format of the FlipImage method is:

> Image *FlipImage ( Image *image, ExceptionInfo *exception );

A description of each parameter follows:

image:
  The image.

exception:
  Return any errors or warnings in this structure.

## FlopImage

FlopImage creates a horizontal mirror image by reflecting the pixels around the central y-axis. If a NULL image is returned, check exception to determine the reason why the operation failed.

The format of the FlopImage method is:

> Image *FlopImage ( Image *image, ExceptionInfo *exception );

A description of each parameter follows:

image:
  The image.

exception:
  Return any errors or warnings in this structure.

## MosaicImages

The MosaicImages method takes a set of images and inlays them to form a single coherent pictiure. MosaicImages returns a single image with each image in the sequence inlayed in the image canvas at an offset as defined in the image. If a NULL image is returned, check exception to determine the reason why the operation failed.

The format of the MosaicImage method is:

> Image *MosaicImages ( const Image *image, ExceptionInfo *exception );

A description of each parameter follows:

image:
  The image.

exception:
  Return any errors or warnings in this structure.

## ProfileImage

ProfileImage adds or removes a ICM, IPTC, or generic profile to an image. If the profile name is defined it is deleted from the image. If a filename is given, one or more profiles are read and added to the image. ProfileImage returns a value other than 0 if the profile is successfully added or removed from the image.

The format of the ProfileImage method is:

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

A description of each parameter follows:

image:
  The image.

profile_name:
  Type of profile to add or remove.

filename:
  Filename of the ICM, IPTC, or generic profile.

## RollImage

RollImage offsets an image as defined by x and y. If a NULL image is returned, check exception to determine the reason why the operation failed.

The format of the RollImage method is:

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

A description of each parameter follows:

image:
  The image.

x_offset:
  The number of columns to roll in the horizontal direction.

y_offset:
  The number of rows to roll in the vertical direction.

exception:
  Return any errors or warnings in this structure.

## ShaveImage

Method ShaveImage shaves pixels from the image edges. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.

The format of the ShaveImage method is:

> Image *ShaveImage ( Image *image, const RectangleInfo *shave_info, ExceptionInfo *exception );

A description of each parameter follows:

shave_image:
  Method ShaveImage returns a pointer to the shaved image. A null image is returned if there is a memory shortage or if the image width or height is zero.

image:
  The image.

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

## TransformImage

TransformImage is a convenience method that behaves like ResizeImage or CropImage but accepts scaling and/or cropping information as a region geometry specification. If the operation fails, the original image handle is returned.

The format of the TransformImage method is:

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

A description of each parameter follows:

image:
  The image The transformed image is returned as this parameter.

crop_geometry:
  A crop geometry string. This geometry defines a subregion of the image to crop.

image_geometry:
  An image geometry string. This geometry defines the final size if the image.