ImageMagick: MagickCore, C API for ImageMagick: Dealing with Image Layers
Author: ImageMagick Studio LLC
Description: ImageMagick® is a software suite to create, edit, and compose bitmap images. It can read, convert and write images in a variety of formats (about 100) including GIF, JPEG, JPEG-2000, PNG, PDF, PhotoCD, TIFF, and DPX. Use ImageMagick to translate, flip, mirror, rotate, scale, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves. ImageMagick is free software delivered as a ready-to-run binary distribution or as source code that you can freely use, copy, modify, and distribute. Its license is compatible with the GPL. It runs on all major operating systems. The functionality of ImageMagick is typically utilized from the command line or you can use the features from programs written in your favorite programming language. Choose from these interfaces: MagickCore (C), MagickWand (C), ChMagick (Ch), Magick++ (C++), JMagick (Java), L-Magick (Lisp), PascalMagick (Pascal), PerlMagick (Perl), MagickWand for PHP (P [cell cut: 1167 characters, first 1000 kept]
Keywords: magickcore, c, api, for, imagemagick:, dealing, with, image, layers, ImageMagick, ImageMagic, MagickCore, MagickWand, PerlMagick, Magick++, RMagick, PythonMagick, JMagick, TclMagick, Image, Magick, Magic, Wand

## CoalesceImages CoalesceImages() 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. CoalesceImages() 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. 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. ## DisposeImages DisposeImages() returns the coalesced frames of a GIF animation as it would appear after the GIF dispose method of that frame has been applied. That is it returned the appearance of each frame before the next is overlaid. The format of the DisposeImages method is:
      Image *DisposeImages(Image *image,ExceptionInfo *exception)
A description of each parameter follows: ##### image The image sequence. ##### exception Return any errors or warnings in this structure. ## CompareImageLayers CompareImageLayers() compares each image with the next in a sequence and returns the minimum bounding region of all the pixel differences (of the LayerType specified) it discovers. Images do NOT have to be the same size, though it is best that all the images are 'coalesced' (images are all the same size, on a flattened canvas, so as to represent exactly how an specific frame should look). No GIF dispose methods are applied, so GIF animations must be coalesced before applying this image operator to find differences to them. The format of the CompareImageLayers method is:
      Image *CompareImageLayers(const Image *images,
        const MagickLayerMethod method,ExceptionInfo *exception)
A description of each parameter follows: ##### image The image. ##### method The layers type to compare images with. Must be one of... CompareAnyLayer, CompareClearLayer, CompareOverlayLayer. ##### exception Return any errors or warnings in this structure. ## DeconstructImages DeconstructImages() compares each image with the next in a sequence and returns the minimum bounding region of all differences from the first image. The format of the CompareImageLayers method is:
      Image *DeconstructImages(const Image *images, ExceptionInfo *exception)
A description of each parameter follows: ##### image The image. ##### exception Return any errors or warnings in this structure. ## OptimizeImageLayers OptimizeImageLayers() compares each image the GIF disposed forms of the previous image in the sequence. From this it attempts to select the smallest cropped image to replace each frame, while preserving the results of the GIF animation. The format of the OptimizeImageLayers method is:
      Image *OptimizeImageLayers(const Image *image,
               ExceptionInfo *exception)
A description of each parameter follows: ##### image The image. ##### exception Return any errors or warnings in this structure. ## OptimizeImagePlusLayers OptimizeImagePlusLayers() is exactly as OptimizeImageLayers(), but may also add or even remove extra frames in the animation, if it improves the total number of pixels in the resulting GIF animation. The format of the OptimizePlusImageLayers method is:
      Image *OptimizePlusImageLayers(const Image *image,
               ExceptionInfo *exception)
A description of each parameter follows: ##### image The image. ##### exception Return any errors or warnings in this structure.

Discourse Server • Mailing Lists • ImageMagick Studio