2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6 % DDDD EEEEE PPPP RRRR EEEEE CCCC AAA TTTTT EEEEE %
7 % D D E P P R R E C A A T E %
8 % D D EEE PPPPP RRRR EEE C AAAAA T EEE %
9 % D D E P R R E C A A T E %
10 % DDDD EEEEE P R R EEEEE CCCC A A T EEEEE %
13 % MagickWand Deprecated Methods %
20 % Copyright 1999-2010 ImageMagick Studio LLC, a non-profit organization %
21 % dedicated to making software imaging solutions freely available. %
23 % You may not use this file except in compliance with the License. You may %
24 % obtain a copy of the License at %
26 % http://www.imagemagick.org/script/license.php %
28 % Unless required by applicable law or agreed to in writing, software %
29 % distributed under the License is distributed on an "AS IS" BASIS, %
30 % WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. %
31 % See the License for the specific language governing permissions and %
32 % limitations under the License. %
34 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
43 #include "wand/studio.h"
44 #include "wand/MagickWand.h"
45 #include "wand/magick-wand-private.h"
46 #include "wand/wand.h"
51 #define ThrowWandException(severity,tag,context) \
53 (void) ThrowMagickException(wand->exception,GetMagickModule(),severity, \
54 tag,"`%s'",context); \
55 return(MagickFalse); \
58 #if !defined(MAGICKCORE_EXCLUDE_DEPRECATED)
61 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
65 % M a g i c k A v e r a g e I m a g e s %
69 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
71 % MagickAverageImages() average a set of images.
73 % The format of the MagickAverageImages method is:
75 % MagickWand *MagickAverageImages(MagickWand *wand)
77 % A description of each parameter follows:
79 % o wand: the magick wand.
83 static MagickWand *CloneMagickWandFromImages(const MagickWand *wand,
89 assert(wand != (MagickWand *) NULL);
90 assert(wand->signature == WandSignature);
91 if (wand->debug != MagickFalse)
92 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
93 clone_wand=(MagickWand *) AcquireAlignedMemory(1,sizeof(*clone_wand));
94 if (clone_wand == (MagickWand *) NULL)
95 ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed",
97 (void) ResetMagickMemory(clone_wand,0,sizeof(*clone_wand));
98 clone_wand->id=AcquireWandId();
99 (void) FormatMagickString(clone_wand->name,MaxTextExtent,"%s-%lu",
100 MagickWandId,(unsigned long) clone_wand->id);
101 clone_wand->exception=AcquireExceptionInfo();
102 InheritException(clone_wand->exception,wand->exception);
103 clone_wand->image_info=CloneImageInfo(wand->image_info);
104 clone_wand->quantize_info=CloneQuantizeInfo(wand->quantize_info);
105 clone_wand->images=images;
106 clone_wand->debug=IsEventLogging();
107 if (clone_wand->debug != MagickFalse)
108 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",clone_wand->name);
109 clone_wand->signature=WandSignature;
113 WandExport MagickWand *MagickAverageImages(MagickWand *wand)
118 assert(wand != (MagickWand *) NULL);
119 assert(wand->signature == WandSignature);
120 if (wand->debug != MagickFalse)
121 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
122 if (wand->images == (Image *) NULL)
123 return((MagickWand *) NULL);
124 average_image=EvaluateImages(wand->images,MeanEvaluateOperator,
126 if (average_image == (Image *) NULL)
127 return((MagickWand *) NULL);
128 return(CloneMagickWandFromImages(wand,average_image));
132 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
136 % M a g i c k C l i p P a t h I m a g e %
140 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
142 % MagickClipPathImage() clips along the named paths from the 8BIM profile, if
143 % present. Later operations take effect inside the path. Id may be a number
144 % if preceded with #, to work on a numbered path, e.g., "#1" to use the first
147 % The format of the MagickClipPathImage method is:
149 % MagickBooleanType MagickClipPathImage(MagickWand *wand,
150 % const char *pathname,const MagickBooleanType inside)
152 % A description of each parameter follows:
154 % o wand: the magick wand.
156 % o pathname: name of clipping path resource. If name is preceded by #, use
157 % clipping path numbered by name.
159 % o inside: if non-zero, later operations take effect inside clipping path.
160 % Otherwise later operations take effect outside clipping path.
163 WandExport MagickBooleanType MagickClipPathImage(MagickWand *wand,
164 const char *pathname,const MagickBooleanType inside)
166 return(MagickClipImagePath(wand,pathname,inside));
169 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
173 % D r a w G e t F i l l A l p h a %
177 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
179 % DrawGetFillAlpha() returns the alpha used when drawing using the fill
180 % color or fill texture. Fully opaque is 1.0.
182 % The format of the DrawGetFillAlpha method is:
184 % double DrawGetFillAlpha(const DrawingWand *wand)
186 % A description of each parameter follows:
188 % o wand: the drawing wand.
191 WandExport double DrawGetFillAlpha(const DrawingWand *wand)
193 return(DrawGetFillOpacity(wand));
197 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
201 % D r a w G e t S t r o k e A l p h a %
205 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
207 % DrawGetStrokeAlpha() returns the alpha of stroked object outlines.
209 % The format of the DrawGetStrokeAlpha method is:
211 % double DrawGetStrokeAlpha(const DrawingWand *wand)
213 % A description of each parameter follows:
215 % o wand: the drawing wand.
217 WandExport double DrawGetStrokeAlpha(const DrawingWand *wand)
219 return(DrawGetStrokeOpacity(wand));
223 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
227 % D r a w P e e k G r a p h i c W a n d %
231 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
233 % DrawPeekGraphicWand() returns the current drawing wand.
235 % The format of the PeekDrawingWand method is:
237 % DrawInfo *DrawPeekGraphicWand(const DrawingWand *wand)
239 % A description of each parameter follows:
241 % o wand: the drawing wand.
244 WandExport DrawInfo *DrawPeekGraphicWand(const DrawingWand *wand)
246 return(PeekDrawingWand(wand));
250 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
254 % D r a w P o p G r a p h i c C o n t e x t %
258 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
260 % DrawPopGraphicContext() destroys the current drawing wand and returns to the
261 % previously pushed drawing wand. Multiple drawing wands may exist. It is an
262 % error to attempt to pop more drawing wands than have been pushed, and it is
263 % proper form to pop all drawing wands which have been pushed.
265 % The format of the DrawPopGraphicContext method is:
267 % MagickBooleanType DrawPopGraphicContext(DrawingWand *wand)
269 % A description of each parameter follows:
271 % o wand: the drawing wand.
274 WandExport void DrawPopGraphicContext(DrawingWand *wand)
276 (void) PopDrawingWand(wand);
280 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
284 % D r a w P u s h G r a p h i c C o n t e x t %
288 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
290 % DrawPushGraphicContext() clones the current drawing wand to create a new
291 % drawing wand. The original drawing wand(s) may be returned to by
292 % invoking PopDrawingWand(). The drawing wands are stored on a drawing wand
293 % stack. For every Pop there must have already been an equivalent Push.
295 % The format of the DrawPushGraphicContext method is:
297 % MagickBooleanType DrawPushGraphicContext(DrawingWand *wand)
299 % A description of each parameter follows:
301 % o wand: the drawing wand.
304 WandExport void DrawPushGraphicContext(DrawingWand *wand)
306 (void) PushDrawingWand(wand);
310 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
314 % D r a w S e t F i l l A l p h a %
318 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
320 % DrawSetFillAlpha() sets the alpha to use when drawing using the fill
321 % color or fill texture. Fully opaque is 1.0.
323 % The format of the DrawSetFillAlpha method is:
325 % void DrawSetFillAlpha(DrawingWand *wand,const double fill_alpha)
327 % A description of each parameter follows:
329 % o wand: the drawing wand.
331 % o fill_alpha: fill alpha
334 WandExport void DrawSetFillAlpha(DrawingWand *wand,const double fill_alpha)
336 DrawSetFillOpacity(wand,fill_alpha);
340 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
344 % D r a w S e t S t r o k e A l p h a %
348 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
350 % DrawSetStrokeAlpha() specifies the alpha of stroked object outlines.
352 % The format of the DrawSetStrokeAlpha method is:
354 % void DrawSetStrokeAlpha(DrawingWand *wand,const double stroke_alpha)
356 % A description of each parameter follows:
358 % o wand: the drawing wand.
360 % o stroke_alpha: stroke alpha. The value 1.0 is opaque.
363 WandExport void DrawSetStrokeAlpha(DrawingWand *wand,const double stroke_alpha)
365 DrawSetStrokeOpacity(wand,stroke_alpha);
369 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
373 % M a g i c k C o l o r F l o o d f i l l I m a g e %
377 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
379 % MagickColorFloodfillImage() changes the color value of any pixel that matches
380 % target and is an immediate neighbor. If the method FillToBorderMethod is
381 % specified, the color value is changed for any neighbor pixel that does not
382 % match the bordercolor member of image.
384 % The format of the MagickColorFloodfillImage method is:
386 % MagickBooleanType MagickColorFloodfillImage(MagickWand *wand,
387 % const PixelWand *fill,const double fuzz,const PixelWand *bordercolor,
388 % const ssize_t x,const ssize_t y)
390 % A description of each parameter follows:
392 % o wand: the magick wand.
394 % o fill: the floodfill color pixel wand.
396 % o fuzz: By default target must match a particular pixel color
397 % exactly. However, in many cases two colors may differ by a small amount.
398 % The fuzz member of image defines how much tolerance is acceptable to
399 % consider two colors as the same. For example, set fuzz to 10 and the
400 % color red at intensities of 100 and 102 respectively are now interpreted
401 % as the same color for the purposes of the floodfill.
403 % o bordercolor: the border color pixel wand.
405 % o x,y: the starting location of the operation.
408 WandExport MagickBooleanType MagickColorFloodfillImage(MagickWand *wand,
409 const PixelWand *fill,const double fuzz,const PixelWand *bordercolor,
410 const ssize_t x,const ssize_t y)
421 assert(wand != (MagickWand *) NULL);
422 assert(wand->signature == WandSignature);
423 if (wand->debug != MagickFalse)
424 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
425 if (wand->images == (Image *) NULL)
426 ThrowWandException(WandError,"ContainsNoImages",wand->name);
427 draw_info=CloneDrawInfo(wand->image_info,(DrawInfo *) NULL);
428 PixelGetQuantumColor(fill,&draw_info->fill);
429 (void) GetOneVirtualPixel(wand->images,x % wand->images->columns,
430 y % wand->images->rows,&target,wand->exception);
431 if (bordercolor != (PixelWand *) NULL)
432 PixelGetQuantumColor(bordercolor,&target);
433 wand->images->fuzz=fuzz;
434 status=ColorFloodfillImage(wand->images,draw_info,target,x,y,
435 bordercolor != (PixelWand *) NULL ? FillToBorderMethod : FloodfillMethod);
436 if (status == MagickFalse)
437 InheritException(wand->exception,&wand->images->exception);
438 draw_info=DestroyDrawInfo(draw_info);
443 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
447 % M a g i c k D e s c r i b e I m a g e %
451 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
453 % MagickDescribeImage() identifies an image by printing its attributes to the
454 % file. Attributes include the image width, height, size, and others.
456 % The format of the MagickDescribeImage method is:
458 % const char *MagickDescribeImage(MagickWand *wand)
460 % A description of each parameter follows:
462 % o wand: the magick wand.
465 WandExport char *MagickDescribeImage(MagickWand *wand)
467 return(MagickIdentifyImage(wand));
471 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
475 % M a g i c k F l a t t e n I m a g e s %
479 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
481 % MagickFlattenImages() merges a sequence of images. This useful for
482 % combining Photoshop layers into a single image.
484 % The format of the MagickFlattenImages method is:
486 % MagickWand *MagickFlattenImages(MagickWand *wand)
488 % A description of each parameter follows:
490 % o wand: the magick wand.
493 WandExport MagickWand *MagickFlattenImages(MagickWand *wand)
498 assert(wand != (MagickWand *) NULL);
499 assert(wand->signature == WandSignature);
500 if (wand->debug != MagickFalse)
501 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
502 if (wand->images == (Image *) NULL)
503 return((MagickWand *) NULL);
504 flatten_image=FlattenImages(wand->images,wand->exception);
505 if (flatten_image == (Image *) NULL)
506 return((MagickWand *) NULL);
507 return(CloneMagickWandFromImages(wand,flatten_image));
511 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
515 % M a g i c k G e t I m a g e A t t r i b u t e %
519 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
521 % MagickGetImageAttribute() returns a value associated with the specified
522 % property. Use MagickRelinquishMemory() to free the value when you are
525 % The format of the MagickGetImageAttribute method is:
527 % char *MagickGetImageAttribute(MagickWand *wand,const char *property)
529 % A description of each parameter follows:
531 % o wand: the magick wand.
533 % o property: the property.
536 WandExport char *MagickGetImageAttribute(MagickWand *wand,const char *property)
538 return(MagickGetImageProperty(wand,property));
542 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
546 + M a g i c k G e t I m a g e I n d e x %
550 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
552 % MagickGetImageIndex() returns the index of the current image.
554 % The format of the MagickGetImageIndex method is:
556 % ssize_t MagickGetImageIndex(MagickWand *wand)
558 % A description of each parameter follows:
560 % o wand: the magick wand.
563 WandExport ssize_t MagickGetImageIndex(MagickWand *wand)
565 return(MagickGetIteratorIndex(wand));
569 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
573 + M a g i c k G e t I m a g e C h a n n e l E x t r e m a %
577 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
579 % MagickGetImageChannelExtrema() gets the extrema for one or more image
582 % The format of the MagickGetImageChannelExtrema method is:
584 % MagickBooleanType MagickGetImageChannelExtrema(MagickWand *wand,
585 % const ChannelType channel,size_t *minima,size_t *maxima)
587 % A description of each parameter follows:
589 % o wand: the magick wand.
591 % o channel: the image channel(s).
593 % o minima: The minimum pixel value for the specified channel(s).
595 % o maxima: The maximum pixel value for the specified channel(s).
598 WandExport MagickBooleanType MagickGetImageChannelExtrema(MagickWand *wand,
599 const ChannelType channel,size_t *minima,size_t *maxima)
604 assert(wand != (MagickWand *) NULL);
605 assert(wand->signature == WandSignature);
606 if (wand->debug != MagickFalse)
607 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
608 if (wand->images == (Image *) NULL)
609 ThrowWandException(WandError,"ContainsNoImages",wand->name);
610 status=GetImageChannelExtrema(wand->images,channel,minima,maxima,
616 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
620 + M a g i c k G e t I m a g e E x t r e m a %
624 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
626 % MagickGetImageExtrema() gets the extrema for the image.
628 % The format of the MagickGetImageExtrema method is:
630 % MagickBooleanType MagickGetImageExtrema(MagickWand *wand,
631 % size_t *minima,size_t *maxima)
633 % A description of each parameter follows:
635 % o wand: the magick wand.
637 % o minima: The minimum pixel value for the specified channel(s).
639 % o maxima: The maximum pixel value for the specified channel(s).
642 WandExport MagickBooleanType MagickGetImageExtrema(MagickWand *wand,
643 size_t *minima,size_t *maxima)
648 assert(wand != (MagickWand *) NULL);
649 assert(wand->signature == WandSignature);
650 if (wand->debug != MagickFalse)
651 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
652 if (wand->images == (Image *) NULL)
653 ThrowWandException(WandError,"ContainsNoImages",wand->name);
654 status=GetImageExtrema(wand->images,minima,maxima,wand->exception);
659 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
663 % M a g i c k G e t I m a g e M a t t e %
667 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
669 % MagickGetImageMatte() returns MagickTrue if the image has a matte channel
670 % otherwise MagickFalse.
672 % The format of the MagickGetImageMatte method is:
674 % size_t MagickGetImageMatte(MagickWand *wand)
676 % A description of each parameter follows:
678 % o wand: the magick wand.
681 WandExport MagickBooleanType MagickGetImageMatte(MagickWand *wand)
683 assert(wand != (MagickWand *) NULL);
684 assert(wand->signature == WandSignature);
685 if (wand->debug != MagickFalse)
686 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
687 if (wand->images == (Image *) NULL)
688 ThrowWandException(WandError,"ContainsNoImages",wand->name);
689 return(wand->images->matte);
693 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
697 % M a g i c k G e t I m a g e P i x e l s %
701 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
703 % MagickGetImagePixels() extracts pixel data from an image and returns it to
704 % you. The method returns MagickTrue on success otherwise MagickFalse if an
705 % error is encountered. The data is returned as char, short int, int, ssize_t,
706 % float, or double in the order specified by map.
708 % Suppose you want to extract the first scanline of a 640x480 image as
709 % character data in red-green-blue order:
711 % MagickGetImagePixels(wand,0,0,640,1,"RGB",CharPixel,pixels);
713 % The format of the MagickGetImagePixels method is:
715 % MagickBooleanType MagickGetImagePixels(MagickWand *wand,
716 % const ssize_t x,const ssize_t y,const size_t columns,
717 % const size_t rows,const char *map,const StorageType storage,
720 % A description of each parameter follows:
722 % o wand: the magick wand.
724 % o x, y, columns, rows: These values define the perimeter
725 % of a region of pixels you want to extract.
727 % o map: This string reflects the expected ordering of the pixel array.
728 % It can be any combination or order of R = red, G = green, B = blue,
729 % A = alpha (0 is transparent), O = opacity (0 is opaque), C = cyan,
730 % Y = yellow, M = magenta, K = black, I = intensity (for grayscale),
733 % o storage: Define the data type of the pixels. Float and double types are
734 % expected to be normalized [0..1] otherwise [0..QuantumRange]. Choose from
735 % these types: CharPixel, DoublePixel, FloatPixel, IntegerPixel,
736 % LongPixel, QuantumPixel, or ShortPixel.
738 % o pixels: This array of values contain the pixel components as defined by
739 % map and type. You must preallocate this array where the expected
740 % length varies depending on the values of width, height, map, and type.
743 WandExport MagickBooleanType MagickGetImagePixels(MagickWand *wand,
744 const ssize_t x,const ssize_t y,const size_t columns,
745 const size_t rows,const char *map,const StorageType storage,
748 return(MagickExportImagePixels(wand,x,y,columns,rows,map,storage,pixels));
752 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
756 % M a g i c k G e t I m a g e S i z e %
760 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
762 % MagickGetImageSize() returns the image length in bytes.
764 % The format of the MagickGetImageSize method is:
766 % MagickBooleanType MagickGetImageSize(MagickWand *wand,
767 % MagickSizeType *length)
769 % A description of each parameter follows:
771 % o wand: the magick wand.
773 % o length: the image length in bytes.
776 WandExport MagickSizeType MagickGetImageSize(MagickWand *wand)
778 assert(wand != (MagickWand *) NULL);
779 assert(wand->signature == WandSignature);
780 if (wand->debug != MagickFalse)
781 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
782 if (wand->images == (Image *) NULL)
783 ThrowWandException(WandError,"ContainsNoImages",wand->name);
784 return(GetBlobSize(wand->images));
788 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
792 % M a g i c k M a p I m a g e %
796 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
798 % MagickMapImage() replaces the colors of an image with the closest color
799 % from a reference image.
801 % The format of the MagickMapImage method is:
803 % MagickBooleanType MagickMapImage(MagickWand *wand,
804 % const MagickWand *map_wand,const MagickBooleanType dither)
806 % A description of each parameter follows:
808 % o wand: the magick wand.
810 % o map: the map wand.
812 % o dither: Set this integer value to something other than zero to dither
816 WandExport MagickBooleanType MagickMapImage(MagickWand *wand,
817 const MagickWand *map_wand,const MagickBooleanType dither)
822 assert(wand != (MagickWand *) NULL);
823 assert(wand->signature == WandSignature);
824 if (wand->debug != MagickFalse)
825 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
826 if ((wand->images == (Image *) NULL) || (map_wand->images == (Image *) NULL))
827 ThrowWandException(WandError,"ContainsNoImages",wand->name);
828 status=MapImage(wand->images,map_wand->images,dither);
829 if (status == MagickFalse)
830 InheritException(wand->exception,&wand->images->exception);
835 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
839 % M a g i c k M a t t e F l o o d f i l l I m a g e %
843 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
845 % MagickMatteFloodfillImage() changes the transparency value of any pixel that
846 % matches target and is an immediate neighbor. If the method
847 % FillToBorderMethod is specified, the transparency value is changed for any
848 % neighbor pixel that does not match the bordercolor member of image.
850 % The format of the MagickMatteFloodfillImage method is:
852 % MagickBooleanType MagickMatteFloodfillImage(MagickWand *wand,
853 % const double alpha,const double fuzz,const PixelWand *bordercolor,
854 % const ssize_t x,const ssize_t y)
856 % A description of each parameter follows:
858 % o wand: the magick wand.
860 % o alpha: the level of transparency: 1.0 is fully opaque and 0.0 is fully
863 % o fuzz: By default target must match a particular pixel color
864 % exactly. However, in many cases two colors may differ by a small amount.
865 % The fuzz member of image defines how much tolerance is acceptable to
866 % consider two colors as the same. For example, set fuzz to 10 and the
867 % color red at intensities of 100 and 102 respectively are now interpreted
868 % as the same color for the purposes of the floodfill.
870 % o bordercolor: the border color pixel wand.
872 % o x,y: the starting location of the operation.
875 WandExport MagickBooleanType MagickMatteFloodfillImage(MagickWand *wand,
876 const double alpha,const double fuzz,const PixelWand *bordercolor,
877 const ssize_t x,const ssize_t y)
888 assert(wand != (MagickWand *) NULL);
889 assert(wand->signature == WandSignature);
890 if (wand->debug != MagickFalse)
891 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
892 if (wand->images == (Image *) NULL)
893 ThrowWandException(WandError,"ContainsNoImages",wand->name);
894 draw_info=CloneDrawInfo(wand->image_info,(DrawInfo *) NULL);
895 (void) GetOneVirtualPixel(wand->images,x % wand->images->columns,
896 y % wand->images->rows,&target,wand->exception);
897 if (bordercolor != (PixelWand *) NULL)
898 PixelGetQuantumColor(bordercolor,&target);
899 wand->images->fuzz=fuzz;
900 status=MatteFloodfillImage(wand->images,target,ClampToQuantum(
901 (MagickRealType) QuantumRange-QuantumRange*alpha),x,y,bordercolor !=
902 (PixelWand *) NULL ? FillToBorderMethod : FloodfillMethod);
903 if (status == MagickFalse)
904 InheritException(wand->exception,&wand->images->exception);
905 draw_info=DestroyDrawInfo(draw_info);
910 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
914 % M a g i c k M a x i m u m I m a g e s %
918 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
920 % MagickMaximumImages() returns the maximum intensity of an image sequence.
922 % The format of the MagickMaximumImages method is:
924 % MagickWand *MagickMaximumImages(MagickWand *wand)
926 % A description of each parameter follows:
928 % o wand: the magick wand.
931 WandExport MagickWand *MagickMaximumImages(MagickWand *wand)
936 assert(wand != (MagickWand *) NULL);
937 assert(wand->signature == WandSignature);
938 if (wand->debug != MagickFalse)
939 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
940 if (wand->images == (Image *) NULL)
941 return((MagickWand *) NULL);
942 maximum_image=EvaluateImages(wand->images,MaxEvaluateOperator,
944 if (maximum_image == (Image *) NULL)
945 return((MagickWand *) NULL);
946 return(CloneMagickWandFromImages(wand,maximum_image));
950 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
954 % M a g i c k M i n i m u m I m a g e s %
958 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
960 % MagickMinimumImages() returns the minimum intensity of an image sequence.
962 % The format of the MagickMinimumImages method is:
964 % MagickWand *MagickMinimumImages(MagickWand *wand)
966 % A description of each parameter follows:
968 % o wand: the magick wand.
971 WandExport MagickWand *MagickMinimumImages(MagickWand *wand)
976 assert(wand != (MagickWand *) NULL);
977 assert(wand->signature == WandSignature);
978 if (wand->debug != MagickFalse)
979 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
980 if (wand->images == (Image *) NULL)
981 return((MagickWand *) NULL);
982 minimum_image=EvaluateImages(wand->images,MinEvaluateOperator,
984 if (minimum_image == (Image *) NULL)
985 return((MagickWand *) NULL);
986 return(CloneMagickWandFromImages(wand,minimum_image));
990 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
994 % M a g i c k M o s a i c I m a g e s %
998 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1000 % MagickMosaicImages() inlays an image sequence to form a single coherent
1001 % picture. It returns a wand with each image in the sequence composited at
1002 % the location defined by the page offset of the image.
1004 % The format of the MagickMosaicImages method is:
1006 % MagickWand *MagickMosaicImages(MagickWand *wand)
1008 % A description of each parameter follows:
1010 % o wand: the magick wand.
1013 WandExport MagickWand *MagickMosaicImages(MagickWand *wand)
1018 assert(wand != (MagickWand *) NULL);
1019 assert(wand->signature == WandSignature);
1020 if (wand->debug != MagickFalse)
1021 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1022 if (wand->images == (Image *) NULL)
1023 return((MagickWand *) NULL);
1024 mosaic_image=MosaicImages(wand->images,wand->exception);
1025 if (mosaic_image == (Image *) NULL)
1026 return((MagickWand *) NULL);
1027 return(CloneMagickWandFromImages(wand,mosaic_image));
1031 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1035 % M a g i c k O p a q u e I m a g e %
1039 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1041 % MagickOpaqueImage() changes any pixel that matches color with the color
1044 % The format of the MagickOpaqueImage method is:
1046 % MagickBooleanType MagickOpaqueImage(MagickWand *wand,
1047 % const PixelWand *target,const PixelWand *fill,const double fuzz)
1049 % A description of each parameter follows:
1051 % o wand: the magick wand.
1053 % o channel: the channel(s).
1055 % o target: Change this target color to the fill color within the image.
1057 % o fill: the fill pixel wand.
1059 % o fuzz: By default target must match a particular pixel color
1060 % exactly. However, in many cases two colors may differ by a small amount.
1061 % The fuzz member of image defines how much tolerance is acceptable to
1062 % consider two colors as the same. For example, set fuzz to 10 and the
1063 % color red at intensities of 100 and 102 respectively are now interpreted
1064 % as the same color for the purposes of the floodfill.
1067 WandExport MagickBooleanType MagickOpaqueImage(MagickWand *wand,
1068 const PixelWand *target,const PixelWand *fill,const double fuzz)
1070 return(MagickPaintOpaqueImage(wand,target,fill,fuzz));
1074 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1078 % M a g i c k P a i n t F l o o d f i l l I m a g e %
1082 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1084 % MagickPaintFloodfillImage() changes the color value of any pixel that matches
1085 % target and is an immediate neighbor. If the method FillToBorderMethod is
1086 % specified, the color value is changed for any neighbor pixel that does not
1087 % match the bordercolor member of image.
1089 % The format of the MagickPaintFloodfillImage method is:
1091 % MagickBooleanType MagickPaintFloodfillImage(MagickWand *wand,
1092 % const ChannelType channel,const PixelWand *fill,const double fuzz,
1093 % const PixelWand *bordercolor,const ssize_t x,const ssize_t y)
1095 % A description of each parameter follows:
1097 % o wand: the magick wand.
1099 % o channel: the channel(s).
1101 % o fill: the floodfill color pixel wand.
1103 % o fuzz: By default target must match a particular pixel color
1104 % exactly. However, in many cases two colors may differ by a small amount.
1105 % The fuzz member of image defines how much tolerance is acceptable to
1106 % consider two colors as the same. For example, set fuzz to 10 and the
1107 % color red at intensities of 100 and 102 respectively are now interpreted
1108 % as the same color for the purposes of the floodfill.
1110 % o bordercolor: the border color pixel wand.
1112 % o x,y: the starting location of the operation.
1115 WandExport MagickBooleanType MagickPaintFloodfillImage(MagickWand *wand,
1116 const ChannelType channel,const PixelWand *fill,const double fuzz,
1117 const PixelWand *bordercolor,const ssize_t x,const ssize_t y)
1122 status=MagickFloodfillPaintImage(wand,channel,fill,fuzz,bordercolor,x,y,
1128 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1132 % M a g i c k P a i n t O p a q u e I m a g e %
1136 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1138 % MagickPaintOpaqueImage() changes any pixel that matches color with the color
1141 % The format of the MagickPaintOpaqueImage method is:
1143 % MagickBooleanType MagickPaintOpaqueImage(MagickWand *wand,
1144 % const PixelWand *target,const PixelWand *fill,const double fuzz)
1145 % MagickBooleanType MagickPaintOpaqueImageChannel(MagickWand *wand,
1146 % const ChannelType channel,const PixelWand *target,
1147 % const PixelWand *fill,const double fuzz)
1149 % A description of each parameter follows:
1151 % o wand: the magick wand.
1153 % o channel: the channel(s).
1155 % o target: Change this target color to the fill color within the image.
1157 % o fill: the fill pixel wand.
1159 % o fuzz: By default target must match a particular pixel color
1160 % exactly. However, in many cases two colors may differ by a small amount.
1161 % The fuzz member of image defines how much tolerance is acceptable to
1162 % consider two colors as the same. For example, set fuzz to 10 and the
1163 % color red at intensities of 100 and 102 respectively are now interpreted
1164 % as the same color for the purposes of the floodfill.
1168 WandExport MagickBooleanType MagickPaintOpaqueImage(MagickWand *wand,
1169 const PixelWand *target,const PixelWand *fill,const double fuzz)
1171 return(MagickPaintOpaqueImageChannel(wand,DefaultChannels,target,fill,fuzz));
1174 WandExport MagickBooleanType MagickPaintOpaqueImageChannel(MagickWand *wand,
1175 const ChannelType channel,const PixelWand *target,const PixelWand *fill,
1181 status=MagickOpaquePaintImageChannel(wand,channel,target,fill,fuzz,
1187 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1191 % M a g i c k P a i n t T r a n s p a r e n t I m a g e %
1195 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1197 % MagickPaintTransparentImage() changes any pixel that matches color with the
1198 % color defined by fill.
1200 % The format of the MagickPaintTransparentImage method is:
1202 % MagickBooleanType MagickPaintTransparentImage(MagickWand *wand,
1203 % const PixelWand *target,const double alpha,const double fuzz)
1205 % A description of each parameter follows:
1207 % o wand: the magick wand.
1209 % o target: Change this target color to specified opacity value within
1212 % o alpha: the level of transparency: 1.0 is fully opaque and 0.0 is fully
1215 % o fuzz: By default target must match a particular pixel color
1216 % exactly. However, in many cases two colors may differ by a small amount.
1217 % The fuzz member of image defines how much tolerance is acceptable to
1218 % consider two colors as the same. For example, set fuzz to 10 and the
1219 % color red at intensities of 100 and 102 respectively are now interpreted
1220 % as the same color for the purposes of the floodfill.
1223 WandExport MagickBooleanType MagickPaintTransparentImage(MagickWand *wand,
1224 const PixelWand *target,const double alpha,const double fuzz)
1226 return(MagickTransparentPaintImage(wand,target,alpha,fuzz,MagickFalse));
1230 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1234 % M a g i c k R e c o l o r I m a g e %
1238 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1240 % MagickRecolorImage() apply color transformation to an image. The method
1241 % permits saturation changes, hue rotation, luminance to alpha, and various
1242 % other effects. Although variable-sized transformation matrices can be used,
1243 % typically one uses a 5x5 matrix for an RGBA image and a 6x6 for CMYKA
1244 % (or RGBA with offsets). The matrix is similar to those used by Adobe Flash
1245 % except offsets are in column 6 rather than 5 (in support of CMYKA images)
1246 % and offsets are normalized (divide Flash offset by 255).
1248 % The format of the MagickRecolorImage method is:
1250 % MagickBooleanType MagickRecolorImage(MagickWand *wand,
1251 % const size_t order,const double *color_matrix)
1253 % A description of each parameter follows:
1255 % o wand: the magick wand.
1257 % o order: the number of columns and rows in the color matrix.
1259 % o color_matrix: An array of doubles representing the color matrix.
1262 WandExport MagickBooleanType MagickRecolorImage(MagickWand *wand,
1263 const size_t order,const double *color_matrix)
1268 assert(wand != (MagickWand *) NULL);
1269 assert(wand->signature == WandSignature);
1270 if (wand->debug != MagickFalse)
1271 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1272 if (color_matrix == (const double *) NULL)
1273 return(MagickFalse);
1274 if (wand->images == (Image *) NULL)
1275 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1276 transform_image=RecolorImage(wand->images,order,color_matrix,
1278 if (transform_image == (Image *) NULL)
1279 return(MagickFalse);
1280 ReplaceImageInList(&wand->images,transform_image);
1285 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1289 % M a g i c k S e t I m a g e A t t r i b u t e %
1293 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1295 % MagickSetImageAttribute() associates a property with an image.
1297 % The format of the MagickSetImageAttribute method is:
1299 % MagickBooleanType MagickSetImageAttribute(MagickWand *wand,
1300 % const char *property,const char *value)
1302 % A description of each parameter follows:
1304 % o wand: the magick wand.
1306 % o property: the property.
1308 % o value: the value.
1311 WandExport MagickBooleanType MagickSetImageAttribute(MagickWand *wand,
1312 const char *property,const char *value)
1314 return(SetImageProperty(wand->images,property,value));
1318 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1322 % M a g i c k S e t I m a g e I n d e x %
1326 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1328 % MagickSetImageIndex() set the current image to the position of the list
1329 % specified with the index parameter.
1331 % The format of the MagickSetImageIndex method is:
1333 % MagickBooleanType MagickSetImageIndex(MagickWand *wand,const ssize_t index)
1335 % A description of each parameter follows:
1337 % o wand: the magick wand.
1339 % o index: the scene number.
1342 WandExport MagickBooleanType MagickSetImageIndex(MagickWand *wand,
1343 const ssize_t index)
1345 return(MagickSetIteratorIndex(wand,index));
1349 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1353 + M a g i c k S e t I m a g e O p t i o n %
1357 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1359 % MagickSetImageOption() associates one or options with a particular image
1360 % format (.e.g MagickSetImageOption(wand,"jpeg","perserve","yes").
1362 % The format of the MagickSetImageOption method is:
1364 % MagickBooleanType MagickSetImageOption(MagickWand *wand,
1365 % const char *format,const char *key,const char *value)
1367 % A description of each parameter follows:
1369 % o wand: the magick wand.
1371 % o format: the image format.
1375 % o value: The value.
1378 WandExport MagickBooleanType MagickSetImageOption(MagickWand *wand,
1379 const char *format,const char *key,const char *value)
1382 option[MaxTextExtent];
1384 assert(wand != (MagickWand *) NULL);
1385 assert(wand->signature == WandSignature);
1386 if (wand->debug != MagickFalse)
1387 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1388 (void) FormatMagickString(option,MaxTextExtent,"%s:%s=%s",format,key,value);
1389 return(DefineImageOption(wand->image_info,option));
1393 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1397 % M a g i c k T r a n s p a r e n t I m a g e %
1401 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1403 % MagickTransparentImage() changes any pixel that matches color with the
1404 % color defined by fill.
1406 % The format of the MagickTransparentImage method is:
1408 % MagickBooleanType MagickTransparentImage(MagickWand *wand,
1409 % const PixelWand *target,const double alpha,const double fuzz)
1411 % A description of each parameter follows:
1413 % o wand: the magick wand.
1415 % o target: Change this target color to specified opacity value within
1418 % o alpha: the level of transparency: 1.0 is fully opaque and 0.0 is fully
1421 % o fuzz: By default target must match a particular pixel color
1422 % exactly. However, in many cases two colors may differ by a small amount.
1423 % The fuzz member of image defines how much tolerance is acceptable to
1424 % consider two colors as the same. For example, set fuzz to 10 and the
1425 % color red at intensities of 100 and 102 respectively are now interpreted
1426 % as the same color for the purposes of the floodfill.
1429 WandExport MagickBooleanType MagickTransparentImage(MagickWand *wand,
1430 const PixelWand *target,const double alpha,const double fuzz)
1432 return(MagickPaintTransparentImage(wand,target,alpha,fuzz));
1436 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1440 % M a g i c k R e g i o n O f I n t e r e s t I m a g e %
1444 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1446 % MagickRegionOfInterestImage() extracts a region of the image and returns it
1449 % The format of the MagickRegionOfInterestImage method is:
1451 % MagickWand *MagickRegionOfInterestImage(MagickWand *wand,
1452 % const size_t width,const size_t height,const ssize_t x,
1455 % A description of each parameter follows:
1457 % o wand: the magick wand.
1459 % o width: the region width.
1461 % o height: the region height.
1463 % o x: the region x offset.
1465 % o y: the region y offset.
1468 WandExport MagickWand *MagickRegionOfInterestImage(MagickWand *wand,
1469 const size_t width,const size_t height,const ssize_t x,
1472 return(MagickGetImageRegion(wand,width,height,x,y));
1476 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1480 % M a g i c k S e t I m a g e P i x e l s %
1484 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1486 % MagickSetImagePixels() accepts pixel datand stores it in the image at the
1487 % location you specify. The method returns MagickFalse on success otherwise
1488 % MagickTrue if an error is encountered. The pixel data can be either char,
1489 % short int, int, ssize_t, float, or double in the order specified by map.
1491 % Suppose your want to upload the first scanline of a 640x480 image from
1492 % character data in red-green-blue order:
1494 % MagickSetImagePixels(wand,0,0,640,1,"RGB",CharPixel,pixels);
1496 % The format of the MagickSetImagePixels method is:
1498 % MagickBooleanType MagickSetImagePixels(MagickWand *wand,
1499 % const ssize_t x,const ssize_t y,const size_t columns,
1500 % const size_t rows,const char *map,const StorageType storage,
1501 % const void *pixels)
1503 % A description of each parameter follows:
1505 % o wand: the magick wand.
1507 % o x, y, columns, rows: These values define the perimeter of a region
1508 % of pixels you want to define.
1510 % o map: This string reflects the expected ordering of the pixel array.
1511 % It can be any combination or order of R = red, G = green, B = blue,
1512 % A = alpha (0 is transparent), O = opacity (0 is opaque), C = cyan,
1513 % Y = yellow, M = magenta, K = black, I = intensity (for grayscale),
1516 % o storage: Define the data type of the pixels. Float and double types are
1517 % expected to be normalized [0..1] otherwise [0..QuantumRange]. Choose from
1518 % these types: CharPixel, ShortPixel, IntegerPixel, LongPixel, FloatPixel,
1521 % o pixels: This array of values contain the pixel components as defined by
1522 % map and type. You must preallocate this array where the expected
1523 % length varies depending on the values of width, height, map, and type.
1526 WandExport MagickBooleanType MagickSetImagePixels(MagickWand *wand,
1527 const ssize_t x,const ssize_t y,const size_t columns,
1528 const size_t rows,const char *map,const StorageType storage,
1531 return(MagickImportImagePixels(wand,x,y,columns,rows,map,storage,pixels));
1535 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1539 % M a g i c k W r i t e I m a g e B l o b %
1543 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1545 % MagickWriteImageBlob() implements direct to memory image formats. It
1546 % returns the image as a blob and its length. Use MagickSetFormat() to
1547 % set the format of the returned blob (GIF, JPEG, PNG, etc.).
1549 % Use MagickRelinquishMemory() to free the blob when you are done with it.
1551 % The format of the MagickWriteImageBlob method is:
1553 % unsigned char *MagickWriteImageBlob(MagickWand *wand,size_t *length)
1555 % A description of each parameter follows:
1557 % o wand: the magick wand.
1559 % o length: the length of the blob.
1562 WandExport unsigned char *MagickWriteImageBlob(MagickWand *wand,size_t *length)
1564 return(MagickGetImageBlob(wand,length));
1568 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1572 % P i x e l G e t N e x t R o w %
1576 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1578 % PixelGetNextRow() returns the next row as an array of pixel wands from the
1581 % The format of the PixelGetNextRow method is:
1583 % PixelWand **PixelGetNextRow(PixelIterator *iterator,
1584 % size_t *number_wands)
1586 % A description of each parameter follows:
1588 % o iterator: the pixel iterator.
1590 % o number_wands: the number of pixel wands.
1593 WandExport PixelWand **PixelGetNextRow(PixelIterator *iterator)
1598 return(PixelGetNextIteratorRow(iterator,&number_wands));
1602 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1606 % P i x e l I t e r a t o r G e t E x c e p t i o n %
1610 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1612 % PixelIteratorGetException() returns the severity, reason, and description of
1613 % any error that occurs when using other methods in this API.
1615 % The format of the PixelIteratorGetException method is:
1617 % char *PixelIteratorGetException(const Pixeliterator *iterator,
1618 % ExceptionType *severity)
1620 % A description of each parameter follows:
1622 % o iterator: the pixel iterator.
1624 % o severity: the severity of the error is returned here.
1627 WandExport char *PixelIteratorGetException(const PixelIterator *iterator,
1628 ExceptionType *severity)
1630 return(PixelGetIteratorException(iterator,severity));