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->images=images;
114 clone_wand->debug=IsEventLogging();
115 if (clone_wand->debug != MagickFalse)
116 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",clone_wand->name);
117 clone_wand->signature=WandSignature;
122 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
126 % G e t I m a g e F r o m M a g i c k W a n d %
130 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
132 % GetImageFromMagickWand() returns the current image from the magick wand.
134 % The format of the GetImageFromMagickWand method is:
136 % Image *GetImageFromMagickWand(const MagickWand *wand)
138 % A description of each parameter follows:
140 % o wand: the magick wand.
143 WandExport Image *GetImageFromMagickWand(const MagickWand *wand)
145 assert(wand != (MagickWand *) NULL);
146 assert(wand->signature == WandSignature);
147 if (wand->debug != MagickFalse)
148 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
149 if (wand->images == (Image *) NULL)
151 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
152 "ContainsNoImages","`%s'",wand->name);
153 return((Image *) NULL);
155 return(wand->images);
159 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
163 % 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 %
167 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
169 % MagickAdaptiveBlurImage() adaptively blurs the image by blurring
170 % less intensely near image edges and more intensely far from edges. We
171 % blur the image with a Gaussian operator of the given radius and standard
172 % deviation (sigma). For reasonable results, radius should be larger than
173 % sigma. Use a radius of 0 and MagickAdaptiveBlurImage() selects a
174 % suitable radius for you.
176 % The format of the MagickAdaptiveBlurImage method is:
178 % MagickBooleanType MagickAdaptiveBlurImage(MagickWand *wand,
179 % const double radius,const double sigma,const double bias)
181 % A description of each parameter follows:
183 % o wand: the magick wand.
185 % o radius: the radius of the Gaussian, in pixels, not counting the center
188 % o sigma: the standard deviation of the Gaussian, in pixels.
193 WandExport MagickBooleanType MagickAdaptiveBlurImage(MagickWand *wand,
194 const double radius,const double sigma,const double bias)
199 assert(wand != (MagickWand *) NULL);
200 assert(wand->signature == WandSignature);
201 if (wand->debug != MagickFalse)
202 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
203 if (wand->images == (Image *) NULL)
204 ThrowWandException(WandError,"ContainsNoImages",wand->name);
205 sharp_image=AdaptiveBlurImage(wand->images,radius,sigma,bias,wand->exception);
206 if (sharp_image == (Image *) NULL)
208 ReplaceImageInList(&wand->images,sharp_image);
213 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
217 % 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 %
221 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
223 % MagickAdaptiveResizeImage() adaptively resize image with data dependent
226 % MagickBooleanType MagickAdaptiveResizeImage(MagickWand *wand,
227 % const size_t columns,const size_t rows)
229 % A description of each parameter follows:
231 % o wand: the magick wand.
233 % o columns: the number of columns in the scaled image.
235 % o rows: the number of rows in the scaled image.
238 WandExport MagickBooleanType MagickAdaptiveResizeImage(MagickWand *wand,
239 const size_t columns,const size_t rows)
244 assert(wand != (MagickWand *) NULL);
245 assert(wand->signature == WandSignature);
246 if (wand->debug != MagickFalse)
247 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
248 if (wand->images == (Image *) NULL)
249 ThrowWandException(WandError,"ContainsNoImages",wand->name);
250 resize_image=AdaptiveResizeImage(wand->images,columns,rows,wand->exception);
251 if (resize_image == (Image *) NULL)
253 ReplaceImageInList(&wand->images,resize_image);
258 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
262 % 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 %
266 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
268 % MagickAdaptiveSharpenImage() adaptively sharpens the image by sharpening
269 % more intensely near image edges and less intensely far from edges. We
270 % sharpen the image with a Gaussian operator of the given radius and standard
271 % deviation (sigma). For reasonable results, radius should be larger than
272 % sigma. Use a radius of 0 and MagickAdaptiveSharpenImage() selects a
273 % suitable radius for you.
275 % The format of the MagickAdaptiveSharpenImage method is:
277 % MagickBooleanType MagickAdaptiveSharpenImage(MagickWand *wand,
278 % const double radius,const double sigma,const double bias)
280 % A description of each parameter follows:
282 % o wand: the magick wand.
284 % o radius: the radius of the Gaussian, in pixels, not counting the center
287 % o sigma: the standard deviation of the Gaussian, in pixels.
292 WandExport MagickBooleanType MagickAdaptiveSharpenImage(MagickWand *wand,
293 const double radius,const double sigma,const double bias)
298 assert(wand != (MagickWand *) NULL);
299 assert(wand->signature == WandSignature);
300 if (wand->debug != MagickFalse)
301 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
302 if (wand->images == (Image *) NULL)
303 ThrowWandException(WandError,"ContainsNoImages",wand->name);
304 sharp_image=AdaptiveSharpenImage(wand->images,radius,sigma,bias,
306 if (sharp_image == (Image *) NULL)
308 ReplaceImageInList(&wand->images,sharp_image);
313 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
317 % 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 %
321 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
323 % MagickAdaptiveThresholdImage() selects an individual threshold for each pixel
324 % based on the range of intensity values in its local neighborhood. This
325 % allows for thresholding of an image whose global intensity histogram
326 % doesn't contain distinctive peaks.
328 % The format of the AdaptiveThresholdImage method is:
330 % MagickBooleanType MagickAdaptiveThresholdImage(MagickWand *wand,
331 % const size_t width,const size_t height,const double bias)
333 % A description of each parameter follows:
335 % o wand: the magick wand.
337 % o width: the width of the local neighborhood.
339 % o height: the height of the local neighborhood.
341 % o offset: the mean bias.
344 WandExport MagickBooleanType MagickAdaptiveThresholdImage(MagickWand *wand,
345 const size_t width,const size_t height,const double bias)
350 assert(wand != (MagickWand *) NULL);
351 assert(wand->signature == WandSignature);
352 if (wand->debug != MagickFalse)
353 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
354 if (wand->images == (Image *) NULL)
355 ThrowWandException(WandError,"ContainsNoImages",wand->name);
356 threshold_image=AdaptiveThresholdImage(wand->images,width,height,bias,
358 if (threshold_image == (Image *) NULL)
360 ReplaceImageInList(&wand->images,threshold_image);
365 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
369 % M a g i c k A d d I m a g e %
373 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
375 % MagickAddImage() adds a clone of the images in the second wand and
376 % inserts them into the first wand, at the current image location.
378 % Use MagickSetFirstIterator(), to insert new images before all the current
379 % images in the wand, otherwise image is placed after the current image.
381 % The format of the MagickAddImage method is:
383 % MagickBooleanType MagickAddImage(MagickWand *wand,
384 % const MagickWand *add_wand)
386 % A description of each parameter follows:
388 % o wand: the magick wand.
390 % o add_wand: A wand that contains images to add at the current image
395 static inline MagickBooleanType InsertImageInWand(MagickWand *wand,
401 current=wand->images; /* note the current image */
403 /* if no images in wand, just add them and set first image as current */
404 if (current == (Image *) NULL)
406 wand->images=GetFirstImageInList(images);
410 /* user jumped to first image, so prepend new images - remain active */
411 if ((wand->set_first != MagickFalse) &&
412 (current->previous == (Image *) NULL) )
414 PrependImageToList(¤t,images);
415 wand->images=GetFirstImageInList(images);
418 wand->set_first = MagickFalse; /* flag no longer valid */
420 /* Current image was flagged as 'pending' iterative processing. */
421 if (wand->image_pending != MagickFalse)
423 /* current pending image is the last, append new images */
424 if (current->next == (Image *) NULL)
426 AppendImageToList(¤t,images);
427 wand->images=GetLastImageInList(images);
430 /* current pending image is the first image, prepend it */
431 if (current->previous == (Image *) NULL)
433 PrependImageToList(¤t,images);
434 wand->images=GetFirstImageInList(images);
439 /* if at last image append new images */
440 if (current->next == (Image *) NULL)
442 InsertImageInList(¤t,images);
443 wand->images=GetLastImageInList(images);
446 /* otherwise just insert image, just after the current image */
447 InsertImageInList(¤t,images);
448 wand->images=GetFirstImageInList(images);
452 WandExport MagickBooleanType MagickAddImage(MagickWand *wand,
453 const MagickWand *add_wand)
458 assert(wand != (MagickWand *) NULL);
459 assert(wand->signature == WandSignature);
460 if (wand->debug != MagickFalse)
461 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
462 assert(add_wand != (MagickWand *) NULL);
463 assert(add_wand->signature == WandSignature);
464 if (add_wand->images == (Image *) NULL)
465 ThrowWandException(WandError,"ContainsNoImages",add_wand->name);
467 /* clone images in second wand, and insert into first */
468 images=CloneImageList(add_wand->images,wand->exception);
469 if (images == (Image *) NULL)
471 return(InsertImageInWand(wand,images));
475 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
479 % M a g i c k A d d N o i s e I m a g e %
483 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
485 % MagickAddNoiseImage() adds random noise to the image.
487 % The format of the MagickAddNoiseImage method is:
489 % MagickBooleanType MagickAddNoiseImage(MagickWand *wand,
490 % const NoiseType noise_type,const double attenuate)
492 % A description of each parameter follows:
494 % o wand: the magick wand.
496 % o noise_type: The type of noise: Uniform, Gaussian, Multiplicative,
497 % Impulse, Laplacian, or Poisson.
499 % o attenuate: attenuate the random distribution.
502 WandExport MagickBooleanType MagickAddNoiseImage(MagickWand *wand,
503 const NoiseType noise_type,const double attenuate)
508 assert(wand != (MagickWand *) NULL);
509 assert(wand->signature == WandSignature);
510 if (wand->debug != MagickFalse)
511 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
512 if (wand->images == (Image *) NULL)
513 ThrowWandException(WandError,"ContainsNoImages",wand->name);
514 noise_image=AddNoiseImage(wand->images,noise_type,attenuate,wand->exception);
515 if (noise_image == (Image *) NULL)
517 ReplaceImageInList(&wand->images,noise_image);
522 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
526 % 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 %
530 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
532 % MagickAffineTransformImage() transforms an image as dictated by the affine
533 % matrix of the drawing wand.
535 % The format of the MagickAffineTransformImage method is:
537 % MagickBooleanType MagickAffineTransformImage(MagickWand *wand,
538 % const DrawingWand *drawing_wand)
540 % A description of each parameter follows:
542 % o wand: the magick wand.
544 % o drawing_wand: the draw wand.
547 WandExport MagickBooleanType MagickAffineTransformImage(MagickWand *wand,
548 const DrawingWand *drawing_wand)
556 assert(wand != (MagickWand *) NULL);
557 assert(wand->signature == WandSignature);
558 if (wand->debug != MagickFalse)
559 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
560 if (wand->images == (Image *) NULL)
561 ThrowWandException(WandError,"ContainsNoImages",wand->name);
562 draw_info=PeekDrawingWand(drawing_wand);
563 if (draw_info == (DrawInfo *) NULL)
565 affine_image=AffineTransformImage(wand->images,&draw_info->affine,
567 draw_info=DestroyDrawInfo(draw_info);
568 if (affine_image == (Image *) NULL)
570 ReplaceImageInList(&wand->images,affine_image);
575 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
579 % M a g i c k A n n o t a t e I m a g e %
583 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
585 % MagickAnnotateImage() annotates an image with text.
587 % The format of the MagickAnnotateImage method is:
589 % MagickBooleanType MagickAnnotateImage(MagickWand *wand,
590 % const DrawingWand *drawing_wand,const double x,const double y,
591 % const double angle,const char *text)
593 % A description of each parameter follows:
595 % o wand: the magick wand.
597 % o drawing_wand: the draw wand.
599 % o x: x ordinate to left of text
601 % o y: y ordinate to text baseline
603 % o angle: rotate text relative to this angle.
605 % o text: text to draw
608 WandExport MagickBooleanType MagickAnnotateImage(MagickWand *wand,
609 const DrawingWand *drawing_wand,const double x,const double y,
610 const double angle,const char *text)
613 geometry[MaxTextExtent];
621 assert(wand != (MagickWand *) NULL);
622 assert(wand->signature == WandSignature);
623 if (wand->debug != MagickFalse)
624 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
625 if (wand->images == (Image *) NULL)
626 ThrowWandException(WandError,"ContainsNoImages",wand->name);
627 draw_info=PeekDrawingWand(drawing_wand);
628 if (draw_info == (DrawInfo *) NULL)
630 (void) CloneString(&draw_info->text,text);
631 (void) FormatLocaleString(geometry,MaxTextExtent,"%+g%+g",x,y);
632 draw_info->affine.sx=cos((double) DegreesToRadians(fmod(angle,360.0)));
633 draw_info->affine.rx=sin((double) DegreesToRadians(fmod(angle,360.0)));
634 draw_info->affine.ry=(-sin((double) DegreesToRadians(fmod(angle,360.0))));
635 draw_info->affine.sy=cos((double) DegreesToRadians(fmod(angle,360.0)));
636 (void) CloneString(&draw_info->geometry,geometry);
637 status=AnnotateImage(wand->images,draw_info,wand->exception);
638 draw_info=DestroyDrawInfo(draw_info);
643 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
647 % M a g i c k A n i m a t e I m a g e s %
651 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
653 % MagickAnimateImages() animates an image or image sequence.
655 % The format of the MagickAnimateImages method is:
657 % MagickBooleanType MagickAnimateImages(MagickWand *wand,
658 % const char *server_name)
660 % A description of each parameter follows:
662 % o wand: the magick wand.
664 % o server_name: the X server name.
667 WandExport MagickBooleanType MagickAnimateImages(MagickWand *wand,
668 const char *server_name)
673 assert(wand != (MagickWand *) NULL);
674 assert(wand->signature == WandSignature);
675 if (wand->debug != MagickFalse)
676 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
677 (void) CloneString(&wand->image_info->server_name,server_name);
678 status=AnimateImages(wand->image_info,wand->images,wand->exception);
683 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
687 % M a g i c k A p p e n d I m a g e s %
691 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
693 % MagickAppendImages() append a set of images.
695 % The format of the MagickAppendImages method is:
697 % MagickWand *MagickAppendImages(MagickWand *wand,
698 % const MagickBooleanType stack)
700 % A description of each parameter follows:
702 % o wand: the magick wand.
704 % o stack: By default, images are stacked left-to-right. Set stack to
705 % MagickTrue to stack them top-to-bottom.
708 WandExport MagickWand *MagickAppendImages(MagickWand *wand,
709 const MagickBooleanType stack)
714 assert(wand != (MagickWand *) NULL);
715 assert(wand->signature == WandSignature);
716 if (wand->debug != MagickFalse)
717 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
718 if (wand->images == (Image *) NULL)
719 return((MagickWand *) NULL);
720 append_image=AppendImages(wand->images,stack,wand->exception);
721 if (append_image == (Image *) NULL)
722 return((MagickWand *) NULL);
723 return(CloneMagickWandFromImages(wand,append_image));
727 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
731 % M a g i c k A u t o G a m m a I m a g e %
735 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
737 % MagickAutoGammaImage() extracts the 'mean' from the image and adjust the
738 % image to try make set its gamma appropriatally.
740 % The format of the MagickAutoGammaImage method is:
742 % MagickBooleanType MagickAutoGammaImage(MagickWand *wand)
744 % A description of each parameter follows:
746 % o wand: the magick wand.
749 WandExport MagickBooleanType MagickAutoGammaImage(MagickWand *wand)
754 assert(wand != (MagickWand *) NULL);
755 assert(wand->signature == WandSignature);
756 if (wand->debug != MagickFalse)
757 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
758 if (wand->images == (Image *) NULL)
759 ThrowWandException(WandError,"ContainsNoImages",wand->name);
760 status=AutoGammaImage(wand->images,wand->exception);
765 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
769 % M a g i c k A u t o L e v e l I m a g e %
773 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
775 % MagickAutoLevelImage() adjusts the levels of a particular image channel by
776 % scaling the minimum and maximum values to the full quantum range.
778 % The format of the MagickAutoLevelImage method is:
780 % MagickBooleanType MagickAutoLevelImage(MagickWand *wand)
782 % A description of each parameter follows:
784 % o wand: the magick wand.
787 WandExport MagickBooleanType MagickAutoLevelImage(MagickWand *wand)
792 assert(wand != (MagickWand *) NULL);
793 assert(wand->signature == WandSignature);
794 if (wand->debug != MagickFalse)
795 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
796 if (wand->images == (Image *) NULL)
797 ThrowWandException(WandError,"ContainsNoImages",wand->name);
798 status=AutoLevelImage(wand->images,wand->exception);
803 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
807 % 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 %
811 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
813 % MagickBlackThresholdImage() is like MagickThresholdImage() but forces all
814 % pixels below the threshold into black while leaving all pixels above the
815 % threshold unchanged.
817 % The format of the MagickBlackThresholdImage method is:
819 % MagickBooleanType MagickBlackThresholdImage(MagickWand *wand,
820 % const PixelWand *threshold)
822 % A description of each parameter follows:
824 % o wand: the magick wand.
826 % o threshold: the pixel wand.
829 WandExport MagickBooleanType MagickBlackThresholdImage(MagickWand *wand,
830 const PixelWand *threshold)
833 thresholds[MaxTextExtent];
838 assert(wand != (MagickWand *) NULL);
839 assert(wand->signature == WandSignature);
840 if (wand->debug != MagickFalse)
841 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
842 if (wand->images == (Image *) NULL)
843 ThrowWandException(WandError,"ContainsNoImages",wand->name);
844 (void) FormatLocaleString(thresholds,MaxTextExtent,
845 QuantumFormat "," QuantumFormat "," QuantumFormat "," QuantumFormat,
846 PixelGetRedQuantum(threshold),PixelGetGreenQuantum(threshold),
847 PixelGetBlueQuantum(threshold),PixelGetAlphaQuantum(threshold));
848 status=BlackThresholdImage(wand->images,thresholds,wand->exception);
853 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
857 % M a g i c k B l u e S h i f t I m a g e %
861 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
863 % MagickBlueShiftImage() mutes the colors of the image to simulate a scene at
864 % nighttime in the moonlight.
866 % The format of the MagickBlueShiftImage method is:
868 % MagickBooleanType MagickBlueShiftImage(MagickWand *wand,
869 % const double factor)
871 % A description of each parameter follows:
873 % o wand: the magick wand.
875 % o factor: the blue shift factor (default 1.5)
878 WandExport MagickBooleanType MagickBlueShiftImage(MagickWand *wand,
884 assert(wand != (MagickWand *) NULL);
885 assert(wand->signature == WandSignature);
886 if (wand->debug != MagickFalse)
887 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
888 if (wand->images == (Image *) NULL)
889 ThrowWandException(WandError,"ContainsNoImages",wand->name);
890 shift_image=BlueShiftImage(wand->images,factor,wand->exception);
891 if (shift_image == (Image *) NULL)
893 ReplaceImageInList(&wand->images,shift_image);
898 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
902 % M a g i c k B l u r I m a g e %
906 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
908 % MagickBlurImage() blurs an image. We convolve the image with a
909 % gaussian operator of the given radius and standard deviation (sigma).
910 % For reasonable results, the radius should be larger than sigma. Use a
911 % radius of 0 and BlurImage() selects a suitable radius for you.
913 % The format of the MagickBlurImage method is:
915 % MagickBooleanType MagickBlurImage(MagickWand *wand,const double radius,
916 % const double sigmaconst double bias)
918 % A description of each parameter follows:
920 % o wand: the magick wand.
922 % o radius: the radius of the , in pixels, not counting the center
925 % o sigma: the standard deviation of the , in pixels.
930 WandExport MagickBooleanType MagickBlurImage(MagickWand *wand,
931 const double radius,const double sigma,const double bias)
936 assert(wand != (MagickWand *) NULL);
937 assert(wand->signature == WandSignature);
938 if (wand->debug != MagickFalse)
939 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
940 if (wand->images == (Image *) NULL)
941 ThrowWandException(WandError,"ContainsNoImages",wand->name);
942 blur_image=BlurImage(wand->images,radius,sigma,bias,wand->exception);
943 if (blur_image == (Image *) NULL)
945 ReplaceImageInList(&wand->images,blur_image);
950 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
954 % M a g i c k B o r d e r I m a g e %
958 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
960 % MagickBorderImage() surrounds the image with a border of the color defined
961 % by the bordercolor pixel wand.
963 % The format of the MagickBorderImage method is:
965 % MagickBooleanType MagickBorderImage(MagickWand *wand,
966 % const PixelWand *bordercolor,const size_t width,
967 % const size_t height,const CompositeOperator compose)
969 % A description of each parameter follows:
971 % o wand: the magick wand.
973 % o bordercolor: the border color pixel wand.
975 % o width: the border width.
977 % o height: the border height.
979 % o compose: the composite operator.
982 WandExport MagickBooleanType MagickBorderImage(MagickWand *wand,
983 const PixelWand *bordercolor,const size_t width,const size_t height,
984 const CompositeOperator compose)
992 assert(wand != (MagickWand *) NULL);
993 assert(wand->signature == WandSignature);
994 if (wand->debug != MagickFalse)
995 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
996 if (wand->images == (Image *) NULL)
997 ThrowWandException(WandError,"ContainsNoImages",wand->name);
998 border_info.width=width;
999 border_info.height=height;
1002 PixelGetQuantumPacket(bordercolor,&wand->images->border_color);
1003 border_image=BorderImage(wand->images,&border_info,compose,wand->exception);
1004 if (border_image == (Image *) NULL)
1005 return(MagickFalse);
1006 ReplaceImageInList(&wand->images,border_image);
1011 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1015 % 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 %
1019 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1021 % Use MagickBrightnessContrastImage() to change the brightness and/or contrast
1022 % of an image. It converts the brightness and contrast parameters into slope
1023 % and intercept and calls a polynomical function to apply to the image.
1026 % The format of the MagickBrightnessContrastImage method is:
1028 % MagickBooleanType MagickBrightnessContrastImage(MagickWand *wand,
1029 % const double brightness,const double contrast)
1031 % A description of each parameter follows:
1033 % o wand: the magick wand.
1035 % o brightness: the brightness percent (-100 .. 100).
1037 % o contrast: the contrast percent (-100 .. 100).
1040 WandExport MagickBooleanType MagickBrightnessContrastImage(
1041 MagickWand *wand,const double brightness,const double contrast)
1046 assert(wand != (MagickWand *) NULL);
1047 assert(wand->signature == WandSignature);
1048 if (wand->debug != MagickFalse)
1049 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1050 if (wand->images == (Image *) NULL)
1051 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1052 status=BrightnessContrastImage(wand->images,brightness,contrast,
1058 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1062 % M a g i c k C h a r c o a l I m a g e %
1066 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1068 % MagickCharcoalImage() simulates a charcoal drawing.
1070 % The format of the MagickCharcoalImage method is:
1072 % MagickBooleanType MagickCharcoalImage(MagickWand *wand,
1073 % const double radius,const double sigma,const double bias)
1075 % A description of each parameter follows:
1077 % o wand: the magick wand.
1079 % o radius: the radius of the Gaussian, in pixels, not counting the center
1082 % o sigma: the standard deviation of the Gaussian, in pixels.
1087 WandExport MagickBooleanType MagickCharcoalImage(MagickWand *wand,
1088 const double radius,const double sigma,const double bias)
1093 assert(wand != (MagickWand *) NULL);
1094 assert(wand->signature == WandSignature);
1095 if (wand->debug != MagickFalse)
1096 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1097 if (wand->images == (Image *) NULL)
1098 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1099 charcoal_image=CharcoalImage(wand->images,radius,sigma,bias,wand->exception);
1100 if (charcoal_image == (Image *) NULL)
1101 return(MagickFalse);
1102 ReplaceImageInList(&wand->images,charcoal_image);
1107 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1111 % M a g i c k C h o p I m a g e %
1115 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1117 % MagickChopImage() removes a region of an image and collapses the image to
1118 % occupy the removed portion
1120 % The format of the MagickChopImage method is:
1122 % MagickBooleanType MagickChopImage(MagickWand *wand,
1123 % const size_t width,const size_t height,const ssize_t x,
1126 % A description of each parameter follows:
1128 % o wand: the magick wand.
1130 % o width: the region width.
1132 % o height: the region height.
1134 % o x: the region x offset.
1136 % o y: the region y offset.
1140 WandExport MagickBooleanType MagickChopImage(MagickWand *wand,
1141 const size_t width,const size_t height,const ssize_t x,
1150 assert(wand != (MagickWand *) NULL);
1151 assert(wand->signature == WandSignature);
1152 if (wand->debug != MagickFalse)
1153 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1154 if (wand->images == (Image *) NULL)
1155 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1160 chop_image=ChopImage(wand->images,&chop,wand->exception);
1161 if (chop_image == (Image *) NULL)
1162 return(MagickFalse);
1163 ReplaceImageInList(&wand->images,chop_image);
1168 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1172 % M a g i c k C l a m p I m a g e %
1176 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1178 % MagickClampImage() restricts the color range from 0 to the quantum depth.
1180 % The format of the MagickClampImage method is:
1182 % MagickBooleanType MagickClampImage(MagickWand *wand)
1184 % A description of each parameter follows:
1186 % o wand: the magick wand.
1188 % o channel: the channel.
1191 WandExport MagickBooleanType MagickClampImage(MagickWand *wand)
1193 assert(wand != (MagickWand *) NULL);
1194 assert(wand->signature == WandSignature);
1195 if (wand->debug != MagickFalse)
1196 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1197 if (wand->images == (Image *) NULL)
1198 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1199 return(ClampImage(wand->images,wand->exception));
1203 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1207 % M a g i c k C l i p I m a g e %
1211 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1213 % MagickClipImage() clips along the first path from the 8BIM profile, if
1216 % The format of the MagickClipImage method is:
1218 % MagickBooleanType MagickClipImage(MagickWand *wand)
1220 % A description of each parameter follows:
1222 % o wand: the magick wand.
1225 WandExport MagickBooleanType MagickClipImage(MagickWand *wand)
1230 assert(wand != (MagickWand *) NULL);
1231 assert(wand->signature == WandSignature);
1232 if (wand->debug != MagickFalse)
1233 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1234 if (wand->images == (Image *) NULL)
1235 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1236 status=ClipImage(wand->images,wand->exception);
1241 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1245 % M a g i c k C l i p I m a g e P a t h %
1249 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1251 % MagickClipImagePath() clips along the named paths from the 8BIM profile, if
1252 % present. Later operations take effect inside the path. Id may be a number
1253 % if preceded with #, to work on a numbered path, e.g., "#1" to use the first
1256 % The format of the MagickClipImagePath method is:
1258 % MagickBooleanType MagickClipImagePath(MagickWand *wand,
1259 % const char *pathname,const MagickBooleanType inside)
1261 % A description of each parameter follows:
1263 % o wand: the magick wand.
1265 % o pathname: name of clipping path resource. If name is preceded by #, use
1266 % clipping path numbered by name.
1268 % o inside: if non-zero, later operations take effect inside clipping path.
1269 % Otherwise later operations take effect outside clipping path.
1272 WandExport MagickBooleanType MagickClipImagePath(MagickWand *wand,
1273 const char *pathname,const MagickBooleanType inside)
1278 assert(wand != (MagickWand *) NULL);
1279 assert(wand->signature == WandSignature);
1280 if (wand->debug != MagickFalse)
1281 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1282 if (wand->images == (Image *) NULL)
1283 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1284 status=ClipImagePath(wand->images,pathname,inside,wand->exception);
1289 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1293 % M a g i c k C l u t I m a g e %
1297 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1299 % MagickClutImage() replaces colors in the image from a color lookup table.
1301 % The format of the MagickClutImage method is:
1303 % MagickBooleanType MagickClutImage(MagickWand *wand,
1304 % const MagickWand *clut_wand,const PixelInterpolateMethod method)
1306 % A description of each parameter follows:
1308 % o wand: the magick wand.
1310 % o clut_image: the clut image.
1312 % o method: the pixel interpolation method.
1315 WandExport MagickBooleanType MagickClutImage(MagickWand *wand,
1316 const MagickWand *clut_wand,const PixelInterpolateMethod method)
1321 assert(wand != (MagickWand *) NULL);
1322 assert(wand->signature == WandSignature);
1323 if (wand->debug != MagickFalse)
1324 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1325 if ((wand->images == (Image *) NULL) || (clut_wand->images == (Image *) NULL))
1326 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1327 status=ClutImage(wand->images,clut_wand->images,method,wand->exception);
1332 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1336 % M a g i c k C o a l e s c e I m a g e s %
1340 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1342 % MagickCoalesceImages() composites a set of images while respecting any page
1343 % offsets and disposal methods. GIF, MIFF, and MNG animation sequences
1344 % typically start with an image background and each subsequent image
1345 % varies in size and offset. MagickCoalesceImages() returns a new sequence
1346 % where each image in the sequence is the same size as the first and
1347 % composited with the next image in the sequence.
1349 % The format of the MagickCoalesceImages method is:
1351 % MagickWand *MagickCoalesceImages(MagickWand *wand)
1353 % A description of each parameter follows:
1355 % o wand: the magick wand.
1358 WandExport MagickWand *MagickCoalesceImages(MagickWand *wand)
1363 assert(wand != (MagickWand *) NULL);
1364 assert(wand->signature == WandSignature);
1365 if (wand->debug != MagickFalse)
1366 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1367 if (wand->images == (Image *) NULL)
1368 return((MagickWand *) NULL);
1369 coalesce_image=CoalesceImages(wand->images,wand->exception);
1370 if (coalesce_image == (Image *) NULL)
1371 return((MagickWand *) NULL);
1372 return(CloneMagickWandFromImages(wand,coalesce_image));
1376 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1380 % M a g i c k C o l o r D e c i s i o n I m a g e %
1384 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1386 % MagickColorDecisionListImage() accepts a lightweight Color Correction
1387 % Collection (CCC) file which solely contains one or more color corrections
1388 % and applies the color correction to the image. Here is a sample CCC file:
1390 % <ColorCorrectionCollection xmlns="urn:ASC:CDL:v1.2">
1391 % <ColorCorrection id="cc03345">
1393 % <Slope> 0.9 1.2 0.5 </Slope>
1394 % <Offset> 0.4 -0.5 0.6 </Offset>
1395 % <Power> 1.0 0.8 1.5 </Power>
1398 % <Saturation> 0.85 </Saturation>
1400 % </ColorCorrection>
1401 % </ColorCorrectionCollection>
1403 % which includes the offset, slope, and power for each of the RGB channels
1404 % as well as the saturation.
1406 % The format of the MagickColorDecisionListImage method is:
1408 % MagickBooleanType MagickColorDecisionListImage(MagickWand *wand,
1409 % const double gamma)
1411 % A description of each parameter follows:
1413 % o wand: the magick wand.
1415 % o color_correction_collection: the color correction collection in XML.
1418 WandExport MagickBooleanType MagickColorDecisionListImage(MagickWand *wand,
1419 const char *color_correction_collection)
1424 assert(wand != (MagickWand *) NULL);
1425 assert(wand->signature == WandSignature);
1426 if (wand->debug != MagickFalse)
1427 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1428 if (wand->images == (Image *) NULL)
1429 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1430 status=ColorDecisionListImage(wand->images,color_correction_collection,
1436 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1440 % M a g i c k C o l o r i z e I m a g e %
1444 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1446 % MagickColorizeImage() blends the fill color with each pixel in the image.
1448 % The format of the MagickColorizeImage method is:
1450 % MagickBooleanType MagickColorizeImage(MagickWand *wand,
1451 % const PixelWand *colorize,const PixelWand *blend)
1453 % A description of each parameter follows:
1455 % o wand: the magick wand.
1457 % o colorize: the colorize pixel wand.
1459 % o alpha: the alpha pixel wand.
1462 WandExport MagickBooleanType MagickColorizeImage(MagickWand *wand,
1463 const PixelWand *colorize,const PixelWand *blend)
1466 percent_blend[MaxTextExtent];
1474 assert(wand != (MagickWand *) NULL);
1475 assert(wand->signature == WandSignature);
1476 if (wand->debug != MagickFalse)
1477 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1478 if (wand->images == (Image *) NULL)
1479 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1480 GetPixelInfo(wand->images,&target);
1481 if (target.colorspace != CMYKColorspace)
1482 (void) FormatLocaleString(percent_blend,MaxTextExtent,
1483 "%g,%g,%g,%g",(double) (100.0*QuantumScale*
1484 PixelGetRedQuantum(blend)),(double) (100.0*QuantumScale*
1485 PixelGetGreenQuantum(blend)),(double) (100.0*QuantumScale*
1486 PixelGetBlueQuantum(blend)),(double) (100.0*QuantumScale*
1487 PixelGetAlphaQuantum(blend)));
1489 (void) FormatLocaleString(percent_blend,MaxTextExtent,
1490 "%g,%g,%g,%g,%g",(double) (100.0*QuantumScale*
1491 PixelGetRedQuantum(blend)),(double) (100.0*QuantumScale*
1492 PixelGetGreenQuantum(blend)),(double) (100.0*QuantumScale*
1493 PixelGetBlueQuantum(blend)),(double) (100.0*QuantumScale*
1494 PixelGetBlackQuantum(blend)),(double) (100.0*QuantumScale*
1495 PixelGetAlphaQuantum(blend)));
1496 target=PixelGetPixel(colorize);
1497 colorize_image=ColorizeImage(wand->images,percent_blend,&target,
1499 if (colorize_image == (Image *) NULL)
1500 return(MagickFalse);
1501 ReplaceImageInList(&wand->images,colorize_image);
1506 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1510 % M a g i c k C o l o r M a t r i x I m a g e %
1514 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1516 % MagickColorMatrixImage() apply color transformation to an image. The method
1517 % permits saturation changes, hue rotation, luminance to alpha, and various
1518 % other effects. Although variable-sized transformation matrices can be used,
1519 % typically one uses a 5x5 matrix for an RGBA image and a 6x6 for CMYKA
1520 % (or RGBA with offsets). The matrix is similar to those used by Adobe Flash
1521 % except offsets are in column 6 rather than 5 (in support of CMYKA images)
1522 % and offsets are normalized (divide Flash offset by 255).
1524 % The format of the MagickColorMatrixImage method is:
1526 % MagickBooleanType MagickColorMatrixImage(MagickWand *wand,
1527 % const KernelInfo *color_matrix)
1529 % A description of each parameter follows:
1531 % o wand: the magick wand.
1533 % o color_matrix: the color matrix.
1536 WandExport MagickBooleanType MagickColorMatrixImage(MagickWand *wand,
1537 const KernelInfo *color_matrix)
1542 assert(wand != (MagickWand *) NULL);
1543 assert(wand->signature == WandSignature);
1544 if (wand->debug != MagickFalse)
1545 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1546 if (color_matrix == (const KernelInfo *) NULL)
1547 return(MagickFalse);
1548 if (wand->images == (Image *) NULL)
1549 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1550 color_image=ColorMatrixImage(wand->images,color_matrix,wand->exception);
1551 if (color_image == (Image *) NULL)
1552 return(MagickFalse);
1553 ReplaceImageInList(&wand->images,color_image);
1558 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1562 % M a g i c k C o m b i n e I m a g e s %
1566 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1568 % MagickCombineImages() combines one or more images into a single image. The
1569 % grayscale value of the pixels of each image in the sequence is assigned in
1570 % order to the specified hannels of the combined image. The typical
1571 % ordering would be image 1 => Red, 2 => Green, 3 => Blue, etc.
1573 % The format of the MagickCombineImages method is:
1575 % MagickWand *MagickCombineImages(MagickWand *wand)
1577 % A description of each parameter follows:
1579 % o wand: the magick wand.
1582 WandExport MagickWand *MagickCombineImages(MagickWand *wand)
1587 assert(wand != (MagickWand *) NULL);
1588 assert(wand->signature == WandSignature);
1589 if (wand->debug != MagickFalse)
1590 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1591 if (wand->images == (Image *) NULL)
1592 return((MagickWand *) NULL);
1593 combine_image=CombineImages(wand->images,wand->exception);
1594 if (combine_image == (Image *) NULL)
1595 return((MagickWand *) NULL);
1596 return(CloneMagickWandFromImages(wand,combine_image));
1600 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1604 % M a g i c k C o m m e n t I m a g e %
1608 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1610 % MagickCommentImage() adds a comment to your image.
1612 % The format of the MagickCommentImage method is:
1614 % MagickBooleanType MagickCommentImage(MagickWand *wand,
1615 % const char *comment)
1617 % A description of each parameter follows:
1619 % o wand: the magick wand.
1621 % o comment: the image comment.
1624 WandExport MagickBooleanType MagickCommentImage(MagickWand *wand,
1625 const char *comment)
1630 assert(wand != (MagickWand *) NULL);
1631 assert(wand->signature == WandSignature);
1632 if (wand->debug != MagickFalse)
1633 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1634 if (wand->images == (Image *) NULL)
1635 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1636 status=SetImageProperty(wand->images,"comment",comment,wand->exception);
1641 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1645 % M a g i c k C o m p a r e I m a g e L a y e r s %
1649 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1651 % MagickCompareImagesLayers() compares each image with the next in a sequence
1652 % and returns the maximum bounding region of any pixel differences it
1655 % The format of the MagickCompareImagesLayers method is:
1657 % MagickWand *MagickCompareImagesLayers(MagickWand *wand,
1658 % const ImageLayerMethod method)
1660 % A description of each parameter follows:
1662 % o wand: the magick wand.
1664 % o method: the compare method.
1667 WandExport MagickWand *MagickCompareImagesLayers(MagickWand *wand,
1668 const ImageLayerMethod method)
1673 assert(wand != (MagickWand *) NULL);
1674 assert(wand->signature == WandSignature);
1675 if (wand->debug != MagickFalse)
1676 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1677 if (wand->images == (Image *) NULL)
1678 return((MagickWand *) NULL);
1679 layers_image=CompareImagesLayers(wand->images,method,wand->exception);
1680 if (layers_image == (Image *) NULL)
1681 return((MagickWand *) NULL);
1682 return(CloneMagickWandFromImages(wand,layers_image));
1686 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1690 % M a g i c k C o m p a r e I m a g e s %
1694 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1696 % MagickCompareImages() compares an image to a reconstructed image and returns
1697 % the specified difference image.
1699 % The format of the MagickCompareImages method is:
1701 % MagickWand *MagickCompareImages(MagickWand *wand,
1702 % const MagickWand *reference,const MetricType metric,
1703 % double *distortion)
1705 % A description of each parameter follows:
1707 % o wand: the magick wand.
1709 % o reference: the reference wand.
1711 % o metric: the metric.
1713 % o distortion: the computed distortion between the images.
1716 WandExport MagickWand *MagickCompareImages(MagickWand *wand,
1717 const MagickWand *reference,const MetricType metric,double *distortion)
1723 assert(wand != (MagickWand *) NULL);
1724 assert(wand->signature == WandSignature);
1725 if (wand->debug != MagickFalse)
1726 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1727 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
1729 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
1730 "ContainsNoImages","`%s'",wand->name);
1731 return((MagickWand *) NULL);
1733 compare_image=CompareImages(wand->images,reference->images,metric,distortion,
1735 if (compare_image == (Image *) NULL)
1736 return((MagickWand *) NULL);
1737 return(CloneMagickWandFromImages(wand,compare_image));
1741 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1745 % M a g i c k C o m p o s i t e I m a g e %
1749 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1751 % MagickCompositeImage() composite one image onto another at the specified
1754 % The format of the MagickCompositeImage method is:
1756 % MagickBooleanType MagickCompositeImage(MagickWand *wand,
1757 % const MagickWand *composite_wand,const CompositeOperator compose,
1758 % const ssize_t x,const ssize_t y)
1760 % A description of each parameter follows:
1762 % o wand: the magick wand.
1764 % o composite_image: the composite image.
1766 % o compose: This operator affects how the composite is applied to the
1767 % image. The default is Over. Choose from these operators:
1769 % OverCompositeOp InCompositeOp OutCompositeOp
1770 % AtopCompositeOp XorCompositeOp PlusCompositeOp
1771 % MinusCompositeOp AddCompositeOp SubtractCompositeOp
1772 % DifferenceCompositeOp BumpmapCompositeOp CopyCompositeOp
1773 % DisplaceCompositeOp
1775 % o x: the column offset of the composited image.
1777 % o y: the row offset of the composited image.
1780 WandExport MagickBooleanType MagickCompositeImage(MagickWand *wand,
1781 const MagickWand *composite_wand,const CompositeOperator compose,
1782 const ssize_t x,const ssize_t y)
1787 assert(wand != (MagickWand *) NULL);
1788 assert(wand->signature == WandSignature);
1789 if (wand->debug != MagickFalse)
1790 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1791 if ((wand->images == (Image *) NULL) ||
1792 (composite_wand->images == (Image *) NULL))
1793 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1794 status=CompositeImage(wand->images,compose,composite_wand->images,x,y,
1800 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1804 % M a g i c k C o n t r a s t I m a g e %
1808 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1810 % MagickContrastImage() enhances the intensity differences between the lighter
1811 % and darker elements of the image. Set sharpen to a value other than 0 to
1812 % increase the image contrast otherwise the contrast is reduced.
1814 % The format of the MagickContrastImage method is:
1816 % MagickBooleanType MagickContrastImage(MagickWand *wand,
1817 % const MagickBooleanType sharpen)
1819 % A description of each parameter follows:
1821 % o wand: the magick wand.
1823 % o sharpen: Increase or decrease image contrast.
1827 WandExport MagickBooleanType MagickContrastImage(MagickWand *wand,
1828 const MagickBooleanType sharpen)
1833 assert(wand != (MagickWand *) NULL);
1834 assert(wand->signature == WandSignature);
1835 if (wand->debug != MagickFalse)
1836 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1837 if (wand->images == (Image *) NULL)
1838 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1839 status=ContrastImage(wand->images,sharpen,wand->exception);
1844 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1848 % 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 %
1852 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1854 % MagickContrastStretchImage() enhances the contrast of a color image by
1855 % adjusting the pixels color to span the entire range of colors available.
1856 % You can also reduce the influence of a particular channel with a gamma
1859 % The format of the MagickContrastStretchImage method is:
1861 % MagickBooleanType MagickContrastStretchImage(MagickWand *wand,
1862 % const double black_point,const double white_point)
1864 % A description of each parameter follows:
1866 % o wand: the magick wand.
1868 % o black_point: the black point.
1870 % o white_point: the white point.
1873 WandExport MagickBooleanType MagickContrastStretchImage(MagickWand *wand,
1874 const double black_point,const double white_point)
1879 assert(wand != (MagickWand *) NULL);
1880 assert(wand->signature == WandSignature);
1881 if (wand->debug != MagickFalse)
1882 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1883 if (wand->images == (Image *) NULL)
1884 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1885 status=ContrastStretchImage(wand->images,black_point,white_point,
1891 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1895 % M a g i c k C o n v o l v e I m a g e %
1899 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1901 % MagickConvolveImage() applies a custom convolution kernel to the image.
1903 % The format of the MagickConvolveImage method is:
1905 % MagickBooleanType MagickConvolveImage(MagickWand *wand,
1906 % const KernelInfo *kernel)
1908 % A description of each parameter follows:
1910 % o wand: the magick wand.
1912 % o kernel: An array of doubles representing the convolution kernel.
1915 WandExport MagickBooleanType MagickConvolveImage(MagickWand *wand,
1916 const KernelInfo *kernel)
1921 assert(wand != (MagickWand *) NULL);
1922 assert(wand->signature == WandSignature);
1923 if (wand->debug != MagickFalse)
1924 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1925 if (kernel == (const KernelInfo *) NULL)
1926 return(MagickFalse);
1927 if (wand->images == (Image *) NULL)
1928 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1929 filter_image=ConvolveImage(wand->images,kernel,wand->exception);
1930 if (filter_image == (Image *) NULL)
1931 return(MagickFalse);
1932 ReplaceImageInList(&wand->images,filter_image);
1937 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1941 % M a g i c k C r o p I m a g e %
1945 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1947 % MagickCropImage() extracts a region of the image.
1949 % The format of the MagickCropImage method is:
1951 % MagickBooleanType MagickCropImage(MagickWand *wand,
1952 % const size_t width,const size_t height,const ssize_t x,const ssize_t y)
1954 % A description of each parameter follows:
1956 % o wand: the magick wand.
1958 % o width: the region width.
1960 % o height: the region height.
1962 % o x: the region x-offset.
1964 % o y: the region y-offset.
1967 WandExport MagickBooleanType MagickCropImage(MagickWand *wand,
1968 const size_t width,const size_t height,const ssize_t x,const ssize_t y)
1976 assert(wand != (MagickWand *) NULL);
1977 assert(wand->signature == WandSignature);
1978 if (wand->debug != MagickFalse)
1979 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1980 if (wand->images == (Image *) NULL)
1981 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1986 crop_image=CropImage(wand->images,&crop,wand->exception);
1987 if (crop_image == (Image *) NULL)
1988 return(MagickFalse);
1989 ReplaceImageInList(&wand->images,crop_image);
1994 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1998 % M a g i c k C y c l e C o l o r m a p I m a g e %
2002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2004 % MagickCycleColormapImage() displaces an image's colormap by a given number
2005 % of positions. If you cycle the colormap a number of times you can produce
2006 % a psychodelic effect.
2008 % The format of the MagickCycleColormapImage method is:
2010 % MagickBooleanType MagickCycleColormapImage(MagickWand *wand,
2011 % const ssize_t displace)
2013 % A description of each parameter follows:
2015 % o wand: the magick wand.
2017 % o pixel_wand: the pixel wand.
2020 WandExport MagickBooleanType MagickCycleColormapImage(MagickWand *wand,
2021 const ssize_t displace)
2026 assert(wand != (MagickWand *) NULL);
2027 assert(wand->signature == WandSignature);
2028 if (wand->debug != MagickFalse)
2029 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2030 if (wand->images == (Image *) NULL)
2031 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2032 status=CycleColormapImage(wand->images,displace,wand->exception);
2037 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2041 % M a g i c k C o n s t i t u t e I m a g e %
2045 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2047 % MagickConstituteImage() adds an image to the wand comprised of the pixel
2048 % data you supply. The pixel data must be in scanline order top-to-bottom.
2049 % The data can be char, short int, int, float, or double. Float and double
2050 % require the pixels to be normalized [0..1], otherwise [0..Max], where Max
2051 % is the maximum value the type can accomodate (e.g. 255 for char). For
2052 % example, to create a 640x480 image from unsigned red-green-blue character
2055 % MagickConstituteImage(wand,640,640,"RGB",CharPixel,pixels);
2057 % The format of the MagickConstituteImage method is:
2059 % MagickBooleanType MagickConstituteImage(MagickWand *wand,
2060 % const size_t columns,const size_t rows,const char *map,
2061 % const StorageType storage,void *pixels)
2063 % A description of each parameter follows:
2065 % o wand: the magick wand.
2067 % o columns: width in pixels of the image.
2069 % o rows: height in pixels of the image.
2071 % o map: This string reflects the expected ordering of the pixel array.
2072 % It can be any combination or order of R = red, G = green, B = blue,
2073 % A = alpha (0 is transparent), O = alpha (0 is opaque), C = cyan,
2074 % Y = yellow, M = magenta, K = black, I = intensity (for grayscale),
2077 % o storage: Define the data type of the pixels. Float and double types are
2078 % expected to be normalized [0..1] otherwise [0..QuantumRange]. Choose from
2079 % these types: CharPixel, DoublePixel, FloatPixel, IntegerPixel,
2080 % LongPixel, QuantumPixel, or ShortPixel.
2082 % o pixels: This array of values contain the pixel components as defined by
2083 % map and type. You must preallocate this array where the expected
2084 % length varies depending on the values of width, height, map, and type.
2088 WandExport MagickBooleanType MagickConstituteImage(MagickWand *wand,
2089 const size_t columns,const size_t rows,const char *map,
2090 const StorageType storage,const void *pixels)
2095 assert(wand != (MagickWand *) NULL);
2096 assert(wand->signature == WandSignature);
2097 if (wand->debug != MagickFalse)
2098 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2099 images=ConstituteImage(columns,rows,map,storage,pixels,wand->exception);
2100 if (images == (Image *) NULL)
2101 return(MagickFalse);
2102 return(InsertImageInWand(wand,images));
2106 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2110 % M a g i c k D e c i p h e r I m a g e %
2114 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2116 % MagickDecipherImage() converts cipher pixels to plain pixels.
2118 % The format of the MagickDecipherImage method is:
2120 % MagickBooleanType MagickDecipherImage(MagickWand *wand,
2121 % const char *passphrase)
2123 % A description of each parameter follows:
2125 % o wand: the magick wand.
2127 % o passphrase: the passphrase.
2130 WandExport MagickBooleanType MagickDecipherImage(MagickWand *wand,
2131 const char *passphrase)
2133 assert(wand != (MagickWand *) NULL);
2134 assert(wand->signature == WandSignature);
2135 if (wand->debug != MagickFalse)
2136 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2137 if (wand->images == (Image *) NULL)
2138 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2139 return(DecipherImage(wand->images,passphrase,wand->exception));
2143 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2147 % M a g i c k D e c o n s t r u c t I m a g e s %
2151 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2153 % MagickDeconstructImages() compares each image with the next in a sequence
2154 % and returns the maximum bounding region of any pixel differences it
2157 % The format of the MagickDeconstructImages method is:
2159 % MagickWand *MagickDeconstructImages(MagickWand *wand)
2161 % A description of each parameter follows:
2163 % o wand: the magick wand.
2166 WandExport MagickWand *MagickDeconstructImages(MagickWand *wand)
2171 assert(wand != (MagickWand *) NULL);
2172 assert(wand->signature == WandSignature);
2173 if (wand->debug != MagickFalse)
2174 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2175 if (wand->images == (Image *) NULL)
2176 return((MagickWand *) NULL);
2177 deconstruct_image=CompareImagesLayers(wand->images,CompareAnyLayer,
2179 if (deconstruct_image == (Image *) NULL)
2180 return((MagickWand *) NULL);
2181 return(CloneMagickWandFromImages(wand,deconstruct_image));
2185 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2189 % M a g i c k D e s k e w I m a g e %
2193 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2195 % MagickDeskewImage() removes skew from the image. Skew is an artifact that
2196 % occurs in scanned images because of the camera being misaligned,
2197 % imperfections in the scanning or surface, or simply because the paper was
2198 % not placed completely flat when scanned.
2200 % The format of the MagickDeskewImage method is:
2202 % MagickBooleanType MagickDeskewImage(MagickWand *wand,
2203 % const double threshold)
2205 % A description of each parameter follows:
2207 % o wand: the magick wand.
2209 % o threshold: separate background from foreground.
2212 WandExport MagickBooleanType MagickDeskewImage(MagickWand *wand,
2213 const double threshold)
2218 assert(wand != (MagickWand *) NULL);
2219 assert(wand->signature == WandSignature);
2220 if (wand->debug != MagickFalse)
2221 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2222 if (wand->images == (Image *) NULL)
2223 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2224 sepia_image=DeskewImage(wand->images,threshold,wand->exception);
2225 if (sepia_image == (Image *) NULL)
2226 return(MagickFalse);
2227 ReplaceImageInList(&wand->images,sepia_image);
2232 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2236 % M a g i c k D e s p e c k l e I m a g e %
2240 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2242 % MagickDespeckleImage() reduces the speckle noise in an image while
2243 % perserving the edges of the original image.
2245 % The format of the MagickDespeckleImage method is:
2247 % MagickBooleanType MagickDespeckleImage(MagickWand *wand)
2249 % A description of each parameter follows:
2251 % o wand: the magick wand.
2254 WandExport MagickBooleanType MagickDespeckleImage(MagickWand *wand)
2259 assert(wand != (MagickWand *) NULL);
2260 assert(wand->signature == WandSignature);
2261 if (wand->debug != MagickFalse)
2262 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2263 if (wand->images == (Image *) NULL)
2264 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2265 despeckle_image=DespeckleImage(wand->images,wand->exception);
2266 if (despeckle_image == (Image *) NULL)
2267 return(MagickFalse);
2268 ReplaceImageInList(&wand->images,despeckle_image);
2273 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2277 % M a g i c k D e s t r o y I m a g e %
2281 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2283 % MagickDestroyImage() dereferences an image, deallocating memory associated
2284 % with the image if the reference count becomes zero.
2286 % The format of the MagickDestroyImage method is:
2288 % Image *MagickDestroyImage(Image *image)
2290 % A description of each parameter follows:
2292 % o image: the image.
2295 WandExport Image *MagickDestroyImage(Image *image)
2297 return(DestroyImage(image));
2301 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2305 % M a g i c k D i s p l a y I m a g e %
2309 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2311 % MagickDisplayImage() displays an image.
2313 % The format of the MagickDisplayImage method is:
2315 % MagickBooleanType MagickDisplayImage(MagickWand *wand,
2316 % const char *server_name)
2318 % A description of each parameter follows:
2320 % o wand: the magick wand.
2322 % o server_name: the X server name.
2325 WandExport MagickBooleanType MagickDisplayImage(MagickWand *wand,
2326 const char *server_name)
2334 assert(wand != (MagickWand *) NULL);
2335 assert(wand->signature == WandSignature);
2336 if (wand->debug != MagickFalse)
2337 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2338 if (wand->images == (Image *) NULL)
2339 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2340 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
2341 if (image == (Image *) NULL)
2342 return(MagickFalse);
2343 (void) CloneString(&wand->image_info->server_name,server_name);
2344 status=DisplayImages(wand->image_info,image,wand->exception);
2345 image=DestroyImage(image);
2350 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2354 % M a g i c k D i s p l a y I m a g e s %
2358 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2360 % MagickDisplayImages() displays an image or image sequence.
2362 % The format of the MagickDisplayImages method is:
2364 % MagickBooleanType MagickDisplayImages(MagickWand *wand,
2365 % const char *server_name)
2367 % A description of each parameter follows:
2369 % o wand: the magick wand.
2371 % o server_name: the X server name.
2374 WandExport MagickBooleanType MagickDisplayImages(MagickWand *wand,
2375 const char *server_name)
2380 assert(wand != (MagickWand *) NULL);
2381 assert(wand->signature == WandSignature);
2382 if (wand->debug != MagickFalse)
2383 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2384 (void) CloneString(&wand->image_info->server_name,server_name);
2385 status=DisplayImages(wand->image_info,wand->images,wand->exception);
2390 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2394 % M a g i c k D i s t o r t I m a g e %
2398 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2400 % MagickDistortImage() distorts an image using various distortion methods, by
2401 % mapping color lookups of the source image to a new destination image
2402 % usally of the same size as the source image, unless 'bestfit' is set to
2405 % If 'bestfit' is enabled, and distortion allows it, the destination image is
2406 % adjusted to ensure the whole source 'image' will just fit within the final
2407 % destination image, which will be sized and offset accordingly. Also in
2408 % many cases the virtual offset of the source image will be taken into
2409 % account in the mapping.
2411 % The format of the MagickDistortImage method is:
2413 % MagickBooleanType MagickDistortImage(MagickWand *wand,
2414 % const DistortImageMethod method,const size_t number_arguments,
2415 % const double *arguments,const MagickBooleanType bestfit)
2417 % A description of each parameter follows:
2419 % o image: the image to be distorted.
2421 % o method: the method of image distortion.
2423 % ArcDistortion always ignores the source image offset, and always
2424 % 'bestfit' the destination image with the top left corner offset
2425 % relative to the polar mapping center.
2427 % Bilinear has no simple inverse mapping so it does not allow 'bestfit'
2428 % style of image distortion.
2430 % Affine, Perspective, and Bilinear, do least squares fitting of the
2431 % distortion when more than the minimum number of control point pairs
2434 % Perspective, and Bilinear, falls back to a Affine distortion when less
2435 % that 4 control point pairs are provided. While Affine distortions let
2436 % you use any number of control point pairs, that is Zero pairs is a
2437 % no-Op (viewport only) distrotion, one pair is a translation and two
2438 % pairs of control points do a scale-rotate-translate, without any
2441 % o number_arguments: the number of arguments given for this distortion
2444 % o arguments: the arguments for this distortion method.
2446 % o bestfit: Attempt to resize destination to fit distorted source.
2449 WandExport MagickBooleanType MagickDistortImage(MagickWand *wand,
2450 const DistortImageMethod method,const size_t number_arguments,
2451 const double *arguments,const MagickBooleanType bestfit)
2456 assert(wand != (MagickWand *) NULL);
2457 assert(wand->signature == WandSignature);
2458 if (wand->debug != MagickFalse)
2459 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2460 if (wand->images == (Image *) NULL)
2461 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2462 distort_image=DistortImage(wand->images,method,number_arguments,arguments,
2463 bestfit,wand->exception);
2464 if (distort_image == (Image *) NULL)
2465 return(MagickFalse);
2466 ReplaceImageInList(&wand->images,distort_image);
2471 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2475 % M a g i c k D r a w I m a g e %
2479 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2481 % MagickDrawImage() renders the drawing wand on the current image.
2483 % The format of the MagickDrawImage method is:
2485 % MagickBooleanType MagickDrawImage(MagickWand *wand,
2486 % const DrawingWand *drawing_wand)
2488 % A description of each parameter follows:
2490 % o wand: the magick wand.
2492 % o drawing_wand: the draw wand.
2495 WandExport MagickBooleanType MagickDrawImage(MagickWand *wand,
2496 const DrawingWand *drawing_wand)
2507 assert(wand != (MagickWand *) NULL);
2508 assert(wand->signature == WandSignature);
2509 if (wand->debug != MagickFalse)
2510 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2511 if (wand->images == (Image *) NULL)
2512 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2513 draw_info=PeekDrawingWand(drawing_wand);
2514 if ((draw_info == (DrawInfo *) NULL) ||
2515 (draw_info->primitive == (char *) NULL))
2516 return(MagickFalse);
2517 primitive=AcquireString(draw_info->primitive);
2518 draw_info=DestroyDrawInfo(draw_info);
2519 draw_info=CloneDrawInfo(wand->image_info,(DrawInfo *) NULL);
2520 draw_info->primitive=primitive;
2521 status=DrawImage(wand->images,draw_info,wand->exception);
2522 draw_info=DestroyDrawInfo(draw_info);
2527 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2531 % M a g i c k E d g e I m a g e %
2535 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2537 % MagickEdgeImage() enhance edges within the image with a convolution filter
2538 % of the given radius. Use a radius of 0 and Edge() selects a suitable
2541 % The format of the MagickEdgeImage method is:
2543 % MagickBooleanType MagickEdgeImage(MagickWand *wand,const double radius,
2544 % const double sigma)
2546 % A description of each parameter follows:
2548 % o wand: the magick wand.
2550 % o radius: the radius of the pixel neighborhood.
2552 % o sigma: the standard deviation of the Gaussian, in pixels.
2555 WandExport MagickBooleanType MagickEdgeImage(MagickWand *wand,
2556 const double radius,const double sigma)
2561 assert(wand != (MagickWand *) NULL);
2562 assert(wand->signature == WandSignature);
2563 if (wand->debug != MagickFalse)
2564 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2565 if (wand->images == (Image *) NULL)
2566 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2567 edge_image=EdgeImage(wand->images,radius,sigma,wand->exception);
2568 if (edge_image == (Image *) NULL)
2569 return(MagickFalse);
2570 ReplaceImageInList(&wand->images,edge_image);
2575 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2579 % M a g i c k E m b o s s I m a g e %
2583 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2585 % MagickEmbossImage() returns a grayscale image with a three-dimensional
2586 % effect. We convolve the image with a Gaussian operator of the given radius
2587 % and standard deviation (sigma). For reasonable results, radius should be
2588 % larger than sigma. Use a radius of 0 and Emboss() selects a suitable
2591 % The format of the MagickEmbossImage method is:
2593 % MagickBooleanType MagickEmbossImage(MagickWand *wand,const double radius,
2594 % const double sigma)
2596 % A description of each parameter follows:
2598 % o wand: the magick wand.
2600 % o radius: the radius of the Gaussian, in pixels, not counting the center
2603 % o sigma: the standard deviation of the Gaussian, in pixels.
2606 WandExport MagickBooleanType MagickEmbossImage(MagickWand *wand,
2607 const double radius,const double sigma)
2612 assert(wand != (MagickWand *) NULL);
2613 assert(wand->signature == WandSignature);
2614 if (wand->debug != MagickFalse)
2615 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2616 if (wand->images == (Image *) NULL)
2617 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2618 emboss_image=EmbossImage(wand->images,radius,sigma,wand->exception);
2619 if (emboss_image == (Image *) NULL)
2620 return(MagickFalse);
2621 ReplaceImageInList(&wand->images,emboss_image);
2626 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2630 % M a g i c k E n c i p h e r I m a g e %
2634 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2636 % MagickEncipherImage() converts plaint pixels to cipher pixels.
2638 % The format of the MagickEncipherImage method is:
2640 % MagickBooleanType MagickEncipherImage(MagickWand *wand,
2641 % const char *passphrase)
2643 % A description of each parameter follows:
2645 % o wand: the magick wand.
2647 % o passphrase: the passphrase.
2650 WandExport MagickBooleanType MagickEncipherImage(MagickWand *wand,
2651 const char *passphrase)
2653 assert(wand != (MagickWand *) NULL);
2654 assert(wand->signature == WandSignature);
2655 if (wand->debug != MagickFalse)
2656 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2657 if (wand->images == (Image *) NULL)
2658 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2659 return(EncipherImage(wand->images,passphrase,wand->exception));
2663 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2667 % M a g i c k E n h a n c e I m a g e %
2671 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2673 % MagickEnhanceImage() applies a digital filter that improves the quality of a
2676 % The format of the MagickEnhanceImage method is:
2678 % MagickBooleanType MagickEnhanceImage(MagickWand *wand)
2680 % A description of each parameter follows:
2682 % o wand: the magick wand.
2685 WandExport MagickBooleanType MagickEnhanceImage(MagickWand *wand)
2690 assert(wand != (MagickWand *) NULL);
2691 assert(wand->signature == WandSignature);
2692 if (wand->debug != MagickFalse)
2693 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2694 if (wand->images == (Image *) NULL)
2695 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2696 enhance_image=EnhanceImage(wand->images,wand->exception);
2697 if (enhance_image == (Image *) NULL)
2698 return(MagickFalse);
2699 ReplaceImageInList(&wand->images,enhance_image);
2704 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2708 % M a g i c k E q u a l i z e I m a g e %
2712 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2714 % MagickEqualizeImage() equalizes the image histogram.
2716 % The format of the MagickEqualizeImage method is:
2718 % MagickBooleanType MagickEqualizeImage(MagickWand *wand)
2720 % A description of each parameter follows:
2722 % o wand: the magick wand.
2724 % o channel: the image channel(s).
2727 WandExport MagickBooleanType MagickEqualizeImage(MagickWand *wand)
2732 assert(wand != (MagickWand *) NULL);
2733 assert(wand->signature == WandSignature);
2734 if (wand->debug != MagickFalse)
2735 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2736 if (wand->images == (Image *) NULL)
2737 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2738 status=EqualizeImage(wand->images,wand->exception);
2743 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2747 % M a g i c k E v a l u a t e I m a g e %
2751 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2753 % MagickEvaluateImage() applys an arithmetic, relational, or logical
2754 % expression to an image. Use these operators to lighten or darken an image,
2755 % to increase or decrease contrast in an image, or to produce the "negative"
2758 % The format of the MagickEvaluateImage method is:
2760 % MagickBooleanType MagickEvaluateImage(MagickWand *wand,
2761 % const MagickEvaluateOperator operator,const double value)
2762 % MagickBooleanType MagickEvaluateImages(MagickWand *wand,
2763 % const MagickEvaluateOperator operator)
2765 % A description of each parameter follows:
2767 % o wand: the magick wand.
2769 % o op: A channel operator.
2771 % o value: A value value.
2775 WandExport MagickWand *MagickEvaluateImages(MagickWand *wand,
2776 const MagickEvaluateOperator op)
2781 assert(wand != (MagickWand *) NULL);
2782 assert(wand->signature == WandSignature);
2783 if (wand->debug != MagickFalse)
2784 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2785 if (wand->images == (Image *) NULL)
2786 return((MagickWand *) NULL);
2787 evaluate_image=EvaluateImages(wand->images,op,wand->exception);
2788 if (evaluate_image == (Image *) NULL)
2789 return((MagickWand *) NULL);
2790 return(CloneMagickWandFromImages(wand,evaluate_image));
2793 WandExport MagickBooleanType MagickEvaluateImage(MagickWand *wand,
2794 const MagickEvaluateOperator op,const double value)
2799 assert(wand != (MagickWand *) NULL);
2800 assert(wand->signature == WandSignature);
2801 if (wand->debug != MagickFalse)
2802 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2803 if (wand->images == (Image *) NULL)
2804 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2805 status=EvaluateImage(wand->images,op,value,wand->exception);
2810 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2814 % M a g i c k E x p o r t I m a g e P i x e l s %
2818 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2820 % MagickExportImagePixels() extracts pixel data from an image and returns it
2821 % to you. The method returns MagickTrue on success otherwise MagickFalse if
2822 % an error is encountered. The data is returned as char, short int, int,
2823 % ssize_t, float, or double in the order specified by map.
2825 % Suppose you want to extract the first scanline of a 640x480 image as
2826 % character data in red-green-blue order:
2828 % MagickExportImagePixels(wand,0,0,640,1,"RGB",CharPixel,pixels);
2830 % The format of the MagickExportImagePixels method is:
2832 % MagickBooleanType MagickExportImagePixels(MagickWand *wand,
2833 % const ssize_t x,const ssize_t y,const size_t columns,
2834 % const size_t rows,const char *map,const StorageType storage,
2837 % A description of each parameter follows:
2839 % o wand: the magick wand.
2841 % o x, y, columns, rows: These values define the perimeter
2842 % of a region of pixels you want to extract.
2844 % o map: This string reflects the expected ordering of the pixel array.
2845 % It can be any combination or order of R = red, G = green, B = blue,
2846 % A = alpha (0 is transparent), O = alpha (0 is opaque), C = cyan,
2847 % Y = yellow, M = magenta, K = black, I = intensity (for grayscale),
2850 % o storage: Define the data type of the pixels. Float and double types are
2851 % expected to be normalized [0..1] otherwise [0..QuantumRange]. Choose from
2852 % these types: CharPixel, DoublePixel, FloatPixel, IntegerPixel,
2853 % LongPixel, QuantumPixel, or ShortPixel.
2855 % o pixels: This array of values contain the pixel components as defined by
2856 % map and type. You must preallocate this array where the expected
2857 % length varies depending on the values of width, height, map, and type.
2860 WandExport MagickBooleanType MagickExportImagePixels(MagickWand *wand,
2861 const ssize_t x,const ssize_t y,const size_t columns,
2862 const size_t rows,const char *map,const StorageType storage,
2868 assert(wand != (MagickWand *) NULL);
2869 assert(wand->signature == WandSignature);
2870 if (wand->debug != MagickFalse)
2871 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2872 if (wand->images == (Image *) NULL)
2873 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2874 status=ExportImagePixels(wand->images,x,y,columns,rows,map,
2875 storage,pixels,wand->exception);
2880 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2884 % M a g i c k E x t e n t I m a g e %
2888 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2890 % MagickExtentImage() extends the image as defined by the geometry, gravity,
2891 % and wand background color. Set the (x,y) offset of the geometry to move
2892 % the original wand relative to the extended wand.
2894 % The format of the MagickExtentImage method is:
2896 % MagickBooleanType MagickExtentImage(MagickWand *wand,const size_t width,
2897 % const size_t height,const ssize_t x,const ssize_t y)
2899 % A description of each parameter follows:
2901 % o wand: the magick wand.
2903 % o width: the region width.
2905 % o height: the region height.
2907 % o x: the region x offset.
2909 % o y: the region y offset.
2912 WandExport MagickBooleanType MagickExtentImage(MagickWand *wand,
2913 const size_t width,const size_t height,const ssize_t x,const ssize_t y)
2921 assert(wand != (MagickWand *) NULL);
2922 assert(wand->signature == WandSignature);
2923 if (wand->debug != MagickFalse)
2924 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2925 if (wand->images == (Image *) NULL)
2926 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2928 extent.height=height;
2931 extent_image=ExtentImage(wand->images,&extent,wand->exception);
2932 if (extent_image == (Image *) NULL)
2933 return(MagickFalse);
2934 ReplaceImageInList(&wand->images,extent_image);
2939 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2943 % M a g i c k F l i p I m a g e %
2947 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2949 % MagickFlipImage() creates a vertical mirror image by reflecting the pixels
2950 % around the central x-axis.
2952 % The format of the MagickFlipImage method is:
2954 % MagickBooleanType MagickFlipImage(MagickWand *wand)
2956 % A description of each parameter follows:
2958 % o wand: the magick wand.
2961 WandExport MagickBooleanType MagickFlipImage(MagickWand *wand)
2966 assert(wand != (MagickWand *) NULL);
2967 assert(wand->signature == WandSignature);
2968 if (wand->debug != MagickFalse)
2969 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2970 if (wand->images == (Image *) NULL)
2971 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2972 flip_image=FlipImage(wand->images,wand->exception);
2973 if (flip_image == (Image *) NULL)
2974 return(MagickFalse);
2975 ReplaceImageInList(&wand->images,flip_image);
2980 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2984 % 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 %
2988 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2990 % MagickFloodfillPaintImage() changes the color value of any pixel that matches
2991 % target and is an immediate neighbor. If the method FillToBorderMethod is
2992 % specified, the color value is changed for any neighbor pixel that does not
2993 % match the bordercolor member of image.
2995 % The format of the MagickFloodfillPaintImage method is:
2997 % MagickBooleanType MagickFloodfillPaintImage(MagickWand *wand,
2998 % const PixelWand *fill,const double fuzz,const PixelWand *bordercolor,
2999 % const ssize_t x,const ssize_t y,const MagickBooleanType invert)
3001 % A description of each parameter follows:
3003 % o wand: the magick wand.
3005 % o fill: the floodfill color pixel wand.
3007 % o fuzz: By default target must match a particular pixel color
3008 % exactly. However, in many cases two colors may differ by a small amount.
3009 % The fuzz member of image defines how much tolerance is acceptable to
3010 % consider two colors as the same. For example, set fuzz to 10 and the
3011 % color red at intensities of 100 and 102 respectively are now interpreted
3012 % as the same color for the purposes of the floodfill.
3014 % o bordercolor: the border color pixel wand.
3016 % o x,y: the starting location of the operation.
3018 % o invert: paint any pixel that does not match the target color.
3021 WandExport MagickBooleanType MagickFloodfillPaintImage(MagickWand *wand,
3022 const PixelWand *fill,const double fuzz,const PixelWand *bordercolor,
3023 const ssize_t x,const ssize_t y,const MagickBooleanType invert)
3034 assert(wand != (MagickWand *) NULL);
3035 assert(wand->signature == WandSignature);
3036 if (wand->debug != MagickFalse)
3037 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3038 if (wand->images == (Image *) NULL)
3039 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3040 draw_info=CloneDrawInfo(wand->image_info,(DrawInfo *) NULL);
3041 PixelGetQuantumPacket(fill,&draw_info->fill);
3042 (void) GetOneVirtualPixelInfo(wand->images,TileVirtualPixelMethod,x %
3043 wand->images->columns,y % wand->images->rows,&target,wand->exception);
3044 if (bordercolor != (PixelWand *) NULL)
3045 PixelGetMagickColor(bordercolor,&target);
3046 wand->images->fuzz=fuzz;
3047 status=FloodfillPaintImage(wand->images,draw_info,&target,x,y,invert,
3049 draw_info=DestroyDrawInfo(draw_info);
3054 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3058 % M a g i c k F l o p I m a g e %
3062 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3064 % MagickFlopImage() creates a horizontal mirror image by reflecting the pixels
3065 % around the central y-axis.
3067 % The format of the MagickFlopImage method is:
3069 % MagickBooleanType MagickFlopImage(MagickWand *wand)
3071 % A description of each parameter follows:
3073 % o wand: the magick wand.
3076 WandExport MagickBooleanType MagickFlopImage(MagickWand *wand)
3081 assert(wand != (MagickWand *) NULL);
3082 assert(wand->signature == WandSignature);
3083 if (wand->debug != MagickFalse)
3084 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3085 if (wand->images == (Image *) NULL)
3086 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3087 flop_image=FlopImage(wand->images,wand->exception);
3088 if (flop_image == (Image *) NULL)
3089 return(MagickFalse);
3090 ReplaceImageInList(&wand->images,flop_image);
3095 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3099 % 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 %
3103 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3105 % MagickForwardFourierTransformImage() implements the discrete Fourier
3106 % transform (DFT) of the image either as a magnitude / phase or real /
3107 % imaginary image pair.
3109 % The format of the MagickForwardFourierTransformImage method is:
3111 % MagickBooleanType MagickForwardFourierTransformImage(MagickWand *wand,
3112 % const MagickBooleanType magnitude)
3114 % A description of each parameter follows:
3116 % o wand: the magick wand.
3118 % o magnitude: if true, return as magnitude / phase pair otherwise a real /
3119 % imaginary image pair.
3122 WandExport MagickBooleanType MagickForwardFourierTransformImage(
3123 MagickWand *wand,const MagickBooleanType magnitude)
3128 assert(wand != (MagickWand *) NULL);
3129 assert(wand->signature == WandSignature);
3130 if (wand->debug != MagickFalse)
3131 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3132 if (wand->images == (Image *) NULL)
3133 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3134 forward_image=ForwardFourierTransformImage(wand->images,magnitude,
3136 if (forward_image == (Image *) NULL)
3137 return(MagickFalse);
3138 ReplaceImageInList(&wand->images,forward_image);
3143 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3147 % M a g i c k F r a m e I m a g e %
3151 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3153 % MagickFrameImage() adds a simulated three-dimensional border around the
3154 % image. The width and height specify the border width of the vertical and
3155 % horizontal sides of the frame. The inner and outer bevels indicate the
3156 % width of the inner and outer shadows of the frame.
3158 % The format of the MagickFrameImage method is:
3160 % MagickBooleanType MagickFrameImage(MagickWand *wand,
3161 % const PixelWand *matte_color,const size_t width,
3162 % const size_t height,const ssize_t inner_bevel,
3163 % const ssize_t outer_bevel,const CompositeOperator compose)
3165 % A description of each parameter follows:
3167 % o wand: the magick wand.
3169 % o matte_color: the frame color pixel wand.
3171 % o width: the border width.
3173 % o height: the border height.
3175 % o inner_bevel: the inner bevel width.
3177 % o outer_bevel: the outer bevel width.
3179 % o compose: the composite operator.
3182 WandExport MagickBooleanType MagickFrameImage(MagickWand *wand,
3183 const PixelWand *matte_color,const size_t width,const size_t height,
3184 const ssize_t inner_bevel,const ssize_t outer_bevel,
3185 const CompositeOperator compose)
3193 assert(wand != (MagickWand *) NULL);
3194 assert(wand->signature == WandSignature);
3195 if (wand->debug != MagickFalse)
3196 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3197 if (wand->images == (Image *) NULL)
3198 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3199 (void) ResetMagickMemory(&frame_info,0,sizeof(frame_info));
3200 frame_info.width=wand->images->columns+2*width;
3201 frame_info.height=wand->images->rows+2*height;
3202 frame_info.x=(ssize_t) width;
3203 frame_info.y=(ssize_t) height;
3204 frame_info.inner_bevel=inner_bevel;
3205 frame_info.outer_bevel=outer_bevel;
3206 PixelGetQuantumPacket(matte_color,&wand->images->matte_color);
3207 frame_image=FrameImage(wand->images,&frame_info,compose,wand->exception);
3208 if (frame_image == (Image *) NULL)
3209 return(MagickFalse);
3210 ReplaceImageInList(&wand->images,frame_image);
3215 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3219 % M a g i c k F u n c t i o n I m a g e %
3223 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3225 % MagickFunctionImage() applys an arithmetic, relational, or logical
3226 % expression to an image. Use these operators to lighten or darken an image,
3227 % to increase or decrease contrast in an image, or to produce the "negative"
3230 % The format of the MagickFunctionImage method is:
3232 % MagickBooleanType MagickFunctionImage(MagickWand *wand,
3233 % const MagickFunction function,const size_t number_arguments,
3234 % const double *arguments)
3236 % A description of each parameter follows:
3238 % o wand: the magick wand.
3240 % o function: the image function.
3242 % o number_arguments: the number of function arguments.
3244 % o arguments: the function arguments.
3247 WandExport MagickBooleanType MagickFunctionImage(MagickWand *wand,
3248 const MagickFunction function,const size_t number_arguments,
3249 const double *arguments)
3254 assert(wand != (MagickWand *) NULL);
3255 assert(wand->signature == WandSignature);
3256 if (wand->debug != MagickFalse)
3257 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3258 if (wand->images == (Image *) NULL)
3259 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3260 status=FunctionImage(wand->images,function,number_arguments,arguments,
3266 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3270 % M a g i c k F x I m a g e %
3274 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3276 % MagickFxImage() evaluate expression for each pixel in the image.
3278 % The format of the MagickFxImage method is:
3280 % MagickWand *MagickFxImage(MagickWand *wand,const char *expression)
3282 % A description of each parameter follows:
3284 % o wand: the magick wand.
3286 % o expression: the expression.
3289 WandExport MagickWand *MagickFxImage(MagickWand *wand,const char *expression)
3294 assert(wand != (MagickWand *) NULL);
3295 assert(wand->signature == WandSignature);
3296 if (wand->debug != MagickFalse)
3297 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3298 if (wand->images == (Image *) NULL)
3299 return((MagickWand *) NULL);
3300 fx_image=FxImage(wand->images,expression,wand->exception);
3301 if (fx_image == (Image *) NULL)
3302 return((MagickWand *) NULL);
3303 return(CloneMagickWandFromImages(wand,fx_image));
3307 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3311 % M a g i c k G a m m a I m a g e %
3315 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3317 % MagickGammaImage() gamma-corrects an image. The same image viewed on
3318 % different devices will have perceptual differences in the way the image's
3319 % intensities are represented on the screen. Specify individual gamma levels
3320 % for the red, green, and blue channels, or adjust all three with the gamma
3321 % parameter. Values typically range from 0.8 to 2.3.
3323 % You can also reduce the influence of a particular channel with a gamma
3326 % The format of the MagickGammaImage method is:
3328 % MagickBooleanType MagickGammaImage(MagickWand *wand,const double gamma)
3330 % A description of each parameter follows:
3332 % o wand: the magick wand.
3334 % o level: Define the level of gamma correction.
3337 WandExport MagickBooleanType MagickGammaImage(MagickWand *wand,
3343 assert(wand != (MagickWand *) NULL);
3344 assert(wand->signature == WandSignature);
3345 if (wand->debug != MagickFalse)
3346 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3347 if (wand->images == (Image *) NULL)
3348 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3349 status=GammaImage(wand->images,gamma,wand->exception);
3354 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3358 % M a g i c k G a u s s i a n B l u r I m a g e %
3362 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3364 % MagickGaussianBlurImage() blurs an image. We convolve the image with a
3365 % Gaussian operator of the given radius and standard deviation (sigma).
3366 % For reasonable results, the radius should be larger than sigma. Use a
3367 % radius of 0 and MagickGaussianBlurImage() selects a suitable radius for you.
3369 % The format of the MagickGaussianBlurImage method is:
3371 % MagickBooleanType MagickGaussianBlurImage(MagickWand *wand,
3372 % const double radius,const double sigma)
3374 % A description of each parameter follows:
3376 % o wand: the magick wand.
3378 % o radius: the radius of the Gaussian, in pixels, not counting the center
3381 % o sigma: the standard deviation of the Gaussian, in pixels.
3384 WandExport MagickBooleanType MagickGaussianBlurImage(MagickWand *wand,
3385 const double radius,const double sigma)
3390 assert(wand != (MagickWand *) NULL);
3391 assert(wand->signature == WandSignature);
3392 if (wand->debug != MagickFalse)
3393 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3394 if (wand->images == (Image *) NULL)
3395 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3396 blur_image=GaussianBlurImage(wand->images,radius,sigma,wand->exception);
3397 if (blur_image == (Image *) NULL)
3398 return(MagickFalse);
3399 ReplaceImageInList(&wand->images,blur_image);
3404 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3408 % M a g i c k G e t I m a g e %
3412 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3414 % MagickGetImage() gets the image at the current image index.
3416 % The format of the MagickGetImage method is:
3418 % MagickWand *MagickGetImage(MagickWand *wand)
3420 % A description of each parameter follows:
3422 % o wand: the magick wand.
3425 WandExport MagickWand *MagickGetImage(MagickWand *wand)
3430 assert(wand != (MagickWand *) NULL);
3431 assert(wand->signature == WandSignature);
3432 if (wand->debug != MagickFalse)
3433 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3434 if (wand->images == (Image *) NULL)
3436 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3437 "ContainsNoImages","`%s'",wand->name);
3438 return((MagickWand *) NULL);
3440 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
3441 if (image == (Image *) NULL)
3442 return((MagickWand *) NULL);
3443 return(CloneMagickWandFromImages(wand,image));
3447 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3451 % 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 %
3455 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3457 % MagickGetImageAlphaChannel() returns MagickFalse if the image alpha channel
3458 % is not activated. That is, the image is RGB rather than RGBA or CMYK rather
3461 % The format of the MagickGetImageAlphaChannel method is:
3463 % size_t MagickGetImageAlphaChannel(MagickWand *wand)
3465 % A description of each parameter follows:
3467 % o wand: the magick wand.
3470 WandExport MagickBooleanType MagickGetImageAlphaChannel(MagickWand *wand)
3472 assert(wand != (MagickWand *) NULL);
3473 assert(wand->signature == WandSignature);
3474 if (wand->debug != MagickFalse)
3475 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3476 if (wand->images == (Image *) NULL)
3477 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3478 return(GetImageAlphaChannel(wand->images));
3482 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3486 % M a g i c k G e t I m a g e C l i p M a s k %
3490 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3492 % MagickGetImageMask() gets the image clip mask at the current image index.
3494 % The format of the MagickGetImageMask method is:
3496 % MagickWand *MagickGetImageMask(MagickWand *wand)
3498 % A description of each parameter follows:
3500 % o wand: the magick wand.
3503 WandExport MagickWand *MagickGetImageMask(MagickWand *wand)
3508 assert(wand != (MagickWand *) NULL);
3509 assert(wand->signature == WandSignature);
3510 if (wand->debug != MagickFalse)
3511 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3512 if (wand->images == (Image *) NULL)
3514 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3515 "ContainsNoImages","`%s'",wand->name);
3516 return((MagickWand *) NULL);
3518 image=GetImageMask(wand->images,wand->exception);
3519 if (image == (Image *) NULL)
3520 return((MagickWand *) NULL);
3521 return(CloneMagickWandFromImages(wand,image));
3525 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3529 % 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 %
3533 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3535 % MagickGetImageBackgroundColor() returns the image background color.
3537 % The format of the MagickGetImageBackgroundColor method is:
3539 % MagickBooleanType MagickGetImageBackgroundColor(MagickWand *wand,
3540 % PixelWand *background_color)
3542 % A description of each parameter follows:
3544 % o wand: the magick wand.
3546 % o background_color: Return the background color.
3549 WandExport MagickBooleanType MagickGetImageBackgroundColor(MagickWand *wand,
3550 PixelWand *background_color)
3552 assert(wand != (MagickWand *) NULL);
3553 assert(wand->signature == WandSignature);
3554 if (wand->debug != MagickFalse)
3555 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3556 if (wand->images == (Image *) NULL)
3557 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3558 PixelSetPixelColor(background_color,&wand->images->background_color);
3563 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3567 % M a g i c k G e t I m a g e B l o b %
3571 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3573 % MagickGetImageBlob() implements direct to memory image formats. It returns
3574 % the image as a blob (a formatted "file" in memory) and its length, starting
3575 % from the current position in the image sequence. Use MagickSetImageFormat()
3576 % to set the format to write to the blob (GIF, JPEG, PNG, etc.).
3578 % Utilize MagickResetIterator() to ensure the write is from the beginning of
3579 % the image sequence.
3581 % Use MagickRelinquishMemory() to free the blob when you are done with it.
3583 % The format of the MagickGetImageBlob method is:
3585 % unsigned char *MagickGetImageBlob(MagickWand *wand,size_t *length)
3587 % A description of each parameter follows:
3589 % o wand: the magick wand.
3591 % o length: the length of the blob.
3594 WandExport unsigned char *MagickGetImageBlob(MagickWand *wand,size_t *length)
3596 assert(wand != (MagickWand *) NULL);
3597 assert(wand->signature == WandSignature);
3598 if (wand->debug != MagickFalse)
3599 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3600 if (wand->images == (Image *) NULL)
3602 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3603 "ContainsNoImages","`%s'",wand->name);
3604 return((unsigned char *) NULL);
3606 return(ImageToBlob(wand->image_info,wand->images,length,wand->exception));
3610 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3614 % M a g i c k G e t I m a g e s B l o b %
3618 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3620 % MagickGetImageBlob() implements direct to memory image formats. It
3621 % returns the image sequence as a blob and its length. The format of the image
3622 % determines the format of the returned blob (GIF, JPEG, PNG, etc.). To
3623 % return a different image format, use MagickSetImageFormat().
3625 % Note, some image formats do not permit multiple images to the same image
3626 % stream (e.g. JPEG). in this instance, just the first image of the
3627 % sequence is returned as a blob.
3629 % The format of the MagickGetImagesBlob method is:
3631 % unsigned char *MagickGetImagesBlob(MagickWand *wand,size_t *length)
3633 % A description of each parameter follows:
3635 % o wand: the magick wand.
3637 % o length: the length of the blob.
3640 WandExport unsigned char *MagickGetImagesBlob(MagickWand *wand,size_t *length)
3645 assert(wand != (MagickWand *) NULL);
3646 assert(wand->signature == WandSignature);
3647 if (wand->debug != MagickFalse)
3648 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3649 if (wand->images == (Image *) NULL)
3651 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3652 "ContainsNoImages","`%s'",wand->name);
3653 return((unsigned char *) NULL);
3655 blob=ImagesToBlob(wand->image_info,GetFirstImageInList(wand->images),length,
3661 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3665 % 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 %
3669 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3671 % MagickGetImageBluePrimary() returns the chromaticy blue primary point for the
3674 % The format of the MagickGetImageBluePrimary method is:
3676 % MagickBooleanType MagickGetImageBluePrimary(MagickWand *wand,double *x,
3679 % A description of each parameter follows:
3681 % o wand: the magick wand.
3683 % o x: the chromaticity blue primary x-point.
3685 % o y: the chromaticity blue primary y-point.
3688 WandExport MagickBooleanType MagickGetImageBluePrimary(MagickWand *wand,
3689 double *x,double *y)
3691 assert(wand != (MagickWand *) NULL);
3692 assert(wand->signature == WandSignature);
3693 if (wand->debug != MagickFalse)
3694 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3695 if (wand->images == (Image *) NULL)
3696 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3697 *x=wand->images->chromaticity.blue_primary.x;
3698 *y=wand->images->chromaticity.blue_primary.y;
3703 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3707 % 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 %
3711 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3713 % MagickGetImageBorderColor() returns the image border color.
3715 % The format of the MagickGetImageBorderColor method is:
3717 % MagickBooleanType MagickGetImageBorderColor(MagickWand *wand,
3718 % PixelWand *border_color)
3720 % A description of each parameter follows:
3722 % o wand: the magick wand.
3724 % o border_color: Return the border color.
3727 WandExport MagickBooleanType MagickGetImageBorderColor(MagickWand *wand,
3728 PixelWand *border_color)
3730 assert(wand != (MagickWand *) NULL);
3731 assert(wand->signature == WandSignature);
3732 if (wand->debug != MagickFalse)
3733 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3734 if (wand->images == (Image *) NULL)
3735 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3736 PixelSetPixelColor(border_color,&wand->images->border_color);
3741 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3745 % M a g i c k G e t I m a g e F e a t u r e s %
3749 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3751 % MagickGetImageFeatures() returns features for each channel in the
3752 % image in each of four directions (horizontal, vertical, left and right
3753 % diagonals) for the specified distance. The features include the angular
3754 % second moment, contrast, correlation, sum of squares: variance, inverse
3755 % difference moment, sum average, sum varience, sum entropy, entropy,
3756 % difference variance, difference entropy, information measures of
3757 % correlation 1, information measures of correlation 2, and maximum
3758 % correlation coefficient. You can access the red channel contrast, for
3759 % example, like this:
3761 % channel_features=MagickGetImageFeatures(wand,1);
3762 % contrast=channel_features[RedPixelChannel].contrast[0];
3764 % Use MagickRelinquishMemory() to free the statistics buffer.
3766 % The format of the MagickGetImageFeatures method is:
3768 % ChannelFeatures *MagickGetImageFeatures(MagickWand *wand,
3769 % const size_t distance)
3771 % A description of each parameter follows:
3773 % o wand: the magick wand.
3775 % o distance: the distance.
3778 WandExport ChannelFeatures *MagickGetImageFeatures(MagickWand *wand,
3779 const size_t distance)
3781 assert(wand != (MagickWand *) NULL);
3782 assert(wand->signature == WandSignature);
3783 if (wand->debug != MagickFalse)
3784 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3785 if (wand->images == (Image *) NULL)
3787 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3788 "ContainsNoImages","`%s'",wand->name);
3789 return((ChannelFeatures *) NULL);
3791 return(GetImageFeatures(wand->images,distance,wand->exception));
3795 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3799 % M a g i c k G e t I m a g e K u r t o s i s %
3803 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3805 % MagickGetImageKurtosis() gets the kurtosis and skewness of one or
3806 % more image channels.
3808 % The format of the MagickGetImageKurtosis method is:
3810 % MagickBooleanType MagickGetImageKurtosis(MagickWand *wand,
3811 % double *kurtosis,double *skewness)
3813 % A description of each parameter follows:
3815 % o wand: the magick wand.
3817 % o kurtosis: The kurtosis for the specified channel(s).
3819 % o skewness: The skewness for the specified channel(s).
3822 WandExport MagickBooleanType MagickGetImageKurtosis(MagickWand *wand,
3823 double *kurtosis,double *skewness)
3828 assert(wand != (MagickWand *) NULL);
3829 assert(wand->signature == WandSignature);
3830 if (wand->debug != MagickFalse)
3831 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3832 if (wand->images == (Image *) NULL)
3833 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3834 status=GetImageKurtosis(wand->images,kurtosis,skewness,wand->exception);
3839 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3843 % M a g i c k G e t I m a g e M e a n %
3847 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3849 % MagickGetImageMean() gets the mean and standard deviation of one or more
3852 % The format of the MagickGetImageMean method is:
3854 % MagickBooleanType MagickGetImageMean(MagickWand *wand,double *mean,
3855 % double *standard_deviation)
3857 % A description of each parameter follows:
3859 % o wand: the magick wand.
3861 % o channel: the image channel(s).
3863 % o mean: The mean pixel value for the specified channel(s).
3865 % o standard_deviation: The standard deviation for the specified channel(s).
3868 WandExport MagickBooleanType MagickGetImageMean(MagickWand *wand,double *mean,
3869 double *standard_deviation)
3874 assert(wand != (MagickWand *) NULL);
3875 assert(wand->signature == WandSignature);
3876 if (wand->debug != MagickFalse)
3877 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3878 if (wand->images == (Image *) NULL)
3879 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3880 status=GetImageMean(wand->images,mean,standard_deviation,wand->exception);
3885 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3889 % M a g i c k G e t I m a g e R a n g e %
3893 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3895 % MagickGetImageRange() gets the range for one or more image channels.
3897 % The format of the MagickGetImageRange method is:
3899 % MagickBooleanType MagickGetImageRange(MagickWand *wand,double *minima,
3902 % A description of each parameter follows:
3904 % o wand: the magick wand.
3906 % o minima: The minimum pixel value for the specified channel(s).
3908 % o maxima: The maximum pixel value for the specified channel(s).
3911 WandExport MagickBooleanType MagickGetImageRange(MagickWand *wand,
3912 double *minima,double *maxima)
3917 assert(wand != (MagickWand *) NULL);
3918 assert(wand->signature == WandSignature);
3919 if (wand->debug != MagickFalse)
3920 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3921 if (wand->images == (Image *) NULL)
3922 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3923 status=GetImageRange(wand->images,minima,maxima,wand->exception);
3928 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3932 % M a g i c k G e t I m a g e S t a t i s t i c s %
3936 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3938 % MagickGetImageStatistics() returns statistics for each channel in the
3939 % image. The statistics include the channel depth, its minima and
3940 % maxima, the mean, the standard deviation, the kurtosis and the skewness.
3941 % You can access the red channel mean, for example, like this:
3943 % channel_statistics=MagickGetImageStatistics(wand);
3944 % red_mean=channel_statistics[RedPixelChannel].mean;
3946 % Use MagickRelinquishMemory() to free the statistics buffer.
3948 % The format of the MagickGetImageStatistics method is:
3950 % ChannelStatistics *MagickGetImageStatistics(MagickWand *wand)
3952 % A description of each parameter follows:
3954 % o wand: the magick wand.
3957 WandExport ChannelStatistics *MagickGetImageStatistics(MagickWand *wand)
3959 assert(wand != (MagickWand *) NULL);
3960 assert(wand->signature == WandSignature);
3961 if (wand->debug != MagickFalse)
3962 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3963 if (wand->images == (Image *) NULL)
3965 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3966 "ContainsNoImages","`%s'",wand->name);
3967 return((ChannelStatistics *) NULL);
3969 return(GetImageStatistics(wand->images,wand->exception));
3973 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3977 % 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 %
3981 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3983 % MagickGetImageColormapColor() returns the color of the specified colormap
3986 % The format of the MagickGetImageColormapColor method is:
3988 % MagickBooleanType MagickGetImageColormapColor(MagickWand *wand,
3989 % const size_t index,PixelWand *color)
3991 % A description of each parameter follows:
3993 % o wand: the magick wand.
3995 % o index: the offset into the image colormap.
3997 % o color: Return the colormap color in this wand.
4000 WandExport MagickBooleanType MagickGetImageColormapColor(MagickWand *wand,
4001 const size_t index,PixelWand *color)
4003 assert(wand != (MagickWand *) NULL);
4004 assert(wand->signature == WandSignature);
4005 if (wand->debug != MagickFalse)
4006 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4007 if (wand->images == (Image *) NULL)
4008 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4009 if ((wand->images->colormap == (PixelInfo *) NULL) ||
4010 (index >= wand->images->colors))
4012 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4013 "InvalidColormapIndex","`%s'",wand->name);
4014 return(MagickFalse);
4016 PixelSetPixelColor(color,wand->images->colormap+index);
4021 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4025 % M a g i c k G e t I m a g e C o l o r s %
4029 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4031 % MagickGetImageColors() gets the number of unique colors in the image.
4033 % The format of the MagickGetImageColors method is:
4035 % size_t MagickGetImageColors(MagickWand *wand)
4037 % A description of each parameter follows:
4039 % o wand: the magick wand.
4042 WandExport size_t MagickGetImageColors(MagickWand *wand)
4044 assert(wand != (MagickWand *) NULL);
4045 assert(wand->signature == WandSignature);
4046 if (wand->debug != MagickFalse)
4047 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4048 if (wand->images == (Image *) NULL)
4050 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4051 "ContainsNoImages","`%s'",wand->name);
4054 return(GetNumberColors(wand->images,(FILE *) NULL,wand->exception));
4058 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4062 % M a g i c k G e t I m a g e C o l o r s p a c e %
4066 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4068 % MagickGetImageColorspace() gets the image colorspace.
4070 % The format of the MagickGetImageColorspace method is:
4072 % ColorspaceType MagickGetImageColorspace(MagickWand *wand)
4074 % A description of each parameter follows:
4076 % o wand: the magick wand.
4079 WandExport ColorspaceType MagickGetImageColorspace(MagickWand *wand)
4081 assert(wand != (MagickWand *) NULL);
4082 assert(wand->signature == WandSignature);
4083 if (wand->debug != MagickFalse)
4084 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4085 if (wand->images == (Image *) NULL)
4087 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4088 "ContainsNoImages","`%s'",wand->name);
4089 return(UndefinedColorspace);
4091 return(wand->images->colorspace);
4095 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4099 % M a g i c k G e t I m a g e C o m p o s e %
4103 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4105 % MagickGetImageCompose() returns the composite operator associated with the
4108 % The format of the MagickGetImageCompose method is:
4110 % CompositeOperator MagickGetImageCompose(MagickWand *wand)
4112 % A description of each parameter follows:
4114 % o wand: the magick wand.
4117 WandExport CompositeOperator MagickGetImageCompose(MagickWand *wand)
4119 assert(wand != (MagickWand *) NULL);
4120 assert(wand->signature == WandSignature);
4121 if (wand->debug != MagickFalse)
4122 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4123 if (wand->images == (Image *) NULL)
4125 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4126 "ContainsNoImages","`%s'",wand->name);
4127 return(UndefinedCompositeOp);
4129 return(wand->images->compose);
4133 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4137 % 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 %
4141 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4143 % MagickGetImageCompression() gets the image compression.
4145 % The format of the MagickGetImageCompression method is:
4147 % CompressionType MagickGetImageCompression(MagickWand *wand)
4149 % A description of each parameter follows:
4151 % o wand: the magick wand.
4154 WandExport CompressionType MagickGetImageCompression(MagickWand *wand)
4156 assert(wand != (MagickWand *) NULL);
4157 assert(wand->signature == WandSignature);
4158 if (wand->debug != MagickFalse)
4159 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4160 if (wand->images == (Image *) NULL)
4162 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4163 "ContainsNoImages","`%s'",wand->name);
4164 return(UndefinedCompression);
4166 return(wand->images->compression);
4170 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4174 % 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 %
4178 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4180 % MagickGetImageCompression() gets the image compression quality.
4182 % The format of the MagickGetImageCompression method is:
4184 % size_t MagickGetImageCompression(MagickWand *wand)
4186 % A description of each parameter follows:
4188 % o wand: the magick wand.
4191 WandExport size_t MagickGetImageCompressionQuality(MagickWand *wand)
4193 assert(wand != (MagickWand *) NULL);
4194 assert(wand->signature == WandSignature);
4195 if (wand->debug != MagickFalse)
4196 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4197 if (wand->images == (Image *) NULL)
4199 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4200 "ContainsNoImages","`%s'",wand->name);
4203 return(wand->images->quality);
4207 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4211 % M a g i c k G e t I m a g e D e l a y %
4215 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4217 % MagickGetImageDelay() gets the image delay.
4219 % The format of the MagickGetImageDelay method is:
4221 % size_t MagickGetImageDelay(MagickWand *wand)
4223 % A description of each parameter follows:
4225 % o wand: the magick wand.
4228 WandExport size_t MagickGetImageDelay(MagickWand *wand)
4230 assert(wand != (MagickWand *) NULL);
4231 assert(wand->signature == WandSignature);
4232 if (wand->debug != MagickFalse)
4233 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4234 if (wand->images == (Image *) NULL)
4235 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4236 return(wand->images->delay);
4240 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4244 % M a g i c k G e t I m a g e D e p t h %
4248 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4250 % MagickGetImageDepth() gets the image depth.
4252 % The format of the MagickGetImageDepth method is:
4254 % size_t MagickGetImageDepth(MagickWand *wand)
4256 % A description of each parameter follows:
4258 % o wand: the magick wand.
4261 WandExport size_t MagickGetImageDepth(MagickWand *wand)
4263 assert(wand != (MagickWand *) NULL);
4264 assert(wand->signature == WandSignature);
4265 if (wand->debug != MagickFalse)
4266 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4267 if (wand->images == (Image *) NULL)
4268 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4269 return(wand->images->depth);
4273 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4277 % M a g i c k G e t I m a g e D i s p o s e %
4281 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4283 % MagickGetImageDispose() gets the image disposal method.
4285 % The format of the MagickGetImageDispose method is:
4287 % DisposeType MagickGetImageDispose(MagickWand *wand)
4289 % A description of each parameter follows:
4291 % o wand: the magick wand.
4294 WandExport DisposeType MagickGetImageDispose(MagickWand *wand)
4296 assert(wand != (MagickWand *) NULL);
4297 assert(wand->signature == WandSignature);
4298 if (wand->debug != MagickFalse)
4299 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4300 if (wand->images == (Image *) NULL)
4302 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4303 "ContainsNoImages","`%s'",wand->name);
4304 return(UndefinedDispose);
4306 return((DisposeType) wand->images->dispose);
4310 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4314 % M a g i c k G e t I m a g e D i s t o r t i o n %
4318 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4320 % MagickGetImageDistortion() compares an image to a reconstructed image and
4321 % returns the specified distortion metric.
4323 % The format of the MagickGetImageDistortion method is:
4325 % MagickBooleanType MagickGetImageDistortion(MagickWand *wand,
4326 % const MagickWand *reference,const MetricType metric,
4327 % double *distortion)
4329 % A description of each parameter follows:
4331 % o wand: the magick wand.
4333 % o reference: the reference wand.
4335 % o metric: the metric.
4337 % o distortion: the computed distortion between the images.
4340 WandExport MagickBooleanType MagickGetImageDistortion(MagickWand *wand,
4341 const MagickWand *reference,const MetricType metric,double *distortion)
4346 assert(wand != (MagickWand *) NULL);
4347 assert(wand->signature == WandSignature);
4348 if (wand->debug != MagickFalse)
4349 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4350 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
4351 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4352 status=GetImageDistortion(wand->images,reference->images,metric,distortion,
4358 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4362 % 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 %
4366 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4368 % MagickGetImageDistortions() compares one or more pixel channels of an
4369 % image to a reconstructed image and returns the specified distortion metrics.
4371 % Use MagickRelinquishMemory() to free the metrics when you are done with them.
4373 % The format of the MagickGetImageDistortion method is:
4375 % double *MagickGetImageDistortion(MagickWand *wand,
4376 % const MagickWand *reference,const MetricType metric)
4378 % A description of each parameter follows:
4380 % o wand: the magick wand.
4382 % o reference: the reference wand.
4384 % o metric: the metric.
4387 WandExport double *MagickGetImageDistortions(MagickWand *wand,
4388 const MagickWand *reference,const MetricType metric)
4391 *channel_distortion;
4393 assert(wand != (MagickWand *) NULL);
4394 assert(wand->signature == WandSignature);
4395 if (wand->debug != MagickFalse)
4396 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4397 assert(reference != (MagickWand *) NULL);
4398 assert(reference->signature == WandSignature);
4399 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
4401 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4402 "ContainsNoImages","`%s'",wand->name);
4403 return((double *) NULL);
4405 channel_distortion=GetImageDistortions(wand->images,reference->images,
4406 metric,wand->exception);
4407 return(channel_distortion);
4411 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4415 % M a g i c k G e t I m a g e F i l e n a m e %
4419 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4421 % MagickGetImageFilename() returns the filename of a particular image in a
4424 % The format of the MagickGetImageFilename method is:
4426 % char *MagickGetImageFilename(MagickWand *wand)
4428 % A description of each parameter follows:
4430 % o wand: the magick wand.
4433 WandExport char *MagickGetImageFilename(MagickWand *wand)
4435 assert(wand != (MagickWand *) NULL);
4436 assert(wand->signature == WandSignature);
4437 if (wand->debug != MagickFalse)
4438 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4439 if (wand->images == (Image *) NULL)
4441 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4442 "ContainsNoImages","`%s'",wand->name);
4443 return((char *) NULL);
4445 return(AcquireString(wand->images->filename));
4449 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4453 % M a g i c k G e t I m a g e F o r m a t %
4457 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4459 % MagickGetImageFormat() returns the format of a particular image in a
4462 % The format of the MagickGetImageFormat method is:
4464 % const char *MagickGetImageFormat(MagickWand *wand)
4466 % A description of each parameter follows:
4468 % o wand: the magick wand.
4471 WandExport char *MagickGetImageFormat(MagickWand *wand)
4473 assert(wand != (MagickWand *) NULL);
4474 assert(wand->signature == WandSignature);
4475 if (wand->debug != MagickFalse)
4476 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4477 if (wand->images == (Image *) NULL)
4479 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4480 "ContainsNoImages","`%s'",wand->name);
4481 return((char *) NULL);
4483 return(AcquireString(wand->images->magick));
4487 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4491 % M a g i c k G e t I m a g e F u z z %
4495 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4497 % MagickGetImageFuzz() gets the image fuzz.
4499 % The format of the MagickGetImageFuzz method is:
4501 % double MagickGetImageFuzz(MagickWand *wand)
4503 % A description of each parameter follows:
4505 % o wand: the magick wand.
4508 WandExport double MagickGetImageFuzz(MagickWand *wand)
4510 assert(wand != (MagickWand *) NULL);
4511 assert(wand->signature == WandSignature);
4512 if (wand->debug != MagickFalse)
4513 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4514 if (wand->images == (Image *) NULL)
4516 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4517 "ContainsNoImages","`%s'",wand->name);
4520 return(wand->images->fuzz);
4524 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4528 % M a g i c k G e t I m a g e G a m m a %
4532 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4534 % MagickGetImageGamma() gets the image gamma.
4536 % The format of the MagickGetImageGamma method is:
4538 % double MagickGetImageGamma(MagickWand *wand)
4540 % A description of each parameter follows:
4542 % o wand: the magick wand.
4545 WandExport double MagickGetImageGamma(MagickWand *wand)
4547 assert(wand != (MagickWand *) NULL);
4548 assert(wand->signature == WandSignature);
4549 if (wand->debug != MagickFalse)
4550 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4551 if (wand->images == (Image *) NULL)
4553 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4554 "ContainsNoImages","`%s'",wand->name);
4557 return(wand->images->gamma);
4561 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4565 % 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 %
4569 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4571 % MagickGetImageGravity() gets the image gravity.
4573 % The format of the MagickGetImageGravity method is:
4575 % GravityType MagickGetImageGravity(MagickWand *wand)
4577 % A description of each parameter follows:
4579 % o wand: the magick wand.
4582 WandExport GravityType MagickGetImageGravity(MagickWand *wand)
4584 assert(wand != (MagickWand *) NULL);
4585 assert(wand->signature == WandSignature);
4586 if (wand->debug != MagickFalse)
4587 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4588 if (wand->images == (Image *) NULL)
4590 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4591 "ContainsNoImages","`%s'",wand->name);
4592 return(UndefinedGravity);
4594 return(wand->images->gravity);
4598 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4602 % 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 %
4606 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4608 % MagickGetImageGreenPrimary() returns the chromaticy green primary point.
4610 % The format of the MagickGetImageGreenPrimary method is:
4612 % MagickBooleanType MagickGetImageGreenPrimary(MagickWand *wand,double *x,
4615 % A description of each parameter follows:
4617 % o wand: the magick wand.
4619 % o x: the chromaticity green primary x-point.
4621 % o y: the chromaticity green primary y-point.
4624 WandExport MagickBooleanType MagickGetImageGreenPrimary(MagickWand *wand,
4625 double *x,double *y)
4627 assert(wand != (MagickWand *) NULL);
4628 assert(wand->signature == WandSignature);
4629 if (wand->debug != MagickFalse)
4630 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4631 if (wand->images == (Image *) NULL)
4632 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4633 *x=wand->images->chromaticity.green_primary.x;
4634 *y=wand->images->chromaticity.green_primary.y;
4639 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4643 % M a g i c k G e t I m a g e H e i g h t %
4647 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4649 % MagickGetImageHeight() returns the image height.
4651 % The format of the MagickGetImageHeight method is:
4653 % size_t MagickGetImageHeight(MagickWand *wand)
4655 % A description of each parameter follows:
4657 % o wand: the magick wand.
4660 WandExport size_t MagickGetImageHeight(MagickWand *wand)
4662 assert(wand != (MagickWand *) NULL);
4663 assert(wand->signature == WandSignature);
4664 if (wand->debug != MagickFalse)
4665 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4666 if (wand->images == (Image *) NULL)
4667 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4668 return(wand->images->rows);
4672 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4676 % M a g i c k G e t I m a g e H i s t o g r a m %
4680 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4682 % MagickGetImageHistogram() returns the image histogram as an array of
4685 % The format of the MagickGetImageHistogram method is:
4687 % PixelWand **MagickGetImageHistogram(MagickWand *wand,
4688 % size_t *number_colors)
4690 % A description of each parameter follows:
4692 % o wand: the magick wand.
4694 % o number_colors: the number of unique colors in the image and the number
4695 % of pixel wands returned.
4698 WandExport PixelWand **MagickGetImageHistogram(MagickWand *wand,
4699 size_t *number_colors)
4710 assert(wand != (MagickWand *) NULL);
4711 assert(wand->signature == WandSignature);
4712 if (wand->debug != MagickFalse)
4713 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4714 if (wand->images == (Image *) NULL)
4716 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4717 "ContainsNoImages","`%s'",wand->name);
4718 return((PixelWand **) NULL);
4720 histogram=GetImageHistogram(wand->images,number_colors,wand->exception);
4721 if (histogram == (PixelInfo *) NULL)
4722 return((PixelWand **) NULL);
4723 pixel_wands=NewPixelWands(*number_colors);
4724 for (i=0; i < (ssize_t) *number_colors; i++)
4726 PixelSetPixelColor(pixel_wands[i],&histogram[i]);
4727 PixelSetColorCount(pixel_wands[i],(size_t) histogram[i].count);
4729 histogram=(PixelInfo *) RelinquishMagickMemory(histogram);
4730 return(pixel_wands);
4734 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4738 % 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 %
4742 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4744 % MagickGetImageInterlaceScheme() gets the image interlace scheme.
4746 % The format of the MagickGetImageInterlaceScheme method is:
4748 % InterlaceType MagickGetImageInterlaceScheme(MagickWand *wand)
4750 % A description of each parameter follows:
4752 % o wand: the magick wand.
4755 WandExport InterlaceType MagickGetImageInterlaceScheme(MagickWand *wand)
4757 assert(wand != (MagickWand *) NULL);
4758 assert(wand->signature == WandSignature);
4759 if (wand->debug != MagickFalse)
4760 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4761 if (wand->images == (Image *) NULL)
4763 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4764 "ContainsNoImages","`%s'",wand->name);
4765 return(UndefinedInterlace);
4767 return(wand->images->interlace);
4771 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4775 % 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 %
4779 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4781 % MagickGetImageInterpolateMethod() returns the interpolation method for the
4784 % The format of the MagickGetImageInterpolateMethod method is:
4786 % PixelInterpolateMethod MagickGetImagePixelInterpolateMethod(
4789 % A description of each parameter follows:
4791 % o wand: the magick wand.
4794 WandExport PixelInterpolateMethod MagickGetImageInterpolateMethod(
4797 assert(wand != (MagickWand *) NULL);
4798 assert(wand->signature == WandSignature);
4799 if (wand->debug != MagickFalse)
4800 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4801 if (wand->images == (Image *) NULL)
4803 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4804 "ContainsNoImages","`%s'",wand->name);
4805 return(UndefinedInterpolatePixel);
4807 return(wand->images->interpolate);
4811 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4815 % M a g i c k G e t I m a g e I t e r a t i o n s %
4819 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4821 % MagickGetImageIterations() gets the image iterations.
4823 % The format of the MagickGetImageIterations method is:
4825 % size_t MagickGetImageIterations(MagickWand *wand)
4827 % A description of each parameter follows:
4829 % o wand: the magick wand.
4832 WandExport size_t MagickGetImageIterations(MagickWand *wand)
4834 assert(wand != (MagickWand *) NULL);
4835 assert(wand->signature == WandSignature);
4836 if (wand->debug != MagickFalse)
4837 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4838 if (wand->images == (Image *) NULL)
4839 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4840 return(wand->images->iterations);
4844 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4848 % M a g i c k G e t I m a g e L e n g t h %
4852 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4854 % MagickGetImageLength() returns the image length in bytes.
4856 % The format of the MagickGetImageLength method is:
4858 % MagickBooleanType MagickGetImageLength(MagickWand *wand,
4859 % MagickSizeType *length)
4861 % A description of each parameter follows:
4863 % o wand: the magick wand.
4865 % o length: the image length in bytes.
4868 WandExport MagickBooleanType MagickGetImageLength(MagickWand *wand,
4869 MagickSizeType *length)
4871 assert(wand != (MagickWand *) NULL);
4872 assert(wand->signature == WandSignature);
4873 if (wand->debug != MagickFalse)
4874 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4875 if (wand->images == (Image *) NULL)
4876 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4877 *length=GetBlobSize(wand->images);
4882 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4886 % M a g i c k G e t I m a g e M a t t e C o l o r %
4890 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4892 % MagickGetImageMatteColor() returns the image matte color.
4894 % The format of the MagickGetImageMatteColor method is:
4896 % MagickBooleanType MagickGetImagematteColor(MagickWand *wand,
4897 % PixelWand *matte_color)
4899 % A description of each parameter follows:
4901 % o wand: the magick wand.
4903 % o matte_color: Return the matte color.
4906 WandExport MagickBooleanType MagickGetImageMatteColor(MagickWand *wand,
4907 PixelWand *matte_color)
4909 assert(wand != (MagickWand *) NULL);
4910 assert(wand->signature == WandSignature);
4911 if (wand->debug != MagickFalse)
4912 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4913 if (wand->images == (Image *) NULL)
4914 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4915 PixelSetPixelColor(matte_color,&wand->images->matte_color);
4920 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4924 % 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 %
4928 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4930 % MagickGetImageOrientation() returns the image orientation.
4932 % The format of the MagickGetImageOrientation method is:
4934 % OrientationType MagickGetImageOrientation(MagickWand *wand)
4936 % A description of each parameter follows:
4938 % o wand: the magick wand.
4941 WandExport OrientationType MagickGetImageOrientation(MagickWand *wand)
4943 assert(wand != (MagickWand *) NULL);
4944 assert(wand->signature == WandSignature);
4945 if (wand->debug != MagickFalse)
4946 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4947 if (wand->images == (Image *) NULL)
4949 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4950 "ContainsNoImages","`%s'",wand->name);
4951 return(UndefinedOrientation);
4953 return(wand->images->orientation);
4957 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4961 % M a g i c k G e t I m a g e P a g e %
4965 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4967 % MagickGetImagePage() returns the page geometry associated with the image.
4969 % The format of the MagickGetImagePage method is:
4971 % MagickBooleanType MagickGetImagePage(MagickWand *wand,
4972 % size_t *width,size_t *height,ssize_t *x,ssize_t *y)
4974 % A description of each parameter follows:
4976 % o wand: the magick wand.
4978 % o width: the page width.
4980 % o height: the page height.
4982 % o x: the page x-offset.
4984 % o y: the page y-offset.
4987 WandExport MagickBooleanType MagickGetImagePage(MagickWand *wand,
4988 size_t *width,size_t *height,ssize_t *x,ssize_t *y)
4990 assert(wand != (const MagickWand *) NULL);
4991 assert(wand->signature == WandSignature);
4992 if (wand->debug != MagickFalse)
4993 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4994 if (wand->images == (Image *) NULL)
4995 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4996 *width=wand->images->page.width;
4997 *height=wand->images->page.height;
4998 *x=wand->images->page.x;
4999 *y=wand->images->page.y;
5004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5008 % M a g i c k G e t I m a g e P i x e l C o l o r %
5012 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5014 % MagickGetImagePixelColor() returns the color of the specified pixel.
5016 % The format of the MagickGetImagePixelColor method is:
5018 % MagickBooleanType MagickGetImagePixelColor(MagickWand *wand,
5019 % const ssize_t x,const ssize_t y,PixelWand *color)
5021 % A description of each parameter follows:
5023 % o wand: the magick wand.
5025 % o x,y: the pixel offset into the image.
5027 % o color: Return the colormap color in this wand.
5030 WandExport MagickBooleanType MagickGetImagePixelColor(MagickWand *wand,
5031 const ssize_t x,const ssize_t y,PixelWand *color)
5033 register const Quantum
5039 assert(wand != (MagickWand *) NULL);
5040 assert(wand->signature == WandSignature);
5041 if (wand->debug != MagickFalse)
5042 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5043 if (wand->images == (Image *) NULL)
5044 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5045 image_view=AcquireCacheView(wand->images);
5046 p=GetCacheViewVirtualPixels(image_view,x,y,1,1,wand->exception);
5047 if (p == (const Quantum *) NULL)
5049 image_view=DestroyCacheView(image_view);
5050 return(MagickFalse);
5052 PixelSetQuantumPixel(wand->images,p,color);
5053 image_view=DestroyCacheView(image_view);
5058 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5062 % M a g i c k G e t I m a g e R e d P r i m a r y %
5066 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5068 % MagickGetImageRedPrimary() returns the chromaticy red primary point.
5070 % The format of the MagickGetImageRedPrimary method is:
5072 % MagickBooleanType MagickGetImageRedPrimary(MagickWand *wand,double *x,
5075 % A description of each parameter follows:
5077 % o wand: the magick wand.
5079 % o x: the chromaticity red primary x-point.
5081 % o y: the chromaticity red primary y-point.
5084 WandExport MagickBooleanType MagickGetImageRedPrimary(MagickWand *wand,
5085 double *x,double *y)
5087 assert(wand != (MagickWand *) NULL);
5088 assert(wand->signature == WandSignature);
5089 if (wand->debug != MagickFalse)
5090 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5091 if (wand->images == (Image *) NULL)
5092 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5093 *x=wand->images->chromaticity.red_primary.x;
5094 *y=wand->images->chromaticity.red_primary.y;
5099 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5103 % M a g i c k G e t I m a g e R e g i o n %
5107 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5109 % MagickGetImageRegion() extracts a region of the image and returns it as a
5112 % The format of the MagickGetImageRegion method is:
5114 % MagickWand *MagickGetImageRegion(MagickWand *wand,
5115 % const size_t width,const size_t height,const ssize_t x,
5118 % A description of each parameter follows:
5120 % o wand: the magick wand.
5122 % o width: the region width.
5124 % o height: the region height.
5126 % o x: the region x offset.
5128 % o y: the region y offset.
5131 WandExport MagickWand *MagickGetImageRegion(MagickWand *wand,
5132 const size_t width,const size_t height,const ssize_t x,
5141 assert(wand != (MagickWand *) NULL);
5142 assert(wand->signature == WandSignature);
5143 if (wand->debug != MagickFalse)
5144 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5145 if (wand->images == (Image *) NULL)
5146 return((MagickWand *) NULL);
5148 region.height=height;
5151 region_image=CropImage(wand->images,®ion,wand->exception);
5152 if (region_image == (Image *) NULL)
5153 return((MagickWand *) NULL);
5154 return(CloneMagickWandFromImages(wand,region_image));
5158 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5162 % 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 %
5166 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5168 % MagickGetImageRenderingIntent() gets the image rendering intent.
5170 % The format of the MagickGetImageRenderingIntent method is:
5172 % RenderingIntent MagickGetImageRenderingIntent(MagickWand *wand)
5174 % A description of each parameter follows:
5176 % o wand: the magick wand.
5179 WandExport RenderingIntent MagickGetImageRenderingIntent(MagickWand *wand)
5181 assert(wand != (MagickWand *) NULL);
5182 assert(wand->signature == WandSignature);
5183 if (wand->debug != MagickFalse)
5184 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5185 if (wand->images == (Image *) NULL)
5187 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5188 "ContainsNoImages","`%s'",wand->name);
5189 return(UndefinedIntent);
5191 return((RenderingIntent) wand->images->rendering_intent);
5195 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5199 % M a g i c k G e t I m a g e R e s o l u t i o n %
5203 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5205 % MagickGetImageResolution() gets the image X and Y resolution.
5207 % The format of the MagickGetImageResolution method is:
5209 % MagickBooleanType MagickGetImageResolution(MagickWand *wand,double *x,
5212 % A description of each parameter follows:
5214 % o wand: the magick wand.
5216 % o x: the image x-resolution.
5218 % o y: the image y-resolution.
5221 WandExport MagickBooleanType MagickGetImageResolution(MagickWand *wand,
5222 double *x,double *y)
5224 assert(wand != (MagickWand *) NULL);
5225 assert(wand->signature == WandSignature);
5226 if (wand->debug != MagickFalse)
5227 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5228 if (wand->images == (Image *) NULL)
5229 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5230 *x=wand->images->resolution.x;
5231 *y=wand->images->resolution.y;
5236 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5240 % M a g i c k G e t I m a g e S c e n e %
5244 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5246 % MagickGetImageScene() gets the image scene.
5248 % The format of the MagickGetImageScene method is:
5250 % size_t MagickGetImageScene(MagickWand *wand)
5252 % A description of each parameter follows:
5254 % o wand: the magick wand.
5257 WandExport size_t MagickGetImageScene(MagickWand *wand)
5259 assert(wand != (MagickWand *) NULL);
5260 assert(wand->signature == WandSignature);
5261 if (wand->debug != MagickFalse)
5262 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5263 if (wand->images == (Image *) NULL)
5264 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5265 return(wand->images->scene);
5269 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5273 % M a g i c k G e t I m a g e S i g n a t u r e %
5277 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5279 % MagickGetImageSignature() generates an SHA-256 message digest for the image
5282 % The format of the MagickGetImageSignature method is:
5284 % const char MagickGetImageSignature(MagickWand *wand)
5286 % A description of each parameter follows:
5288 % o wand: the magick wand.
5291 WandExport char *MagickGetImageSignature(MagickWand *wand)
5299 assert(wand != (MagickWand *) NULL);
5300 assert(wand->signature == WandSignature);
5301 if (wand->debug != MagickFalse)
5302 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5303 if (wand->images == (Image *) NULL)
5305 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5306 "ContainsNoImages","`%s'",wand->name);
5307 return((char *) NULL);
5309 status=SignatureImage(wand->images,wand->exception);
5310 if (status == MagickFalse)
5311 return((char *) NULL);
5312 value=GetImageProperty(wand->images,"signature",wand->exception);
5313 if (value == (const char *) NULL)
5314 return((char *) NULL);
5315 return(AcquireString(value));
5319 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5323 % 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 %
5327 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5329 % MagickGetImageTicksPerSecond() gets the image ticks-per-second.
5331 % The format of the MagickGetImageTicksPerSecond method is:
5333 % size_t MagickGetImageTicksPerSecond(MagickWand *wand)
5335 % A description of each parameter follows:
5337 % o wand: the magick wand.
5340 WandExport size_t MagickGetImageTicksPerSecond(MagickWand *wand)
5342 assert(wand != (MagickWand *) NULL);
5343 assert(wand->signature == WandSignature);
5344 if (wand->debug != MagickFalse)
5345 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5346 if (wand->images == (Image *) NULL)
5347 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5348 return((size_t) wand->images->ticks_per_second);
5352 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5356 % M a g i c k G e t I m a g e T y p e %
5360 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5362 % MagickGetImageType() gets the potential image type:
5364 % Bilevel Grayscale GrayscaleMatte
5365 % Palette PaletteMatte TrueColor
5366 % TrueColorMatte ColorSeparation ColorSeparationMatte
5368 % To ensure the image type matches its potential, use MagickSetImageType():
5370 % (void) MagickSetImageType(wand,MagickGetImageType(wand));
5372 % The format of the MagickGetImageType method is:
5374 % ImageType MagickGetImageType(MagickWand *wand)
5376 % A description of each parameter follows:
5378 % o wand: the magick wand.
5381 WandExport ImageType MagickGetImageType(MagickWand *wand)
5383 assert(wand != (MagickWand *) NULL);
5384 assert(wand->signature == WandSignature);
5385 if (wand->debug != MagickFalse)
5386 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5387 if (wand->images == (Image *) NULL)
5389 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5390 "ContainsNoImages","`%s'",wand->name);
5391 return(UndefinedType);
5393 return(GetImageType(wand->images,wand->exception));
5397 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5401 % M a g i c k G e t I m a g e U n i t s %
5405 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5407 % MagickGetImageUnits() gets the image units of resolution.
5409 % The format of the MagickGetImageUnits method is:
5411 % ResolutionType MagickGetImageUnits(MagickWand *wand)
5413 % A description of each parameter follows:
5415 % o wand: the magick wand.
5418 WandExport ResolutionType MagickGetImageUnits(MagickWand *wand)
5420 assert(wand != (MagickWand *) NULL);
5421 assert(wand->signature == WandSignature);
5422 if (wand->debug != MagickFalse)
5423 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5424 if (wand->images == (Image *) NULL)
5426 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5427 "ContainsNoImages","`%s'",wand->name);
5428 return(UndefinedResolution);
5430 return(wand->images->units);
5434 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5438 % 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 %
5442 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5444 % MagickGetImageVirtualPixelMethod() returns the virtual pixel method for the
5447 % The format of the MagickGetImageVirtualPixelMethod method is:
5449 % VirtualPixelMethod MagickGetImageVirtualPixelMethod(MagickWand *wand)
5451 % A description of each parameter follows:
5453 % o wand: the magick wand.
5456 WandExport VirtualPixelMethod MagickGetImageVirtualPixelMethod(MagickWand *wand)
5458 assert(wand != (MagickWand *) NULL);
5459 assert(wand->signature == WandSignature);
5460 if (wand->debug != MagickFalse)
5461 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5462 if (wand->images == (Image *) NULL)
5464 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5465 "ContainsNoImages","`%s'",wand->name);
5466 return(UndefinedVirtualPixelMethod);
5468 return(GetImageVirtualPixelMethod(wand->images));
5472 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5476 % M a g i c k G e t I m a g e W h i t e P o i n t %
5480 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5482 % MagickGetImageWhitePoint() returns the chromaticy white point.
5484 % The format of the MagickGetImageWhitePoint method is:
5486 % MagickBooleanType MagickGetImageWhitePoint(MagickWand *wand,double *x,
5489 % A description of each parameter follows:
5491 % o wand: the magick wand.
5493 % o x: the chromaticity white x-point.
5495 % o y: the chromaticity white y-point.
5498 WandExport MagickBooleanType MagickGetImageWhitePoint(MagickWand *wand,
5499 double *x,double *y)
5501 assert(wand != (MagickWand *) NULL);
5502 assert(wand->signature == WandSignature);
5503 if (wand->debug != MagickFalse)
5504 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5505 if (wand->images == (Image *) NULL)
5506 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5507 *x=wand->images->chromaticity.white_point.x;
5508 *y=wand->images->chromaticity.white_point.y;
5513 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5517 % M a g i c k G e t I m a g e W i d t h %
5521 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5523 % MagickGetImageWidth() returns the image width.
5525 % The format of the MagickGetImageWidth method is:
5527 % size_t MagickGetImageWidth(MagickWand *wand)
5529 % A description of each parameter follows:
5531 % o wand: the magick wand.
5534 WandExport size_t MagickGetImageWidth(MagickWand *wand)
5536 assert(wand != (MagickWand *) NULL);
5537 assert(wand->signature == WandSignature);
5538 if (wand->debug != MagickFalse)
5539 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5540 if (wand->images == (Image *) NULL)
5541 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5542 return(wand->images->columns);
5546 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5550 % M a g i c k G e t N u m b e r I m a g e s %
5554 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5556 % MagickGetNumberImages() returns the number of images associated with a
5559 % The format of the MagickGetNumberImages method is:
5561 % size_t MagickGetNumberImages(MagickWand *wand)
5563 % A description of each parameter follows:
5565 % o wand: the magick wand.
5568 WandExport size_t MagickGetNumberImages(MagickWand *wand)
5570 assert(wand != (MagickWand *) NULL);
5571 assert(wand->signature == WandSignature);
5572 if (wand->debug != MagickFalse)
5573 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5574 return(GetImageListLength(wand->images));
5578 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5582 % 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 %
5586 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5588 % MagickGetImageTotalInkDensity() gets the image total ink density.
5590 % The format of the MagickGetImageTotalInkDensity method is:
5592 % double MagickGetImageTotalInkDensity(MagickWand *wand)
5594 % A description of each parameter follows:
5596 % o wand: the magick wand.
5599 WandExport double MagickGetImageTotalInkDensity(MagickWand *wand)
5601 assert(wand != (MagickWand *) NULL);
5602 assert(wand->signature == WandSignature);
5603 if (wand->debug != MagickFalse)
5604 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5605 if (wand->images == (Image *) NULL)
5607 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5608 "ContainsNoImages","`%s'",wand->name);
5611 return(GetImageTotalInkDensity(wand->images,wand->exception));
5615 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5619 % M a g i c k H a l d C l u t I m a g e %
5623 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5625 % MagickHaldClutImage() replaces colors in the image from a Hald color lookup
5626 % table. A Hald color lookup table is a 3-dimensional color cube mapped to 2
5627 % dimensions. Create it with the HALD coder. You can apply any color
5628 % transformation to the Hald image and then use this method to apply the
5629 % transform to the image.
5631 % The format of the MagickHaldClutImage method is:
5633 % MagickBooleanType MagickHaldClutImage(MagickWand *wand,
5634 % const MagickWand *hald_wand)
5636 % A description of each parameter follows:
5638 % o wand: the magick wand.
5640 % o hald_image: the hald CLUT image.
5643 WandExport MagickBooleanType MagickHaldClutImage(MagickWand *wand,
5644 const MagickWand *hald_wand)
5649 assert(wand != (MagickWand *) NULL);
5650 assert(wand->signature == WandSignature);
5651 if (wand->debug != MagickFalse)
5652 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5653 if ((wand->images == (Image *) NULL) || (hald_wand->images == (Image *) NULL))
5654 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5655 status=HaldClutImage(wand->images,hald_wand->images,wand->exception);
5660 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5664 % M a g i c k H a s N e x t I m a g e %
5668 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5670 % MagickHasNextImage() returns MagickTrue if the wand has more images when
5671 % traversing the list in the forward direction
5673 % The format of the MagickHasNextImage method is:
5675 % MagickBooleanType MagickHasNextImage(MagickWand *wand)
5677 % A description of each parameter follows:
5679 % o wand: the magick wand.
5682 WandExport MagickBooleanType MagickHasNextImage(MagickWand *wand)
5684 assert(wand != (MagickWand *) NULL);
5685 assert(wand->signature == WandSignature);
5686 if (wand->debug != MagickFalse)
5687 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5688 if (wand->images == (Image *) NULL)
5689 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5690 if (GetNextImageInList(wand->images) == (Image *) NULL)
5691 return(MagickFalse);
5696 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5700 % M a g i c k H a s P r e v i o u s I m a g e %
5704 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5706 % MagickHasPreviousImage() returns MagickTrue if the wand has more images when
5707 % traversing the list in the reverse direction
5709 % The format of the MagickHasPreviousImage method is:
5711 % MagickBooleanType MagickHasPreviousImage(MagickWand *wand)
5713 % A description of each parameter follows:
5715 % o wand: the magick wand.
5718 WandExport MagickBooleanType MagickHasPreviousImage(MagickWand *wand)
5720 assert(wand != (MagickWand *) NULL);
5721 assert(wand->signature == WandSignature);
5722 if (wand->debug != MagickFalse)
5723 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5724 if (wand->images == (Image *) NULL)
5725 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5726 if (GetPreviousImageInList(wand->images) == (Image *) NULL)
5727 return(MagickFalse);
5732 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5736 % M a g i c k I d e n t i f y I m a g e %
5740 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5742 % MagickIdentifyImage() identifies an image by printing its attributes to the
5743 % file. Attributes include the image width, height, size, and others.
5745 % The format of the MagickIdentifyImage method is:
5747 % const char *MagickIdentifyImage(MagickWand *wand)
5749 % A description of each parameter follows:
5751 % o wand: the magick wand.
5754 WandExport char *MagickIdentifyImage(MagickWand *wand)
5758 filename[MaxTextExtent];
5766 assert(wand != (MagickWand *) NULL);
5767 assert(wand->signature == WandSignature);
5768 if (wand->debug != MagickFalse)
5769 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5770 if (wand->images == (Image *) NULL)
5772 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5773 "ContainsNoImages","`%s'",wand->name);
5774 return((char *) NULL);
5776 description=(char *) NULL;
5777 unique_file=AcquireUniqueFileResource(filename);
5779 if (unique_file != -1)
5780 file=fdopen(unique_file,"wb");
5781 if ((unique_file == -1) || (file == (FILE *) NULL))
5783 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5784 "UnableToCreateTemporaryFile","`%s'",wand->name);
5785 return((char *) NULL);
5787 (void) IdentifyImage(wand->images,file,MagickTrue,wand->exception);
5788 (void) fclose(file);
5789 description=FileToString(filename,~0,wand->exception);
5790 (void) RelinquishUniqueFileResource(filename);
5791 return(description);
5795 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5799 % M a g i c k I m p l o d e I m a g e %
5803 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5805 % MagickImplodeImage() creates a new image that is a copy of an existing
5806 % one with the image pixels "implode" by the specified percentage. It
5807 % allocates the memory necessary for the new Image structure and returns a
5808 % pointer to the new image.
5810 % The format of the MagickImplodeImage method is:
5812 % MagickBooleanType MagickImplodeImage(MagickWand *wand,
5813 % const double radius,const PixelInterpolateMethod method)
5815 % A description of each parameter follows:
5817 % o wand: the magick wand.
5819 % o amount: Define the extent of the implosion.
5821 % o method: the pixel interpolation method.
5824 WandExport MagickBooleanType MagickImplodeImage(MagickWand *wand,
5825 const double amount,const PixelInterpolateMethod method)
5830 assert(wand != (MagickWand *) NULL);
5831 assert(wand->signature == WandSignature);
5832 if (wand->debug != MagickFalse)
5833 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5834 if (wand->images == (Image *) NULL)
5835 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5836 implode_image=ImplodeImage(wand->images,amount,method,wand->exception);
5837 if (implode_image == (Image *) NULL)
5838 return(MagickFalse);
5839 ReplaceImageInList(&wand->images,implode_image);
5844 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5848 % M a g i c k I m p o r t I m a g e P i x e l s %
5852 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5854 % MagickImportImagePixels() accepts pixel datand stores it in the image at the
5855 % location you specify. The method returns MagickFalse on success otherwise
5856 % MagickTrue if an error is encountered. The pixel data can be either char,
5857 % short int, int, ssize_t, float, or double in the order specified by map.
5859 % Suppose your want to upload the first scanline of a 640x480 image from
5860 % character data in red-green-blue order:
5862 % MagickImportImagePixels(wand,0,0,640,1,"RGB",CharPixel,pixels);
5864 % The format of the MagickImportImagePixels method is:
5866 % MagickBooleanType MagickImportImagePixels(MagickWand *wand,
5867 % const ssize_t x,const ssize_t y,const size_t columns,
5868 % const size_t rows,const char *map,const StorageType storage,
5869 % const void *pixels)
5871 % A description of each parameter follows:
5873 % o wand: the magick wand.
5875 % o x, y, columns, rows: These values define the perimeter of a region
5876 % of pixels you want to define.
5878 % o map: This string reflects the expected ordering of the pixel array.
5879 % It can be any combination or order of R = red, G = green, B = blue,
5880 % A = alpha (0 is transparent), O = alpha (0 is opaque), C = cyan,
5881 % Y = yellow, M = magenta, K = black, I = intensity (for grayscale),
5884 % o storage: Define the data type of the pixels. Float and double types are
5885 % expected to be normalized [0..1] otherwise [0..QuantumRange]. Choose from
5886 % these types: CharPixel, ShortPixel, IntegerPixel, LongPixel, FloatPixel,
5889 % o pixels: This array of values contain the pixel components as defined by
5890 % map and type. You must preallocate this array where the expected
5891 % length varies depending on the values of width, height, map, and type.
5894 WandExport MagickBooleanType MagickImportImagePixels(MagickWand *wand,
5895 const ssize_t x,const ssize_t y,const size_t columns,const size_t rows,
5896 const char *map,const StorageType storage,const void *pixels)
5901 assert(wand != (MagickWand *) NULL);
5902 assert(wand->signature == WandSignature);
5903 if (wand->debug != MagickFalse)
5904 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5905 if (wand->images == (Image *) NULL)
5906 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5907 status=ImportImagePixels(wand->images,x,y,columns,rows,map,storage,pixels,
5913 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5917 % 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 %
5921 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5923 % MagickInterpolativeResizeImage() resize image using a interpolative
5926 % MagickBooleanType MagickInterpolativeResizeImage(MagickWand *wand,
5927 % const size_t columns,const size_t rows,
5928 % const PixelInterpolateMethod method)
5930 % A description of each parameter follows:
5932 % o wand: the magick wand.
5934 % o columns: the number of columns in the scaled image.
5936 % o rows: the number of rows in the scaled image.
5938 % o interpolate: the pixel interpolation method.
5941 WandExport MagickBooleanType MagickInterpolativeResizeImage(MagickWand *wand,
5942 const size_t columns,const size_t rows,const PixelInterpolateMethod method)
5947 assert(wand != (MagickWand *) NULL);
5948 assert(wand->signature == WandSignature);
5949 if (wand->debug != MagickFalse)
5950 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5951 if (wand->images == (Image *) NULL)
5952 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5953 resize_image=InterpolativeResizeImage(wand->images,columns,rows,method,
5955 if (resize_image == (Image *) NULL)
5956 return(MagickFalse);
5957 ReplaceImageInList(&wand->images,resize_image);
5962 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5966 % 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 %
5970 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5972 % MagickInverseFourierTransformImage() implements the inverse discrete
5973 % Fourier transform (DFT) of the image either as a magnitude / phase or real /
5974 % imaginary image pair.
5976 % The format of the MagickInverseFourierTransformImage method is:
5978 % MagickBooleanType MagickInverseFourierTransformImage(
5979 % MagickWand *magnitude_wand,MagickWand *phase_wand,
5980 % const MagickBooleanType magnitude)
5982 % A description of each parameter follows:
5984 % o magnitude_wand: the magnitude or real wand.
5986 % o phase_wand: the phase or imaginary wand.
5988 % o magnitude: if true, return as magnitude / phase pair otherwise a real /
5989 % imaginary image pair.
5992 WandExport MagickBooleanType MagickInverseFourierTransformImage(
5993 MagickWand *magnitude_wand,MagickWand *phase_wand,
5994 const MagickBooleanType magnitude)
6002 assert(magnitude_wand != (MagickWand *) NULL);
6003 assert(magnitude_wand->signature == WandSignature);
6004 if (magnitude_wand->debug != MagickFalse)
6005 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",
6006 magnitude_wand->name);
6007 wand=magnitude_wand;
6008 if (magnitude_wand->images == (Image *) NULL)
6009 ThrowWandException(WandError,"ContainsNoImages",
6010 magnitude_wand->name);
6011 assert(phase_wand != (MagickWand *) NULL);
6012 assert(phase_wand->signature == WandSignature);
6013 inverse_image=InverseFourierTransformImage(magnitude_wand->images,
6014 phase_wand->images,magnitude,wand->exception);
6015 if (inverse_image == (Image *) NULL)
6016 return(MagickFalse);
6017 ReplaceImageInList(&wand->images,inverse_image);
6022 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6026 % M a g i c k L a b e l I m a g e %
6030 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6032 % MagickLabelImage() adds a label to your image.
6034 % The format of the MagickLabelImage method is:
6036 % MagickBooleanType MagickLabelImage(MagickWand *wand,const char *label)
6038 % A description of each parameter follows:
6040 % o wand: the magick wand.
6042 % o label: the image label.
6045 WandExport MagickBooleanType MagickLabelImage(MagickWand *wand,
6051 assert(wand != (MagickWand *) NULL);
6052 assert(wand->signature == WandSignature);
6053 if (wand->debug != MagickFalse)
6054 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6055 if (wand->images == (Image *) NULL)
6056 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6057 status=SetImageProperty(wand->images,"label",label,wand->exception);
6062 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6066 % M a g i c k L e v e l I m a g e %
6070 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6072 % MagickLevelImage() adjusts the levels of an image by scaling the colors
6073 % falling between specified white and black points to the full available
6074 % quantum range. The parameters provided represent the black, mid, and white
6075 % points. The black point specifies the darkest color in the image. Colors
6076 % darker than the black point are set to zero. Mid point specifies a gamma
6077 % correction to apply to the image. White point specifies the lightest color
6078 % in the image. Colors brighter than the white point are set to the maximum
6081 % The format of the MagickLevelImage method is:
6083 % MagickBooleanType MagickLevelImage(MagickWand *wand,
6084 % const double black_point,const double gamma,const double white_point)
6085 % MagickBooleanType MagickLevelImage(MagickWand *wand,
6086 % const ChannelType channel,const double black_point,const double gamma,
6087 % const double white_point)
6089 % A description of each parameter follows:
6091 % o wand: the magick wand.
6093 % o channel: Identify which channel to level: RedPixelChannel,
6094 % GreenPixelChannel, etc.
6096 % o black_point: the black point.
6098 % o gamma: the gamma.
6100 % o white_point: the white point.
6103 WandExport MagickBooleanType MagickLevelImage(MagickWand *wand,
6104 const double black_point,const double gamma,const double white_point)
6109 assert(wand != (MagickWand *) NULL);
6110 assert(wand->signature == WandSignature);
6111 if (wand->debug != MagickFalse)
6112 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6113 if (wand->images == (Image *) NULL)
6114 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6115 status=LevelImage(wand->images,black_point,white_point,gamma,
6121 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6125 % M a g i c k L i n e a r S t r e t c h I m a g e %
6129 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6131 % MagickLinearStretchImage() stretches with saturation the image intensity.
6133 % You can also reduce the influence of a particular channel with a gamma
6136 % The format of the MagickLinearStretchImage method is:
6138 % MagickBooleanType MagickLinearStretchImage(MagickWand *wand,
6139 % const double black_point,const double white_point)
6141 % A description of each parameter follows:
6143 % o wand: the magick wand.
6145 % o black_point: the black point.
6147 % o white_point: the white point.
6150 WandExport MagickBooleanType MagickLinearStretchImage(MagickWand *wand,
6151 const double black_point,const double white_point)
6156 assert(wand != (MagickWand *) NULL);
6157 assert(wand->signature == WandSignature);
6158 if (wand->debug != MagickFalse)
6159 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6160 if (wand->images == (Image *) NULL)
6161 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6162 status=LinearStretchImage(wand->images,black_point,white_point,
6168 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6172 % M a g i c k L i q u i d R e s c a l e I m a g e %
6176 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6178 % MagickLiquidRescaleImage() rescales image with seam carving.
6180 % MagickBooleanType MagickLiquidRescaleImage(MagickWand *wand,
6181 % const size_t columns,const size_t rows,
6182 % const double delta_x,const double rigidity)
6184 % A description of each parameter follows:
6186 % o wand: the magick wand.
6188 % o columns: the number of columns in the scaled image.
6190 % o rows: the number of rows in the scaled image.
6192 % o delta_x: maximum seam transversal step (0 means straight seams).
6194 % o rigidity: introduce a bias for non-straight seams (typically 0).
6197 WandExport MagickBooleanType MagickLiquidRescaleImage(MagickWand *wand,
6198 const size_t columns,const size_t rows,const double delta_x,
6199 const double rigidity)
6204 assert(wand != (MagickWand *) NULL);
6205 assert(wand->signature == WandSignature);
6206 if (wand->debug != MagickFalse)
6207 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6208 if (wand->images == (Image *) NULL)
6209 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6210 rescale_image=LiquidRescaleImage(wand->images,columns,rows,delta_x,
6211 rigidity,wand->exception);
6212 if (rescale_image == (Image *) NULL)
6213 return(MagickFalse);
6214 ReplaceImageInList(&wand->images,rescale_image);
6219 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6223 % M a g i c k M a g n i f y I m a g e %
6227 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6229 % MagickMagnifyImage() is a convenience method that scales an image
6230 % proportionally to twice its original size.
6232 % The format of the MagickMagnifyImage method is:
6234 % MagickBooleanType MagickMagnifyImage(MagickWand *wand)
6236 % A description of each parameter follows:
6238 % o wand: the magick wand.
6241 WandExport MagickBooleanType MagickMagnifyImage(MagickWand *wand)
6246 assert(wand != (MagickWand *) NULL);
6247 assert(wand->signature == WandSignature);
6248 if (wand->debug != MagickFalse)
6249 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6250 if (wand->images == (Image *) NULL)
6251 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6252 magnify_image=MagnifyImage(wand->images,wand->exception);
6253 if (magnify_image == (Image *) NULL)
6254 return(MagickFalse);
6255 ReplaceImageInList(&wand->images,magnify_image);
6260 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6264 % M a g i c k M e r g e I m a g e L a y e r s %
6268 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6270 % MagickMergeImageLayers() composes all the image layers from the current
6271 % given image onward to produce a single image of the merged layers.
6273 % The inital canvas's size depends on the given ImageLayerMethod, and is
6274 % initialized using the first images background color. The images
6275 % are then compositied onto that image in sequence using the given
6276 % composition that has been assigned to each individual image.
6278 % The format of the MagickMergeImageLayers method is:
6280 % MagickWand *MagickMergeImageLayers(MagickWand *wand,
6281 % const ImageLayerMethod method)
6283 % A description of each parameter follows:
6285 % o wand: the magick wand.
6287 % o method: the method of selecting the size of the initial canvas.
6289 % MergeLayer: Merge all layers onto a canvas just large enough
6290 % to hold all the actual images. The virtual canvas of the
6291 % first image is preserved but otherwise ignored.
6293 % FlattenLayer: Use the virtual canvas size of first image.
6294 % Images which fall outside this canvas is clipped.
6295 % This can be used to 'fill out' a given virtual canvas.
6297 % MosaicLayer: Start with the virtual canvas of the first image,
6298 % enlarging left and right edges to contain all images.
6299 % Images with negative offsets will be clipped.
6302 WandExport MagickWand *MagickMergeImageLayers(MagickWand *wand,
6303 const ImageLayerMethod method)
6308 assert(wand != (MagickWand *) NULL);
6309 assert(wand->signature == WandSignature);
6310 if (wand->debug != MagickFalse)
6311 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6312 if (wand->images == (Image *) NULL)
6313 return((MagickWand *) NULL);
6314 mosaic_image=MergeImageLayers(wand->images,method,wand->exception);
6315 if (mosaic_image == (Image *) NULL)
6316 return((MagickWand *) NULL);
6317 return(CloneMagickWandFromImages(wand,mosaic_image));
6321 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6325 % M a g i c k M i n i f y I m a g e %
6329 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6331 % MagickMinifyImage() is a convenience method that scales an image
6332 % proportionally to one-half its original size
6334 % The format of the MagickMinifyImage method is:
6336 % MagickBooleanType MagickMinifyImage(MagickWand *wand)
6338 % A description of each parameter follows:
6340 % o wand: the magick wand.
6343 WandExport MagickBooleanType MagickMinifyImage(MagickWand *wand)
6348 assert(wand != (MagickWand *) NULL);
6349 assert(wand->signature == WandSignature);
6350 if (wand->debug != MagickFalse)
6351 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6352 if (wand->images == (Image *) NULL)
6353 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6354 minify_image=MinifyImage(wand->images,wand->exception);
6355 if (minify_image == (Image *) NULL)
6356 return(MagickFalse);
6357 ReplaceImageInList(&wand->images,minify_image);
6362 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6366 % M a g i c k M o d u l a t e I m a g e %
6370 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6372 % MagickModulateImage() lets you control the brightness, saturation, and hue
6373 % of an image. Hue is the percentage of absolute rotation from the current
6374 % position. For example 50 results in a counter-clockwise rotation of 90
6375 % degrees, 150 results in a clockwise rotation of 90 degrees, with 0 and 200
6376 % both resulting in a rotation of 180 degrees.
6378 % To increase the color brightness by 20% and decrease the color saturation by
6379 % 10% and leave the hue unchanged, use: 120,90,100.
6381 % The format of the MagickModulateImage method is:
6383 % MagickBooleanType MagickModulateImage(MagickWand *wand,
6384 % const double brightness,const double saturation,const double hue)
6386 % A description of each parameter follows:
6388 % o wand: the magick wand.
6390 % o brightness: the percent change in brighness.
6392 % o saturation: the percent change in saturation.
6394 % o hue: the percent change in hue.
6397 WandExport MagickBooleanType MagickModulateImage(MagickWand *wand,
6398 const double brightness,const double saturation,const double hue)
6401 modulate[MaxTextExtent];
6406 assert(wand != (MagickWand *) NULL);
6407 assert(wand->signature == WandSignature);
6408 if (wand->debug != MagickFalse)
6409 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6410 if (wand->images == (Image *) NULL)
6411 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6412 (void) FormatLocaleString(modulate,MaxTextExtent,"%g,%g,%g",
6413 brightness,saturation,hue);
6414 status=ModulateImage(wand->images,modulate,wand->exception);
6419 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6423 % M a g i c k M o n t a g e I m a g e %
6427 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6429 % MagickMontageImage() creates a composite image by combining several
6430 % separate images. The images are tiled on the composite image with the name
6431 % of the image optionally appearing just below the individual tile.
6433 % The format of the MagickMontageImage method is:
6435 % MagickWand *MagickMontageImage(MagickWand *wand,
6436 % const DrawingWand drawing_wand,const char *tile_geometry,
6437 % const char *thumbnail_geometry,const MontageMode mode,
6438 % const char *frame)
6440 % A description of each parameter follows:
6442 % o wand: the magick wand.
6444 % o drawing_wand: the drawing wand. The font name, size, and color are
6445 % obtained from this wand.
6447 % o tile_geometry: the number of tiles per row and page (e.g. 6x4+0+0).
6449 % o thumbnail_geometry: Preferred image size and border size of each
6450 % thumbnail (e.g. 120x120+4+3>).
6452 % o mode: Thumbnail framing mode: Frame, Unframe, or Concatenate.
6454 % o frame: Surround the image with an ornamental border (e.g. 15x15+3+3).
6455 % The frame color is that of the thumbnail's matte color.
6458 WandExport MagickWand *MagickMontageImage(MagickWand *wand,
6459 const DrawingWand *drawing_wand,const char *tile_geometry,
6460 const char *thumbnail_geometry,const MontageMode mode,const char *frame)
6474 assert(wand != (MagickWand *) NULL);
6475 assert(wand->signature == WandSignature);
6476 if (wand->debug != MagickFalse)
6477 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6478 if (wand->images == (Image *) NULL)
6479 return((MagickWand *) NULL);
6480 montage_info=CloneMontageInfo(wand->image_info,(MontageInfo *) NULL);
6485 (void) CloneString(&montage_info->frame,"15x15+3+3");
6486 montage_info->shadow=MagickTrue;
6491 montage_info->frame=(char *) NULL;
6492 montage_info->shadow=MagickFalse;
6493 montage_info->border_width=0;
6496 case ConcatenateMode:
6498 montage_info->frame=(char *) NULL;
6499 montage_info->shadow=MagickFalse;
6500 (void) CloneString(&montage_info->geometry,"+0+0");
6501 montage_info->border_width=0;
6507 font=DrawGetFont(drawing_wand);
6508 if (font != (char *) NULL)
6509 (void) CloneString(&montage_info->font,font);
6510 if (frame != (char *) NULL)
6511 (void) CloneString(&montage_info->frame,frame);
6512 montage_info->pointsize=DrawGetFontSize(drawing_wand);
6513 pixel_wand=NewPixelWand();
6514 DrawGetFillColor(drawing_wand,pixel_wand);
6515 PixelGetQuantumPacket(pixel_wand,&montage_info->fill);
6516 DrawGetStrokeColor(drawing_wand,pixel_wand);
6517 PixelGetQuantumPacket(pixel_wand,&montage_info->stroke);
6518 pixel_wand=DestroyPixelWand(pixel_wand);
6519 if (thumbnail_geometry != (char *) NULL)
6520 (void) CloneString(&montage_info->geometry,thumbnail_geometry);
6521 if (tile_geometry != (char *) NULL)
6522 (void) CloneString(&montage_info->tile,tile_geometry);
6523 montage_image=MontageImageList(wand->image_info,montage_info,wand->images,
6525 montage_info=DestroyMontageInfo(montage_info);
6526 if (montage_image == (Image *) NULL)
6527 return((MagickWand *) NULL);
6528 return(CloneMagickWandFromImages(wand,montage_image));
6532 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6536 % M a g i c k M o r p h I m a g e s %
6540 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6542 % MagickMorphImages() method morphs a set of images. Both the image pixels
6543 % and size are linearly interpolated to give the appearance of a
6544 % meta-morphosis from one image to the next.
6546 % The format of the MagickMorphImages method is:
6548 % MagickWand *MagickMorphImages(MagickWand *wand,
6549 % const size_t number_frames)
6551 % A description of each parameter follows:
6553 % o wand: the magick wand.
6555 % o number_frames: the number of in-between images to generate.
6558 WandExport MagickWand *MagickMorphImages(MagickWand *wand,
6559 const size_t number_frames)
6564 assert(wand != (MagickWand *) NULL);
6565 assert(wand->signature == WandSignature);
6566 if (wand->debug != MagickFalse)
6567 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6568 if (wand->images == (Image *) NULL)
6569 return((MagickWand *) NULL);
6570 morph_image=MorphImages(wand->images,number_frames,wand->exception);
6571 if (morph_image == (Image *) NULL)
6572 return((MagickWand *) NULL);
6573 return(CloneMagickWandFromImages(wand,morph_image));
6577 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6581 % M a g i c k M o r p h o l o g y I m a g e %
6585 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6587 % MagickMorphologyImage() applies a user supplied kernel to the image
6588 % according to the given mophology method.
6590 % The format of the MagickMorphologyImage method is:
6592 % MagickBooleanType MagickMorphologyImage(MagickWand *wand,
6593 % MorphologyMethod method,const ssize_t iterations,KernelInfo *kernel)
6595 % A description of each parameter follows:
6597 % o wand: the magick wand.
6599 % o method: the morphology method to be applied.
6601 % o iterations: apply the operation this many times (or no change).
6602 % A value of -1 means loop until no change found. How this is applied
6603 % may depend on the morphology method. Typically this is a value of 1.
6605 % o kernel: An array of doubles representing the morphology kernel.
6608 WandExport MagickBooleanType MagickMorphologyImage(MagickWand *wand,
6609 MorphologyMethod method,const ssize_t iterations,KernelInfo *kernel)
6614 assert(wand != (MagickWand *) NULL);
6615 assert(wand->signature == WandSignature);
6616 if (wand->debug != MagickFalse)
6617 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6618 if (kernel == (const KernelInfo *) NULL)
6619 return(MagickFalse);
6620 if (wand->images == (Image *) NULL)
6621 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6622 morphology_image=MorphologyImage(wand->images,method,iterations,kernel,
6624 if (morphology_image == (Image *) NULL)
6625 return(MagickFalse);
6626 ReplaceImageInList(&wand->images,morphology_image);
6631 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6635 % M a g i c k M o t i o n B l u r I m a g e %
6639 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6641 % MagickMotionBlurImage() simulates motion blur. We convolve the image with a
6642 % Gaussian operator of the given radius and standard deviation (sigma).
6643 % For reasonable results, radius should be larger than sigma. Use a
6644 % radius of 0 and MotionBlurImage() selects a suitable radius for you.
6645 % Angle gives the angle of the blurring motion.
6647 % The format of the MagickMotionBlurImage method is:
6649 % MagickBooleanType MagickMotionBlurImage(MagickWand *wand,
6650 % const double radius,const double sigma,const double angle,
6651 % const double bias)
6653 % A description of each parameter follows:
6655 % o wand: the magick wand.
6657 % o radius: the radius of the Gaussian, in pixels, not counting
6660 % o sigma: the standard deviation of the Gaussian, in pixels.
6662 % o angle: Apply the effect along this angle.
6665 WandExport MagickBooleanType MagickMotionBlurImage(MagickWand *wand,
6666 const double radius,const double sigma,const double angle,const double bias)
6671 assert(wand != (MagickWand *) NULL);
6672 assert(wand->signature == WandSignature);
6673 if (wand->debug != MagickFalse)
6674 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6675 if (wand->images == (Image *) NULL)
6676 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6677 blur_image=MotionBlurImage(wand->images,radius,sigma,angle,bias,
6679 if (blur_image == (Image *) NULL)
6680 return(MagickFalse);
6681 ReplaceImageInList(&wand->images,blur_image);
6686 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6690 % M a g i c k N e g a t e I m a g e %
6694 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6696 % MagickNegateImage() negates the colors in the reference image. The
6697 % Grayscale option means that only grayscale values within the image are
6700 % You can also reduce the influence of a particular channel with a gamma
6703 % The format of the MagickNegateImage method is:
6705 % MagickBooleanType MagickNegateImage(MagickWand *wand,
6706 % const MagickBooleanType gray)
6708 % A description of each parameter follows:
6710 % o wand: the magick wand.
6712 % o gray: If MagickTrue, only negate grayscale pixels within the image.
6715 WandExport MagickBooleanType MagickNegateImage(MagickWand *wand,
6716 const MagickBooleanType gray)
6721 assert(wand != (MagickWand *) NULL);
6722 assert(wand->signature == WandSignature);
6723 if (wand->debug != MagickFalse)
6724 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6725 if (wand->images == (Image *) NULL)
6726 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6727 status=NegateImage(wand->images,gray,wand->exception);
6732 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6736 % M a g i c k N e w I m a g e %
6740 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6742 % MagickNewImage() adds a blank image canvas of the specified size and
6743 % background color to the wand.
6745 % The format of the MagickNewImage method is:
6747 % MagickBooleanType MagickNewImage(MagickWand *wand,
6748 % const size_t columns,const size_t rows,
6749 % const PixelWand *background)
6751 % A description of each parameter follows:
6753 % o wand: the magick wand.
6755 % o width: the image width.
6757 % o height: the image height.
6759 % o background: the image color.
6762 WandExport MagickBooleanType MagickNewImage(MagickWand *wand,const size_t width,
6763 const size_t height,const PixelWand *background)
6771 assert(wand != (MagickWand *) NULL);
6772 assert(wand->signature == WandSignature);
6773 if (wand->debug != MagickFalse)
6774 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6775 PixelGetMagickColor(background,&pixel);
6776 images=NewMagickImage(wand->image_info,width,height,&pixel,wand->exception);
6777 if (images == (Image *) NULL)
6778 return(MagickFalse);
6779 return(InsertImageInWand(wand,images));
6783 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6787 % M a g i c k N e x t I m a g e %
6791 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6793 % MagickNextImage() associates the next image in the image list with a magick
6794 % wand. It returns true if the it succeeds, meaning the current image is the
6795 % next image to be iterated over.
6797 % The format of the MagickNextImage method is:
6799 % MagickBooleanType MagickNextImage(MagickWand *wand)
6801 % A description of each parameter follows:
6803 % o wand: the magick wand.
6806 WandExport MagickBooleanType MagickNextImage(MagickWand *wand)
6808 assert(wand != (MagickWand *) NULL);
6809 assert(wand->signature == WandSignature);
6810 if (wand->debug != MagickFalse)
6811 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6812 if (wand->images == (Image *) NULL)
6813 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6814 /* If current image is 'pending' just return true. */
6815 if (wand->image_pending != MagickFalse)
6817 wand->image_pending=MagickFalse;
6820 /* If there is no next image, (Iterator is finished) */
6821 if (GetNextImageInList(wand->images) == (Image *) NULL)
6822 return(MagickFalse);
6823 /* just move to next image - current image is not 'pending' */
6824 wand->images=GetNextImageInList(wand->images);
6829 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6833 % M a g i c k N o r m a l i z e I m a g e %
6837 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6839 % MagickNormalizeImage() enhances the contrast of a color image by adjusting
6840 % the pixels color to span the entire range of colors available
6842 % You can also reduce the influence of a particular channel with a gamma
6845 % The format of the MagickNormalizeImage method is:
6847 % MagickBooleanType MagickNormalizeImage(MagickWand *wand)
6849 % A description of each parameter follows:
6851 % o wand: the magick wand.
6854 WandExport MagickBooleanType MagickNormalizeImage(MagickWand *wand)
6859 assert(wand != (MagickWand *) NULL);
6860 assert(wand->signature == WandSignature);
6861 if (wand->debug != MagickFalse)
6862 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6863 if (wand->images == (Image *) NULL)
6864 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6865 status=NormalizeImage(wand->images,wand->exception);
6870 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6874 % M a g i c k O i l P a i n t I m a g e %
6878 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6880 % MagickOilPaintImage() applies a special effect filter that simulates an oil
6881 % painting. Each pixel is replaced by the most frequent color occurring
6882 % in a circular region defined by radius.
6884 % The format of the MagickOilPaintImage method is:
6886 % MagickBooleanType MagickOilPaintImage(MagickWand *wand,
6887 % const double radius,const double sigma)
6889 % A description of each parameter follows:
6891 % o wand: the magick wand.
6893 % o radius: the radius of the circular neighborhood.
6895 % o sigma: the standard deviation of the Gaussian, in pixels.
6898 WandExport MagickBooleanType MagickOilPaintImage(MagickWand *wand,
6899 const double radius,const double sigma)
6904 assert(wand != (MagickWand *) NULL);
6905 assert(wand->signature == WandSignature);
6906 if (wand->debug != MagickFalse)
6907 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6908 if (wand->images == (Image *) NULL)
6909 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6910 paint_image=OilPaintImage(wand->images,radius,sigma,wand->exception);
6911 if (paint_image == (Image *) NULL)
6912 return(MagickFalse);
6913 ReplaceImageInList(&wand->images,paint_image);
6918 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6922 % M a g i c k O p a q u e P a i n t I m a g e %
6926 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6928 % MagickOpaquePaintImage() changes any pixel that matches color with the color
6931 % The format of the MagickOpaquePaintImage method is:
6933 % MagickBooleanType MagickOpaquePaintImage(MagickWand *wand,
6934 % const PixelWand *target,const PixelWand *fill,const double fuzz,
6935 % const MagickBooleanType invert)
6937 % A description of each parameter follows:
6939 % o wand: the magick wand.
6941 % o target: Change this target color to the fill color within the image.
6943 % o fill: the fill pixel wand.
6945 % o fuzz: By default target must match a particular pixel color
6946 % exactly. However, in many cases two colors may differ by a small amount.
6947 % The fuzz member of image defines how much tolerance is acceptable to
6948 % consider two colors as the same. For example, set fuzz to 10 and the
6949 % color red at intensities of 100 and 102 respectively are now interpreted
6950 % as the same color for the purposes of the floodfill.
6952 % o invert: paint any pixel that does not match the target color.
6955 WandExport MagickBooleanType MagickOpaquePaintImage(MagickWand *wand,
6956 const PixelWand *target,const PixelWand *fill,const double fuzz,
6957 const MagickBooleanType invert)
6966 assert(wand != (MagickWand *) NULL);
6967 assert(wand->signature == WandSignature);
6968 if (wand->debug != MagickFalse)
6969 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6970 if (wand->images == (Image *) NULL)
6971 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6972 PixelGetMagickColor(target,&target_pixel);
6973 PixelGetMagickColor(fill,&fill_pixel);
6974 wand->images->fuzz=fuzz;
6975 status=OpaquePaintImage(wand->images,&target_pixel,&fill_pixel,invert,
6981 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6985 % 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 %
6989 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6991 % MagickOptimizeImageLayers() compares each image the GIF disposed forms of the
6992 % previous image in the sequence. From this it attempts to select the
6993 % smallest cropped image to replace each frame, while preserving the results
6996 % The format of the MagickOptimizeImageLayers method is:
6998 % MagickWand *MagickOptimizeImageLayers(MagickWand *wand)
7000 % A description of each parameter follows:
7002 % o wand: the magick wand.
7005 WandExport MagickWand *MagickOptimizeImageLayers(MagickWand *wand)
7010 assert(wand != (MagickWand *) NULL);
7011 assert(wand->signature == WandSignature);
7012 if (wand->debug != MagickFalse)
7013 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7014 if (wand->images == (Image *) NULL)
7015 return((MagickWand *) NULL);
7016 optimize_image=OptimizeImageLayers(wand->images,wand->exception);
7017 if (optimize_image == (Image *) NULL)
7018 return((MagickWand *) NULL);
7019 return(CloneMagickWandFromImages(wand,optimize_image));
7023 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7027 % 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 %
7031 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7033 % MagickOrderedPosterizeImage() performs an ordered dither based on a number
7034 % of pre-defined dithering threshold maps, but over multiple intensity levels,
7035 % which can be different for different channels, according to the input
7038 % The format of the MagickOrderedPosterizeImage method is:
7040 % MagickBooleanType MagickOrderedPosterizeImage(MagickWand *wand,
7041 % const char *threshold_map)
7043 % A description of each parameter follows:
7045 % o image: the image.
7047 % o threshold_map: A string containing the name of the threshold dither
7048 % map to use, followed by zero or more numbers representing the number of
7049 % color levels tho dither between.
7051 % Any level number less than 2 is equivalent to 2, and means only binary
7052 % dithering will be applied to each color channel.
7054 % No numbers also means a 2 level (bitmap) dither will be applied to all
7055 % channels, while a single number is the number of levels applied to each
7056 % channel in sequence. More numbers will be applied in turn to each of
7057 % the color channels.
7059 % For example: "o3x3,6" generates a 6 level posterization of the image
7060 % with a ordered 3x3 diffused pixel dither being applied between each
7061 % level. While checker,8,8,4 will produce a 332 colormaped image with
7062 % only a single checkerboard hash pattern (50% grey) between each color
7063 % level, to basically double the number of color levels with a bare
7064 % minimim of dithering.
7067 WandExport MagickBooleanType MagickOrderedPosterizeImage(MagickWand *wand,
7068 const char *threshold_map)
7073 assert(wand != (MagickWand *) NULL);
7074 assert(wand->signature == WandSignature);
7075 if (wand->debug != MagickFalse)
7076 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7077 if (wand->images == (Image *) NULL)
7078 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7079 status=OrderedPosterizeImage(wand->images,threshold_map,wand->exception);
7084 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7088 % M a g i c k P i n g I m a g e %
7092 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7094 % MagickPingImage() is the same as MagickReadImage() except the only valid
7095 % information returned is the image width, height, size, and format. It
7096 % is designed to efficiently obtain this information from a file without
7097 % reading the entire image sequence into memory.
7099 % The format of the MagickPingImage method is:
7101 % MagickBooleanType MagickPingImage(MagickWand *wand,const char *filename)
7103 % A description of each parameter follows:
7105 % o wand: the magick wand.
7107 % o filename: the image filename.
7110 WandExport MagickBooleanType MagickPingImage(MagickWand *wand,
7111 const char *filename)
7119 assert(wand != (MagickWand *) NULL);
7120 assert(wand->signature == WandSignature);
7121 if (wand->debug != MagickFalse)
7122 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7123 ping_info=CloneImageInfo(wand->image_info);
7124 if (filename != (const char *) NULL)
7125 (void) CopyMagickString(ping_info->filename,filename,MaxTextExtent);
7126 images=PingImage(ping_info,wand->exception);
7127 ping_info=DestroyImageInfo(ping_info);
7128 if (images == (Image *) NULL)
7129 return(MagickFalse);
7130 return(InsertImageInWand(wand,images));
7134 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7138 % M a g i c k P i n g I m a g e B l o b %
7142 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7144 % MagickPingImageBlob() pings an image or image sequence from a blob.
7146 % The format of the MagickPingImageBlob method is:
7148 % MagickBooleanType MagickPingImageBlob(MagickWand *wand,
7149 % const void *blob,const size_t length)
7151 % A description of each parameter follows:
7153 % o wand: the magick wand.
7157 % o length: the blob length.
7160 WandExport MagickBooleanType MagickPingImageBlob(MagickWand *wand,
7161 const void *blob,const size_t length)
7169 assert(wand != (MagickWand *) NULL);
7170 assert(wand->signature == WandSignature);
7171 if (wand->debug != MagickFalse)
7172 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7173 read_info=CloneImageInfo(wand->image_info);
7174 SetImageInfoBlob(read_info,blob,length);
7175 images=PingImage(read_info,wand->exception);
7176 read_info=DestroyImageInfo(read_info);
7177 if (images == (Image *) NULL)
7178 return(MagickFalse);
7179 return(InsertImageInWand(wand,images));
7183 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7187 % M a g i c k P i n g I m a g e F i l e %
7191 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7193 % MagickPingImageFile() pings an image or image sequence from an open file
7196 % The format of the MagickPingImageFile method is:
7198 % MagickBooleanType MagickPingImageFile(MagickWand *wand,FILE *file)
7200 % A description of each parameter follows:
7202 % o wand: the magick wand.
7204 % o file: the file descriptor.
7207 WandExport MagickBooleanType MagickPingImageFile(MagickWand *wand,FILE *file)
7215 assert(wand != (MagickWand *) NULL);
7216 assert(wand->signature == WandSignature);
7217 assert(file != (FILE *) NULL);
7218 if (wand->debug != MagickFalse)
7219 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7220 read_info=CloneImageInfo(wand->image_info);
7221 SetImageInfoFile(read_info,file);
7222 images=PingImage(read_info,wand->exception);
7223 read_info=DestroyImageInfo(read_info);
7224 if (images == (Image *) NULL)
7225 return(MagickFalse);
7226 return(InsertImageInWand(wand,images));
7230 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7234 % M a g i c k P o l a r o i d I m a g e %
7238 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7240 % MagickPolaroidImage() simulates a Polaroid picture.
7242 % The format of the MagickPolaroidImage method is:
7244 % MagickBooleanType MagickPolaroidImage(MagickWand *wand,
7245 % const DrawingWand *drawing_wand,const char *caption,const double angle,
7246 % const PixelInterpolateMethod method)
7248 % A description of each parameter follows:
7250 % o wand: the magick wand.
7252 % o drawing_wand: the draw wand.
7254 % o caption: the Polaroid caption.
7256 % o angle: Apply the effect along this angle.
7258 % o method: the pixel interpolation method.
7261 WandExport MagickBooleanType MagickPolaroidImage(MagickWand *wand,
7262 const DrawingWand *drawing_wand,const char *caption,const double angle,
7263 const PixelInterpolateMethod method)
7271 assert(wand != (MagickWand *) NULL);
7272 assert(wand->signature == WandSignature);
7273 if (wand->debug != MagickFalse)
7274 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7275 if (wand->images == (Image *) NULL)
7276 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7277 draw_info=PeekDrawingWand(drawing_wand);
7278 if (draw_info == (DrawInfo *) NULL)
7279 return(MagickFalse);
7280 polaroid_image=PolaroidImage(wand->images,draw_info,caption,angle,method,
7282 if (polaroid_image == (Image *) NULL)
7283 return(MagickFalse);
7284 ReplaceImageInList(&wand->images,polaroid_image);
7289 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7293 % M a g i c k P o s t e r i z e I m a g e %
7297 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7299 % MagickPosterizeImage() reduces the image to a limited number of color level.
7301 % The format of the MagickPosterizeImage method is:
7303 % MagickBooleanType MagickPosterizeImage(MagickWand *wand,
7304 % const unsigned levels,const MagickBooleanType dither)
7306 % A description of each parameter follows:
7308 % o wand: the magick wand.
7310 % o levels: Number of color levels allowed in each channel. Very low values
7311 % (2, 3, or 4) have the most visible effect.
7313 % o dither: Set this integer value to something other than zero to dither
7317 WandExport MagickBooleanType MagickPosterizeImage(MagickWand *wand,
7318 const size_t levels,const MagickBooleanType dither)
7323 assert(wand != (MagickWand *) NULL);
7324 assert(wand->signature == WandSignature);
7325 if (wand->debug != MagickFalse)
7326 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7327 if (wand->images == (Image *) NULL)
7328 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7329 status=PosterizeImage(wand->images,levels,dither,wand->exception);
7334 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7338 % M a g i c k P r e v i e w I m a g e s %
7342 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7344 % MagickPreviewImages() tiles 9 thumbnails of the specified image with an
7345 % image processing operation applied at varying strengths. This helpful
7346 % to quickly pin-point an appropriate parameter for an image processing
7349 % The format of the MagickPreviewImages method is:
7351 % MagickWand *MagickPreviewImages(MagickWand *wand,
7352 % const PreviewType preview)
7354 % A description of each parameter follows:
7356 % o wand: the magick wand.
7358 % o preview: the preview type.
7361 WandExport MagickWand *MagickPreviewImages(MagickWand *wand,
7362 const PreviewType preview)
7367 assert(wand != (MagickWand *) NULL);
7368 assert(wand->signature == WandSignature);
7369 if (wand->debug != MagickFalse)
7370 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7371 if (wand->images == (Image *) NULL)
7372 return((MagickWand *) NULL);
7373 preview_image=PreviewImage(wand->images,preview,wand->exception);
7374 if (preview_image == (Image *) NULL)
7375 return((MagickWand *) NULL);
7376 return(CloneMagickWandFromImages(wand,preview_image));
7380 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7384 % M a g i c k P r e v i o u s I m a g e %
7388 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7390 % MagickPreviousImage() assocates the previous image in an image list with
7393 % The format of the MagickPreviousImage method is:
7395 % MagickBooleanType MagickPreviousImage(MagickWand *wand)
7397 % A description of each parameter follows:
7399 % o wand: the magick wand.
7402 WandExport MagickBooleanType MagickPreviousImage(MagickWand *wand)
7404 assert(wand != (MagickWand *) NULL);
7405 assert(wand->signature == WandSignature);
7406 if (wand->debug != MagickFalse)
7407 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7408 if (wand->images == (Image *) NULL)
7409 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7411 wand->image_pending=MagickFalse; /* pending status has no meaning */
7412 /* If there is no prev image, return false (Iterator is finished) */
7413 if (GetPreviousImageInList(wand->images) == (Image *) NULL)
7414 return(MagickFalse);
7415 /* just do it - current image is not 'pending' */
7416 wand->images=GetPreviousImageInList(wand->images);
7421 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7425 % M a g i c k Q u a n t i z e I m a g e %
7429 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7431 % MagickQuantizeImage() analyzes the colors within a reference image and
7432 % chooses a fixed number of colors to represent the image. The goal of the
7433 % algorithm is to minimize the color difference between the input and output
7434 % image while minimizing the processing time.
7436 % The format of the MagickQuantizeImage method is:
7438 % MagickBooleanType MagickQuantizeImage(MagickWand *wand,
7439 % const size_t number_colors,const ColorspaceType colorspace,
7440 % const size_t treedepth,const MagickBooleanType dither,
7441 % const MagickBooleanType measure_error)
7443 % A description of each parameter follows:
7445 % o wand: the magick wand.
7447 % o number_colors: the number of colors.
7449 % o colorspace: Perform color reduction in this colorspace, typically
7452 % o treedepth: Normally, this integer value is zero or one. A zero or
7453 % 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
7454 % reference image with the least amount of memory and the fastest
7455 % computational speed. In some cases, such as an image with low color
7456 % dispersion (a few number of colors), a value other than
7457 % Log4(number_colors) is required. To expand the color tree completely,
7460 % o dither: A value other than zero distributes the difference between an
7461 % original image and the corresponding color reduced image to
7462 % neighboring pixels along a Hilbert curve.
7464 % o measure_error: A value other than zero measures the difference between
7465 % the original and quantized images. This difference is the total
7466 % quantization error. The error is computed by summing over all pixels
7467 % in an image the distance squared in RGB space between each reference
7468 % pixel value and its quantized value.
7471 WandExport MagickBooleanType MagickQuantizeImage(MagickWand *wand,
7472 const size_t number_colors,const ColorspaceType colorspace,
7473 const size_t treedepth,const MagickBooleanType dither,
7474 const MagickBooleanType measure_error)
7482 assert(wand != (MagickWand *) NULL);
7483 assert(wand->signature == WandSignature);
7484 if (wand->debug != MagickFalse)
7485 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7486 if (wand->images == (Image *) NULL)
7487 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7488 quantize_info=CloneQuantizeInfo((QuantizeInfo *) NULL);
7489 quantize_info->number_colors=number_colors;
7490 quantize_info->dither=dither;
7491 quantize_info->tree_depth=treedepth;
7492 quantize_info->colorspace=colorspace;
7493 quantize_info->measure_error=measure_error;
7494 status=QuantizeImage(quantize_info,wand->images,wand->exception);
7495 quantize_info=DestroyQuantizeInfo(quantize_info);
7500 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7504 % M a g i c k Q u a n t i z e I m a g e s %
7508 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7510 % MagickQuantizeImages() analyzes the colors within a sequence of images and
7511 % chooses a fixed number of colors to represent the image. The goal of the
7512 % algorithm is to minimize the color difference between the input and output
7513 % image while minimizing the processing time.
7515 % The format of the MagickQuantizeImages method is:
7517 % MagickBooleanType MagickQuantizeImages(MagickWand *wand,
7518 % const size_t number_colors,const ColorspaceType colorspace,
7519 % const size_t treedepth,const MagickBooleanType dither,
7520 % const MagickBooleanType measure_error)
7522 % A description of each parameter follows:
7524 % o wand: the magick wand.
7526 % o number_colors: the number of colors.
7528 % o colorspace: Perform color reduction in this colorspace, typically
7531 % o treedepth: Normally, this integer value is zero or one. A zero or
7532 % 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
7533 % reference image with the least amount of memory and the fastest
7534 % computational speed. In some cases, such as an image with low color
7535 % dispersion (a few number of colors), a value other than
7536 % Log4(number_colors) is required. To expand the color tree completely,
7539 % o dither: A value other than zero distributes the difference between an
7540 % original image and the corresponding color reduced algorithm to
7541 % neighboring pixels along a Hilbert curve.
7543 % o measure_error: A value other than zero measures the difference between
7544 % the original and quantized images. This difference is the total
7545 % quantization error. The error is computed by summing over all pixels
7546 % in an image the distance squared in RGB space between each reference
7547 % pixel value and its quantized value.
7550 WandExport MagickBooleanType MagickQuantizeImages(MagickWand *wand,
7551 const size_t number_colors,const ColorspaceType colorspace,
7552 const size_t treedepth,const MagickBooleanType dither,
7553 const MagickBooleanType measure_error)
7561 assert(wand != (MagickWand *) NULL);
7562 assert(wand->signature == WandSignature);
7563 if (wand->debug != MagickFalse)
7564 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7565 if (wand->images == (Image *) NULL)
7566 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7567 quantize_info=CloneQuantizeInfo((QuantizeInfo *) NULL);
7568 quantize_info->number_colors=number_colors;
7569 quantize_info->dither=dither;
7570 quantize_info->tree_depth=treedepth;
7571 quantize_info->colorspace=colorspace;
7572 quantize_info->measure_error=measure_error;
7573 status=QuantizeImages(quantize_info,wand->images,wand->exception);
7574 quantize_info=DestroyQuantizeInfo(quantize_info);
7579 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7583 % M a g i c k R a d i a l B l u r I m a g e %
7587 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7589 % MagickRadialBlurImage() radial blurs an image.
7591 % The format of the MagickRadialBlurImage method is:
7593 % MagickBooleanType MagickRadialBlurImage(MagickWand *wand,
7594 % const double angle,const double bias)
7596 % A description of each parameter follows:
7598 % o wand: the magick wand.
7600 % o angle: the angle of the blur in degrees.
7605 WandExport MagickBooleanType MagickRadialBlurImage(MagickWand *wand,
7606 const double angle,const double bias)
7611 assert(wand != (MagickWand *) NULL);
7612 assert(wand->signature == WandSignature);
7613 if (wand->debug != MagickFalse)
7614 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7615 if (wand->images == (Image *) NULL)
7616 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7617 blur_image=RadialBlurImage(wand->images,angle,bias,wand->exception);
7618 if (blur_image == (Image *) NULL)
7619 return(MagickFalse);
7620 ReplaceImageInList(&wand->images,blur_image);
7625 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7629 % M a g i c k R a i s e I m a g e %
7633 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7635 % MagickRaiseImage() creates a simulated three-dimensional button-like effect
7636 % by lightening and darkening the edges of the image. Members width and
7637 % height of raise_info define the width of the vertical and horizontal
7638 % edge of the effect.
7640 % The format of the MagickRaiseImage method is:
7642 % MagickBooleanType MagickRaiseImage(MagickWand *wand,
7643 % const size_t width,const size_t height,const ssize_t x,
7644 % const ssize_t y,const MagickBooleanType raise)
7646 % A description of each parameter follows:
7648 % o wand: the magick wand.
7650 % o width,height,x,y: Define the dimensions of the area to raise.
7652 % o raise: A value other than zero creates a 3-D raise effect,
7653 % otherwise it has a lowered effect.
7656 WandExport MagickBooleanType MagickRaiseImage(MagickWand *wand,
7657 const size_t width,const size_t height,const ssize_t x,
7658 const ssize_t y,const MagickBooleanType raise)
7666 assert(wand != (MagickWand *) NULL);
7667 assert(wand->signature == WandSignature);
7668 if (wand->debug != MagickFalse)
7669 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7670 if (wand->images == (Image *) NULL)
7671 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7672 raise_info.width=width;
7673 raise_info.height=height;
7676 status=RaiseImage(wand->images,&raise_info,raise,wand->exception);
7681 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7685 % 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 %
7689 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7691 % MagickRandomThresholdImage() changes the value of individual pixels based on
7692 % the intensity of each pixel compared to threshold. The result is a
7693 % high-contrast, two color image.
7695 % The format of the MagickRandomThresholdImage method is:
7697 % MagickBooleanType MagickRandomThresholdImage(MagickWand *wand,
7698 % const double low,const double high)
7700 % A description of each parameter follows:
7702 % o wand: the magick wand.
7704 % o low,high: Specify the high and low thresholds. These values range from
7705 % 0 to QuantumRange.
7708 WandExport MagickBooleanType MagickRandomThresholdImage(MagickWand *wand,
7709 const double low,const double high)
7712 threshold[MaxTextExtent];
7714 assert(wand != (MagickWand *) NULL);
7715 assert(wand->signature == WandSignature);
7716 if (wand->debug != MagickFalse)
7717 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7718 if (wand->images == (Image *) NULL)
7719 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7720 (void) FormatLocaleString(threshold,MaxTextExtent,"%gx%g",low,high);
7721 return(RandomThresholdImage(wand->images,threshold,wand->exception));
7725 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7729 % M a g i c k R e a d I m a g e %
7733 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7735 % MagickReadImage() reads an image or image sequence. The images are inserted
7736 % jjust before the current image pointer position.
7738 % Use MagickSetFirstIterator(), to insert new images before all the current
7739 % images in the wand, MagickSetLastIterator() to append add to the end,
7740 % MagickSetImageIndex() to place images just after the given index.
7742 % The format of the MagickReadImage method is:
7744 % MagickBooleanType MagickReadImage(MagickWand *wand,const char *filename)
7746 % A description of each parameter follows:
7748 % o wand: the magick wand.
7750 % o filename: the image filename.
7753 WandExport MagickBooleanType MagickReadImage(MagickWand *wand,
7754 const char *filename)
7762 assert(wand != (MagickWand *) NULL);
7763 assert(wand->signature == WandSignature);
7764 if (wand->debug != MagickFalse)
7765 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7766 read_info=CloneImageInfo(wand->image_info);
7767 if (filename != (const char *) NULL)
7768 (void) CopyMagickString(read_info->filename,filename,MaxTextExtent);
7769 images=ReadImage(read_info,wand->exception);
7770 read_info=DestroyImageInfo(read_info);
7771 if (images == (Image *) NULL)
7772 return(MagickFalse);
7773 return(InsertImageInWand(wand,images));
7777 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7781 % M a g i c k R e a d I m a g e B l o b %
7785 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7787 % MagickReadImageBlob() reads an image or image sequence from a blob.
7788 % In all other respects it is like MagickReadImage().
7790 % The format of the MagickReadImageBlob method is:
7792 % MagickBooleanType MagickReadImageBlob(MagickWand *wand,
7793 % const void *blob,const size_t length)
7795 % A description of each parameter follows:
7797 % o wand: the magick wand.
7801 % o length: the blob length.
7804 WandExport MagickBooleanType MagickReadImageBlob(MagickWand *wand,
7805 const void *blob,const size_t length)
7810 assert(wand != (MagickWand *) NULL);
7811 assert(wand->signature == WandSignature);
7812 if (wand->debug != MagickFalse)
7813 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7814 images=BlobToImage(wand->image_info,blob,length,wand->exception);
7815 if (images == (Image *) NULL)
7816 return(MagickFalse);
7817 return(InsertImageInWand(wand,images));
7821 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7825 % M a g i c k R e a d I m a g e F i l e %
7829 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7831 % MagickReadImageFile() reads an image or image sequence from an already
7832 % opened file descriptor. Otherwise it is like MagickReadImage().
7834 % The format of the MagickReadImageFile method is:
7836 % MagickBooleanType MagickReadImageFile(MagickWand *wand,FILE *file)
7838 % A description of each parameter follows:
7840 % o wand: the magick wand.
7842 % o file: the file descriptor.
7845 WandExport MagickBooleanType MagickReadImageFile(MagickWand *wand,FILE *file)
7853 assert(wand != (MagickWand *) NULL);
7854 assert(wand->signature == WandSignature);
7855 assert(file != (FILE *) NULL);
7856 if (wand->debug != MagickFalse)
7857 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7858 read_info=CloneImageInfo(wand->image_info);
7859 SetImageInfoFile(read_info,file);
7860 images=ReadImage(read_info,wand->exception);
7861 read_info=DestroyImageInfo(read_info);
7862 if (images == (Image *) NULL)
7863 return(MagickFalse);
7864 return(InsertImageInWand(wand,images));
7868 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7872 % M a g i c k R e m a p I m a g e %
7876 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7878 % MagickRemapImage() replaces the colors of an image with the closest color
7879 % from a reference image.
7881 % The format of the MagickRemapImage method is:
7883 % MagickBooleanType MagickRemapImage(MagickWand *wand,
7884 % const MagickWand *remap_wand,const DitherMethod method)
7886 % A description of each parameter follows:
7888 % o wand: the magick wand.
7890 % o affinity: the affinity wand.
7892 % o method: choose from these dither methods: NoDitherMethod,
7893 % RiemersmaDitherMethod, or FloydSteinbergDitherMethod.
7896 WandExport MagickBooleanType MagickRemapImage(MagickWand *wand,
7897 const MagickWand *remap_wand,const DitherMethod method)
7905 assert(wand != (MagickWand *) NULL);
7906 assert(wand->signature == WandSignature);
7907 if (wand->debug != MagickFalse)
7908 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7909 if ((wand->images == (Image *) NULL) ||
7910 (remap_wand->images == (Image *) NULL))
7911 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7912 quantize_info=AcquireQuantizeInfo(wand->image_info);
7913 quantize_info->dither_method=method;
7914 if (method == NoDitherMethod)
7915 quantize_info->dither=MagickFalse;
7916 status=RemapImage(quantize_info,wand->images,remap_wand->images,
7918 quantize_info=DestroyQuantizeInfo(quantize_info);
7923 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7927 % M a g i c k R e m o v e I m a g e %
7931 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7933 % MagickRemoveImage() removes an image from the image list.
7935 % The format of the MagickRemoveImage method is:
7937 % MagickBooleanType MagickRemoveImage(MagickWand *wand)
7939 % A description of each parameter follows:
7941 % o wand: the magick wand.
7943 % o insert: the splice wand.
7946 WandExport MagickBooleanType MagickRemoveImage(MagickWand *wand)
7948 assert(wand != (MagickWand *) NULL);
7949 assert(wand->signature == WandSignature);
7950 if (wand->debug != MagickFalse)
7951 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7952 if (wand->images == (Image *) NULL)
7953 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7954 DeleteImageFromList(&wand->images);
7959 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7963 % M a g i c k R e s a m p l e I m a g e %
7967 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7969 % MagickResampleImage() resample image to desired resolution.
7971 % Bessel Blackman Box
7972 % Catrom Cubic Gaussian
7973 % Hanning Hermite Lanczos
7974 % Mitchell Point Quandratic
7977 % Most of the filters are FIR (finite impulse response), however, Bessel,
7978 % Gaussian, and Sinc are IIR (infinite impulse response). Bessel and Sinc
7979 % are windowed (brought down to zero) with the Blackman filter.
7981 % The format of the MagickResampleImage method is:
7983 % MagickBooleanType MagickResampleImage(MagickWand *wand,
7984 % const double x_resolution,const double y_resolution,
7985 % const FilterTypes filter,const double blur)
7987 % A description of each parameter follows:
7989 % o wand: the magick wand.
7991 % o x_resolution: the new image x resolution.
7993 % o y_resolution: the new image y resolution.
7995 % o filter: Image filter to use.
7997 % o blur: the blur factor where > 1 is blurry, < 1 is sharp.
8000 WandExport MagickBooleanType MagickResampleImage(MagickWand *wand,
8001 const double x_resolution,const double y_resolution,const FilterTypes filter,
8007 assert(wand != (MagickWand *) NULL);
8008 assert(wand->signature == WandSignature);
8009 if (wand->debug != MagickFalse)
8010 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8011 if (wand->images == (Image *) NULL)
8012 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8013 resample_image=ResampleImage(wand->images,x_resolution,y_resolution,filter,
8014 blur,wand->exception);
8015 if (resample_image == (Image *) NULL)
8016 return(MagickFalse);
8017 ReplaceImageInList(&wand->images,resample_image);
8022 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8026 % M a g i c k R e s e t I m a g e P a g e %
8030 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8032 % MagickResetImagePage() resets the Wand page canvas and position.
8034 % The format of the MagickResetImagePage method is:
8036 % MagickBooleanType MagickResetImagePage(MagickWand *wand,
8039 % A description of each parameter follows:
8041 % o wand: the magick wand.
8043 % o page: the relative page specification.
8046 WandExport MagickBooleanType MagickResetImagePage(MagickWand *wand,
8049 assert(wand != (MagickWand *) NULL);
8050 assert(wand->signature == WandSignature);
8051 if (wand->debug != MagickFalse)
8052 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8053 if (wand->images == (Image *) NULL)
8054 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8055 if ((page == (char *) NULL) || (*page == '\0'))
8057 (void) ParseAbsoluteGeometry("0x0+0+0",&wand->images->page);
8060 return(ResetImagePage(wand->images,page));
8064 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8068 % M a g i c k R e s i z e I m a g e %
8072 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8074 % MagickResizeImage() scales an image to the desired dimensions with one of
8077 % Bessel Blackman Box
8078 % Catrom Cubic Gaussian
8079 % Hanning Hermite Lanczos
8080 % Mitchell Point Quandratic
8083 % Most of the filters are FIR (finite impulse response), however, Bessel,
8084 % Gaussian, and Sinc are IIR (infinite impulse response). Bessel and Sinc
8085 % are windowed (brought down to zero) with the Blackman filter.
8087 % The format of the MagickResizeImage method is:
8089 % MagickBooleanType MagickResizeImage(MagickWand *wand,
8090 % const size_t columns,const size_t rows,
8091 % const FilterTypes filter,const double blur)
8093 % A description of each parameter follows:
8095 % o wand: the magick wand.
8097 % o columns: the number of columns in the scaled image.
8099 % o rows: the number of rows in the scaled image.
8101 % o filter: Image filter to use.
8103 % o blur: the blur factor where > 1 is blurry, < 1 is sharp.
8106 WandExport MagickBooleanType MagickResizeImage(MagickWand *wand,
8107 const size_t columns,const size_t rows,const FilterTypes filter,
8113 assert(wand != (MagickWand *) NULL);
8114 assert(wand->signature == WandSignature);
8115 if (wand->debug != MagickFalse)
8116 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8117 if (wand->images == (Image *) NULL)
8118 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8119 resize_image=ResizeImage(wand->images,columns,rows,filter,blur,
8121 if (resize_image == (Image *) NULL)
8122 return(MagickFalse);
8123 ReplaceImageInList(&wand->images,resize_image);
8128 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8132 % M a g i c k R o l l I m a g e %
8136 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8138 % MagickRollImage() offsets an image as defined by x and y.
8140 % The format of the MagickRollImage method is:
8142 % MagickBooleanType MagickRollImage(MagickWand *wand,const ssize_t x,
8145 % A description of each parameter follows:
8147 % o wand: the magick wand.
8149 % o x: the x offset.
8151 % o y: the y offset.
8155 WandExport MagickBooleanType MagickRollImage(MagickWand *wand,
8156 const ssize_t x,const ssize_t y)
8161 assert(wand != (MagickWand *) NULL);
8162 assert(wand->signature == WandSignature);
8163 if (wand->debug != MagickFalse)
8164 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8165 if (wand->images == (Image *) NULL)
8166 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8167 roll_image=RollImage(wand->images,x,y,wand->exception);
8168 if (roll_image == (Image *) NULL)
8169 return(MagickFalse);
8170 ReplaceImageInList(&wand->images,roll_image);
8175 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8179 % M a g i c k R o t a t e I m a g e %
8183 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8185 % MagickRotateImage() rotates an image the specified number of degrees. Empty
8186 % triangles left over from rotating the image are filled with the
8189 % The format of the MagickRotateImage method is:
8191 % MagickBooleanType MagickRotateImage(MagickWand *wand,
8192 % const PixelWand *background,const double degrees)
8194 % A description of each parameter follows:
8196 % o wand: the magick wand.
8198 % o background: the background pixel wand.
8200 % o degrees: the number of degrees to rotate the image.
8204 WandExport MagickBooleanType MagickRotateImage(MagickWand *wand,
8205 const PixelWand *background,const double degrees)
8210 assert(wand != (MagickWand *) NULL);
8211 assert(wand->signature == WandSignature);
8212 if (wand->debug != MagickFalse)
8213 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8214 if (wand->images == (Image *) NULL)
8215 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8216 PixelGetQuantumPacket(background,&wand->images->background_color);
8217 rotate_image=RotateImage(wand->images,degrees,wand->exception);
8218 if (rotate_image == (Image *) NULL)
8219 return(MagickFalse);
8220 ReplaceImageInList(&wand->images,rotate_image);
8225 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8229 % M a g i c k S a m p l e I m a g e %
8233 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8235 % MagickSampleImage() scales an image to the desired dimensions with pixel
8236 % sampling. Unlike other scaling methods, this method does not introduce
8237 % any additional color into the scaled image.
8239 % The format of the MagickSampleImage method is:
8241 % MagickBooleanType MagickSampleImage(MagickWand *wand,
8242 % const size_t columns,const size_t rows)
8244 % A description of each parameter follows:
8246 % o wand: the magick wand.
8248 % o columns: the number of columns in the scaled image.
8250 % o rows: the number of rows in the scaled image.
8254 WandExport MagickBooleanType MagickSampleImage(MagickWand *wand,
8255 const size_t columns,const size_t rows)
8260 assert(wand != (MagickWand *) NULL);
8261 assert(wand->signature == WandSignature);
8262 if (wand->debug != MagickFalse)
8263 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8264 if (wand->images == (Image *) NULL)
8265 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8266 sample_image=SampleImage(wand->images,columns,rows,wand->exception);
8267 if (sample_image == (Image *) NULL)
8268 return(MagickFalse);
8269 ReplaceImageInList(&wand->images,sample_image);
8274 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8278 % M a g i c k S c a l e I m a g e %
8282 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8284 % MagickScaleImage() scales the size of an image to the given dimensions.
8286 % The format of the MagickScaleImage method is:
8288 % MagickBooleanType MagickScaleImage(MagickWand *wand,
8289 % const size_t columns,const size_t rows)
8291 % A description of each parameter follows:
8293 % o wand: the magick wand.
8295 % o columns: the number of columns in the scaled image.
8297 % o rows: the number of rows in the scaled image.
8301 WandExport MagickBooleanType MagickScaleImage(MagickWand *wand,
8302 const size_t columns,const size_t rows)
8307 assert(wand != (MagickWand *) NULL);
8308 assert(wand->signature == WandSignature);
8309 if (wand->debug != MagickFalse)
8310 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8311 if (wand->images == (Image *) NULL)
8312 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8313 scale_image=ScaleImage(wand->images,columns,rows,wand->exception);
8314 if (scale_image == (Image *) NULL)
8315 return(MagickFalse);
8316 ReplaceImageInList(&wand->images,scale_image);
8321 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8325 % M a g i c k S e g m e n t I m a g e %
8329 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8331 % MagickSegmentImage() segments an image by analyzing the histograms of the
8332 % color components and identifying units that are homogeneous with the fuzzy
8333 % C-means technique.
8335 % The format of the SegmentImage method is:
8337 % MagickBooleanType MagickSegmentImage(MagickWand *wand,
8338 % const ColorspaceType colorspace,const MagickBooleanType verbose,
8339 % const double cluster_threshold,const double smooth_threshold)
8341 % A description of each parameter follows.
8345 % o colorspace: the image colorspace.
8347 % o verbose: Set to MagickTrue to print detailed information about the
8348 % identified classes.
8350 % o cluster_threshold: This represents the minimum number of pixels
8351 % contained in a hexahedra before it can be considered valid (expressed as
8354 % o smooth_threshold: the smoothing threshold eliminates noise in the second
8355 % derivative of the histogram. As the value is increased, you can expect a
8356 % smoother second derivative.
8359 MagickExport MagickBooleanType MagickSegmentImage(MagickWand *wand,
8360 const ColorspaceType colorspace,const MagickBooleanType verbose,
8361 const double cluster_threshold,const double smooth_threshold)
8366 assert(wand != (MagickWand *) NULL);
8367 assert(wand->signature == WandSignature);
8368 if (wand->debug != MagickFalse)
8369 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8370 if (wand->images == (Image *) NULL)
8371 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8372 status=SegmentImage(wand->images,colorspace,verbose,cluster_threshold,
8373 smooth_threshold,wand->exception);
8378 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8382 % M a g i c k S e l e c t i v e B l u r I m a g e %
8386 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8388 % MagickSelectiveBlurImage() selectively blur an image within a contrast
8389 % threshold. It is similar to the unsharpen mask that sharpens everything with
8390 % contrast above a certain threshold.
8392 % The format of the MagickSelectiveBlurImage method is:
8394 % MagickBooleanType MagickSelectiveBlurImage(MagickWand *wand,
8395 % const double radius,const double sigma,const double threshold,
8396 % const double bias)
8398 % A description of each parameter follows:
8400 % o wand: the magick wand.
8402 % o radius: the radius of the gaussian, in pixels, not counting the center
8405 % o sigma: the standard deviation of the gaussian, in pixels.
8407 % o threshold: only pixels within this contrast threshold are included
8408 % in the blur operation.
8413 WandExport MagickBooleanType MagickSelectiveBlurImage(MagickWand *wand,
8414 const double radius,const double sigma,const double threshold,
8420 assert(wand != (MagickWand *) NULL);
8421 assert(wand->signature == WandSignature);
8422 if (wand->debug != MagickFalse)
8423 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8424 if (wand->images == (Image *) NULL)
8425 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8426 blur_image=SelectiveBlurImage(wand->images,radius,sigma,threshold,bias,
8428 if (blur_image == (Image *) NULL)
8429 return(MagickFalse);
8430 ReplaceImageInList(&wand->images,blur_image);
8435 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8439 % 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 %
8443 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8445 % MagickSeparateImage() separates a channel from the image and returns a
8446 % grayscale image. A channel is a particular color component of each pixel
8449 % The format of the MagickSeparateImage method is:
8451 % MagickBooleanType MagickSeparateImage(MagickWand *wand,
8452 % const ChannelType channel)
8454 % A description of each parameter follows:
8456 % o wand: the magick wand.
8458 % o channel: the channel.
8461 WandExport MagickBooleanType MagickSeparateImage(MagickWand *wand,
8462 const ChannelType channel)
8467 assert(wand != (MagickWand *) NULL);
8468 assert(wand->signature == WandSignature);
8469 if (wand->debug != MagickFalse)
8470 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8471 if (wand->images == (Image *) NULL)
8472 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8473 separate_image=SeparateImage(wand->images,channel,wand->exception);
8474 if (separate_image == (Image *) NULL)
8475 return(MagickFalse);
8476 ReplaceImageInList(&wand->images,separate_image);
8481 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8485 % M a g i c k S e p i a T o n e I m a g e %
8489 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8491 % MagickSepiaToneImage() applies a special effect to the image, similar to the
8492 % effect achieved in a photo darkroom by sepia toning. Threshold ranges from
8493 % 0 to QuantumRange and is a measure of the extent of the sepia toning. A
8494 % threshold of 80% is a good starting point for a reasonable tone.
8496 % The format of the MagickSepiaToneImage method is:
8498 % MagickBooleanType MagickSepiaToneImage(MagickWand *wand,
8499 % const double threshold)
8501 % A description of each parameter follows:
8503 % o wand: the magick wand.
8505 % o threshold: Define the extent of the sepia toning.
8508 WandExport MagickBooleanType MagickSepiaToneImage(MagickWand *wand,
8509 const double threshold)
8514 assert(wand != (MagickWand *) NULL);
8515 assert(wand->signature == WandSignature);
8516 if (wand->debug != MagickFalse)
8517 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8518 if (wand->images == (Image *) NULL)
8519 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8520 sepia_image=SepiaToneImage(wand->images,threshold,wand->exception);
8521 if (sepia_image == (Image *) NULL)
8522 return(MagickFalse);
8523 ReplaceImageInList(&wand->images,sepia_image);
8528 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8532 % M a g i c k S e t I m a g e %
8536 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8538 % MagickSetImage() replaces the last image returned by MagickSetImageIndex(),
8539 % MagickNextImage(), MagickPreviousImage() with the images from the specified
8542 % The format of the MagickSetImage method is:
8544 % MagickBooleanType MagickSetImage(MagickWand *wand,
8545 % const MagickWand *set_wand)
8547 % A description of each parameter follows:
8549 % o wand: the magick wand.
8551 % o set_wand: the set_wand wand.
8554 WandExport MagickBooleanType MagickSetImage(MagickWand *wand,
8555 const MagickWand *set_wand)
8560 assert(wand != (MagickWand *) NULL);
8561 assert(wand->signature == WandSignature);
8562 if (wand->debug != MagickFalse)
8563 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8564 assert(set_wand != (MagickWand *) NULL);
8565 assert(set_wand->signature == WandSignature);
8566 if (wand->debug != MagickFalse)
8567 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",set_wand->name);
8568 if (set_wand->images == (Image *) NULL)
8569 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8570 images=CloneImageList(set_wand->images,wand->exception);
8571 if (images == (Image *) NULL)
8572 return(MagickFalse);
8573 ReplaceImageInList(&wand->images,images);
8578 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8582 % 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 %
8586 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8588 % MagickSetImageAlphaChannel() activates, deactivates, resets, or sets the
8591 % The format of the MagickSetImageAlphaChannel method is:
8593 % MagickBooleanType MagickSetImageAlphaChannel(MagickWand *wand,
8594 % const AlphaChannelType alpha_type)
8596 % A description of each parameter follows:
8598 % o wand: the magick wand.
8600 % o alpha_type: the alpha channel type: ActivateAlphaChannel,
8601 % DeactivateAlphaChannel, OpaqueAlphaChannel, or SetAlphaChannel.
8604 WandExport MagickBooleanType MagickSetImageAlphaChannel(MagickWand *wand,
8605 const AlphaChannelType alpha_type)
8607 assert(wand != (MagickWand *) NULL);
8608 assert(wand->signature == WandSignature);
8609 if (wand->debug != MagickFalse)
8610 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8611 if (wand->images == (Image *) NULL)
8612 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8613 return(SetImageAlphaChannel(wand->images,alpha_type,wand->exception));
8617 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8621 % 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 %
8625 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8627 % MagickSetImageBackgroundColor() sets the image background color.
8629 % The format of the MagickSetImageBackgroundColor method is:
8631 % MagickBooleanType MagickSetImageBackgroundColor(MagickWand *wand,
8632 % const PixelWand *background)
8634 % A description of each parameter follows:
8636 % o wand: the magick wand.
8638 % o background: the background pixel wand.
8641 WandExport MagickBooleanType MagickSetImageBackgroundColor(MagickWand *wand,
8642 const PixelWand *background)
8644 assert(wand != (MagickWand *) NULL);
8645 assert(wand->signature == WandSignature);
8646 if (wand->debug != MagickFalse)
8647 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8648 if (wand->images == (Image *) NULL)
8649 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8650 PixelGetQuantumPacket(background,&wand->images->background_color);
8655 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8659 % M a g i c k S e t I m a g e B i a s %
8663 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8665 % MagickSetImageBias() sets the image bias for any method that convolves an
8666 % image (e.g. MagickConvolveImage()).
8668 % The format of the MagickSetImageBias method is:
8670 % MagickBooleanType MagickSetImageBias(MagickWand *wand,
8671 % const double bias)
8673 % A description of each parameter follows:
8675 % o wand: the magick wand.
8677 % o bias: the image bias.
8680 WandExport MagickBooleanType MagickSetImageBias(MagickWand *wand,
8683 assert(wand != (MagickWand *) NULL);
8684 assert(wand->signature == WandSignature);
8685 if (wand->debug != MagickFalse)
8686 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8687 if (wand->images == (Image *) NULL)
8688 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8689 wand->images->bias=bias;
8694 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8698 % 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 %
8702 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8704 % MagickSetImageBluePrimary() sets the image chromaticity blue primary point.
8706 % The format of the MagickSetImageBluePrimary method is:
8708 % MagickBooleanType MagickSetImageBluePrimary(MagickWand *wand,
8709 % const double x,const double y)
8711 % A description of each parameter follows:
8713 % o wand: the magick wand.
8715 % o x: the blue primary x-point.
8717 % o y: the blue primary y-point.
8720 WandExport MagickBooleanType MagickSetImageBluePrimary(MagickWand *wand,
8721 const double x,const double y)
8723 assert(wand != (MagickWand *) NULL);
8724 assert(wand->signature == WandSignature);
8725 if (wand->debug != MagickFalse)
8726 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8727 if (wand->images == (Image *) NULL)
8728 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8729 wand->images->chromaticity.blue_primary.x=x;
8730 wand->images->chromaticity.blue_primary.y=y;
8735 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8739 % 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 %
8743 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8745 % MagickSetImageBorderColor() sets the image border color.
8747 % The format of the MagickSetImageBorderColor method is:
8749 % MagickBooleanType MagickSetImageBorderColor(MagickWand *wand,
8750 % const PixelWand *border)
8752 % A description of each parameter follows:
8754 % o wand: the magick wand.
8756 % o border: the border pixel wand.
8759 WandExport MagickBooleanType MagickSetImageBorderColor(MagickWand *wand,
8760 const PixelWand *border)
8762 assert(wand != (MagickWand *) NULL);
8763 assert(wand->signature == WandSignature);
8764 if (wand->debug != MagickFalse)
8765 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8766 if (wand->images == (Image *) NULL)
8767 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8768 PixelGetQuantumPacket(border,&wand->images->border_color);
8773 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8777 % M a g i c k S e t I m a g e C l i p M a s k %
8781 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8783 % MagickSetImageMask() sets image clip mask.
8785 % The format of the MagickSetImageMask method is:
8787 % MagickBooleanType MagickSetImageMask(MagickWand *wand,
8788 % const MagickWand *clip_mask)
8790 % A description of each parameter follows:
8792 % o wand: the magick wand.
8794 % o clip_mask: the clip_mask wand.
8797 WandExport MagickBooleanType MagickSetImageMask(MagickWand *wand,
8798 const MagickWand *clip_mask)
8800 assert(wand != (MagickWand *) NULL);
8801 assert(wand->signature == WandSignature);
8802 if (wand->debug != MagickFalse)
8803 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8804 assert(clip_mask != (MagickWand *) NULL);
8805 assert(clip_mask->signature == WandSignature);
8806 if (clip_mask->debug != MagickFalse)
8807 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",clip_mask->name);
8808 if (clip_mask->images == (Image *) NULL)
8809 ThrowWandException(WandError,"ContainsNoImages",clip_mask->name);
8810 return(SetImageMask(wand->images,clip_mask->images,wand->exception));
8814 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8818 % M a g i c k S e t I m a g e C o l o r %
8822 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8824 % MagickSetImageColor() set the entire wand canvas to the specified color.
8826 % The format of the MagickSetImageColor method is:
8828 % MagickBooleanType MagickSetImageColor(MagickWand *wand,
8829 % const PixelWand *color)
8831 % A description of each parameter follows:
8833 % o wand: the magick wand.
8835 % o background: the image color.
8838 WandExport MagickBooleanType MagickSetImageColor(MagickWand *wand,
8839 const PixelWand *color)
8844 assert(wand != (MagickWand *) NULL);
8845 assert(wand->signature == WandSignature);
8846 if (wand->debug != MagickFalse)
8847 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8848 PixelGetMagickColor(color,&pixel);
8849 return(SetImageColor(wand->images,&pixel,wand->exception));
8853 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8857 % 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 %
8861 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8863 % MagickSetImageColormapColor() sets the color of the specified colormap
8866 % The format of the MagickSetImageColormapColor method is:
8868 % MagickBooleanType MagickSetImageColormapColor(MagickWand *wand,
8869 % const size_t index,const PixelWand *color)
8871 % A description of each parameter follows:
8873 % o wand: the magick wand.
8875 % o index: the offset into the image colormap.
8877 % o color: Return the colormap color in this wand.
8880 WandExport MagickBooleanType MagickSetImageColormapColor(MagickWand *wand,
8881 const size_t index,const PixelWand *color)
8883 assert(wand != (MagickWand *) NULL);
8884 assert(wand->signature == WandSignature);
8885 if (wand->debug != MagickFalse)
8886 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8887 if (wand->images == (Image *) NULL)
8888 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8889 if ((wand->images->colormap == (PixelInfo *) NULL) ||
8890 (index >= wand->images->colors))
8891 ThrowWandException(WandError,"InvalidColormapIndex",wand->name);
8892 PixelGetQuantumPacket(color,wand->images->colormap+index);
8893 return(SyncImage(wand->images,wand->exception));
8897 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8901 % M a g i c k S e t I m a g e C o l o r s p a c e %
8905 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8907 % MagickSetImageColorspace() sets the image colorspace.
8909 % The format of the MagickSetImageColorspace method is:
8911 % MagickBooleanType MagickSetImageColorspace(MagickWand *wand,
8912 % const ColorspaceType colorspace)
8914 % A description of each parameter follows:
8916 % o wand: the magick wand.
8918 % o colorspace: the image colorspace: UndefinedColorspace, RGBColorspace,
8919 % GRAYColorspace, TransparentColorspace, OHTAColorspace, XYZColorspace,
8920 % YCbCrColorspace, YCCColorspace, YIQColorspace, YPbPrColorspace,
8921 % YPbPrColorspace, YUVColorspace, CMYKColorspace, sRGBColorspace,
8922 % HSLColorspace, or HWBColorspace.
8925 WandExport MagickBooleanType MagickSetImageColorspace(MagickWand *wand,
8926 const ColorspaceType colorspace)
8928 assert(wand != (MagickWand *) NULL);
8929 assert(wand->signature == WandSignature);
8930 if (wand->debug != MagickFalse)
8931 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8932 if (wand->images == (Image *) NULL)
8933 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8934 return(SetImageColorspace(wand->images,colorspace,wand->exception));
8938 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8942 % M a g i c k S e t I m a g e C o m p o s e %
8946 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8948 % MagickSetImageCompose() sets the image composite operator, useful for
8949 % specifying how to composite the image thumbnail when using the
8950 % MagickMontageImage() method.
8952 % The format of the MagickSetImageCompose method is:
8954 % MagickBooleanType MagickSetImageCompose(MagickWand *wand,
8955 % const CompositeOperator compose)
8957 % A description of each parameter follows:
8959 % o wand: the magick wand.
8961 % o compose: the image composite operator.
8964 WandExport MagickBooleanType MagickSetImageCompose(MagickWand *wand,
8965 const CompositeOperator compose)
8967 assert(wand != (MagickWand *) NULL);
8968 assert(wand->signature == WandSignature);
8969 if (wand->debug != MagickFalse)
8970 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8971 if (wand->images == (Image *) NULL)
8972 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8973 wand->images->compose=compose;
8978 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8982 % 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 %
8986 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8988 % MagickSetImageCompression() sets the image compression.
8990 % The format of the MagickSetImageCompression method is:
8992 % MagickBooleanType MagickSetImageCompression(MagickWand *wand,
8993 % const CompressionType compression)
8995 % A description of each parameter follows:
8997 % o wand: the magick wand.
8999 % o compression: the image compression type.
9002 WandExport MagickBooleanType MagickSetImageCompression(MagickWand *wand,
9003 const CompressionType compression)
9005 assert(wand != (MagickWand *) NULL);
9006 assert(wand->signature == WandSignature);
9007 if (wand->debug != MagickFalse)
9008 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9009 if (wand->images == (Image *) NULL)
9010 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9011 wand->images->compression=compression;
9016 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9020 % 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 %
9024 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9026 % MagickSetImageCompressionQuality() sets the image compression quality.
9028 % The format of the MagickSetImageCompressionQuality method is:
9030 % MagickBooleanType MagickSetImageCompressionQuality(MagickWand *wand,
9031 % const size_t quality)
9033 % A description of each parameter follows:
9035 % o wand: the magick wand.
9037 % o quality: the image compression tlityype.
9040 WandExport MagickBooleanType MagickSetImageCompressionQuality(MagickWand *wand,
9041 const size_t quality)
9043 assert(wand != (MagickWand *) NULL);
9044 assert(wand->signature == WandSignature);
9045 if (wand->debug != MagickFalse)
9046 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9047 if (wand->images == (Image *) NULL)
9048 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9049 wand->images->quality=quality;
9054 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9058 % M a g i c k S e t I m a g e D e l a y %
9062 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9064 % MagickSetImageDelay() sets the image delay.
9066 % The format of the MagickSetImageDelay method is:
9068 % MagickBooleanType MagickSetImageDelay(MagickWand *wand,
9069 % const size_t delay)
9071 % A description of each parameter follows:
9073 % o wand: the magick wand.
9075 % o delay: the image delay in ticks-per-second units.
9078 WandExport MagickBooleanType MagickSetImageDelay(MagickWand *wand,
9081 assert(wand != (MagickWand *) NULL);
9082 assert(wand->signature == WandSignature);
9083 if (wand->debug != MagickFalse)
9084 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9085 if (wand->images == (Image *) NULL)
9086 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9087 wand->images->delay=delay;
9092 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9096 % M a g i c k S e t I m a g e D e p t h %
9100 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9102 % MagickSetImageDepth() sets the image depth.
9104 % The format of the MagickSetImageDepth method is:
9106 % MagickBooleanType MagickSetImageDepth(MagickWand *wand,
9107 % const size_t depth)
9109 % A description of each parameter follows:
9111 % o wand: the magick wand.
9113 % o depth: the image depth in bits: 8, 16, or 32.
9116 WandExport MagickBooleanType MagickSetImageDepth(MagickWand *wand,
9119 assert(wand != (MagickWand *) NULL);
9120 assert(wand->signature == WandSignature);
9121 if (wand->debug != MagickFalse)
9122 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9123 if (wand->images == (Image *) NULL)
9124 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9125 return(SetImageDepth(wand->images,depth,wand->exception));
9129 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9133 % M a g i c k S e t I m a g e D i s p o s e %
9137 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9139 % MagickSetImageDispose() sets the image disposal method.
9141 % The format of the MagickSetImageDispose method is:
9143 % MagickBooleanType MagickSetImageDispose(MagickWand *wand,
9144 % const DisposeType dispose)
9146 % A description of each parameter follows:
9148 % o wand: the magick wand.
9150 % o dispose: the image disposeal type.
9153 WandExport MagickBooleanType MagickSetImageDispose(MagickWand *wand,
9154 const DisposeType dispose)
9156 assert(wand != (MagickWand *) NULL);
9157 assert(wand->signature == WandSignature);
9158 if (wand->debug != MagickFalse)
9159 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9160 if (wand->images == (Image *) NULL)
9161 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9162 wand->images->dispose=dispose;
9167 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9171 % M a g i c k S e t I m a g e E x t e n t %
9175 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9177 % MagickSetImageExtent() sets the image size (i.e. columns & rows).
9179 % The format of the MagickSetImageExtent method is:
9181 % MagickBooleanType MagickSetImageExtent(MagickWand *wand,
9182 % const size_t columns,const unsigned rows)
9184 % A description of each parameter follows:
9186 % o wand: the magick wand.
9188 % o columns: The image width in pixels.
9190 % o rows: The image height in pixels.
9193 WandExport MagickBooleanType MagickSetImageExtent(MagickWand *wand,
9194 const size_t columns,const size_t rows)
9196 assert(wand != (MagickWand *) NULL);
9197 assert(wand->signature == WandSignature);
9198 if (wand->debug != MagickFalse)
9199 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9200 if (wand->images == (Image *) NULL)
9201 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9202 return(SetImageExtent(wand->images,columns,rows,wand->exception));
9206 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9210 % M a g i c k S e t I m a g e F i l e n a m e %
9214 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9216 % MagickSetImageFilename() sets the filename of a particular image in a
9219 % The format of the MagickSetImageFilename method is:
9221 % MagickBooleanType MagickSetImageFilename(MagickWand *wand,
9222 % const char *filename)
9224 % A description of each parameter follows:
9226 % o wand: the magick wand.
9228 % o filename: the image filename.
9231 WandExport MagickBooleanType MagickSetImageFilename(MagickWand *wand,
9232 const char *filename)
9234 assert(wand != (MagickWand *) NULL);
9235 assert(wand->signature == WandSignature);
9236 if (wand->debug != MagickFalse)
9237 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9238 if (wand->images == (Image *) NULL)
9239 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9240 if (filename != (const char *) NULL)
9241 (void) CopyMagickString(wand->images->filename,filename,MaxTextExtent);
9246 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9250 % M a g i c k S e t I m a g e F o r m a t %
9254 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9256 % MagickSetImageFormat() sets the format of a particular image in a
9259 % The format of the MagickSetImageFormat method is:
9261 % MagickBooleanType MagickSetImageFormat(MagickWand *wand,
9262 % const char *format)
9264 % A description of each parameter follows:
9266 % o wand: the magick wand.
9268 % o format: the image format.
9271 WandExport MagickBooleanType MagickSetImageFormat(MagickWand *wand,
9277 assert(wand != (MagickWand *) NULL);
9278 assert(wand->signature == WandSignature);
9279 if (wand->debug != MagickFalse)
9280 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9281 if (wand->images == (Image *) NULL)
9282 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9283 if ((format == (char *) NULL) || (*format == '\0'))
9285 *wand->images->magick='\0';
9288 magick_info=GetMagickInfo(format,wand->exception);
9289 if (magick_info == (const MagickInfo *) NULL)
9290 return(MagickFalse);
9291 ClearMagickException(wand->exception);
9292 (void) CopyMagickString(wand->images->magick,format,MaxTextExtent);
9297 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9301 % M a g i c k S e t I m a g e F u z z %
9305 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9307 % MagickSetImageFuzz() sets the image fuzz.
9309 % The format of the MagickSetImageFuzz method is:
9311 % MagickBooleanType MagickSetImageFuzz(MagickWand *wand,
9312 % const double fuzz)
9314 % A description of each parameter follows:
9316 % o wand: the magick wand.
9318 % o fuzz: the image fuzz.
9321 WandExport MagickBooleanType MagickSetImageFuzz(MagickWand *wand,
9324 assert(wand != (MagickWand *) NULL);
9325 assert(wand->signature == WandSignature);
9326 if (wand->debug != MagickFalse)
9327 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9328 if (wand->images == (Image *) NULL)
9329 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9330 wand->images->fuzz=fuzz;
9335 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9339 % M a g i c k S e t I m a g e G a m m a %
9343 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9345 % MagickSetImageGamma() sets the image gamma.
9347 % The format of the MagickSetImageGamma method is:
9349 % MagickBooleanType MagickSetImageGamma(MagickWand *wand,
9350 % const double gamma)
9352 % A description of each parameter follows:
9354 % o wand: the magick wand.
9356 % o gamma: the image gamma.
9359 WandExport MagickBooleanType MagickSetImageGamma(MagickWand *wand,
9362 assert(wand != (MagickWand *) NULL);
9363 assert(wand->signature == WandSignature);
9364 if (wand->debug != MagickFalse)
9365 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9366 if (wand->images == (Image *) NULL)
9367 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9368 wand->images->gamma=gamma;
9373 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9377 % M a g i c k S e t I m a g e G r a v i t y %
9381 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9383 % MagickSetImageGravity() sets the image gravity type.
9385 % The format of the MagickSetImageGravity method is:
9387 % MagickBooleanType MagickSetImageGravity(MagickWand *wand,
9388 % const GravityType gravity)
9390 % A description of each parameter follows:
9392 % o wand: the magick wand.
9394 % o gravity: the image interlace scheme: NoInterlace, LineInterlace,
9395 % PlaneInterlace, PartitionInterlace.
9398 WandExport MagickBooleanType MagickSetImageGravity(MagickWand *wand,
9399 const GravityType gravity)
9401 assert(wand != (MagickWand *) NULL);
9402 assert(wand->signature == WandSignature);
9403 if (wand->debug != MagickFalse)
9404 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9405 if (wand->images == (Image *) NULL)
9406 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9407 wand->images->gravity=gravity;
9412 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9416 % 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 %
9420 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9422 % MagickSetImageGreenPrimary() sets the image chromaticity green primary
9425 % The format of the MagickSetImageGreenPrimary method is:
9427 % MagickBooleanType MagickSetImageGreenPrimary(MagickWand *wand,
9428 % const double x,const double y)
9430 % A description of each parameter follows:
9432 % o wand: the magick wand.
9434 % o x: the green primary x-point.
9436 % o y: the green primary y-point.
9440 WandExport MagickBooleanType MagickSetImageGreenPrimary(MagickWand *wand,
9441 const double x,const double y)
9443 assert(wand != (MagickWand *) NULL);
9444 assert(wand->signature == WandSignature);
9445 if (wand->debug != MagickFalse)
9446 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9447 if (wand->images == (Image *) NULL)
9448 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9449 wand->images->chromaticity.green_primary.x=x;
9450 wand->images->chromaticity.green_primary.y=y;
9455 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9459 % 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 %
9463 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9465 % MagickSetImageInterlaceScheme() sets the image interlace scheme.
9467 % The format of the MagickSetImageInterlaceScheme method is:
9469 % MagickBooleanType MagickSetImageInterlaceScheme(MagickWand *wand,
9470 % const InterlaceType interlace)
9472 % A description of each parameter follows:
9474 % o wand: the magick wand.
9476 % o interlace: the image interlace scheme: NoInterlace, LineInterlace,
9477 % PlaneInterlace, PartitionInterlace.
9480 WandExport MagickBooleanType MagickSetImageInterlaceScheme(MagickWand *wand,
9481 const InterlaceType interlace)
9483 assert(wand != (MagickWand *) NULL);
9484 assert(wand->signature == WandSignature);
9485 if (wand->debug != MagickFalse)
9486 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9487 if (wand->images == (Image *) NULL)
9488 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9489 wand->images->interlace=interlace;
9494 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9498 % 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 %
9502 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9504 % MagickSetImagePixelInterpolateMethod() sets the image interpolate pixel method.
9506 % The format of the MagickSetImagePixelInterpolateMethod method is:
9508 % MagickBooleanType MagickSetImagePixelInterpolateMethod(MagickWand *wand,
9509 % const PixelInterpolateMethod method)
9511 % A description of each parameter follows:
9513 % o wand: the magick wand.
9515 % o method: the image interpole pixel methods: choose from Undefined,
9516 % Average, Bicubic, Bilinear, Filter, Integer, Mesh, NearestNeighbor.
9519 WandExport MagickBooleanType MagickSetImagePixelInterpolateMethod(MagickWand *wand,
9520 const PixelInterpolateMethod method)
9522 assert(wand != (MagickWand *) NULL);
9523 assert(wand->signature == WandSignature);
9524 if (wand->debug != MagickFalse)
9525 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9526 if (wand->images == (Image *) NULL)
9527 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9528 wand->images->interpolate=method;
9533 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9537 % M a g i c k S e t I m a g e I t e r a t i o n s %
9541 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9543 % MagickSetImageIterations() sets the image iterations.
9545 % The format of the MagickSetImageIterations method is:
9547 % MagickBooleanType MagickSetImageIterations(MagickWand *wand,
9548 % const size_t iterations)
9550 % A description of each parameter follows:
9552 % o wand: the magick wand.
9554 % o delay: the image delay in 1/100th of a second.
9557 WandExport MagickBooleanType MagickSetImageIterations(MagickWand *wand,
9558 const size_t iterations)
9560 assert(wand != (MagickWand *) NULL);
9561 assert(wand->signature == WandSignature);
9562 if (wand->debug != MagickFalse)
9563 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9564 if (wand->images == (Image *) NULL)
9565 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9566 wand->images->iterations=iterations;
9571 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9575 % M a g i c k S e t I m a g e M a t t e %
9579 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9581 % MagickSetImageMatte() sets the image matte channel.
9583 % The format of the MagickSetImageMatteColor method is:
9585 % MagickBooleanType MagickSetImageMatteColor(MagickWand *wand,
9586 % const MagickBooleanType *matte)
9588 % A description of each parameter follows:
9590 % o wand: the magick wand.
9592 % o matte: Set to MagickTrue to enable the image matte channel otherwise
9596 WandExport MagickBooleanType MagickSetImageMatte(MagickWand *wand,
9597 const MagickBooleanType matte)
9599 assert(wand != (MagickWand *) NULL);
9600 assert(wand->signature == WandSignature);
9601 if (wand->debug != MagickFalse)
9602 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9603 if (wand->images == (Image *) NULL)
9604 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9605 if ((wand->images->matte == MagickFalse) && (matte != MagickFalse))
9606 (void) SetImageAlpha(wand->images,OpaqueAlpha,wand->exception);
9607 wand->images->matte=matte;
9612 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9616 % M a g i c k S e t I m a g e M a t t e C o l o r %
9620 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9622 % MagickSetImageMatteColor() sets the image matte color.
9624 % The format of the MagickSetImageMatteColor method is:
9626 % MagickBooleanType MagickSetImageMatteColor(MagickWand *wand,
9627 % const PixelWand *matte)
9629 % A description of each parameter follows:
9631 % o wand: the magick wand.
9633 % o matte: the matte pixel wand.
9636 WandExport MagickBooleanType MagickSetImageMatteColor(MagickWand *wand,
9637 const PixelWand *matte)
9639 assert(wand != (MagickWand *) NULL);
9640 assert(wand->signature == WandSignature);
9641 if (wand->debug != MagickFalse)
9642 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9643 if (wand->images == (Image *) NULL)
9644 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9645 PixelGetQuantumPacket(matte,&wand->images->matte_color);
9650 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9654 % M a g i c k S e t I m a g e O p a c i t y %
9658 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9660 % MagickSetImageAlpha() sets the image to the specified alpha level.
9662 % The format of the MagickSetImageAlpha method is:
9664 % MagickBooleanType MagickSetImageAlpha(MagickWand *wand,
9665 % const double alpha)
9667 % A description of each parameter follows:
9669 % o wand: the magick wand.
9671 % o alpha: the level of transparency: 1.0 is fully opaque and 0.0 is fully
9675 WandExport MagickBooleanType MagickSetImageAlpha(MagickWand *wand,
9681 assert(wand != (MagickWand *) NULL);
9682 assert(wand->signature == WandSignature);
9683 if (wand->debug != MagickFalse)
9684 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9685 if (wand->images == (Image *) NULL)
9686 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9687 status=SetImageAlpha(wand->images,ClampToQuantum(QuantumRange*alpha),
9693 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9697 % 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 %
9701 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9703 % MagickSetImageOrientation() sets the image orientation.
9705 % The format of the MagickSetImageOrientation method is:
9707 % MagickBooleanType MagickSetImageOrientation(MagickWand *wand,
9708 % const OrientationType orientation)
9710 % A description of each parameter follows:
9712 % o wand: the magick wand.
9714 % o orientation: the image orientation type.
9717 WandExport MagickBooleanType MagickSetImageOrientation(MagickWand *wand,
9718 const OrientationType orientation)
9720 assert(wand != (MagickWand *) NULL);
9721 assert(wand->signature == WandSignature);
9722 if (wand->debug != MagickFalse)
9723 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9724 if (wand->images == (Image *) NULL)
9725 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9726 wand->images->orientation=orientation;
9731 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9735 % M a g i c k S e t I m a g e P a g e %
9739 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9741 % MagickSetImagePage() sets the page geometry of the image.
9743 % The format of the MagickSetImagePage method is:
9745 % MagickBooleanType MagickSetImagePage(MagickWand *wand,
9746 % const size_t width,const size_t height,const ssize_t x,
9749 % A description of each parameter follows:
9751 % o wand: the magick wand.
9753 % o width: the page width.
9755 % o height: the page height.
9757 % o x: the page x-offset.
9759 % o y: the page y-offset.
9762 WandExport MagickBooleanType MagickSetImagePage(MagickWand *wand,
9763 const size_t width,const size_t height,const ssize_t x,
9766 assert(wand != (MagickWand *) NULL);
9767 assert(wand->signature == WandSignature);
9768 if (wand->debug != MagickFalse)
9769 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9770 if (wand->images == (Image *) NULL)
9771 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9772 wand->images->page.width=width;
9773 wand->images->page.height=height;
9774 wand->images->page.x=x;
9775 wand->images->page.y=y;
9780 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9784 % 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 %
9788 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9790 % MagickSetImageProgressMonitor() sets the wand image progress monitor to the
9791 % specified method and returns the previous progress monitor if any. The
9792 % progress monitor method looks like this:
9794 % MagickBooleanType MagickProgressMonitor(const char *text,
9795 % const MagickOffsetType offset,const MagickSizeType span,
9796 % void *client_data)
9798 % If the progress monitor returns MagickFalse, the current operation is
9801 % The format of the MagickSetImageProgressMonitor method is:
9803 % MagickProgressMonitor MagickSetImageProgressMonitor(MagickWand *wand
9804 % const MagickProgressMonitor progress_monitor,void *client_data)
9806 % A description of each parameter follows:
9808 % o wand: the magick wand.
9810 % o progress_monitor: Specifies a pointer to a method to monitor progress
9811 % of an image operation.
9813 % o client_data: Specifies a pointer to any client data.
9816 WandExport MagickProgressMonitor MagickSetImageProgressMonitor(MagickWand *wand,
9817 const MagickProgressMonitor progress_monitor,void *client_data)
9819 MagickProgressMonitor
9822 assert(wand != (MagickWand *) NULL);
9823 assert(wand->signature == WandSignature);
9824 if (wand->debug != MagickFalse)
9825 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9826 if (wand->images == (Image *) NULL)
9828 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
9829 "ContainsNoImages","`%s'",wand->name);
9830 return((MagickProgressMonitor) NULL);
9832 previous_monitor=SetImageProgressMonitor(wand->images,
9833 progress_monitor,client_data);
9834 return(previous_monitor);
9838 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9842 % M a g i c k S e t I m a g e R e d P r i m a r y %
9846 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9848 % MagickSetImageRedPrimary() sets the image chromaticity red primary point.
9850 % The format of the MagickSetImageRedPrimary method is:
9852 % MagickBooleanType MagickSetImageRedPrimary(MagickWand *wand,
9853 % const double x,const double y)
9855 % A description of each parameter follows:
9857 % o wand: the magick wand.
9859 % o x: the red primary x-point.
9861 % o y: the red primary y-point.
9864 WandExport MagickBooleanType MagickSetImageRedPrimary(MagickWand *wand,
9865 const double x,const double y)
9867 assert(wand != (MagickWand *) NULL);
9868 assert(wand->signature == WandSignature);
9869 if (wand->debug != MagickFalse)
9870 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9871 if (wand->images == (Image *) NULL)
9872 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9873 wand->images->chromaticity.red_primary.x=x;
9874 wand->images->chromaticity.red_primary.y=y;
9879 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9883 % 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 %
9887 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9889 % MagickSetImageRenderingIntent() sets the image rendering intent.
9891 % The format of the MagickSetImageRenderingIntent method is:
9893 % MagickBooleanType MagickSetImageRenderingIntent(MagickWand *wand,
9894 % const RenderingIntent rendering_intent)
9896 % A description of each parameter follows:
9898 % o wand: the magick wand.
9900 % o rendering_intent: the image rendering intent: UndefinedIntent,
9901 % SaturationIntent, PerceptualIntent, AbsoluteIntent, or RelativeIntent.
9904 WandExport MagickBooleanType MagickSetImageRenderingIntent(MagickWand *wand,
9905 const RenderingIntent rendering_intent)
9907 assert(wand != (MagickWand *) NULL);
9908 assert(wand->signature == WandSignature);
9909 if (wand->debug != MagickFalse)
9910 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9911 if (wand->images == (Image *) NULL)
9912 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9913 wand->images->rendering_intent=rendering_intent;
9918 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9922 % M a g i c k S e t I m a g e R e s o l u t i o n %
9926 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9928 % MagickSetImageResolution() sets the image resolution.
9930 % The format of the MagickSetImageResolution method is:
9932 % MagickBooleanType MagickSetImageResolution(MagickWand *wand,
9933 % const double x_resolution,const doubtl y_resolution)
9935 % A description of each parameter follows:
9937 % o wand: the magick wand.
9939 % o x_resolution: the image x resolution.
9941 % o y_resolution: the image y resolution.
9944 WandExport MagickBooleanType MagickSetImageResolution(MagickWand *wand,
9945 const double x_resolution,const double y_resolution)
9947 assert(wand != (MagickWand *) NULL);
9948 assert(wand->signature == WandSignature);
9949 if (wand->debug != MagickFalse)
9950 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9951 if (wand->images == (Image *) NULL)
9952 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9953 wand->images->resolution.x=x_resolution;
9954 wand->images->resolution.y=y_resolution;
9959 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9963 % M a g i c k S e t I m a g e S c e n e %
9967 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9969 % MagickSetImageScene() sets the image scene.
9971 % The format of the MagickSetImageScene method is:
9973 % MagickBooleanType MagickSetImageScene(MagickWand *wand,
9974 % const size_t scene)
9976 % A description of each parameter follows:
9978 % o wand: the magick wand.
9980 % o delay: the image scene number.
9983 WandExport MagickBooleanType MagickSetImageScene(MagickWand *wand,
9986 assert(wand != (MagickWand *) NULL);
9987 assert(wand->signature == WandSignature);
9988 if (wand->debug != MagickFalse)
9989 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9990 if (wand->images == (Image *) NULL)
9991 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9992 wand->images->scene=scene;
9997 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10001 % 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 %
10005 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10007 % MagickSetImageTicksPerSecond() sets the image ticks-per-second.
10009 % The format of the MagickSetImageTicksPerSecond method is:
10011 % MagickBooleanType MagickSetImageTicksPerSecond(MagickWand *wand,
10012 % const ssize_t ticks_per-second)
10014 % A description of each parameter follows:
10016 % o wand: the magick wand.
10018 % o ticks_per_second: the units to use for the image delay.
10021 WandExport MagickBooleanType MagickSetImageTicksPerSecond(MagickWand *wand,
10022 const ssize_t ticks_per_second)
10024 assert(wand != (MagickWand *) NULL);
10025 assert(wand->signature == WandSignature);
10026 if (wand->debug != MagickFalse)
10027 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10028 if (wand->images == (Image *) NULL)
10029 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10030 wand->images->ticks_per_second=ticks_per_second;
10031 return(MagickTrue);
10035 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10039 % M a g i c k S e t I m a g e T y p e %
10043 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10045 % MagickSetImageType() sets the image type.
10047 % The format of the MagickSetImageType method is:
10049 % MagickBooleanType MagickSetImageType(MagickWand *wand,
10050 % const ImageType image_type)
10052 % A description of each parameter follows:
10054 % o wand: the magick wand.
10056 % o image_type: the image type: UndefinedType, BilevelType, GrayscaleType,
10057 % GrayscaleMatteType, PaletteType, PaletteMatteType, TrueColorType,
10058 % TrueColorMatteType, ColorSeparationType, ColorSeparationMatteType,
10062 WandExport MagickBooleanType MagickSetImageType(MagickWand *wand,
10063 const ImageType image_type)
10065 assert(wand != (MagickWand *) NULL);
10066 assert(wand->signature == WandSignature);
10067 if (wand->debug != MagickFalse)
10068 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10069 if (wand->images == (Image *) NULL)
10070 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10071 return(SetImageType(wand->images,image_type,wand->exception));
10075 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10079 % M a g i c k S e t I m a g e U n i t s %
10083 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10085 % MagickSetImageUnits() sets the image units of resolution.
10087 % The format of the MagickSetImageUnits method is:
10089 % MagickBooleanType MagickSetImageUnits(MagickWand *wand,
10090 % const ResolutionType units)
10092 % A description of each parameter follows:
10094 % o wand: the magick wand.
10096 % o units: the image units of resolution : UndefinedResolution,
10097 % PixelsPerInchResolution, or PixelsPerCentimeterResolution.
10100 WandExport MagickBooleanType MagickSetImageUnits(MagickWand *wand,
10101 const ResolutionType units)
10103 assert(wand != (MagickWand *) NULL);
10104 assert(wand->signature == WandSignature);
10105 if (wand->debug != MagickFalse)
10106 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10107 if (wand->images == (Image *) NULL)
10108 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10109 wand->images->units=units;
10110 return(MagickTrue);
10114 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10118 % 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 %
10122 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10124 % MagickSetImageVirtualPixelMethod() sets the image virtual pixel method.
10126 % The format of the MagickSetImageVirtualPixelMethod method is:
10128 % VirtualPixelMethod MagickSetImageVirtualPixelMethod(MagickWand *wand,
10129 % const VirtualPixelMethod method)
10131 % A description of each parameter follows:
10133 % o wand: the magick wand.
10135 % o method: the image virtual pixel method : UndefinedVirtualPixelMethod,
10136 % ConstantVirtualPixelMethod, EdgeVirtualPixelMethod,
10137 % MirrorVirtualPixelMethod, or TileVirtualPixelMethod.
10140 WandExport VirtualPixelMethod MagickSetImageVirtualPixelMethod(MagickWand *wand,
10141 const VirtualPixelMethod method)
10143 assert(wand != (MagickWand *) NULL);
10144 assert(wand->signature == WandSignature);
10145 if (wand->debug != MagickFalse)
10146 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10147 if (wand->images == (Image *) NULL)
10148 return(UndefinedVirtualPixelMethod);
10149 return(SetImageVirtualPixelMethod(wand->images,method,wand->exception));
10153 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10157 % M a g i c k S e t I m a g e W h i t e P o i n t %
10161 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10163 % MagickSetImageWhitePoint() sets the image chromaticity white point.
10165 % The format of the MagickSetImageWhitePoint method is:
10167 % MagickBooleanType MagickSetImageWhitePoint(MagickWand *wand,
10168 % const double x,const double y)
10170 % A description of each parameter follows:
10172 % o wand: the magick wand.
10174 % o x: the white x-point.
10176 % o y: the white y-point.
10179 WandExport MagickBooleanType MagickSetImageWhitePoint(MagickWand *wand,
10180 const double x,const double y)
10182 assert(wand != (MagickWand *) NULL);
10183 assert(wand->signature == WandSignature);
10184 if (wand->debug != MagickFalse)
10185 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10186 if (wand->images == (Image *) NULL)
10187 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10188 wand->images->chromaticity.white_point.x=x;
10189 wand->images->chromaticity.white_point.y=y;
10190 return(MagickTrue);
10194 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10198 % M a g i c k S h a d e I m a g e C h a n n e l %
10202 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10204 % MagickShadeImage() shines a distant light on an image to create a
10205 % three-dimensional effect. You control the positioning of the light with
10206 % azimuth and elevation; azimuth is measured in degrees off the x axis
10207 % and elevation is measured in pixels above the Z axis.
10209 % The format of the MagickShadeImage method is:
10211 % MagickBooleanType MagickShadeImage(MagickWand *wand,
10212 % const MagickBooleanType gray,const double azimuth,
10213 % const double elevation)
10215 % A description of each parameter follows:
10217 % o wand: the magick wand.
10219 % o gray: A value other than zero shades the intensity of each pixel.
10221 % o azimuth, elevation: Define the light source direction.
10224 WandExport MagickBooleanType MagickShadeImage(MagickWand *wand,
10225 const MagickBooleanType gray,const double asimuth,const double elevation)
10230 assert(wand != (MagickWand *) NULL);
10231 assert(wand->signature == WandSignature);
10232 if (wand->debug != MagickFalse)
10233 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10234 if (wand->images == (Image *) NULL)
10235 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10236 shade_image=ShadeImage(wand->images,gray,asimuth,elevation,wand->exception);
10237 if (shade_image == (Image *) NULL)
10238 return(MagickFalse);
10239 ReplaceImageInList(&wand->images,shade_image);
10240 return(MagickTrue);
10244 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10248 % M a g i c k S h a d o w I m a g e %
10252 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10254 % MagickShadowImage() simulates an image shadow.
10256 % The format of the MagickShadowImage method is:
10258 % MagickBooleanType MagickShadowImage(MagickWand *wand,
10259 % const double alpha,const double sigma,const double bias,
10260 % const ssize_t x,const ssize_t y)
10262 % A description of each parameter follows:
10264 % o wand: the magick wand.
10266 % o alpha: percentage transparency.
10268 % o sigma: the standard deviation of the Gaussian, in pixels.
10270 % o bias: the bias.
10272 % o x: the shadow x-offset.
10274 % o y: the shadow y-offset.
10277 WandExport MagickBooleanType MagickShadowImage(MagickWand *wand,
10278 const double alpha,const double sigma,const double bias,const ssize_t x,
10284 assert(wand != (MagickWand *) NULL);
10285 assert(wand->signature == WandSignature);
10286 if (wand->debug != MagickFalse)
10287 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10288 if (wand->images == (Image *) NULL)
10289 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10290 shadow_image=ShadowImage(wand->images,alpha,sigma,bias,x,y,wand->exception);
10291 if (shadow_image == (Image *) NULL)
10292 return(MagickFalse);
10293 ReplaceImageInList(&wand->images,shadow_image);
10294 return(MagickTrue);
10298 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10302 % M a g i c k S h a r p e n I m a g e %
10306 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10308 % MagickSharpenImage() sharpens an image. We convolve the image with a
10309 % Gaussian operator of the given radius and standard deviation (sigma).
10310 % For reasonable results, the radius should be larger than sigma. Use a
10311 % radius of 0 and MagickSharpenImage() selects a suitable radius for you.
10313 % The format of the MagickSharpenImage method is:
10315 % MagickBooleanType MagickSharpenImage(MagickWand *wand,
10316 % const double radius,const double sigma,const double bias)
10318 % A description of each parameter follows:
10320 % o wand: the magick wand.
10322 % o radius: the radius of the Gaussian, in pixels, not counting the center
10325 % o sigma: the standard deviation of the Gaussian, in pixels.
10327 % o bias: the bias.
10330 WandExport MagickBooleanType MagickSharpenImage(MagickWand *wand,
10331 const double radius,const double sigma,const double bias)
10336 assert(wand != (MagickWand *) NULL);
10337 assert(wand->signature == WandSignature);
10338 if (wand->debug != MagickFalse)
10339 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10340 if (wand->images == (Image *) NULL)
10341 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10342 sharp_image=SharpenImage(wand->images,radius,sigma,bias,wand->exception);
10343 if (sharp_image == (Image *) NULL)
10344 return(MagickFalse);
10345 ReplaceImageInList(&wand->images,sharp_image);
10346 return(MagickTrue);
10350 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10354 % M a g i c k S h a v e I m a g e %
10358 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10360 % MagickShaveImage() shaves pixels from the image edges. It allocates the
10361 % memory necessary for the new Image structure and returns a pointer to the
10364 % The format of the MagickShaveImage method is:
10366 % MagickBooleanType MagickShaveImage(MagickWand *wand,
10367 % const size_t columns,const size_t rows)
10369 % A description of each parameter follows:
10371 % o wand: the magick wand.
10373 % o columns: the number of columns in the scaled image.
10375 % o rows: the number of rows in the scaled image.
10379 WandExport MagickBooleanType MagickShaveImage(MagickWand *wand,
10380 const size_t columns,const size_t rows)
10388 assert(wand != (MagickWand *) NULL);
10389 assert(wand->signature == WandSignature);
10390 if (wand->debug != MagickFalse)
10391 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10392 if (wand->images == (Image *) NULL)
10393 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10394 shave_info.width=columns;
10395 shave_info.height=rows;
10398 shave_image=ShaveImage(wand->images,&shave_info,wand->exception);
10399 if (shave_image == (Image *) NULL)
10400 return(MagickFalse);
10401 ReplaceImageInList(&wand->images,shave_image);
10402 return(MagickTrue);
10406 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10410 % M a g i c k S h e a r I m a g e %
10414 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10416 % MagickShearImage() slides one edge of an image along the X or Y axis,
10417 % creating a parallelogram. An X direction shear slides an edge along the X
10418 % axis, while a Y direction shear slides an edge along the Y axis. The amount
10419 % of the shear is controlled by a shear angle. For X direction shears, x_shear
10420 % is measured relative to the Y axis, and similarly, for Y direction shears
10421 % y_shear is measured relative to the X axis. Empty triangles left over from
10422 % shearing the image are filled with the background color.
10424 % The format of the MagickShearImage method is:
10426 % MagickBooleanType MagickShearImage(MagickWand *wand,
10427 % const PixelWand *background,const double x_shear,onst double y_shear)
10429 % A description of each parameter follows:
10431 % o wand: the magick wand.
10433 % o background: the background pixel wand.
10435 % o x_shear: the number of degrees to shear the image.
10437 % o y_shear: the number of degrees to shear the image.
10440 WandExport MagickBooleanType MagickShearImage(MagickWand *wand,
10441 const PixelWand *background,const double x_shear,const double y_shear)
10446 assert(wand != (MagickWand *) NULL);
10447 assert(wand->signature == WandSignature);
10448 if (wand->debug != MagickFalse)
10449 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10450 if (wand->images == (Image *) NULL)
10451 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10452 PixelGetQuantumPacket(background,&wand->images->background_color);
10453 shear_image=ShearImage(wand->images,x_shear,y_shear,wand->exception);
10454 if (shear_image == (Image *) NULL)
10455 return(MagickFalse);
10456 ReplaceImageInList(&wand->images,shear_image);
10457 return(MagickTrue);
10461 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10465 % 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 %
10469 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10471 % MagickSigmoidalContrastImage() adjusts the contrast of an image with a
10472 % non-linear sigmoidal contrast algorithm. Increase the contrast of the
10473 % image using a sigmoidal transfer function without saturating highlights or
10474 % shadows. Contrast indicates how much to increase the contrast (0 is none;
10475 % 3 is typical; 20 is pushing it); mid-point indicates where midtones fall in
10476 % the resultant image (0 is white; 50% is middle-gray; 100% is black). Set
10477 % sharpen to MagickTrue to increase the image contrast otherwise the contrast
10480 % The format of the MagickSigmoidalContrastImage method is:
10482 % MagickBooleanType MagickSigmoidalContrastImage(MagickWand *wand,
10483 % const MagickBooleanType sharpen,const double alpha,const double beta)
10485 % A description of each parameter follows:
10487 % o wand: the magick wand.
10489 % o sharpen: Increase or decrease image contrast.
10491 % o alpha: strength of the contrast, the larger the number the more
10492 % 'threshold-like' it becomes.
10494 % o beta: midpoint of the function as a color value 0 to QuantumRange.
10497 WandExport MagickBooleanType MagickSigmoidalContrastImage(
10498 MagickWand *wand,const MagickBooleanType sharpen,const double alpha,
10504 assert(wand != (MagickWand *) NULL);
10505 assert(wand->signature == WandSignature);
10506 if (wand->debug != MagickFalse)
10507 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10508 if (wand->images == (Image *) NULL)
10509 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10510 status=SigmoidalContrastImage(wand->images,sharpen,alpha,beta,
10516 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10520 % M a g i c k S i m i l a r i t y I m a g e %
10524 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10526 % MagickSimilarityImage() compares the reference image of the image and
10527 % returns the best match offset. In addition, it returns a similarity image
10528 % such that an exact match location is completely white and if none of the
10529 % pixels match, black, otherwise some gray level in-between.
10531 % The format of the MagickSimilarityImage method is:
10533 % MagickWand *MagickSimilarityImage(MagickWand *wand,
10534 % const MagickWand *reference,const MetricType metric,
10535 % RectangeInfo *offset,double *similarity)
10537 % A description of each parameter follows:
10539 % o wand: the magick wand.
10541 % o reference: the reference wand.
10543 % o metric: the metric.
10545 % o offset: the best match offset of the reference image within the image.
10547 % o similarity: the computed similarity between the images.
10550 WandExport MagickWand *MagickSimilarityImage(MagickWand *wand,
10551 const MagickWand *reference,const MetricType metric,RectangleInfo *offset,
10552 double *similarity)
10557 assert(wand != (MagickWand *) NULL);
10558 assert(wand->signature == WandSignature);
10559 if (wand->debug != MagickFalse)
10560 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10561 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
10563 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
10564 "ContainsNoImages","`%s'",wand->name);
10565 return((MagickWand *) NULL);
10567 similarity_image=SimilarityImage(wand->images,reference->images,metric,offset,
10568 similarity,wand->exception);
10569 if (similarity_image == (Image *) NULL)
10570 return((MagickWand *) NULL);
10571 return(CloneMagickWandFromImages(wand,similarity_image));
10575 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10579 % M a g i c k S k e t c h I m a g e %
10583 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10585 % MagickSketchImage() simulates a pencil sketch. We convolve the image with
10586 % a Gaussian operator of the given radius and standard deviation (sigma).
10587 % For reasonable results, radius should be larger than sigma. Use a
10588 % radius of 0 and SketchImage() selects a suitable radius for you.
10589 % Angle gives the angle of the blurring motion.
10591 % The format of the MagickSketchImage method is:
10593 % MagickBooleanType MagickSketchImage(MagickWand *wand,
10594 % const double radius,const double sigma,const double angle,
10595 % const double bias)
10597 % A description of each parameter follows:
10599 % o wand: the magick wand.
10601 % o radius: the radius of the Gaussian, in pixels, not counting
10602 % the center pixel.
10604 % o sigma: the standard deviation of the Gaussian, in pixels.
10606 % o angle: apply the effect along this angle.
10608 % o bias: the bias.
10611 WandExport MagickBooleanType MagickSketchImage(MagickWand *wand,
10612 const double radius,const double sigma,const double angle,const double bias)
10617 assert(wand != (MagickWand *) NULL);
10618 assert(wand->signature == WandSignature);
10619 if (wand->debug != MagickFalse)
10620 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10621 if (wand->images == (Image *) NULL)
10622 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10623 sketch_image=SketchImage(wand->images,radius,sigma,angle,bias,
10625 if (sketch_image == (Image *) NULL)
10626 return(MagickFalse);
10627 ReplaceImageInList(&wand->images,sketch_image);
10628 return(MagickTrue);
10632 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10636 % M a g i c k S m u s h I m a g e s %
10640 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10642 % MagickSmushImages() takes all images from the current image pointer to the
10643 % end of the image list and smushs them to each other top-to-bottom if the
10644 % stack parameter is true, otherwise left-to-right.
10646 % The format of the MagickSmushImages method is:
10648 % MagickWand *MagickSmushImages(MagickWand *wand,
10649 % const MagickBooleanType stack,const ssize_t offset)
10651 % A description of each parameter follows:
10653 % o wand: the magick wand.
10655 % o stack: By default, images are stacked left-to-right. Set stack to
10656 % MagickTrue to stack them top-to-bottom.
10658 % o offset: minimum distance in pixels between images.
10661 WandExport MagickWand *MagickSmushImages(MagickWand *wand,
10662 const MagickBooleanType stack,const ssize_t offset)
10667 assert(wand != (MagickWand *) NULL);
10668 assert(wand->signature == WandSignature);
10669 if (wand->debug != MagickFalse)
10670 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10671 if (wand->images == (Image *) NULL)
10672 return((MagickWand *) NULL);
10673 smush_image=SmushImages(wand->images,stack,offset,wand->exception);
10674 if (smush_image == (Image *) NULL)
10675 return((MagickWand *) NULL);
10676 return(CloneMagickWandFromImages(wand,smush_image));
10680 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10684 % M a g i c k S o l a r i z e I m a g e %
10688 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10690 % MagickSolarizeImage() applies a special effect to the image, similar to the
10691 % effect achieved in a photo darkroom by selectively exposing areas of photo
10692 % sensitive paper to light. Threshold ranges from 0 to QuantumRange and is a
10693 % measure of the extent of the solarization.
10695 % The format of the MagickSolarizeImage method is:
10697 % MagickBooleanType MagickSolarizeImage(MagickWand *wand,
10698 % const double threshold)
10700 % A description of each parameter follows:
10702 % o wand: the magick wand.
10704 % o threshold: Define the extent of the solarization.
10707 WandExport MagickBooleanType MagickSolarizeImage(MagickWand *wand,
10708 const double threshold)
10713 assert(wand != (MagickWand *) NULL);
10714 assert(wand->signature == WandSignature);
10715 if (wand->debug != MagickFalse)
10716 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10717 if (wand->images == (Image *) NULL)
10718 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10719 status=SolarizeImage(wand->images,threshold,wand->exception);
10724 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10728 % M a g i c k S p a r s e C o l o r I m a g e %
10732 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10734 % MagickSparseColorImage(), given a set of coordinates, interpolates the
10735 % colors found at those coordinates, across the whole image, using various
10738 % The format of the MagickSparseColorImage method is:
10740 % MagickBooleanType MagickSparseColorImage(MagickWand *wand,
10741 % const SparseColorMethod method,const size_t number_arguments,
10742 % const double *arguments)
10744 % A description of each parameter follows:
10746 % o image: the image to be sparseed.
10748 % o method: the method of image sparseion.
10750 % ArcSparseColorion will always ignore source image offset, and always
10751 % 'bestfit' the destination image with the top left corner offset
10752 % relative to the polar mapping center.
10754 % Bilinear has no simple inverse mapping so will not allow 'bestfit'
10755 % style of image sparseion.
10757 % Affine, Perspective, and Bilinear, will do least squares fitting of
10758 % the distrotion when more than the minimum number of control point
10759 % pairs are provided.
10761 % Perspective, and Bilinear, will fall back to a Affine sparseion when
10762 % less than 4 control point pairs are provided. While Affine sparseions
10763 % will let you use any number of control point pairs, that is Zero pairs
10764 % is a No-Op (viewport only) distrotion, one pair is a translation and
10765 % two pairs of control points will do a scale-rotate-translate, without
10768 % o number_arguments: the number of arguments given for this sparseion
10771 % o arguments: the arguments for this sparseion method.
10774 WandExport MagickBooleanType MagickSparseColorImage(MagickWand *wand,
10775 const SparseColorMethod method,const size_t number_arguments,
10776 const double *arguments)
10781 assert(wand != (MagickWand *) NULL);
10782 assert(wand->signature == WandSignature);
10783 if (wand->debug != MagickFalse)
10784 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10785 if (wand->images == (Image *) NULL)
10786 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10787 sparse_image=SparseColorImage(wand->images,method,number_arguments,arguments,
10789 if (sparse_image == (Image *) NULL)
10790 return(MagickFalse);
10791 ReplaceImageInList(&wand->images,sparse_image);
10792 return(MagickTrue);
10796 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10800 % M a g i c k S p l i c e I m a g e %
10804 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10806 % MagickSpliceImage() splices a solid color into the image.
10808 % The format of the MagickSpliceImage method is:
10810 % MagickBooleanType MagickSpliceImage(MagickWand *wand,
10811 % const size_t width,const size_t height,const ssize_t x,
10814 % A description of each parameter follows:
10816 % o wand: the magick wand.
10818 % o width: the region width.
10820 % o height: the region height.
10822 % o x: the region x offset.
10824 % o y: the region y offset.
10827 WandExport MagickBooleanType MagickSpliceImage(MagickWand *wand,
10828 const size_t width,const size_t height,const ssize_t x,
10837 assert(wand != (MagickWand *) NULL);
10838 assert(wand->signature == WandSignature);
10839 if (wand->debug != MagickFalse)
10840 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10841 if (wand->images == (Image *) NULL)
10842 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10843 splice.width=width;
10844 splice.height=height;
10847 splice_image=SpliceImage(wand->images,&splice,wand->exception);
10848 if (splice_image == (Image *) NULL)
10849 return(MagickFalse);
10850 ReplaceImageInList(&wand->images,splice_image);
10851 return(MagickTrue);
10855 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10859 % M a g i c k S p r e a d I m a g e %
10863 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10865 % MagickSpreadImage() is a special effects method that randomly displaces each
10866 % pixel in a block defined by the radius parameter.
10868 % The format of the MagickSpreadImage method is:
10870 % MagickBooleanType MagickSpreadImage(MagickWand *wand,const double radius,
10871 % const PixelInterpolateMethod method)
10873 % A description of each parameter follows:
10875 % o wand: the magick wand.
10877 % o radius: Choose a random pixel in a neighborhood of this extent.
10879 % o method: the pixel interpolation method.
10882 WandExport MagickBooleanType MagickSpreadImage(MagickWand *wand,
10883 const double radius,const PixelInterpolateMethod method)
10888 assert(wand != (MagickWand *) NULL);
10889 assert(wand->signature == WandSignature);
10890 if (wand->debug != MagickFalse)
10891 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10892 if (wand->images == (Image *) NULL)
10893 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10894 spread_image=SpreadImage(wand->images,radius,method,wand->exception);
10895 if (spread_image == (Image *) NULL)
10896 return(MagickFalse);
10897 ReplaceImageInList(&wand->images,spread_image);
10898 return(MagickTrue);
10902 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10906 % M a g i c k S t a t i s t i c I m a g e %
10910 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10912 % MagickStatisticImage() replace each pixel with corresponding statistic from
10913 % the neighborhood of the specified width and height.
10915 % The format of the MagickStatisticImage method is:
10917 % MagickBooleanType MagickStatisticImage(MagickWand *wand,
10918 % const StatisticType type,const double width,const size_t height)
10920 % A description of each parameter follows:
10922 % o wand: the magick wand.
10924 % o type: the statistic type (e.g. median, mode, etc.).
10926 % o width: the width of the pixel neighborhood.
10928 % o height: the height of the pixel neighborhood.
10931 WandExport MagickBooleanType MagickStatisticImage(MagickWand *wand,
10932 const StatisticType type,const size_t width,const size_t height)
10937 assert(wand != (MagickWand *) NULL);
10938 assert(wand->signature == WandSignature);
10939 if (wand->debug != MagickFalse)
10940 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10941 if (wand->images == (Image *) NULL)
10942 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10943 statistic_image=StatisticImage(wand->images,type,width,height,
10945 if (statistic_image == (Image *) NULL)
10946 return(MagickFalse);
10947 ReplaceImageInList(&wand->images,statistic_image);
10948 return(MagickTrue);
10952 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10956 % M a g i c k S t e g a n o I m a g e %
10960 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10962 % MagickSteganoImage() hides a digital watermark within the image.
10963 % Recover the hidden watermark later to prove that the authenticity of
10964 % an image. Offset defines the start position within the image to hide
10967 % The format of the MagickSteganoImage method is:
10969 % MagickWand *MagickSteganoImage(MagickWand *wand,
10970 % const MagickWand *watermark_wand,const ssize_t offset)
10972 % A description of each parameter follows:
10974 % o wand: the magick wand.
10976 % o watermark_wand: the watermark wand.
10978 % o offset: Start hiding at this offset into the image.
10981 WandExport MagickWand *MagickSteganoImage(MagickWand *wand,
10982 const MagickWand *watermark_wand,const ssize_t offset)
10987 assert(wand != (MagickWand *) NULL);
10988 assert(wand->signature == WandSignature);
10989 if (wand->debug != MagickFalse)
10990 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10991 if ((wand->images == (Image *) NULL) ||
10992 (watermark_wand->images == (Image *) NULL))
10994 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
10995 "ContainsNoImages","`%s'",wand->name);
10996 return((MagickWand *) NULL);
10998 wand->images->offset=offset;
10999 stegano_image=SteganoImage(wand->images,watermark_wand->images,
11001 if (stegano_image == (Image *) NULL)
11002 return((MagickWand *) NULL);
11003 return(CloneMagickWandFromImages(wand,stegano_image));
11007 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11011 % M a g i c k S t e r e o I m a g e %
11015 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11017 % MagickStereoImage() composites two images and produces a single image that
11018 % is the composite of a left and right image of a stereo pair
11020 % The format of the MagickStereoImage method is:
11022 % MagickWand *MagickStereoImage(MagickWand *wand,
11023 % const MagickWand *offset_wand)
11025 % A description of each parameter follows:
11027 % o wand: the magick wand.
11029 % o offset_wand: Another image wand.
11032 WandExport MagickWand *MagickStereoImage(MagickWand *wand,
11033 const MagickWand *offset_wand)
11038 assert(wand != (MagickWand *) NULL);
11039 assert(wand->signature == WandSignature);
11040 if (wand->debug != MagickFalse)
11041 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11042 if ((wand->images == (Image *) NULL) ||
11043 (offset_wand->images == (Image *) NULL))
11045 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
11046 "ContainsNoImages","`%s'",wand->name);
11047 return((MagickWand *) NULL);
11049 stereo_image=StereoImage(wand->images,offset_wand->images,wand->exception);
11050 if (stereo_image == (Image *) NULL)
11051 return((MagickWand *) NULL);
11052 return(CloneMagickWandFromImages(wand,stereo_image));
11056 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11060 % M a g i c k S t r i p I m a g e %
11064 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11066 % MagickStripImage() strips an image of all profiles and comments.
11068 % The format of the MagickStripImage method is:
11070 % MagickBooleanType MagickStripImage(MagickWand *wand)
11072 % A description of each parameter follows:
11074 % o wand: the magick wand.
11077 WandExport MagickBooleanType MagickStripImage(MagickWand *wand)
11079 assert(wand != (MagickWand *) NULL);
11080 assert(wand->signature == WandSignature);
11081 if (wand->debug != MagickFalse)
11082 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11083 if (wand->images == (Image *) NULL)
11084 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11085 return(StripImage(wand->images,wand->exception));
11089 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11093 % M a g i c k S w i r l I m a g e %
11097 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11099 % MagickSwirlImage() swirls the pixels about the center of the image, where
11100 % degrees indicates the sweep of the arc through which each pixel is moved.
11101 % You get a more dramatic effect as the degrees move from 1 to 360.
11103 % The format of the MagickSwirlImage method is:
11105 % MagickBooleanType MagickSwirlImage(MagickWand *wand,const double degrees,
11106 % const PixelInterpolateMethod method)
11108 % A description of each parameter follows:
11110 % o wand: the magick wand.
11112 % o degrees: Define the tightness of the swirling effect.
11114 % o method: the pixel interpolation method.
11117 WandExport MagickBooleanType MagickSwirlImage(MagickWand *wand,
11118 const double degrees,const PixelInterpolateMethod method)
11123 assert(wand != (MagickWand *) NULL);
11124 assert(wand->signature == WandSignature);
11125 if (wand->debug != MagickFalse)
11126 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11127 if (wand->images == (Image *) NULL)
11128 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11129 swirl_image=SwirlImage(wand->images,degrees,method,wand->exception);
11130 if (swirl_image == (Image *) NULL)
11131 return(MagickFalse);
11132 ReplaceImageInList(&wand->images,swirl_image);
11133 return(MagickTrue);
11137 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11141 % M a g i c k T e x t u r e I m a g e %
11145 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11147 % MagickTextureImage() repeatedly tiles the texture image across and down the
11150 % The format of the MagickTextureImage method is:
11152 % MagickWand *MagickTextureImage(MagickWand *wand,
11153 % const MagickWand *texture_wand)
11155 % A description of each parameter follows:
11157 % o wand: the magick wand.
11159 % o texture_wand: the texture wand
11162 WandExport MagickWand *MagickTextureImage(MagickWand *wand,
11163 const MagickWand *texture_wand)
11171 assert(wand != (MagickWand *) NULL);
11172 assert(wand->signature == WandSignature);
11173 if (wand->debug != MagickFalse)
11174 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11175 if ((wand->images == (Image *) NULL) ||
11176 (texture_wand->images == (Image *) NULL))
11178 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
11179 "ContainsNoImages","`%s'",wand->name);
11180 return((MagickWand *) NULL);
11182 texture_image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
11183 if (texture_image == (Image *) NULL)
11184 return((MagickWand *) NULL);
11185 status=TextureImage(texture_image,texture_wand->images,wand->exception);
11186 if (status == MagickFalse)
11188 texture_image=DestroyImage(texture_image);
11189 return((MagickWand *) NULL);
11191 return(CloneMagickWandFromImages(wand,texture_image));
11195 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11199 % M a g i c k T h r e s h o l d I m a g e %
11203 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11205 % MagickThresholdImage() changes the value of individual pixels based on
11206 % the intensity of each pixel compared to threshold. The result is a
11207 % high-contrast, two color image.
11209 % The format of the MagickThresholdImage method is:
11211 % MagickBooleanType MagickThresholdImage(MagickWand *wand,
11212 % const double threshold)
11213 % MagickBooleanType MagickThresholdImageChannel(MagickWand *wand,
11214 % const ChannelType channel,const double threshold)
11216 % A description of each parameter follows:
11218 % o wand: the magick wand.
11220 % o channel: the image channel(s).
11222 % o threshold: Define the threshold value.
11225 WandExport MagickBooleanType MagickThresholdImage(MagickWand *wand,
11226 const double threshold)
11231 status=MagickThresholdImageChannel(wand,DefaultChannels,threshold);
11235 WandExport MagickBooleanType MagickThresholdImageChannel(MagickWand *wand,
11236 const ChannelType channel,const double threshold)
11241 assert(wand != (MagickWand *) NULL);
11242 assert(wand->signature == WandSignature);
11243 if (wand->debug != MagickFalse)
11244 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11245 if (wand->images == (Image *) NULL)
11246 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11247 status=BilevelImage(wand->images,threshold,wand->exception);
11252 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11256 % M a g i c k T h u m b n a i l I m a g e %
11260 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11262 % MagickThumbnailImage() changes the size of an image to the given dimensions
11263 % and removes any associated profiles. The goal is to produce small low cost
11264 % thumbnail images suited for display on the Web.
11266 % The format of the MagickThumbnailImage method is:
11268 % MagickBooleanType MagickThumbnailImage(MagickWand *wand,
11269 % const size_t columns,const size_t rows)
11271 % A description of each parameter follows:
11273 % o wand: the magick wand.
11275 % o columns: the number of columns in the scaled image.
11277 % o rows: the number of rows in the scaled image.
11280 WandExport MagickBooleanType MagickThumbnailImage(MagickWand *wand,
11281 const size_t columns,const size_t rows)
11286 assert(wand != (MagickWand *) NULL);
11287 assert(wand->signature == WandSignature);
11288 if (wand->debug != MagickFalse)
11289 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11290 if (wand->images == (Image *) NULL)
11291 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11292 thumbnail_image=ThumbnailImage(wand->images,columns,rows,wand->exception);
11293 if (thumbnail_image == (Image *) NULL)
11294 return(MagickFalse);
11295 ReplaceImageInList(&wand->images,thumbnail_image);
11296 return(MagickTrue);
11300 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11304 % M a g i c k T i n t I m a g e %
11308 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11310 % MagickTintImage() applies a color vector to each pixel in the image. The
11311 % length of the vector is 0 for black and white and at its maximum for the
11312 % midtones. The vector weighting function is
11313 % f(x)=(1-(4.0*((x-0.5)*(x-0.5)))).
11315 % The format of the MagickTintImage method is:
11317 % MagickBooleanType MagickTintImage(MagickWand *wand,
11318 % const PixelWand *tint,const PixelWand *blend)
11320 % A description of each parameter follows:
11322 % o wand: the magick wand.
11324 % o tint: the tint pixel wand.
11326 % o alpha: the alpha pixel wand.
11329 WandExport MagickBooleanType MagickTintImage(MagickWand *wand,
11330 const PixelWand *tint,const PixelWand *blend)
11333 percent_blend[MaxTextExtent];
11341 assert(wand != (MagickWand *) NULL);
11342 assert(wand->signature == WandSignature);
11343 if (wand->debug != MagickFalse)
11344 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11345 if (wand->images == (Image *) NULL)
11346 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11347 if (wand->images->colorspace != CMYKColorspace)
11348 (void) FormatLocaleString(percent_blend,MaxTextExtent,
11349 "%g,%g,%g,%g",(double) (100.0*QuantumScale*
11350 PixelGetRedQuantum(blend)),(double) (100.0*QuantumScale*
11351 PixelGetGreenQuantum(blend)),(double) (100.0*QuantumScale*
11352 PixelGetBlueQuantum(blend)),(double) (100.0*QuantumScale*
11353 PixelGetAlphaQuantum(blend)));
11355 (void) FormatLocaleString(percent_blend,MaxTextExtent,
11356 "%g,%g,%g,%g,%g",(double) (100.0*QuantumScale*
11357 PixelGetCyanQuantum(blend)),(double) (100.0*QuantumScale*
11358 PixelGetMagentaQuantum(blend)),(double) (100.0*QuantumScale*
11359 PixelGetYellowQuantum(blend)),(double) (100.0*QuantumScale*
11360 PixelGetBlackQuantum(blend)),(double) (100.0*QuantumScale*
11361 PixelGetAlphaQuantum(blend)));
11362 target=PixelGetPixel(tint);
11363 tint_image=TintImage(wand->images,percent_blend,&target,wand->exception);
11364 if (tint_image == (Image *) NULL)
11365 return(MagickFalse);
11366 ReplaceImageInList(&wand->images,tint_image);
11367 return(MagickTrue);
11371 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11375 % M a g i c k T r a n s f o r m I m a g e %
11379 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11381 % MagickTransformImage() is a convenience method that behaves like
11382 % MagickResizeImage() or MagickCropImage() but accepts scaling and/or cropping
11383 % information as a region geometry specification. If the operation fails,
11384 % a NULL image handle is returned.
11386 % The format of the MagickTransformImage method is:
11388 % MagickWand *MagickTransformImage(MagickWand *wand,const char *crop,
11389 % const char *geometry)
11391 % A description of each parameter follows:
11393 % o wand: the magick wand.
11395 % o crop: A crop geometry string. This geometry defines a subregion of the
11398 % o geometry: An image geometry string. This geometry defines the final
11399 % size of the image.
11402 WandExport MagickWand *MagickTransformImage(MagickWand *wand,
11403 const char *crop,const char *geometry)
11411 assert(wand != (MagickWand *) NULL);
11412 assert(wand->signature == WandSignature);
11413 if (wand->debug != MagickFalse)
11414 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11415 if (wand->images == (Image *) NULL)
11416 return((MagickWand *) NULL);
11417 transform_image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
11418 if (transform_image == (Image *) NULL)
11419 return((MagickWand *) NULL);
11420 status=TransformImage(&transform_image,crop,geometry,wand->exception);
11421 if (status == MagickFalse)
11423 transform_image=DestroyImage(transform_image);
11424 return((MagickWand *) NULL);
11426 return(CloneMagickWandFromImages(wand,transform_image));
11430 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11434 % 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 %
11438 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11440 % MagickTransformImageColorspace() transform the image colorspace.
11442 % The format of the MagickTransformImageColorspace method is:
11444 % MagickBooleanType MagickTransformImageColorspace(MagickWand *wand,
11445 % const ColorspaceType colorspace)
11447 % A description of each parameter follows:
11449 % o wand: the magick wand.
11451 % o colorspace: the image colorspace: UndefinedColorspace, RGBColorspace,
11452 % GRAYColorspace, TransparentColorspace, OHTAColorspace, XYZColorspace,
11453 % YCbCrColorspace, YCCColorspace, YIQColorspace, YPbPrColorspace,
11454 % YPbPrColorspace, YUVColorspace, CMYKColorspace, sRGBColorspace,
11455 % HSLColorspace, or HWBColorspace.
11458 WandExport MagickBooleanType MagickTransformImageColorspace(MagickWand *wand,
11459 const ColorspaceType colorspace)
11461 assert(wand != (MagickWand *) NULL);
11462 assert(wand->signature == WandSignature);
11463 if (wand->debug != MagickFalse)
11464 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11465 if (wand->images == (Image *) NULL)
11466 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11467 return(TransformImageColorspace(wand->images,colorspace,wand->exception));
11471 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11475 % 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 %
11479 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11481 % MagickTransparentPaintImage() changes any pixel that matches color with the
11482 % color defined by fill.
11484 % The format of the MagickTransparentPaintImage method is:
11486 % MagickBooleanType MagickTransparentPaintImage(MagickWand *wand,
11487 % const PixelWand *target,const double alpha,const double fuzz,
11488 % const MagickBooleanType invert)
11490 % A description of each parameter follows:
11492 % o wand: the magick wand.
11494 % o target: Change this target color to specified alpha value within
11497 % o alpha: the level of transparency: 1.0 is fully opaque and 0.0 is fully
11500 % o fuzz: By default target must match a particular pixel color
11501 % exactly. However, in many cases two colors may differ by a small amount.
11502 % The fuzz member of image defines how much tolerance is acceptable to
11503 % consider two colors as the same. For example, set fuzz to 10 and the
11504 % color red at intensities of 100 and 102 respectively are now interpreted
11505 % as the same color for the purposes of the floodfill.
11507 % o invert: paint any pixel that does not match the target color.
11510 WandExport MagickBooleanType MagickTransparentPaintImage(MagickWand *wand,
11511 const PixelWand *target,const double alpha,const double fuzz,
11512 const MagickBooleanType invert)
11520 assert(wand != (MagickWand *) NULL);
11521 assert(wand->signature == WandSignature);
11522 if (wand->debug != MagickFalse)
11523 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11524 if (wand->images == (Image *) NULL)
11525 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11526 PixelGetMagickColor(target,&target_pixel);
11527 wand->images->fuzz=fuzz;
11528 status=TransparentPaintImage(wand->images,&target_pixel,ClampToQuantum(
11529 QuantumRange*alpha),invert,wand->exception);
11534 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11538 % M a g i c k T r a n s p o s e I m a g e %
11542 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11544 % MagickTransposeImage() creates a vertical mirror image by reflecting the
11545 % pixels around the central x-axis while rotating them 90-degrees.
11547 % The format of the MagickTransposeImage method is:
11549 % MagickBooleanType MagickTransposeImage(MagickWand *wand)
11551 % A description of each parameter follows:
11553 % o wand: the magick wand.
11556 WandExport MagickBooleanType MagickTransposeImage(MagickWand *wand)
11561 assert(wand != (MagickWand *) NULL);
11562 assert(wand->signature == WandSignature);
11563 if (wand->debug != MagickFalse)
11564 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11565 if (wand->images == (Image *) NULL)
11566 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11567 transpose_image=TransposeImage(wand->images,wand->exception);
11568 if (transpose_image == (Image *) NULL)
11569 return(MagickFalse);
11570 ReplaceImageInList(&wand->images,transpose_image);
11571 return(MagickTrue);
11575 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11579 % M a g i c k T r a n s v e r s e I m a g e %
11583 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11585 % MagickTransverseImage() creates a horizontal mirror image by reflecting the
11586 % pixels around the central y-axis while rotating them 270-degrees.
11588 % The format of the MagickTransverseImage method is:
11590 % MagickBooleanType MagickTransverseImage(MagickWand *wand)
11592 % A description of each parameter follows:
11594 % o wand: the magick wand.
11597 WandExport MagickBooleanType MagickTransverseImage(MagickWand *wand)
11602 assert(wand != (MagickWand *) NULL);
11603 assert(wand->signature == WandSignature);
11604 if (wand->debug != MagickFalse)
11605 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11606 if (wand->images == (Image *) NULL)
11607 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11608 transverse_image=TransverseImage(wand->images,wand->exception);
11609 if (transverse_image == (Image *) NULL)
11610 return(MagickFalse);
11611 ReplaceImageInList(&wand->images,transverse_image);
11612 return(MagickTrue);
11616 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11620 % M a g i c k T r i m I m a g e %
11624 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11626 % MagickTrimImage() remove edges that are the background color from the image.
11628 % The format of the MagickTrimImage method is:
11630 % MagickBooleanType MagickTrimImage(MagickWand *wand,const double fuzz)
11632 % A description of each parameter follows:
11634 % o wand: the magick wand.
11636 % o fuzz: By default target must match a particular pixel color
11637 % exactly. However, in many cases two colors may differ by a small amount.
11638 % The fuzz member of image defines how much tolerance is acceptable to
11639 % consider two colors as the same. For example, set fuzz to 10 and the
11640 % color red at intensities of 100 and 102 respectively are now interpreted
11641 % as the same color for the purposes of the floodfill.
11644 WandExport MagickBooleanType MagickTrimImage(MagickWand *wand,const double fuzz)
11649 assert(wand != (MagickWand *) NULL);
11650 assert(wand->signature == WandSignature);
11651 if (wand->debug != MagickFalse)
11652 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11653 if (wand->images == (Image *) NULL)
11654 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11655 wand->images->fuzz=fuzz;
11656 trim_image=TrimImage(wand->images,wand->exception);
11657 if (trim_image == (Image *) NULL)
11658 return(MagickFalse);
11659 ReplaceImageInList(&wand->images,trim_image);
11660 return(MagickTrue);
11664 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11668 % M a g i c k U n i q u e I m a g e C o l o r s %
11672 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11674 % MagickUniqueImageColors() discards all but one of any pixel color.
11676 % The format of the MagickUniqueImageColors method is:
11678 % MagickBooleanType MagickUniqueImageColors(MagickWand *wand)
11680 % A description of each parameter follows:
11682 % o wand: the magick wand.
11685 WandExport MagickBooleanType MagickUniqueImageColors(MagickWand *wand)
11690 assert(wand != (MagickWand *) NULL);
11691 assert(wand->signature == WandSignature);
11692 if (wand->debug != MagickFalse)
11693 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11694 if (wand->images == (Image *) NULL)
11695 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11696 unique_image=UniqueImageColors(wand->images,wand->exception);
11697 if (unique_image == (Image *) NULL)
11698 return(MagickFalse);
11699 ReplaceImageInList(&wand->images,unique_image);
11700 return(MagickTrue);
11704 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11708 % M a g i c k U n s h a r p M a s k I m a g e %
11712 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11714 % MagickUnsharpMaskImage() sharpens an image. We convolve the image with a
11715 % Gaussian operator of the given radius and standard deviation (sigma).
11716 % For reasonable results, radius should be larger than sigma. Use a radius
11717 % of 0 and UnsharpMaskImage() selects a suitable radius for you.
11719 % The format of the MagickUnsharpMaskImage method is:
11721 % MagickBooleanType MagickUnsharpMaskImage(MagickWand *wand,
11722 % const double radius,const double sigma,const double amount,
11723 % const double threshold)
11725 % A description of each parameter follows:
11727 % o wand: the magick wand.
11729 % o radius: the radius of the Gaussian, in pixels, not counting the center
11732 % o sigma: the standard deviation of the Gaussian, in pixels.
11734 % o amount: the percentage of the difference between the original and the
11735 % blur image that is added back into the original.
11737 % o threshold: the threshold in pixels needed to apply the diffence amount.
11740 WandExport MagickBooleanType MagickUnsharpMaskImage(MagickWand *wand,
11741 const double radius,const double sigma,const double amount,
11742 const double threshold)
11747 assert(wand != (MagickWand *) NULL);
11748 assert(wand->signature == WandSignature);
11749 if (wand->debug != MagickFalse)
11750 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11751 if (wand->images == (Image *) NULL)
11752 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11753 unsharp_image=UnsharpMaskImage(wand->images,radius,sigma,amount,threshold,
11755 if (unsharp_image == (Image *) NULL)
11756 return(MagickFalse);
11757 ReplaceImageInList(&wand->images,unsharp_image);
11758 return(MagickTrue);
11762 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11766 % M a g i c k V i g n e t t e I m a g e %
11770 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11772 % MagickVignetteImage() softens the edges of the image in vignette style.
11774 % The format of the MagickVignetteImage method is:
11776 % MagickBooleanType MagickVignetteImage(MagickWand *wand,
11777 % const double radius,const double sigma,const double bias,
11778 % const ssize_t x,const ssize_t y)
11780 % A description of each parameter follows:
11782 % o wand: the magick wand.
11784 % o radius: the radius.
11786 % o sigma: the sigma.
11788 % o bias: the bias.
11790 % o x, y: Define the x and y ellipse offset.
11793 WandExport MagickBooleanType MagickVignetteImage(MagickWand *wand,
11794 const double radius,const double sigma,const double bias,const ssize_t x,
11800 assert(wand != (MagickWand *) NULL);
11801 assert(wand->signature == WandSignature);
11802 if (wand->debug != MagickFalse)
11803 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11804 if (wand->images == (Image *) NULL)
11805 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11806 vignette_image=VignetteImage(wand->images,radius,sigma,bias,x,y,
11808 if (vignette_image == (Image *) NULL)
11809 return(MagickFalse);
11810 ReplaceImageInList(&wand->images,vignette_image);
11811 return(MagickTrue);
11815 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11819 % M a g i c k W a v e I m a g e %
11823 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11825 % MagickWaveImage() creates a "ripple" effect in the image by shifting
11826 % the pixels vertically along a sine wave whose amplitude and wavelength
11827 % is specified by the given parameters.
11829 % The format of the MagickWaveImage method is:
11831 % MagickBooleanType MagickWaveImage(MagickWand *wand,
11832 % const double amplitude,const double wave_length,
11833 % const PixelInterpolateMethod method)
11835 % A description of each parameter follows:
11837 % o wand: the magick wand.
11839 % o amplitude, wave_length: Define the amplitude and wave length of the
11842 % o method: the pixel interpolation method.
11845 WandExport MagickBooleanType MagickWaveImage(MagickWand *wand,
11846 const double amplitude,const double wave_length,
11847 const PixelInterpolateMethod method)
11852 assert(wand != (MagickWand *) NULL);
11853 assert(wand->signature == WandSignature);
11854 if (wand->debug != MagickFalse)
11855 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11856 if (wand->images == (Image *) NULL)
11857 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11858 wave_image=WaveImage(wand->images,amplitude,wave_length,method,
11860 if (wave_image == (Image *) NULL)
11861 return(MagickFalse);
11862 ReplaceImageInList(&wand->images,wave_image);
11863 return(MagickTrue);
11867 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11871 % 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 %
11875 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11877 % MagickWhiteThresholdImage() is like ThresholdImage() but force all pixels
11878 % above the threshold into white while leaving all pixels below the threshold
11881 % The format of the MagickWhiteThresholdImage method is:
11883 % MagickBooleanType MagickWhiteThresholdImage(MagickWand *wand,
11884 % const PixelWand *threshold)
11886 % A description of each parameter follows:
11888 % o wand: the magick wand.
11890 % o threshold: the pixel wand.
11893 WandExport MagickBooleanType MagickWhiteThresholdImage(MagickWand *wand,
11894 const PixelWand *threshold)
11897 thresholds[MaxTextExtent];
11899 assert(wand != (MagickWand *) NULL);
11900 assert(wand->signature == WandSignature);
11901 if (wand->debug != MagickFalse)
11902 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11903 if (wand->images == (Image *) NULL)
11904 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11905 (void) FormatLocaleString(thresholds,MaxTextExtent,
11906 QuantumFormat "," QuantumFormat "," QuantumFormat "," QuantumFormat,
11907 PixelGetRedQuantum(threshold),PixelGetGreenQuantum(threshold),
11908 PixelGetBlueQuantum(threshold),PixelGetAlphaQuantum(threshold));
11909 return(WhiteThresholdImage(wand->images,thresholds,wand->exception));
11913 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11917 % M a g i c k W r i t e I m a g e %
11921 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11923 % MagickWriteImage() writes an image to the specified filename. If the
11924 % filename parameter is NULL, the image is written to the filename set
11925 % by MagickReadImage() or MagickSetImageFilename().
11927 % The format of the MagickWriteImage method is:
11929 % MagickBooleanType MagickWriteImage(MagickWand *wand,
11930 % const char *filename)
11932 % A description of each parameter follows:
11934 % o wand: the magick wand.
11936 % o filename: the image filename.
11940 WandExport MagickBooleanType MagickWriteImage(MagickWand *wand,
11941 const char *filename)
11952 assert(wand != (MagickWand *) NULL);
11953 assert(wand->signature == WandSignature);
11954 if (wand->debug != MagickFalse)
11955 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11956 if (wand->images == (Image *) NULL)
11957 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11958 if (filename != (const char *) NULL)
11959 (void) CopyMagickString(wand->images->filename,filename,MaxTextExtent);
11960 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
11961 if (image == (Image *) NULL)
11962 return(MagickFalse);
11963 write_info=CloneImageInfo(wand->image_info);
11964 write_info->adjoin=MagickTrue;
11965 status=WriteImage(write_info,image,wand->exception);
11966 image=DestroyImage(image);
11967 write_info=DestroyImageInfo(write_info);
11972 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11976 % M a g i c k W r i t e I m a g e F i l e %
11980 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11982 % MagickWriteImageFile() writes an image to an open file descriptor.
11984 % The format of the MagickWriteImageFile method is:
11986 % MagickBooleanType MagickWriteImageFile(MagickWand *wand,FILE *file)
11988 % A description of each parameter follows:
11990 % o wand: the magick wand.
11992 % o file: the file descriptor.
11995 WandExport MagickBooleanType MagickWriteImageFile(MagickWand *wand,FILE *file)
12006 assert(wand != (MagickWand *) NULL);
12007 assert(wand->signature == WandSignature);
12008 assert(file != (FILE *) NULL);
12009 if (wand->debug != MagickFalse)
12010 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12011 if (wand->images == (Image *) NULL)
12012 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12013 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
12014 if (image == (Image *) NULL)
12015 return(MagickFalse);
12016 write_info=CloneImageInfo(wand->image_info);
12017 SetImageInfoFile(write_info,file);
12018 write_info->adjoin=MagickTrue;
12019 status=WriteImage(write_info,image,wand->exception);
12020 write_info=DestroyImageInfo(write_info);
12021 image=DestroyImage(image);
12026 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12030 % M a g i c k W r i t e I m a g e s %
12034 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12036 % MagickWriteImages() writes an image or image sequence.
12038 % The format of the MagickWriteImages method is:
12040 % MagickBooleanType MagickWriteImages(MagickWand *wand,
12041 % const char *filename,const MagickBooleanType adjoin)
12043 % A description of each parameter follows:
12045 % o wand: the magick wand.
12047 % o filename: the image filename.
12049 % o adjoin: join images into a single multi-image file.
12052 WandExport MagickBooleanType MagickWriteImages(MagickWand *wand,
12053 const char *filename,const MagickBooleanType adjoin)
12061 assert(wand != (MagickWand *) NULL);
12062 assert(wand->signature == WandSignature);
12063 if (wand->debug != MagickFalse)
12064 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12065 if (wand->images == (Image *) NULL)
12066 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12067 write_info=CloneImageInfo(wand->image_info);
12068 write_info->adjoin=adjoin;
12069 status=WriteImages(write_info,wand->images,filename,wand->exception);
12070 write_info=DestroyImageInfo(write_info);
12075 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12079 % M a g i c k W r i t e I m a g e s F i l e %
12083 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12085 % MagickWriteImagesFile() writes an image sequence to an open file descriptor.
12087 % The format of the MagickWriteImagesFile method is:
12089 % MagickBooleanType MagickWriteImagesFile(MagickWand *wand,FILE *file)
12091 % A description of each parameter follows:
12093 % o wand: the magick wand.
12095 % o file: the file descriptor.
12098 WandExport MagickBooleanType MagickWriteImagesFile(MagickWand *wand,FILE *file)
12106 assert(wand != (MagickWand *) NULL);
12107 assert(wand->signature == WandSignature);
12108 if (wand->debug != MagickFalse)
12109 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12110 if (wand->images == (Image *) NULL)
12111 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12112 write_info=CloneImageInfo(wand->image_info);
12113 SetImageInfoFile(write_info,file);
12114 write_info->adjoin=MagickTrue;
12115 status=WriteImages(write_info,wand->images,(const char *) NULL,
12117 write_info=DestroyImageInfo(write_info);