ImageMagick: MagickCore, C API for ImageMagick: Constitute an Image
Author: ImageMagick Studio LLC
Description: ImageMagick (TM) is a free software suite to create, edit and compose bitmap images. It can read, convert and write images in a large variety of formats. Images can be cropped, colors can be changed, various effects can be applied, images can be rotated and combined, and text, lines, polygons, ellipses and Bézier curves can be added to images and stretched and rotated. ImageMagick is free software: it is delivered with full source code and can be freely used, copied, modified and distributed. Its license is compatible with the GPL. It runs on all major operating systems. Most of the functionality of ImageMagick can be used interactively from the command line; more often, however, the features are used from programs written in the programming languages Perl, C, C++, Python, PHP, Ruby or Java, for which ready-made ImageMagick interfaces (PerlMagick, Magick++, PythonMagick, MagickWand for PHP, RubyMagick, and JMagick) are available. This makes it possible to modify or create images automa [cell cut: 1159 characters, first 1000 kept]
Keywords: magickcore, c, api, for, imagemagick:, constitute, an, image, ImageMagick, PerlMagick, Magick++, Image, Magick

## ConstituteImage ConstituteImage() returns an image from the the pixel data you supply. The pixel data must be in scanline order top-to-bottom. The data can be char, short int, int, float, or double. Float and double require the pixels to be normalized [0..1], otherwise [0..QuantumRange]. For example, to create a 640x480 image from unsigned red-green-blue character data, use:
      image = ConstituteImage(640,480,"RGB",CharPixel,pixels,&exception);
The format of the ConstituteImage method is:
      Image *ConstituteImage(const unsigned long columns,
        const unsigned long rows,const char *map,const StorageType storage,
        const void *pixels,ExceptionInfo *exception)
A description of each parameter follows: #### columns width in pixels of the image. #### rows height in pixels of the image. #### map This string reflects the expected ordering of the pixel array. It can be any combination or order of R = red, G = green, B = blue, A = alpha (0 is transparent), O = opacity (0 is opaque), C = cyan, Y = yellow, M = magenta, K = black, I = intensity (for grayscale), P = pad. #### storage Define the data type of the pixels. Float and double types are expected to be normalized [0..1] otherwise [0..QuantumRange]. Choose from these types: CharPixel, DoublePixel, FloatPixel, IntegerPixel, LongPixel, QuantumPixel, or ShortPixel. #### pixels This array of values contain the pixel components as defined by map and type. You must preallocate this array where the expected length varies depending on the values of width, height, map, and type. #### exception Return any errors or warnings in this structure. ## DestroyConstitute DestroyConstitute() destroys the constitute environment. The format of the DestroyConstitute method is:
      DestroyConstitute(void)
## PingImage PingImage() returns all the attributes of an image or image sequence except for the pixels. It is much faster and consumes far less memory than ReadImage(). On failure, a NULL image is returned and exception describes the reason for the failure. The format of the PingImage method is:
      Image *PingImage(const ImageInfo *image_info,ExceptionInfo *exception)
A description of each parameter follows: #### image_info Ping the image defined by the file or filename members of this structure. #### exception Return any errors or warnings in this structure. ## ReadImage ReadImage() reads an image or image sequence from a file or file handle. The method returns a NULL if there is a memory shortage or if the image cannot be read. On failure, a NULL image is returned and exception describes the reason for the failure. The format of the ReadImage method is:
      Image *ReadImage(const ImageInfo *image_info,ExceptionInfo *exception)
A description of each parameter follows: #### image_info Read the image defined by the file or filename members of this structure. #### exception Return any errors or warnings in this structure. ## ReadInlineImage ReadInlineImage() reads a Base64-encoded inline image or image sequence. The method returns a NULL if there is a memory shortage or if the image cannot be read. On failure, a NULL image is returned and exception describes the reason for the failure. The format of the ReadInlineImage method is:
      Image *ReadInlineImage(const ImageInfo *image_info,const char *content,
        ExceptionInfo *exception)
A description of each parameter follows: #### image_info The image info. #### content The image encoded in Base64. #### exception Return any errors or warnings in this structure. ## WriteImage WriteImage() writes an image or an image sequence to a file or filehandle. If writing to a file on disk, the name is defined by the filename member of the image structure. Write() returns MagickFalse is these is a memory shortage or if the image cannot be written. Check the exception member of image to determine the cause for any failure. The format of the WriteImage method is:
      MagickBooleanType WriteImage(const ImageInfo *image_info,Image *image)
A description of each parameter follows: #### image_info The image info. #### image The image. ## WriteImages WriteImages() writes an image sequence. The format of the WriteImages method is:
      MagickBooleanType WriteImages(const ImageInfo *image_info,Image *images,
        const char *filename,ExceptionInfo *exception)
A description of each parameter follows: #### image_info The image info. #### images The image list. #### filename The image filename. #### exception Return any errors or warnings in this structure. |

Discourse Server | Mailing Lists | Image Gallery | ImageMagick Studio
© 1999-2005 ImageMagick Studio LLC