2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6 % M M AAA GGGG IIIII CCCC K K %
7 % MM MM A A G I C K K %
8 % M M M AAAAA G GGG I C KKK %
9 % M M A A G G I C K K %
10 % M M A A GGGG IIIII CCCC K K %
12 % IIIII M M AAA GGGG EEEEE %
14 % I M M M AAAAA G GG EEE %
16 % IIIII M M A A GGGG EEEEE %
19 % MagickWand Image Methods %
26 % Copyright 1999-2012 ImageMagick Studio LLC, a non-profit organization %
27 % dedicated to making software imaging solutions freely available. %
29 % You may not use this file except in compliance with the License. You may %
30 % obtain a copy of the License at %
32 % http://www.imagemagick.org/script/license.php %
34 % Unless required by applicable law or agreed to in writing, software %
35 % distributed under the License is distributed on an "AS IS" BASIS, %
36 % WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. %
37 % See the License for the specific language governing permissions and %
38 % limitations under the License. %
40 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
49 #include "MagickWand/studio.h"
50 #include "MagickWand/MagickWand.h"
51 #include "MagickWand/magick-wand-private.h"
52 #include "MagickWand/wand.h"
53 #include "MagickWand/pixel-wand-private.h"
58 #define ThrowWandException(severity,tag,context) \
60 (void) ThrowMagickException(wand->exception,GetMagickModule(),severity, \
61 tag,"`%s'",context); \
62 return(MagickFalse); \
64 #define MagickWandId "MagickWand"
67 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
71 + C l o n e M a g i c k W a n d F r o m I m a g e s %
75 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
77 % CloneMagickWandFromImages() clones the magick wand and inserts a new image
80 % The format of the CloneMagickWandFromImages method is:
82 % MagickWand *CloneMagickWandFromImages(const MagickWand *wand,
85 % A description of each parameter follows:
87 % o wand: the magick wand.
89 % o images: replace the image list with these image(s).
92 static MagickWand *CloneMagickWandFromImages(const MagickWand *wand,
98 assert(wand != (MagickWand *) NULL);
99 assert(wand->signature == WandSignature);
100 if (wand->debug != MagickFalse)
101 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
102 clone_wand=(MagickWand *) AcquireMagickMemory(sizeof(*clone_wand));
103 if (clone_wand == (MagickWand *) NULL)
104 ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed",
106 (void) ResetMagickMemory(clone_wand,0,sizeof(*clone_wand));
107 clone_wand->id=AcquireWandId();
108 (void) FormatLocaleString(clone_wand->name,MaxTextExtent,"%s-%.20g",
109 MagickWandId,(double) clone_wand->id);
110 clone_wand->exception=AcquireExceptionInfo();
111 InheritException(clone_wand->exception,wand->exception);
112 clone_wand->image_info=CloneImageInfo(wand->image_info);
113 clone_wand->quantize_info=CloneQuantizeInfo(wand->quantize_info);
114 clone_wand->images=images;
115 clone_wand->debug=IsEventLogging();
116 if (clone_wand->debug != MagickFalse)
117 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",clone_wand->name);
118 clone_wand->signature=WandSignature;
123 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
127 % G e t I m a g e F r o m M a g i c k W a n d %
131 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
133 % GetImageFromMagickWand() returns the current image from the magick wand.
135 % The format of the GetImageFromMagickWand method is:
137 % Image *GetImageFromMagickWand(const MagickWand *wand)
139 % A description of each parameter follows:
141 % o wand: the magick wand.
144 WandExport Image *GetImageFromMagickWand(const MagickWand *wand)
146 assert(wand != (MagickWand *) NULL);
147 assert(wand->signature == WandSignature);
148 if (wand->debug != MagickFalse)
149 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
150 if (wand->images == (Image *) NULL)
152 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
153 "ContainsNoImages","`%s'",wand->name);
154 return((Image *) NULL);
156 return(wand->images);
160 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
164 % M a g i c k A d a p t i v e S h a r p e n I m a g e %
168 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
170 % MagickAdaptiveBlurImage() adaptively blurs the image by blurring
171 % less intensely near image edges and more intensely far from edges. We
172 % blur the image with a Gaussian operator of the given radius and standard
173 % deviation (sigma). For reasonable results, radius should be larger than
174 % sigma. Use a radius of 0 and MagickAdaptiveBlurImage() selects a
175 % suitable radius for you.
177 % The format of the MagickAdaptiveBlurImage method is:
179 % MagickBooleanType MagickAdaptiveBlurImage(MagickWand *wand,
180 % const double radius,const double sigma,const double bias)
182 % A description of each parameter follows:
184 % o wand: the magick wand.
186 % o radius: the radius of the Gaussian, in pixels, not counting the center
189 % o sigma: the standard deviation of the Gaussian, in pixels.
194 WandExport MagickBooleanType MagickAdaptiveBlurImage(MagickWand *wand,
195 const double radius,const double sigma,const double bias)
200 assert(wand != (MagickWand *) NULL);
201 assert(wand->signature == WandSignature);
202 if (wand->debug != MagickFalse)
203 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
204 if (wand->images == (Image *) NULL)
205 ThrowWandException(WandError,"ContainsNoImages",wand->name);
206 sharp_image=AdaptiveBlurImage(wand->images,radius,sigma,bias,wand->exception);
207 if (sharp_image == (Image *) NULL)
209 ReplaceImageInList(&wand->images,sharp_image);
214 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
218 % M a g i c k A d a p t i v e R e s i z e I m a g e %
222 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
224 % MagickAdaptiveResizeImage() adaptively resize image with data dependent
227 % MagickBooleanType MagickAdaptiveResizeImage(MagickWand *wand,
228 % const size_t columns,const size_t rows)
230 % A description of each parameter follows:
232 % o wand: the magick wand.
234 % o columns: the number of columns in the scaled image.
236 % o rows: the number of rows in the scaled image.
239 WandExport MagickBooleanType MagickAdaptiveResizeImage(MagickWand *wand,
240 const size_t columns,const size_t rows)
245 assert(wand != (MagickWand *) NULL);
246 assert(wand->signature == WandSignature);
247 if (wand->debug != MagickFalse)
248 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
249 if (wand->images == (Image *) NULL)
250 ThrowWandException(WandError,"ContainsNoImages",wand->name);
251 resize_image=AdaptiveResizeImage(wand->images,columns,rows,wand->exception);
252 if (resize_image == (Image *) NULL)
254 ReplaceImageInList(&wand->images,resize_image);
259 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
263 % M a g i c k A d a p t i v e S h a r p e n I m a g e %
267 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
269 % MagickAdaptiveSharpenImage() adaptively sharpens the image by sharpening
270 % more intensely near image edges and less intensely far from edges. We
271 % sharpen the image with a Gaussian operator of the given radius and standard
272 % deviation (sigma). For reasonable results, radius should be larger than
273 % sigma. Use a radius of 0 and MagickAdaptiveSharpenImage() selects a
274 % suitable radius for you.
276 % The format of the MagickAdaptiveSharpenImage method is:
278 % MagickBooleanType MagickAdaptiveSharpenImage(MagickWand *wand,
279 % const double radius,const double sigma,const double bias)
281 % A description of each parameter follows:
283 % o wand: the magick wand.
285 % o radius: the radius of the Gaussian, in pixels, not counting the center
288 % o sigma: the standard deviation of the Gaussian, in pixels.
293 WandExport MagickBooleanType MagickAdaptiveSharpenImage(MagickWand *wand,
294 const double radius,const double sigma,const double bias)
299 assert(wand != (MagickWand *) NULL);
300 assert(wand->signature == WandSignature);
301 if (wand->debug != MagickFalse)
302 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
303 if (wand->images == (Image *) NULL)
304 ThrowWandException(WandError,"ContainsNoImages",wand->name);
305 sharp_image=AdaptiveSharpenImage(wand->images,radius,sigma,bias,
307 if (sharp_image == (Image *) NULL)
309 ReplaceImageInList(&wand->images,sharp_image);
314 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
318 % M a g i c k A d a p t i v e T h r e s h o l d I m a g e %
322 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
324 % MagickAdaptiveThresholdImage() selects an individual threshold for each pixel
325 % based on the range of intensity values in its local neighborhood. This
326 % allows for thresholding of an image whose global intensity histogram
327 % doesn't contain distinctive peaks.
329 % The format of the AdaptiveThresholdImage method is:
331 % MagickBooleanType MagickAdaptiveThresholdImage(MagickWand *wand,
332 % const size_t width,const size_t height,const double bias)
334 % A description of each parameter follows:
336 % o wand: the magick wand.
338 % o width: the width of the local neighborhood.
340 % o height: the height of the local neighborhood.
342 % o offset: the mean bias.
345 WandExport MagickBooleanType MagickAdaptiveThresholdImage(MagickWand *wand,
346 const size_t width,const size_t height,const double bias)
351 assert(wand != (MagickWand *) NULL);
352 assert(wand->signature == WandSignature);
353 if (wand->debug != MagickFalse)
354 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
355 if (wand->images == (Image *) NULL)
356 ThrowWandException(WandError,"ContainsNoImages",wand->name);
357 threshold_image=AdaptiveThresholdImage(wand->images,width,height,bias,
359 if (threshold_image == (Image *) NULL)
361 ReplaceImageInList(&wand->images,threshold_image);
366 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
370 % M a g i c k A d d I m a g e %
374 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
376 % MagickAddImage() adds a clone of the images in the second wand and
377 % inserts them into the first wand, at the current image location.
379 % Use MagickSetFirstIterator(), to insert new images before all the current
380 % images in the wand, otherwise image is placed after the current image.
382 % The format of the MagickAddImage method is:
384 % MagickBooleanType MagickAddImage(MagickWand *wand,
385 % const MagickWand *add_wand)
387 % A description of each parameter follows:
389 % o wand: the magick wand.
391 % o add_wand: A wand that contains images to add at the current image
396 static inline MagickBooleanType InsertImageInWand(MagickWand *wand,
402 current=wand->images; /* note the current image */
404 /* if no images in wand, just add them and set first image as current */
405 if (current == (Image *) NULL)
407 wand->images=GetFirstImageInList(images);
411 /* user jumped to first image, so prepend new images - remain active */
412 if ((wand->set_first != MagickFalse) &&
413 (current->previous == (Image *) NULL) )
415 PrependImageToList(¤t,images);
416 wand->images=GetFirstImageInList(images);
419 wand->set_first = MagickFalse; /* flag no longer valid */
421 /* Current image was flaged as 'pending' iterative processing. */
422 if (wand->image_pending != MagickFalse)
424 /* current pending image is the last, append new images */
425 if (current->next == (Image *) NULL)
427 AppendImageToList(¤t,images);
428 wand->images=GetLastImageInList(images);
431 /* current pending image is the first image, prepend it */
432 if (current->previous == (Image *) NULL)
434 PrependImageToList(¤t,images);
435 wand->images=GetFirstImageInList(images);
440 /* if at last image append new images */
441 if (current->next == (Image *) NULL)
443 InsertImageInList(¤t,images);
444 wand->images=GetLastImageInList(images);
447 /* otherwise just insert image, just after the current image */
448 InsertImageInList(¤t,images);
449 wand->images=GetFirstImageInList(images);
453 WandExport MagickBooleanType MagickAddImage(MagickWand *wand,
454 const MagickWand *add_wand)
459 assert(wand != (MagickWand *) NULL);
460 assert(wand->signature == WandSignature);
461 if (wand->debug != MagickFalse)
462 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
463 assert(add_wand != (MagickWand *) NULL);
464 assert(add_wand->signature == WandSignature);
465 if (add_wand->images == (Image *) NULL)
466 ThrowWandException(WandError,"ContainsNoImages",add_wand->name);
468 /* clone images in second wand, and insert into first */
469 images=CloneImageList(add_wand->images,wand->exception);
470 if (images == (Image *) NULL)
472 return(InsertImageInWand(wand,images));
476 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
480 % M a g i c k A d d N o i s e I m a g e %
484 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
486 % MagickAddNoiseImage() adds random noise to the image.
488 % The format of the MagickAddNoiseImage method is:
490 % MagickBooleanType MagickAddNoiseImage(MagickWand *wand,
491 % const NoiseType noise_type,const double attenuate)
493 % A description of each parameter follows:
495 % o wand: the magick wand.
497 % o noise_type: The type of noise: Uniform, Gaussian, Multiplicative,
498 % Impulse, Laplacian, or Poisson.
500 % o attenuate: attenuate the random distribution.
503 WandExport MagickBooleanType MagickAddNoiseImage(MagickWand *wand,
504 const NoiseType noise_type,const double attenuate)
509 assert(wand != (MagickWand *) NULL);
510 assert(wand->signature == WandSignature);
511 if (wand->debug != MagickFalse)
512 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
513 if (wand->images == (Image *) NULL)
514 ThrowWandException(WandError,"ContainsNoImages",wand->name);
515 noise_image=AddNoiseImage(wand->images,noise_type,attenuate,wand->exception);
516 if (noise_image == (Image *) NULL)
518 ReplaceImageInList(&wand->images,noise_image);
523 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
527 % M a g i c k A f f i n e T r a n s f o r m I m a g e %
531 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
533 % MagickAffineTransformImage() transforms an image as dictated by the affine
534 % matrix of the drawing wand.
536 % The format of the MagickAffineTransformImage method is:
538 % MagickBooleanType MagickAffineTransformImage(MagickWand *wand,
539 % const DrawingWand *drawing_wand)
541 % A description of each parameter follows:
543 % o wand: the magick wand.
545 % o drawing_wand: the draw wand.
548 WandExport MagickBooleanType MagickAffineTransformImage(MagickWand *wand,
549 const DrawingWand *drawing_wand)
557 assert(wand != (MagickWand *) NULL);
558 assert(wand->signature == WandSignature);
559 if (wand->debug != MagickFalse)
560 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
561 if (wand->images == (Image *) NULL)
562 ThrowWandException(WandError,"ContainsNoImages",wand->name);
563 draw_info=PeekDrawingWand(drawing_wand);
564 if (draw_info == (DrawInfo *) NULL)
566 affine_image=AffineTransformImage(wand->images,&draw_info->affine,
568 draw_info=DestroyDrawInfo(draw_info);
569 if (affine_image == (Image *) NULL)
571 ReplaceImageInList(&wand->images,affine_image);
576 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
580 % M a g i c k A n n o t a t e I m a g e %
584 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
586 % MagickAnnotateImage() annotates an image with text.
588 % The format of the MagickAnnotateImage method is:
590 % MagickBooleanType MagickAnnotateImage(MagickWand *wand,
591 % const DrawingWand *drawing_wand,const double x,const double y,
592 % const double angle,const char *text)
594 % A description of each parameter follows:
596 % o wand: the magick wand.
598 % o drawing_wand: the draw wand.
600 % o x: x ordinate to left of text
602 % o y: y ordinate to text baseline
604 % o angle: rotate text relative to this angle.
606 % o text: text to draw
609 WandExport MagickBooleanType MagickAnnotateImage(MagickWand *wand,
610 const DrawingWand *drawing_wand,const double x,const double y,
611 const double angle,const char *text)
614 geometry[MaxTextExtent];
622 assert(wand != (MagickWand *) NULL);
623 assert(wand->signature == WandSignature);
624 if (wand->debug != MagickFalse)
625 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
626 if (wand->images == (Image *) NULL)
627 ThrowWandException(WandError,"ContainsNoImages",wand->name);
628 draw_info=PeekDrawingWand(drawing_wand);
629 if (draw_info == (DrawInfo *) NULL)
631 (void) CloneString(&draw_info->text,text);
632 (void) FormatLocaleString(geometry,MaxTextExtent,"%+g%+g",x,y);
633 draw_info->affine.sx=cos((double) DegreesToRadians(fmod(angle,360.0)));
634 draw_info->affine.rx=sin((double) DegreesToRadians(fmod(angle,360.0)));
635 draw_info->affine.ry=(-sin((double) DegreesToRadians(fmod(angle,360.0))));
636 draw_info->affine.sy=cos((double) DegreesToRadians(fmod(angle,360.0)));
637 (void) CloneString(&draw_info->geometry,geometry);
638 status=AnnotateImage(wand->images,draw_info,wand->exception);
639 draw_info=DestroyDrawInfo(draw_info);
644 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
648 % M a g i c k A n i m a t e I m a g e s %
652 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
654 % MagickAnimateImages() animates an image or image sequence.
656 % The format of the MagickAnimateImages method is:
658 % MagickBooleanType MagickAnimateImages(MagickWand *wand,
659 % const char *server_name)
661 % A description of each parameter follows:
663 % o wand: the magick wand.
665 % o server_name: the X server name.
668 WandExport MagickBooleanType MagickAnimateImages(MagickWand *wand,
669 const char *server_name)
674 assert(wand != (MagickWand *) NULL);
675 assert(wand->signature == WandSignature);
676 if (wand->debug != MagickFalse)
677 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
678 (void) CloneString(&wand->image_info->server_name,server_name);
679 status=AnimateImages(wand->image_info,wand->images,wand->exception);
684 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
688 % M a g i c k A p p e n d I m a g e s %
692 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
694 % MagickAppendImages() append a set of images.
696 % The format of the MagickAppendImages method is:
698 % MagickWand *MagickAppendImages(MagickWand *wand,
699 % const MagickBooleanType stack)
701 % A description of each parameter follows:
703 % o wand: the magick wand.
705 % o stack: By default, images are stacked left-to-right. Set stack to
706 % MagickTrue to stack them top-to-bottom.
709 WandExport MagickWand *MagickAppendImages(MagickWand *wand,
710 const MagickBooleanType stack)
715 assert(wand != (MagickWand *) NULL);
716 assert(wand->signature == WandSignature);
717 if (wand->debug != MagickFalse)
718 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
719 if (wand->images == (Image *) NULL)
720 return((MagickWand *) NULL);
721 append_image=AppendImages(wand->images,stack,wand->exception);
722 if (append_image == (Image *) NULL)
723 return((MagickWand *) NULL);
724 return(CloneMagickWandFromImages(wand,append_image));
728 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
732 % M a g i c k A u t o G a m m a I m a g e %
736 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
738 % MagickAutoGammaImage() extracts the 'mean' from the image and adjust the
739 % image to try make set its gamma appropriatally.
741 % The format of the MagickAutoGammaImage method is:
743 % MagickBooleanType MagickAutoGammaImage(MagickWand *wand)
745 % A description of each parameter follows:
747 % o wand: the magick wand.
750 WandExport MagickBooleanType MagickAutoGammaImage(MagickWand *wand)
755 assert(wand != (MagickWand *) NULL);
756 assert(wand->signature == WandSignature);
757 if (wand->debug != MagickFalse)
758 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
759 if (wand->images == (Image *) NULL)
760 ThrowWandException(WandError,"ContainsNoImages",wand->name);
761 status=AutoGammaImage(wand->images,wand->exception);
766 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
770 % M a g i c k A u t o L e v e l I m a g e %
774 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
776 % MagickAutoLevelImage() adjusts the levels of a particular image channel by
777 % scaling the minimum and maximum values to the full quantum range.
779 % The format of the MagickAutoLevelImage method is:
781 % MagickBooleanType MagickAutoLevelImage(MagickWand *wand)
783 % A description of each parameter follows:
785 % o wand: the magick wand.
788 WandExport MagickBooleanType MagickAutoLevelImage(MagickWand *wand)
793 assert(wand != (MagickWand *) NULL);
794 assert(wand->signature == WandSignature);
795 if (wand->debug != MagickFalse)
796 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
797 if (wand->images == (Image *) NULL)
798 ThrowWandException(WandError,"ContainsNoImages",wand->name);
799 status=AutoLevelImage(wand->images,wand->exception);
804 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
808 % M a g i c k B l a c k T h r e s h o l d I m a g e %
812 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
814 % MagickBlackThresholdImage() is like MagickThresholdImage() but forces all
815 % pixels below the threshold into black while leaving all pixels above the
816 % threshold unchanged.
818 % The format of the MagickBlackThresholdImage method is:
820 % MagickBooleanType MagickBlackThresholdImage(MagickWand *wand,
821 % const PixelWand *threshold)
823 % A description of each parameter follows:
825 % o wand: the magick wand.
827 % o threshold: the pixel wand.
830 WandExport MagickBooleanType MagickBlackThresholdImage(MagickWand *wand,
831 const PixelWand *threshold)
834 thresholds[MaxTextExtent];
839 assert(wand != (MagickWand *) NULL);
840 assert(wand->signature == WandSignature);
841 if (wand->debug != MagickFalse)
842 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
843 if (wand->images == (Image *) NULL)
844 ThrowWandException(WandError,"ContainsNoImages",wand->name);
845 (void) FormatLocaleString(thresholds,MaxTextExtent,
846 QuantumFormat "," QuantumFormat "," QuantumFormat "," QuantumFormat,
847 PixelGetRedQuantum(threshold),PixelGetGreenQuantum(threshold),
848 PixelGetBlueQuantum(threshold),PixelGetAlphaQuantum(threshold));
849 status=BlackThresholdImage(wand->images,thresholds,wand->exception);
854 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
858 % M a g i c k B l u e S h i f t I m a g e %
862 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
864 % MagickBlueShiftImage() mutes the colors of the image to simulate a scene at
865 % nighttime in the moonlight.
867 % The format of the MagickBlueShiftImage method is:
869 % MagickBooleanType MagickBlueShiftImage(MagickWand *wand,
870 % const double factor)
872 % A description of each parameter follows:
874 % o wand: the magick wand.
876 % o factor: the blue shift factor (default 1.5)
879 WandExport MagickBooleanType MagickBlueShiftImage(MagickWand *wand,
885 assert(wand != (MagickWand *) NULL);
886 assert(wand->signature == WandSignature);
887 if (wand->debug != MagickFalse)
888 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
889 if (wand->images == (Image *) NULL)
890 ThrowWandException(WandError,"ContainsNoImages",wand->name);
891 shift_image=BlueShiftImage(wand->images,factor,wand->exception);
892 if (shift_image == (Image *) NULL)
894 ReplaceImageInList(&wand->images,shift_image);
899 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
903 % M a g i c k B l u r I m a g e %
907 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
909 % MagickBlurImage() blurs an image. We convolve the image with a
910 % gaussian operator of the given radius and standard deviation (sigma).
911 % For reasonable results, the radius should be larger than sigma. Use a
912 % radius of 0 and BlurImage() selects a suitable radius for you.
914 % The format of the MagickBlurImage method is:
916 % MagickBooleanType MagickBlurImage(MagickWand *wand,const double radius,
917 % const double sigmaconst double bias)
919 % A description of each parameter follows:
921 % o wand: the magick wand.
923 % o radius: the radius of the , in pixels, not counting the center
926 % o sigma: the standard deviation of the , in pixels.
931 WandExport MagickBooleanType MagickBlurImage(MagickWand *wand,
932 const double radius,const double sigma,const double bias)
937 assert(wand != (MagickWand *) NULL);
938 assert(wand->signature == WandSignature);
939 if (wand->debug != MagickFalse)
940 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
941 if (wand->images == (Image *) NULL)
942 ThrowWandException(WandError,"ContainsNoImages",wand->name);
943 blur_image=BlurImage(wand->images,radius,sigma,bias,wand->exception);
944 if (blur_image == (Image *) NULL)
946 ReplaceImageInList(&wand->images,blur_image);
951 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
955 % M a g i c k B o r d e r I m a g e %
959 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
961 % MagickBorderImage() surrounds the image with a border of the color defined
962 % by the bordercolor pixel wand.
964 % The format of the MagickBorderImage method is:
966 % MagickBooleanType MagickBorderImage(MagickWand *wand,
967 % const PixelWand *bordercolor,const size_t width,
968 % const size_t height,const CompositeOperator compose)
970 % A description of each parameter follows:
972 % o wand: the magick wand.
974 % o bordercolor: the border color pixel wand.
976 % o width: the border width.
978 % o height: the border height.
980 % o compose: the composite operator.
983 WandExport MagickBooleanType MagickBorderImage(MagickWand *wand,
984 const PixelWand *bordercolor,const size_t width,const size_t height,
985 const CompositeOperator compose)
993 assert(wand != (MagickWand *) NULL);
994 assert(wand->signature == WandSignature);
995 if (wand->debug != MagickFalse)
996 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
997 if (wand->images == (Image *) NULL)
998 ThrowWandException(WandError,"ContainsNoImages",wand->name);
999 border_info.width=width;
1000 border_info.height=height;
1003 PixelGetQuantumPacket(bordercolor,&wand->images->border_color);
1004 border_image=BorderImage(wand->images,&border_info,compose,wand->exception);
1005 if (border_image == (Image *) NULL)
1006 return(MagickFalse);
1007 ReplaceImageInList(&wand->images,border_image);
1012 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1016 % M a g i c k B r i g h t n e s s C o n t r a s t S t r e t c h I m a g e %
1020 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1022 % Use MagickBrightnessContrastImage() to change the brightness and/or contrast
1023 % of an image. It converts the brightness and contrast parameters into slope
1024 % and intercept and calls a polynomical function to apply to the image.
1027 % The format of the MagickBrightnessContrastImage method is:
1029 % MagickBooleanType MagickBrightnessContrastImage(MagickWand *wand,
1030 % const double brightness,const double contrast)
1032 % A description of each parameter follows:
1034 % o wand: the magick wand.
1036 % o brightness: the brightness percent (-100 .. 100).
1038 % o contrast: the contrast percent (-100 .. 100).
1041 WandExport MagickBooleanType MagickBrightnessContrastImage(
1042 MagickWand *wand,const double brightness,const double contrast)
1047 assert(wand != (MagickWand *) NULL);
1048 assert(wand->signature == WandSignature);
1049 if (wand->debug != MagickFalse)
1050 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1051 if (wand->images == (Image *) NULL)
1052 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1053 status=BrightnessContrastImage(wand->images,brightness,contrast,
1059 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1063 % M a g i c k C h a r c o a l I m a g e %
1067 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1069 % MagickCharcoalImage() simulates a charcoal drawing.
1071 % The format of the MagickCharcoalImage method is:
1073 % MagickBooleanType MagickCharcoalImage(MagickWand *wand,
1074 % const double radius,const double sigma,const double bias)
1076 % A description of each parameter follows:
1078 % o wand: the magick wand.
1080 % o radius: the radius of the Gaussian, in pixels, not counting the center
1083 % o sigma: the standard deviation of the Gaussian, in pixels.
1088 WandExport MagickBooleanType MagickCharcoalImage(MagickWand *wand,
1089 const double radius,const double sigma,const double bias)
1094 assert(wand != (MagickWand *) NULL);
1095 assert(wand->signature == WandSignature);
1096 if (wand->debug != MagickFalse)
1097 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1098 if (wand->images == (Image *) NULL)
1099 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1100 charcoal_image=CharcoalImage(wand->images,radius,sigma,bias,wand->exception);
1101 if (charcoal_image == (Image *) NULL)
1102 return(MagickFalse);
1103 ReplaceImageInList(&wand->images,charcoal_image);
1108 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1112 % M a g i c k C h o p I m a g e %
1116 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1118 % MagickChopImage() removes a region of an image and collapses the image to
1119 % occupy the removed portion
1121 % The format of the MagickChopImage method is:
1123 % MagickBooleanType MagickChopImage(MagickWand *wand,
1124 % const size_t width,const size_t height,const ssize_t x,
1127 % A description of each parameter follows:
1129 % o wand: the magick wand.
1131 % o width: the region width.
1133 % o height: the region height.
1135 % o x: the region x offset.
1137 % o y: the region y offset.
1141 WandExport MagickBooleanType MagickChopImage(MagickWand *wand,
1142 const size_t width,const size_t height,const ssize_t x,
1151 assert(wand != (MagickWand *) NULL);
1152 assert(wand->signature == WandSignature);
1153 if (wand->debug != MagickFalse)
1154 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1155 if (wand->images == (Image *) NULL)
1156 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1161 chop_image=ChopImage(wand->images,&chop,wand->exception);
1162 if (chop_image == (Image *) NULL)
1163 return(MagickFalse);
1164 ReplaceImageInList(&wand->images,chop_image);
1169 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1173 % M a g i c k C l a m p I m a g e %
1177 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1179 % MagickClampImage() restricts the color range from 0 to the quantum depth.
1181 % The format of the MagickClampImage method is:
1183 % MagickBooleanType MagickClampImage(MagickWand *wand)
1185 % A description of each parameter follows:
1187 % o wand: the magick wand.
1189 % o channel: the channel.
1192 WandExport MagickBooleanType MagickClampImage(MagickWand *wand)
1194 assert(wand != (MagickWand *) NULL);
1195 assert(wand->signature == WandSignature);
1196 if (wand->debug != MagickFalse)
1197 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1198 if (wand->images == (Image *) NULL)
1199 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1200 return(ClampImage(wand->images,wand->exception));
1204 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1208 % M a g i c k C l i p I m a g e %
1212 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1214 % MagickClipImage() clips along the first path from the 8BIM profile, if
1217 % The format of the MagickClipImage method is:
1219 % MagickBooleanType MagickClipImage(MagickWand *wand)
1221 % A description of each parameter follows:
1223 % o wand: the magick wand.
1226 WandExport MagickBooleanType MagickClipImage(MagickWand *wand)
1231 assert(wand != (MagickWand *) NULL);
1232 assert(wand->signature == WandSignature);
1233 if (wand->debug != MagickFalse)
1234 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1235 if (wand->images == (Image *) NULL)
1236 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1237 status=ClipImage(wand->images,wand->exception);
1242 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1246 % M a g i c k C l i p I m a g e P a t h %
1250 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1252 % MagickClipImagePath() clips along the named paths from the 8BIM profile, if
1253 % present. Later operations take effect inside the path. Id may be a number
1254 % if preceded with #, to work on a numbered path, e.g., "#1" to use the first
1257 % The format of the MagickClipImagePath method is:
1259 % MagickBooleanType MagickClipImagePath(MagickWand *wand,
1260 % const char *pathname,const MagickBooleanType inside)
1262 % A description of each parameter follows:
1264 % o wand: the magick wand.
1266 % o pathname: name of clipping path resource. If name is preceded by #, use
1267 % clipping path numbered by name.
1269 % o inside: if non-zero, later operations take effect inside clipping path.
1270 % Otherwise later operations take effect outside clipping path.
1273 WandExport MagickBooleanType MagickClipImagePath(MagickWand *wand,
1274 const char *pathname,const MagickBooleanType inside)
1279 assert(wand != (MagickWand *) NULL);
1280 assert(wand->signature == WandSignature);
1281 if (wand->debug != MagickFalse)
1282 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1283 if (wand->images == (Image *) NULL)
1284 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1285 status=ClipImagePath(wand->images,pathname,inside,wand->exception);
1290 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1294 % M a g i c k C l u t I m a g e %
1298 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1300 % MagickClutImage() replaces colors in the image from a color lookup table.
1302 % The format of the MagickClutImage method is:
1304 % MagickBooleanType MagickClutImage(MagickWand *wand,
1305 % const MagickWand *clut_wand,const PixelInterpolateMethod method)
1307 % A description of each parameter follows:
1309 % o wand: the magick wand.
1311 % o clut_image: the clut image.
1313 % o method: the pixel interpolation method.
1316 WandExport MagickBooleanType MagickClutImage(MagickWand *wand,
1317 const MagickWand *clut_wand,const PixelInterpolateMethod method)
1322 assert(wand != (MagickWand *) NULL);
1323 assert(wand->signature == WandSignature);
1324 if (wand->debug != MagickFalse)
1325 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1326 if ((wand->images == (Image *) NULL) || (clut_wand->images == (Image *) NULL))
1327 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1328 status=ClutImage(wand->images,clut_wand->images,method,wand->exception);
1333 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1337 % M a g i c k C o a l e s c e I m a g e s %
1341 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1343 % MagickCoalesceImages() composites a set of images while respecting any page
1344 % offsets and disposal methods. GIF, MIFF, and MNG animation sequences
1345 % typically start with an image background and each subsequent image
1346 % varies in size and offset. MagickCoalesceImages() returns a new sequence
1347 % where each image in the sequence is the same size as the first and
1348 % composited with the next image in the sequence.
1350 % The format of the MagickCoalesceImages method is:
1352 % MagickWand *MagickCoalesceImages(MagickWand *wand)
1354 % A description of each parameter follows:
1356 % o wand: the magick wand.
1359 WandExport MagickWand *MagickCoalesceImages(MagickWand *wand)
1364 assert(wand != (MagickWand *) NULL);
1365 assert(wand->signature == WandSignature);
1366 if (wand->debug != MagickFalse)
1367 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1368 if (wand->images == (Image *) NULL)
1369 return((MagickWand *) NULL);
1370 coalesce_image=CoalesceImages(wand->images,wand->exception);
1371 if (coalesce_image == (Image *) NULL)
1372 return((MagickWand *) NULL);
1373 return(CloneMagickWandFromImages(wand,coalesce_image));
1377 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1381 % M a g i c k C o l o r D e c i s i o n I m a g e %
1385 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1387 % MagickColorDecisionListImage() accepts a lightweight Color Correction
1388 % Collection (CCC) file which solely contains one or more color corrections
1389 % and applies the color correction to the image. Here is a sample CCC file:
1391 % <ColorCorrectionCollection xmlns="urn:ASC:CDL:v1.2">
1392 % <ColorCorrection id="cc03345">
1394 % <Slope> 0.9 1.2 0.5 </Slope>
1395 % <Offset> 0.4 -0.5 0.6 </Offset>
1396 % <Power> 1.0 0.8 1.5 </Power>
1399 % <Saturation> 0.85 </Saturation>
1401 % </ColorCorrection>
1402 % </ColorCorrectionCollection>
1404 % which includes the offset, slope, and power for each of the RGB channels
1405 % as well as the saturation.
1407 % The format of the MagickColorDecisionListImage method is:
1409 % MagickBooleanType MagickColorDecisionListImage(MagickWand *wand,
1410 % const double gamma)
1412 % A description of each parameter follows:
1414 % o wand: the magick wand.
1416 % o color_correction_collection: the color correction collection in XML.
1419 WandExport MagickBooleanType MagickColorDecisionListImage(MagickWand *wand,
1420 const char *color_correction_collection)
1425 assert(wand != (MagickWand *) NULL);
1426 assert(wand->signature == WandSignature);
1427 if (wand->debug != MagickFalse)
1428 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1429 if (wand->images == (Image *) NULL)
1430 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1431 status=ColorDecisionListImage(wand->images,color_correction_collection,
1437 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1441 % M a g i c k C o l o r i z e I m a g e %
1445 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1447 % MagickColorizeImage() blends the fill color with each pixel in the image.
1449 % The format of the MagickColorizeImage method is:
1451 % MagickBooleanType MagickColorizeImage(MagickWand *wand,
1452 % const PixelWand *colorize,const PixelWand *blend)
1454 % A description of each parameter follows:
1456 % o wand: the magick wand.
1458 % o colorize: the colorize pixel wand.
1460 % o alpha: the alpha pixel wand.
1463 WandExport MagickBooleanType MagickColorizeImage(MagickWand *wand,
1464 const PixelWand *colorize,const PixelWand *blend)
1467 percent_blend[MaxTextExtent];
1475 assert(wand != (MagickWand *) NULL);
1476 assert(wand->signature == WandSignature);
1477 if (wand->debug != MagickFalse)
1478 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1479 if (wand->images == (Image *) NULL)
1480 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1481 GetPixelInfo(wand->images,&target);
1482 if (target.colorspace != CMYKColorspace)
1483 (void) FormatLocaleString(percent_blend,MaxTextExtent,
1484 "%g,%g,%g,%g",(double) (100.0*QuantumScale*
1485 PixelGetRedQuantum(blend)),(double) (100.0*QuantumScale*
1486 PixelGetGreenQuantum(blend)),(double) (100.0*QuantumScale*
1487 PixelGetBlueQuantum(blend)),(double) (100.0*QuantumScale*
1488 PixelGetAlphaQuantum(blend)));
1490 (void) FormatLocaleString(percent_blend,MaxTextExtent,
1491 "%g,%g,%g,%g,%g",(double) (100.0*QuantumScale*
1492 PixelGetRedQuantum(blend)),(double) (100.0*QuantumScale*
1493 PixelGetGreenQuantum(blend)),(double) (100.0*QuantumScale*
1494 PixelGetBlueQuantum(blend)),(double) (100.0*QuantumScale*
1495 PixelGetBlackQuantum(blend)),(double) (100.0*QuantumScale*
1496 PixelGetAlphaQuantum(blend)));
1497 target=PixelGetPixel(colorize);
1498 colorize_image=ColorizeImage(wand->images,percent_blend,&target,
1500 if (colorize_image == (Image *) NULL)
1501 return(MagickFalse);
1502 ReplaceImageInList(&wand->images,colorize_image);
1507 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1511 % M a g i c k C o l o r M a t r i x I m a g e %
1515 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1517 % MagickColorMatrixImage() apply color transformation to an image. The method
1518 % permits saturation changes, hue rotation, luminance to alpha, and various
1519 % other effects. Although variable-sized transformation matrices can be used,
1520 % typically one uses a 5x5 matrix for an RGBA image and a 6x6 for CMYKA
1521 % (or RGBA with offsets). The matrix is similar to those used by Adobe Flash
1522 % except offsets are in column 6 rather than 5 (in support of CMYKA images)
1523 % and offsets are normalized (divide Flash offset by 255).
1525 % The format of the MagickColorMatrixImage method is:
1527 % MagickBooleanType MagickColorMatrixImage(MagickWand *wand,
1528 % const KernelInfo *color_matrix)
1530 % A description of each parameter follows:
1532 % o wand: the magick wand.
1534 % o color_matrix: the color matrix.
1537 WandExport MagickBooleanType MagickColorMatrixImage(MagickWand *wand,
1538 const KernelInfo *color_matrix)
1543 assert(wand != (MagickWand *) NULL);
1544 assert(wand->signature == WandSignature);
1545 if (wand->debug != MagickFalse)
1546 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1547 if (color_matrix == (const KernelInfo *) NULL)
1548 return(MagickFalse);
1549 if (wand->images == (Image *) NULL)
1550 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1551 color_image=ColorMatrixImage(wand->images,color_matrix,wand->exception);
1552 if (color_image == (Image *) NULL)
1553 return(MagickFalse);
1554 ReplaceImageInList(&wand->images,color_image);
1559 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1563 % M a g i c k C o m b i n e I m a g e s %
1567 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1569 % MagickCombineImages() combines one or more images into a single image. The
1570 % grayscale value of the pixels of each image in the sequence is assigned in
1571 % order to the specified hannels of the combined image. The typical
1572 % ordering would be image 1 => Red, 2 => Green, 3 => Blue, etc.
1574 % The format of the MagickCombineImages method is:
1576 % MagickWand *MagickCombineImages(MagickWand *wand)
1578 % A description of each parameter follows:
1580 % o wand: the magick wand.
1583 WandExport MagickWand *MagickCombineImages(MagickWand *wand)
1588 assert(wand != (MagickWand *) NULL);
1589 assert(wand->signature == WandSignature);
1590 if (wand->debug != MagickFalse)
1591 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1592 if (wand->images == (Image *) NULL)
1593 return((MagickWand *) NULL);
1594 combine_image=CombineImages(wand->images,wand->exception);
1595 if (combine_image == (Image *) NULL)
1596 return((MagickWand *) NULL);
1597 return(CloneMagickWandFromImages(wand,combine_image));
1601 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1605 % M a g i c k C o m m e n t I m a g e %
1609 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1611 % MagickCommentImage() adds a comment to your image.
1613 % The format of the MagickCommentImage method is:
1615 % MagickBooleanType MagickCommentImage(MagickWand *wand,
1616 % const char *comment)
1618 % A description of each parameter follows:
1620 % o wand: the magick wand.
1622 % o comment: the image comment.
1625 WandExport MagickBooleanType MagickCommentImage(MagickWand *wand,
1626 const char *comment)
1631 assert(wand != (MagickWand *) NULL);
1632 assert(wand->signature == WandSignature);
1633 if (wand->debug != MagickFalse)
1634 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1635 if (wand->images == (Image *) NULL)
1636 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1637 status=SetImageProperty(wand->images,"comment",comment,wand->exception);
1642 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1646 % M a g i c k C o m p a r e I m a g e L a y e r s %
1650 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1652 % MagickCompareImagesLayers() compares each image with the next in a sequence
1653 % and returns the maximum bounding region of any pixel differences it
1656 % The format of the MagickCompareImagesLayers method is:
1658 % MagickWand *MagickCompareImagesLayers(MagickWand *wand,
1659 % const ImageLayerMethod method)
1661 % A description of each parameter follows:
1663 % o wand: the magick wand.
1665 % o method: the compare method.
1668 WandExport MagickWand *MagickCompareImagesLayers(MagickWand *wand,
1669 const ImageLayerMethod method)
1674 assert(wand != (MagickWand *) NULL);
1675 assert(wand->signature == WandSignature);
1676 if (wand->debug != MagickFalse)
1677 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1678 if (wand->images == (Image *) NULL)
1679 return((MagickWand *) NULL);
1680 layers_image=CompareImagesLayers(wand->images,method,wand->exception);
1681 if (layers_image == (Image *) NULL)
1682 return((MagickWand *) NULL);
1683 return(CloneMagickWandFromImages(wand,layers_image));
1687 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1691 % M a g i c k C o m p a r e I m a g e s %
1695 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1697 % MagickCompareImages() compares an image to a reconstructed image and returns
1698 % the specified difference image.
1700 % The format of the MagickCompareImages method is:
1702 % MagickWand *MagickCompareImages(MagickWand *wand,
1703 % const MagickWand *reference,const MetricType metric,
1704 % double *distortion)
1706 % A description of each parameter follows:
1708 % o wand: the magick wand.
1710 % o reference: the reference wand.
1712 % o metric: the metric.
1714 % o distortion: the computed distortion between the images.
1717 WandExport MagickWand *MagickCompareImages(MagickWand *wand,
1718 const MagickWand *reference,const MetricType metric,double *distortion)
1724 assert(wand != (MagickWand *) NULL);
1725 assert(wand->signature == WandSignature);
1726 if (wand->debug != MagickFalse)
1727 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1728 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
1730 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
1731 "ContainsNoImages","`%s'",wand->name);
1732 return((MagickWand *) NULL);
1734 compare_image=CompareImages(wand->images,reference->images,metric,distortion,
1736 if (compare_image == (Image *) NULL)
1737 return((MagickWand *) NULL);
1738 return(CloneMagickWandFromImages(wand,compare_image));
1742 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1746 % M a g i c k C o m p o s i t e I m a g e %
1750 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1752 % MagickCompositeImage() composite one image onto another at the specified
1755 % The format of the MagickCompositeImage method is:
1757 % MagickBooleanType MagickCompositeImage(MagickWand *wand,
1758 % const MagickWand *composite_wand,const CompositeOperator compose,
1759 % const ssize_t x,const ssize_t y)
1761 % A description of each parameter follows:
1763 % o wand: the magick wand.
1765 % o composite_image: the composite image.
1767 % o compose: This operator affects how the composite is applied to the
1768 % image. The default is Over. Choose from these operators:
1770 % OverCompositeOp InCompositeOp OutCompositeOp
1771 % AtopCompositeOp XorCompositeOp PlusCompositeOp
1772 % MinusCompositeOp AddCompositeOp SubtractCompositeOp
1773 % DifferenceCompositeOp BumpmapCompositeOp CopyCompositeOp
1774 % DisplaceCompositeOp
1776 % o x: the column offset of the composited image.
1778 % o y: the row offset of the composited image.
1781 WandExport MagickBooleanType MagickCompositeImage(MagickWand *wand,
1782 const MagickWand *composite_wand,const CompositeOperator compose,
1783 const ssize_t x,const ssize_t y)
1788 assert(wand != (MagickWand *) NULL);
1789 assert(wand->signature == WandSignature);
1790 if (wand->debug != MagickFalse)
1791 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1792 if ((wand->images == (Image *) NULL) ||
1793 (composite_wand->images == (Image *) NULL))
1794 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1795 status=CompositeImage(wand->images,compose,composite_wand->images,x,y,
1801 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1805 % M a g i c k C o n t r a s t I m a g e %
1809 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1811 % MagickContrastImage() enhances the intensity differences between the lighter
1812 % and darker elements of the image. Set sharpen to a value other than 0 to
1813 % increase the image contrast otherwise the contrast is reduced.
1815 % The format of the MagickContrastImage method is:
1817 % MagickBooleanType MagickContrastImage(MagickWand *wand,
1818 % const MagickBooleanType sharpen)
1820 % A description of each parameter follows:
1822 % o wand: the magick wand.
1824 % o sharpen: Increase or decrease image contrast.
1828 WandExport MagickBooleanType MagickContrastImage(MagickWand *wand,
1829 const MagickBooleanType sharpen)
1834 assert(wand != (MagickWand *) NULL);
1835 assert(wand->signature == WandSignature);
1836 if (wand->debug != MagickFalse)
1837 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1838 if (wand->images == (Image *) NULL)
1839 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1840 status=ContrastImage(wand->images,sharpen,wand->exception);
1845 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1849 % M a g i c k C o n t r a s t S t r e t c h I m a g e %
1853 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1855 % MagickContrastStretchImage() enhances the contrast of a color image by
1856 % adjusting the pixels color to span the entire range of colors available.
1857 % You can also reduce the influence of a particular channel with a gamma
1860 % The format of the MagickContrastStretchImage method is:
1862 % MagickBooleanType MagickContrastStretchImage(MagickWand *wand,
1863 % const double black_point,const double white_point)
1865 % A description of each parameter follows:
1867 % o wand: the magick wand.
1869 % o black_point: the black point.
1871 % o white_point: the white point.
1874 WandExport MagickBooleanType MagickContrastStretchImage(MagickWand *wand,
1875 const double black_point,const double white_point)
1880 assert(wand != (MagickWand *) NULL);
1881 assert(wand->signature == WandSignature);
1882 if (wand->debug != MagickFalse)
1883 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1884 if (wand->images == (Image *) NULL)
1885 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1886 status=ContrastStretchImage(wand->images,black_point,white_point,
1892 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1896 % M a g i c k C o n v o l v e I m a g e %
1900 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1902 % MagickConvolveImage() applies a custom convolution kernel to the image.
1904 % The format of the MagickConvolveImage method is:
1906 % MagickBooleanType MagickConvolveImage(MagickWand *wand,
1907 % const KernelInfo *kernel)
1909 % A description of each parameter follows:
1911 % o wand: the magick wand.
1913 % o kernel: An array of doubles representing the convolution kernel.
1916 WandExport MagickBooleanType MagickConvolveImage(MagickWand *wand,
1917 const KernelInfo *kernel)
1922 assert(wand != (MagickWand *) NULL);
1923 assert(wand->signature == WandSignature);
1924 if (wand->debug != MagickFalse)
1925 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1926 if (kernel == (const KernelInfo *) NULL)
1927 return(MagickFalse);
1928 if (wand->images == (Image *) NULL)
1929 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1930 filter_image=ConvolveImage(wand->images,kernel,wand->exception);
1931 if (filter_image == (Image *) NULL)
1932 return(MagickFalse);
1933 ReplaceImageInList(&wand->images,filter_image);
1938 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1942 % M a g i c k C r o p I m a g e %
1946 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1948 % MagickCropImage() extracts a region of the image.
1950 % The format of the MagickCropImage method is:
1952 % MagickBooleanType MagickCropImage(MagickWand *wand,
1953 % const size_t width,const size_t height,const ssize_t x,const ssize_t y)
1955 % A description of each parameter follows:
1957 % o wand: the magick wand.
1959 % o width: the region width.
1961 % o height: the region height.
1963 % o x: the region x-offset.
1965 % o y: the region y-offset.
1968 WandExport MagickBooleanType MagickCropImage(MagickWand *wand,
1969 const size_t width,const size_t height,const ssize_t x,const ssize_t y)
1977 assert(wand != (MagickWand *) NULL);
1978 assert(wand->signature == WandSignature);
1979 if (wand->debug != MagickFalse)
1980 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1981 if (wand->images == (Image *) NULL)
1982 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1987 crop_image=CropImage(wand->images,&crop,wand->exception);
1988 if (crop_image == (Image *) NULL)
1989 return(MagickFalse);
1990 ReplaceImageInList(&wand->images,crop_image);
1995 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1999 % M a g i c k C y c l e C o l o r m a p I m a g e %
2003 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2005 % MagickCycleColormapImage() displaces an image's colormap by a given number
2006 % of positions. If you cycle the colormap a number of times you can produce
2007 % a psychodelic effect.
2009 % The format of the MagickCycleColormapImage method is:
2011 % MagickBooleanType MagickCycleColormapImage(MagickWand *wand,
2012 % const ssize_t displace)
2014 % A description of each parameter follows:
2016 % o wand: the magick wand.
2018 % o pixel_wand: the pixel wand.
2021 WandExport MagickBooleanType MagickCycleColormapImage(MagickWand *wand,
2022 const ssize_t displace)
2027 assert(wand != (MagickWand *) NULL);
2028 assert(wand->signature == WandSignature);
2029 if (wand->debug != MagickFalse)
2030 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2031 if (wand->images == (Image *) NULL)
2032 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2033 status=CycleColormapImage(wand->images,displace,wand->exception);
2038 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2042 % M a g i c k C o n s t i t u t e I m a g e %
2046 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2048 % MagickConstituteImage() adds an image to the wand comprised of the pixel
2049 % data you supply. The pixel data must be in scanline order top-to-bottom.
2050 % The data can be char, short int, int, float, or double. Float and double
2051 % require the pixels to be normalized [0..1], otherwise [0..Max], where Max
2052 % is the maximum value the type can accomodate (e.g. 255 for char). For
2053 % example, to create a 640x480 image from unsigned red-green-blue character
2056 % MagickConstituteImage(wand,640,640,"RGB",CharPixel,pixels);
2058 % The format of the MagickConstituteImage method is:
2060 % MagickBooleanType MagickConstituteImage(MagickWand *wand,
2061 % const size_t columns,const size_t rows,const char *map,
2062 % const StorageType storage,void *pixels)
2064 % A description of each parameter follows:
2066 % o wand: the magick wand.
2068 % o columns: width in pixels of the image.
2070 % o rows: height in pixels of the image.
2072 % o map: This string reflects the expected ordering of the pixel array.
2073 % It can be any combination or order of R = red, G = green, B = blue,
2074 % A = alpha (0 is transparent), O = alpha (0 is opaque), C = cyan,
2075 % Y = yellow, M = magenta, K = black, I = intensity (for grayscale),
2078 % o storage: Define the data type of the pixels. Float and double types are
2079 % expected to be normalized [0..1] otherwise [0..QuantumRange]. Choose from
2080 % these types: CharPixel, DoublePixel, FloatPixel, IntegerPixel,
2081 % LongPixel, QuantumPixel, or ShortPixel.
2083 % o pixels: This array of values contain the pixel components as defined by
2084 % map and type. You must preallocate this array where the expected
2085 % length varies depending on the values of width, height, map, and type.
2089 WandExport MagickBooleanType MagickConstituteImage(MagickWand *wand,
2090 const size_t columns,const size_t rows,const char *map,
2091 const StorageType storage,const void *pixels)
2096 assert(wand != (MagickWand *) NULL);
2097 assert(wand->signature == WandSignature);
2098 if (wand->debug != MagickFalse)
2099 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2100 images=ConstituteImage(columns,rows,map,storage,pixels,wand->exception);
2101 if (images == (Image *) NULL)
2102 return(MagickFalse);
2103 return(InsertImageInWand(wand,images));
2107 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2111 % M a g i c k D e c i p h e r I m a g e %
2115 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2117 % MagickDecipherImage() converts cipher pixels to plain pixels.
2119 % The format of the MagickDecipherImage method is:
2121 % MagickBooleanType MagickDecipherImage(MagickWand *wand,
2122 % const char *passphrase)
2124 % A description of each parameter follows:
2126 % o wand: the magick wand.
2128 % o passphrase: the passphrase.
2131 WandExport MagickBooleanType MagickDecipherImage(MagickWand *wand,
2132 const char *passphrase)
2134 assert(wand != (MagickWand *) NULL);
2135 assert(wand->signature == WandSignature);
2136 if (wand->debug != MagickFalse)
2137 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2138 if (wand->images == (Image *) NULL)
2139 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2140 return(DecipherImage(wand->images,passphrase,wand->exception));
2144 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2148 % M a g i c k D e c o n s t r u c t I m a g e s %
2152 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2154 % MagickDeconstructImages() compares each image with the next in a sequence
2155 % and returns the maximum bounding region of any pixel differences it
2158 % The format of the MagickDeconstructImages method is:
2160 % MagickWand *MagickDeconstructImages(MagickWand *wand)
2162 % A description of each parameter follows:
2164 % o wand: the magick wand.
2167 WandExport MagickWand *MagickDeconstructImages(MagickWand *wand)
2172 assert(wand != (MagickWand *) NULL);
2173 assert(wand->signature == WandSignature);
2174 if (wand->debug != MagickFalse)
2175 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2176 if (wand->images == (Image *) NULL)
2177 return((MagickWand *) NULL);
2178 deconstruct_image=CompareImagesLayers(wand->images,CompareAnyLayer,
2180 if (deconstruct_image == (Image *) NULL)
2181 return((MagickWand *) NULL);
2182 return(CloneMagickWandFromImages(wand,deconstruct_image));
2186 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2190 % M a g i c k D e s k e w I m a g e %
2194 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2196 % MagickDeskewImage() removes skew from the image. Skew is an artifact that
2197 % occurs in scanned images because of the camera being misaligned,
2198 % imperfections in the scanning or surface, or simply because the paper was
2199 % not placed completely flat when scanned.
2201 % The format of the MagickDeskewImage method is:
2203 % MagickBooleanType MagickDeskewImage(MagickWand *wand,
2204 % const double threshold)
2206 % A description of each parameter follows:
2208 % o wand: the magick wand.
2210 % o threshold: separate background from foreground.
2213 WandExport MagickBooleanType MagickDeskewImage(MagickWand *wand,
2214 const double threshold)
2219 assert(wand != (MagickWand *) NULL);
2220 assert(wand->signature == WandSignature);
2221 if (wand->debug != MagickFalse)
2222 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2223 if (wand->images == (Image *) NULL)
2224 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2225 sepia_image=DeskewImage(wand->images,threshold,wand->exception);
2226 if (sepia_image == (Image *) NULL)
2227 return(MagickFalse);
2228 ReplaceImageInList(&wand->images,sepia_image);
2233 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2237 % M a g i c k D e s p e c k l e I m a g e %
2241 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2243 % MagickDespeckleImage() reduces the speckle noise in an image while
2244 % perserving the edges of the original image.
2246 % The format of the MagickDespeckleImage method is:
2248 % MagickBooleanType MagickDespeckleImage(MagickWand *wand)
2250 % A description of each parameter follows:
2252 % o wand: the magick wand.
2255 WandExport MagickBooleanType MagickDespeckleImage(MagickWand *wand)
2260 assert(wand != (MagickWand *) NULL);
2261 assert(wand->signature == WandSignature);
2262 if (wand->debug != MagickFalse)
2263 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2264 if (wand->images == (Image *) NULL)
2265 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2266 despeckle_image=DespeckleImage(wand->images,wand->exception);
2267 if (despeckle_image == (Image *) NULL)
2268 return(MagickFalse);
2269 ReplaceImageInList(&wand->images,despeckle_image);
2274 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2278 % M a g i c k D e s t r o y I m a g e %
2282 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2284 % MagickDestroyImage() dereferences an image, deallocating memory associated
2285 % with the image if the reference count becomes zero.
2287 % The format of the MagickDestroyImage method is:
2289 % Image *MagickDestroyImage(Image *image)
2291 % A description of each parameter follows:
2293 % o image: the image.
2296 WandExport Image *MagickDestroyImage(Image *image)
2298 return(DestroyImage(image));
2302 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2306 % M a g i c k D i s p l a y I m a g e %
2310 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2312 % MagickDisplayImage() displays an image.
2314 % The format of the MagickDisplayImage method is:
2316 % MagickBooleanType MagickDisplayImage(MagickWand *wand,
2317 % const char *server_name)
2319 % A description of each parameter follows:
2321 % o wand: the magick wand.
2323 % o server_name: the X server name.
2326 WandExport MagickBooleanType MagickDisplayImage(MagickWand *wand,
2327 const char *server_name)
2335 assert(wand != (MagickWand *) NULL);
2336 assert(wand->signature == WandSignature);
2337 if (wand->debug != MagickFalse)
2338 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2339 if (wand->images == (Image *) NULL)
2340 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2341 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
2342 if (image == (Image *) NULL)
2343 return(MagickFalse);
2344 (void) CloneString(&wand->image_info->server_name,server_name);
2345 status=DisplayImages(wand->image_info,image,wand->exception);
2346 image=DestroyImage(image);
2351 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2355 % M a g i c k D i s p l a y I m a g e s %
2359 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2361 % MagickDisplayImages() displays an image or image sequence.
2363 % The format of the MagickDisplayImages method is:
2365 % MagickBooleanType MagickDisplayImages(MagickWand *wand,
2366 % const char *server_name)
2368 % A description of each parameter follows:
2370 % o wand: the magick wand.
2372 % o server_name: the X server name.
2375 WandExport MagickBooleanType MagickDisplayImages(MagickWand *wand,
2376 const char *server_name)
2381 assert(wand != (MagickWand *) NULL);
2382 assert(wand->signature == WandSignature);
2383 if (wand->debug != MagickFalse)
2384 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2385 (void) CloneString(&wand->image_info->server_name,server_name);
2386 status=DisplayImages(wand->image_info,wand->images,wand->exception);
2391 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2395 % M a g i c k D i s t o r t I m a g e %
2399 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2401 % MagickDistortImage() distorts an image using various distortion methods, by
2402 % mapping color lookups of the source image to a new destination image
2403 % usally of the same size as the source image, unless 'bestfit' is set to
2406 % If 'bestfit' is enabled, and distortion allows it, the destination image is
2407 % adjusted to ensure the whole source 'image' will just fit within the final
2408 % destination image, which will be sized and offset accordingly. Also in
2409 % many cases the virtual offset of the source image will be taken into
2410 % account in the mapping.
2412 % The format of the MagickDistortImage method is:
2414 % MagickBooleanType MagickDistortImage(MagickWand *wand,
2415 % const DistortImageMethod method,const size_t number_arguments,
2416 % const double *arguments,const MagickBooleanType bestfit)
2418 % A description of each parameter follows:
2420 % o image: the image to be distorted.
2422 % o method: the method of image distortion.
2424 % ArcDistortion always ignores the source image offset, and always
2425 % 'bestfit' the destination image with the top left corner offset
2426 % relative to the polar mapping center.
2428 % Bilinear has no simple inverse mapping so it does not allow 'bestfit'
2429 % style of image distortion.
2431 % Affine, Perspective, and Bilinear, do least squares fitting of the
2432 % distortion when more than the minimum number of control point pairs
2435 % Perspective, and Bilinear, falls back to a Affine distortion when less
2436 % that 4 control point pairs are provided. While Affine distortions let
2437 % you use any number of control point pairs, that is Zero pairs is a
2438 % no-Op (viewport only) distrotion, one pair is a translation and two
2439 % pairs of control points do a scale-rotate-translate, without any
2442 % o number_arguments: the number of arguments given for this distortion
2445 % o arguments: the arguments for this distortion method.
2447 % o bestfit: Attempt to resize destination to fit distorted source.
2450 WandExport MagickBooleanType MagickDistortImage(MagickWand *wand,
2451 const DistortImageMethod method,const size_t number_arguments,
2452 const double *arguments,const MagickBooleanType bestfit)
2457 assert(wand != (MagickWand *) NULL);
2458 assert(wand->signature == WandSignature);
2459 if (wand->debug != MagickFalse)
2460 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2461 if (wand->images == (Image *) NULL)
2462 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2463 distort_image=DistortImage(wand->images,method,number_arguments,arguments,
2464 bestfit,wand->exception);
2465 if (distort_image == (Image *) NULL)
2466 return(MagickFalse);
2467 ReplaceImageInList(&wand->images,distort_image);
2472 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2476 % M a g i c k D r a w I m a g e %
2480 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2482 % MagickDrawImage() renders the drawing wand on the current image.
2484 % The format of the MagickDrawImage method is:
2486 % MagickBooleanType MagickDrawImage(MagickWand *wand,
2487 % const DrawingWand *drawing_wand)
2489 % A description of each parameter follows:
2491 % o wand: the magick wand.
2493 % o drawing_wand: the draw wand.
2496 WandExport MagickBooleanType MagickDrawImage(MagickWand *wand,
2497 const DrawingWand *drawing_wand)
2508 assert(wand != (MagickWand *) NULL);
2509 assert(wand->signature == WandSignature);
2510 if (wand->debug != MagickFalse)
2511 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2512 if (wand->images == (Image *) NULL)
2513 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2514 draw_info=PeekDrawingWand(drawing_wand);
2515 if ((draw_info == (DrawInfo *) NULL) ||
2516 (draw_info->primitive == (char *) NULL))
2517 return(MagickFalse);
2518 primitive=AcquireString(draw_info->primitive);
2519 draw_info=DestroyDrawInfo(draw_info);
2520 draw_info=CloneDrawInfo(wand->image_info,(DrawInfo *) NULL);
2521 draw_info->primitive=primitive;
2522 status=DrawImage(wand->images,draw_info,wand->exception);
2523 draw_info=DestroyDrawInfo(draw_info);
2528 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2532 % M a g i c k E d g e I m a g e %
2536 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2538 % MagickEdgeImage() enhance edges within the image with a convolution filter
2539 % of the given radius. Use a radius of 0 and Edge() selects a suitable
2542 % The format of the MagickEdgeImage method is:
2544 % MagickBooleanType MagickEdgeImage(MagickWand *wand,const double radius,
2545 % const double sigma)
2547 % A description of each parameter follows:
2549 % o wand: the magick wand.
2551 % o radius: the radius of the pixel neighborhood.
2553 % o sigma: the standard deviation of the Gaussian, in pixels.
2556 WandExport MagickBooleanType MagickEdgeImage(MagickWand *wand,
2557 const double radius,const double sigma)
2562 assert(wand != (MagickWand *) NULL);
2563 assert(wand->signature == WandSignature);
2564 if (wand->debug != MagickFalse)
2565 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2566 if (wand->images == (Image *) NULL)
2567 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2568 edge_image=EdgeImage(wand->images,radius,sigma,wand->exception);
2569 if (edge_image == (Image *) NULL)
2570 return(MagickFalse);
2571 ReplaceImageInList(&wand->images,edge_image);
2576 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2580 % M a g i c k E m b o s s I m a g e %
2584 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2586 % MagickEmbossImage() returns a grayscale image with a three-dimensional
2587 % effect. We convolve the image with a Gaussian operator of the given radius
2588 % and standard deviation (sigma). For reasonable results, radius should be
2589 % larger than sigma. Use a radius of 0 and Emboss() selects a suitable
2592 % The format of the MagickEmbossImage method is:
2594 % MagickBooleanType MagickEmbossImage(MagickWand *wand,const double radius,
2595 % const double sigma)
2597 % A description of each parameter follows:
2599 % o wand: the magick wand.
2601 % o radius: the radius of the Gaussian, in pixels, not counting the center
2604 % o sigma: the standard deviation of the Gaussian, in pixels.
2607 WandExport MagickBooleanType MagickEmbossImage(MagickWand *wand,
2608 const double radius,const double sigma)
2613 assert(wand != (MagickWand *) NULL);
2614 assert(wand->signature == WandSignature);
2615 if (wand->debug != MagickFalse)
2616 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2617 if (wand->images == (Image *) NULL)
2618 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2619 emboss_image=EmbossImage(wand->images,radius,sigma,wand->exception);
2620 if (emboss_image == (Image *) NULL)
2621 return(MagickFalse);
2622 ReplaceImageInList(&wand->images,emboss_image);
2627 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2631 % M a g i c k E n c i p h e r I m a g e %
2635 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2637 % MagickEncipherImage() converts plaint pixels to cipher pixels.
2639 % The format of the MagickEncipherImage method is:
2641 % MagickBooleanType MagickEncipherImage(MagickWand *wand,
2642 % const char *passphrase)
2644 % A description of each parameter follows:
2646 % o wand: the magick wand.
2648 % o passphrase: the passphrase.
2651 WandExport MagickBooleanType MagickEncipherImage(MagickWand *wand,
2652 const char *passphrase)
2654 assert(wand != (MagickWand *) NULL);
2655 assert(wand->signature == WandSignature);
2656 if (wand->debug != MagickFalse)
2657 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2658 if (wand->images == (Image *) NULL)
2659 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2660 return(EncipherImage(wand->images,passphrase,wand->exception));
2664 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2668 % M a g i c k E n h a n c e I m a g e %
2672 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2674 % MagickEnhanceImage() applies a digital filter that improves the quality of a
2677 % The format of the MagickEnhanceImage method is:
2679 % MagickBooleanType MagickEnhanceImage(MagickWand *wand)
2681 % A description of each parameter follows:
2683 % o wand: the magick wand.
2686 WandExport MagickBooleanType MagickEnhanceImage(MagickWand *wand)
2691 assert(wand != (MagickWand *) NULL);
2692 assert(wand->signature == WandSignature);
2693 if (wand->debug != MagickFalse)
2694 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2695 if (wand->images == (Image *) NULL)
2696 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2697 enhance_image=EnhanceImage(wand->images,wand->exception);
2698 if (enhance_image == (Image *) NULL)
2699 return(MagickFalse);
2700 ReplaceImageInList(&wand->images,enhance_image);
2705 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2709 % M a g i c k E q u a l i z e I m a g e %
2713 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2715 % MagickEqualizeImage() equalizes the image histogram.
2717 % The format of the MagickEqualizeImage method is:
2719 % MagickBooleanType MagickEqualizeImage(MagickWand *wand)
2721 % A description of each parameter follows:
2723 % o wand: the magick wand.
2725 % o channel: the image channel(s).
2728 WandExport MagickBooleanType MagickEqualizeImage(MagickWand *wand)
2733 assert(wand != (MagickWand *) NULL);
2734 assert(wand->signature == WandSignature);
2735 if (wand->debug != MagickFalse)
2736 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2737 if (wand->images == (Image *) NULL)
2738 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2739 status=EqualizeImage(wand->images,wand->exception);
2744 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2748 % M a g i c k E v a l u a t e I m a g e %
2752 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2754 % MagickEvaluateImage() applys an arithmetic, relational, or logical
2755 % expression to an image. Use these operators to lighten or darken an image,
2756 % to increase or decrease contrast in an image, or to produce the "negative"
2759 % The format of the MagickEvaluateImage method is:
2761 % MagickBooleanType MagickEvaluateImage(MagickWand *wand,
2762 % const MagickEvaluateOperator operator,const double value)
2763 % MagickBooleanType MagickEvaluateImages(MagickWand *wand,
2764 % const MagickEvaluateOperator operator)
2766 % A description of each parameter follows:
2768 % o wand: the magick wand.
2770 % o op: A channel operator.
2772 % o value: A value value.
2776 WandExport MagickWand *MagickEvaluateImages(MagickWand *wand,
2777 const MagickEvaluateOperator op)
2782 assert(wand != (MagickWand *) NULL);
2783 assert(wand->signature == WandSignature);
2784 if (wand->debug != MagickFalse)
2785 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2786 if (wand->images == (Image *) NULL)
2787 return((MagickWand *) NULL);
2788 evaluate_image=EvaluateImages(wand->images,op,wand->exception);
2789 if (evaluate_image == (Image *) NULL)
2790 return((MagickWand *) NULL);
2791 return(CloneMagickWandFromImages(wand,evaluate_image));
2794 WandExport MagickBooleanType MagickEvaluateImage(MagickWand *wand,
2795 const MagickEvaluateOperator op,const double value)
2800 assert(wand != (MagickWand *) NULL);
2801 assert(wand->signature == WandSignature);
2802 if (wand->debug != MagickFalse)
2803 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2804 if (wand->images == (Image *) NULL)
2805 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2806 status=EvaluateImage(wand->images,op,value,wand->exception);
2811 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2815 % M a g i c k E x p o r t I m a g e P i x e l s %
2819 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2821 % MagickExportImagePixels() extracts pixel data from an image and returns it
2822 % to you. The method returns MagickTrue on success otherwise MagickFalse if
2823 % an error is encountered. The data is returned as char, short int, int,
2824 % ssize_t, float, or double in the order specified by map.
2826 % Suppose you want to extract the first scanline of a 640x480 image as
2827 % character data in red-green-blue order:
2829 % MagickExportImagePixels(wand,0,0,640,1,"RGB",CharPixel,pixels);
2831 % The format of the MagickExportImagePixels method is:
2833 % MagickBooleanType MagickExportImagePixels(MagickWand *wand,
2834 % const ssize_t x,const ssize_t y,const size_t columns,
2835 % const size_t rows,const char *map,const StorageType storage,
2838 % A description of each parameter follows:
2840 % o wand: the magick wand.
2842 % o x, y, columns, rows: These values define the perimeter
2843 % of a region of pixels you want to extract.
2845 % o map: This string reflects the expected ordering of the pixel array.
2846 % It can be any combination or order of R = red, G = green, B = blue,
2847 % A = alpha (0 is transparent), O = alpha (0 is opaque), C = cyan,
2848 % Y = yellow, M = magenta, K = black, I = intensity (for grayscale),
2851 % o storage: Define the data type of the pixels. Float and double types are
2852 % expected to be normalized [0..1] otherwise [0..QuantumRange]. Choose from
2853 % these types: CharPixel, DoublePixel, FloatPixel, IntegerPixel,
2854 % LongPixel, QuantumPixel, or ShortPixel.
2856 % o pixels: This array of values contain the pixel components as defined by
2857 % map and type. You must preallocate this array where the expected
2858 % length varies depending on the values of width, height, map, and type.
2861 WandExport MagickBooleanType MagickExportImagePixels(MagickWand *wand,
2862 const ssize_t x,const ssize_t y,const size_t columns,
2863 const size_t rows,const char *map,const StorageType storage,
2869 assert(wand != (MagickWand *) NULL);
2870 assert(wand->signature == WandSignature);
2871 if (wand->debug != MagickFalse)
2872 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2873 if (wand->images == (Image *) NULL)
2874 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2875 status=ExportImagePixels(wand->images,x,y,columns,rows,map,
2876 storage,pixels,wand->exception);
2881 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2885 % M a g i c k E x t e n t I m a g e %
2889 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2891 % MagickExtentImage() extends the image as defined by the geometry, gravity,
2892 % and wand background color. Set the (x,y) offset of the geometry to move
2893 % the original wand relative to the extended wand.
2895 % The format of the MagickExtentImage method is:
2897 % MagickBooleanType MagickExtentImage(MagickWand *wand,const size_t width,
2898 % const size_t height,const ssize_t x,const ssize_t y)
2900 % A description of each parameter follows:
2902 % o wand: the magick wand.
2904 % o width: the region width.
2906 % o height: the region height.
2908 % o x: the region x offset.
2910 % o y: the region y offset.
2913 WandExport MagickBooleanType MagickExtentImage(MagickWand *wand,
2914 const size_t width,const size_t height,const ssize_t x,const ssize_t y)
2922 assert(wand != (MagickWand *) NULL);
2923 assert(wand->signature == WandSignature);
2924 if (wand->debug != MagickFalse)
2925 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2926 if (wand->images == (Image *) NULL)
2927 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2929 extent.height=height;
2932 extent_image=ExtentImage(wand->images,&extent,wand->exception);
2933 if (extent_image == (Image *) NULL)
2934 return(MagickFalse);
2935 ReplaceImageInList(&wand->images,extent_image);
2940 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2944 % M a g i c k F l i p I m a g e %
2948 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2950 % MagickFlipImage() creates a vertical mirror image by reflecting the pixels
2951 % around the central x-axis.
2953 % The format of the MagickFlipImage method is:
2955 % MagickBooleanType MagickFlipImage(MagickWand *wand)
2957 % A description of each parameter follows:
2959 % o wand: the magick wand.
2962 WandExport MagickBooleanType MagickFlipImage(MagickWand *wand)
2967 assert(wand != (MagickWand *) NULL);
2968 assert(wand->signature == WandSignature);
2969 if (wand->debug != MagickFalse)
2970 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2971 if (wand->images == (Image *) NULL)
2972 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2973 flip_image=FlipImage(wand->images,wand->exception);
2974 if (flip_image == (Image *) NULL)
2975 return(MagickFalse);
2976 ReplaceImageInList(&wand->images,flip_image);
2981 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2985 % M a g i c k F l o o d f i l l P a i n t I m a g e %
2989 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2991 % MagickFloodfillPaintImage() changes the color value of any pixel that matches
2992 % target and is an immediate neighbor. If the method FillToBorderMethod is
2993 % specified, the color value is changed for any neighbor pixel that does not
2994 % match the bordercolor member of image.
2996 % The format of the MagickFloodfillPaintImage method is:
2998 % MagickBooleanType MagickFloodfillPaintImage(MagickWand *wand,
2999 % const PixelWand *fill,const double fuzz,const PixelWand *bordercolor,
3000 % const ssize_t x,const ssize_t y,const MagickBooleanType invert)
3002 % A description of each parameter follows:
3004 % o wand: the magick wand.
3006 % o fill: the floodfill color pixel wand.
3008 % o fuzz: By default target must match a particular pixel color
3009 % exactly. However, in many cases two colors may differ by a small amount.
3010 % The fuzz member of image defines how much tolerance is acceptable to
3011 % consider two colors as the same. For example, set fuzz to 10 and the
3012 % color red at intensities of 100 and 102 respectively are now interpreted
3013 % as the same color for the purposes of the floodfill.
3015 % o bordercolor: the border color pixel wand.
3017 % o x,y: the starting location of the operation.
3019 % o invert: paint any pixel that does not match the target color.
3022 WandExport MagickBooleanType MagickFloodfillPaintImage(MagickWand *wand,
3023 const PixelWand *fill,const double fuzz,const PixelWand *bordercolor,
3024 const ssize_t x,const ssize_t y,const MagickBooleanType invert)
3035 assert(wand != (MagickWand *) NULL);
3036 assert(wand->signature == WandSignature);
3037 if (wand->debug != MagickFalse)
3038 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3039 if (wand->images == (Image *) NULL)
3040 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3041 draw_info=CloneDrawInfo(wand->image_info,(DrawInfo *) NULL);
3042 PixelGetQuantumPacket(fill,&draw_info->fill);
3043 (void) GetOneVirtualPixelInfo(wand->images,TileVirtualPixelMethod,x %
3044 wand->images->columns,y % wand->images->rows,&target,wand->exception);
3045 if (bordercolor != (PixelWand *) NULL)
3046 PixelGetMagickColor(bordercolor,&target);
3047 wand->images->fuzz=fuzz;
3048 status=FloodfillPaintImage(wand->images,draw_info,&target,x,y,invert,
3050 draw_info=DestroyDrawInfo(draw_info);
3055 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3059 % M a g i c k F l o p I m a g e %
3063 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3065 % MagickFlopImage() creates a horizontal mirror image by reflecting the pixels
3066 % around the central y-axis.
3068 % The format of the MagickFlopImage method is:
3070 % MagickBooleanType MagickFlopImage(MagickWand *wand)
3072 % A description of each parameter follows:
3074 % o wand: the magick wand.
3077 WandExport MagickBooleanType MagickFlopImage(MagickWand *wand)
3082 assert(wand != (MagickWand *) NULL);
3083 assert(wand->signature == WandSignature);
3084 if (wand->debug != MagickFalse)
3085 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3086 if (wand->images == (Image *) NULL)
3087 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3088 flop_image=FlopImage(wand->images,wand->exception);
3089 if (flop_image == (Image *) NULL)
3090 return(MagickFalse);
3091 ReplaceImageInList(&wand->images,flop_image);
3096 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3100 % M a g i c k F o u r i e r T r a n s f o r m I m a g e %
3104 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3106 % MagickForwardFourierTransformImage() implements the discrete Fourier
3107 % transform (DFT) of the image either as a magnitude / phase or real /
3108 % imaginary image pair.
3110 % The format of the MagickForwardFourierTransformImage method is:
3112 % MagickBooleanType MagickForwardFourierTransformImage(MagickWand *wand,
3113 % const MagickBooleanType magnitude)
3115 % A description of each parameter follows:
3117 % o wand: the magick wand.
3119 % o magnitude: if true, return as magnitude / phase pair otherwise a real /
3120 % imaginary image pair.
3123 WandExport MagickBooleanType MagickForwardFourierTransformImage(
3124 MagickWand *wand,const MagickBooleanType magnitude)
3129 assert(wand != (MagickWand *) NULL);
3130 assert(wand->signature == WandSignature);
3131 if (wand->debug != MagickFalse)
3132 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3133 if (wand->images == (Image *) NULL)
3134 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3135 forward_image=ForwardFourierTransformImage(wand->images,magnitude,
3137 if (forward_image == (Image *) NULL)
3138 return(MagickFalse);
3139 ReplaceImageInList(&wand->images,forward_image);
3144 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3148 % M a g i c k F r a m e I m a g e %
3152 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3154 % MagickFrameImage() adds a simulated three-dimensional border around the
3155 % image. The width and height specify the border width of the vertical and
3156 % horizontal sides of the frame. The inner and outer bevels indicate the
3157 % width of the inner and outer shadows of the frame.
3159 % The format of the MagickFrameImage method is:
3161 % MagickBooleanType MagickFrameImage(MagickWand *wand,
3162 % const PixelWand *matte_color,const size_t width,
3163 % const size_t height,const ssize_t inner_bevel,
3164 % const ssize_t outer_bevel,const CompositeOperator compose)
3166 % A description of each parameter follows:
3168 % o wand: the magick wand.
3170 % o matte_color: the frame color pixel wand.
3172 % o width: the border width.
3174 % o height: the border height.
3176 % o inner_bevel: the inner bevel width.
3178 % o outer_bevel: the outer bevel width.
3180 % o compose: the composite operator.
3183 WandExport MagickBooleanType MagickFrameImage(MagickWand *wand,
3184 const PixelWand *matte_color,const size_t width,const size_t height,
3185 const ssize_t inner_bevel,const ssize_t outer_bevel,
3186 const CompositeOperator compose)
3194 assert(wand != (MagickWand *) NULL);
3195 assert(wand->signature == WandSignature);
3196 if (wand->debug != MagickFalse)
3197 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3198 if (wand->images == (Image *) NULL)
3199 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3200 (void) ResetMagickMemory(&frame_info,0,sizeof(frame_info));
3201 frame_info.width=wand->images->columns+2*width;
3202 frame_info.height=wand->images->rows+2*height;
3203 frame_info.x=(ssize_t) width;
3204 frame_info.y=(ssize_t) height;
3205 frame_info.inner_bevel=inner_bevel;
3206 frame_info.outer_bevel=outer_bevel;
3207 PixelGetQuantumPacket(matte_color,&wand->images->matte_color);
3208 frame_image=FrameImage(wand->images,&frame_info,compose,wand->exception);
3209 if (frame_image == (Image *) NULL)
3210 return(MagickFalse);
3211 ReplaceImageInList(&wand->images,frame_image);
3216 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3220 % M a g i c k F u n c t i o n I m a g e %
3224 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3226 % MagickFunctionImage() applys an arithmetic, relational, or logical
3227 % expression to an image. Use these operators to lighten or darken an image,
3228 % to increase or decrease contrast in an image, or to produce the "negative"
3231 % The format of the MagickFunctionImage method is:
3233 % MagickBooleanType MagickFunctionImage(MagickWand *wand,
3234 % const MagickFunction function,const size_t number_arguments,
3235 % const double *arguments)
3237 % A description of each parameter follows:
3239 % o wand: the magick wand.
3241 % o function: the image function.
3243 % o number_arguments: the number of function arguments.
3245 % o arguments: the function arguments.
3248 WandExport MagickBooleanType MagickFunctionImage(MagickWand *wand,
3249 const MagickFunction function,const size_t number_arguments,
3250 const double *arguments)
3255 assert(wand != (MagickWand *) NULL);
3256 assert(wand->signature == WandSignature);
3257 if (wand->debug != MagickFalse)
3258 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3259 if (wand->images == (Image *) NULL)
3260 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3261 status=FunctionImage(wand->images,function,number_arguments,arguments,
3267 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3271 % M a g i c k F x I m a g e %
3275 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3277 % MagickFxImage() evaluate expression for each pixel in the image.
3279 % The format of the MagickFxImage method is:
3281 % MagickWand *MagickFxImage(MagickWand *wand,const char *expression)
3283 % A description of each parameter follows:
3285 % o wand: the magick wand.
3287 % o expression: the expression.
3290 WandExport MagickWand *MagickFxImage(MagickWand *wand,const char *expression)
3295 assert(wand != (MagickWand *) NULL);
3296 assert(wand->signature == WandSignature);
3297 if (wand->debug != MagickFalse)
3298 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3299 if (wand->images == (Image *) NULL)
3300 return((MagickWand *) NULL);
3301 fx_image=FxImage(wand->images,expression,wand->exception);
3302 if (fx_image == (Image *) NULL)
3303 return((MagickWand *) NULL);
3304 return(CloneMagickWandFromImages(wand,fx_image));
3308 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3312 % M a g i c k G a m m a I m a g e %
3316 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3318 % MagickGammaImage() gamma-corrects an image. The same image viewed on
3319 % different devices will have perceptual differences in the way the image's
3320 % intensities are represented on the screen. Specify individual gamma levels
3321 % for the red, green, and blue channels, or adjust all three with the gamma
3322 % parameter. Values typically range from 0.8 to 2.3.
3324 % You can also reduce the influence of a particular channel with a gamma
3327 % The format of the MagickGammaImage method is:
3329 % MagickBooleanType MagickGammaImage(MagickWand *wand,const double gamma)
3331 % A description of each parameter follows:
3333 % o wand: the magick wand.
3335 % o level: Define the level of gamma correction.
3338 WandExport MagickBooleanType MagickGammaImage(MagickWand *wand,
3344 assert(wand != (MagickWand *) NULL);
3345 assert(wand->signature == WandSignature);
3346 if (wand->debug != MagickFalse)
3347 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3348 if (wand->images == (Image *) NULL)
3349 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3350 status=GammaImage(wand->images,gamma,wand->exception);
3355 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3359 % M a g i c k G a u s s i a n B l u r I m a g e %
3363 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3365 % MagickGaussianBlurImage() blurs an image. We convolve the image with a
3366 % Gaussian operator of the given radius and standard deviation (sigma).
3367 % For reasonable results, the radius should be larger than sigma. Use a
3368 % radius of 0 and MagickGaussianBlurImage() selects a suitable radius for you.
3370 % The format of the MagickGaussianBlurImage method is:
3372 % MagickBooleanType MagickGaussianBlurImage(MagickWand *wand,
3373 % const double radius,const double sigma)
3375 % A description of each parameter follows:
3377 % o wand: the magick wand.
3379 % o radius: the radius of the Gaussian, in pixels, not counting the center
3382 % o sigma: the standard deviation of the Gaussian, in pixels.
3385 WandExport MagickBooleanType MagickGaussianBlurImage(MagickWand *wand,
3386 const double radius,const double sigma)
3391 assert(wand != (MagickWand *) NULL);
3392 assert(wand->signature == WandSignature);
3393 if (wand->debug != MagickFalse)
3394 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3395 if (wand->images == (Image *) NULL)
3396 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3397 blur_image=GaussianBlurImage(wand->images,radius,sigma,wand->exception);
3398 if (blur_image == (Image *) NULL)
3399 return(MagickFalse);
3400 ReplaceImageInList(&wand->images,blur_image);
3405 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3409 % M a g i c k G e t I m a g e %
3413 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3415 % MagickGetImage() gets the image at the current image index.
3417 % The format of the MagickGetImage method is:
3419 % MagickWand *MagickGetImage(MagickWand *wand)
3421 % A description of each parameter follows:
3423 % o wand: the magick wand.
3426 WandExport MagickWand *MagickGetImage(MagickWand *wand)
3431 assert(wand != (MagickWand *) NULL);
3432 assert(wand->signature == WandSignature);
3433 if (wand->debug != MagickFalse)
3434 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3435 if (wand->images == (Image *) NULL)
3437 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3438 "ContainsNoImages","`%s'",wand->name);
3439 return((MagickWand *) NULL);
3441 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
3442 if (image == (Image *) NULL)
3443 return((MagickWand *) NULL);
3444 return(CloneMagickWandFromImages(wand,image));
3448 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3452 % M a g i c k G e t I m a g e A l p h a C h a n n e l %
3456 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3458 % MagickGetImageAlphaChannel() returns MagickFalse if the image alpha channel
3459 % is not activated. That is, the image is RGB rather than RGBA or CMYK rather
3462 % The format of the MagickGetImageAlphaChannel method is:
3464 % size_t MagickGetImageAlphaChannel(MagickWand *wand)
3466 % A description of each parameter follows:
3468 % o wand: the magick wand.
3471 WandExport MagickBooleanType MagickGetImageAlphaChannel(MagickWand *wand)
3473 assert(wand != (MagickWand *) NULL);
3474 assert(wand->signature == WandSignature);
3475 if (wand->debug != MagickFalse)
3476 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3477 if (wand->images == (Image *) NULL)
3478 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3479 return(GetImageAlphaChannel(wand->images));
3483 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3487 % M a g i c k G e t I m a g e C l i p M a s k %
3491 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3493 % MagickGetImageMask() gets the image clip mask at the current image index.
3495 % The format of the MagickGetImageMask method is:
3497 % MagickWand *MagickGetImageMask(MagickWand *wand)
3499 % A description of each parameter follows:
3501 % o wand: the magick wand.
3504 WandExport MagickWand *MagickGetImageMask(MagickWand *wand)
3509 assert(wand != (MagickWand *) NULL);
3510 assert(wand->signature == WandSignature);
3511 if (wand->debug != MagickFalse)
3512 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3513 if (wand->images == (Image *) NULL)
3515 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3516 "ContainsNoImages","`%s'",wand->name);
3517 return((MagickWand *) NULL);
3519 image=GetImageMask(wand->images,wand->exception);
3520 if (image == (Image *) NULL)
3521 return((MagickWand *) NULL);
3522 return(CloneMagickWandFromImages(wand,image));
3526 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3530 % M a g i c k G e t I m a g e B a c k g r o u n d C o l o r %
3534 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3536 % MagickGetImageBackgroundColor() returns the image background color.
3538 % The format of the MagickGetImageBackgroundColor method is:
3540 % MagickBooleanType MagickGetImageBackgroundColor(MagickWand *wand,
3541 % PixelWand *background_color)
3543 % A description of each parameter follows:
3545 % o wand: the magick wand.
3547 % o background_color: Return the background color.
3550 WandExport MagickBooleanType MagickGetImageBackgroundColor(MagickWand *wand,
3551 PixelWand *background_color)
3553 assert(wand != (MagickWand *) NULL);
3554 assert(wand->signature == WandSignature);
3555 if (wand->debug != MagickFalse)
3556 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3557 if (wand->images == (Image *) NULL)
3558 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3559 PixelSetPixelColor(background_color,&wand->images->background_color);
3564 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3568 % M a g i c k G e t I m a g e B l o b %
3572 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3574 % MagickGetImageBlob() implements direct to memory image formats. It returns
3575 % the image as a blob (a formatted "file" in memory) and its length, starting
3576 % from the current position in the image sequence. Use MagickSetImageFormat()
3577 % to set the format to write to the blob (GIF, JPEG, PNG, etc.).
3579 % Utilize MagickResetIterator() to ensure the write is from the beginning of
3580 % the image sequence.
3582 % Use MagickRelinquishMemory() to free the blob when you are done with it.
3584 % The format of the MagickGetImageBlob method is:
3586 % unsigned char *MagickGetImageBlob(MagickWand *wand,size_t *length)
3588 % A description of each parameter follows:
3590 % o wand: the magick wand.
3592 % o length: the length of the blob.
3595 WandExport unsigned char *MagickGetImageBlob(MagickWand *wand,size_t *length)
3597 assert(wand != (MagickWand *) NULL);
3598 assert(wand->signature == WandSignature);
3599 if (wand->debug != MagickFalse)
3600 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3601 if (wand->images == (Image *) NULL)
3603 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3604 "ContainsNoImages","`%s'",wand->name);
3605 return((unsigned char *) NULL);
3607 return(ImageToBlob(wand->image_info,wand->images,length,wand->exception));
3611 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3615 % M a g i c k G e t I m a g e s B l o b %
3619 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3621 % MagickGetImageBlob() implements direct to memory image formats. It
3622 % returns the image sequence as a blob and its length. The format of the image
3623 % determines the format of the returned blob (GIF, JPEG, PNG, etc.). To
3624 % return a different image format, use MagickSetImageFormat().
3626 % Note, some image formats do not permit multiple images to the same image
3627 % stream (e.g. JPEG). in this instance, just the first image of the
3628 % sequence is returned as a blob.
3630 % The format of the MagickGetImagesBlob method is:
3632 % unsigned char *MagickGetImagesBlob(MagickWand *wand,size_t *length)
3634 % A description of each parameter follows:
3636 % o wand: the magick wand.
3638 % o length: the length of the blob.
3641 WandExport unsigned char *MagickGetImagesBlob(MagickWand *wand,size_t *length)
3646 assert(wand != (MagickWand *) NULL);
3647 assert(wand->signature == WandSignature);
3648 if (wand->debug != MagickFalse)
3649 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3650 if (wand->images == (Image *) NULL)
3652 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3653 "ContainsNoImages","`%s'",wand->name);
3654 return((unsigned char *) NULL);
3656 blob=ImagesToBlob(wand->image_info,GetFirstImageInList(wand->images),length,
3662 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3666 % M a g i c k G e t I m a g e B l u e P r i m a r y %
3670 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3672 % MagickGetImageBluePrimary() returns the chromaticy blue primary point for the
3675 % The format of the MagickGetImageBluePrimary method is:
3677 % MagickBooleanType MagickGetImageBluePrimary(MagickWand *wand,double *x,
3680 % A description of each parameter follows:
3682 % o wand: the magick wand.
3684 % o x: the chromaticity blue primary x-point.
3686 % o y: the chromaticity blue primary y-point.
3689 WandExport MagickBooleanType MagickGetImageBluePrimary(MagickWand *wand,
3690 double *x,double *y)
3692 assert(wand != (MagickWand *) NULL);
3693 assert(wand->signature == WandSignature);
3694 if (wand->debug != MagickFalse)
3695 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3696 if (wand->images == (Image *) NULL)
3697 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3698 *x=wand->images->chromaticity.blue_primary.x;
3699 *y=wand->images->chromaticity.blue_primary.y;
3704 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3708 % M a g i c k G e t I m a g e B o r d e r C o l o r %
3712 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3714 % MagickGetImageBorderColor() returns the image border color.
3716 % The format of the MagickGetImageBorderColor method is:
3718 % MagickBooleanType MagickGetImageBorderColor(MagickWand *wand,
3719 % PixelWand *border_color)
3721 % A description of each parameter follows:
3723 % o wand: the magick wand.
3725 % o border_color: Return the border color.
3728 WandExport MagickBooleanType MagickGetImageBorderColor(MagickWand *wand,
3729 PixelWand *border_color)
3731 assert(wand != (MagickWand *) NULL);
3732 assert(wand->signature == WandSignature);
3733 if (wand->debug != MagickFalse)
3734 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3735 if (wand->images == (Image *) NULL)
3736 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3737 PixelSetPixelColor(border_color,&wand->images->border_color);
3742 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3746 % M a g i c k G e t I m a g e F e a t u r e s %
3750 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3752 % MagickGetImageFeatures() returns features for each channel in the
3753 % image in each of four directions (horizontal, vertical, left and right
3754 % diagonals) for the specified distance. The features include the angular
3755 % second moment, contrast, correlation, sum of squares: variance, inverse
3756 % difference moment, sum average, sum varience, sum entropy, entropy,
3757 % difference variance, difference entropy, information measures of
3758 % correlation 1, information measures of correlation 2, and maximum
3759 % correlation coefficient. You can access the red channel contrast, for
3760 % example, like this:
3762 % channel_features=MagickGetImageFeatures(wand,1);
3763 % contrast=channel_features[RedPixelChannel].contrast[0];
3765 % Use MagickRelinquishMemory() to free the statistics buffer.
3767 % The format of the MagickGetImageFeatures method is:
3769 % ChannelFeatures *MagickGetImageFeatures(MagickWand *wand,
3770 % const size_t distance)
3772 % A description of each parameter follows:
3774 % o wand: the magick wand.
3776 % o distance: the distance.
3779 WandExport ChannelFeatures *MagickGetImageFeatures(MagickWand *wand,
3780 const size_t distance)
3782 assert(wand != (MagickWand *) NULL);
3783 assert(wand->signature == WandSignature);
3784 if (wand->debug != MagickFalse)
3785 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3786 if (wand->images == (Image *) NULL)
3788 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3789 "ContainsNoImages","`%s'",wand->name);
3790 return((ChannelFeatures *) NULL);
3792 return(GetImageFeatures(wand->images,distance,wand->exception));
3796 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3800 % M a g i c k G e t I m a g e K u r t o s i s %
3804 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3806 % MagickGetImageKurtosis() gets the kurtosis and skewness of one or
3807 % more image channels.
3809 % The format of the MagickGetImageKurtosis method is:
3811 % MagickBooleanType MagickGetImageKurtosis(MagickWand *wand,
3812 % double *kurtosis,double *skewness)
3814 % A description of each parameter follows:
3816 % o wand: the magick wand.
3818 % o kurtosis: The kurtosis for the specified channel(s).
3820 % o skewness: The skewness for the specified channel(s).
3823 WandExport MagickBooleanType MagickGetImageKurtosis(MagickWand *wand,
3824 double *kurtosis,double *skewness)
3829 assert(wand != (MagickWand *) NULL);
3830 assert(wand->signature == WandSignature);
3831 if (wand->debug != MagickFalse)
3832 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3833 if (wand->images == (Image *) NULL)
3834 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3835 status=GetImageKurtosis(wand->images,kurtosis,skewness,wand->exception);
3840 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3844 % M a g i c k G e t I m a g e M e a n %
3848 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3850 % MagickGetImageMean() gets the mean and standard deviation of one or more
3853 % The format of the MagickGetImageMean method is:
3855 % MagickBooleanType MagickGetImageMean(MagickWand *wand,double *mean,
3856 % double *standard_deviation)
3858 % A description of each parameter follows:
3860 % o wand: the magick wand.
3862 % o channel: the image channel(s).
3864 % o mean: The mean pixel value for the specified channel(s).
3866 % o standard_deviation: The standard deviation for the specified channel(s).
3869 WandExport MagickBooleanType MagickGetImageMean(MagickWand *wand,double *mean,
3870 double *standard_deviation)
3875 assert(wand != (MagickWand *) NULL);
3876 assert(wand->signature == WandSignature);
3877 if (wand->debug != MagickFalse)
3878 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3879 if (wand->images == (Image *) NULL)
3880 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3881 status=GetImageMean(wand->images,mean,standard_deviation,wand->exception);
3886 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3890 % M a g i c k G e t I m a g e R a n g e %
3894 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3896 % MagickGetImageRange() gets the range for one or more image channels.
3898 % The format of the MagickGetImageRange method is:
3900 % MagickBooleanType MagickGetImageRange(MagickWand *wand,double *minima,
3903 % A description of each parameter follows:
3905 % o wand: the magick wand.
3907 % o minima: The minimum pixel value for the specified channel(s).
3909 % o maxima: The maximum pixel value for the specified channel(s).
3912 WandExport MagickBooleanType MagickGetImageRange(MagickWand *wand,
3913 double *minima,double *maxima)
3918 assert(wand != (MagickWand *) NULL);
3919 assert(wand->signature == WandSignature);
3920 if (wand->debug != MagickFalse)
3921 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3922 if (wand->images == (Image *) NULL)
3923 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3924 status=GetImageRange(wand->images,minima,maxima,wand->exception);
3929 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3933 % M a g i c k G e t I m a g e S t a t i s t i c s %
3937 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3939 % MagickGetImageStatistics() returns statistics for each channel in the
3940 % image. The statistics include the channel depth, its minima and
3941 % maxima, the mean, the standard deviation, the kurtosis and the skewness.
3942 % You can access the red channel mean, for example, like this:
3944 % channel_statistics=MagickGetImageStatistics(wand);
3945 % red_mean=channel_statistics[RedPixelChannel].mean;
3947 % Use MagickRelinquishMemory() to free the statistics buffer.
3949 % The format of the MagickGetImageStatistics method is:
3951 % ChannelStatistics *MagickGetImageStatistics(MagickWand *wand)
3953 % A description of each parameter follows:
3955 % o wand: the magick wand.
3958 WandExport ChannelStatistics *MagickGetImageStatistics(MagickWand *wand)
3960 assert(wand != (MagickWand *) NULL);
3961 assert(wand->signature == WandSignature);
3962 if (wand->debug != MagickFalse)
3963 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3964 if (wand->images == (Image *) NULL)
3966 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3967 "ContainsNoImages","`%s'",wand->name);
3968 return((ChannelStatistics *) NULL);
3970 return(GetImageStatistics(wand->images,wand->exception));
3974 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3978 % M a g i c k G e t I m a g e C o l o r m a p C o l o r %
3982 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3984 % MagickGetImageColormapColor() returns the color of the specified colormap
3987 % The format of the MagickGetImageColormapColor method is:
3989 % MagickBooleanType MagickGetImageColormapColor(MagickWand *wand,
3990 % const size_t index,PixelWand *color)
3992 % A description of each parameter follows:
3994 % o wand: the magick wand.
3996 % o index: the offset into the image colormap.
3998 % o color: Return the colormap color in this wand.
4001 WandExport MagickBooleanType MagickGetImageColormapColor(MagickWand *wand,
4002 const size_t index,PixelWand *color)
4004 assert(wand != (MagickWand *) NULL);
4005 assert(wand->signature == WandSignature);
4006 if (wand->debug != MagickFalse)
4007 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4008 if (wand->images == (Image *) NULL)
4009 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4010 if ((wand->images->colormap == (PixelInfo *) NULL) ||
4011 (index >= wand->images->colors))
4013 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4014 "InvalidColormapIndex","`%s'",wand->name);
4015 return(MagickFalse);
4017 PixelSetPixelColor(color,wand->images->colormap+index);
4022 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4026 % M a g i c k G e t I m a g e C o l o r s %
4030 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4032 % MagickGetImageColors() gets the number of unique colors in the image.
4034 % The format of the MagickGetImageColors method is:
4036 % size_t MagickGetImageColors(MagickWand *wand)
4038 % A description of each parameter follows:
4040 % o wand: the magick wand.
4043 WandExport size_t MagickGetImageColors(MagickWand *wand)
4045 assert(wand != (MagickWand *) NULL);
4046 assert(wand->signature == WandSignature);
4047 if (wand->debug != MagickFalse)
4048 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4049 if (wand->images == (Image *) NULL)
4051 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4052 "ContainsNoImages","`%s'",wand->name);
4055 return(GetNumberColors(wand->images,(FILE *) NULL,wand->exception));
4059 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4063 % M a g i c k G e t I m a g e C o l o r s p a c e %
4067 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4069 % MagickGetImageColorspace() gets the image colorspace.
4071 % The format of the MagickGetImageColorspace method is:
4073 % ColorspaceType MagickGetImageColorspace(MagickWand *wand)
4075 % A description of each parameter follows:
4077 % o wand: the magick wand.
4080 WandExport ColorspaceType MagickGetImageColorspace(MagickWand *wand)
4082 assert(wand != (MagickWand *) NULL);
4083 assert(wand->signature == WandSignature);
4084 if (wand->debug != MagickFalse)
4085 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4086 if (wand->images == (Image *) NULL)
4088 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4089 "ContainsNoImages","`%s'",wand->name);
4090 return(UndefinedColorspace);
4092 return(wand->images->colorspace);
4096 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4100 % M a g i c k G e t I m a g e C o m p o s e %
4104 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4106 % MagickGetImageCompose() returns the composite operator associated with the
4109 % The format of the MagickGetImageCompose method is:
4111 % CompositeOperator MagickGetImageCompose(MagickWand *wand)
4113 % A description of each parameter follows:
4115 % o wand: the magick wand.
4118 WandExport CompositeOperator MagickGetImageCompose(MagickWand *wand)
4120 assert(wand != (MagickWand *) NULL);
4121 assert(wand->signature == WandSignature);
4122 if (wand->debug != MagickFalse)
4123 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4124 if (wand->images == (Image *) NULL)
4126 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4127 "ContainsNoImages","`%s'",wand->name);
4128 return(UndefinedCompositeOp);
4130 return(wand->images->compose);
4134 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4138 % M a g i c k G e t I m a g e C o m p r e s s i o n %
4142 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4144 % MagickGetImageCompression() gets the image compression.
4146 % The format of the MagickGetImageCompression method is:
4148 % CompressionType MagickGetImageCompression(MagickWand *wand)
4150 % A description of each parameter follows:
4152 % o wand: the magick wand.
4155 WandExport CompressionType MagickGetImageCompression(MagickWand *wand)
4157 assert(wand != (MagickWand *) NULL);
4158 assert(wand->signature == WandSignature);
4159 if (wand->debug != MagickFalse)
4160 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4161 if (wand->images == (Image *) NULL)
4163 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4164 "ContainsNoImages","`%s'",wand->name);
4165 return(UndefinedCompression);
4167 return(wand->images->compression);
4171 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4175 % M a g i c k G e t I m a g e C o m p r e s s i o n Q u a l i t y %
4179 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4181 % MagickGetImageCompression() gets the image compression quality.
4183 % The format of the MagickGetImageCompression method is:
4185 % size_t MagickGetImageCompression(MagickWand *wand)
4187 % A description of each parameter follows:
4189 % o wand: the magick wand.
4192 WandExport size_t MagickGetImageCompressionQuality(MagickWand *wand)
4194 assert(wand != (MagickWand *) NULL);
4195 assert(wand->signature == WandSignature);
4196 if (wand->debug != MagickFalse)
4197 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4198 if (wand->images == (Image *) NULL)
4200 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4201 "ContainsNoImages","`%s'",wand->name);
4204 return(wand->images->quality);
4208 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4212 % M a g i c k G e t I m a g e D e l a y %
4216 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4218 % MagickGetImageDelay() gets the image delay.
4220 % The format of the MagickGetImageDelay method is:
4222 % size_t MagickGetImageDelay(MagickWand *wand)
4224 % A description of each parameter follows:
4226 % o wand: the magick wand.
4229 WandExport size_t MagickGetImageDelay(MagickWand *wand)
4231 assert(wand != (MagickWand *) NULL);
4232 assert(wand->signature == WandSignature);
4233 if (wand->debug != MagickFalse)
4234 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4235 if (wand->images == (Image *) NULL)
4236 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4237 return(wand->images->delay);
4241 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4245 % M a g i c k G e t I m a g e D e p t h %
4249 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4251 % MagickGetImageDepth() gets the image depth.
4253 % The format of the MagickGetImageDepth method is:
4255 % size_t MagickGetImageDepth(MagickWand *wand)
4257 % A description of each parameter follows:
4259 % o wand: the magick wand.
4262 WandExport size_t MagickGetImageDepth(MagickWand *wand)
4264 assert(wand != (MagickWand *) NULL);
4265 assert(wand->signature == WandSignature);
4266 if (wand->debug != MagickFalse)
4267 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4268 if (wand->images == (Image *) NULL)
4269 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4270 return(wand->images->depth);
4274 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4278 % M a g i c k G e t I m a g e D i s p o s e %
4282 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4284 % MagickGetImageDispose() gets the image disposal method.
4286 % The format of the MagickGetImageDispose method is:
4288 % DisposeType MagickGetImageDispose(MagickWand *wand)
4290 % A description of each parameter follows:
4292 % o wand: the magick wand.
4295 WandExport DisposeType MagickGetImageDispose(MagickWand *wand)
4297 assert(wand != (MagickWand *) NULL);
4298 assert(wand->signature == WandSignature);
4299 if (wand->debug != MagickFalse)
4300 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4301 if (wand->images == (Image *) NULL)
4303 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4304 "ContainsNoImages","`%s'",wand->name);
4305 return(UndefinedDispose);
4307 return((DisposeType) wand->images->dispose);
4311 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4315 % M a g i c k G e t I m a g e D i s t o r t i o n %
4319 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4321 % MagickGetImageDistortion() compares an image to a reconstructed image and
4322 % returns the specified distortion metric.
4324 % The format of the MagickGetImageDistortion method is:
4326 % MagickBooleanType MagickGetImageDistortion(MagickWand *wand,
4327 % const MagickWand *reference,const MetricType metric,
4328 % double *distortion)
4330 % A description of each parameter follows:
4332 % o wand: the magick wand.
4334 % o reference: the reference wand.
4336 % o metric: the metric.
4338 % o distortion: the computed distortion between the images.
4341 WandExport MagickBooleanType MagickGetImageDistortion(MagickWand *wand,
4342 const MagickWand *reference,const MetricType metric,double *distortion)
4347 assert(wand != (MagickWand *) NULL);
4348 assert(wand->signature == WandSignature);
4349 if (wand->debug != MagickFalse)
4350 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4351 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
4352 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4353 status=GetImageDistortion(wand->images,reference->images,metric,distortion,
4359 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4363 % M a g i c k G e t I m a g e D i s t o r t i o n s %
4367 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4369 % MagickGetImageDistortions() compares one or more pixel channels of an
4370 % image to a reconstructed image and returns the specified distortion metrics.
4372 % Use MagickRelinquishMemory() to free the metrics when you are done with them.
4374 % The format of the MagickGetImageDistortion method is:
4376 % double *MagickGetImageDistortion(MagickWand *wand,
4377 % const MagickWand *reference,const MetricType metric)
4379 % A description of each parameter follows:
4381 % o wand: the magick wand.
4383 % o reference: the reference wand.
4385 % o metric: the metric.
4388 WandExport double *MagickGetImageDistortions(MagickWand *wand,
4389 const MagickWand *reference,const MetricType metric)
4392 *channel_distortion;
4394 assert(wand != (MagickWand *) NULL);
4395 assert(wand->signature == WandSignature);
4396 if (wand->debug != MagickFalse)
4397 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4398 assert(reference != (MagickWand *) NULL);
4399 assert(reference->signature == WandSignature);
4400 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
4402 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4403 "ContainsNoImages","`%s'",wand->name);
4404 return((double *) NULL);
4406 channel_distortion=GetImageDistortions(wand->images,reference->images,
4407 metric,wand->exception);
4408 return(channel_distortion);
4412 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4416 % M a g i c k G e t I m a g e F i l e n a m e %
4420 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4422 % MagickGetImageFilename() returns the filename of a particular image in a
4425 % The format of the MagickGetImageFilename method is:
4427 % char *MagickGetImageFilename(MagickWand *wand)
4429 % A description of each parameter follows:
4431 % o wand: the magick wand.
4434 WandExport char *MagickGetImageFilename(MagickWand *wand)
4436 assert(wand != (MagickWand *) NULL);
4437 assert(wand->signature == WandSignature);
4438 if (wand->debug != MagickFalse)
4439 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4440 if (wand->images == (Image *) NULL)
4442 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4443 "ContainsNoImages","`%s'",wand->name);
4444 return((char *) NULL);
4446 return(AcquireString(wand->images->filename));
4450 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4454 % M a g i c k G e t I m a g e F o r m a t %
4458 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4460 % MagickGetImageFormat() returns the format of a particular image in a
4463 % The format of the MagickGetImageFormat method is:
4465 % const char *MagickGetImageFormat(MagickWand *wand)
4467 % A description of each parameter follows:
4469 % o wand: the magick wand.
4472 WandExport char *MagickGetImageFormat(MagickWand *wand)
4474 assert(wand != (MagickWand *) NULL);
4475 assert(wand->signature == WandSignature);
4476 if (wand->debug != MagickFalse)
4477 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4478 if (wand->images == (Image *) NULL)
4480 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4481 "ContainsNoImages","`%s'",wand->name);
4482 return((char *) NULL);
4484 return(AcquireString(wand->images->magick));
4488 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4492 % M a g i c k G e t I m a g e F u z z %
4496 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4498 % MagickGetImageFuzz() gets the image fuzz.
4500 % The format of the MagickGetImageFuzz method is:
4502 % double MagickGetImageFuzz(MagickWand *wand)
4504 % A description of each parameter follows:
4506 % o wand: the magick wand.
4509 WandExport double MagickGetImageFuzz(MagickWand *wand)
4511 assert(wand != (MagickWand *) NULL);
4512 assert(wand->signature == WandSignature);
4513 if (wand->debug != MagickFalse)
4514 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4515 if (wand->images == (Image *) NULL)
4517 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4518 "ContainsNoImages","`%s'",wand->name);
4521 return(wand->images->fuzz);
4525 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4529 % M a g i c k G e t I m a g e G a m m a %
4533 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4535 % MagickGetImageGamma() gets the image gamma.
4537 % The format of the MagickGetImageGamma method is:
4539 % double MagickGetImageGamma(MagickWand *wand)
4541 % A description of each parameter follows:
4543 % o wand: the magick wand.
4546 WandExport double MagickGetImageGamma(MagickWand *wand)
4548 assert(wand != (MagickWand *) NULL);
4549 assert(wand->signature == WandSignature);
4550 if (wand->debug != MagickFalse)
4551 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4552 if (wand->images == (Image *) NULL)
4554 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4555 "ContainsNoImages","`%s'",wand->name);
4558 return(wand->images->gamma);
4562 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4566 % M a g i c k G e t I m a g e I n t e r l a c e S c h e m e %
4570 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4572 % MagickGetImageGravity() gets the image gravity.
4574 % The format of the MagickGetImageGravity method is:
4576 % GravityType MagickGetImageGravity(MagickWand *wand)
4578 % A description of each parameter follows:
4580 % o wand: the magick wand.
4583 WandExport GravityType MagickGetImageGravity(MagickWand *wand)
4585 assert(wand != (MagickWand *) NULL);
4586 assert(wand->signature == WandSignature);
4587 if (wand->debug != MagickFalse)
4588 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4589 if (wand->images == (Image *) NULL)
4591 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4592 "ContainsNoImages","`%s'",wand->name);
4593 return(UndefinedGravity);
4595 return(wand->images->gravity);
4599 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4603 % M a g i c k G e t I m a g e G r e e n P r i m a r y %
4607 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4609 % MagickGetImageGreenPrimary() returns the chromaticy green primary point.
4611 % The format of the MagickGetImageGreenPrimary method is:
4613 % MagickBooleanType MagickGetImageGreenPrimary(MagickWand *wand,double *x,
4616 % A description of each parameter follows:
4618 % o wand: the magick wand.
4620 % o x: the chromaticity green primary x-point.
4622 % o y: the chromaticity green primary y-point.
4625 WandExport MagickBooleanType MagickGetImageGreenPrimary(MagickWand *wand,
4626 double *x,double *y)
4628 assert(wand != (MagickWand *) NULL);
4629 assert(wand->signature == WandSignature);
4630 if (wand->debug != MagickFalse)
4631 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4632 if (wand->images == (Image *) NULL)
4633 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4634 *x=wand->images->chromaticity.green_primary.x;
4635 *y=wand->images->chromaticity.green_primary.y;
4640 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4644 % M a g i c k G e t I m a g e H e i g h t %
4648 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4650 % MagickGetImageHeight() returns the image height.
4652 % The format of the MagickGetImageHeight method is:
4654 % size_t MagickGetImageHeight(MagickWand *wand)
4656 % A description of each parameter follows:
4658 % o wand: the magick wand.
4661 WandExport size_t MagickGetImageHeight(MagickWand *wand)
4663 assert(wand != (MagickWand *) NULL);
4664 assert(wand->signature == WandSignature);
4665 if (wand->debug != MagickFalse)
4666 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4667 if (wand->images == (Image *) NULL)
4668 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4669 return(wand->images->rows);
4673 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4677 % M a g i c k G e t I m a g e H i s t o g r a m %
4681 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4683 % MagickGetImageHistogram() returns the image histogram as an array of
4686 % The format of the MagickGetImageHistogram method is:
4688 % PixelWand **MagickGetImageHistogram(MagickWand *wand,
4689 % size_t *number_colors)
4691 % A description of each parameter follows:
4693 % o wand: the magick wand.
4695 % o number_colors: the number of unique colors in the image and the number
4696 % of pixel wands returned.
4699 WandExport PixelWand **MagickGetImageHistogram(MagickWand *wand,
4700 size_t *number_colors)
4711 assert(wand != (MagickWand *) NULL);
4712 assert(wand->signature == WandSignature);
4713 if (wand->debug != MagickFalse)
4714 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4715 if (wand->images == (Image *) NULL)
4717 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4718 "ContainsNoImages","`%s'",wand->name);
4719 return((PixelWand **) NULL);
4721 histogram=GetImageHistogram(wand->images,number_colors,wand->exception);
4722 if (histogram == (PixelInfo *) NULL)
4723 return((PixelWand **) NULL);
4724 pixel_wands=NewPixelWands(*number_colors);
4725 for (i=0; i < (ssize_t) *number_colors; i++)
4727 PixelSetPixelColor(pixel_wands[i],&histogram[i]);
4728 PixelSetColorCount(pixel_wands[i],(size_t) histogram[i].count);
4730 histogram=(PixelInfo *) RelinquishMagickMemory(histogram);
4731 return(pixel_wands);
4735 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4739 % M a g i c k G e t I m a g e I n t e r l a c e S c h e m e %
4743 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4745 % MagickGetImageInterlaceScheme() gets the image interlace scheme.
4747 % The format of the MagickGetImageInterlaceScheme method is:
4749 % InterlaceType MagickGetImageInterlaceScheme(MagickWand *wand)
4751 % A description of each parameter follows:
4753 % o wand: the magick wand.
4756 WandExport InterlaceType MagickGetImageInterlaceScheme(MagickWand *wand)
4758 assert(wand != (MagickWand *) NULL);
4759 assert(wand->signature == WandSignature);
4760 if (wand->debug != MagickFalse)
4761 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4762 if (wand->images == (Image *) NULL)
4764 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4765 "ContainsNoImages","`%s'",wand->name);
4766 return(UndefinedInterlace);
4768 return(wand->images->interlace);
4772 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4776 % M a g i c k G e t I m a g e I n t e r p o l a t e M e t h o d %
4780 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4782 % MagickGetImageInterpolateMethod() returns the interpolation method for the
4785 % The format of the MagickGetImageInterpolateMethod method is:
4787 % PixelInterpolateMethod MagickGetImagePixelInterpolateMethod(
4790 % A description of each parameter follows:
4792 % o wand: the magick wand.
4795 WandExport PixelInterpolateMethod MagickGetImageInterpolateMethod(
4798 assert(wand != (MagickWand *) NULL);
4799 assert(wand->signature == WandSignature);
4800 if (wand->debug != MagickFalse)
4801 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4802 if (wand->images == (Image *) NULL)
4804 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4805 "ContainsNoImages","`%s'",wand->name);
4806 return(UndefinedInterpolatePixel);
4808 return(wand->images->interpolate);
4812 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4816 % M a g i c k G e t I m a g e I t e r a t i o n s %
4820 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4822 % MagickGetImageIterations() gets the image iterations.
4824 % The format of the MagickGetImageIterations method is:
4826 % size_t MagickGetImageIterations(MagickWand *wand)
4828 % A description of each parameter follows:
4830 % o wand: the magick wand.
4833 WandExport size_t MagickGetImageIterations(MagickWand *wand)
4835 assert(wand != (MagickWand *) NULL);
4836 assert(wand->signature == WandSignature);
4837 if (wand->debug != MagickFalse)
4838 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4839 if (wand->images == (Image *) NULL)
4840 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4841 return(wand->images->iterations);
4845 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4849 % M a g i c k G e t I m a g e L e n g t h %
4853 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4855 % MagickGetImageLength() returns the image length in bytes.
4857 % The format of the MagickGetImageLength method is:
4859 % MagickBooleanType MagickGetImageLength(MagickWand *wand,
4860 % MagickSizeType *length)
4862 % A description of each parameter follows:
4864 % o wand: the magick wand.
4866 % o length: the image length in bytes.
4869 WandExport MagickBooleanType MagickGetImageLength(MagickWand *wand,
4870 MagickSizeType *length)
4872 assert(wand != (MagickWand *) NULL);
4873 assert(wand->signature == WandSignature);
4874 if (wand->debug != MagickFalse)
4875 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4876 if (wand->images == (Image *) NULL)
4877 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4878 *length=GetBlobSize(wand->images);
4883 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4887 % M a g i c k G e t I m a g e M a t t e C o l o r %
4891 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4893 % MagickGetImageMatteColor() returns the image matte color.
4895 % The format of the MagickGetImageMatteColor method is:
4897 % MagickBooleanType MagickGetImagematteColor(MagickWand *wand,
4898 % PixelWand *matte_color)
4900 % A description of each parameter follows:
4902 % o wand: the magick wand.
4904 % o matte_color: Return the matte color.
4907 WandExport MagickBooleanType MagickGetImageMatteColor(MagickWand *wand,
4908 PixelWand *matte_color)
4910 assert(wand != (MagickWand *) NULL);
4911 assert(wand->signature == WandSignature);
4912 if (wand->debug != MagickFalse)
4913 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4914 if (wand->images == (Image *) NULL)
4915 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4916 PixelSetPixelColor(matte_color,&wand->images->matte_color);
4921 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4925 % M a g i c k G e t I m a g e O r i e n t a t i o n %
4929 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4931 % MagickGetImageOrientation() returns the image orientation.
4933 % The format of the MagickGetImageOrientation method is:
4935 % OrientationType MagickGetImageOrientation(MagickWand *wand)
4937 % A description of each parameter follows:
4939 % o wand: the magick wand.
4942 WandExport OrientationType MagickGetImageOrientation(MagickWand *wand)
4944 assert(wand != (MagickWand *) NULL);
4945 assert(wand->signature == WandSignature);
4946 if (wand->debug != MagickFalse)
4947 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4948 if (wand->images == (Image *) NULL)
4950 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4951 "ContainsNoImages","`%s'",wand->name);
4952 return(UndefinedOrientation);
4954 return(wand->images->orientation);
4958 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4962 % M a g i c k G e t I m a g e P a g e %
4966 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4968 % MagickGetImagePage() returns the page geometry associated with the image.
4970 % The format of the MagickGetImagePage method is:
4972 % MagickBooleanType MagickGetImagePage(MagickWand *wand,
4973 % size_t *width,size_t *height,ssize_t *x,ssize_t *y)
4975 % A description of each parameter follows:
4977 % o wand: the magick wand.
4979 % o width: the page width.
4981 % o height: the page height.
4983 % o x: the page x-offset.
4985 % o y: the page y-offset.
4988 WandExport MagickBooleanType MagickGetImagePage(MagickWand *wand,
4989 size_t *width,size_t *height,ssize_t *x,ssize_t *y)
4991 assert(wand != (const MagickWand *) NULL);
4992 assert(wand->signature == WandSignature);
4993 if (wand->debug != MagickFalse)
4994 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4995 if (wand->images == (Image *) NULL)
4996 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4997 *width=wand->images->page.width;
4998 *height=wand->images->page.height;
4999 *x=wand->images->page.x;
5000 *y=wand->images->page.y;
5005 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5009 % M a g i c k G e t I m a g e P i x e l C o l o r %
5013 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5015 % MagickGetImagePixelColor() returns the color of the specified pixel.
5017 % The format of the MagickGetImagePixelColor method is:
5019 % MagickBooleanType MagickGetImagePixelColor(MagickWand *wand,
5020 % const ssize_t x,const ssize_t y,PixelWand *color)
5022 % A description of each parameter follows:
5024 % o wand: the magick wand.
5026 % o x,y: the pixel offset into the image.
5028 % o color: Return the colormap color in this wand.
5031 WandExport MagickBooleanType MagickGetImagePixelColor(MagickWand *wand,
5032 const ssize_t x,const ssize_t y,PixelWand *color)
5034 register const Quantum
5040 assert(wand != (MagickWand *) NULL);
5041 assert(wand->signature == WandSignature);
5042 if (wand->debug != MagickFalse)
5043 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5044 if (wand->images == (Image *) NULL)
5045 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5046 image_view=AcquireCacheView(wand->images);
5047 p=GetCacheViewVirtualPixels(image_view,x,y,1,1,wand->exception);
5048 if (p == (const Quantum *) NULL)
5050 image_view=DestroyCacheView(image_view);
5051 return(MagickFalse);
5053 PixelSetQuantumPixel(wand->images,p,color);
5054 image_view=DestroyCacheView(image_view);
5059 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5063 % M a g i c k G e t I m a g e R e d P r i m a r y %
5067 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5069 % MagickGetImageRedPrimary() returns the chromaticy red primary point.
5071 % The format of the MagickGetImageRedPrimary method is:
5073 % MagickBooleanType MagickGetImageRedPrimary(MagickWand *wand,double *x,
5076 % A description of each parameter follows:
5078 % o wand: the magick wand.
5080 % o x: the chromaticity red primary x-point.
5082 % o y: the chromaticity red primary y-point.
5085 WandExport MagickBooleanType MagickGetImageRedPrimary(MagickWand *wand,
5086 double *x,double *y)
5088 assert(wand != (MagickWand *) NULL);
5089 assert(wand->signature == WandSignature);
5090 if (wand->debug != MagickFalse)
5091 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5092 if (wand->images == (Image *) NULL)
5093 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5094 *x=wand->images->chromaticity.red_primary.x;
5095 *y=wand->images->chromaticity.red_primary.y;
5100 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5104 % M a g i c k G e t I m a g e R e g i o n %
5108 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5110 % MagickGetImageRegion() extracts a region of the image and returns it as a
5113 % The format of the MagickGetImageRegion method is:
5115 % MagickWand *MagickGetImageRegion(MagickWand *wand,
5116 % const size_t width,const size_t height,const ssize_t x,
5119 % A description of each parameter follows:
5121 % o wand: the magick wand.
5123 % o width: the region width.
5125 % o height: the region height.
5127 % o x: the region x offset.
5129 % o y: the region y offset.
5132 WandExport MagickWand *MagickGetImageRegion(MagickWand *wand,
5133 const size_t width,const size_t height,const ssize_t x,
5142 assert(wand != (MagickWand *) NULL);
5143 assert(wand->signature == WandSignature);
5144 if (wand->debug != MagickFalse)
5145 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5146 if (wand->images == (Image *) NULL)
5147 return((MagickWand *) NULL);
5149 region.height=height;
5152 region_image=CropImage(wand->images,®ion,wand->exception);
5153 if (region_image == (Image *) NULL)
5154 return((MagickWand *) NULL);
5155 return(CloneMagickWandFromImages(wand,region_image));
5159 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5163 % M a g i c k G e t I m a g e R e n d e r i n g I n t e n t %
5167 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5169 % MagickGetImageRenderingIntent() gets the image rendering intent.
5171 % The format of the MagickGetImageRenderingIntent method is:
5173 % RenderingIntent MagickGetImageRenderingIntent(MagickWand *wand)
5175 % A description of each parameter follows:
5177 % o wand: the magick wand.
5180 WandExport RenderingIntent MagickGetImageRenderingIntent(MagickWand *wand)
5182 assert(wand != (MagickWand *) NULL);
5183 assert(wand->signature == WandSignature);
5184 if (wand->debug != MagickFalse)
5185 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5186 if (wand->images == (Image *) NULL)
5188 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5189 "ContainsNoImages","`%s'",wand->name);
5190 return(UndefinedIntent);
5192 return((RenderingIntent) wand->images->rendering_intent);
5196 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5200 % M a g i c k G e t I m a g e R e s o l u t i o n %
5204 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5206 % MagickGetImageResolution() gets the image X and Y resolution.
5208 % The format of the MagickGetImageResolution method is:
5210 % MagickBooleanType MagickGetImageResolution(MagickWand *wand,double *x,
5213 % A description of each parameter follows:
5215 % o wand: the magick wand.
5217 % o x: the image x-resolution.
5219 % o y: the image y-resolution.
5222 WandExport MagickBooleanType MagickGetImageResolution(MagickWand *wand,
5223 double *x,double *y)
5225 assert(wand != (MagickWand *) NULL);
5226 assert(wand->signature == WandSignature);
5227 if (wand->debug != MagickFalse)
5228 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5229 if (wand->images == (Image *) NULL)
5230 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5231 *x=wand->images->resolution.x;
5232 *y=wand->images->resolution.y;
5237 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5241 % M a g i c k G e t I m a g e S c e n e %
5245 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5247 % MagickGetImageScene() gets the image scene.
5249 % The format of the MagickGetImageScene method is:
5251 % size_t MagickGetImageScene(MagickWand *wand)
5253 % A description of each parameter follows:
5255 % o wand: the magick wand.
5258 WandExport size_t MagickGetImageScene(MagickWand *wand)
5260 assert(wand != (MagickWand *) NULL);
5261 assert(wand->signature == WandSignature);
5262 if (wand->debug != MagickFalse)
5263 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5264 if (wand->images == (Image *) NULL)
5265 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5266 return(wand->images->scene);
5270 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5274 % M a g i c k G e t I m a g e S i g n a t u r e %
5278 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5280 % MagickGetImageSignature() generates an SHA-256 message digest for the image
5283 % The format of the MagickGetImageSignature method is:
5285 % const char MagickGetImageSignature(MagickWand *wand)
5287 % A description of each parameter follows:
5289 % o wand: the magick wand.
5292 WandExport char *MagickGetImageSignature(MagickWand *wand)
5300 assert(wand != (MagickWand *) NULL);
5301 assert(wand->signature == WandSignature);
5302 if (wand->debug != MagickFalse)
5303 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5304 if (wand->images == (Image *) NULL)
5306 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5307 "ContainsNoImages","`%s'",wand->name);
5308 return((char *) NULL);
5310 status=SignatureImage(wand->images,wand->exception);
5311 if (status == MagickFalse)
5312 return((char *) NULL);
5313 value=GetImageProperty(wand->images,"signature",wand->exception);
5314 if (value == (const char *) NULL)
5315 return((char *) NULL);
5316 return(AcquireString(value));
5320 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5324 % M a g i c k G e t I m a g e T i c k s P e r S e c o n d %
5328 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5330 % MagickGetImageTicksPerSecond() gets the image ticks-per-second.
5332 % The format of the MagickGetImageTicksPerSecond method is:
5334 % size_t MagickGetImageTicksPerSecond(MagickWand *wand)
5336 % A description of each parameter follows:
5338 % o wand: the magick wand.
5341 WandExport size_t MagickGetImageTicksPerSecond(MagickWand *wand)
5343 assert(wand != (MagickWand *) NULL);
5344 assert(wand->signature == WandSignature);
5345 if (wand->debug != MagickFalse)
5346 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5347 if (wand->images == (Image *) NULL)
5348 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5349 return((size_t) wand->images->ticks_per_second);
5353 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5357 % M a g i c k G e t I m a g e T y p e %
5361 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5363 % MagickGetImageType() gets the potential image type:
5365 % Bilevel Grayscale GrayscaleMatte
5366 % Palette PaletteMatte TrueColor
5367 % TrueColorMatte ColorSeparation ColorSeparationMatte
5369 % To ensure the image type matches its potential, use MagickSetImageType():
5371 % (void) MagickSetImageType(wand,MagickGetImageType(wand));
5373 % The format of the MagickGetImageType method is:
5375 % ImageType MagickGetImageType(MagickWand *wand)
5377 % A description of each parameter follows:
5379 % o wand: the magick wand.
5382 WandExport ImageType MagickGetImageType(MagickWand *wand)
5384 assert(wand != (MagickWand *) NULL);
5385 assert(wand->signature == WandSignature);
5386 if (wand->debug != MagickFalse)
5387 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5388 if (wand->images == (Image *) NULL)
5390 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5391 "ContainsNoImages","`%s'",wand->name);
5392 return(UndefinedType);
5394 return(GetImageType(wand->images,wand->exception));
5398 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5402 % M a g i c k G e t I m a g e U n i t s %
5406 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5408 % MagickGetImageUnits() gets the image units of resolution.
5410 % The format of the MagickGetImageUnits method is:
5412 % ResolutionType MagickGetImageUnits(MagickWand *wand)
5414 % A description of each parameter follows:
5416 % o wand: the magick wand.
5419 WandExport ResolutionType MagickGetImageUnits(MagickWand *wand)
5421 assert(wand != (MagickWand *) NULL);
5422 assert(wand->signature == WandSignature);
5423 if (wand->debug != MagickFalse)
5424 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5425 if (wand->images == (Image *) NULL)
5427 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5428 "ContainsNoImages","`%s'",wand->name);
5429 return(UndefinedResolution);
5431 return(wand->images->units);
5435 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5439 % M a g i c k G e t I m a g e V i r t u a l P i x e l M e t h o d %
5443 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5445 % MagickGetImageVirtualPixelMethod() returns the virtual pixel method for the
5448 % The format of the MagickGetImageVirtualPixelMethod method is:
5450 % VirtualPixelMethod MagickGetImageVirtualPixelMethod(MagickWand *wand)
5452 % A description of each parameter follows:
5454 % o wand: the magick wand.
5457 WandExport VirtualPixelMethod MagickGetImageVirtualPixelMethod(MagickWand *wand)
5459 assert(wand != (MagickWand *) NULL);
5460 assert(wand->signature == WandSignature);
5461 if (wand->debug != MagickFalse)
5462 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5463 if (wand->images == (Image *) NULL)
5465 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5466 "ContainsNoImages","`%s'",wand->name);
5467 return(UndefinedVirtualPixelMethod);
5469 return(GetImageVirtualPixelMethod(wand->images));
5473 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5477 % M a g i c k G e t I m a g e W h i t e P o i n t %
5481 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5483 % MagickGetImageWhitePoint() returns the chromaticy white point.
5485 % The format of the MagickGetImageWhitePoint method is:
5487 % MagickBooleanType MagickGetImageWhitePoint(MagickWand *wand,double *x,
5490 % A description of each parameter follows:
5492 % o wand: the magick wand.
5494 % o x: the chromaticity white x-point.
5496 % o y: the chromaticity white y-point.
5499 WandExport MagickBooleanType MagickGetImageWhitePoint(MagickWand *wand,
5500 double *x,double *y)
5502 assert(wand != (MagickWand *) NULL);
5503 assert(wand->signature == WandSignature);
5504 if (wand->debug != MagickFalse)
5505 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5506 if (wand->images == (Image *) NULL)
5507 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5508 *x=wand->images->chromaticity.white_point.x;
5509 *y=wand->images->chromaticity.white_point.y;
5514 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5518 % M a g i c k G e t I m a g e W i d t h %
5522 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5524 % MagickGetImageWidth() returns the image width.
5526 % The format of the MagickGetImageWidth method is:
5528 % size_t MagickGetImageWidth(MagickWand *wand)
5530 % A description of each parameter follows:
5532 % o wand: the magick wand.
5535 WandExport size_t MagickGetImageWidth(MagickWand *wand)
5537 assert(wand != (MagickWand *) NULL);
5538 assert(wand->signature == WandSignature);
5539 if (wand->debug != MagickFalse)
5540 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5541 if (wand->images == (Image *) NULL)
5542 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5543 return(wand->images->columns);
5547 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5551 % M a g i c k G e t N u m b e r I m a g e s %
5555 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5557 % MagickGetNumberImages() returns the number of images associated with a
5560 % The format of the MagickGetNumberImages method is:
5562 % size_t MagickGetNumberImages(MagickWand *wand)
5564 % A description of each parameter follows:
5566 % o wand: the magick wand.
5569 WandExport size_t MagickGetNumberImages(MagickWand *wand)
5571 assert(wand != (MagickWand *) NULL);
5572 assert(wand->signature == WandSignature);
5573 if (wand->debug != MagickFalse)
5574 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5575 return(GetImageListLength(wand->images));
5579 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5583 % M a g i c k I m a g e G e t T o t a l I n k D e n s i t y %
5587 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5589 % MagickGetImageTotalInkDensity() gets the image total ink density.
5591 % The format of the MagickGetImageTotalInkDensity method is:
5593 % double MagickGetImageTotalInkDensity(MagickWand *wand)
5595 % A description of each parameter follows:
5597 % o wand: the magick wand.
5600 WandExport double MagickGetImageTotalInkDensity(MagickWand *wand)
5602 assert(wand != (MagickWand *) NULL);
5603 assert(wand->signature == WandSignature);
5604 if (wand->debug != MagickFalse)
5605 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5606 if (wand->images == (Image *) NULL)
5608 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5609 "ContainsNoImages","`%s'",wand->name);
5612 return(GetImageTotalInkDensity(wand->images,wand->exception));
5616 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5620 % M a g i c k H a l d C l u t I m a g e %
5624 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5626 % MagickHaldClutImage() replaces colors in the image from a Hald color lookup
5627 % table. A Hald color lookup table is a 3-dimensional color cube mapped to 2
5628 % dimensions. Create it with the HALD coder. You can apply any color
5629 % transformation to the Hald image and then use this method to apply the
5630 % transform to the image.
5632 % The format of the MagickHaldClutImage method is:
5634 % MagickBooleanType MagickHaldClutImage(MagickWand *wand,
5635 % const MagickWand *hald_wand)
5637 % A description of each parameter follows:
5639 % o wand: the magick wand.
5641 % o hald_image: the hald CLUT image.
5644 WandExport MagickBooleanType MagickHaldClutImage(MagickWand *wand,
5645 const MagickWand *hald_wand)
5650 assert(wand != (MagickWand *) NULL);
5651 assert(wand->signature == WandSignature);
5652 if (wand->debug != MagickFalse)
5653 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5654 if ((wand->images == (Image *) NULL) || (hald_wand->images == (Image *) NULL))
5655 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5656 status=HaldClutImage(wand->images,hald_wand->images,wand->exception);
5661 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5665 % M a g i c k H a s N e x t I m a g e %
5669 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5671 % MagickHasNextImage() returns MagickTrue if the wand has more images when
5672 % traversing the list in the forward direction
5674 % The format of the MagickHasNextImage method is:
5676 % MagickBooleanType MagickHasNextImage(MagickWand *wand)
5678 % A description of each parameter follows:
5680 % o wand: the magick wand.
5683 WandExport MagickBooleanType MagickHasNextImage(MagickWand *wand)
5685 assert(wand != (MagickWand *) NULL);
5686 assert(wand->signature == WandSignature);
5687 if (wand->debug != MagickFalse)
5688 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5689 if (wand->images == (Image *) NULL)
5690 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5691 if (GetNextImageInList(wand->images) == (Image *) NULL)
5692 return(MagickFalse);
5697 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5701 % M a g i c k H a s P r e v i o u s I m a g e %
5705 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5707 % MagickHasPreviousImage() returns MagickTrue if the wand has more images when
5708 % traversing the list in the reverse direction
5710 % The format of the MagickHasPreviousImage method is:
5712 % MagickBooleanType MagickHasPreviousImage(MagickWand *wand)
5714 % A description of each parameter follows:
5716 % o wand: the magick wand.
5719 WandExport MagickBooleanType MagickHasPreviousImage(MagickWand *wand)
5721 assert(wand != (MagickWand *) NULL);
5722 assert(wand->signature == WandSignature);
5723 if (wand->debug != MagickFalse)
5724 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5725 if (wand->images == (Image *) NULL)
5726 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5727 if (GetPreviousImageInList(wand->images) == (Image *) NULL)
5728 return(MagickFalse);
5733 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5737 % M a g i c k I d e n t i f y I m a g e %
5741 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5743 % MagickIdentifyImage() identifies an image by printing its attributes to the
5744 % file. Attributes include the image width, height, size, and others.
5746 % The format of the MagickIdentifyImage method is:
5748 % const char *MagickIdentifyImage(MagickWand *wand)
5750 % A description of each parameter follows:
5752 % o wand: the magick wand.
5755 WandExport char *MagickIdentifyImage(MagickWand *wand)
5759 filename[MaxTextExtent];
5767 assert(wand != (MagickWand *) NULL);
5768 assert(wand->signature == WandSignature);
5769 if (wand->debug != MagickFalse)
5770 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5771 if (wand->images == (Image *) NULL)
5773 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5774 "ContainsNoImages","`%s'",wand->name);
5775 return((char *) NULL);
5777 description=(char *) NULL;
5778 unique_file=AcquireUniqueFileResource(filename);
5780 if (unique_file != -1)
5781 file=fdopen(unique_file,"wb");
5782 if ((unique_file == -1) || (file == (FILE *) NULL))
5784 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5785 "UnableToCreateTemporaryFile","`%s'",wand->name);
5786 return((char *) NULL);
5788 (void) IdentifyImage(wand->images,file,MagickTrue,wand->exception);
5789 (void) fclose(file);
5790 description=FileToString(filename,~0,wand->exception);
5791 (void) RelinquishUniqueFileResource(filename);
5792 return(description);
5796 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5800 % M a g i c k I m p l o d e I m a g e %
5804 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5806 % MagickImplodeImage() creates a new image that is a copy of an existing
5807 % one with the image pixels "implode" by the specified percentage. It
5808 % allocates the memory necessary for the new Image structure and returns a
5809 % pointer to the new image.
5811 % The format of the MagickImplodeImage method is:
5813 % MagickBooleanType MagickImplodeImage(MagickWand *wand,
5814 % const double radius,const PixelInterpolateMethod method)
5816 % A description of each parameter follows:
5818 % o wand: the magick wand.
5820 % o amount: Define the extent of the implosion.
5822 % o method: the pixel interpolation method.
5825 WandExport MagickBooleanType MagickImplodeImage(MagickWand *wand,
5826 const double amount,const PixelInterpolateMethod method)
5831 assert(wand != (MagickWand *) NULL);
5832 assert(wand->signature == WandSignature);
5833 if (wand->debug != MagickFalse)
5834 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5835 if (wand->images == (Image *) NULL)
5836 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5837 implode_image=ImplodeImage(wand->images,amount,method,wand->exception);
5838 if (implode_image == (Image *) NULL)
5839 return(MagickFalse);
5840 ReplaceImageInList(&wand->images,implode_image);
5845 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5849 % M a g i c k I m p o r t I m a g e P i x e l s %
5853 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5855 % MagickImportImagePixels() accepts pixel datand stores it in the image at the
5856 % location you specify. The method returns MagickFalse on success otherwise
5857 % MagickTrue if an error is encountered. The pixel data can be either char,
5858 % short int, int, ssize_t, float, or double in the order specified by map.
5860 % Suppose your want to upload the first scanline of a 640x480 image from
5861 % character data in red-green-blue order:
5863 % MagickImportImagePixels(wand,0,0,640,1,"RGB",CharPixel,pixels);
5865 % The format of the MagickImportImagePixels method is:
5867 % MagickBooleanType MagickImportImagePixels(MagickWand *wand,
5868 % const ssize_t x,const ssize_t y,const size_t columns,
5869 % const size_t rows,const char *map,const StorageType storage,
5870 % const void *pixels)
5872 % A description of each parameter follows:
5874 % o wand: the magick wand.
5876 % o x, y, columns, rows: These values define the perimeter of a region
5877 % of pixels you want to define.
5879 % o map: This string reflects the expected ordering of the pixel array.
5880 % It can be any combination or order of R = red, G = green, B = blue,
5881 % A = alpha (0 is transparent), O = alpha (0 is opaque), C = cyan,
5882 % Y = yellow, M = magenta, K = black, I = intensity (for grayscale),
5885 % o storage: Define the data type of the pixels. Float and double types are
5886 % expected to be normalized [0..1] otherwise [0..QuantumRange]. Choose from
5887 % these types: CharPixel, ShortPixel, IntegerPixel, LongPixel, FloatPixel,
5890 % o pixels: This array of values contain the pixel components as defined by
5891 % map and type. You must preallocate this array where the expected
5892 % length varies depending on the values of width, height, map, and type.
5895 WandExport MagickBooleanType MagickImportImagePixels(MagickWand *wand,
5896 const ssize_t x,const ssize_t y,const size_t columns,const size_t rows,
5897 const char *map,const StorageType storage,const void *pixels)
5902 assert(wand != (MagickWand *) NULL);
5903 assert(wand->signature == WandSignature);
5904 if (wand->debug != MagickFalse)
5905 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5906 if (wand->images == (Image *) NULL)
5907 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5908 status=ImportImagePixels(wand->images,x,y,columns,rows,map,storage,pixels,
5914 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5918 % M a g i c k I n t e r p o l a t i v e R e s i z e I m a g e %
5922 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5924 % MagickInterpolativeResizeImage() resize image using a interpolative
5927 % MagickBooleanType MagickInterpolativeResizeImage(MagickWand *wand,
5928 % const size_t columns,const size_t rows,
5929 % const PixelInterpolateMethod method)
5931 % A description of each parameter follows:
5933 % o wand: the magick wand.
5935 % o columns: the number of columns in the scaled image.
5937 % o rows: the number of rows in the scaled image.
5939 % o interpolate: the pixel interpolation method.
5942 WandExport MagickBooleanType MagickInterpolativeResizeImage(MagickWand *wand,
5943 const size_t columns,const size_t rows,const PixelInterpolateMethod method)
5948 assert(wand != (MagickWand *) NULL);
5949 assert(wand->signature == WandSignature);
5950 if (wand->debug != MagickFalse)
5951 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5952 if (wand->images == (Image *) NULL)
5953 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5954 resize_image=InterpolativeResizeImage(wand->images,columns,rows,method,
5956 if (resize_image == (Image *) NULL)
5957 return(MagickFalse);
5958 ReplaceImageInList(&wand->images,resize_image);
5963 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5967 % M a g i c k I n v e r s e F o u r i e r T r a n s f o r m I m a g e %
5971 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5973 % MagickInverseFourierTransformImage() implements the inverse discrete
5974 % Fourier transform (DFT) of the image either as a magnitude / phase or real /
5975 % imaginary image pair.
5977 % The format of the MagickInverseFourierTransformImage method is:
5979 % MagickBooleanType MagickInverseFourierTransformImage(
5980 % MagickWand *magnitude_wand,MagickWand *phase_wand,
5981 % const MagickBooleanType magnitude)
5983 % A description of each parameter follows:
5985 % o magnitude_wand: the magnitude or real wand.
5987 % o phase_wand: the phase or imaginary wand.
5989 % o magnitude: if true, return as magnitude / phase pair otherwise a real /
5990 % imaginary image pair.
5993 WandExport MagickBooleanType MagickInverseFourierTransformImage(
5994 MagickWand *magnitude_wand,MagickWand *phase_wand,
5995 const MagickBooleanType magnitude)
6003 assert(magnitude_wand != (MagickWand *) NULL);
6004 assert(magnitude_wand->signature == WandSignature);
6005 if (magnitude_wand->debug != MagickFalse)
6006 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",
6007 magnitude_wand->name);
6008 wand=magnitude_wand;
6009 if (magnitude_wand->images == (Image *) NULL)
6010 ThrowWandException(WandError,"ContainsNoImages",
6011 magnitude_wand->name);
6012 assert(phase_wand != (MagickWand *) NULL);
6013 assert(phase_wand->signature == WandSignature);
6014 inverse_image=InverseFourierTransformImage(magnitude_wand->images,
6015 phase_wand->images,magnitude,wand->exception);
6016 if (inverse_image == (Image *) NULL)
6017 return(MagickFalse);
6018 ReplaceImageInList(&wand->images,inverse_image);
6023 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6027 % M a g i c k L a b e l I m a g e %
6031 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6033 % MagickLabelImage() adds a label to your image.
6035 % The format of the MagickLabelImage method is:
6037 % MagickBooleanType MagickLabelImage(MagickWand *wand,const char *label)
6039 % A description of each parameter follows:
6041 % o wand: the magick wand.
6043 % o label: the image label.
6046 WandExport MagickBooleanType MagickLabelImage(MagickWand *wand,
6052 assert(wand != (MagickWand *) NULL);
6053 assert(wand->signature == WandSignature);
6054 if (wand->debug != MagickFalse)
6055 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6056 if (wand->images == (Image *) NULL)
6057 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6058 status=SetImageProperty(wand->images,"label",label,wand->exception);
6063 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6067 % M a g i c k L e v e l I m a g e %
6071 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6073 % MagickLevelImage() adjusts the levels of an image by scaling the colors
6074 % falling between specified white and black points to the full available
6075 % quantum range. The parameters provided represent the black, mid, and white
6076 % points. The black point specifies the darkest color in the image. Colors
6077 % darker than the black point are set to zero. Mid point specifies a gamma
6078 % correction to apply to the image. White point specifies the lightest color
6079 % in the image. Colors brighter than the white point are set to the maximum
6082 % The format of the MagickLevelImage method is:
6084 % MagickBooleanType MagickLevelImage(MagickWand *wand,
6085 % const double black_point,const double gamma,const double white_point)
6086 % MagickBooleanType MagickLevelImage(MagickWand *wand,
6087 % const ChannelType channel,const double black_point,const double gamma,
6088 % const double white_point)
6090 % A description of each parameter follows:
6092 % o wand: the magick wand.
6094 % o channel: Identify which channel to level: RedPixelChannel,
6095 % GreenPixelChannel, etc.
6097 % o black_point: the black point.
6099 % o gamma: the gamma.
6101 % o white_point: the white point.
6104 WandExport MagickBooleanType MagickLevelImage(MagickWand *wand,
6105 const double black_point,const double gamma,const double white_point)
6110 assert(wand != (MagickWand *) NULL);
6111 assert(wand->signature == WandSignature);
6112 if (wand->debug != MagickFalse)
6113 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6114 if (wand->images == (Image *) NULL)
6115 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6116 status=LevelImage(wand->images,black_point,white_point,gamma,
6122 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6126 % M a g i c k L i n e a r S t r e t c h I m a g e %
6130 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6132 % MagickLinearStretchImage() stretches with saturation the image intensity.
6134 % You can also reduce the influence of a particular channel with a gamma
6137 % The format of the MagickLinearStretchImage method is:
6139 % MagickBooleanType MagickLinearStretchImage(MagickWand *wand,
6140 % const double black_point,const double white_point)
6142 % A description of each parameter follows:
6144 % o wand: the magick wand.
6146 % o black_point: the black point.
6148 % o white_point: the white point.
6151 WandExport MagickBooleanType MagickLinearStretchImage(MagickWand *wand,
6152 const double black_point,const double white_point)
6157 assert(wand != (MagickWand *) NULL);
6158 assert(wand->signature == WandSignature);
6159 if (wand->debug != MagickFalse)
6160 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6161 if (wand->images == (Image *) NULL)
6162 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6163 status=LinearStretchImage(wand->images,black_point,white_point,
6169 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6173 % M a g i c k L i q u i d R e s c a l e I m a g e %
6177 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6179 % MagickLiquidRescaleImage() rescales image with seam carving.
6181 % MagickBooleanType MagickLiquidRescaleImage(MagickWand *wand,
6182 % const size_t columns,const size_t rows,
6183 % const double delta_x,const double rigidity)
6185 % A description of each parameter follows:
6187 % o wand: the magick wand.
6189 % o columns: the number of columns in the scaled image.
6191 % o rows: the number of rows in the scaled image.
6193 % o delta_x: maximum seam transversal step (0 means straight seams).
6195 % o rigidity: introduce a bias for non-straight seams (typically 0).
6198 WandExport MagickBooleanType MagickLiquidRescaleImage(MagickWand *wand,
6199 const size_t columns,const size_t rows,const double delta_x,
6200 const double rigidity)
6205 assert(wand != (MagickWand *) NULL);
6206 assert(wand->signature == WandSignature);
6207 if (wand->debug != MagickFalse)
6208 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6209 if (wand->images == (Image *) NULL)
6210 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6211 rescale_image=LiquidRescaleImage(wand->images,columns,rows,delta_x,
6212 rigidity,wand->exception);
6213 if (rescale_image == (Image *) NULL)
6214 return(MagickFalse);
6215 ReplaceImageInList(&wand->images,rescale_image);
6220 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6224 % M a g i c k M a g n i f y I m a g e %
6228 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6230 % MagickMagnifyImage() is a convenience method that scales an image
6231 % proportionally to twice its original size.
6233 % The format of the MagickMagnifyImage method is:
6235 % MagickBooleanType MagickMagnifyImage(MagickWand *wand)
6237 % A description of each parameter follows:
6239 % o wand: the magick wand.
6242 WandExport MagickBooleanType MagickMagnifyImage(MagickWand *wand)
6247 assert(wand != (MagickWand *) NULL);
6248 assert(wand->signature == WandSignature);
6249 if (wand->debug != MagickFalse)
6250 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6251 if (wand->images == (Image *) NULL)
6252 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6253 magnify_image=MagnifyImage(wand->images,wand->exception);
6254 if (magnify_image == (Image *) NULL)
6255 return(MagickFalse);
6256 ReplaceImageInList(&wand->images,magnify_image);
6261 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6265 % M a g i c k M e r g e I m a g e L a y e r s %
6269 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6271 % MagickMergeImageLayers() composes all the image layers from the current
6272 % given image onward to produce a single image of the merged layers.
6274 % The inital canvas's size depends on the given ImageLayerMethod, and is
6275 % initialized using the first images background color. The images
6276 % are then compositied onto that image in sequence using the given
6277 % composition that has been assigned to each individual image.
6279 % The format of the MagickMergeImageLayers method is:
6281 % MagickWand *MagickMergeImageLayers(MagickWand *wand,
6282 % const ImageLayerMethod method)
6284 % A description of each parameter follows:
6286 % o wand: the magick wand.
6288 % o method: the method of selecting the size of the initial canvas.
6290 % MergeLayer: Merge all layers onto a canvas just large enough
6291 % to hold all the actual images. The virtual canvas of the
6292 % first image is preserved but otherwise ignored.
6294 % FlattenLayer: Use the virtual canvas size of first image.
6295 % Images which fall outside this canvas is clipped.
6296 % This can be used to 'fill out' a given virtual canvas.
6298 % MosaicLayer: Start with the virtual canvas of the first image,
6299 % enlarging left and right edges to contain all images.
6300 % Images with negative offsets will be clipped.
6303 WandExport MagickWand *MagickMergeImageLayers(MagickWand *wand,
6304 const ImageLayerMethod method)
6309 assert(wand != (MagickWand *) NULL);
6310 assert(wand->signature == WandSignature);
6311 if (wand->debug != MagickFalse)
6312 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6313 if (wand->images == (Image *) NULL)
6314 return((MagickWand *) NULL);
6315 mosaic_image=MergeImageLayers(wand->images,method,wand->exception);
6316 if (mosaic_image == (Image *) NULL)
6317 return((MagickWand *) NULL);
6318 return(CloneMagickWandFromImages(wand,mosaic_image));
6322 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6326 % M a g i c k M i n i f y I m a g e %
6330 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6332 % MagickMinifyImage() is a convenience method that scales an image
6333 % proportionally to one-half its original size
6335 % The format of the MagickMinifyImage method is:
6337 % MagickBooleanType MagickMinifyImage(MagickWand *wand)
6339 % A description of each parameter follows:
6341 % o wand: the magick wand.
6344 WandExport MagickBooleanType MagickMinifyImage(MagickWand *wand)
6349 assert(wand != (MagickWand *) NULL);
6350 assert(wand->signature == WandSignature);
6351 if (wand->debug != MagickFalse)
6352 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6353 if (wand->images == (Image *) NULL)
6354 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6355 minify_image=MinifyImage(wand->images,wand->exception);
6356 if (minify_image == (Image *) NULL)
6357 return(MagickFalse);
6358 ReplaceImageInList(&wand->images,minify_image);
6363 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6367 % M a g i c k M o d u l a t e I m a g e %
6371 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6373 % MagickModulateImage() lets you control the brightness, saturation, and hue
6374 % of an image. Hue is the percentage of absolute rotation from the current
6375 % position. For example 50 results in a counter-clockwise rotation of 90
6376 % degrees, 150 results in a clockwise rotation of 90 degrees, with 0 and 200
6377 % both resulting in a rotation of 180 degrees.
6379 % To increase the color brightness by 20% and decrease the color saturation by
6380 % 10% and leave the hue unchanged, use: 120,90,100.
6382 % The format of the MagickModulateImage method is:
6384 % MagickBooleanType MagickModulateImage(MagickWand *wand,
6385 % const double brightness,const double saturation,const double hue)
6387 % A description of each parameter follows:
6389 % o wand: the magick wand.
6391 % o brightness: the percent change in brighness.
6393 % o saturation: the percent change in saturation.
6395 % o hue: the percent change in hue.
6398 WandExport MagickBooleanType MagickModulateImage(MagickWand *wand,
6399 const double brightness,const double saturation,const double hue)
6402 modulate[MaxTextExtent];
6407 assert(wand != (MagickWand *) NULL);
6408 assert(wand->signature == WandSignature);
6409 if (wand->debug != MagickFalse)
6410 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6411 if (wand->images == (Image *) NULL)
6412 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6413 (void) FormatLocaleString(modulate,MaxTextExtent,"%g,%g,%g",
6414 brightness,saturation,hue);
6415 status=ModulateImage(wand->images,modulate,wand->exception);
6420 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6424 % M a g i c k M o n t a g e I m a g e %
6428 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6430 % MagickMontageImage() creates a composite image by combining several
6431 % separate images. The images are tiled on the composite image with the name
6432 % of the image optionally appearing just below the individual tile.
6434 % The format of the MagickMontageImage method is:
6436 % MagickWand *MagickMontageImage(MagickWand *wand,
6437 % const DrawingWand drawing_wand,const char *tile_geometry,
6438 % const char *thumbnail_geometry,const MontageMode mode,
6439 % const char *frame)
6441 % A description of each parameter follows:
6443 % o wand: the magick wand.
6445 % o drawing_wand: the drawing wand. The font name, size, and color are
6446 % obtained from this wand.
6448 % o tile_geometry: the number of tiles per row and page (e.g. 6x4+0+0).
6450 % o thumbnail_geometry: Preferred image size and border size of each
6451 % thumbnail (e.g. 120x120+4+3>).
6453 % o mode: Thumbnail framing mode: Frame, Unframe, or Concatenate.
6455 % o frame: Surround the image with an ornamental border (e.g. 15x15+3+3).
6456 % The frame color is that of the thumbnail's matte color.
6459 WandExport MagickWand *MagickMontageImage(MagickWand *wand,
6460 const DrawingWand *drawing_wand,const char *tile_geometry,
6461 const char *thumbnail_geometry,const MontageMode mode,const char *frame)
6475 assert(wand != (MagickWand *) NULL);
6476 assert(wand->signature == WandSignature);
6477 if (wand->debug != MagickFalse)
6478 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6479 if (wand->images == (Image *) NULL)
6480 return((MagickWand *) NULL);
6481 montage_info=CloneMontageInfo(wand->image_info,(MontageInfo *) NULL);
6486 (void) CloneString(&montage_info->frame,"15x15+3+3");
6487 montage_info->shadow=MagickTrue;
6492 montage_info->frame=(char *) NULL;
6493 montage_info->shadow=MagickFalse;
6494 montage_info->border_width=0;
6497 case ConcatenateMode:
6499 montage_info->frame=(char *) NULL;
6500 montage_info->shadow=MagickFalse;
6501 (void) CloneString(&montage_info->geometry,"+0+0");
6502 montage_info->border_width=0;
6508 font=DrawGetFont(drawing_wand);
6509 if (font != (char *) NULL)
6510 (void) CloneString(&montage_info->font,font);
6511 if (frame != (char *) NULL)
6512 (void) CloneString(&montage_info->frame,frame);
6513 montage_info->pointsize=DrawGetFontSize(drawing_wand);
6514 pixel_wand=NewPixelWand();
6515 DrawGetFillColor(drawing_wand,pixel_wand);
6516 PixelGetQuantumPacket(pixel_wand,&montage_info->fill);
6517 DrawGetStrokeColor(drawing_wand,pixel_wand);
6518 PixelGetQuantumPacket(pixel_wand,&montage_info->stroke);
6519 pixel_wand=DestroyPixelWand(pixel_wand);
6520 if (thumbnail_geometry != (char *) NULL)
6521 (void) CloneString(&montage_info->geometry,thumbnail_geometry);
6522 if (tile_geometry != (char *) NULL)
6523 (void) CloneString(&montage_info->tile,tile_geometry);
6524 montage_image=MontageImageList(wand->image_info,montage_info,wand->images,
6526 montage_info=DestroyMontageInfo(montage_info);
6527 if (montage_image == (Image *) NULL)
6528 return((MagickWand *) NULL);
6529 return(CloneMagickWandFromImages(wand,montage_image));
6533 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6537 % M a g i c k M o r p h I m a g e s %
6541 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6543 % MagickMorphImages() method morphs a set of images. Both the image pixels
6544 % and size are linearly interpolated to give the appearance of a
6545 % meta-morphosis from one image to the next.
6547 % The format of the MagickMorphImages method is:
6549 % MagickWand *MagickMorphImages(MagickWand *wand,
6550 % const size_t number_frames)
6552 % A description of each parameter follows:
6554 % o wand: the magick wand.
6556 % o number_frames: the number of in-between images to generate.
6559 WandExport MagickWand *MagickMorphImages(MagickWand *wand,
6560 const size_t number_frames)
6565 assert(wand != (MagickWand *) NULL);
6566 assert(wand->signature == WandSignature);
6567 if (wand->debug != MagickFalse)
6568 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6569 if (wand->images == (Image *) NULL)
6570 return((MagickWand *) NULL);
6571 morph_image=MorphImages(wand->images,number_frames,wand->exception);
6572 if (morph_image == (Image *) NULL)
6573 return((MagickWand *) NULL);
6574 return(CloneMagickWandFromImages(wand,morph_image));
6578 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6582 % M a g i c k M o r p h o l o g y I m a g e %
6586 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6588 % MagickMorphologyImage() applies a user supplied kernel to the image
6589 % according to the given mophology method.
6591 % The format of the MagickMorphologyImage method is:
6593 % MagickBooleanType MagickMorphologyImage(MagickWand *wand,
6594 % MorphologyMethod method,const ssize_t iterations,KernelInfo *kernel)
6596 % A description of each parameter follows:
6598 % o wand: the magick wand.
6600 % o method: the morphology method to be applied.
6602 % o iterations: apply the operation this many times (or no change).
6603 % A value of -1 means loop until no change found. How this is applied
6604 % may depend on the morphology method. Typically this is a value of 1.
6606 % o kernel: An array of doubles representing the morphology kernel.
6609 WandExport MagickBooleanType MagickMorphologyImage(MagickWand *wand,
6610 MorphologyMethod method,const ssize_t iterations,KernelInfo *kernel)
6615 assert(wand != (MagickWand *) NULL);
6616 assert(wand->signature == WandSignature);
6617 if (wand->debug != MagickFalse)
6618 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6619 if (kernel == (const KernelInfo *) NULL)
6620 return(MagickFalse);
6621 if (wand->images == (Image *) NULL)
6622 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6623 morphology_image=MorphologyImage(wand->images,method,iterations,kernel,
6625 if (morphology_image == (Image *) NULL)
6626 return(MagickFalse);
6627 ReplaceImageInList(&wand->images,morphology_image);
6632 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6636 % M a g i c k M o t i o n B l u r I m a g e %
6640 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6642 % MagickMotionBlurImage() simulates motion blur. We convolve the image with a
6643 % Gaussian operator of the given radius and standard deviation (sigma).
6644 % For reasonable results, radius should be larger than sigma. Use a
6645 % radius of 0 and MotionBlurImage() selects a suitable radius for you.
6646 % Angle gives the angle of the blurring motion.
6648 % The format of the MagickMotionBlurImage method is:
6650 % MagickBooleanType MagickMotionBlurImage(MagickWand *wand,
6651 % const double radius,const double sigma,const double angle,
6652 % const double bias)
6654 % A description of each parameter follows:
6656 % o wand: the magick wand.
6658 % o radius: the radius of the Gaussian, in pixels, not counting
6661 % o sigma: the standard deviation of the Gaussian, in pixels.
6663 % o angle: Apply the effect along this angle.
6666 WandExport MagickBooleanType MagickMotionBlurImage(MagickWand *wand,
6667 const double radius,const double sigma,const double angle,const double bias)
6672 assert(wand != (MagickWand *) NULL);
6673 assert(wand->signature == WandSignature);
6674 if (wand->debug != MagickFalse)
6675 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6676 if (wand->images == (Image *) NULL)
6677 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6678 blur_image=MotionBlurImage(wand->images,radius,sigma,angle,bias,
6680 if (blur_image == (Image *) NULL)
6681 return(MagickFalse);
6682 ReplaceImageInList(&wand->images,blur_image);
6687 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6691 % M a g i c k N e g a t e I m a g e %
6695 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6697 % MagickNegateImage() negates the colors in the reference image. The
6698 % Grayscale option means that only grayscale values within the image are
6701 % You can also reduce the influence of a particular channel with a gamma
6704 % The format of the MagickNegateImage method is:
6706 % MagickBooleanType MagickNegateImage(MagickWand *wand,
6707 % const MagickBooleanType gray)
6709 % A description of each parameter follows:
6711 % o wand: the magick wand.
6713 % o gray: If MagickTrue, only negate grayscale pixels within the image.
6716 WandExport MagickBooleanType MagickNegateImage(MagickWand *wand,
6717 const MagickBooleanType gray)
6722 assert(wand != (MagickWand *) NULL);
6723 assert(wand->signature == WandSignature);
6724 if (wand->debug != MagickFalse)
6725 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6726 if (wand->images == (Image *) NULL)
6727 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6728 status=NegateImage(wand->images,gray,wand->exception);
6733 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6737 % M a g i c k N e w I m a g e %
6741 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6743 % MagickNewImage() adds a blank image canvas of the specified size and
6744 % background color to the wand.
6746 % The format of the MagickNewImage method is:
6748 % MagickBooleanType MagickNewImage(MagickWand *wand,
6749 % const size_t columns,const size_t rows,
6750 % const PixelWand *background)
6752 % A description of each parameter follows:
6754 % o wand: the magick wand.
6756 % o width: the image width.
6758 % o height: the image height.
6760 % o background: the image color.
6763 WandExport MagickBooleanType MagickNewImage(MagickWand *wand,const size_t width,
6764 const size_t height,const PixelWand *background)
6772 assert(wand != (MagickWand *) NULL);
6773 assert(wand->signature == WandSignature);
6774 if (wand->debug != MagickFalse)
6775 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6776 PixelGetMagickColor(background,&pixel);
6777 images=NewMagickImage(wand->image_info,width,height,&pixel,wand->exception);
6778 if (images == (Image *) NULL)
6779 return(MagickFalse);
6780 return(InsertImageInWand(wand,images));
6784 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6788 % M a g i c k N e x t I m a g e %
6792 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6794 % MagickNextImage() associates the next image in the image list with a magick
6795 % wand. It returns true if the it succeeds, meaning the current image is the
6796 % next image to be iterated over.
6798 % The format of the MagickNextImage method is:
6800 % MagickBooleanType MagickNextImage(MagickWand *wand)
6802 % A description of each parameter follows:
6804 % o wand: the magick wand.
6807 WandExport MagickBooleanType MagickNextImage(MagickWand *wand)
6809 assert(wand != (MagickWand *) NULL);
6810 assert(wand->signature == WandSignature);
6811 if (wand->debug != MagickFalse)
6812 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6813 if (wand->images == (Image *) NULL)
6814 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6815 /* If current image is 'pending' just return true. */
6816 if (wand->image_pending != MagickFalse)
6818 wand->image_pending=MagickFalse;
6821 /* If there is no next image, (Iterator is finished) */
6822 if (GetNextImageInList(wand->images) == (Image *) NULL)
6823 return(MagickFalse);
6824 /* just move to next image - current image is not 'pending' */
6825 wand->images=GetNextImageInList(wand->images);
6830 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6834 % M a g i c k N o r m a l i z e I m a g e %
6838 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6840 % MagickNormalizeImage() enhances the contrast of a color image by adjusting
6841 % the pixels color to span the entire range of colors available
6843 % You can also reduce the influence of a particular channel with a gamma
6846 % The format of the MagickNormalizeImage method is:
6848 % MagickBooleanType MagickNormalizeImage(MagickWand *wand)
6850 % A description of each parameter follows:
6852 % o wand: the magick wand.
6855 WandExport MagickBooleanType MagickNormalizeImage(MagickWand *wand)
6860 assert(wand != (MagickWand *) NULL);
6861 assert(wand->signature == WandSignature);
6862 if (wand->debug != MagickFalse)
6863 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6864 if (wand->images == (Image *) NULL)
6865 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6866 status=NormalizeImage(wand->images,wand->exception);
6871 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6875 % M a g i c k O i l P a i n t I m a g e %
6879 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6881 % MagickOilPaintImage() applies a special effect filter that simulates an oil
6882 % painting. Each pixel is replaced by the most frequent color occurring
6883 % in a circular region defined by radius.
6885 % The format of the MagickOilPaintImage method is:
6887 % MagickBooleanType MagickOilPaintImage(MagickWand *wand,
6888 % const double radius,const double sigma)
6890 % A description of each parameter follows:
6892 % o wand: the magick wand.
6894 % o radius: the radius of the circular neighborhood.
6896 % o sigma: the standard deviation of the Gaussian, in pixels.
6899 WandExport MagickBooleanType MagickOilPaintImage(MagickWand *wand,
6900 const double radius,const double sigma)
6905 assert(wand != (MagickWand *) NULL);
6906 assert(wand->signature == WandSignature);
6907 if (wand->debug != MagickFalse)
6908 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6909 if (wand->images == (Image *) NULL)
6910 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6911 paint_image=OilPaintImage(wand->images,radius,sigma,wand->exception);
6912 if (paint_image == (Image *) NULL)
6913 return(MagickFalse);
6914 ReplaceImageInList(&wand->images,paint_image);
6919 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6923 % M a g i c k O p a q u e P a i n t I m a g e %
6927 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6929 % MagickOpaquePaintImage() changes any pixel that matches color with the color
6932 % The format of the MagickOpaquePaintImage method is:
6934 % MagickBooleanType MagickOpaquePaintImage(MagickWand *wand,
6935 % const PixelWand *target,const PixelWand *fill,const double fuzz,
6936 % const MagickBooleanType invert)
6938 % A description of each parameter follows:
6940 % o wand: the magick wand.
6942 % o target: Change this target color to the fill color within the image.
6944 % o fill: the fill pixel wand.
6946 % o fuzz: By default target must match a particular pixel color
6947 % exactly. However, in many cases two colors may differ by a small amount.
6948 % The fuzz member of image defines how much tolerance is acceptable to
6949 % consider two colors as the same. For example, set fuzz to 10 and the
6950 % color red at intensities of 100 and 102 respectively are now interpreted
6951 % as the same color for the purposes of the floodfill.
6953 % o invert: paint any pixel that does not match the target color.
6956 WandExport MagickBooleanType MagickOpaquePaintImage(MagickWand *wand,
6957 const PixelWand *target,const PixelWand *fill,const double fuzz,
6958 const MagickBooleanType invert)
6967 assert(wand != (MagickWand *) NULL);
6968 assert(wand->signature == WandSignature);
6969 if (wand->debug != MagickFalse)
6970 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6971 if (wand->images == (Image *) NULL)
6972 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6973 PixelGetMagickColor(target,&target_pixel);
6974 PixelGetMagickColor(fill,&fill_pixel);
6975 wand->images->fuzz=fuzz;
6976 status=OpaquePaintImage(wand->images,&target_pixel,&fill_pixel,invert,
6982 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6986 % M a g i c k O p t i m i z e I m a g e L a y e r s %
6990 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6992 % MagickOptimizeImageLayers() compares each image the GIF disposed forms of the
6993 % previous image in the sequence. From this it attempts to select the
6994 % smallest cropped image to replace each frame, while preserving the results
6997 % The format of the MagickOptimizeImageLayers method is:
6999 % MagickWand *MagickOptimizeImageLayers(MagickWand *wand)
7001 % A description of each parameter follows:
7003 % o wand: the magick wand.
7006 WandExport MagickWand *MagickOptimizeImageLayers(MagickWand *wand)
7011 assert(wand != (MagickWand *) NULL);
7012 assert(wand->signature == WandSignature);
7013 if (wand->debug != MagickFalse)
7014 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7015 if (wand->images == (Image *) NULL)
7016 return((MagickWand *) NULL);
7017 optimize_image=OptimizeImageLayers(wand->images,wand->exception);
7018 if (optimize_image == (Image *) NULL)
7019 return((MagickWand *) NULL);
7020 return(CloneMagickWandFromImages(wand,optimize_image));
7024 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7028 % M a g i c k O r d e r e d P o s t e r i z e I m a g e %
7032 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7034 % MagickOrderedPosterizeImage() performs an ordered dither based on a number
7035 % of pre-defined dithering threshold maps, but over multiple intensity levels,
7036 % which can be different for different channels, according to the input
7039 % The format of the MagickOrderedPosterizeImage method is:
7041 % MagickBooleanType MagickOrderedPosterizeImage(MagickWand *wand,
7042 % const char *threshold_map)
7044 % A description of each parameter follows:
7046 % o image: the image.
7048 % o threshold_map: A string containing the name of the threshold dither
7049 % map to use, followed by zero or more numbers representing the number of
7050 % color levels tho dither between.
7052 % Any level number less than 2 is equivalent to 2, and means only binary
7053 % dithering will be applied to each color channel.
7055 % No numbers also means a 2 level (bitmap) dither will be applied to all
7056 % channels, while a single number is the number of levels applied to each
7057 % channel in sequence. More numbers will be applied in turn to each of
7058 % the color channels.
7060 % For example: "o3x3,6" generates a 6 level posterization of the image
7061 % with a ordered 3x3 diffused pixel dither being applied between each
7062 % level. While checker,8,8,4 will produce a 332 colormaped image with
7063 % only a single checkerboard hash pattern (50% grey) between each color
7064 % level, to basically double the number of color levels with a bare
7065 % minimim of dithering.
7068 WandExport MagickBooleanType MagickOrderedPosterizeImage(MagickWand *wand,
7069 const char *threshold_map)
7074 assert(wand != (MagickWand *) NULL);
7075 assert(wand->signature == WandSignature);
7076 if (wand->debug != MagickFalse)
7077 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7078 if (wand->images == (Image *) NULL)
7079 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7080 status=OrderedPosterizeImage(wand->images,threshold_map,wand->exception);
7085 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7089 % M a g i c k P i n g I m a g e %
7093 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7095 % MagickPingImage() is the same as MagickReadImage() except the only valid
7096 % information returned is the image width, height, size, and format. It
7097 % is designed to efficiently obtain this information from a file without
7098 % reading the entire image sequence into memory.
7100 % The format of the MagickPingImage method is:
7102 % MagickBooleanType MagickPingImage(MagickWand *wand,const char *filename)
7104 % A description of each parameter follows:
7106 % o wand: the magick wand.
7108 % o filename: the image filename.
7111 WandExport MagickBooleanType MagickPingImage(MagickWand *wand,
7112 const char *filename)
7120 assert(wand != (MagickWand *) NULL);
7121 assert(wand->signature == WandSignature);
7122 if (wand->debug != MagickFalse)
7123 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7124 ping_info=CloneImageInfo(wand->image_info);
7125 if (filename != (const char *) NULL)
7126 (void) CopyMagickString(ping_info->filename,filename,MaxTextExtent);
7127 images=PingImage(ping_info,wand->exception);
7128 ping_info=DestroyImageInfo(ping_info);
7129 if (images == (Image *) NULL)
7130 return(MagickFalse);
7131 return(InsertImageInWand(wand,images));
7135 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7139 % M a g i c k P i n g I m a g e B l o b %
7143 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7145 % MagickPingImageBlob() pings an image or image sequence from a blob.
7147 % The format of the MagickPingImageBlob method is:
7149 % MagickBooleanType MagickPingImageBlob(MagickWand *wand,
7150 % const void *blob,const size_t length)
7152 % A description of each parameter follows:
7154 % o wand: the magick wand.
7158 % o length: the blob length.
7161 WandExport MagickBooleanType MagickPingImageBlob(MagickWand *wand,
7162 const void *blob,const size_t length)
7170 assert(wand != (MagickWand *) NULL);
7171 assert(wand->signature == WandSignature);
7172 if (wand->debug != MagickFalse)
7173 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7174 read_info=CloneImageInfo(wand->image_info);
7175 SetImageInfoBlob(read_info,blob,length);
7176 images=PingImage(read_info,wand->exception);
7177 read_info=DestroyImageInfo(read_info);
7178 if (images == (Image *) NULL)
7179 return(MagickFalse);
7180 return(InsertImageInWand(wand,images));
7184 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7188 % M a g i c k P i n g I m a g e F i l e %
7192 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7194 % MagickPingImageFile() pings an image or image sequence from an open file
7197 % The format of the MagickPingImageFile method is:
7199 % MagickBooleanType MagickPingImageFile(MagickWand *wand,FILE *file)
7201 % A description of each parameter follows:
7203 % o wand: the magick wand.
7205 % o file: the file descriptor.
7208 WandExport MagickBooleanType MagickPingImageFile(MagickWand *wand,FILE *file)
7216 assert(wand != (MagickWand *) NULL);
7217 assert(wand->signature == WandSignature);
7218 assert(file != (FILE *) NULL);
7219 if (wand->debug != MagickFalse)
7220 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7221 read_info=CloneImageInfo(wand->image_info);
7222 SetImageInfoFile(read_info,file);
7223 images=PingImage(read_info,wand->exception);
7224 read_info=DestroyImageInfo(read_info);
7225 if (images == (Image *) NULL)
7226 return(MagickFalse);
7227 return(InsertImageInWand(wand,images));
7231 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7235 % M a g i c k P o l a r o i d I m a g e %
7239 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7241 % MagickPolaroidImage() simulates a Polaroid picture.
7243 % The format of the MagickPolaroidImage method is:
7245 % MagickBooleanType MagickPolaroidImage(MagickWand *wand,
7246 % const DrawingWand *drawing_wand,const char *caption,const double angle,
7247 % const PixelInterpolateMethod method)
7249 % A description of each parameter follows:
7251 % o wand: the magick wand.
7253 % o drawing_wand: the draw wand.
7255 % o caption: the Polaroid caption.
7257 % o angle: Apply the effect along this angle.
7259 % o method: the pixel interpolation method.
7262 WandExport MagickBooleanType MagickPolaroidImage(MagickWand *wand,
7263 const DrawingWand *drawing_wand,const char *caption,const double angle,
7264 const PixelInterpolateMethod method)
7272 assert(wand != (MagickWand *) NULL);
7273 assert(wand->signature == WandSignature);
7274 if (wand->debug != MagickFalse)
7275 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7276 if (wand->images == (Image *) NULL)
7277 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7278 draw_info=PeekDrawingWand(drawing_wand);
7279 if (draw_info == (DrawInfo *) NULL)
7280 return(MagickFalse);
7281 polaroid_image=PolaroidImage(wand->images,draw_info,caption,angle,method,
7283 if (polaroid_image == (Image *) NULL)
7284 return(MagickFalse);
7285 ReplaceImageInList(&wand->images,polaroid_image);
7290 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7294 % M a g i c k P o s t e r i z e I m a g e %
7298 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7300 % MagickPosterizeImage() reduces the image to a limited number of color level.
7302 % The format of the MagickPosterizeImage method is:
7304 % MagickBooleanType MagickPosterizeImage(MagickWand *wand,
7305 % const unsigned levels,const MagickBooleanType dither)
7307 % A description of each parameter follows:
7309 % o wand: the magick wand.
7311 % o levels: Number of color levels allowed in each channel. Very low values
7312 % (2, 3, or 4) have the most visible effect.
7314 % o dither: Set this integer value to something other than zero to dither
7318 WandExport MagickBooleanType MagickPosterizeImage(MagickWand *wand,
7319 const size_t levels,const MagickBooleanType dither)
7324 assert(wand != (MagickWand *) NULL);
7325 assert(wand->signature == WandSignature);
7326 if (wand->debug != MagickFalse)
7327 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7328 if (wand->images == (Image *) NULL)
7329 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7330 status=PosterizeImage(wand->images,levels,dither,wand->exception);
7335 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7339 % M a g i c k P r e v i e w I m a g e s %
7343 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7345 % MagickPreviewImages() tiles 9 thumbnails of the specified image with an
7346 % image processing operation applied at varying strengths. This helpful
7347 % to quickly pin-point an appropriate parameter for an image processing
7350 % The format of the MagickPreviewImages method is:
7352 % MagickWand *MagickPreviewImages(MagickWand *wand,
7353 % const PreviewType preview)
7355 % A description of each parameter follows:
7357 % o wand: the magick wand.
7359 % o preview: the preview type.
7362 WandExport MagickWand *MagickPreviewImages(MagickWand *wand,
7363 const PreviewType preview)
7368 assert(wand != (MagickWand *) NULL);
7369 assert(wand->signature == WandSignature);
7370 if (wand->debug != MagickFalse)
7371 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7372 if (wand->images == (Image *) NULL)
7373 return((MagickWand *) NULL);
7374 preview_image=PreviewImage(wand->images,preview,wand->exception);
7375 if (preview_image == (Image *) NULL)
7376 return((MagickWand *) NULL);
7377 return(CloneMagickWandFromImages(wand,preview_image));
7381 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7385 % M a g i c k P r e v i o u s I m a g e %
7389 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7391 % MagickPreviousImage() assocates the previous image in an image list with
7394 % The format of the MagickPreviousImage method is:
7396 % MagickBooleanType MagickPreviousImage(MagickWand *wand)
7398 % A description of each parameter follows:
7400 % o wand: the magick wand.
7403 WandExport MagickBooleanType MagickPreviousImage(MagickWand *wand)
7405 assert(wand != (MagickWand *) NULL);
7406 assert(wand->signature == WandSignature);
7407 if (wand->debug != MagickFalse)
7408 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7409 if (wand->images == (Image *) NULL)
7410 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7412 wand->image_pending=MagickFalse; /* pending status has no meaning */
7413 /* If there is no prev image, return false (Iterator is finished) */
7414 if (GetPreviousImageInList(wand->images) == (Image *) NULL)
7415 return(MagickFalse);
7416 /* just do it - current image is not 'pending' */
7417 wand->images=GetPreviousImageInList(wand->images);
7422 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7426 % M a g i c k Q u a n t i z e I m a g e %
7430 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7432 % MagickQuantizeImage() analyzes the colors within a reference image and
7433 % chooses a fixed number of colors to represent the image. The goal of the
7434 % algorithm is to minimize the color difference between the input and output
7435 % image while minimizing the processing time.
7437 % The format of the MagickQuantizeImage method is:
7439 % MagickBooleanType MagickQuantizeImage(MagickWand *wand,
7440 % const size_t number_colors,const ColorspaceType colorspace,
7441 % const size_t treedepth,const MagickBooleanType dither,
7442 % const MagickBooleanType measure_error)
7444 % A description of each parameter follows:
7446 % o wand: the magick wand.
7448 % o number_colors: the number of colors.
7450 % o colorspace: Perform color reduction in this colorspace, typically
7453 % o treedepth: Normally, this integer value is zero or one. A zero or
7454 % one tells Quantize to choose a optimal tree depth of Log4(number_colors).% A tree of this depth generally allows the best representation of the
7455 % reference image with the least amount of memory and the fastest
7456 % computational speed. In some cases, such as an image with low color
7457 % dispersion (a few number of colors), a value other than
7458 % Log4(number_colors) is required. To expand the color tree completely,
7461 % o dither: A value other than zero distributes the difference between an
7462 % original image and the corresponding color reduced image to
7463 % neighboring pixels along a Hilbert curve.
7465 % o measure_error: A value other than zero measures the difference between
7466 % the original and quantized images. This difference is the total
7467 % quantization error. The error is computed by summing over all pixels
7468 % in an image the distance squared in RGB space between each reference
7469 % pixel value and its quantized value.
7472 WandExport MagickBooleanType MagickQuantizeImage(MagickWand *wand,
7473 const size_t number_colors,const ColorspaceType colorspace,
7474 const size_t treedepth,const MagickBooleanType dither,
7475 const MagickBooleanType measure_error)
7483 assert(wand != (MagickWand *) NULL);
7484 assert(wand->signature == WandSignature);
7485 if (wand->debug != MagickFalse)
7486 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7487 if (wand->images == (Image *) NULL)
7488 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7489 quantize_info=CloneQuantizeInfo((QuantizeInfo *) NULL);
7490 quantize_info->number_colors=number_colors;
7491 quantize_info->dither=dither;
7492 quantize_info->tree_depth=treedepth;
7493 quantize_info->colorspace=colorspace;
7494 quantize_info->measure_error=measure_error;
7495 status=QuantizeImage(quantize_info,wand->images,wand->exception);
7496 quantize_info=DestroyQuantizeInfo(quantize_info);
7501 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7505 % M a g i c k Q u a n t i z e I m a g e s %
7509 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7511 % MagickQuantizeImages() analyzes the colors within a sequence of images and
7512 % chooses a fixed number of colors to represent the image. The goal of the
7513 % algorithm is to minimize the color difference between the input and output
7514 % image while minimizing the processing time.
7516 % The format of the MagickQuantizeImages method is:
7518 % MagickBooleanType MagickQuantizeImages(MagickWand *wand,
7519 % const size_t number_colors,const ColorspaceType colorspace,
7520 % const size_t treedepth,const MagickBooleanType dither,
7521 % const MagickBooleanType measure_error)
7523 % A description of each parameter follows:
7525 % o wand: the magick wand.
7527 % o number_colors: the number of colors.
7529 % o colorspace: Perform color reduction in this colorspace, typically
7532 % o treedepth: Normally, this integer value is zero or one. A zero or
7533 % one tells Quantize to choose a optimal tree depth of Log4(number_colors).% A tree of this depth generally allows the best representation of the
7534 % reference image with the least amount of memory and the fastest
7535 % computational speed. In some cases, such as an image with low color
7536 % dispersion (a few number of colors), a value other than
7537 % Log4(number_colors) is required. To expand the color tree completely,
7540 % o dither: A value other than zero distributes the difference between an
7541 % original image and the corresponding color reduced algorithm to
7542 % neighboring pixels along a Hilbert curve.
7544 % o measure_error: A value other than zero measures the difference between
7545 % the original and quantized images. This difference is the total
7546 % quantization error. The error is computed by summing over all pixels
7547 % in an image the distance squared in RGB space between each reference
7548 % pixel value and its quantized value.
7551 WandExport MagickBooleanType MagickQuantizeImages(MagickWand *wand,
7552 const size_t number_colors,const ColorspaceType colorspace,
7553 const size_t treedepth,const MagickBooleanType dither,
7554 const MagickBooleanType measure_error)
7562 assert(wand != (MagickWand *) NULL);
7563 assert(wand->signature == WandSignature);
7564 if (wand->debug != MagickFalse)
7565 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7566 if (wand->images == (Image *) NULL)
7567 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7568 quantize_info=CloneQuantizeInfo((QuantizeInfo *) NULL);
7569 quantize_info->number_colors=number_colors;
7570 quantize_info->dither=dither;
7571 quantize_info->tree_depth=treedepth;
7572 quantize_info->colorspace=colorspace;
7573 quantize_info->measure_error=measure_error;
7574 status=QuantizeImages(quantize_info,wand->images,wand->exception);
7575 quantize_info=DestroyQuantizeInfo(quantize_info);
7580 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7584 % M a g i c k R a d i a l B l u r I m a g e %
7588 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7590 % MagickRadialBlurImage() radial blurs an image.
7592 % The format of the MagickRadialBlurImage method is:
7594 % MagickBooleanType MagickRadialBlurImage(MagickWand *wand,
7595 % const double angle,const double bias)
7597 % A description of each parameter follows:
7599 % o wand: the magick wand.
7601 % o angle: the angle of the blur in degrees.
7606 WandExport MagickBooleanType MagickRadialBlurImage(MagickWand *wand,
7607 const double angle,const double bias)
7612 assert(wand != (MagickWand *) NULL);
7613 assert(wand->signature == WandSignature);
7614 if (wand->debug != MagickFalse)
7615 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7616 if (wand->images == (Image *) NULL)
7617 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7618 blur_image=RadialBlurImage(wand->images,angle,bias,wand->exception);
7619 if (blur_image == (Image *) NULL)
7620 return(MagickFalse);
7621 ReplaceImageInList(&wand->images,blur_image);
7626 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7630 % M a g i c k R a i s e I m a g e %
7634 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7636 % MagickRaiseImage() creates a simulated three-dimensional button-like effect
7637 % by lightening and darkening the edges of the image. Members width and
7638 % height of raise_info define the width of the vertical and horizontal
7639 % edge of the effect.
7641 % The format of the MagickRaiseImage method is:
7643 % MagickBooleanType MagickRaiseImage(MagickWand *wand,
7644 % const size_t width,const size_t height,const ssize_t x,
7645 % const ssize_t y,const MagickBooleanType raise)
7647 % A description of each parameter follows:
7649 % o wand: the magick wand.
7651 % o width,height,x,y: Define the dimensions of the area to raise.
7653 % o raise: A value other than zero creates a 3-D raise effect,
7654 % otherwise it has a lowered effect.
7657 WandExport MagickBooleanType MagickRaiseImage(MagickWand *wand,
7658 const size_t width,const size_t height,const ssize_t x,
7659 const ssize_t y,const MagickBooleanType raise)
7667 assert(wand != (MagickWand *) NULL);
7668 assert(wand->signature == WandSignature);
7669 if (wand->debug != MagickFalse)
7670 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7671 if (wand->images == (Image *) NULL)
7672 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7673 raise_info.width=width;
7674 raise_info.height=height;
7677 status=RaiseImage(wand->images,&raise_info,raise,wand->exception);
7682 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7686 % M a g i c k R a n d o m T h r e s h o l d I m a g e %
7690 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7692 % MagickRandomThresholdImage() changes the value of individual pixels based on
7693 % the intensity of each pixel compared to threshold. The result is a
7694 % high-contrast, two color image.
7696 % The format of the MagickRandomThresholdImage method is:
7698 % MagickBooleanType MagickRandomThresholdImage(MagickWand *wand,
7699 % const double low,const double high)
7701 % A description of each parameter follows:
7703 % o wand: the magick wand.
7705 % o low,high: Specify the high and low thresholds. These values range from
7706 % 0 to QuantumRange.
7709 WandExport MagickBooleanType MagickRandomThresholdImage(MagickWand *wand,
7710 const double low,const double high)
7713 threshold[MaxTextExtent];
7715 assert(wand != (MagickWand *) NULL);
7716 assert(wand->signature == WandSignature);
7717 if (wand->debug != MagickFalse)
7718 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7719 if (wand->images == (Image *) NULL)
7720 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7721 (void) FormatLocaleString(threshold,MaxTextExtent,"%gx%g",low,high);
7722 return(RandomThresholdImage(wand->images,threshold,wand->exception));
7726 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7730 % M a g i c k R e a d I m a g e %
7734 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7736 % MagickReadImage() reads an image or image sequence. The images are inserted
7737 % at the current image pointer position.
7739 % Use MagickSetFirstIterator(), to insert new images before all the current
7740 % images in the wand, MagickSetLastIterator() to append add to the end,
7741 % MagickSetImageIndex() to place images just after the given index.
7743 % The format of the MagickReadImage method is:
7745 % MagickBooleanType MagickReadImage(MagickWand *wand,const char *filename)
7747 % A description of each parameter follows:
7749 % o wand: the magick wand.
7751 % o filename: the image filename.
7754 WandExport MagickBooleanType MagickReadImage(MagickWand *wand,
7755 const char *filename)
7763 assert(wand != (MagickWand *) NULL);
7764 assert(wand->signature == WandSignature);
7765 if (wand->debug != MagickFalse)
7766 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7767 read_info=CloneImageInfo(wand->image_info);
7768 if (filename != (const char *) NULL)
7769 (void) CopyMagickString(read_info->filename,filename,MaxTextExtent);
7770 images=ReadImage(read_info,wand->exception);
7771 read_info=DestroyImageInfo(read_info);
7772 if (images == (Image *) NULL)
7773 return(MagickFalse);
7774 return(InsertImageInWand(wand,images));
7778 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7782 % M a g i c k R e a d I m a g e B l o b %
7786 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7788 % MagickReadImageBlob() reads an image or image sequence from a blob.
7789 % In all other respects it is like MagickReadImage().
7791 % The format of the MagickReadImageBlob method is:
7793 % MagickBooleanType MagickReadImageBlob(MagickWand *wand,
7794 % const void *blob,const size_t length)
7796 % A description of each parameter follows:
7798 % o wand: the magick wand.
7802 % o length: the blob length.
7805 WandExport MagickBooleanType MagickReadImageBlob(MagickWand *wand,
7806 const void *blob,const size_t length)
7811 assert(wand != (MagickWand *) NULL);
7812 assert(wand->signature == WandSignature);
7813 if (wand->debug != MagickFalse)
7814 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7815 images=BlobToImage(wand->image_info,blob,length,wand->exception);
7816 if (images == (Image *) NULL)
7817 return(MagickFalse);
7818 return(InsertImageInWand(wand,images));
7822 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7826 % M a g i c k R e a d I m a g e F i l e %
7830 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7832 % MagickReadImageFile() reads an image or image sequence from an already
7833 % opened file descriptor. Otherwise it is like MagickReadImage().
7835 % The format of the MagickReadImageFile method is:
7837 % MagickBooleanType MagickReadImageFile(MagickWand *wand,FILE *file)
7839 % A description of each parameter follows:
7841 % o wand: the magick wand.
7843 % o file: the file descriptor.
7846 WandExport MagickBooleanType MagickReadImageFile(MagickWand *wand,FILE *file)
7854 assert(wand != (MagickWand *) NULL);
7855 assert(wand->signature == WandSignature);
7856 assert(file != (FILE *) NULL);
7857 if (wand->debug != MagickFalse)
7858 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7859 read_info=CloneImageInfo(wand->image_info);
7860 SetImageInfoFile(read_info,file);
7861 images=ReadImage(read_info,wand->exception);
7862 read_info=DestroyImageInfo(read_info);
7863 if (images == (Image *) NULL)
7864 return(MagickFalse);
7865 return(InsertImageInWand(wand,images));
7869 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7873 % M a g i c k R e m a p I m a g e %
7877 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7879 % MagickRemapImage() replaces the colors of an image with the closest color
7880 % from a reference image.
7882 % The format of the MagickRemapImage method is:
7884 % MagickBooleanType MagickRemapImage(MagickWand *wand,
7885 % const MagickWand *remap_wand,const DitherMethod method)
7887 % A description of each parameter follows:
7889 % o wand: the magick wand.
7891 % o affinity: the affinity wand.
7893 % o method: choose from these dither methods: NoDitherMethod,
7894 % RiemersmaDitherMethod, or FloydSteinbergDitherMethod.
7897 WandExport MagickBooleanType MagickRemapImage(MagickWand *wand,
7898 const MagickWand *remap_wand,const DitherMethod method)
7906 assert(wand != (MagickWand *) NULL);
7907 assert(wand->signature == WandSignature);
7908 if (wand->debug != MagickFalse)
7909 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7910 if ((wand->images == (Image *) NULL) ||
7911 (remap_wand->images == (Image *) NULL))
7912 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7913 quantize_info=AcquireQuantizeInfo(wand->image_info);
7914 quantize_info->dither_method=method;
7915 if (method == NoDitherMethod)
7916 quantize_info->dither=MagickFalse;
7917 status=RemapImage(quantize_info,wand->images,remap_wand->images,
7919 quantize_info=DestroyQuantizeInfo(quantize_info);
7924 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7928 % M a g i c k R e m o v e I m a g e %
7932 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7934 % MagickRemoveImage() removes an image from the image list.
7936 % The format of the MagickRemoveImage method is:
7938 % MagickBooleanType MagickRemoveImage(MagickWand *wand)
7940 % A description of each parameter follows:
7942 % o wand: the magick wand.
7944 % o insert: the splice wand.
7947 WandExport MagickBooleanType MagickRemoveImage(MagickWand *wand)
7949 assert(wand != (MagickWand *) NULL);
7950 assert(wand->signature == WandSignature);
7951 if (wand->debug != MagickFalse)
7952 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7953 if (wand->images == (Image *) NULL)
7954 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7955 DeleteImageFromList(&wand->images);
7960 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7964 % M a g i c k R e s a m p l e I m a g e %
7968 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7970 % MagickResampleImage() resample image to desired resolution.
7972 % Bessel Blackman Box
7973 % Catrom Cubic Gaussian
7974 % Hanning Hermite Lanczos
7975 % Mitchell Point Quandratic
7978 % Most of the filters are FIR (finite impulse response), however, Bessel,
7979 % Gaussian, and Sinc are IIR (infinite impulse response). Bessel and Sinc
7980 % are windowed (brought down to zero) with the Blackman filter.
7982 % The format of the MagickResampleImage method is:
7984 % MagickBooleanType MagickResampleImage(MagickWand *wand,
7985 % const double x_resolution,const double y_resolution,
7986 % const FilterTypes filter,const double blur)
7988 % A description of each parameter follows:
7990 % o wand: the magick wand.
7992 % o x_resolution: the new image x resolution.
7994 % o y_resolution: the new image y resolution.
7996 % o filter: Image filter to use.
7998 % o blur: the blur factor where > 1 is blurry, < 1 is sharp.
8001 WandExport MagickBooleanType MagickResampleImage(MagickWand *wand,
8002 const double x_resolution,const double y_resolution,const FilterTypes filter,
8008 assert(wand != (MagickWand *) NULL);
8009 assert(wand->signature == WandSignature);
8010 if (wand->debug != MagickFalse)
8011 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8012 if (wand->images == (Image *) NULL)
8013 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8014 resample_image=ResampleImage(wand->images,x_resolution,y_resolution,filter,
8015 blur,wand->exception);
8016 if (resample_image == (Image *) NULL)
8017 return(MagickFalse);
8018 ReplaceImageInList(&wand->images,resample_image);
8023 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8027 % M a g i c k R e s e t I m a g e P a g e %
8031 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8033 % MagickResetImagePage() resets the Wand page canvas and position.
8035 % The format of the MagickResetImagePage method is:
8037 % MagickBooleanType MagickResetImagePage(MagickWand *wand,
8040 % A description of each parameter follows:
8042 % o wand: the magick wand.
8044 % o page: the relative page specification.
8047 WandExport MagickBooleanType MagickResetImagePage(MagickWand *wand,
8050 assert(wand != (MagickWand *) NULL);
8051 assert(wand->signature == WandSignature);
8052 if (wand->debug != MagickFalse)
8053 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8054 if (wand->images == (Image *) NULL)
8055 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8056 if ((page == (char *) NULL) || (*page == '\0'))
8058 (void) ParseAbsoluteGeometry("0x0+0+0",&wand->images->page);
8061 return(ResetImagePage(wand->images,page));
8065 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8069 % M a g i c k R e s i z e I m a g e %
8073 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8075 % MagickResizeImage() scales an image to the desired dimensions with one of
8078 % Bessel Blackman Box
8079 % Catrom Cubic Gaussian
8080 % Hanning Hermite Lanczos
8081 % Mitchell Point Quandratic
8084 % Most of the filters are FIR (finite impulse response), however, Bessel,
8085 % Gaussian, and Sinc are IIR (infinite impulse response). Bessel and Sinc
8086 % are windowed (brought down to zero) with the Blackman filter.
8088 % The format of the MagickResizeImage method is:
8090 % MagickBooleanType MagickResizeImage(MagickWand *wand,
8091 % const size_t columns,const size_t rows,
8092 % const FilterTypes filter,const double blur)
8094 % A description of each parameter follows:
8096 % o wand: the magick wand.
8098 % o columns: the number of columns in the scaled image.
8100 % o rows: the number of rows in the scaled image.
8102 % o filter: Image filter to use.
8104 % o blur: the blur factor where > 1 is blurry, < 1 is sharp.
8107 WandExport MagickBooleanType MagickResizeImage(MagickWand *wand,
8108 const size_t columns,const size_t rows,const FilterTypes filter,
8114 assert(wand != (MagickWand *) NULL);
8115 assert(wand->signature == WandSignature);
8116 if (wand->debug != MagickFalse)
8117 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8118 if (wand->images == (Image *) NULL)
8119 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8120 resize_image=ResizeImage(wand->images,columns,rows,filter,blur,
8122 if (resize_image == (Image *) NULL)
8123 return(MagickFalse);
8124 ReplaceImageInList(&wand->images,resize_image);
8129 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8133 % M a g i c k R o l l I m a g e %
8137 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8139 % MagickRollImage() offsets an image as defined by x and y.
8141 % The format of the MagickRollImage method is:
8143 % MagickBooleanType MagickRollImage(MagickWand *wand,const ssize_t x,
8146 % A description of each parameter follows:
8148 % o wand: the magick wand.
8150 % o x: the x offset.
8152 % o y: the y offset.
8156 WandExport MagickBooleanType MagickRollImage(MagickWand *wand,
8157 const ssize_t x,const ssize_t y)
8162 assert(wand != (MagickWand *) NULL);
8163 assert(wand->signature == WandSignature);
8164 if (wand->debug != MagickFalse)
8165 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8166 if (wand->images == (Image *) NULL)
8167 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8168 roll_image=RollImage(wand->images,x,y,wand->exception);
8169 if (roll_image == (Image *) NULL)
8170 return(MagickFalse);
8171 ReplaceImageInList(&wand->images,roll_image);
8176 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8180 % M a g i c k R o t a t e I m a g e %
8184 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8186 % MagickRotateImage() rotates an image the specified number of degrees. Empty
8187 % triangles left over from rotating the image are filled with the
8190 % The format of the MagickRotateImage method is:
8192 % MagickBooleanType MagickRotateImage(MagickWand *wand,
8193 % const PixelWand *background,const double degrees)
8195 % A description of each parameter follows:
8197 % o wand: the magick wand.
8199 % o background: the background pixel wand.
8201 % o degrees: the number of degrees to rotate the image.
8205 WandExport MagickBooleanType MagickRotateImage(MagickWand *wand,
8206 const PixelWand *background,const double degrees)
8211 assert(wand != (MagickWand *) NULL);
8212 assert(wand->signature == WandSignature);
8213 if (wand->debug != MagickFalse)
8214 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8215 if (wand->images == (Image *) NULL)
8216 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8217 PixelGetQuantumPacket(background,&wand->images->background_color);
8218 rotate_image=RotateImage(wand->images,degrees,wand->exception);
8219 if (rotate_image == (Image *) NULL)
8220 return(MagickFalse);
8221 ReplaceImageInList(&wand->images,rotate_image);
8226 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8230 % M a g i c k S a m p l e I m a g e %
8234 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8236 % MagickSampleImage() scales an image to the desired dimensions with pixel
8237 % sampling. Unlike other scaling methods, this method does not introduce
8238 % any additional color into the scaled image.
8240 % The format of the MagickSampleImage method is:
8242 % MagickBooleanType MagickSampleImage(MagickWand *wand,
8243 % const size_t columns,const size_t rows)
8245 % A description of each parameter follows:
8247 % o wand: the magick wand.
8249 % o columns: the number of columns in the scaled image.
8251 % o rows: the number of rows in the scaled image.
8255 WandExport MagickBooleanType MagickSampleImage(MagickWand *wand,
8256 const size_t columns,const size_t rows)
8261 assert(wand != (MagickWand *) NULL);
8262 assert(wand->signature == WandSignature);
8263 if (wand->debug != MagickFalse)
8264 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8265 if (wand->images == (Image *) NULL)
8266 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8267 sample_image=SampleImage(wand->images,columns,rows,wand->exception);
8268 if (sample_image == (Image *) NULL)
8269 return(MagickFalse);
8270 ReplaceImageInList(&wand->images,sample_image);
8275 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8279 % M a g i c k S c a l e I m a g e %
8283 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8285 % MagickScaleImage() scales the size of an image to the given dimensions.
8287 % The format of the MagickScaleImage method is:
8289 % MagickBooleanType MagickScaleImage(MagickWand *wand,
8290 % const size_t columns,const size_t rows)
8292 % A description of each parameter follows:
8294 % o wand: the magick wand.
8296 % o columns: the number of columns in the scaled image.
8298 % o rows: the number of rows in the scaled image.
8302 WandExport MagickBooleanType MagickScaleImage(MagickWand *wand,
8303 const size_t columns,const size_t rows)
8308 assert(wand != (MagickWand *) NULL);
8309 assert(wand->signature == WandSignature);
8310 if (wand->debug != MagickFalse)
8311 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8312 if (wand->images == (Image *) NULL)
8313 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8314 scale_image=ScaleImage(wand->images,columns,rows,wand->exception);
8315 if (scale_image == (Image *) NULL)
8316 return(MagickFalse);
8317 ReplaceImageInList(&wand->images,scale_image);
8322 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8326 % M a g i c k S e g m e n t I m a g e %
8330 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8332 % MagickSegmentImage() segments an image by analyzing the histograms of the
8333 % color components and identifying units that are homogeneous with the fuzzy
8334 % C-means technique.
8336 % The format of the SegmentImage method is:
8338 % MagickBooleanType MagickSegmentImage(MagickWand *wand,
8339 % const ColorspaceType colorspace,const MagickBooleanType verbose,
8340 % const double cluster_threshold,const double smooth_threshold)
8342 % A description of each parameter follows.
8346 % o colorspace: the image colorspace.
8348 % o verbose: Set to MagickTrue to print detailed information about the
8349 % identified classes.
8351 % o cluster_threshold: This represents the minimum number of pixels
8352 % contained in a hexahedra before it can be considered valid (expressed as
8355 % o smooth_threshold: the smoothing threshold eliminates noise in the second
8356 % derivative of the histogram. As the value is increased, you can expect a
8357 % smoother second derivative.
8360 MagickExport MagickBooleanType MagickSegmentImage(MagickWand *wand,
8361 const ColorspaceType colorspace,const MagickBooleanType verbose,
8362 const double cluster_threshold,const double smooth_threshold)
8367 assert(wand != (MagickWand *) NULL);
8368 assert(wand->signature == WandSignature);
8369 if (wand->debug != MagickFalse)
8370 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8371 if (wand->images == (Image *) NULL)
8372 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8373 status=SegmentImage(wand->images,colorspace,verbose,cluster_threshold,
8374 smooth_threshold,wand->exception);
8379 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8383 % M a g i c k S e l e c t i v e B l u r I m a g e %
8387 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8389 % MagickSelectiveBlurImage() selectively blur an image within a contrast
8390 % threshold. It is similar to the unsharpen mask that sharpens everything with
8391 % contrast above a certain threshold.
8393 % The format of the MagickSelectiveBlurImage method is:
8395 % MagickBooleanType MagickSelectiveBlurImage(MagickWand *wand,
8396 % const double radius,const double sigma,const double threshold,
8397 % const double bias)
8399 % A description of each parameter follows:
8401 % o wand: the magick wand.
8403 % o radius: the radius of the gaussian, in pixels, not counting the center
8406 % o sigma: the standard deviation of the gaussian, in pixels.
8408 % o threshold: only pixels within this contrast threshold are included
8409 % in the blur operation.
8414 WandExport MagickBooleanType MagickSelectiveBlurImage(MagickWand *wand,
8415 const double radius,const double sigma,const double threshold,
8421 assert(wand != (MagickWand *) NULL);
8422 assert(wand->signature == WandSignature);
8423 if (wand->debug != MagickFalse)
8424 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8425 if (wand->images == (Image *) NULL)
8426 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8427 blur_image=SelectiveBlurImage(wand->images,radius,sigma,threshold,bias,
8429 if (blur_image == (Image *) NULL)
8430 return(MagickFalse);
8431 ReplaceImageInList(&wand->images,blur_image);
8436 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8440 % M a g i c k S e p a r a t e I m a g e C h a n n e l %
8444 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8446 % MagickSeparateImage() separates a channel from the image and returns a
8447 % grayscale image. A channel is a particular color component of each pixel
8450 % The format of the MagickSeparateImage method is:
8452 % MagickBooleanType MagickSeparateImage(MagickWand *wand,
8453 % const ChannelType channel)
8455 % A description of each parameter follows:
8457 % o wand: the magick wand.
8459 % o channel: the channel.
8462 WandExport MagickBooleanType MagickSeparateImage(MagickWand *wand,
8463 const ChannelType channel)
8468 assert(wand != (MagickWand *) NULL);
8469 assert(wand->signature == WandSignature);
8470 if (wand->debug != MagickFalse)
8471 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8472 if (wand->images == (Image *) NULL)
8473 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8474 separate_image=SeparateImage(wand->images,channel,wand->exception);
8475 if (separate_image == (Image *) NULL)
8476 return(MagickFalse);
8477 ReplaceImageInList(&wand->images,separate_image);
8482 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8486 % M a g i c k S e p i a T o n e I m a g e %
8490 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8492 % MagickSepiaToneImage() applies a special effect to the image, similar to the
8493 % effect achieved in a photo darkroom by sepia toning. Threshold ranges from
8494 % 0 to QuantumRange and is a measure of the extent of the sepia toning. A
8495 % threshold of 80% is a good starting point for a reasonable tone.
8497 % The format of the MagickSepiaToneImage method is:
8499 % MagickBooleanType MagickSepiaToneImage(MagickWand *wand,
8500 % const double threshold)
8502 % A description of each parameter follows:
8504 % o wand: the magick wand.
8506 % o threshold: Define the extent of the sepia toning.
8509 WandExport MagickBooleanType MagickSepiaToneImage(MagickWand *wand,
8510 const double threshold)
8515 assert(wand != (MagickWand *) NULL);
8516 assert(wand->signature == WandSignature);
8517 if (wand->debug != MagickFalse)
8518 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8519 if (wand->images == (Image *) NULL)
8520 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8521 sepia_image=SepiaToneImage(wand->images,threshold,wand->exception);
8522 if (sepia_image == (Image *) NULL)
8523 return(MagickFalse);
8524 ReplaceImageInList(&wand->images,sepia_image);
8529 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8533 % M a g i c k S e t I m a g e %
8537 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8539 % MagickSetImage() replaces the last image returned by MagickSetImageIndex(),
8540 % MagickNextImage(), MagickPreviousImage() with the images from the specified
8543 % The format of the MagickSetImage method is:
8545 % MagickBooleanType MagickSetImage(MagickWand *wand,
8546 % const MagickWand *set_wand)
8548 % A description of each parameter follows:
8550 % o wand: the magick wand.
8552 % o set_wand: the set_wand wand.
8555 WandExport MagickBooleanType MagickSetImage(MagickWand *wand,
8556 const MagickWand *set_wand)
8561 assert(wand != (MagickWand *) NULL);
8562 assert(wand->signature == WandSignature);
8563 if (wand->debug != MagickFalse)
8564 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8565 assert(set_wand != (MagickWand *) NULL);
8566 assert(set_wand->signature == WandSignature);
8567 if (wand->debug != MagickFalse)
8568 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",set_wand->name);
8569 if (set_wand->images == (Image *) NULL)
8570 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8571 images=CloneImageList(set_wand->images,wand->exception);
8572 if (images == (Image *) NULL)
8573 return(MagickFalse);
8574 ReplaceImageInList(&wand->images,images);
8579 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8583 % M a g i c k S e t I m a g e A l p h a C h a n n e l %
8587 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8589 % MagickSetImageAlphaChannel() activates, deactivates, resets, or sets the
8592 % The format of the MagickSetImageAlphaChannel method is:
8594 % MagickBooleanType MagickSetImageAlphaChannel(MagickWand *wand,
8595 % const AlphaChannelType alpha_type)
8597 % A description of each parameter follows:
8599 % o wand: the magick wand.
8601 % o alpha_type: the alpha channel type: ActivateAlphaChannel,
8602 % DeactivateAlphaChannel, OpaqueAlphaChannel, or SetAlphaChannel.
8605 WandExport MagickBooleanType MagickSetImageAlphaChannel(MagickWand *wand,
8606 const AlphaChannelType alpha_type)
8608 assert(wand != (MagickWand *) NULL);
8609 assert(wand->signature == WandSignature);
8610 if (wand->debug != MagickFalse)
8611 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8612 if (wand->images == (Image *) NULL)
8613 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8614 return(SetImageAlphaChannel(wand->images,alpha_type,wand->exception));
8618 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8622 % M a g i c k S e t I m a g e B a c k g r o u n d C o l o r %
8626 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8628 % MagickSetImageBackgroundColor() sets the image background color.
8630 % The format of the MagickSetImageBackgroundColor method is:
8632 % MagickBooleanType MagickSetImageBackgroundColor(MagickWand *wand,
8633 % const PixelWand *background)
8635 % A description of each parameter follows:
8637 % o wand: the magick wand.
8639 % o background: the background pixel wand.
8642 WandExport MagickBooleanType MagickSetImageBackgroundColor(MagickWand *wand,
8643 const PixelWand *background)
8645 assert(wand != (MagickWand *) NULL);
8646 assert(wand->signature == WandSignature);
8647 if (wand->debug != MagickFalse)
8648 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8649 if (wand->images == (Image *) NULL)
8650 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8651 PixelGetQuantumPacket(background,&wand->images->background_color);
8656 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8660 % M a g i c k S e t I m a g e B i a s %
8664 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8666 % MagickSetImageBias() sets the image bias for any method that convolves an
8667 % image (e.g. MagickConvolveImage()).
8669 % The format of the MagickSetImageBias method is:
8671 % MagickBooleanType MagickSetImageBias(MagickWand *wand,
8672 % const double bias)
8674 % A description of each parameter follows:
8676 % o wand: the magick wand.
8678 % o bias: the image bias.
8681 WandExport MagickBooleanType MagickSetImageBias(MagickWand *wand,
8684 assert(wand != (MagickWand *) NULL);
8685 assert(wand->signature == WandSignature);
8686 if (wand->debug != MagickFalse)
8687 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8688 if (wand->images == (Image *) NULL)
8689 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8690 wand->images->bias=bias;
8695 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8699 % M a g i c k S e t I m a g e B l u e P r i m a r y %
8703 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8705 % MagickSetImageBluePrimary() sets the image chromaticity blue primary point.
8707 % The format of the MagickSetImageBluePrimary method is:
8709 % MagickBooleanType MagickSetImageBluePrimary(MagickWand *wand,
8710 % const double x,const double y)
8712 % A description of each parameter follows:
8714 % o wand: the magick wand.
8716 % o x: the blue primary x-point.
8718 % o y: the blue primary y-point.
8721 WandExport MagickBooleanType MagickSetImageBluePrimary(MagickWand *wand,
8722 const double x,const double y)
8724 assert(wand != (MagickWand *) NULL);
8725 assert(wand->signature == WandSignature);
8726 if (wand->debug != MagickFalse)
8727 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8728 if (wand->images == (Image *) NULL)
8729 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8730 wand->images->chromaticity.blue_primary.x=x;
8731 wand->images->chromaticity.blue_primary.y=y;
8736 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8740 % M a g i c k S e t I m a g e B o r d e r C o l o r %
8744 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8746 % MagickSetImageBorderColor() sets the image border color.
8748 % The format of the MagickSetImageBorderColor method is:
8750 % MagickBooleanType MagickSetImageBorderColor(MagickWand *wand,
8751 % const PixelWand *border)
8753 % A description of each parameter follows:
8755 % o wand: the magick wand.
8757 % o border: the border pixel wand.
8760 WandExport MagickBooleanType MagickSetImageBorderColor(MagickWand *wand,
8761 const PixelWand *border)
8763 assert(wand != (MagickWand *) NULL);
8764 assert(wand->signature == WandSignature);
8765 if (wand->debug != MagickFalse)
8766 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8767 if (wand->images == (Image *) NULL)
8768 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8769 PixelGetQuantumPacket(border,&wand->images->border_color);
8774 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8778 % M a g i c k S e t I m a g e C l i p M a s k %
8782 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8784 % MagickSetImageMask() sets image clip mask.
8786 % The format of the MagickSetImageMask method is:
8788 % MagickBooleanType MagickSetImageMask(MagickWand *wand,
8789 % const MagickWand *clip_mask)
8791 % A description of each parameter follows:
8793 % o wand: the magick wand.
8795 % o clip_mask: the clip_mask wand.
8798 WandExport MagickBooleanType MagickSetImageMask(MagickWand *wand,
8799 const MagickWand *clip_mask)
8801 assert(wand != (MagickWand *) NULL);
8802 assert(wand->signature == WandSignature);
8803 if (wand->debug != MagickFalse)
8804 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8805 assert(clip_mask != (MagickWand *) NULL);
8806 assert(clip_mask->signature == WandSignature);
8807 if (clip_mask->debug != MagickFalse)
8808 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",clip_mask->name);
8809 if (clip_mask->images == (Image *) NULL)
8810 ThrowWandException(WandError,"ContainsNoImages",clip_mask->name);
8811 return(SetImageMask(wand->images,clip_mask->images,wand->exception));
8815 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8819 % M a g i c k S e t I m a g e C o l o r %
8823 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8825 % MagickSetImageColor() set the entire wand canvas to the specified color.
8827 % The format of the MagickSetImageColor method is:
8829 % MagickBooleanType MagickSetImageColor(MagickWand *wand,
8830 % const PixelWand *color)
8832 % A description of each parameter follows:
8834 % o wand: the magick wand.
8836 % o background: the image color.
8839 WandExport MagickBooleanType MagickSetImageColor(MagickWand *wand,
8840 const PixelWand *color)
8845 assert(wand != (MagickWand *) NULL);
8846 assert(wand->signature == WandSignature);
8847 if (wand->debug != MagickFalse)
8848 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8849 PixelGetMagickColor(color,&pixel);
8850 return(SetImageColor(wand->images,&pixel,wand->exception));
8854 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8858 % M a g i c k S e t I m a g e C o l o r m a p C o l o r %
8862 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8864 % MagickSetImageColormapColor() sets the color of the specified colormap
8867 % The format of the MagickSetImageColormapColor method is:
8869 % MagickBooleanType MagickSetImageColormapColor(MagickWand *wand,
8870 % const size_t index,const PixelWand *color)
8872 % A description of each parameter follows:
8874 % o wand: the magick wand.
8876 % o index: the offset into the image colormap.
8878 % o color: Return the colormap color in this wand.
8881 WandExport MagickBooleanType MagickSetImageColormapColor(MagickWand *wand,
8882 const size_t index,const PixelWand *color)
8884 assert(wand != (MagickWand *) NULL);
8885 assert(wand->signature == WandSignature);
8886 if (wand->debug != MagickFalse)
8887 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8888 if (wand->images == (Image *) NULL)
8889 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8890 if ((wand->images->colormap == (PixelInfo *) NULL) ||
8891 (index >= wand->images->colors))
8892 ThrowWandException(WandError,"InvalidColormapIndex",wand->name);
8893 PixelGetQuantumPacket(color,wand->images->colormap+index);
8894 return(SyncImage(wand->images,wand->exception));
8898 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8902 % M a g i c k S e t I m a g e C o l o r s p a c e %
8906 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8908 % MagickSetImageColorspace() sets the image colorspace.
8910 % The format of the MagickSetImageColorspace method is:
8912 % MagickBooleanType MagickSetImageColorspace(MagickWand *wand,
8913 % const ColorspaceType colorspace)
8915 % A description of each parameter follows:
8917 % o wand: the magick wand.
8919 % o colorspace: the image colorspace: UndefinedColorspace, RGBColorspace,
8920 % GRAYColorspace, TransparentColorspace, OHTAColorspace, XYZColorspace,
8921 % YCbCrColorspace, YCCColorspace, YIQColorspace, YPbPrColorspace,
8922 % YPbPrColorspace, YUVColorspace, CMYKColorspace, sRGBColorspace,
8923 % HSLColorspace, or HWBColorspace.
8926 WandExport MagickBooleanType MagickSetImageColorspace(MagickWand *wand,
8927 const ColorspaceType colorspace)
8929 assert(wand != (MagickWand *) NULL);
8930 assert(wand->signature == WandSignature);
8931 if (wand->debug != MagickFalse)
8932 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8933 if (wand->images == (Image *) NULL)
8934 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8935 return(SetImageColorspace(wand->images,colorspace,wand->exception));
8939 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8943 % M a g i c k S e t I m a g e C o m p o s e %
8947 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8949 % MagickSetImageCompose() sets the image composite operator, useful for
8950 % specifying how to composite the image thumbnail when using the
8951 % MagickMontageImage() method.
8953 % The format of the MagickSetImageCompose method is:
8955 % MagickBooleanType MagickSetImageCompose(MagickWand *wand,
8956 % const CompositeOperator compose)
8958 % A description of each parameter follows:
8960 % o wand: the magick wand.
8962 % o compose: the image composite operator.
8965 WandExport MagickBooleanType MagickSetImageCompose(MagickWand *wand,
8966 const CompositeOperator compose)
8968 assert(wand != (MagickWand *) NULL);
8969 assert(wand->signature == WandSignature);
8970 if (wand->debug != MagickFalse)
8971 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8972 if (wand->images == (Image *) NULL)
8973 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8974 wand->images->compose=compose;
8979 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8983 % M a g i c k S e t I m a g e C o m p r e s s i o n %
8987 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8989 % MagickSetImageCompression() sets the image compression.
8991 % The format of the MagickSetImageCompression method is:
8993 % MagickBooleanType MagickSetImageCompression(MagickWand *wand,
8994 % const CompressionType compression)
8996 % A description of each parameter follows:
8998 % o wand: the magick wand.
9000 % o compression: the image compression type.
9003 WandExport MagickBooleanType MagickSetImageCompression(MagickWand *wand,
9004 const CompressionType compression)
9006 assert(wand != (MagickWand *) NULL);
9007 assert(wand->signature == WandSignature);
9008 if (wand->debug != MagickFalse)
9009 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9010 if (wand->images == (Image *) NULL)
9011 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9012 wand->images->compression=compression;
9017 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9021 % M a g i c k S e t I m a g e C o m p r e s s i o n Q u a l i t y %
9025 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9027 % MagickSetImageCompressionQuality() sets the image compression quality.
9029 % The format of the MagickSetImageCompressionQuality method is:
9031 % MagickBooleanType MagickSetImageCompressionQuality(MagickWand *wand,
9032 % const size_t quality)
9034 % A description of each parameter follows:
9036 % o wand: the magick wand.
9038 % o quality: the image compression tlityype.
9041 WandExport MagickBooleanType MagickSetImageCompressionQuality(MagickWand *wand,
9042 const size_t quality)
9044 assert(wand != (MagickWand *) NULL);
9045 assert(wand->signature == WandSignature);
9046 if (wand->debug != MagickFalse)
9047 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9048 if (wand->images == (Image *) NULL)
9049 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9050 wand->images->quality=quality;
9055 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9059 % M a g i c k S e t I m a g e D e l a y %
9063 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9065 % MagickSetImageDelay() sets the image delay.
9067 % The format of the MagickSetImageDelay method is:
9069 % MagickBooleanType MagickSetImageDelay(MagickWand *wand,
9070 % const size_t delay)
9072 % A description of each parameter follows:
9074 % o wand: the magick wand.
9076 % o delay: the image delay in ticks-per-second units.
9079 WandExport MagickBooleanType MagickSetImageDelay(MagickWand *wand,
9082 assert(wand != (MagickWand *) NULL);
9083 assert(wand->signature == WandSignature);
9084 if (wand->debug != MagickFalse)
9085 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9086 if (wand->images == (Image *) NULL)
9087 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9088 wand->images->delay=delay;
9093 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9097 % M a g i c k S e t I m a g e D e p t h %
9101 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9103 % MagickSetImageDepth() sets the image depth.
9105 % The format of the MagickSetImageDepth method is:
9107 % MagickBooleanType MagickSetImageDepth(MagickWand *wand,
9108 % const size_t depth)
9110 % A description of each parameter follows:
9112 % o wand: the magick wand.
9114 % o depth: the image depth in bits: 8, 16, or 32.
9117 WandExport MagickBooleanType MagickSetImageDepth(MagickWand *wand,
9120 assert(wand != (MagickWand *) NULL);
9121 assert(wand->signature == WandSignature);
9122 if (wand->debug != MagickFalse)
9123 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9124 if (wand->images == (Image *) NULL)
9125 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9126 return(SetImageDepth(wand->images,depth,wand->exception));
9130 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9134 % M a g i c k S e t I m a g e D i s p o s e %
9138 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9140 % MagickSetImageDispose() sets the image disposal method.
9142 % The format of the MagickSetImageDispose method is:
9144 % MagickBooleanType MagickSetImageDispose(MagickWand *wand,
9145 % const DisposeType dispose)
9147 % A description of each parameter follows:
9149 % o wand: the magick wand.
9151 % o dispose: the image disposeal type.
9154 WandExport MagickBooleanType MagickSetImageDispose(MagickWand *wand,
9155 const DisposeType dispose)
9157 assert(wand != (MagickWand *) NULL);
9158 assert(wand->signature == WandSignature);
9159 if (wand->debug != MagickFalse)
9160 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9161 if (wand->images == (Image *) NULL)
9162 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9163 wand->images->dispose=dispose;
9168 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9172 % M a g i c k S e t I m a g e E x t e n t %
9176 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9178 % MagickSetImageExtent() sets the image size (i.e. columns & rows).
9180 % The format of the MagickSetImageExtent method is:
9182 % MagickBooleanType MagickSetImageExtent(MagickWand *wand,
9183 % const size_t columns,const unsigned rows)
9185 % A description of each parameter follows:
9187 % o wand: the magick wand.
9189 % o columns: The image width in pixels.
9191 % o rows: The image height in pixels.
9194 WandExport MagickBooleanType MagickSetImageExtent(MagickWand *wand,
9195 const size_t columns,const size_t rows)
9197 assert(wand != (MagickWand *) NULL);
9198 assert(wand->signature == WandSignature);
9199 if (wand->debug != MagickFalse)
9200 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9201 if (wand->images == (Image *) NULL)
9202 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9203 return(SetImageExtent(wand->images,columns,rows,wand->exception));
9207 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9211 % M a g i c k S e t I m a g e F i l e n a m e %
9215 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9217 % MagickSetImageFilename() sets the filename of a particular image in a
9220 % The format of the MagickSetImageFilename method is:
9222 % MagickBooleanType MagickSetImageFilename(MagickWand *wand,
9223 % const char *filename)
9225 % A description of each parameter follows:
9227 % o wand: the magick wand.
9229 % o filename: the image filename.
9232 WandExport MagickBooleanType MagickSetImageFilename(MagickWand *wand,
9233 const char *filename)
9235 assert(wand != (MagickWand *) NULL);
9236 assert(wand->signature == WandSignature);
9237 if (wand->debug != MagickFalse)
9238 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9239 if (wand->images == (Image *) NULL)
9240 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9241 if (filename != (const char *) NULL)
9242 (void) CopyMagickString(wand->images->filename,filename,MaxTextExtent);
9247 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9251 % M a g i c k S e t I m a g e F o r m a t %
9255 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9257 % MagickSetImageFormat() sets the format of a particular image in a
9260 % The format of the MagickSetImageFormat method is:
9262 % MagickBooleanType MagickSetImageFormat(MagickWand *wand,
9263 % const char *format)
9265 % A description of each parameter follows:
9267 % o wand: the magick wand.
9269 % o format: the image format.
9272 WandExport MagickBooleanType MagickSetImageFormat(MagickWand *wand,
9278 assert(wand != (MagickWand *) NULL);
9279 assert(wand->signature == WandSignature);
9280 if (wand->debug != MagickFalse)
9281 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9282 if (wand->images == (Image *) NULL)
9283 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9284 if ((format == (char *) NULL) || (*format == '\0'))
9286 *wand->images->magick='\0';
9289 magick_info=GetMagickInfo(format,wand->exception);
9290 if (magick_info == (const MagickInfo *) NULL)
9291 return(MagickFalse);
9292 ClearMagickException(wand->exception);
9293 (void) CopyMagickString(wand->images->magick,format,MaxTextExtent);
9298 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9302 % M a g i c k S e t I m a g e F u z z %
9306 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9308 % MagickSetImageFuzz() sets the image fuzz.
9310 % The format of the MagickSetImageFuzz method is:
9312 % MagickBooleanType MagickSetImageFuzz(MagickWand *wand,
9313 % const double fuzz)
9315 % A description of each parameter follows:
9317 % o wand: the magick wand.
9319 % o fuzz: the image fuzz.
9322 WandExport MagickBooleanType MagickSetImageFuzz(MagickWand *wand,
9325 assert(wand != (MagickWand *) NULL);
9326 assert(wand->signature == WandSignature);
9327 if (wand->debug != MagickFalse)
9328 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9329 if (wand->images == (Image *) NULL)
9330 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9331 wand->images->fuzz=fuzz;
9336 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9340 % M a g i c k S e t I m a g e G a m m a %
9344 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9346 % MagickSetImageGamma() sets the image gamma.
9348 % The format of the MagickSetImageGamma method is:
9350 % MagickBooleanType MagickSetImageGamma(MagickWand *wand,
9351 % const double gamma)
9353 % A description of each parameter follows:
9355 % o wand: the magick wand.
9357 % o gamma: the image gamma.
9360 WandExport MagickBooleanType MagickSetImageGamma(MagickWand *wand,
9363 assert(wand != (MagickWand *) NULL);
9364 assert(wand->signature == WandSignature);
9365 if (wand->debug != MagickFalse)
9366 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9367 if (wand->images == (Image *) NULL)
9368 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9369 wand->images->gamma=gamma;
9374 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9378 % M a g i c k S e t I m a g e G r a v i t y %
9382 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9384 % MagickSetImageGravity() sets the image gravity type.
9386 % The format of the MagickSetImageGravity method is:
9388 % MagickBooleanType MagickSetImageGravity(MagickWand *wand,
9389 % const GravityType gravity)
9391 % A description of each parameter follows:
9393 % o wand: the magick wand.
9395 % o gravity: the image interlace scheme: NoInterlace, LineInterlace,
9396 % PlaneInterlace, PartitionInterlace.
9399 WandExport MagickBooleanType MagickSetImageGravity(MagickWand *wand,
9400 const GravityType gravity)
9402 assert(wand != (MagickWand *) NULL);
9403 assert(wand->signature == WandSignature);
9404 if (wand->debug != MagickFalse)
9405 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9406 if (wand->images == (Image *) NULL)
9407 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9408 wand->images->gravity=gravity;
9413 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9417 % M a g i c k S e t I m a g e G r e e n P r i m a r y %
9421 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9423 % MagickSetImageGreenPrimary() sets the image chromaticity green primary
9426 % The format of the MagickSetImageGreenPrimary method is:
9428 % MagickBooleanType MagickSetImageGreenPrimary(MagickWand *wand,
9429 % const double x,const double y)
9431 % A description of each parameter follows:
9433 % o wand: the magick wand.
9435 % o x: the green primary x-point.
9437 % o y: the green primary y-point.
9441 WandExport MagickBooleanType MagickSetImageGreenPrimary(MagickWand *wand,
9442 const double x,const double y)
9444 assert(wand != (MagickWand *) NULL);
9445 assert(wand->signature == WandSignature);
9446 if (wand->debug != MagickFalse)
9447 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9448 if (wand->images == (Image *) NULL)
9449 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9450 wand->images->chromaticity.green_primary.x=x;
9451 wand->images->chromaticity.green_primary.y=y;
9456 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9460 % M a g i c k S e t I m a g e I n t e r l a c e S c h e m e %
9464 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9466 % MagickSetImageInterlaceScheme() sets the image interlace scheme.
9468 % The format of the MagickSetImageInterlaceScheme method is:
9470 % MagickBooleanType MagickSetImageInterlaceScheme(MagickWand *wand,
9471 % const InterlaceType interlace)
9473 % A description of each parameter follows:
9475 % o wand: the magick wand.
9477 % o interlace: the image interlace scheme: NoInterlace, LineInterlace,
9478 % PlaneInterlace, PartitionInterlace.
9481 WandExport MagickBooleanType MagickSetImageInterlaceScheme(MagickWand *wand,
9482 const InterlaceType interlace)
9484 assert(wand != (MagickWand *) NULL);
9485 assert(wand->signature == WandSignature);
9486 if (wand->debug != MagickFalse)
9487 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9488 if (wand->images == (Image *) NULL)
9489 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9490 wand->images->interlace=interlace;
9495 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9499 % M a g i c k S e t I m a g e I n t e r p o l a t e M e t h o d %
9503 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9505 % MagickSetImagePixelInterpolateMethod() sets the image interpolate pixel method.
9507 % The format of the MagickSetImagePixelInterpolateMethod method is:
9509 % MagickBooleanType MagickSetImagePixelInterpolateMethod(MagickWand *wand,
9510 % const PixelInterpolateMethod method)
9512 % A description of each parameter follows:
9514 % o wand: the magick wand.
9516 % o method: the image interpole pixel methods: choose from Undefined,
9517 % Average, Bicubic, Bilinear, Filter, Integer, Mesh, NearestNeighbor.
9520 WandExport MagickBooleanType MagickSetImagePixelInterpolateMethod(MagickWand *wand,
9521 const PixelInterpolateMethod method)
9523 assert(wand != (MagickWand *) NULL);
9524 assert(wand->signature == WandSignature);
9525 if (wand->debug != MagickFalse)
9526 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9527 if (wand->images == (Image *) NULL)
9528 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9529 wand->images->interpolate=method;
9534 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9538 % M a g i c k S e t I m a g e I t e r a t i o n s %
9542 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9544 % MagickSetImageIterations() sets the image iterations.
9546 % The format of the MagickSetImageIterations method is:
9548 % MagickBooleanType MagickSetImageIterations(MagickWand *wand,
9549 % const size_t iterations)
9551 % A description of each parameter follows:
9553 % o wand: the magick wand.
9555 % o delay: the image delay in 1/100th of a second.
9558 WandExport MagickBooleanType MagickSetImageIterations(MagickWand *wand,
9559 const size_t iterations)
9561 assert(wand != (MagickWand *) NULL);
9562 assert(wand->signature == WandSignature);
9563 if (wand->debug != MagickFalse)
9564 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9565 if (wand->images == (Image *) NULL)
9566 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9567 wand->images->iterations=iterations;
9572 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9576 % M a g i c k S e t I m a g e M a t t e %
9580 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9582 % MagickSetImageMatte() sets the image matte channel.
9584 % The format of the MagickSetImageMatteColor method is:
9586 % MagickBooleanType MagickSetImageMatteColor(MagickWand *wand,
9587 % const MagickBooleanType *matte)
9589 % A description of each parameter follows:
9591 % o wand: the magick wand.
9593 % o matte: Set to MagickTrue to enable the image matte channel otherwise
9597 WandExport MagickBooleanType MagickSetImageMatte(MagickWand *wand,
9598 const MagickBooleanType matte)
9600 assert(wand != (MagickWand *) NULL);
9601 assert(wand->signature == WandSignature);
9602 if (wand->debug != MagickFalse)
9603 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9604 if (wand->images == (Image *) NULL)
9605 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9606 if ((wand->images->matte == MagickFalse) && (matte != MagickFalse))
9607 (void) SetImageAlpha(wand->images,OpaqueAlpha,wand->exception);
9608 wand->images->matte=matte;
9613 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9617 % M a g i c k S e t I m a g e M a t t e C o l o r %
9621 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9623 % MagickSetImageMatteColor() sets the image matte color.
9625 % The format of the MagickSetImageMatteColor method is:
9627 % MagickBooleanType MagickSetImageMatteColor(MagickWand *wand,
9628 % const PixelWand *matte)
9630 % A description of each parameter follows:
9632 % o wand: the magick wand.
9634 % o matte: the matte pixel wand.
9637 WandExport MagickBooleanType MagickSetImageMatteColor(MagickWand *wand,
9638 const PixelWand *matte)
9640 assert(wand != (MagickWand *) NULL);
9641 assert(wand->signature == WandSignature);
9642 if (wand->debug != MagickFalse)
9643 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9644 if (wand->images == (Image *) NULL)
9645 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9646 PixelGetQuantumPacket(matte,&wand->images->matte_color);
9651 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9655 % M a g i c k S e t I m a g e O p a c i t y %
9659 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9661 % MagickSetImageAlpha() sets the image to the specified alpha level.
9663 % The format of the MagickSetImageAlpha method is:
9665 % MagickBooleanType MagickSetImageAlpha(MagickWand *wand,
9666 % const double alpha)
9668 % A description of each parameter follows:
9670 % o wand: the magick wand.
9672 % o alpha: the level of transparency: 1.0 is fully opaque and 0.0 is fully
9676 WandExport MagickBooleanType MagickSetImageAlpha(MagickWand *wand,
9682 assert(wand != (MagickWand *) NULL);
9683 assert(wand->signature == WandSignature);
9684 if (wand->debug != MagickFalse)
9685 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9686 if (wand->images == (Image *) NULL)
9687 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9688 status=SetImageAlpha(wand->images,ClampToQuantum(QuantumRange*alpha),
9694 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9698 % M a g i c k S e t I m a g e O r i e n t a t i o n %
9702 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9704 % MagickSetImageOrientation() sets the image orientation.
9706 % The format of the MagickSetImageOrientation method is:
9708 % MagickBooleanType MagickSetImageOrientation(MagickWand *wand,
9709 % const OrientationType orientation)
9711 % A description of each parameter follows:
9713 % o wand: the magick wand.
9715 % o orientation: the image orientation type.
9718 WandExport MagickBooleanType MagickSetImageOrientation(MagickWand *wand,
9719 const OrientationType orientation)
9721 assert(wand != (MagickWand *) NULL);
9722 assert(wand->signature == WandSignature);
9723 if (wand->debug != MagickFalse)
9724 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9725 if (wand->images == (Image *) NULL)
9726 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9727 wand->images->orientation=orientation;
9732 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9736 % M a g i c k S e t I m a g e P a g e %
9740 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9742 % MagickSetImagePage() sets the page geometry of the image.
9744 % The format of the MagickSetImagePage method is:
9746 % MagickBooleanType MagickSetImagePage(MagickWand *wand,
9747 % const size_t width,const size_t height,const ssize_t x,
9750 % A description of each parameter follows:
9752 % o wand: the magick wand.
9754 % o width: the page width.
9756 % o height: the page height.
9758 % o x: the page x-offset.
9760 % o y: the page y-offset.
9763 WandExport MagickBooleanType MagickSetImagePage(MagickWand *wand,
9764 const size_t width,const size_t height,const ssize_t x,
9767 assert(wand != (MagickWand *) NULL);
9768 assert(wand->signature == WandSignature);
9769 if (wand->debug != MagickFalse)
9770 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9771 if (wand->images == (Image *) NULL)
9772 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9773 wand->images->page.width=width;
9774 wand->images->page.height=height;
9775 wand->images->page.x=x;
9776 wand->images->page.y=y;
9781 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9785 % M a g i c k S e t I m a g e P r o g r e s s M o n i t o r %
9789 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9791 % MagickSetImageProgressMonitor() sets the wand image progress monitor to the
9792 % specified method and returns the previous progress monitor if any. The
9793 % progress monitor method looks like this:
9795 % MagickBooleanType MagickProgressMonitor(const char *text,
9796 % const MagickOffsetType offset,const MagickSizeType span,
9797 % void *client_data)
9799 % If the progress monitor returns MagickFalse, the current operation is
9802 % The format of the MagickSetImageProgressMonitor method is:
9804 % MagickProgressMonitor MagickSetImageProgressMonitor(MagickWand *wand
9805 % const MagickProgressMonitor progress_monitor,void *client_data)
9807 % A description of each parameter follows:
9809 % o wand: the magick wand.
9811 % o progress_monitor: Specifies a pointer to a method to monitor progress
9812 % of an image operation.
9814 % o client_data: Specifies a pointer to any client data.
9817 WandExport MagickProgressMonitor MagickSetImageProgressMonitor(MagickWand *wand,
9818 const MagickProgressMonitor progress_monitor,void *client_data)
9820 MagickProgressMonitor
9823 assert(wand != (MagickWand *) NULL);
9824 assert(wand->signature == WandSignature);
9825 if (wand->debug != MagickFalse)
9826 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9827 if (wand->images == (Image *) NULL)
9829 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
9830 "ContainsNoImages","`%s'",wand->name);
9831 return((MagickProgressMonitor) NULL);
9833 previous_monitor=SetImageProgressMonitor(wand->images,
9834 progress_monitor,client_data);
9835 return(previous_monitor);
9839 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9843 % M a g i c k S e t I m a g e R e d P r i m a r y %
9847 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9849 % MagickSetImageRedPrimary() sets the image chromaticity red primary point.
9851 % The format of the MagickSetImageRedPrimary method is:
9853 % MagickBooleanType MagickSetImageRedPrimary(MagickWand *wand,
9854 % const double x,const double y)
9856 % A description of each parameter follows:
9858 % o wand: the magick wand.
9860 % o x: the red primary x-point.
9862 % o y: the red primary y-point.
9865 WandExport MagickBooleanType MagickSetImageRedPrimary(MagickWand *wand,
9866 const double x,const double y)
9868 assert(wand != (MagickWand *) NULL);
9869 assert(wand->signature == WandSignature);
9870 if (wand->debug != MagickFalse)
9871 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9872 if (wand->images == (Image *) NULL)
9873 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9874 wand->images->chromaticity.red_primary.x=x;
9875 wand->images->chromaticity.red_primary.y=y;
9880 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9884 % M a g i c k S e t I m a g e R e n d e r i n g I n t e n t %
9888 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9890 % MagickSetImageRenderingIntent() sets the image rendering intent.
9892 % The format of the MagickSetImageRenderingIntent method is:
9894 % MagickBooleanType MagickSetImageRenderingIntent(MagickWand *wand,
9895 % const RenderingIntent rendering_intent)
9897 % A description of each parameter follows:
9899 % o wand: the magick wand.
9901 % o rendering_intent: the image rendering intent: UndefinedIntent,
9902 % SaturationIntent, PerceptualIntent, AbsoluteIntent, or RelativeIntent.
9905 WandExport MagickBooleanType MagickSetImageRenderingIntent(MagickWand *wand,
9906 const RenderingIntent rendering_intent)
9908 assert(wand != (MagickWand *) NULL);
9909 assert(wand->signature == WandSignature);
9910 if (wand->debug != MagickFalse)
9911 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9912 if (wand->images == (Image *) NULL)
9913 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9914 wand->images->rendering_intent=rendering_intent;
9919 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9923 % M a g i c k S e t I m a g e R e s o l u t i o n %
9927 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9929 % MagickSetImageResolution() sets the image resolution.
9931 % The format of the MagickSetImageResolution method is:
9933 % MagickBooleanType MagickSetImageResolution(MagickWand *wand,
9934 % const double x_resolution,const doubtl y_resolution)
9936 % A description of each parameter follows:
9938 % o wand: the magick wand.
9940 % o x_resolution: the image x resolution.
9942 % o y_resolution: the image y resolution.
9945 WandExport MagickBooleanType MagickSetImageResolution(MagickWand *wand,
9946 const double x_resolution,const double y_resolution)
9948 assert(wand != (MagickWand *) NULL);
9949 assert(wand->signature == WandSignature);
9950 if (wand->debug != MagickFalse)
9951 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9952 if (wand->images == (Image *) NULL)
9953 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9954 wand->images->resolution.x=x_resolution;
9955 wand->images->resolution.y=y_resolution;
9960 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9964 % M a g i c k S e t I m a g e S c e n e %
9968 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9970 % MagickSetImageScene() sets the image scene.
9972 % The format of the MagickSetImageScene method is:
9974 % MagickBooleanType MagickSetImageScene(MagickWand *wand,
9975 % const size_t scene)
9977 % A description of each parameter follows:
9979 % o wand: the magick wand.
9981 % o delay: the image scene number.
9984 WandExport MagickBooleanType MagickSetImageScene(MagickWand *wand,
9987 assert(wand != (MagickWand *) NULL);
9988 assert(wand->signature == WandSignature);
9989 if (wand->debug != MagickFalse)
9990 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9991 if (wand->images == (Image *) NULL)
9992 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9993 wand->images->scene=scene;
9998 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10002 % M a g i c k S e t I m a g e T i c k s P e r S e c o n d %
10006 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10008 % MagickSetImageTicksPerSecond() sets the image ticks-per-second.
10010 % The format of the MagickSetImageTicksPerSecond method is:
10012 % MagickBooleanType MagickSetImageTicksPerSecond(MagickWand *wand,
10013 % const ssize_t ticks_per-second)
10015 % A description of each parameter follows:
10017 % o wand: the magick wand.
10019 % o ticks_per_second: the units to use for the image delay.
10022 WandExport MagickBooleanType MagickSetImageTicksPerSecond(MagickWand *wand,
10023 const ssize_t ticks_per_second)
10025 assert(wand != (MagickWand *) NULL);
10026 assert(wand->signature == WandSignature);
10027 if (wand->debug != MagickFalse)
10028 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10029 if (wand->images == (Image *) NULL)
10030 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10031 wand->images->ticks_per_second=ticks_per_second;
10032 return(MagickTrue);
10036 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10040 % M a g i c k S e t I m a g e T y p e %
10044 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10046 % MagickSetImageType() sets the image type.
10048 % The format of the MagickSetImageType method is:
10050 % MagickBooleanType MagickSetImageType(MagickWand *wand,
10051 % const ImageType image_type)
10053 % A description of each parameter follows:
10055 % o wand: the magick wand.
10057 % o image_type: the image type: UndefinedType, BilevelType, GrayscaleType,
10058 % GrayscaleMatteType, PaletteType, PaletteMatteType, TrueColorType,
10059 % TrueColorMatteType, ColorSeparationType, ColorSeparationMatteType,
10063 WandExport MagickBooleanType MagickSetImageType(MagickWand *wand,
10064 const ImageType image_type)
10066 assert(wand != (MagickWand *) NULL);
10067 assert(wand->signature == WandSignature);
10068 if (wand->debug != MagickFalse)
10069 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10070 if (wand->images == (Image *) NULL)
10071 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10072 return(SetImageType(wand->images,image_type,wand->exception));
10076 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10080 % M a g i c k S e t I m a g e U n i t s %
10084 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10086 % MagickSetImageUnits() sets the image units of resolution.
10088 % The format of the MagickSetImageUnits method is:
10090 % MagickBooleanType MagickSetImageUnits(MagickWand *wand,
10091 % const ResolutionType units)
10093 % A description of each parameter follows:
10095 % o wand: the magick wand.
10097 % o units: the image units of resolution : UndefinedResolution,
10098 % PixelsPerInchResolution, or PixelsPerCentimeterResolution.
10101 WandExport MagickBooleanType MagickSetImageUnits(MagickWand *wand,
10102 const ResolutionType units)
10104 assert(wand != (MagickWand *) NULL);
10105 assert(wand->signature == WandSignature);
10106 if (wand->debug != MagickFalse)
10107 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10108 if (wand->images == (Image *) NULL)
10109 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10110 wand->images->units=units;
10111 return(MagickTrue);
10115 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10119 % M a g i c k S e t I m a g e V i r t u a l P i x e l M e t h o d %
10123 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10125 % MagickSetImageVirtualPixelMethod() sets the image virtual pixel method.
10127 % The format of the MagickSetImageVirtualPixelMethod method is:
10129 % VirtualPixelMethod MagickSetImageVirtualPixelMethod(MagickWand *wand,
10130 % const VirtualPixelMethod method)
10132 % A description of each parameter follows:
10134 % o wand: the magick wand.
10136 % o method: the image virtual pixel method : UndefinedVirtualPixelMethod,
10137 % ConstantVirtualPixelMethod, EdgeVirtualPixelMethod,
10138 % MirrorVirtualPixelMethod, or TileVirtualPixelMethod.
10141 WandExport VirtualPixelMethod MagickSetImageVirtualPixelMethod(MagickWand *wand,
10142 const VirtualPixelMethod method)
10144 assert(wand != (MagickWand *) NULL);
10145 assert(wand->signature == WandSignature);
10146 if (wand->debug != MagickFalse)
10147 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10148 if (wand->images == (Image *) NULL)
10149 return(UndefinedVirtualPixelMethod);
10150 return(SetImageVirtualPixelMethod(wand->images,method,wand->exception));
10154 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10158 % M a g i c k S e t I m a g e W h i t e P o i n t %
10162 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10164 % MagickSetImageWhitePoint() sets the image chromaticity white point.
10166 % The format of the MagickSetImageWhitePoint method is:
10168 % MagickBooleanType MagickSetImageWhitePoint(MagickWand *wand,
10169 % const double x,const double y)
10171 % A description of each parameter follows:
10173 % o wand: the magick wand.
10175 % o x: the white x-point.
10177 % o y: the white y-point.
10180 WandExport MagickBooleanType MagickSetImageWhitePoint(MagickWand *wand,
10181 const double x,const double y)
10183 assert(wand != (MagickWand *) NULL);
10184 assert(wand->signature == WandSignature);
10185 if (wand->debug != MagickFalse)
10186 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10187 if (wand->images == (Image *) NULL)
10188 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10189 wand->images->chromaticity.white_point.x=x;
10190 wand->images->chromaticity.white_point.y=y;
10191 return(MagickTrue);
10195 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10199 % M a g i c k S h a d e I m a g e C h a n n e l %
10203 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10205 % MagickShadeImage() shines a distant light on an image to create a
10206 % three-dimensional effect. You control the positioning of the light with
10207 % azimuth and elevation; azimuth is measured in degrees off the x axis
10208 % and elevation is measured in pixels above the Z axis.
10210 % The format of the MagickShadeImage method is:
10212 % MagickBooleanType MagickShadeImage(MagickWand *wand,
10213 % const MagickBooleanType gray,const double azimuth,
10214 % const double elevation)
10216 % A description of each parameter follows:
10218 % o wand: the magick wand.
10220 % o gray: A value other than zero shades the intensity of each pixel.
10222 % o azimuth, elevation: Define the light source direction.
10225 WandExport MagickBooleanType MagickShadeImage(MagickWand *wand,
10226 const MagickBooleanType gray,const double asimuth,const double elevation)
10231 assert(wand != (MagickWand *) NULL);
10232 assert(wand->signature == WandSignature);
10233 if (wand->debug != MagickFalse)
10234 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10235 if (wand->images == (Image *) NULL)
10236 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10237 shade_image=ShadeImage(wand->images,gray,asimuth,elevation,wand->exception);
10238 if (shade_image == (Image *) NULL)
10239 return(MagickFalse);
10240 ReplaceImageInList(&wand->images,shade_image);
10241 return(MagickTrue);
10245 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10249 % M a g i c k S h a d o w I m a g e %
10253 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10255 % MagickShadowImage() simulates an image shadow.
10257 % The format of the MagickShadowImage method is:
10259 % MagickBooleanType MagickShadowImage(MagickWand *wand,
10260 % const double alpha,const double sigma,const double bias,
10261 % const ssize_t x,const ssize_t y)
10263 % A description of each parameter follows:
10265 % o wand: the magick wand.
10267 % o alpha: percentage transparency.
10269 % o sigma: the standard deviation of the Gaussian, in pixels.
10271 % o bias: the bias.
10273 % o x: the shadow x-offset.
10275 % o y: the shadow y-offset.
10278 WandExport MagickBooleanType MagickShadowImage(MagickWand *wand,
10279 const double alpha,const double sigma,const double bias,const ssize_t x,
10285 assert(wand != (MagickWand *) NULL);
10286 assert(wand->signature == WandSignature);
10287 if (wand->debug != MagickFalse)
10288 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10289 if (wand->images == (Image *) NULL)
10290 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10291 shadow_image=ShadowImage(wand->images,alpha,sigma,bias,x,y,wand->exception);
10292 if (shadow_image == (Image *) NULL)
10293 return(MagickFalse);
10294 ReplaceImageInList(&wand->images,shadow_image);
10295 return(MagickTrue);
10299 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10303 % M a g i c k S h a r p e n I m a g e %
10307 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10309 % MagickSharpenImage() sharpens an image. We convolve the image with a
10310 % Gaussian operator of the given radius and standard deviation (sigma).
10311 % For reasonable results, the radius should be larger than sigma. Use a
10312 % radius of 0 and MagickSharpenImage() selects a suitable radius for you.
10314 % The format of the MagickSharpenImage method is:
10316 % MagickBooleanType MagickSharpenImage(MagickWand *wand,
10317 % const double radius,const double sigma,const double bias)
10319 % A description of each parameter follows:
10321 % o wand: the magick wand.
10323 % o radius: the radius of the Gaussian, in pixels, not counting the center
10326 % o sigma: the standard deviation of the Gaussian, in pixels.
10328 % o bias: the bias.
10331 WandExport MagickBooleanType MagickSharpenImage(MagickWand *wand,
10332 const double radius,const double sigma,const double bias)
10337 assert(wand != (MagickWand *) NULL);
10338 assert(wand->signature == WandSignature);
10339 if (wand->debug != MagickFalse)
10340 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10341 if (wand->images == (Image *) NULL)
10342 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10343 sharp_image=SharpenImage(wand->images,radius,sigma,bias,wand->exception);
10344 if (sharp_image == (Image *) NULL)
10345 return(MagickFalse);
10346 ReplaceImageInList(&wand->images,sharp_image);
10347 return(MagickTrue);
10351 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10355 % M a g i c k S h a v e I m a g e %
10359 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10361 % MagickShaveImage() shaves pixels from the image edges. It allocates the
10362 % memory necessary for the new Image structure and returns a pointer to the
10365 % The format of the MagickShaveImage method is:
10367 % MagickBooleanType MagickShaveImage(MagickWand *wand,
10368 % const size_t columns,const size_t rows)
10370 % A description of each parameter follows:
10372 % o wand: the magick wand.
10374 % o columns: the number of columns in the scaled image.
10376 % o rows: the number of rows in the scaled image.
10380 WandExport MagickBooleanType MagickShaveImage(MagickWand *wand,
10381 const size_t columns,const size_t rows)
10389 assert(wand != (MagickWand *) NULL);
10390 assert(wand->signature == WandSignature);
10391 if (wand->debug != MagickFalse)
10392 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10393 if (wand->images == (Image *) NULL)
10394 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10395 shave_info.width=columns;
10396 shave_info.height=rows;
10399 shave_image=ShaveImage(wand->images,&shave_info,wand->exception);
10400 if (shave_image == (Image *) NULL)
10401 return(MagickFalse);
10402 ReplaceImageInList(&wand->images,shave_image);
10403 return(MagickTrue);
10407 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10411 % M a g i c k S h e a r I m a g e %
10415 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10417 % MagickShearImage() slides one edge of an image along the X or Y axis,
10418 % creating a parallelogram. An X direction shear slides an edge along the X
10419 % axis, while a Y direction shear slides an edge along the Y axis. The amount
10420 % of the shear is controlled by a shear angle. For X direction shears, x_shear
10421 % is measured relative to the Y axis, and similarly, for Y direction shears
10422 % y_shear is measured relative to the X axis. Empty triangles left over from
10423 % shearing the image are filled with the background color.
10425 % The format of the MagickShearImage method is:
10427 % MagickBooleanType MagickShearImage(MagickWand *wand,
10428 % const PixelWand *background,const double x_shear,onst double y_shear)
10430 % A description of each parameter follows:
10432 % o wand: the magick wand.
10434 % o background: the background pixel wand.
10436 % o x_shear: the number of degrees to shear the image.
10438 % o y_shear: the number of degrees to shear the image.
10441 WandExport MagickBooleanType MagickShearImage(MagickWand *wand,
10442 const PixelWand *background,const double x_shear,const double y_shear)
10447 assert(wand != (MagickWand *) NULL);
10448 assert(wand->signature == WandSignature);
10449 if (wand->debug != MagickFalse)
10450 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10451 if (wand->images == (Image *) NULL)
10452 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10453 PixelGetQuantumPacket(background,&wand->images->background_color);
10454 shear_image=ShearImage(wand->images,x_shear,y_shear,wand->exception);
10455 if (shear_image == (Image *) NULL)
10456 return(MagickFalse);
10457 ReplaceImageInList(&wand->images,shear_image);
10458 return(MagickTrue);
10462 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10466 % M a g i c k S i g m o i d a l C o n t r a s t I m a g e %
10470 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10472 % MagickSigmoidalContrastImage() adjusts the contrast of an image with a
10473 % non-linear sigmoidal contrast algorithm. Increase the contrast of the
10474 % image using a sigmoidal transfer function without saturating highlights or
10475 % shadows. Contrast indicates how much to increase the contrast (0 is none;
10476 % 3 is typical; 20 is pushing it); mid-point indicates where midtones fall in
10477 % the resultant image (0 is white; 50% is middle-gray; 100% is black). Set
10478 % sharpen to MagickTrue to increase the image contrast otherwise the contrast
10481 % The format of the MagickSigmoidalContrastImage method is:
10483 % MagickBooleanType MagickSigmoidalContrastImage(MagickWand *wand,
10484 % const MagickBooleanType sharpen,const double alpha,const double beta)
10486 % A description of each parameter follows:
10488 % o wand: the magick wand.
10490 % o sharpen: Increase or decrease image contrast.
10492 % o alpha: strength of the contrast, the larger the number the more
10493 % 'threshold-like' it becomes.
10495 % o beta: midpoint of the function as a color value 0 to QuantumRange.
10498 WandExport MagickBooleanType MagickSigmoidalContrastImage(
10499 MagickWand *wand,const MagickBooleanType sharpen,const double alpha,
10505 assert(wand != (MagickWand *) NULL);
10506 assert(wand->signature == WandSignature);
10507 if (wand->debug != MagickFalse)
10508 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10509 if (wand->images == (Image *) NULL)
10510 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10511 status=SigmoidalContrastImage(wand->images,sharpen,alpha,beta,
10517 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10521 % M a g i c k S i m i l a r i t y I m a g e %
10525 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10527 % MagickSimilarityImage() compares the reference image of the image and
10528 % returns the best match offset. In addition, it returns a similarity image
10529 % such that an exact match location is completely white and if none of the
10530 % pixels match, black, otherwise some gray level in-between.
10532 % The format of the MagickSimilarityImage method is:
10534 % MagickWand *MagickSimilarityImage(MagickWand *wand,
10535 % const MagickWand *reference,const MetricType metric,
10536 % RectangeInfo *offset,double *similarity)
10538 % A description of each parameter follows:
10540 % o wand: the magick wand.
10542 % o reference: the reference wand.
10544 % o metric: the metric.
10546 % o offset: the best match offset of the reference image within the image.
10548 % o similarity: the computed similarity between the images.
10551 WandExport MagickWand *MagickSimilarityImage(MagickWand *wand,
10552 const MagickWand *reference,const MetricType metric,RectangleInfo *offset,
10553 double *similarity)
10558 assert(wand != (MagickWand *) NULL);
10559 assert(wand->signature == WandSignature);
10560 if (wand->debug != MagickFalse)
10561 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10562 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
10564 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
10565 "ContainsNoImages","`%s'",wand->name);
10566 return((MagickWand *) NULL);
10568 similarity_image=SimilarityImage(wand->images,reference->images,metric,offset,
10569 similarity,wand->exception);
10570 if (similarity_image == (Image *) NULL)
10571 return((MagickWand *) NULL);
10572 return(CloneMagickWandFromImages(wand,similarity_image));
10576 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10580 % M a g i c k S k e t c h I m a g e %
10584 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10586 % MagickSketchImage() simulates a pencil sketch. We convolve the image with
10587 % a Gaussian operator of the given radius and standard deviation (sigma).
10588 % For reasonable results, radius should be larger than sigma. Use a
10589 % radius of 0 and SketchImage() selects a suitable radius for you.
10590 % Angle gives the angle of the blurring motion.
10592 % The format of the MagickSketchImage method is:
10594 % MagickBooleanType MagickSketchImage(MagickWand *wand,
10595 % const double radius,const double sigma,const double angle,
10596 % const double bias)
10598 % A description of each parameter follows:
10600 % o wand: the magick wand.
10602 % o radius: the radius of the Gaussian, in pixels, not counting
10603 % the center pixel.
10605 % o sigma: the standard deviation of the Gaussian, in pixels.
10607 % o angle: apply the effect along this angle.
10609 % o bias: the bias.
10612 WandExport MagickBooleanType MagickSketchImage(MagickWand *wand,
10613 const double radius,const double sigma,const double angle,const double bias)
10618 assert(wand != (MagickWand *) NULL);
10619 assert(wand->signature == WandSignature);
10620 if (wand->debug != MagickFalse)
10621 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10622 if (wand->images == (Image *) NULL)
10623 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10624 sketch_image=SketchImage(wand->images,radius,sigma,angle,bias,
10626 if (sketch_image == (Image *) NULL)
10627 return(MagickFalse);
10628 ReplaceImageInList(&wand->images,sketch_image);
10629 return(MagickTrue);
10633 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10637 % M a g i c k S m u s h I m a g e s %
10641 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10643 % MagickSmushImages() takes all images from the current image pointer to the
10644 % end of the image list and smushs them to each other top-to-bottom if the
10645 % stack parameter is true, otherwise left-to-right.
10647 % The format of the MagickSmushImages method is:
10649 % MagickWand *MagickSmushImages(MagickWand *wand,
10650 % const MagickBooleanType stack,const ssize_t offset)
10652 % A description of each parameter follows:
10654 % o wand: the magick wand.
10656 % o stack: By default, images are stacked left-to-right. Set stack to
10657 % MagickTrue to stack them top-to-bottom.
10659 % o offset: minimum distance in pixels between images.
10662 WandExport MagickWand *MagickSmushImages(MagickWand *wand,
10663 const MagickBooleanType stack,const ssize_t offset)
10668 assert(wand != (MagickWand *) NULL);
10669 assert(wand->signature == WandSignature);
10670 if (wand->debug != MagickFalse)
10671 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10672 if (wand->images == (Image *) NULL)
10673 return((MagickWand *) NULL);
10674 smush_image=SmushImages(wand->images,stack,offset,wand->exception);
10675 if (smush_image == (Image *) NULL)
10676 return((MagickWand *) NULL);
10677 return(CloneMagickWandFromImages(wand,smush_image));
10681 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10685 % M a g i c k S o l a r i z e I m a g e %
10689 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10691 % MagickSolarizeImage() applies a special effect to the image, similar to the
10692 % effect achieved in a photo darkroom by selectively exposing areas of photo
10693 % sensitive paper to light. Threshold ranges from 0 to QuantumRange and is a
10694 % measure of the extent of the solarization.
10696 % The format of the MagickSolarizeImage method is:
10698 % MagickBooleanType MagickSolarizeImage(MagickWand *wand,
10699 % const double threshold)
10701 % A description of each parameter follows:
10703 % o wand: the magick wand.
10705 % o threshold: Define the extent of the solarization.
10708 WandExport MagickBooleanType MagickSolarizeImage(MagickWand *wand,
10709 const double threshold)
10714 assert(wand != (MagickWand *) NULL);
10715 assert(wand->signature == WandSignature);
10716 if (wand->debug != MagickFalse)
10717 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10718 if (wand->images == (Image *) NULL)
10719 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10720 status=SolarizeImage(wand->images,threshold,wand->exception);
10725 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10729 % M a g i c k S p a r s e C o l o r I m a g e %
10733 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10735 % MagickSparseColorImage(), given a set of coordinates, interpolates the
10736 % colors found at those coordinates, across the whole image, using various
10739 % The format of the MagickSparseColorImage method is:
10741 % MagickBooleanType MagickSparseColorImage(MagickWand *wand,
10742 % const SparseColorMethod method,const size_t number_arguments,
10743 % const double *arguments)
10745 % A description of each parameter follows:
10747 % o image: the image to be sparseed.
10749 % o method: the method of image sparseion.
10751 % ArcSparseColorion will always ignore source image offset, and always
10752 % 'bestfit' the destination image with the top left corner offset
10753 % relative to the polar mapping center.
10755 % Bilinear has no simple inverse mapping so will not allow 'bestfit'
10756 % style of image sparseion.
10758 % Affine, Perspective, and Bilinear, will do least squares fitting of
10759 % the distrotion when more than the minimum number of control point
10760 % pairs are provided.
10762 % Perspective, and Bilinear, will fall back to a Affine sparseion when
10763 % less than 4 control point pairs are provided. While Affine sparseions
10764 % will let you use any number of control point pairs, that is Zero pairs
10765 % is a No-Op (viewport only) distrotion, one pair is a translation and
10766 % two pairs of control points will do a scale-rotate-translate, without
10769 % o number_arguments: the number of arguments given for this sparseion
10772 % o arguments: the arguments for this sparseion method.
10775 WandExport MagickBooleanType MagickSparseColorImage(MagickWand *wand,
10776 const SparseColorMethod method,const size_t number_arguments,
10777 const double *arguments)
10782 assert(wand != (MagickWand *) NULL);
10783 assert(wand->signature == WandSignature);
10784 if (wand->debug != MagickFalse)
10785 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10786 if (wand->images == (Image *) NULL)
10787 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10788 sparse_image=SparseColorImage(wand->images,method,number_arguments,arguments,
10790 if (sparse_image == (Image *) NULL)
10791 return(MagickFalse);
10792 ReplaceImageInList(&wand->images,sparse_image);
10793 return(MagickTrue);
10797 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10801 % M a g i c k S p l i c e I m a g e %
10805 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10807 % MagickSpliceImage() splices a solid color into the image.
10809 % The format of the MagickSpliceImage method is:
10811 % MagickBooleanType MagickSpliceImage(MagickWand *wand,
10812 % const size_t width,const size_t height,const ssize_t x,
10815 % A description of each parameter follows:
10817 % o wand: the magick wand.
10819 % o width: the region width.
10821 % o height: the region height.
10823 % o x: the region x offset.
10825 % o y: the region y offset.
10828 WandExport MagickBooleanType MagickSpliceImage(MagickWand *wand,
10829 const size_t width,const size_t height,const ssize_t x,
10838 assert(wand != (MagickWand *) NULL);
10839 assert(wand->signature == WandSignature);
10840 if (wand->debug != MagickFalse)
10841 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10842 if (wand->images == (Image *) NULL)
10843 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10844 splice.width=width;
10845 splice.height=height;
10848 splice_image=SpliceImage(wand->images,&splice,wand->exception);
10849 if (splice_image == (Image *) NULL)
10850 return(MagickFalse);
10851 ReplaceImageInList(&wand->images,splice_image);
10852 return(MagickTrue);
10856 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10860 % M a g i c k S p r e a d I m a g e %
10864 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10866 % MagickSpreadImage() is a special effects method that randomly displaces each
10867 % pixel in a block defined by the radius parameter.
10869 % The format of the MagickSpreadImage method is:
10871 % MagickBooleanType MagickSpreadImage(MagickWand *wand,const double radius,
10872 % const PixelInterpolateMethod method)
10874 % A description of each parameter follows:
10876 % o wand: the magick wand.
10878 % o radius: Choose a random pixel in a neighborhood of this extent.
10880 % o method: the pixel interpolation method.
10883 WandExport MagickBooleanType MagickSpreadImage(MagickWand *wand,
10884 const double radius,const PixelInterpolateMethod method)
10889 assert(wand != (MagickWand *) NULL);
10890 assert(wand->signature == WandSignature);
10891 if (wand->debug != MagickFalse)
10892 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10893 if (wand->images == (Image *) NULL)
10894 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10895 spread_image=SpreadImage(wand->images,radius,method,wand->exception);
10896 if (spread_image == (Image *) NULL)
10897 return(MagickFalse);
10898 ReplaceImageInList(&wand->images,spread_image);
10899 return(MagickTrue);
10903 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10907 % M a g i c k S t a t i s t i c I m a g e %
10911 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10913 % MagickStatisticImage() replace each pixel with corresponding statistic from
10914 % the neighborhood of the specified width and height.
10916 % The format of the MagickStatisticImage method is:
10918 % MagickBooleanType MagickStatisticImage(MagickWand *wand,
10919 % const StatisticType type,const double width,const size_t height)
10921 % A description of each parameter follows:
10923 % o wand: the magick wand.
10925 % o type: the statistic type (e.g. median, mode, etc.).
10927 % o width: the width of the pixel neighborhood.
10929 % o height: the height of the pixel neighborhood.
10932 WandExport MagickBooleanType MagickStatisticImage(MagickWand *wand,
10933 const StatisticType type,const size_t width,const size_t height)
10938 assert(wand != (MagickWand *) NULL);
10939 assert(wand->signature == WandSignature);
10940 if (wand->debug != MagickFalse)
10941 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10942 if (wand->images == (Image *) NULL)
10943 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10944 statistic_image=StatisticImage(wand->images,type,width,height,
10946 if (statistic_image == (Image *) NULL)
10947 return(MagickFalse);
10948 ReplaceImageInList(&wand->images,statistic_image);
10949 return(MagickTrue);
10953 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10957 % M a g i c k S t e g a n o I m a g e %
10961 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10963 % MagickSteganoImage() hides a digital watermark within the image.
10964 % Recover the hidden watermark later to prove that the authenticity of
10965 % an image. Offset defines the start position within the image to hide
10968 % The format of the MagickSteganoImage method is:
10970 % MagickWand *MagickSteganoImage(MagickWand *wand,
10971 % const MagickWand *watermark_wand,const ssize_t offset)
10973 % A description of each parameter follows:
10975 % o wand: the magick wand.
10977 % o watermark_wand: the watermark wand.
10979 % o offset: Start hiding at this offset into the image.
10982 WandExport MagickWand *MagickSteganoImage(MagickWand *wand,
10983 const MagickWand *watermark_wand,const ssize_t offset)
10988 assert(wand != (MagickWand *) NULL);
10989 assert(wand->signature == WandSignature);
10990 if (wand->debug != MagickFalse)
10991 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10992 if ((wand->images == (Image *) NULL) ||
10993 (watermark_wand->images == (Image *) NULL))
10995 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
10996 "ContainsNoImages","`%s'",wand->name);
10997 return((MagickWand *) NULL);
10999 wand->images->offset=offset;
11000 stegano_image=SteganoImage(wand->images,watermark_wand->images,
11002 if (stegano_image == (Image *) NULL)
11003 return((MagickWand *) NULL);
11004 return(CloneMagickWandFromImages(wand,stegano_image));
11008 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11012 % M a g i c k S t e r e o I m a g e %
11016 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11018 % MagickStereoImage() composites two images and produces a single image that
11019 % is the composite of a left and right image of a stereo pair
11021 % The format of the MagickStereoImage method is:
11023 % MagickWand *MagickStereoImage(MagickWand *wand,
11024 % const MagickWand *offset_wand)
11026 % A description of each parameter follows:
11028 % o wand: the magick wand.
11030 % o offset_wand: Another image wand.
11033 WandExport MagickWand *MagickStereoImage(MagickWand *wand,
11034 const MagickWand *offset_wand)
11039 assert(wand != (MagickWand *) NULL);
11040 assert(wand->signature == WandSignature);
11041 if (wand->debug != MagickFalse)
11042 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11043 if ((wand->images == (Image *) NULL) ||
11044 (offset_wand->images == (Image *) NULL))
11046 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
11047 "ContainsNoImages","`%s'",wand->name);
11048 return((MagickWand *) NULL);
11050 stereo_image=StereoImage(wand->images,offset_wand->images,wand->exception);
11051 if (stereo_image == (Image *) NULL)
11052 return((MagickWand *) NULL);
11053 return(CloneMagickWandFromImages(wand,stereo_image));
11057 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11061 % M a g i c k S t r i p I m a g e %
11065 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11067 % MagickStripImage() strips an image of all profiles and comments.
11069 % The format of the MagickStripImage method is:
11071 % MagickBooleanType MagickStripImage(MagickWand *wand)
11073 % A description of each parameter follows:
11075 % o wand: the magick wand.
11078 WandExport MagickBooleanType MagickStripImage(MagickWand *wand)
11080 assert(wand != (MagickWand *) NULL);
11081 assert(wand->signature == WandSignature);
11082 if (wand->debug != MagickFalse)
11083 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11084 if (wand->images == (Image *) NULL)
11085 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11086 return(StripImage(wand->images,wand->exception));
11090 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11094 % M a g i c k S w i r l I m a g e %
11098 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11100 % MagickSwirlImage() swirls the pixels about the center of the image, where
11101 % degrees indicates the sweep of the arc through which each pixel is moved.
11102 % You get a more dramatic effect as the degrees move from 1 to 360.
11104 % The format of the MagickSwirlImage method is:
11106 % MagickBooleanType MagickSwirlImage(MagickWand *wand,const double degrees,
11107 % const PixelInterpolateMethod method)
11109 % A description of each parameter follows:
11111 % o wand: the magick wand.
11113 % o degrees: Define the tightness of the swirling effect.
11115 % o method: the pixel interpolation method.
11118 WandExport MagickBooleanType MagickSwirlImage(MagickWand *wand,
11119 const double degrees,const PixelInterpolateMethod method)
11124 assert(wand != (MagickWand *) NULL);
11125 assert(wand->signature == WandSignature);
11126 if (wand->debug != MagickFalse)
11127 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11128 if (wand->images == (Image *) NULL)
11129 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11130 swirl_image=SwirlImage(wand->images,degrees,method,wand->exception);
11131 if (swirl_image == (Image *) NULL)
11132 return(MagickFalse);
11133 ReplaceImageInList(&wand->images,swirl_image);
11134 return(MagickTrue);
11138 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11142 % M a g i c k T e x t u r e I m a g e %
11146 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11148 % MagickTextureImage() repeatedly tiles the texture image across and down the
11151 % The format of the MagickTextureImage method is:
11153 % MagickWand *MagickTextureImage(MagickWand *wand,
11154 % const MagickWand *texture_wand)
11156 % A description of each parameter follows:
11158 % o wand: the magick wand.
11160 % o texture_wand: the texture wand
11163 WandExport MagickWand *MagickTextureImage(MagickWand *wand,
11164 const MagickWand *texture_wand)
11172 assert(wand != (MagickWand *) NULL);
11173 assert(wand->signature == WandSignature);
11174 if (wand->debug != MagickFalse)
11175 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11176 if ((wand->images == (Image *) NULL) ||
11177 (texture_wand->images == (Image *) NULL))
11179 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
11180 "ContainsNoImages","`%s'",wand->name);
11181 return((MagickWand *) NULL);
11183 texture_image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
11184 if (texture_image == (Image *) NULL)
11185 return((MagickWand *) NULL);
11186 status=TextureImage(texture_image,texture_wand->images,wand->exception);
11187 if (status == MagickFalse)
11189 texture_image=DestroyImage(texture_image);
11190 return((MagickWand *) NULL);
11192 return(CloneMagickWandFromImages(wand,texture_image));
11196 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11200 % M a g i c k T h r e s h o l d I m a g e %
11204 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11206 % MagickThresholdImage() changes the value of individual pixels based on
11207 % the intensity of each pixel compared to threshold. The result is a
11208 % high-contrast, two color image.
11210 % The format of the MagickThresholdImage method is:
11212 % MagickBooleanType MagickThresholdImage(MagickWand *wand,
11213 % const double threshold)
11214 % MagickBooleanType MagickThresholdImageChannel(MagickWand *wand,
11215 % const ChannelType channel,const double threshold)
11217 % A description of each parameter follows:
11219 % o wand: the magick wand.
11221 % o channel: the image channel(s).
11223 % o threshold: Define the threshold value.
11226 WandExport MagickBooleanType MagickThresholdImage(MagickWand *wand,
11227 const double threshold)
11232 status=MagickThresholdImageChannel(wand,DefaultChannels,threshold);
11236 WandExport MagickBooleanType MagickThresholdImageChannel(MagickWand *wand,
11237 const ChannelType channel,const double threshold)
11242 assert(wand != (MagickWand *) NULL);
11243 assert(wand->signature == WandSignature);
11244 if (wand->debug != MagickFalse)
11245 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11246 if (wand->images == (Image *) NULL)
11247 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11248 status=BilevelImage(wand->images,threshold,wand->exception);
11253 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11257 % M a g i c k T h u m b n a i l I m a g e %
11261 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11263 % MagickThumbnailImage() changes the size of an image to the given dimensions
11264 % and removes any associated profiles. The goal is to produce small low cost
11265 % thumbnail images suited for display on the Web.
11267 % The format of the MagickThumbnailImage method is:
11269 % MagickBooleanType MagickThumbnailImage(MagickWand *wand,
11270 % const size_t columns,const size_t rows)
11272 % A description of each parameter follows:
11274 % o wand: the magick wand.
11276 % o columns: the number of columns in the scaled image.
11278 % o rows: the number of rows in the scaled image.
11281 WandExport MagickBooleanType MagickThumbnailImage(MagickWand *wand,
11282 const size_t columns,const size_t rows)
11287 assert(wand != (MagickWand *) NULL);
11288 assert(wand->signature == WandSignature);
11289 if (wand->debug != MagickFalse)
11290 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11291 if (wand->images == (Image *) NULL)
11292 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11293 thumbnail_image=ThumbnailImage(wand->images,columns,rows,wand->exception);
11294 if (thumbnail_image == (Image *) NULL)
11295 return(MagickFalse);
11296 ReplaceImageInList(&wand->images,thumbnail_image);
11297 return(MagickTrue);
11301 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11305 % M a g i c k T i n t I m a g e %
11309 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11311 % MagickTintImage() applies a color vector to each pixel in the image. The
11312 % length of the vector is 0 for black and white and at its maximum for the
11313 % midtones. The vector weighting function is
11314 % f(x)=(1-(4.0*((x-0.5)*(x-0.5)))).
11316 % The format of the MagickTintImage method is:
11318 % MagickBooleanType MagickTintImage(MagickWand *wand,
11319 % const PixelWand *tint,const PixelWand *blend)
11321 % A description of each parameter follows:
11323 % o wand: the magick wand.
11325 % o tint: the tint pixel wand.
11327 % o alpha: the alpha pixel wand.
11330 WandExport MagickBooleanType MagickTintImage(MagickWand *wand,
11331 const PixelWand *tint,const PixelWand *blend)
11334 percent_blend[MaxTextExtent];
11342 assert(wand != (MagickWand *) NULL);
11343 assert(wand->signature == WandSignature);
11344 if (wand->debug != MagickFalse)
11345 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11346 if (wand->images == (Image *) NULL)
11347 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11348 if (wand->images->colorspace != CMYKColorspace)
11349 (void) FormatLocaleString(percent_blend,MaxTextExtent,
11350 "%g,%g,%g,%g",(double) (100.0*QuantumScale*
11351 PixelGetRedQuantum(blend)),(double) (100.0*QuantumScale*
11352 PixelGetGreenQuantum(blend)),(double) (100.0*QuantumScale*
11353 PixelGetBlueQuantum(blend)),(double) (100.0*QuantumScale*
11354 PixelGetAlphaQuantum(blend)));
11356 (void) FormatLocaleString(percent_blend,MaxTextExtent,
11357 "%g,%g,%g,%g,%g",(double) (100.0*QuantumScale*
11358 PixelGetCyanQuantum(blend)),(double) (100.0*QuantumScale*
11359 PixelGetMagentaQuantum(blend)),(double) (100.0*QuantumScale*
11360 PixelGetYellowQuantum(blend)),(double) (100.0*QuantumScale*
11361 PixelGetBlackQuantum(blend)),(double) (100.0*QuantumScale*
11362 PixelGetAlphaQuantum(blend)));
11363 target=PixelGetPixel(tint);
11364 tint_image=TintImage(wand->images,percent_blend,&target,wand->exception);
11365 if (tint_image == (Image *) NULL)
11366 return(MagickFalse);
11367 ReplaceImageInList(&wand->images,tint_image);
11368 return(MagickTrue);
11372 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11376 % M a g i c k T r a n s f o r m I m a g e %
11380 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11382 % MagickTransformImage() is a convenience method that behaves like
11383 % MagickResizeImage() or MagickCropImage() but accepts scaling and/or cropping
11384 % information as a region geometry specification. If the operation fails,
11385 % a NULL image handle is returned.
11387 % The format of the MagickTransformImage method is:
11389 % MagickWand *MagickTransformImage(MagickWand *wand,const char *crop,
11390 % const char *geometry)
11392 % A description of each parameter follows:
11394 % o wand: the magick wand.
11396 % o crop: A crop geometry string. This geometry defines a subregion of the
11399 % o geometry: An image geometry string. This geometry defines the final
11400 % size of the image.
11403 WandExport MagickWand *MagickTransformImage(MagickWand *wand,
11404 const char *crop,const char *geometry)
11412 assert(wand != (MagickWand *) NULL);
11413 assert(wand->signature == WandSignature);
11414 if (wand->debug != MagickFalse)
11415 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11416 if (wand->images == (Image *) NULL)
11417 return((MagickWand *) NULL);
11418 transform_image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
11419 if (transform_image == (Image *) NULL)
11420 return((MagickWand *) NULL);
11421 status=TransformImage(&transform_image,crop,geometry,wand->exception);
11422 if (status == MagickFalse)
11424 transform_image=DestroyImage(transform_image);
11425 return((MagickWand *) NULL);
11427 return(CloneMagickWandFromImages(wand,transform_image));
11431 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11435 % M a g i c k T r a n s f o r m I m a g e C o l o r s p a c e %
11439 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11441 % MagickTransformImageColorspace() transform the image colorspace.
11443 % The format of the MagickTransformImageColorspace method is:
11445 % MagickBooleanType MagickTransformImageColorspace(MagickWand *wand,
11446 % const ColorspaceType colorspace)
11448 % A description of each parameter follows:
11450 % o wand: the magick wand.
11452 % o colorspace: the image colorspace: UndefinedColorspace, RGBColorspace,
11453 % GRAYColorspace, TransparentColorspace, OHTAColorspace, XYZColorspace,
11454 % YCbCrColorspace, YCCColorspace, YIQColorspace, YPbPrColorspace,
11455 % YPbPrColorspace, YUVColorspace, CMYKColorspace, sRGBColorspace,
11456 % HSLColorspace, or HWBColorspace.
11459 WandExport MagickBooleanType MagickTransformImageColorspace(MagickWand *wand,
11460 const ColorspaceType colorspace)
11462 assert(wand != (MagickWand *) NULL);
11463 assert(wand->signature == WandSignature);
11464 if (wand->debug != MagickFalse)
11465 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11466 if (wand->images == (Image *) NULL)
11467 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11468 return(TransformImageColorspace(wand->images,colorspace,wand->exception));
11472 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11476 % M a g i c k T r a n s p a r e n t P a i n t I m a g e %
11480 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11482 % MagickTransparentPaintImage() changes any pixel that matches color with the
11483 % color defined by fill.
11485 % The format of the MagickTransparentPaintImage method is:
11487 % MagickBooleanType MagickTransparentPaintImage(MagickWand *wand,
11488 % const PixelWand *target,const double alpha,const double fuzz,
11489 % const MagickBooleanType invert)
11491 % A description of each parameter follows:
11493 % o wand: the magick wand.
11495 % o target: Change this target color to specified alpha value within
11498 % o alpha: the level of transparency: 1.0 is fully opaque and 0.0 is fully
11501 % o fuzz: By default target must match a particular pixel color
11502 % exactly. However, in many cases two colors may differ by a small amount.
11503 % The fuzz member of image defines how much tolerance is acceptable to
11504 % consider two colors as the same. For example, set fuzz to 10 and the
11505 % color red at intensities of 100 and 102 respectively are now interpreted
11506 % as the same color for the purposes of the floodfill.
11508 % o invert: paint any pixel that does not match the target color.
11511 WandExport MagickBooleanType MagickTransparentPaintImage(MagickWand *wand,
11512 const PixelWand *target,const double alpha,const double fuzz,
11513 const MagickBooleanType invert)
11521 assert(wand != (MagickWand *) NULL);
11522 assert(wand->signature == WandSignature);
11523 if (wand->debug != MagickFalse)
11524 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11525 if (wand->images == (Image *) NULL)
11526 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11527 PixelGetMagickColor(target,&target_pixel);
11528 wand->images->fuzz=fuzz;
11529 status=TransparentPaintImage(wand->images,&target_pixel,ClampToQuantum(
11530 QuantumRange*alpha),invert,wand->exception);
11535 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11539 % M a g i c k T r a n s p o s e I m a g e %
11543 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11545 % MagickTransposeImage() creates a vertical mirror image by reflecting the
11546 % pixels around the central x-axis while rotating them 90-degrees.
11548 % The format of the MagickTransposeImage method is:
11550 % MagickBooleanType MagickTransposeImage(MagickWand *wand)
11552 % A description of each parameter follows:
11554 % o wand: the magick wand.
11557 WandExport MagickBooleanType MagickTransposeImage(MagickWand *wand)
11562 assert(wand != (MagickWand *) NULL);
11563 assert(wand->signature == WandSignature);
11564 if (wand->debug != MagickFalse)
11565 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11566 if (wand->images == (Image *) NULL)
11567 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11568 transpose_image=TransposeImage(wand->images,wand->exception);
11569 if (transpose_image == (Image *) NULL)
11570 return(MagickFalse);
11571 ReplaceImageInList(&wand->images,transpose_image);
11572 return(MagickTrue);
11576 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11580 % M a g i c k T r a n s v e r s e I m a g e %
11584 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11586 % MagickTransverseImage() creates a horizontal mirror image by reflecting the
11587 % pixels around the central y-axis while rotating them 270-degrees.
11589 % The format of the MagickTransverseImage method is:
11591 % MagickBooleanType MagickTransverseImage(MagickWand *wand)
11593 % A description of each parameter follows:
11595 % o wand: the magick wand.
11598 WandExport MagickBooleanType MagickTransverseImage(MagickWand *wand)
11603 assert(wand != (MagickWand *) NULL);
11604 assert(wand->signature == WandSignature);
11605 if (wand->debug != MagickFalse)
11606 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11607 if (wand->images == (Image *) NULL)
11608 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11609 transverse_image=TransverseImage(wand->images,wand->exception);
11610 if (transverse_image == (Image *) NULL)
11611 return(MagickFalse);
11612 ReplaceImageInList(&wand->images,transverse_image);
11613 return(MagickTrue);
11617 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11621 % M a g i c k T r i m I m a g e %
11625 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11627 % MagickTrimImage() remove edges that are the background color from the image.
11629 % The format of the MagickTrimImage method is:
11631 % MagickBooleanType MagickTrimImage(MagickWand *wand,const double fuzz)
11633 % A description of each parameter follows:
11635 % o wand: the magick wand.
11637 % o fuzz: By default target must match a particular pixel color
11638 % exactly. However, in many cases two colors may differ by a small amount.
11639 % The fuzz member of image defines how much tolerance is acceptable to
11640 % consider two colors as the same. For example, set fuzz to 10 and the
11641 % color red at intensities of 100 and 102 respectively are now interpreted
11642 % as the same color for the purposes of the floodfill.
11645 WandExport MagickBooleanType MagickTrimImage(MagickWand *wand,const double fuzz)
11650 assert(wand != (MagickWand *) NULL);
11651 assert(wand->signature == WandSignature);
11652 if (wand->debug != MagickFalse)
11653 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11654 if (wand->images == (Image *) NULL)
11655 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11656 wand->images->fuzz=fuzz;
11657 trim_image=TrimImage(wand->images,wand->exception);
11658 if (trim_image == (Image *) NULL)
11659 return(MagickFalse);
11660 ReplaceImageInList(&wand->images,trim_image);
11661 return(MagickTrue);
11665 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11669 % M a g i c k U n i q u e I m a g e C o l o r s %
11673 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11675 % MagickUniqueImageColors() discards all but one of any pixel color.
11677 % The format of the MagickUniqueImageColors method is:
11679 % MagickBooleanType MagickUniqueImageColors(MagickWand *wand)
11681 % A description of each parameter follows:
11683 % o wand: the magick wand.
11686 WandExport MagickBooleanType MagickUniqueImageColors(MagickWand *wand)
11691 assert(wand != (MagickWand *) NULL);
11692 assert(wand->signature == WandSignature);
11693 if (wand->debug != MagickFalse)
11694 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11695 if (wand->images == (Image *) NULL)
11696 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11697 unique_image=UniqueImageColors(wand->images,wand->exception);
11698 if (unique_image == (Image *) NULL)
11699 return(MagickFalse);
11700 ReplaceImageInList(&wand->images,unique_image);
11701 return(MagickTrue);
11705 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11709 % M a g i c k U n s h a r p M a s k I m a g e %
11713 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11715 % MagickUnsharpMaskImage() sharpens an image. We convolve the image with a
11716 % Gaussian operator of the given radius and standard deviation (sigma).
11717 % For reasonable results, radius should be larger than sigma. Use a radius
11718 % of 0 and UnsharpMaskImage() selects a suitable radius for you.
11720 % The format of the MagickUnsharpMaskImage method is:
11722 % MagickBooleanType MagickUnsharpMaskImage(MagickWand *wand,
11723 % const double radius,const double sigma,const double amount,
11724 % const double threshold)
11726 % A description of each parameter follows:
11728 % o wand: the magick wand.
11730 % o radius: the radius of the Gaussian, in pixels, not counting the center
11733 % o sigma: the standard deviation of the Gaussian, in pixels.
11735 % o amount: the percentage of the difference between the original and the
11736 % blur image that is added back into the original.
11738 % o threshold: the threshold in pixels needed to apply the diffence amount.
11741 WandExport MagickBooleanType MagickUnsharpMaskImage(MagickWand *wand,
11742 const double radius,const double sigma,const double amount,
11743 const double threshold)
11748 assert(wand != (MagickWand *) NULL);
11749 assert(wand->signature == WandSignature);
11750 if (wand->debug != MagickFalse)
11751 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11752 if (wand->images == (Image *) NULL)
11753 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11754 unsharp_image=UnsharpMaskImage(wand->images,radius,sigma,amount,threshold,
11756 if (unsharp_image == (Image *) NULL)
11757 return(MagickFalse);
11758 ReplaceImageInList(&wand->images,unsharp_image);
11759 return(MagickTrue);
11763 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11767 % M a g i c k V i g n e t t e I m a g e %
11771 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11773 % MagickVignetteImage() softens the edges of the image in vignette style.
11775 % The format of the MagickVignetteImage method is:
11777 % MagickBooleanType MagickVignetteImage(MagickWand *wand,
11778 % const double radius,const double sigma,const double bias,
11779 % const ssize_t x,const ssize_t y)
11781 % A description of each parameter follows:
11783 % o wand: the magick wand.
11785 % o radius: the radius.
11787 % o sigma: the sigma.
11789 % o bias: the bias.
11791 % o x, y: Define the x and y ellipse offset.
11794 WandExport MagickBooleanType MagickVignetteImage(MagickWand *wand,
11795 const double radius,const double sigma,const double bias,const ssize_t x,
11801 assert(wand != (MagickWand *) NULL);
11802 assert(wand->signature == WandSignature);
11803 if (wand->debug != MagickFalse)
11804 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11805 if (wand->images == (Image *) NULL)
11806 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11807 vignette_image=VignetteImage(wand->images,radius,sigma,bias,x,y,
11809 if (vignette_image == (Image *) NULL)
11810 return(MagickFalse);
11811 ReplaceImageInList(&wand->images,vignette_image);
11812 return(MagickTrue);
11816 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11820 % M a g i c k W a v e I m a g e %
11824 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11826 % MagickWaveImage() creates a "ripple" effect in the image by shifting
11827 % the pixels vertically along a sine wave whose amplitude and wavelength
11828 % is specified by the given parameters.
11830 % The format of the MagickWaveImage method is:
11832 % MagickBooleanType MagickWaveImage(MagickWand *wand,
11833 % const double amplitude,const double wave_length,
11834 % const PixelInterpolateMethod method)
11836 % A description of each parameter follows:
11838 % o wand: the magick wand.
11840 % o amplitude, wave_length: Define the amplitude and wave length of the
11843 % o method: the pixel interpolation method.
11846 WandExport MagickBooleanType MagickWaveImage(MagickWand *wand,
11847 const double amplitude,const double wave_length,
11848 const PixelInterpolateMethod method)
11853 assert(wand != (MagickWand *) NULL);
11854 assert(wand->signature == WandSignature);
11855 if (wand->debug != MagickFalse)
11856 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11857 if (wand->images == (Image *) NULL)
11858 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11859 wave_image=WaveImage(wand->images,amplitude,wave_length,method,
11861 if (wave_image == (Image *) NULL)
11862 return(MagickFalse);
11863 ReplaceImageInList(&wand->images,wave_image);
11864 return(MagickTrue);
11868 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11872 % M a g i c k W h i t e T h r e s h o l d I m a g e %
11876 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11878 % MagickWhiteThresholdImage() is like ThresholdImage() but force all pixels
11879 % above the threshold into white while leaving all pixels below the threshold
11882 % The format of the MagickWhiteThresholdImage method is:
11884 % MagickBooleanType MagickWhiteThresholdImage(MagickWand *wand,
11885 % const PixelWand *threshold)
11887 % A description of each parameter follows:
11889 % o wand: the magick wand.
11891 % o threshold: the pixel wand.
11894 WandExport MagickBooleanType MagickWhiteThresholdImage(MagickWand *wand,
11895 const PixelWand *threshold)
11898 thresholds[MaxTextExtent];
11900 assert(wand != (MagickWand *) NULL);
11901 assert(wand->signature == WandSignature);
11902 if (wand->debug != MagickFalse)
11903 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11904 if (wand->images == (Image *) NULL)
11905 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11906 (void) FormatLocaleString(thresholds,MaxTextExtent,
11907 QuantumFormat "," QuantumFormat "," QuantumFormat "," QuantumFormat,
11908 PixelGetRedQuantum(threshold),PixelGetGreenQuantum(threshold),
11909 PixelGetBlueQuantum(threshold),PixelGetAlphaQuantum(threshold));
11910 return(WhiteThresholdImage(wand->images,thresholds,wand->exception));
11914 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11918 % M a g i c k W r i t e I m a g e %
11922 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11924 % MagickWriteImage() writes an image to the specified filename. If the
11925 % filename parameter is NULL, the image is written to the filename set
11926 % by MagickReadImage() or MagickSetImageFilename().
11928 % The format of the MagickWriteImage method is:
11930 % MagickBooleanType MagickWriteImage(MagickWand *wand,
11931 % const char *filename)
11933 % A description of each parameter follows:
11935 % o wand: the magick wand.
11937 % o filename: the image filename.
11941 WandExport MagickBooleanType MagickWriteImage(MagickWand *wand,
11942 const char *filename)
11953 assert(wand != (MagickWand *) NULL);
11954 assert(wand->signature == WandSignature);
11955 if (wand->debug != MagickFalse)
11956 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11957 if (wand->images == (Image *) NULL)
11958 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11959 if (filename != (const char *) NULL)
11960 (void) CopyMagickString(wand->images->filename,filename,MaxTextExtent);
11961 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
11962 if (image == (Image *) NULL)
11963 return(MagickFalse);
11964 write_info=CloneImageInfo(wand->image_info);
11965 write_info->adjoin=MagickTrue;
11966 status=WriteImage(write_info,image,wand->exception);
11967 image=DestroyImage(image);
11968 write_info=DestroyImageInfo(write_info);
11973 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11977 % M a g i c k W r i t e I m a g e F i l e %
11981 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11983 % MagickWriteImageFile() writes an image to an open file descriptor.
11985 % The format of the MagickWriteImageFile method is:
11987 % MagickBooleanType MagickWriteImageFile(MagickWand *wand,FILE *file)
11989 % A description of each parameter follows:
11991 % o wand: the magick wand.
11993 % o file: the file descriptor.
11996 WandExport MagickBooleanType MagickWriteImageFile(MagickWand *wand,FILE *file)
12007 assert(wand != (MagickWand *) NULL);
12008 assert(wand->signature == WandSignature);
12009 assert(file != (FILE *) NULL);
12010 if (wand->debug != MagickFalse)
12011 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12012 if (wand->images == (Image *) NULL)
12013 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12014 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
12015 if (image == (Image *) NULL)
12016 return(MagickFalse);
12017 write_info=CloneImageInfo(wand->image_info);
12018 SetImageInfoFile(write_info,file);
12019 write_info->adjoin=MagickTrue;
12020 status=WriteImage(write_info,image,wand->exception);
12021 write_info=DestroyImageInfo(write_info);
12022 image=DestroyImage(image);
12027 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12031 % M a g i c k W r i t e I m a g e s %
12035 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12037 % MagickWriteImages() writes an image or image sequence.
12039 % The format of the MagickWriteImages method is:
12041 % MagickBooleanType MagickWriteImages(MagickWand *wand,
12042 % const char *filename,const MagickBooleanType adjoin)
12044 % A description of each parameter follows:
12046 % o wand: the magick wand.
12048 % o filename: the image filename.
12050 % o adjoin: join images into a single multi-image file.
12053 WandExport MagickBooleanType MagickWriteImages(MagickWand *wand,
12054 const char *filename,const MagickBooleanType adjoin)
12062 assert(wand != (MagickWand *) NULL);
12063 assert(wand->signature == WandSignature);
12064 if (wand->debug != MagickFalse)
12065 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12066 if (wand->images == (Image *) NULL)
12067 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12068 write_info=CloneImageInfo(wand->image_info);
12069 write_info->adjoin=adjoin;
12070 status=WriteImages(write_info,wand->images,filename,wand->exception);
12071 write_info=DestroyImageInfo(write_info);
12076 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12080 % M a g i c k W r i t e I m a g e s F i l e %
12084 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12086 % MagickWriteImagesFile() writes an image sequence to an open file descriptor.
12088 % The format of the MagickWriteImagesFile method is:
12090 % MagickBooleanType MagickWriteImagesFile(MagickWand *wand,FILE *file)
12092 % A description of each parameter follows:
12094 % o wand: the magick wand.
12096 % o file: the file descriptor.
12099 WandExport MagickBooleanType MagickWriteImagesFile(MagickWand *wand,FILE *file)
12107 assert(wand != (MagickWand *) NULL);
12108 assert(wand->signature == WandSignature);
12109 if (wand->debug != MagickFalse)
12110 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12111 if (wand->images == (Image *) NULL)
12112 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12113 write_info=CloneImageInfo(wand->image_info);
12114 SetImageInfoFile(write_info,file);
12115 write_info->adjoin=MagickTrue;
12116 status=WriteImages(write_info,wand->images,(const char *) NULL,
12118 write_info=DestroyImageInfo(write_info);