>K [ 1 N # ImageMagick ImageV<> 
H



ImageMagick Image

NThe Image structure represents an ImageMagick image. It is initially allocatedLby AllocateImage() and deallocatedIby DestroyImage(). The functions2ReadImage(),4ReadImages(),4BlobToImage()Fand CreateImage() return a newFimage. Use CloneImage() to copyFan image. An image consists of a structure containing image attributesas well as the image pixels._

The image pixels are represented by the structure PixelPacketFand are cached in-memory, or on disk, depending on the cache thresholdFsetting. This cache is known as the "pixel cache". Pixels in the cacheJmay not be edited directly. They must first be made visible from the cacheIvia a pixel view. A pixel view is a rectangular view of theMpixels as defined by a starting coordinate, and a number of rows and columns.FWhen considering the varying abilities of multiple platforms, the mostHreliably efficient pixel view is comprized of part, or all, of one imagerow.P

There are two means of accessing pixel views.  When using the defaultYview, the pixels are made visible and accessable by using the GetImagePixels()Fmethod which provides access to a specified region of the image. AfterHthe view has been updated, thhe pixels may be saved back to the cache inItheir original positions via SyncImagePixels(). In order to createFan image with new contents, or to blindly overwrite existing contents,Hthe method  SetImagePixels() is used to reserve a pixel viewJcorresponding to a region in the pixel cache. Once the pixel view has beenIupdated, it may be written to the cache via SyncImagePixels(). TheKfunction GetIndexes() providesQaccess to the image colormap, represented as an array of type IndexPacket.f

A more flexible interface to the image pixels is via the CacheViewFinterface. This interface supports multiple pixel cache views (limitedFby the number of image rows), each of which are identified by a handle^(of type ViewInfo*). Use OpenCacheView()\to obtain a new cache view, CloseCacheView()Uto discard a cache view, GetCacheView()`to access an existing pixel region, SetCacheView()\to define a new pixel region, and SyncCacheView()tovsave the updated pixel region. The function GetCacheViewIndexes()Gprovides access to the colormap indexes associated with the pixel view.M

When writing encoders and decoders for new image formats, it is convenientJto have a high-level interface available which supports converting betweenJexternal pixel representations and ImageMagick's own representation. PixelGcomponents (red, green, blue, opacity, RGB, or RGBA) may be transferred[from a user-supplied buffer into the default view by using PushImagePixels().GPixel components may be transferred from the default view into aMuser-supplied buffer by using PopImagePixels(). Use of this high-levelHinterface helps protect image coders from changes to ImageMagick's pixel1representation and simplifies the implementation.G

The members of the Image structure are shown in the following table:
 J1AOH[H45$LEH0ERTGHF=J89*A[I;*)=$,C]G7*F7*K?$K;*I?+U5$G=1?=&B9UI5!L7$J=$H?YGEHSA*J5-F91AI*GK1JC*H7*TCH=U*J;$J5-:]$KW$F9!G9*O5LA5!G9Jf=-?M];5**7*7EQ_;!G?LF7'JE+w7[7E$@E$>
Image Structure Members
MemberTypeDescription
attributesImageAttribute*Image attribute list. Consists of a doubly-linked-listLof ImageAttribute structures, each of which has an associated key and value.]Access/update list via SetImageAttribute()Qand GetImageAttribute(). KKey-strings used by ImageMagick include "Comment" (image comment) , "Label"=(image label), and "Signature" (image signature).
ImageAttributebackground_colorPixelPacketImage background color
blurdoubleBlur factor to apply to the image when zooming
border_colorPixelPacketImage border color
chromaticityChromaticityInfoRed, green, blue, and white-point chromaticity values.
color_profileProfileInfoICC color profile. Specifications are available fromTthe International Color Consortium for the format of ICC color profiles.
colormapPixelPacket *PseudoColor palette array.
colorsunsigned intThe desired number of colors. Used by QuantizeImage().
colorspaceColorspaceTypeImage pixel interpretation.If the colorspace is RGB theIpixels are red, green, blue. If matte is true, then red, green, blue, andLindex. If it is CMYK, the pixels are cyan, yellow, magenta, black. Otherwise&the colorspace is ignored.
columnsunsigned intImage width
commentschar *Image comments
compressionCompressionTypeImage compresion type. The default is the compression-type of the specified image file.
delayunsigned intTime in 1/100ths of a second (0 to 65535) which mustLexpire before displaying the next image in an animated sequence. This optionIis useful for regulating the animation of a sequence of GIF images withinNetscape.
depthunsigned intImage depth (8 or 16). QuantumLeap must be defined before#a depth of 16 is valid.
directorychar *Tile names from within an image montage. Only valid afterFcalling MontageImages() or;reading a MIFF file which contains a directory.
disposeunsigned intGIF disposal method. This option is used to control howGsuccessive frames are rendered (how the preceding frame is disposed of)*when creating a GIF animation.
exceptionExceptionInfoRecord of any error which occurred when updating image.
fileFILE *Stdio stream to read image from or write image to. IfJset, ImageMagick will read from or write to the stream rather than openingza file. Used by ReadImage() and WriteImage().>The stream is closed when the operation completes.
filenamechar[MaxTextExtent]Image file name to read or write.
filesizelong intNumber of bytes of the encoded file.
filterFilterTypesFilter to use when resizing image. The reduction filterIemployed has a significant effect on the time required to resize an imageGand the resulting quality. The default filter is Lanczos which has beenLshown to produce high quality results when reducing most images.
fuzzintColors within this distance are considered equal. A numberLof algorithms search for a target color. By default the color must be exact.IUse this option to match colors that are close to the target color in RGBspace.
gammadoubleGamma level of the image. The same color image displayedFon two different workstations may look different due to differences inZthe display monitor. Use gamma correction to adjust for this color difference.
geometrychar *Preferred size of the image when encoding.
interlaceInterlaceTypeThe type of interlacing scheme (default NoInterlace).KThis option is used to specify the type of interlacing scheme for raw imageMformats such as RGB or YUV. NoInterlace means do not interlace, LineInterlaceXuses scanline interlacing, and PlaneInterlace uses plane interlacing. PartitionInterlaceJis like PlaneInterlace except the different planes are saved to individualOfiles (e.g. image.R, image.G, and image.B). Use LineInterlace or PlaneInterlaceBto create an interlaced GIF or progressive JPEG image.
iptc_profileProfileInfoIPTC profile. Specifications are available from the International?Press Telecommunications Council for IPTC profiles.
iterationsunsigned intNumber of iterations to loop an animation (e.g. Netscape loop extension) for.
liststruct _Image *Undo image list (used only by 'display')
magickchar[MaxTextExtent]Image encoding format (e.g. "GIF").
magick_columnsunsigned intBase image width (before transformations)
magick_filenamechar[MaxTextExtent]Base image filename (before transformations)
magick_rowsunsigned intBase image height (before transformations)
matteunsigned intIf non-zero, then the index member of pixels)represents the alpha channel.
matte_colorPixelPacketImage matte (transparent) color
mean_error_per_pixelunsigned intThe mean error per pixel computed when an image is colorGreduced. This parameter is only valid if verbose is set to true and the*image has just been quantized.
montagechar *Tile size and offset within an image montage. Only validfor montage images.
nextstruct _Image *Next image frame in sequence
normalized_maximum_errordoubleThe normalized max error per pixel computed when an imageGis color reduced. This parameter is only valid if verbose is set:to true and the image has just been quantized.
normalized_mean_errordoubleThe normalized mean error per pixel computed when anFimage is color reduced. This parameter is only valid if verboseAis set to true and the image has just been quantized.
offsetintNumber of initial bytes to skip over when reading rawimage.
orphanunsigned intWhen set, CloneImage()Fclones only the current frame, creating an "orphan" frame.
pageRectangleInfoEquivalent size of Postscript page.
pipeintSet to True if image is read/written from/to aGPOSIX pipe. To read from (or write to) an open pipe, set this member to True,Fset the file member to a stdio stream representing“the pipe (obtained from popen()), and invoke ReadImage()/WriteImage().WThe pipe is automatically closed via pclose() when the operation completes.
pixelsPixelPacket *Image pixels retrieved via GetPixelCache()Yor initialized via SetPixelCache().
previousstruct _Image *Previous image frame in sequence.
rendering_intentRenderingIntentThe type of rendering intent.
rowsunsigned intImage height
sceneunsigned intImage frame scene number.
storage_typeClassTypeImage storage class. If DirectClassqthen the image packets contain valid RGB or CMYK colors. If PseudoClassSthen the image has a colormap referenced by pixel's index member. 
taintedintSet to  non-zero (True) if the image pixels havebeen modified.
tile_infoRectangleInfoDescribes a tile within an image.  For example,Nif your images is 640x480 you may only want 320x256 with an offset of +128+64.PIt is used for raw formats such as RGB and CMYK as well as for TIFF.
timerTimerInfoSupport for measuring actual (user + system) and elapsedexecution time.
total_colorsunsigned longThe number of colors in the image after QuantizeImage(),Hor QuantizeImages() if theverbose flag was set before the call. Calculated by GetNumberColors().
unitsResolutionTypeUnits of image resolution
x_resolutiondoubleHorizontal resolution of the image
y_resolutiondoubleVertical resolution of the image





–

Home Page9Image manipulation software that works like magic.