


  

  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  



  

    

      

        
../index.html[ImageMagick] 
        

        
http://www.imagemagick.org/[sponsor] 
        

        
../index.html 
        
../index.html 
      

    

  


  

  


    

      

      
#mainSkip to page contents 

      
[
      
../index.htmlAbout ImageMagick       
../www/command-line-tools.htmlCommand-line Tools       
../www/api.htmlProgram Interfaces   
][
      
../www/install-source.htmlInstall from Source       
../www/binary-releases.htmlBinary Releases       
../www/resources.htmlResources   
][
      
../www/download.htmlDownload   
][
      
../www/links.htmlLinks   
][
      
../www/sponsors.htmlSponsors   
http://www.travelsur.net/Trips to Argentina       
]
      


      

The MagickCore API is a low-level interface between the C programming language and the ImageMagick image processing libraries and is recommended for wizard-level programmers only.  Unlike the ../www/magick-wand.htmlMagickWand  C API which uses only a few opaque types and accessors, with MagickCore you almost exlusively access the structure members directly.  A description of the MagickCore public methods are found here:
  
../www/api/magick.htmlInitialize or Destroy the ImageMagick Environment   
../www/api/constitute.htmlConstitute an Image   
../www/api/composite.htmlComposite an Image   
../www/api/image.htmlImage Methods   
../www/api/color.htmlCount the Colors in an Image   
../www/api/colorspace.htmlDealing with Image Colorspaces   
../www/api/profile.htmlDealing with Image Profiles   
../www/api/quantize.htmlReduce the Number of Unique Colors in an Image   
../www/api/segment.htmlSegment an Image with Thresholding Fuzzy c-Means   
../www/api/resize.htmlResize an Image   
../www/api/transform.htmlTransform an Image   
../www/api/shear.htmlShear or Rotate an Image by an Arbitrary Angle   
../www/api/enhance.htmlEnhance an Image   
../www/api/effect.htmlAdd an Effect   
../www/api/fx.htmlAdd a Special Effect   
../www/api/decorate.htmlDecorate an Image   
../www/api/attribute.htmlSet Text Attributes   
../www/api/annotate.htmlAnnotate an Image   
../www/api/paint.htmlPaint on an Image   
../www/api/draw.htmlDraw on an Image   
../www/api/montage.htmlCreate an Image Thumbnail   
../www/api/compare.htmlCompare an Image to a Reconstructed Image   
../www/api/display.htmlInteractively Display and Edit an Image   
../www/api/animate.htmlInteractively Animate an Image Sequence   
../www/api/cache.htmlGet or Set Image Pixels   
../www/api/list.htmlWorking with Image Lists   
../www/api/cache-view.htmlWorking with Cache Views   
../www/api/stream.htmlThe Pixel FIFO   
../www/api/blob.htmlRead or Write Binary Large OBjects   
../www/api/signature.htmlCompute a Message Digest for an Image   
../www/api/registry.htmlThe Registry   
../www/api/exception.htmlDealing with Exceptions   
../www/api/memory.htmlMemory Allocation   
../www/api/resource.htmlMonitor or Limit Resource Consumption   
../www/api/monitor.htmlMonitor the Progress of an Image Operation   
../www/api/version.htmlGet the Version and Copyrights After you write your MagickCore program, compile it like this:
  cc `Magick-config --cflags --cppflags` core.c `Magick-config --ldflags --libs`
Here is a example program that utilizes the MagickCore API to get you started, ../www/source/core.ccore.c . It reads a GIF image, creates a thumbnail, and writes it to disk in the PNG image format.
  #include <stdio.h>
  #include <stdlib.h>
  #include <string.h>
  #include <time.h>
  #include <magick/ImageMagick.h>
  int main(int argc,char **argv)
  {
    ExceptionInfo
      exception;
    Image
      *image,
      *images,
      *resize_image,
      *thumbnails;
    ImageInfo
      *image_info;
    /*
      Initialize the image info structure and read an image.
    */
    InitializeMagick(*argv);
    GetExceptionInfo(&exception);
    image_info=CloneImageInfo((ImageInfo *) NULL);
    (void) strcpy(image_info->filename,"image.gif");
    images=ReadImage(image_info,&exception);
    if (exception.severity != UndefinedException)
      CatchException(&exception);
    if (images == (Image *) NULL)
      exit(1);
    /*
      Turn the images into a thumbnail sequence.
    */
    thumbnails=NewImageList();
    while ((image=RemoveFirstImageFromList(&images)) != (Image *) NULL)
    {
      resize_image=ResizeImage(image,106,80,LanczosFilter,1.0,&exception);
      if (resize_image == (Image *) NULL)
        MagickError(exception.severity,exception.reason,exception.description);
      (void) AppendImageToList(&thumbnails,resize_image);
      DestroyImage(image);
    }
    /*
      Write the image as MIFF and destroy it.
    */
    (void) strcpy(thumbnails->filename,"image.png");
    WriteImage(image_info,thumbnails);
    thumbnails=DestroyImageList(thumbnails);
    image_info=DestroyImageInfo(image_info);
    DestroyExceptionInfo(&exception);
    DestroyMagick();
    return(0);
  }
      

      
 
    

  

  

  

    
http://redux.imagemagick.org/discussion-serverDiscourse Server  |
    
../www/mailing-list.htmlMailing Lists  |
    
http://redux.imagemagick.org/galleryImage Gallery  |
    
http://redux.imagemagick.org/MagickStudio/scripts/MagickStudio.cgiImageMagick Studio 
  

  

    
© 1999-2005 ImageMagick Studio LLC
  

  



