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-2013 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 (IfMagickTrue(wand->debug))
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 clone_wand->signature=WandSignature;
116 if (IfMagickTrue(clone_wand->debug))
117 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",clone_wand->name);
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 (IfMagickTrue(wand->debug))
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)
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.
191 WandExport MagickBooleanType MagickAdaptiveBlurImage(MagickWand *wand,
192 const double radius,const double sigma)
197 assert(wand != (MagickWand *) NULL);
198 assert(wand->signature == WandSignature);
199 if (IfMagickTrue(wand->debug))
200 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
201 if (wand->images == (Image *) NULL)
202 ThrowWandException(WandError,"ContainsNoImages",wand->name);
203 sharp_image=AdaptiveBlurImage(wand->images,radius,sigma,wand->exception);
204 if (sharp_image == (Image *) NULL)
206 ReplaceImageInList(&wand->images,sharp_image);
211 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
215 % 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 %
219 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
221 % MagickAdaptiveResizeImage() adaptively resize image with data dependent
224 % MagickBooleanType MagickAdaptiveResizeImage(MagickWand *wand,
225 % const size_t columns,const size_t rows)
227 % A description of each parameter follows:
229 % o wand: the magick wand.
231 % o columns: the number of columns in the scaled image.
233 % o rows: the number of rows in the scaled image.
236 WandExport MagickBooleanType MagickAdaptiveResizeImage(MagickWand *wand,
237 const size_t columns,const size_t rows)
242 assert(wand != (MagickWand *) NULL);
243 assert(wand->signature == WandSignature);
244 if (IfMagickTrue(wand->debug))
245 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
246 if (wand->images == (Image *) NULL)
247 ThrowWandException(WandError,"ContainsNoImages",wand->name);
248 resize_image=AdaptiveResizeImage(wand->images,columns,rows,wand->exception);
249 if (resize_image == (Image *) NULL)
251 ReplaceImageInList(&wand->images,resize_image);
256 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
260 % 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 %
264 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
266 % MagickAdaptiveSharpenImage() adaptively sharpens the image by sharpening
267 % more intensely near image edges and less intensely far from edges. We
268 % sharpen the image with a Gaussian operator of the given radius and standard
269 % deviation (sigma). For reasonable results, radius should be larger than
270 % sigma. Use a radius of 0 and MagickAdaptiveSharpenImage() selects a
271 % suitable radius for you.
273 % The format of the MagickAdaptiveSharpenImage method is:
275 % MagickBooleanType MagickAdaptiveSharpenImage(MagickWand *wand,
276 % const double radius,const double sigma)
278 % A description of each parameter follows:
280 % o wand: the magick wand.
282 % o radius: the radius of the Gaussian, in pixels, not counting the center
285 % o sigma: the standard deviation of the Gaussian, in pixels.
288 WandExport MagickBooleanType MagickAdaptiveSharpenImage(MagickWand *wand,
289 const double radius,const double sigma)
294 assert(wand != (MagickWand *) NULL);
295 assert(wand->signature == WandSignature);
296 if (IfMagickTrue(wand->debug))
297 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
298 if (wand->images == (Image *) NULL)
299 ThrowWandException(WandError,"ContainsNoImages",wand->name);
300 sharp_image=AdaptiveSharpenImage(wand->images,radius,sigma,wand->exception);
301 if (sharp_image == (Image *) NULL)
303 ReplaceImageInList(&wand->images,sharp_image);
308 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
312 % 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 %
316 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
318 % MagickAdaptiveThresholdImage() selects an individual threshold for each pixel
319 % based on the range of intensity values in its local neighborhood. This
320 % allows for thresholding of an image whose global intensity histogram
321 % doesn't contain distinctive peaks.
323 % The format of the AdaptiveThresholdImage method is:
325 % MagickBooleanType MagickAdaptiveThresholdImage(MagickWand *wand,
326 % const size_t width,const size_t height,const double bias)
328 % A description of each parameter follows:
330 % o wand: the magick wand.
332 % o width: the width of the local neighborhood.
334 % o height: the height of the local neighborhood.
336 % o offset: the mean bias.
339 WandExport MagickBooleanType MagickAdaptiveThresholdImage(MagickWand *wand,
340 const size_t width,const size_t height,const double bias)
345 assert(wand != (MagickWand *) NULL);
346 assert(wand->signature == WandSignature);
347 if (IfMagickTrue(wand->debug))
348 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
349 if (wand->images == (Image *) NULL)
350 ThrowWandException(WandError,"ContainsNoImages",wand->name);
351 threshold_image=AdaptiveThresholdImage(wand->images,width,height,bias,
353 if (threshold_image == (Image *) NULL)
355 ReplaceImageInList(&wand->images,threshold_image);
360 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
364 % M a g i c k A d d I m a g e %
368 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
370 % MagickAddImage() adds a clone of the images from the second wand and
371 % inserts them into the first wand.
373 % Use MagickSetLastIterator(), to append new images into an existing wand,
374 % current image will be set to last image so later adds with also be
375 % appened to end of wand.
377 % Use MagickSetFirstIterator() to prepend new images into wand, any more
378 % images added will also be prepended before other images in the wand.
379 % However the order of a list of new images will not change.
381 % Otherwise the new images will be inserted just after the current image,
382 % and any later image will also be added after this current image but
383 % before the previously added images. Caution is advised when multiple
384 % image adds are inserted into the middle of the wand image list.
386 % The format of the MagickAddImage method is:
388 % MagickBooleanType MagickAddImage(MagickWand *wand,
389 % const MagickWand *add_wand)
391 % A description of each parameter follows:
393 % o wand: the magick wand.
395 % o add_wand: A wand that contains the image list to be added
398 static inline MagickBooleanType InsertImageInWand(MagickWand *wand,
401 if (wand->images == (Image *) NULL)
404 No images in wand, just add them, set current as appropriate.
406 if (IfMagickTrue(wand->insert_before))
407 wand->images=GetFirstImageInList(images);
409 wand->images=GetLastImageInList(images);
412 /* user jumped to first image, so prepend new images - remain active */
413 if (IfMagickTrue((wand->insert_before)) &&
414 (wand->images->previous == (Image *) NULL))
416 PrependImageToList(&wand->images,images);
417 wand->images=GetFirstImageInList(images);
421 Note you should never have 'insert_before' true when current image is not
422 the first image in the wand! That is no insert before current image, only
425 if (wand->images->next == (Image *) NULL)
428 At last image, append new images.
430 InsertImageInList(&wand->images,images);
431 wand->images=GetLastImageInList(images);
435 Insert new images, just after the current image.
437 InsertImageInList(&wand->images,images);
441 WandExport MagickBooleanType MagickAddImage(MagickWand *wand,
442 const MagickWand *add_wand)
447 assert(wand != (MagickWand *) NULL);
448 assert(wand->signature == WandSignature);
449 if (IfMagickTrue(wand->debug))
450 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
451 assert(add_wand != (MagickWand *) NULL);
452 assert(add_wand->signature == WandSignature);
453 if (add_wand->images == (Image *) NULL)
454 ThrowWandException(WandError,"ContainsNoImages",add_wand->name);
456 Clone images in second wand, and insert into first.
458 images=CloneImageList(add_wand->images,wand->exception);
459 if (images == (Image *) NULL)
461 return(InsertImageInWand(wand,images));
465 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
469 % M a g i c k A d d N o i s e I m a g e %
473 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
475 % MagickAddNoiseImage() adds random noise to the image.
477 % The format of the MagickAddNoiseImage method is:
479 % MagickBooleanType MagickAddNoiseImage(MagickWand *wand,
480 % const NoiseType noise_type,const double attenuate)
482 % A description of each parameter follows:
484 % o wand: the magick wand.
486 % o noise_type: The type of noise: Uniform, Gaussian, Multiplicative,
487 % Impulse, Laplacian, or Poisson.
489 % o attenuate: attenuate the random distribution.
492 WandExport MagickBooleanType MagickAddNoiseImage(MagickWand *wand,
493 const NoiseType noise_type,const double attenuate)
498 assert(wand != (MagickWand *) NULL);
499 assert(wand->signature == WandSignature);
500 if (IfMagickTrue(wand->debug))
501 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
502 if (wand->images == (Image *) NULL)
503 ThrowWandException(WandError,"ContainsNoImages",wand->name);
504 noise_image=AddNoiseImage(wand->images,noise_type,attenuate,wand->exception);
505 if (noise_image == (Image *) NULL)
507 ReplaceImageInList(&wand->images,noise_image);
512 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
516 % 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 %
520 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
522 % MagickAffineTransformImage() transforms an image as dictated by the affine
523 % matrix of the drawing wand.
525 % The format of the MagickAffineTransformImage method is:
527 % MagickBooleanType MagickAffineTransformImage(MagickWand *wand,
528 % const DrawingWand *drawing_wand)
530 % A description of each parameter follows:
532 % o wand: the magick wand.
534 % o drawing_wand: the draw wand.
537 WandExport MagickBooleanType MagickAffineTransformImage(MagickWand *wand,
538 const DrawingWand *drawing_wand)
546 assert(wand != (MagickWand *) NULL);
547 assert(wand->signature == WandSignature);
548 if (IfMagickTrue(wand->debug))
549 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
550 if (wand->images == (Image *) NULL)
551 ThrowWandException(WandError,"ContainsNoImages",wand->name);
552 draw_info=PeekDrawingWand(drawing_wand);
553 if (draw_info == (DrawInfo *) NULL)
555 affine_image=AffineTransformImage(wand->images,&draw_info->affine,
557 draw_info=DestroyDrawInfo(draw_info);
558 if (affine_image == (Image *) NULL)
560 ReplaceImageInList(&wand->images,affine_image);
565 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
569 % M a g i c k A n n o t a t e I m a g e %
573 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
575 % MagickAnnotateImage() annotates an image with text.
577 % The format of the MagickAnnotateImage method is:
579 % MagickBooleanType MagickAnnotateImage(MagickWand *wand,
580 % const DrawingWand *drawing_wand,const double x,const double y,
581 % const double angle,const char *text)
583 % A description of each parameter follows:
585 % o wand: the magick wand.
587 % o drawing_wand: the draw wand.
589 % o x: x ordinate to left of text
591 % o y: y ordinate to text baseline
593 % o angle: rotate text relative to this angle.
595 % o text: text to draw
598 WandExport MagickBooleanType MagickAnnotateImage(MagickWand *wand,
599 const DrawingWand *drawing_wand,const double x,const double y,
600 const double angle,const char *text)
603 geometry[MaxTextExtent];
611 assert(wand != (MagickWand *) NULL);
612 assert(wand->signature == WandSignature);
613 if (IfMagickTrue(wand->debug))
614 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
615 if (wand->images == (Image *) NULL)
616 ThrowWandException(WandError,"ContainsNoImages",wand->name);
617 draw_info=PeekDrawingWand(drawing_wand);
618 if (draw_info == (DrawInfo *) NULL)
620 (void) CloneString(&draw_info->text,text);
621 (void) FormatLocaleString(geometry,MaxTextExtent,"%+g%+g",x,y);
622 draw_info->affine.sx=cos((double) DegreesToRadians(fmod(angle,360.0)));
623 draw_info->affine.rx=sin((double) DegreesToRadians(fmod(angle,360.0)));
624 draw_info->affine.ry=(-sin((double) DegreesToRadians(fmod(angle,360.0))));
625 draw_info->affine.sy=cos((double) DegreesToRadians(fmod(angle,360.0)));
626 (void) CloneString(&draw_info->geometry,geometry);
627 status=AnnotateImage(wand->images,draw_info,wand->exception);
628 draw_info=DestroyDrawInfo(draw_info);
633 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
637 % M a g i c k A n i m a t e I m a g e s %
641 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
643 % MagickAnimateImages() animates an image or image sequence.
645 % The format of the MagickAnimateImages method is:
647 % MagickBooleanType MagickAnimateImages(MagickWand *wand,
648 % const char *server_name)
650 % A description of each parameter follows:
652 % o wand: the magick wand.
654 % o server_name: the X server name.
657 WandExport MagickBooleanType MagickAnimateImages(MagickWand *wand,
658 const char *server_name)
663 assert(wand != (MagickWand *) NULL);
664 assert(wand->signature == WandSignature);
665 if (IfMagickTrue(wand->debug))
666 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
667 (void) CloneString(&wand->image_info->server_name,server_name);
668 status=AnimateImages(wand->image_info,wand->images,wand->exception);
673 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
677 % M a g i c k A p p e n d I m a g e s %
681 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
683 % MagickAppendImages() append the images in a wand from the current image
684 % onwards, creating a new wand with the single image result. This is
685 % affected by the gravity and background settings of the first image.
687 % Typically you would call either MagickResetIterator() or
688 % MagickSetFirstImage() before calling this function to ensure that all
689 % the images in the wand's image list will be appended together.
691 % The format of the MagickAppendImages method is:
693 % MagickWand *MagickAppendImages(MagickWand *wand,
694 % const MagickBooleanType stack)
696 % A description of each parameter follows:
698 % o wand: the magick wand.
700 % o stack: By default, images are stacked left-to-right. Set stack to
701 % MagickTrue to stack them top-to-bottom.
704 WandExport MagickWand *MagickAppendImages(MagickWand *wand,
705 const MagickBooleanType stack)
710 assert(wand != (MagickWand *) NULL);
711 assert(wand->signature == WandSignature);
712 if (IfMagickTrue(wand->debug))
713 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
714 if (wand->images == (Image *) NULL)
715 return((MagickWand *) NULL);
716 append_image=AppendImages(wand->images,stack,wand->exception);
717 if (append_image == (Image *) NULL)
718 return((MagickWand *) NULL);
719 return(CloneMagickWandFromImages(wand,append_image));
723 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
727 % M a g i c k A u t o G a m m a I m a g e %
731 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
733 % MagickAutoGammaImage() extracts the 'mean' from the image and adjust the
734 % image to try make set its gamma appropriatally.
736 % The format of the MagickAutoGammaImage method is:
738 % MagickBooleanType MagickAutoGammaImage(MagickWand *wand)
740 % A description of each parameter follows:
742 % o wand: the magick wand.
745 WandExport MagickBooleanType MagickAutoGammaImage(MagickWand *wand)
750 assert(wand != (MagickWand *) NULL);
751 assert(wand->signature == WandSignature);
752 if (IfMagickTrue(wand->debug))
753 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
754 if (wand->images == (Image *) NULL)
755 ThrowWandException(WandError,"ContainsNoImages",wand->name);
756 status=AutoGammaImage(wand->images,wand->exception);
761 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
765 % M a g i c k A u t o L e v e l I m a g e %
769 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
771 % MagickAutoLevelImage() adjusts the levels of a particular image channel by
772 % scaling the minimum and maximum values to the full quantum range.
774 % The format of the MagickAutoLevelImage method is:
776 % MagickBooleanType MagickAutoLevelImage(MagickWand *wand)
778 % A description of each parameter follows:
780 % o wand: the magick wand.
783 WandExport MagickBooleanType MagickAutoLevelImage(MagickWand *wand)
788 assert(wand != (MagickWand *) NULL);
789 assert(wand->signature == WandSignature);
790 if (IfMagickTrue(wand->debug))
791 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
792 if (wand->images == (Image *) NULL)
793 ThrowWandException(WandError,"ContainsNoImages",wand->name);
794 status=AutoLevelImage(wand->images,wand->exception);
799 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
803 % 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 %
807 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
809 % MagickBlackThresholdImage() is like MagickThresholdImage() but forces all
810 % pixels below the threshold into black while leaving all pixels above the
811 % threshold unchanged.
813 % The format of the MagickBlackThresholdImage method is:
815 % MagickBooleanType MagickBlackThresholdImage(MagickWand *wand,
816 % const PixelWand *threshold)
818 % A description of each parameter follows:
820 % o wand: the magick wand.
822 % o threshold: the pixel wand.
825 WandExport MagickBooleanType MagickBlackThresholdImage(MagickWand *wand,
826 const PixelWand *threshold)
829 thresholds[MaxTextExtent];
834 assert(wand != (MagickWand *) NULL);
835 assert(wand->signature == WandSignature);
836 if (IfMagickTrue(wand->debug))
837 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
838 if (wand->images == (Image *) NULL)
839 ThrowWandException(WandError,"ContainsNoImages",wand->name);
840 (void) FormatLocaleString(thresholds,MaxTextExtent,
841 QuantumFormat "," QuantumFormat "," QuantumFormat "," QuantumFormat,
842 PixelGetRedQuantum(threshold),PixelGetGreenQuantum(threshold),
843 PixelGetBlueQuantum(threshold),PixelGetAlphaQuantum(threshold));
844 status=BlackThresholdImage(wand->images,thresholds,wand->exception);
849 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
853 % M a g i c k B l u e S h i f t I m a g e %
857 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
859 % MagickBlueShiftImage() mutes the colors of the image to simulate a scene at
860 % nighttime in the moonlight.
862 % The format of the MagickBlueShiftImage method is:
864 % MagickBooleanType MagickBlueShiftImage(MagickWand *wand,
865 % const double factor)
867 % A description of each parameter follows:
869 % o wand: the magick wand.
871 % o factor: the blue shift factor (default 1.5)
874 WandExport MagickBooleanType MagickBlueShiftImage(MagickWand *wand,
880 assert(wand != (MagickWand *) NULL);
881 assert(wand->signature == WandSignature);
882 if (IfMagickTrue(wand->debug))
883 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
884 if (wand->images == (Image *) NULL)
885 ThrowWandException(WandError,"ContainsNoImages",wand->name);
886 shift_image=BlueShiftImage(wand->images,factor,wand->exception);
887 if (shift_image == (Image *) NULL)
889 ReplaceImageInList(&wand->images,shift_image);
894 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
898 % M a g i c k B l u r I m a g e %
902 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
904 % MagickBlurImage() blurs an image. We convolve the image with a
905 % gaussian operator of the given radius and standard deviation (sigma).
906 % For reasonable results, the radius should be larger than sigma. Use a
907 % radius of 0 and BlurImage() selects a suitable radius for you.
909 % The format of the MagickBlurImage method is:
911 % MagickBooleanType MagickBlurImage(MagickWand *wand,const double radius,
912 % const double sigma)
914 % A description of each parameter follows:
916 % o wand: the magick wand.
918 % o radius: the radius of the , in pixels, not counting the center
921 % o sigma: the standard deviation of the , in pixels.
924 WandExport MagickBooleanType MagickBlurImage(MagickWand *wand,
925 const double radius,const double sigma)
930 assert(wand != (MagickWand *) NULL);
931 assert(wand->signature == WandSignature);
932 if (IfMagickTrue(wand->debug))
933 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
934 if (wand->images == (Image *) NULL)
935 ThrowWandException(WandError,"ContainsNoImages",wand->name);
936 blur_image=BlurImage(wand->images,radius,sigma,wand->exception);
937 if (blur_image == (Image *) NULL)
939 ReplaceImageInList(&wand->images,blur_image);
944 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
948 % M a g i c k B o r d e r I m a g e %
952 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
954 % MagickBorderImage() surrounds the image with a border of the color defined
955 % by the bordercolor pixel wand.
957 % The format of the MagickBorderImage method is:
959 % MagickBooleanType MagickBorderImage(MagickWand *wand,
960 % const PixelWand *bordercolor,const size_t width,
961 % const size_t height,const CompositeOperator compose)
963 % A description of each parameter follows:
965 % o wand: the magick wand.
967 % o bordercolor: the border color pixel wand.
969 % o width: the border width.
971 % o height: the border height.
973 % o compose: the composite operator.
976 WandExport MagickBooleanType MagickBorderImage(MagickWand *wand,
977 const PixelWand *bordercolor,const size_t width,const size_t height,
978 const CompositeOperator compose)
986 assert(wand != (MagickWand *) NULL);
987 assert(wand->signature == WandSignature);
988 if (IfMagickTrue(wand->debug))
989 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
990 if (wand->images == (Image *) NULL)
991 ThrowWandException(WandError,"ContainsNoImages",wand->name);
992 border_info.width=width;
993 border_info.height=height;
996 PixelGetQuantumPacket(bordercolor,&wand->images->border_color);
997 border_image=BorderImage(wand->images,&border_info,compose,wand->exception);
998 if (border_image == (Image *) NULL)
1000 ReplaceImageInList(&wand->images,border_image);
1005 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1009 % 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 %
1013 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1015 % Use MagickBrightnessContrastImage() to change the brightness and/or contrast
1016 % of an image. It converts the brightness and contrast parameters into slope
1017 % and intercept and calls a polynomical function to apply to the image.
1020 % The format of the MagickBrightnessContrastImage method is:
1022 % MagickBooleanType MagickBrightnessContrastImage(MagickWand *wand,
1023 % const double brightness,const double contrast)
1025 % A description of each parameter follows:
1027 % o wand: the magick wand.
1029 % o brightness: the brightness percent (-100 .. 100).
1031 % o contrast: the contrast percent (-100 .. 100).
1034 WandExport MagickBooleanType MagickBrightnessContrastImage(
1035 MagickWand *wand,const double brightness,const double contrast)
1040 assert(wand != (MagickWand *) NULL);
1041 assert(wand->signature == WandSignature);
1042 if (IfMagickTrue(wand->debug))
1043 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1044 if (wand->images == (Image *) NULL)
1045 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1046 status=BrightnessContrastImage(wand->images,brightness,contrast,
1052 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1056 % M a g i c k C h a n n e l F x I m a g e %
1060 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1062 % MagickChannelFxImage() applies a channel expression to the specified image.
1063 % The expression consists of one or more channels, either mnemonic or numeric
1064 % (e.g. red, 1), separated by actions as follows:
1066 % <=> exchange two channels (e.g. red<=>blue)
1067 % => transfer a channel to another (e.g. red=>green)
1068 % , separate channel operations (e.g. red, green)
1069 % | read channels from next input image (e.g. red | green)
1070 % ; write channels to next output image (e.g. red; green; blue)
1072 % A channel without a operation symbol implies extract. For example, to create
1073 % 3 grayscale images from the red, green, and blue channels of an image, use:
1075 % -channel-fx "red; green; blue"
1077 % The format of the MagickChannelFxImage method is:
1079 % MagickWand *MagickChannelFxImage(MagickWand *wand,const char *expression)
1081 % A description of each parameter follows:
1083 % o wand: the magick wand.
1085 % o expression: the expression.
1088 WandExport MagickWand *MagickChannelFxImage(MagickWand *wand,
1089 const char *expression)
1094 assert(wand != (MagickWand *) NULL);
1095 assert(wand->signature == WandSignature);
1096 if (IfMagickTrue(wand->debug))
1097 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1098 if (wand->images == (Image *) NULL)
1099 return((MagickWand *) NULL);
1100 fx_image=ChannelFxImage(wand->images,expression,wand->exception);
1101 if (fx_image == (Image *) NULL)
1102 return((MagickWand *) NULL);
1103 return(CloneMagickWandFromImages(wand,fx_image));
1107 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1111 % M a g i c k C h a r c o a l I m a g e %
1115 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1117 % MagickCharcoalImage() simulates a charcoal drawing.
1119 % The format of the MagickCharcoalImage method is:
1121 % MagickBooleanType MagickCharcoalImage(MagickWand *wand,
1122 % const double radius,const double sigma)
1124 % A description of each parameter follows:
1126 % o wand: the magick wand.
1128 % o radius: the radius of the Gaussian, in pixels, not counting the center
1131 % o sigma: the standard deviation of the Gaussian, in pixels.
1134 WandExport MagickBooleanType MagickCharcoalImage(MagickWand *wand,
1135 const double radius,const double sigma)
1140 assert(wand != (MagickWand *) NULL);
1141 assert(wand->signature == WandSignature);
1142 if (IfMagickTrue(wand->debug))
1143 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1144 if (wand->images == (Image *) NULL)
1145 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1146 charcoal_image=CharcoalImage(wand->images,radius,sigma,wand->exception);
1147 if (charcoal_image == (Image *) NULL)
1148 return(MagickFalse);
1149 ReplaceImageInList(&wand->images,charcoal_image);
1154 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1158 % M a g i c k C h o p I m a g e %
1162 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1164 % MagickChopImage() removes a region of an image and collapses the image to
1165 % occupy the removed portion
1167 % The format of the MagickChopImage method is:
1169 % MagickBooleanType MagickChopImage(MagickWand *wand,
1170 % const size_t width,const size_t height,const ssize_t x,
1173 % A description of each parameter follows:
1175 % o wand: the magick wand.
1177 % o width: the region width.
1179 % o height: the region height.
1181 % o x: the region x offset.
1183 % o y: the region y offset.
1187 WandExport MagickBooleanType MagickChopImage(MagickWand *wand,
1188 const size_t width,const size_t height,const ssize_t x,
1197 assert(wand != (MagickWand *) NULL);
1198 assert(wand->signature == WandSignature);
1199 if (IfMagickTrue(wand->debug))
1200 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1201 if (wand->images == (Image *) NULL)
1202 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1207 chop_image=ChopImage(wand->images,&chop,wand->exception);
1208 if (chop_image == (Image *) NULL)
1209 return(MagickFalse);
1210 ReplaceImageInList(&wand->images,chop_image);
1215 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1219 % M a g i c k C l a m p I m a g e %
1223 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1225 % MagickClampImage() restricts the color range from 0 to the quantum depth.
1227 % The format of the MagickClampImage method is:
1229 % MagickBooleanType MagickClampImage(MagickWand *wand)
1231 % A description of each parameter follows:
1233 % o wand: the magick wand.
1235 % o channel: the channel.
1238 WandExport MagickBooleanType MagickClampImage(MagickWand *wand)
1240 assert(wand != (MagickWand *) NULL);
1241 assert(wand->signature == WandSignature);
1242 if (IfMagickTrue(wand->debug))
1243 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1244 if (wand->images == (Image *) NULL)
1245 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1246 return(ClampImage(wand->images,wand->exception));
1250 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1254 % M a g i c k C l i p I m a g e %
1258 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1260 % MagickClipImage() clips along the first path from the 8BIM profile, if
1263 % The format of the MagickClipImage method is:
1265 % MagickBooleanType MagickClipImage(MagickWand *wand)
1267 % A description of each parameter follows:
1269 % o wand: the magick wand.
1272 WandExport MagickBooleanType MagickClipImage(MagickWand *wand)
1277 assert(wand != (MagickWand *) NULL);
1278 assert(wand->signature == WandSignature);
1279 if (IfMagickTrue(wand->debug))
1280 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1281 if (wand->images == (Image *) NULL)
1282 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1283 status=ClipImage(wand->images,wand->exception);
1288 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1292 % M a g i c k C l i p I m a g e P a t h %
1296 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1298 % MagickClipImagePath() clips along the named paths from the 8BIM profile, if
1299 % present. Later operations take effect inside the path. Id may be a number
1300 % if preceded with #, to work on a numbered path, e.g., "#1" to use the first
1303 % The format of the MagickClipImagePath method is:
1305 % MagickBooleanType MagickClipImagePath(MagickWand *wand,
1306 % const char *pathname,const MagickBooleanType inside)
1308 % A description of each parameter follows:
1310 % o wand: the magick wand.
1312 % o pathname: name of clipping path resource. If name is preceded by #, use
1313 % clipping path numbered by name.
1315 % o inside: if non-zero, later operations take effect inside clipping path.
1316 % Otherwise later operations take effect outside clipping path.
1319 WandExport MagickBooleanType MagickClipImagePath(MagickWand *wand,
1320 const char *pathname,const MagickBooleanType inside)
1325 assert(wand != (MagickWand *) NULL);
1326 assert(wand->signature == WandSignature);
1327 if (IfMagickTrue(wand->debug))
1328 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1329 if (wand->images == (Image *) NULL)
1330 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1331 status=ClipImagePath(wand->images,pathname,inside,wand->exception);
1336 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1340 % M a g i c k C l u t I m a g e %
1344 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1346 % MagickClutImage() replaces colors in the image from a color lookup table.
1348 % The format of the MagickClutImage method is:
1350 % MagickBooleanType MagickClutImage(MagickWand *wand,
1351 % const MagickWand *clut_wand,const PixelInterpolateMethod method)
1353 % A description of each parameter follows:
1355 % o wand: the magick wand.
1357 % o clut_image: the clut image.
1359 % o method: the pixel interpolation method.
1362 WandExport MagickBooleanType MagickClutImage(MagickWand *wand,
1363 const MagickWand *clut_wand,const PixelInterpolateMethod method)
1368 assert(wand != (MagickWand *) NULL);
1369 assert(wand->signature == WandSignature);
1370 if (IfMagickTrue(wand->debug))
1371 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1372 if ((wand->images == (Image *) NULL) || (clut_wand->images == (Image *) NULL))
1373 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1374 status=ClutImage(wand->images,clut_wand->images,method,wand->exception);
1379 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1383 % M a g i c k C o a l e s c e I m a g e s %
1387 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1389 % MagickCoalesceImages() composites a set of images while respecting any page
1390 % offsets and disposal methods. GIF, MIFF, and MNG animation sequences
1391 % typically start with an image background and each subsequent image
1392 % varies in size and offset. MagickCoalesceImages() returns a new sequence
1393 % where each image in the sequence is the same size as the first and
1394 % composited with the next image in the sequence.
1396 % The format of the MagickCoalesceImages method is:
1398 % MagickWand *MagickCoalesceImages(MagickWand *wand)
1400 % A description of each parameter follows:
1402 % o wand: the magick wand.
1405 WandExport MagickWand *MagickCoalesceImages(MagickWand *wand)
1410 assert(wand != (MagickWand *) NULL);
1411 assert(wand->signature == WandSignature);
1412 if (IfMagickTrue(wand->debug))
1413 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1414 if (wand->images == (Image *) NULL)
1415 return((MagickWand *) NULL);
1416 coalesce_image=CoalesceImages(wand->images,wand->exception);
1417 if (coalesce_image == (Image *) NULL)
1418 return((MagickWand *) NULL);
1419 return(CloneMagickWandFromImages(wand,coalesce_image));
1423 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1427 % M a g i c k C o l o r D e c i s i o n I m a g e %
1431 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1433 % MagickColorDecisionListImage() accepts a lightweight Color Correction
1434 % Collection (CCC) file which solely contains one or more color corrections
1435 % and applies the color correction to the image. Here is a sample CCC file:
1437 % <ColorCorrectionCollection xmlns="urn:ASC:CDL:v1.2">
1438 % <ColorCorrection id="cc03345">
1440 % <Slope> 0.9 1.2 0.5 </Slope>
1441 % <Offset> 0.4 -0.5 0.6 </Offset>
1442 % <Power> 1.0 0.8 1.5 </Power>
1445 % <Saturation> 0.85 </Saturation>
1447 % </ColorCorrection>
1448 % </ColorCorrectionCollection>
1450 % which includes the offset, slope, and power for each of the RGB channels
1451 % as well as the saturation.
1453 % The format of the MagickColorDecisionListImage method is:
1455 % MagickBooleanType MagickColorDecisionListImage(MagickWand *wand,
1456 % const char *color_correction_collection)
1458 % A description of each parameter follows:
1460 % o wand: the magick wand.
1462 % o color_correction_collection: the color correction collection in XML.
1465 WandExport MagickBooleanType MagickColorDecisionListImage(MagickWand *wand,
1466 const char *color_correction_collection)
1471 assert(wand != (MagickWand *) NULL);
1472 assert(wand->signature == WandSignature);
1473 if (IfMagickTrue(wand->debug))
1474 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1475 if (wand->images == (Image *) NULL)
1476 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1477 status=ColorDecisionListImage(wand->images,color_correction_collection,
1483 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1487 % M a g i c k C o l o r i z e I m a g e %
1491 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1493 % MagickColorizeImage() blends the fill color with each pixel in the image.
1495 % The format of the MagickColorizeImage method is:
1497 % MagickBooleanType MagickColorizeImage(MagickWand *wand,
1498 % const PixelWand *colorize,const PixelWand *blend)
1500 % A description of each parameter follows:
1502 % o wand: the magick wand.
1504 % o colorize: the colorize pixel wand.
1506 % o alpha: the alpha pixel wand.
1509 WandExport MagickBooleanType MagickColorizeImage(MagickWand *wand,
1510 const PixelWand *colorize,const PixelWand *blend)
1513 percent_blend[MaxTextExtent];
1521 assert(wand != (MagickWand *) NULL);
1522 assert(wand->signature == WandSignature);
1523 if (IfMagickTrue(wand->debug))
1524 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1525 if (wand->images == (Image *) NULL)
1526 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1527 GetPixelInfo(wand->images,&target);
1528 if (target.colorspace != CMYKColorspace)
1529 (void) FormatLocaleString(percent_blend,MaxTextExtent,
1530 "%g,%g,%g,%g",(double) (100.0*QuantumScale*
1531 PixelGetRedQuantum(blend)),(double) (100.0*QuantumScale*
1532 PixelGetGreenQuantum(blend)),(double) (100.0*QuantumScale*
1533 PixelGetBlueQuantum(blend)),(double) (100.0*QuantumScale*
1534 PixelGetAlphaQuantum(blend)));
1536 (void) FormatLocaleString(percent_blend,MaxTextExtent,
1537 "%g,%g,%g,%g,%g",(double) (100.0*QuantumScale*
1538 PixelGetRedQuantum(blend)),(double) (100.0*QuantumScale*
1539 PixelGetGreenQuantum(blend)),(double) (100.0*QuantumScale*
1540 PixelGetBlueQuantum(blend)),(double) (100.0*QuantumScale*
1541 PixelGetBlackQuantum(blend)),(double) (100.0*QuantumScale*
1542 PixelGetAlphaQuantum(blend)));
1543 target=PixelGetPixel(colorize);
1544 colorize_image=ColorizeImage(wand->images,percent_blend,&target,
1546 if (colorize_image == (Image *) NULL)
1547 return(MagickFalse);
1548 ReplaceImageInList(&wand->images,colorize_image);
1553 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1557 % M a g i c k C o l o r M a t r i x I m a g e %
1561 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1563 % MagickColorMatrixImage() apply color transformation to an image. The method
1564 % permits saturation changes, hue rotation, luminance to alpha, and various
1565 % other effects. Although variable-sized transformation matrices can be used,
1566 % typically one uses a 5x5 matrix for an RGBA image and a 6x6 for CMYKA
1567 % (or RGBA with offsets). The matrix is similar to those used by Adobe Flash
1568 % except offsets are in column 6 rather than 5 (in support of CMYKA images)
1569 % and offsets are normalized (divide Flash offset by 255).
1571 % The format of the MagickColorMatrixImage method is:
1573 % MagickBooleanType MagickColorMatrixImage(MagickWand *wand,
1574 % const KernelInfo *color_matrix)
1576 % A description of each parameter follows:
1578 % o wand: the magick wand.
1580 % o color_matrix: the color matrix.
1583 WandExport MagickBooleanType MagickColorMatrixImage(MagickWand *wand,
1584 const KernelInfo *color_matrix)
1589 assert(wand != (MagickWand *) NULL);
1590 assert(wand->signature == WandSignature);
1591 if (IfMagickTrue(wand->debug))
1592 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1593 if (color_matrix == (const KernelInfo *) NULL)
1594 return(MagickFalse);
1595 if (wand->images == (Image *) NULL)
1596 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1597 color_image=ColorMatrixImage(wand->images,color_matrix,wand->exception);
1598 if (color_image == (Image *) NULL)
1599 return(MagickFalse);
1600 ReplaceImageInList(&wand->images,color_image);
1605 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1609 % M a g i c k C o m b i n e I m a g e s %
1613 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1615 % MagickCombineImages() combines one or more images into a single image. The
1616 % grayscale value of the pixels of each image in the sequence is assigned in
1617 % order to the specified hannels of the combined image. The typical
1618 % ordering would be image 1 => Red, 2 => Green, 3 => Blue, etc.
1620 % The format of the MagickCombineImages method is:
1622 % MagickWand *MagickCombineImages(MagickWand *wand,
1623 % const ColorspaceType colorspace)
1625 % A description of each parameter follows:
1627 % o wand: the magick wand.
1629 % o colorspace: the colorspace.
1632 WandExport MagickWand *MagickCombineImages(MagickWand *wand,
1633 const ColorspaceType colorspace)
1638 assert(wand != (MagickWand *) NULL);
1639 assert(wand->signature == WandSignature);
1640 if (IfMagickTrue(wand->debug))
1641 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1642 if (wand->images == (Image *) NULL)
1643 return((MagickWand *) NULL);
1644 combine_image=CombineImages(wand->images,colorspace,wand->exception);
1645 if (combine_image == (Image *) NULL)
1646 return((MagickWand *) NULL);
1647 return(CloneMagickWandFromImages(wand,combine_image));
1651 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1655 % M a g i c k C o m m e n t I m a g e %
1659 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1661 % MagickCommentImage() adds a comment to your image.
1663 % The format of the MagickCommentImage method is:
1665 % MagickBooleanType MagickCommentImage(MagickWand *wand,
1666 % const char *comment)
1668 % A description of each parameter follows:
1670 % o wand: the magick wand.
1672 % o comment: the image comment.
1675 WandExport MagickBooleanType MagickCommentImage(MagickWand *wand,
1676 const char *comment)
1681 assert(wand != (MagickWand *) NULL);
1682 assert(wand->signature == WandSignature);
1683 if (IfMagickTrue(wand->debug))
1684 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1685 if (wand->images == (Image *) NULL)
1686 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1687 status=SetImageProperty(wand->images,"comment",comment,wand->exception);
1692 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1696 % M a g i c k C o m p a r e I m a g e L a y e r s %
1700 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1702 % MagickCompareImagesLayers() compares each image with the next in a sequence
1703 % and returns the maximum bounding region of any pixel differences it
1706 % The format of the MagickCompareImagesLayers method is:
1708 % MagickWand *MagickCompareImagesLayers(MagickWand *wand,
1709 % const LayerMethod method)
1711 % A description of each parameter follows:
1713 % o wand: the magick wand.
1715 % o method: the compare method.
1718 WandExport MagickWand *MagickCompareImagesLayers(MagickWand *wand,
1719 const LayerMethod method)
1724 assert(wand != (MagickWand *) NULL);
1725 assert(wand->signature == WandSignature);
1726 if (IfMagickTrue(wand->debug))
1727 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1728 if (wand->images == (Image *) NULL)
1729 return((MagickWand *) NULL);
1730 layers_image=CompareImagesLayers(wand->images,method,wand->exception);
1731 if (layers_image == (Image *) NULL)
1732 return((MagickWand *) NULL);
1733 return(CloneMagickWandFromImages(wand,layers_image));
1737 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1741 % M a g i c k C o m p a r e I m a g e s %
1745 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1747 % MagickCompareImages() compares an image to a reconstructed image and returns
1748 % the specified difference image.
1750 % The format of the MagickCompareImages method is:
1752 % MagickWand *MagickCompareImages(MagickWand *wand,
1753 % const MagickWand *reference,const MetricType metric,
1754 % double *distortion)
1756 % A description of each parameter follows:
1758 % o wand: the magick wand.
1760 % o reference: the reference wand.
1762 % o metric: the metric.
1764 % o distortion: the computed distortion between the images.
1767 WandExport MagickWand *MagickCompareImages(MagickWand *wand,
1768 const MagickWand *reference,const MetricType metric,double *distortion)
1774 assert(wand != (MagickWand *) NULL);
1775 assert(wand->signature == WandSignature);
1776 if (IfMagickTrue(wand->debug))
1777 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1778 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
1780 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
1781 "ContainsNoImages","`%s'",wand->name);
1782 return((MagickWand *) NULL);
1784 compare_image=CompareImages(wand->images,reference->images,metric,distortion,
1786 if (compare_image == (Image *) NULL)
1787 return((MagickWand *) NULL);
1788 return(CloneMagickWandFromImages(wand,compare_image));
1792 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1796 % M a g i c k C o m p o s i t e I m a g e %
1800 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1802 % MagickCompositeImage() composite one image onto another at the specified
1805 % The format of the MagickCompositeImage method is:
1807 % MagickBooleanType MagickCompositeImage(MagickWand *wand,
1808 % const MagickWand *source_wand,const CompositeOperator compose,
1809 % const MagickBooleanType clip_to_self,const ssize_t x,const ssize_t y)
1811 % A description of each parameter follows:
1813 % o wand: the magick wand holding the destination images
1815 % o source_image: the magick wand holding source image.
1817 % o compose: This operator affects how the composite is applied to the
1818 % image. The default is Over. These are some of the compose methods
1821 % OverCompositeOp InCompositeOp OutCompositeOp
1822 % AtopCompositeOp XorCompositeOp PlusCompositeOp
1823 % MinusCompositeOp AddCompositeOp SubtractCompositeOp
1824 % DifferenceCompositeOp BumpmapCompositeOp CopyCompositeOp
1825 % DisplaceCompositeOp
1827 % o clip_to_self: set to MagickTrue to limit composition to area composed.
1829 % o x: the column offset of the composited image.
1831 % o y: the row offset of the composited image.
1834 WandExport MagickBooleanType MagickCompositeImage(MagickWand *wand,
1835 const MagickWand *source_wand,const CompositeOperator compose,
1836 const MagickBooleanType clip_to_self,const ssize_t x,const ssize_t y)
1841 assert(wand != (MagickWand *) NULL);
1842 assert(wand->signature == WandSignature);
1843 if (IfMagickTrue(wand->debug))
1844 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1845 if ((wand->images == (Image *) NULL) ||
1846 (source_wand->images == (Image *) NULL))
1847 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1848 status=CompositeImage(wand->images,source_wand->images,compose,clip_to_self,
1849 x,y,wand->exception);
1854 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1858 % M a g i c k C o m p o s i t e L a y e r s %
1862 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1864 % MagickCompositeLayers() composite the images in the source wand over the
1865 % images in the destination wand in sequence, starting with the current
1866 % image in both lists.
1868 % Each layer from the two image lists are composted together until the end of
1869 % one of the image lists is reached. The offset of each composition is also
1870 % adjusted to match the virtual canvas offsets of each layer. As such the
1871 % given offset is relative to the virtual canvas, and not the actual image.
1873 % Composition uses given x and y offsets, as the 'origin' location of the
1874 % source images virtual canvas (not the real image) allowing you to compose a
1875 % list of 'layer images' into the destiantioni images. This makes it well
1876 % sutiable for directly composing 'Clears Frame Animations' or 'Coaleased
1877 % Animations' onto a static or other 'Coaleased Animation' destination image
1878 % list. GIF disposal handling is not looked at.
1880 % Special case:- If one of the image sequences is the last image (just a
1881 % single image remaining), that image is repeatally composed with all the
1882 % images in the other image list. Either the source or destination lists may
1883 % be the single image, for this situation.
1885 % In the case of a single destination image (or last image given), that image
1886 % will ve cloned to match the number of images remaining in the source image
1889 % This is equivelent to the "-layer Composite" Shell API operator.
1891 % The format of the MagickCompositeLayers method is:
1893 % MagickBooleanType MagickCompositeLayers(MagickWand *wand,
1894 % const MagickWand *source_wand, const CompositeOperator compose,
1895 % const ssize_t x,const ssize_t y)
1897 % A description of each parameter follows:
1899 % o wand: the magick wand holding destaintion images
1901 % o source_wand: the wand holding the source images
1903 % o compose, x, y: composition arguments
1906 WandExport MagickBooleanType MagickCompositeLayers(MagickWand *wand,
1907 const MagickWand *source_wand,const CompositeOperator compose,
1908 const ssize_t x,const ssize_t y)
1913 assert(wand != (MagickWand *) NULL);
1914 assert(wand->signature == WandSignature);
1915 if (IfMagickTrue(wand->debug))
1916 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1917 if ((wand->images == (Image *) NULL) ||
1918 (source_wand->images == (Image *) NULL))
1919 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1920 CompositeLayers(wand->images,compose,source_wand->images,x,y,wand->exception);
1921 status=MagickTrue; /* FUTURE: determine status from exceptions */
1926 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1930 % M a g i c k C o n t r a s t I m a g e %
1934 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1936 % MagickContrastImage() enhances the intensity differences between the lighter
1937 % and darker elements of the image. Set sharpen to a value other than 0 to
1938 % increase the image contrast otherwise the contrast is reduced.
1940 % The format of the MagickContrastImage method is:
1942 % MagickBooleanType MagickContrastImage(MagickWand *wand,
1943 % const MagickBooleanType sharpen)
1945 % A description of each parameter follows:
1947 % o wand: the magick wand.
1949 % o sharpen: Increase or decrease image contrast.
1953 WandExport MagickBooleanType MagickContrastImage(MagickWand *wand,
1954 const MagickBooleanType sharpen)
1959 assert(wand != (MagickWand *) NULL);
1960 assert(wand->signature == WandSignature);
1961 if (IfMagickTrue(wand->debug))
1962 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1963 if (wand->images == (Image *) NULL)
1964 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1965 status=ContrastImage(wand->images,sharpen,wand->exception);
1970 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1974 % 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 %
1978 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1980 % MagickContrastStretchImage() enhances the contrast of a color image by
1981 % adjusting the pixels color to span the entire range of colors available.
1982 % You can also reduce the influence of a particular channel with a gamma
1985 % The format of the MagickContrastStretchImage method is:
1987 % MagickBooleanType MagickContrastStretchImage(MagickWand *wand,
1988 % const double black_point,const double white_point)
1990 % A description of each parameter follows:
1992 % o wand: the magick wand.
1994 % o black_point: the black point.
1996 % o white_point: the white point.
1999 WandExport MagickBooleanType MagickContrastStretchImage(MagickWand *wand,
2000 const double black_point,const double white_point)
2005 assert(wand != (MagickWand *) NULL);
2006 assert(wand->signature == WandSignature);
2007 if (IfMagickTrue(wand->debug))
2008 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2009 if (wand->images == (Image *) NULL)
2010 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2011 status=ContrastStretchImage(wand->images,black_point,white_point,
2017 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2021 % M a g i c k C o n v o l v e I m a g e %
2025 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2027 % MagickConvolveImage() applies a custom convolution kernel to the image.
2029 % The format of the MagickConvolveImage method is:
2031 % MagickBooleanType MagickConvolveImage(MagickWand *wand,
2032 % const KernelInfo *kernel)
2034 % A description of each parameter follows:
2036 % o wand: the magick wand.
2038 % o kernel: An array of doubles representing the convolution kernel.
2041 WandExport MagickBooleanType MagickConvolveImage(MagickWand *wand,
2042 const KernelInfo *kernel)
2047 assert(wand != (MagickWand *) NULL);
2048 assert(wand->signature == WandSignature);
2049 if (IfMagickTrue(wand->debug))
2050 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2051 if (kernel == (const KernelInfo *) NULL)
2052 return(MagickFalse);
2053 if (wand->images == (Image *) NULL)
2054 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2055 filter_image=ConvolveImage(wand->images,kernel,wand->exception);
2056 if (filter_image == (Image *) NULL)
2057 return(MagickFalse);
2058 ReplaceImageInList(&wand->images,filter_image);
2063 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2067 % M a g i c k C r o p I m a g e %
2071 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2073 % MagickCropImage() extracts a region of the image.
2075 % The format of the MagickCropImage method is:
2077 % MagickBooleanType MagickCropImage(MagickWand *wand,
2078 % const size_t width,const size_t height,const ssize_t x,const ssize_t y)
2080 % A description of each parameter follows:
2082 % o wand: the magick wand.
2084 % o width: the region width.
2086 % o height: the region height.
2088 % o x: the region x-offset.
2090 % o y: the region y-offset.
2093 WandExport MagickBooleanType MagickCropImage(MagickWand *wand,
2094 const size_t width,const size_t height,const ssize_t x,const ssize_t y)
2102 assert(wand != (MagickWand *) NULL);
2103 assert(wand->signature == WandSignature);
2104 if (IfMagickTrue(wand->debug))
2105 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2106 if (wand->images == (Image *) NULL)
2107 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2112 crop_image=CropImage(wand->images,&crop,wand->exception);
2113 if (crop_image == (Image *) NULL)
2114 return(MagickFalse);
2115 ReplaceImageInList(&wand->images,crop_image);
2120 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2124 % M a g i c k C y c l e C o l o r m a p I m a g e %
2128 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2130 % MagickCycleColormapImage() displaces an image's colormap by a given number
2131 % of positions. If you cycle the colormap a number of times you can produce
2132 % a psychodelic effect.
2134 % The format of the MagickCycleColormapImage method is:
2136 % MagickBooleanType MagickCycleColormapImage(MagickWand *wand,
2137 % const ssize_t displace)
2139 % A description of each parameter follows:
2141 % o wand: the magick wand.
2143 % o pixel_wand: the pixel wand.
2146 WandExport MagickBooleanType MagickCycleColormapImage(MagickWand *wand,
2147 const ssize_t displace)
2152 assert(wand != (MagickWand *) NULL);
2153 assert(wand->signature == WandSignature);
2154 if (IfMagickTrue(wand->debug))
2155 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2156 if (wand->images == (Image *) NULL)
2157 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2158 status=CycleColormapImage(wand->images,displace,wand->exception);
2163 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2167 % M a g i c k C o n s t i t u t e I m a g e %
2171 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2173 % MagickConstituteImage() adds an image to the wand comprised of the pixel
2174 % data you supply. The pixel data must be in scanline order top-to-bottom.
2175 % The data can be char, short int, int, float, or double. Float and double
2176 % require the pixels to be normalized [0..1], otherwise [0..Max], where Max
2177 % is the maximum value the type can accomodate (e.g. 255 for char). For
2178 % example, to create a 640x480 image from unsigned red-green-blue character
2181 % MagickConstituteImage(wand,640,640,"RGB",CharPixel,pixels);
2183 % The format of the MagickConstituteImage method is:
2185 % MagickBooleanType MagickConstituteImage(MagickWand *wand,
2186 % const size_t columns,const size_t rows,const char *map,
2187 % const StorageType storage,void *pixels)
2189 % A description of each parameter follows:
2191 % o wand: the magick wand.
2193 % o columns: width in pixels of the image.
2195 % o rows: height in pixels of the image.
2197 % o map: This string reflects the expected ordering of the pixel array.
2198 % It can be any combination or order of R = red, G = green, B = blue,
2199 % A = alpha (0 is transparent), O = alpha (0 is opaque), C = cyan,
2200 % Y = yellow, M = magenta, K = black, I = intensity (for grayscale),
2203 % o storage: Define the data type of the pixels. Float and double types are
2204 % expected to be normalized [0..1] otherwise [0..QuantumRange]. Choose from
2205 % these types: CharPixel, DoublePixel, FloatPixel, IntegerPixel,
2206 % LongPixel, QuantumPixel, or ShortPixel.
2208 % o pixels: This array of values contain the pixel components as defined by
2209 % map and type. You must preallocate this array where the expected
2210 % length varies depending on the values of width, height, map, and type.
2214 WandExport MagickBooleanType MagickConstituteImage(MagickWand *wand,
2215 const size_t columns,const size_t rows,const char *map,
2216 const StorageType storage,const void *pixels)
2221 assert(wand != (MagickWand *) NULL);
2222 assert(wand->signature == WandSignature);
2223 if (IfMagickTrue(wand->debug))
2224 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2225 images=ConstituteImage(columns,rows,map,storage,pixels,wand->exception);
2226 if (images == (Image *) NULL)
2227 return(MagickFalse);
2228 return(InsertImageInWand(wand,images));
2232 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2236 % M a g i c k D e c i p h e r I m a g e %
2240 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2242 % MagickDecipherImage() converts cipher pixels to plain pixels.
2244 % The format of the MagickDecipherImage method is:
2246 % MagickBooleanType MagickDecipherImage(MagickWand *wand,
2247 % const char *passphrase)
2249 % A description of each parameter follows:
2251 % o wand: the magick wand.
2253 % o passphrase: the passphrase.
2256 WandExport MagickBooleanType MagickDecipherImage(MagickWand *wand,
2257 const char *passphrase)
2259 assert(wand != (MagickWand *) NULL);
2260 assert(wand->signature == WandSignature);
2261 if (IfMagickTrue(wand->debug))
2262 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2263 if (wand->images == (Image *) NULL)
2264 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2265 return(DecipherImage(wand->images,passphrase,wand->exception));
2269 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2273 % M a g i c k D e c o n s t r u c t I m a g e s %
2277 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2279 % MagickDeconstructImages() compares each image with the next in a sequence
2280 % and returns the maximum bounding region of any pixel differences it
2283 % The format of the MagickDeconstructImages method is:
2285 % MagickWand *MagickDeconstructImages(MagickWand *wand)
2287 % A description of each parameter follows:
2289 % o wand: the magick wand.
2292 WandExport MagickWand *MagickDeconstructImages(MagickWand *wand)
2297 assert(wand != (MagickWand *) NULL);
2298 assert(wand->signature == WandSignature);
2299 if (IfMagickTrue(wand->debug))
2300 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2301 if (wand->images == (Image *) NULL)
2302 return((MagickWand *) NULL);
2303 deconstruct_image=CompareImagesLayers(wand->images,CompareAnyLayer,
2305 if (deconstruct_image == (Image *) NULL)
2306 return((MagickWand *) NULL);
2307 return(CloneMagickWandFromImages(wand,deconstruct_image));
2311 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2315 % M a g i c k D e s k e w I m a g e %
2319 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2321 % MagickDeskewImage() removes skew from the image. Skew is an artifact that
2322 % occurs in scanned images because of the camera being misaligned,
2323 % imperfections in the scanning or surface, or simply because the paper was
2324 % not placed completely flat when scanned.
2326 % The format of the MagickDeskewImage method is:
2328 % MagickBooleanType MagickDeskewImage(MagickWand *wand,
2329 % const double threshold)
2331 % A description of each parameter follows:
2333 % o wand: the magick wand.
2335 % o threshold: separate background from foreground.
2338 WandExport MagickBooleanType MagickDeskewImage(MagickWand *wand,
2339 const double threshold)
2344 assert(wand != (MagickWand *) NULL);
2345 assert(wand->signature == WandSignature);
2346 if (IfMagickTrue(wand->debug))
2347 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2348 if (wand->images == (Image *) NULL)
2349 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2350 sepia_image=DeskewImage(wand->images,threshold,wand->exception);
2351 if (sepia_image == (Image *) NULL)
2352 return(MagickFalse);
2353 ReplaceImageInList(&wand->images,sepia_image);
2358 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2362 % M a g i c k D e s p e c k l e I m a g e %
2366 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2368 % MagickDespeckleImage() reduces the speckle noise in an image while
2369 % perserving the edges of the original image.
2371 % The format of the MagickDespeckleImage method is:
2373 % MagickBooleanType MagickDespeckleImage(MagickWand *wand)
2375 % A description of each parameter follows:
2377 % o wand: the magick wand.
2380 WandExport MagickBooleanType MagickDespeckleImage(MagickWand *wand)
2385 assert(wand != (MagickWand *) NULL);
2386 assert(wand->signature == WandSignature);
2387 if (IfMagickTrue(wand->debug))
2388 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2389 if (wand->images == (Image *) NULL)
2390 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2391 despeckle_image=DespeckleImage(wand->images,wand->exception);
2392 if (despeckle_image == (Image *) NULL)
2393 return(MagickFalse);
2394 ReplaceImageInList(&wand->images,despeckle_image);
2399 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2403 % M a g i c k D e s t r o y I m a g e %
2407 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2409 % MagickDestroyImage() dereferences an image, deallocating memory associated
2410 % with the image if the reference count becomes zero.
2412 % The format of the MagickDestroyImage method is:
2414 % Image *MagickDestroyImage(Image *image)
2416 % A description of each parameter follows:
2418 % o image: the image.
2421 WandExport Image *MagickDestroyImage(Image *image)
2423 return(DestroyImage(image));
2427 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2431 % M a g i c k D i s p l a y I m a g e %
2435 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2437 % MagickDisplayImage() displays an image.
2439 % The format of the MagickDisplayImage method is:
2441 % MagickBooleanType MagickDisplayImage(MagickWand *wand,
2442 % const char *server_name)
2444 % A description of each parameter follows:
2446 % o wand: the magick wand.
2448 % o server_name: the X server name.
2451 WandExport MagickBooleanType MagickDisplayImage(MagickWand *wand,
2452 const char *server_name)
2460 assert(wand != (MagickWand *) NULL);
2461 assert(wand->signature == WandSignature);
2462 if (IfMagickTrue(wand->debug))
2463 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2464 if (wand->images == (Image *) NULL)
2465 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2466 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
2467 if (image == (Image *) NULL)
2468 return(MagickFalse);
2469 (void) CloneString(&wand->image_info->server_name,server_name);
2470 status=DisplayImages(wand->image_info,image,wand->exception);
2471 image=DestroyImage(image);
2476 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2480 % M a g i c k D i s p l a y I m a g e s %
2484 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2486 % MagickDisplayImages() displays an image or image sequence.
2488 % The format of the MagickDisplayImages method is:
2490 % MagickBooleanType MagickDisplayImages(MagickWand *wand,
2491 % const char *server_name)
2493 % A description of each parameter follows:
2495 % o wand: the magick wand.
2497 % o server_name: the X server name.
2500 WandExport MagickBooleanType MagickDisplayImages(MagickWand *wand,
2501 const char *server_name)
2506 assert(wand != (MagickWand *) NULL);
2507 assert(wand->signature == WandSignature);
2508 if (IfMagickTrue(wand->debug))
2509 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2510 (void) CloneString(&wand->image_info->server_name,server_name);
2511 status=DisplayImages(wand->image_info,wand->images,wand->exception);
2516 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2520 % M a g i c k D i s t o r t I m a g e %
2524 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2526 % MagickDistortImage() distorts an image using various distortion methods, by
2527 % mapping color lookups of the source image to a new destination image
2528 % usally of the same size as the source image, unless 'bestfit' is set to
2531 % If 'bestfit' is enabled, and distortion allows it, the destination image is
2532 % adjusted to ensure the whole source 'image' will just fit within the final
2533 % destination image, which will be sized and offset accordingly. Also in
2534 % many cases the virtual offset of the source image will be taken into
2535 % account in the mapping.
2537 % The format of the MagickDistortImage method is:
2539 % MagickBooleanType MagickDistortImage(MagickWand *wand,
2540 % const DistortImageMethod method,const size_t number_arguments,
2541 % const double *arguments,const MagickBooleanType bestfit)
2543 % A description of each parameter follows:
2545 % o image: the image to be distorted.
2547 % o method: the method of image distortion.
2549 % ArcDistortion always ignores the source image offset, and always
2550 % 'bestfit' the destination image with the top left corner offset
2551 % relative to the polar mapping center.
2553 % Bilinear has no simple inverse mapping so it does not allow 'bestfit'
2554 % style of image distortion.
2556 % Affine, Perspective, and Bilinear, do least squares fitting of the
2557 % distortion when more than the minimum number of control point pairs
2560 % Perspective, and Bilinear, falls back to a Affine distortion when less
2561 % that 4 control point pairs are provided. While Affine distortions let
2562 % you use any number of control point pairs, that is Zero pairs is a
2563 % no-Op (viewport only) distrotion, one pair is a translation and two
2564 % pairs of control points do a scale-rotate-translate, without any
2567 % o number_arguments: the number of arguments given for this distortion
2570 % o arguments: the arguments for this distortion method.
2572 % o bestfit: Attempt to resize destination to fit distorted source.
2575 WandExport MagickBooleanType MagickDistortImage(MagickWand *wand,
2576 const DistortImageMethod method,const size_t number_arguments,
2577 const double *arguments,const MagickBooleanType bestfit)
2582 assert(wand != (MagickWand *) NULL);
2583 assert(wand->signature == WandSignature);
2584 if (IfMagickTrue(wand->debug))
2585 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2586 if (wand->images == (Image *) NULL)
2587 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2588 distort_image=DistortImage(wand->images,method,number_arguments,arguments,
2589 bestfit,wand->exception);
2590 if (distort_image == (Image *) NULL)
2591 return(MagickFalse);
2592 ReplaceImageInList(&wand->images,distort_image);
2597 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2601 % M a g i c k D r a w I m a g e %
2605 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2607 % MagickDrawImage() renders the drawing wand on the current image.
2609 % The format of the MagickDrawImage method is:
2611 % MagickBooleanType MagickDrawImage(MagickWand *wand,
2612 % const DrawingWand *drawing_wand)
2614 % A description of each parameter follows:
2616 % o wand: the magick wand.
2618 % o drawing_wand: the draw wand.
2621 WandExport MagickBooleanType MagickDrawImage(MagickWand *wand,
2622 const DrawingWand *drawing_wand)
2633 assert(wand != (MagickWand *) NULL);
2634 assert(wand->signature == WandSignature);
2635 if (IfMagickTrue(wand->debug))
2636 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2637 if (wand->images == (Image *) NULL)
2638 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2639 draw_info=PeekDrawingWand(drawing_wand);
2640 if ((draw_info == (DrawInfo *) NULL) ||
2641 (draw_info->primitive == (char *) NULL))
2642 return(MagickFalse);
2643 primitive=AcquireString(draw_info->primitive);
2644 draw_info=DestroyDrawInfo(draw_info);
2645 draw_info=CloneDrawInfo(wand->image_info,(DrawInfo *) NULL);
2646 draw_info->primitive=primitive;
2647 status=DrawImage(wand->images,draw_info,wand->exception);
2648 draw_info=DestroyDrawInfo(draw_info);
2653 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2657 % M a g i c k E d g e I m a g e %
2661 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2663 % MagickEdgeImage() enhance edges within the image with a convolution filter
2664 % of the given radius. Use a radius of 0 and Edge() selects a suitable
2667 % The format of the MagickEdgeImage method is:
2669 % MagickBooleanType MagickEdgeImage(MagickWand *wand,const double radius)
2671 % A description of each parameter follows:
2673 % o wand: the magick wand.
2675 % o radius: the radius of the pixel neighborhood.
2678 WandExport MagickBooleanType MagickEdgeImage(MagickWand *wand,
2679 const double radius)
2684 assert(wand != (MagickWand *) NULL);
2685 assert(wand->signature == WandSignature);
2686 if (IfMagickTrue(wand->debug))
2687 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2688 if (wand->images == (Image *) NULL)
2689 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2690 edge_image=EdgeImage(wand->images,radius,wand->exception);
2691 if (edge_image == (Image *) NULL)
2692 return(MagickFalse);
2693 ReplaceImageInList(&wand->images,edge_image);
2698 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2702 % M a g i c k E m b o s s I m a g e %
2706 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2708 % MagickEmbossImage() returns a grayscale image with a three-dimensional
2709 % effect. We convolve the image with a Gaussian operator of the given radius
2710 % and standard deviation (sigma). For reasonable results, radius should be
2711 % larger than sigma. Use a radius of 0 and Emboss() selects a suitable
2714 % The format of the MagickEmbossImage method is:
2716 % MagickBooleanType MagickEmbossImage(MagickWand *wand,const double radius,
2717 % const double sigma)
2719 % A description of each parameter follows:
2721 % o wand: the magick wand.
2723 % o radius: the radius of the Gaussian, in pixels, not counting the center
2726 % o sigma: the standard deviation of the Gaussian, in pixels.
2729 WandExport MagickBooleanType MagickEmbossImage(MagickWand *wand,
2730 const double radius,const double sigma)
2735 assert(wand != (MagickWand *) NULL);
2736 assert(wand->signature == WandSignature);
2737 if (IfMagickTrue(wand->debug))
2738 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2739 if (wand->images == (Image *) NULL)
2740 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2741 emboss_image=EmbossImage(wand->images,radius,sigma,wand->exception);
2742 if (emboss_image == (Image *) NULL)
2743 return(MagickFalse);
2744 ReplaceImageInList(&wand->images,emboss_image);
2749 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2753 % M a g i c k E n c i p h e r I m a g e %
2757 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2759 % MagickEncipherImage() converts plaint pixels to cipher pixels.
2761 % The format of the MagickEncipherImage method is:
2763 % MagickBooleanType MagickEncipherImage(MagickWand *wand,
2764 % const char *passphrase)
2766 % A description of each parameter follows:
2768 % o wand: the magick wand.
2770 % o passphrase: the passphrase.
2773 WandExport MagickBooleanType MagickEncipherImage(MagickWand *wand,
2774 const char *passphrase)
2776 assert(wand != (MagickWand *) NULL);
2777 assert(wand->signature == WandSignature);
2778 if (IfMagickTrue(wand->debug))
2779 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2780 if (wand->images == (Image *) NULL)
2781 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2782 return(EncipherImage(wand->images,passphrase,wand->exception));
2786 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2790 % M a g i c k E n h a n c e I m a g e %
2794 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2796 % MagickEnhanceImage() applies a digital filter that improves the quality of a
2799 % The format of the MagickEnhanceImage method is:
2801 % MagickBooleanType MagickEnhanceImage(MagickWand *wand)
2803 % A description of each parameter follows:
2805 % o wand: the magick wand.
2808 WandExport MagickBooleanType MagickEnhanceImage(MagickWand *wand)
2813 assert(wand != (MagickWand *) NULL);
2814 assert(wand->signature == WandSignature);
2815 if (IfMagickTrue(wand->debug))
2816 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2817 if (wand->images == (Image *) NULL)
2818 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2819 enhance_image=EnhanceImage(wand->images,wand->exception);
2820 if (enhance_image == (Image *) NULL)
2821 return(MagickFalse);
2822 ReplaceImageInList(&wand->images,enhance_image);
2827 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2831 % M a g i c k E q u a l i z e I m a g e %
2835 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2837 % MagickEqualizeImage() equalizes the image histogram.
2839 % The format of the MagickEqualizeImage method is:
2841 % MagickBooleanType MagickEqualizeImage(MagickWand *wand)
2843 % A description of each parameter follows:
2845 % o wand: the magick wand.
2847 % o channel: the image channel(s).
2850 WandExport MagickBooleanType MagickEqualizeImage(MagickWand *wand)
2855 assert(wand != (MagickWand *) NULL);
2856 assert(wand->signature == WandSignature);
2857 if (IfMagickTrue(wand->debug))
2858 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2859 if (wand->images == (Image *) NULL)
2860 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2861 status=EqualizeImage(wand->images,wand->exception);
2866 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2870 % M a g i c k E v a l u a t e I m a g e %
2874 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2876 % MagickEvaluateImage() applys an arithmetic, relational, or logical
2877 % expression to an image. Use these operators to lighten or darken an image,
2878 % to increase or decrease contrast in an image, or to produce the "negative"
2881 % The format of the MagickEvaluateImage method is:
2883 % MagickBooleanType MagickEvaluateImage(MagickWand *wand,
2884 % const MagickEvaluateOperator operator,const double value)
2885 % MagickBooleanType MagickEvaluateImages(MagickWand *wand,
2886 % const MagickEvaluateOperator operator)
2888 % A description of each parameter follows:
2890 % o wand: the magick wand.
2892 % o op: A channel operator.
2894 % o value: A value value.
2898 WandExport MagickWand *MagickEvaluateImages(MagickWand *wand,
2899 const MagickEvaluateOperator op)
2904 assert(wand != (MagickWand *) NULL);
2905 assert(wand->signature == WandSignature);
2906 if (IfMagickTrue(wand->debug))
2907 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2908 if (wand->images == (Image *) NULL)
2909 return((MagickWand *) NULL);
2910 evaluate_image=EvaluateImages(wand->images,op,wand->exception);
2911 if (evaluate_image == (Image *) NULL)
2912 return((MagickWand *) NULL);
2913 return(CloneMagickWandFromImages(wand,evaluate_image));
2916 WandExport MagickBooleanType MagickEvaluateImage(MagickWand *wand,
2917 const MagickEvaluateOperator op,const double value)
2922 assert(wand != (MagickWand *) NULL);
2923 assert(wand->signature == WandSignature);
2924 if (IfMagickTrue(wand->debug))
2925 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2926 if (wand->images == (Image *) NULL)
2927 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2928 status=EvaluateImage(wand->images,op,value,wand->exception);
2933 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2937 % M a g i c k E x p o r t I m a g e P i x e l s %
2941 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2943 % MagickExportImagePixels() extracts pixel data from an image and returns it
2944 % to you. The method returns MagickTrue on success otherwise MagickFalse if
2945 % an error is encountered. The data is returned as char, short int, int,
2946 % ssize_t, float, or double in the order specified by map.
2948 % Suppose you want to extract the first scanline of a 640x480 image as
2949 % character data in red-green-blue order:
2951 % MagickExportImagePixels(wand,0,0,640,1,"RGB",CharPixel,pixels);
2953 % The format of the MagickExportImagePixels method is:
2955 % MagickBooleanType MagickExportImagePixels(MagickWand *wand,
2956 % const ssize_t x,const ssize_t y,const size_t columns,
2957 % const size_t rows,const char *map,const StorageType storage,
2960 % A description of each parameter follows:
2962 % o wand: the magick wand.
2964 % o x, y, columns, rows: These values define the perimeter
2965 % of a region of pixels you want to extract.
2967 % o map: This string reflects the expected ordering of the pixel array.
2968 % It can be any combination or order of R = red, G = green, B = blue,
2969 % A = alpha (0 is transparent), O = alpha (0 is opaque), C = cyan,
2970 % Y = yellow, M = magenta, K = black, I = intensity (for grayscale),
2973 % o storage: Define the data type of the pixels. Float and double types are
2974 % expected to be normalized [0..1] otherwise [0..QuantumRange]. Choose from
2975 % these types: CharPixel, DoublePixel, FloatPixel, IntegerPixel,
2976 % LongPixel, QuantumPixel, or ShortPixel.
2978 % o pixels: This array of values contain the pixel components as defined by
2979 % map and type. You must preallocate this array where the expected
2980 % length varies depending on the values of width, height, map, and type.
2983 WandExport MagickBooleanType MagickExportImagePixels(MagickWand *wand,
2984 const ssize_t x,const ssize_t y,const size_t columns,
2985 const size_t rows,const char *map,const StorageType storage,
2991 assert(wand != (MagickWand *) NULL);
2992 assert(wand->signature == WandSignature);
2993 if (IfMagickTrue(wand->debug))
2994 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2995 if (wand->images == (Image *) NULL)
2996 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2997 status=ExportImagePixels(wand->images,x,y,columns,rows,map,
2998 storage,pixels,wand->exception);
3003 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3007 % M a g i c k E x t e n t I m a g e %
3011 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3013 % MagickExtentImage() extends the image as defined by the geometry, gravity,
3014 % and wand background color. Set the (x,y) offset of the geometry to move
3015 % the original wand relative to the extended wand.
3017 % The format of the MagickExtentImage method is:
3019 % MagickBooleanType MagickExtentImage(MagickWand *wand,const size_t width,
3020 % const size_t height,const ssize_t x,const ssize_t y)
3022 % A description of each parameter follows:
3024 % o wand: the magick wand.
3026 % o width: the region width.
3028 % o height: the region height.
3030 % o x: the region x offset.
3032 % o y: the region y offset.
3035 WandExport MagickBooleanType MagickExtentImage(MagickWand *wand,
3036 const size_t width,const size_t height,const ssize_t x,const ssize_t y)
3044 assert(wand != (MagickWand *) NULL);
3045 assert(wand->signature == WandSignature);
3046 if (IfMagickTrue(wand->debug))
3047 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3048 if (wand->images == (Image *) NULL)
3049 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3051 extent.height=height;
3054 extent_image=ExtentImage(wand->images,&extent,wand->exception);
3055 if (extent_image == (Image *) NULL)
3056 return(MagickFalse);
3057 ReplaceImageInList(&wand->images,extent_image);
3062 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3066 % M a g i c k F l i p I m a g e %
3070 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3072 % MagickFlipImage() creates a vertical mirror image by reflecting the pixels
3073 % around the central x-axis.
3075 % The format of the MagickFlipImage method is:
3077 % MagickBooleanType MagickFlipImage(MagickWand *wand)
3079 % A description of each parameter follows:
3081 % o wand: the magick wand.
3084 WandExport MagickBooleanType MagickFlipImage(MagickWand *wand)
3089 assert(wand != (MagickWand *) NULL);
3090 assert(wand->signature == WandSignature);
3091 if (IfMagickTrue(wand->debug))
3092 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3093 if (wand->images == (Image *) NULL)
3094 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3095 flip_image=FlipImage(wand->images,wand->exception);
3096 if (flip_image == (Image *) NULL)
3097 return(MagickFalse);
3098 ReplaceImageInList(&wand->images,flip_image);
3103 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3107 % 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 %
3111 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3113 % MagickFloodfillPaintImage() changes the color value of any pixel that matches
3114 % target and is an immediate neighbor. If the method FillToBorderMethod is
3115 % specified, the color value is changed for any neighbor pixel that does not
3116 % match the bordercolor member of image.
3118 % The format of the MagickFloodfillPaintImage method is:
3120 % MagickBooleanType MagickFloodfillPaintImage(MagickWand *wand,
3121 % const PixelWand *fill,const double fuzz,const PixelWand *bordercolor,
3122 % const ssize_t x,const ssize_t y,const MagickBooleanType invert)
3124 % A description of each parameter follows:
3126 % o wand: the magick wand.
3128 % o fill: the floodfill color pixel wand.
3130 % o fuzz: By default target must match a particular pixel color
3131 % exactly. However, in many cases two colors may differ by a small amount.
3132 % The fuzz member of image defines how much tolerance is acceptable to
3133 % consider two colors as the same. For example, set fuzz to 10 and the
3134 % color red at intensities of 100 and 102 respectively are now interpreted
3135 % as the same color for the purposes of the floodfill.
3137 % o bordercolor: the border color pixel wand.
3139 % o x,y: the starting location of the operation.
3141 % o invert: paint any pixel that does not match the target color.
3144 WandExport MagickBooleanType MagickFloodfillPaintImage(MagickWand *wand,
3145 const PixelWand *fill,const double fuzz,const PixelWand *bordercolor,
3146 const ssize_t x,const ssize_t y,const MagickBooleanType invert)
3157 assert(wand != (MagickWand *) NULL);
3158 assert(wand->signature == WandSignature);
3159 if (IfMagickTrue(wand->debug))
3160 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3161 if (wand->images == (Image *) NULL)
3162 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3163 draw_info=CloneDrawInfo(wand->image_info,(DrawInfo *) NULL);
3164 PixelGetQuantumPacket(fill,&draw_info->fill);
3165 (void) GetOneVirtualPixelInfo(wand->images,TileVirtualPixelMethod,x %
3166 wand->images->columns,y % wand->images->rows,&target,wand->exception);
3167 if (bordercolor != (PixelWand *) NULL)
3168 PixelGetMagickColor(bordercolor,&target);
3169 wand->images->fuzz=fuzz;
3170 status=FloodfillPaintImage(wand->images,draw_info,&target,x,y,invert,
3172 draw_info=DestroyDrawInfo(draw_info);
3177 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3181 % M a g i c k F l o p I m a g e %
3185 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3187 % MagickFlopImage() creates a horizontal mirror image by reflecting the pixels
3188 % around the central y-axis.
3190 % The format of the MagickFlopImage method is:
3192 % MagickBooleanType MagickFlopImage(MagickWand *wand)
3194 % A description of each parameter follows:
3196 % o wand: the magick wand.
3199 WandExport MagickBooleanType MagickFlopImage(MagickWand *wand)
3204 assert(wand != (MagickWand *) NULL);
3205 assert(wand->signature == WandSignature);
3206 if (IfMagickTrue(wand->debug))
3207 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3208 if (wand->images == (Image *) NULL)
3209 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3210 flop_image=FlopImage(wand->images,wand->exception);
3211 if (flop_image == (Image *) NULL)
3212 return(MagickFalse);
3213 ReplaceImageInList(&wand->images,flop_image);
3218 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3222 % 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 %
3226 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3228 % MagickForwardFourierTransformImage() implements the discrete Fourier
3229 % transform (DFT) of the image either as a magnitude / phase or real /
3230 % imaginary image pair.
3232 % The format of the MagickForwardFourierTransformImage method is:
3234 % MagickBooleanType MagickForwardFourierTransformImage(MagickWand *wand,
3235 % const MagickBooleanType magnitude)
3237 % A description of each parameter follows:
3239 % o wand: the magick wand.
3241 % o magnitude: if true, return as magnitude / phase pair otherwise a real /
3242 % imaginary image pair.
3245 WandExport MagickBooleanType MagickForwardFourierTransformImage(
3246 MagickWand *wand,const MagickBooleanType magnitude)
3251 assert(wand != (MagickWand *) NULL);
3252 assert(wand->signature == WandSignature);
3253 if (IfMagickTrue(wand->debug))
3254 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3255 if (wand->images == (Image *) NULL)
3256 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3257 forward_image=ForwardFourierTransformImage(wand->images,magnitude,
3259 if (forward_image == (Image *) NULL)
3260 return(MagickFalse);
3261 ReplaceImageInList(&wand->images,forward_image);
3266 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3270 % M a g i c k F r a m e I m a g e %
3274 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3276 % MagickFrameImage() adds a simulated three-dimensional border around the
3277 % image. The width and height specify the border width of the vertical and
3278 % horizontal sides of the frame. The inner and outer bevels indicate the
3279 % width of the inner and outer shadows of the frame.
3281 % The format of the MagickFrameImage method is:
3283 % MagickBooleanType MagickFrameImage(MagickWand *wand,
3284 % const PixelWand *matte_color,const size_t width,
3285 % const size_t height,const ssize_t inner_bevel,
3286 % const ssize_t outer_bevel,const CompositeOperator compose)
3288 % A description of each parameter follows:
3290 % o wand: the magick wand.
3292 % o matte_color: the frame color pixel wand.
3294 % o width: the border width.
3296 % o height: the border height.
3298 % o inner_bevel: the inner bevel width.
3300 % o outer_bevel: the outer bevel width.
3302 % o compose: the composite operator.
3305 WandExport MagickBooleanType MagickFrameImage(MagickWand *wand,
3306 const PixelWand *matte_color,const size_t width,const size_t height,
3307 const ssize_t inner_bevel,const ssize_t outer_bevel,
3308 const CompositeOperator compose)
3316 assert(wand != (MagickWand *) NULL);
3317 assert(wand->signature == WandSignature);
3318 if (IfMagickTrue(wand->debug))
3319 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3320 if (wand->images == (Image *) NULL)
3321 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3322 (void) ResetMagickMemory(&frame_info,0,sizeof(frame_info));
3323 frame_info.width=wand->images->columns+2*width;
3324 frame_info.height=wand->images->rows+2*height;
3325 frame_info.x=(ssize_t) width;
3326 frame_info.y=(ssize_t) height;
3327 frame_info.inner_bevel=inner_bevel;
3328 frame_info.outer_bevel=outer_bevel;
3329 PixelGetQuantumPacket(matte_color,&wand->images->matte_color);
3330 frame_image=FrameImage(wand->images,&frame_info,compose,wand->exception);
3331 if (frame_image == (Image *) NULL)
3332 return(MagickFalse);
3333 ReplaceImageInList(&wand->images,frame_image);
3338 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3342 % M a g i c k F u n c t i o n I m a g e %
3346 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3348 % MagickFunctionImage() applys an arithmetic, relational, or logical
3349 % expression to an image. Use these operators to lighten or darken an image,
3350 % to increase or decrease contrast in an image, or to produce the "negative"
3353 % The format of the MagickFunctionImage method is:
3355 % MagickBooleanType MagickFunctionImage(MagickWand *wand,
3356 % const MagickFunction function,const size_t number_arguments,
3357 % const double *arguments)
3359 % A description of each parameter follows:
3361 % o wand: the magick wand.
3363 % o function: the image function.
3365 % o number_arguments: the number of function arguments.
3367 % o arguments: the function arguments.
3370 WandExport MagickBooleanType MagickFunctionImage(MagickWand *wand,
3371 const MagickFunction function,const size_t number_arguments,
3372 const double *arguments)
3377 assert(wand != (MagickWand *) NULL);
3378 assert(wand->signature == WandSignature);
3379 if (IfMagickTrue(wand->debug))
3380 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3381 if (wand->images == (Image *) NULL)
3382 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3383 status=FunctionImage(wand->images,function,number_arguments,arguments,
3389 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3393 % M a g i c k F x I m a g e %
3397 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3399 % MagickFxImage() evaluate expression for each pixel in the image.
3401 % The format of the MagickFxImage method is:
3403 % MagickWand *MagickFxImage(MagickWand *wand,const char *expression)
3405 % A description of each parameter follows:
3407 % o wand: the magick wand.
3409 % o expression: the expression.
3412 WandExport MagickWand *MagickFxImage(MagickWand *wand,const char *expression)
3417 assert(wand != (MagickWand *) NULL);
3418 assert(wand->signature == WandSignature);
3419 if (IfMagickTrue(wand->debug))
3420 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3421 if (wand->images == (Image *) NULL)
3422 return((MagickWand *) NULL);
3423 fx_image=FxImage(wand->images,expression,wand->exception);
3424 if (fx_image == (Image *) NULL)
3425 return((MagickWand *) NULL);
3426 return(CloneMagickWandFromImages(wand,fx_image));
3430 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3434 % M a g i c k G a m m a I m a g e %
3438 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3440 % MagickGammaImage() gamma-corrects an image. The same image viewed on
3441 % different devices will have perceptual differences in the way the image's
3442 % intensities are represented on the screen. Specify individual gamma levels
3443 % for the red, green, and blue channels, or adjust all three with the gamma
3444 % parameter. Values typically range from 0.8 to 2.3.
3446 % You can also reduce the influence of a particular channel with a gamma
3449 % The format of the MagickGammaImage method is:
3451 % MagickBooleanType MagickGammaImage(MagickWand *wand,const double gamma)
3453 % A description of each parameter follows:
3455 % o wand: the magick wand.
3457 % o level: Define the level of gamma correction.
3460 WandExport MagickBooleanType MagickGammaImage(MagickWand *wand,
3466 assert(wand != (MagickWand *) NULL);
3467 assert(wand->signature == WandSignature);
3468 if (IfMagickTrue(wand->debug))
3469 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3470 if (wand->images == (Image *) NULL)
3471 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3472 status=GammaImage(wand->images,gamma,wand->exception);
3477 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3481 % M a g i c k G a u s s i a n B l u r I m a g e %
3485 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3487 % MagickGaussianBlurImage() blurs an image. We convolve the image with a
3488 % Gaussian operator of the given radius and standard deviation (sigma).
3489 % For reasonable results, the radius should be larger than sigma. Use a
3490 % radius of 0 and MagickGaussianBlurImage() selects a suitable radius for you.
3492 % The format of the MagickGaussianBlurImage method is:
3494 % MagickBooleanType MagickGaussianBlurImage(MagickWand *wand,
3495 % const double radius,const double sigma)
3497 % A description of each parameter follows:
3499 % o wand: the magick wand.
3501 % o radius: the radius of the Gaussian, in pixels, not counting the center
3504 % o sigma: the standard deviation of the Gaussian, in pixels.
3507 WandExport MagickBooleanType MagickGaussianBlurImage(MagickWand *wand,
3508 const double radius,const double sigma)
3513 assert(wand != (MagickWand *) NULL);
3514 assert(wand->signature == WandSignature);
3515 if (IfMagickTrue(wand->debug))
3516 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3517 if (wand->images == (Image *) NULL)
3518 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3519 blur_image=GaussianBlurImage(wand->images,radius,sigma,wand->exception);
3520 if (blur_image == (Image *) NULL)
3521 return(MagickFalse);
3522 ReplaceImageInList(&wand->images,blur_image);
3527 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3531 % M a g i c k G e t I m a g e %
3535 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3537 % MagickGetImage() gets the image at the current image index.
3539 % The format of the MagickGetImage method is:
3541 % MagickWand *MagickGetImage(MagickWand *wand)
3543 % A description of each parameter follows:
3545 % o wand: the magick wand.
3548 WandExport MagickWand *MagickGetImage(MagickWand *wand)
3553 assert(wand != (MagickWand *) NULL);
3554 assert(wand->signature == WandSignature);
3555 if (IfMagickTrue(wand->debug))
3556 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3557 if (wand->images == (Image *) NULL)
3559 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3560 "ContainsNoImages","`%s'",wand->name);
3561 return((MagickWand *) NULL);
3563 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
3564 if (image == (Image *) NULL)
3565 return((MagickWand *) NULL);
3566 return(CloneMagickWandFromImages(wand,image));
3570 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3574 % 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 %
3578 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3580 % MagickGetImageAlphaChannel() returns MagickFalse if the image alpha channel
3581 % is not activated. That is, the image is RGB rather than RGBA or CMYK rather
3584 % The format of the MagickGetImageAlphaChannel method is:
3586 % size_t MagickGetImageAlphaChannel(MagickWand *wand)
3588 % A description of each parameter follows:
3590 % o wand: the magick wand.
3593 WandExport MagickBooleanType MagickGetImageAlphaChannel(MagickWand *wand)
3595 assert(wand != (MagickWand *) NULL);
3596 assert(wand->signature == WandSignature);
3597 if (IfMagickTrue(wand->debug))
3598 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3599 if (wand->images == (Image *) NULL)
3600 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3601 return(GetImageAlphaChannel(wand->images));
3605 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3609 % M a g i c k G e t I m a g e C l i p M a s k %
3613 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3615 % MagickGetImageMask() gets the image clip mask at the current image index.
3617 % The format of the MagickGetImageMask method is:
3619 % MagickWand *MagickGetImageMask(MagickWand *wand)
3621 % A description of each parameter follows:
3623 % o wand: the magick wand.
3626 WandExport MagickWand *MagickGetImageMask(MagickWand *wand)
3631 assert(wand != (MagickWand *) NULL);
3632 assert(wand->signature == WandSignature);
3633 if (IfMagickTrue(wand->debug))
3634 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3635 if (wand->images == (Image *) NULL)
3637 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3638 "ContainsNoImages","`%s'",wand->name);
3639 return((MagickWand *) NULL);
3641 image=GetImageMask(wand->images,wand->exception);
3642 if (image == (Image *) NULL)
3643 return((MagickWand *) NULL);
3644 return(CloneMagickWandFromImages(wand,image));
3648 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3652 % 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 %
3656 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3658 % MagickGetImageBackgroundColor() returns the image background color.
3660 % The format of the MagickGetImageBackgroundColor method is:
3662 % MagickBooleanType MagickGetImageBackgroundColor(MagickWand *wand,
3663 % PixelWand *background_color)
3665 % A description of each parameter follows:
3667 % o wand: the magick wand.
3669 % o background_color: Return the background color.
3672 WandExport MagickBooleanType MagickGetImageBackgroundColor(MagickWand *wand,
3673 PixelWand *background_color)
3675 assert(wand != (MagickWand *) NULL);
3676 assert(wand->signature == WandSignature);
3677 if (IfMagickTrue(wand->debug))
3678 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3679 if (wand->images == (Image *) NULL)
3680 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3681 PixelSetPixelColor(background_color,&wand->images->background_color);
3686 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3690 % M a g i c k G e t I m a g e B l o b %
3694 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3696 % MagickGetImageBlob() implements direct to memory image formats. It returns
3697 % the image as a blob (a formatted "file" in memory) and its length, starting
3698 % from the current position in the image sequence. Use MagickSetImageFormat()
3699 % to set the format to write to the blob (GIF, JPEG, PNG, etc.).
3701 % Utilize MagickResetIterator() to ensure the write is from the beginning of
3702 % the image sequence.
3704 % Use MagickRelinquishMemory() to free the blob when you are done with it.
3706 % The format of the MagickGetImageBlob method is:
3708 % unsigned char *MagickGetImageBlob(MagickWand *wand,size_t *length)
3710 % A description of each parameter follows:
3712 % o wand: the magick wand.
3714 % o length: the length of the blob.
3717 WandExport unsigned char *MagickGetImageBlob(MagickWand *wand,size_t *length)
3719 assert(wand != (MagickWand *) NULL);
3720 assert(wand->signature == WandSignature);
3721 if (IfMagickTrue(wand->debug))
3722 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3723 if (wand->images == (Image *) NULL)
3725 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3726 "ContainsNoImages","`%s'",wand->name);
3727 return((unsigned char *) NULL);
3729 return(ImageToBlob(wand->image_info,wand->images,length,wand->exception));
3733 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3737 % M a g i c k G e t I m a g e s B l o b %
3741 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3743 % MagickGetImageBlob() implements direct to memory image formats. It
3744 % returns the image sequence as a blob and its length. The format of the image
3745 % determines the format of the returned blob (GIF, JPEG, PNG, etc.). To
3746 % return a different image format, use MagickSetImageFormat().
3748 % Note, some image formats do not permit multiple images to the same image
3749 % stream (e.g. JPEG). in this instance, just the first image of the
3750 % sequence is returned as a blob.
3752 % The format of the MagickGetImagesBlob method is:
3754 % unsigned char *MagickGetImagesBlob(MagickWand *wand,size_t *length)
3756 % A description of each parameter follows:
3758 % o wand: the magick wand.
3760 % o length: the length of the blob.
3763 WandExport unsigned char *MagickGetImagesBlob(MagickWand *wand,size_t *length)
3768 assert(wand != (MagickWand *) NULL);
3769 assert(wand->signature == WandSignature);
3770 if (IfMagickTrue(wand->debug))
3771 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3772 if (wand->images == (Image *) NULL)
3774 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3775 "ContainsNoImages","`%s'",wand->name);
3776 return((unsigned char *) NULL);
3778 blob=ImagesToBlob(wand->image_info,GetFirstImageInList(wand->images),length,
3784 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3788 % 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 %
3792 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3794 % MagickGetImageBluePrimary() returns the chromaticy blue primary point for the
3797 % The format of the MagickGetImageBluePrimary method is:
3799 % MagickBooleanType MagickGetImageBluePrimary(MagickWand *wand,double *x,
3802 % A description of each parameter follows:
3804 % o wand: the magick wand.
3806 % o x: the chromaticity blue primary x-point.
3808 % o y: the chromaticity blue primary y-point.
3811 WandExport MagickBooleanType MagickGetImageBluePrimary(MagickWand *wand,
3812 double *x,double *y)
3814 assert(wand != (MagickWand *) NULL);
3815 assert(wand->signature == WandSignature);
3816 if (IfMagickTrue(wand->debug))
3817 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3818 if (wand->images == (Image *) NULL)
3819 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3820 *x=wand->images->chromaticity.blue_primary.x;
3821 *y=wand->images->chromaticity.blue_primary.y;
3826 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3830 % 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 %
3834 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3836 % MagickGetImageBorderColor() returns the image border color.
3838 % The format of the MagickGetImageBorderColor method is:
3840 % MagickBooleanType MagickGetImageBorderColor(MagickWand *wand,
3841 % PixelWand *border_color)
3843 % A description of each parameter follows:
3845 % o wand: the magick wand.
3847 % o border_color: Return the border color.
3850 WandExport MagickBooleanType MagickGetImageBorderColor(MagickWand *wand,
3851 PixelWand *border_color)
3853 assert(wand != (MagickWand *) NULL);
3854 assert(wand->signature == WandSignature);
3855 if (IfMagickTrue(wand->debug))
3856 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3857 if (wand->images == (Image *) NULL)
3858 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3859 PixelSetPixelColor(border_color,&wand->images->border_color);
3864 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3868 % M a g i c k G e t I m a g e F e a t u r e s %
3872 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3874 % MagickGetImageFeatures() returns features for each channel in the
3875 % image in each of four directions (horizontal, vertical, left and right
3876 % diagonals) for the specified distance. The features include the angular
3877 % second moment, contrast, correlation, sum of squares: variance, inverse
3878 % difference moment, sum average, sum varience, sum entropy, entropy,
3879 % difference variance, difference entropy, information measures of
3880 % correlation 1, information measures of correlation 2, and maximum
3881 % correlation coefficient. You can access the red channel contrast, for
3882 % example, like this:
3884 % channel_features=MagickGetImageFeatures(wand,1);
3885 % contrast=channel_features[RedPixelChannel].contrast[0];
3887 % Use MagickRelinquishMemory() to free the statistics buffer.
3889 % The format of the MagickGetImageFeatures method is:
3891 % ChannelFeatures *MagickGetImageFeatures(MagickWand *wand,
3892 % const size_t distance)
3894 % A description of each parameter follows:
3896 % o wand: the magick wand.
3898 % o distance: the distance.
3901 WandExport ChannelFeatures *MagickGetImageFeatures(MagickWand *wand,
3902 const size_t distance)
3904 assert(wand != (MagickWand *) NULL);
3905 assert(wand->signature == WandSignature);
3906 if (IfMagickTrue(wand->debug))
3907 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3908 if (wand->images == (Image *) NULL)
3910 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3911 "ContainsNoImages","`%s'",wand->name);
3912 return((ChannelFeatures *) NULL);
3914 return(GetImageFeatures(wand->images,distance,wand->exception));
3918 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3922 % M a g i c k G e t I m a g e K u r t o s i s %
3926 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3928 % MagickGetImageKurtosis() gets the kurtosis and skewness of one or
3929 % more image channels.
3931 % The format of the MagickGetImageKurtosis method is:
3933 % MagickBooleanType MagickGetImageKurtosis(MagickWand *wand,
3934 % double *kurtosis,double *skewness)
3936 % A description of each parameter follows:
3938 % o wand: the magick wand.
3940 % o kurtosis: The kurtosis for the specified channel(s).
3942 % o skewness: The skewness for the specified channel(s).
3945 WandExport MagickBooleanType MagickGetImageKurtosis(MagickWand *wand,
3946 double *kurtosis,double *skewness)
3951 assert(wand != (MagickWand *) NULL);
3952 assert(wand->signature == WandSignature);
3953 if (IfMagickTrue(wand->debug))
3954 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3955 if (wand->images == (Image *) NULL)
3956 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3957 status=GetImageKurtosis(wand->images,kurtosis,skewness,wand->exception);
3962 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3966 % M a g i c k G e t I m a g e M e a n %
3970 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3972 % MagickGetImageMean() gets the mean and standard deviation of one or more
3975 % The format of the MagickGetImageMean method is:
3977 % MagickBooleanType MagickGetImageMean(MagickWand *wand,double *mean,
3978 % double *standard_deviation)
3980 % A description of each parameter follows:
3982 % o wand: the magick wand.
3984 % o channel: the image channel(s).
3986 % o mean: The mean pixel value for the specified channel(s).
3988 % o standard_deviation: The standard deviation for the specified channel(s).
3991 WandExport MagickBooleanType MagickGetImageMean(MagickWand *wand,double *mean,
3992 double *standard_deviation)
3997 assert(wand != (MagickWand *) NULL);
3998 assert(wand->signature == WandSignature);
3999 if (IfMagickTrue(wand->debug))
4000 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4001 if (wand->images == (Image *) NULL)
4002 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4003 status=GetImageMean(wand->images,mean,standard_deviation,wand->exception);
4008 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4012 % M a g i c k G e t I m a g e R a n g e %
4016 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4018 % MagickGetImageRange() gets the range for one or more image channels.
4020 % The format of the MagickGetImageRange method is:
4022 % MagickBooleanType MagickGetImageRange(MagickWand *wand,double *minima,
4025 % A description of each parameter follows:
4027 % o wand: the magick wand.
4029 % o minima: The minimum pixel value for the specified channel(s).
4031 % o maxima: The maximum pixel value for the specified channel(s).
4034 WandExport MagickBooleanType MagickGetImageRange(MagickWand *wand,
4035 double *minima,double *maxima)
4040 assert(wand != (MagickWand *) NULL);
4041 assert(wand->signature == WandSignature);
4042 if (IfMagickTrue(wand->debug))
4043 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4044 if (wand->images == (Image *) NULL)
4045 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4046 status=GetImageRange(wand->images,minima,maxima,wand->exception);
4051 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4055 % M a g i c k G e t I m a g e S t a t i s t i c s %
4059 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4061 % MagickGetImageStatistics() returns statistics for each channel in the
4062 % image. The statistics include the channel depth, its minima and
4063 % maxima, the mean, the standard deviation, the kurtosis and the skewness.
4064 % You can access the red channel mean, for example, like this:
4066 % channel_statistics=MagickGetImageStatistics(wand);
4067 % red_mean=channel_statistics[RedPixelChannel].mean;
4069 % Use MagickRelinquishMemory() to free the statistics buffer.
4071 % The format of the MagickGetImageStatistics method is:
4073 % ChannelStatistics *MagickGetImageStatistics(MagickWand *wand)
4075 % A description of each parameter follows:
4077 % o wand: the magick wand.
4080 WandExport ChannelStatistics *MagickGetImageStatistics(MagickWand *wand)
4082 assert(wand != (MagickWand *) NULL);
4083 assert(wand->signature == WandSignature);
4084 if (IfMagickTrue(wand->debug))
4085 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4086 if (wand->images == (Image *) NULL)
4088 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4089 "ContainsNoImages","`%s'",wand->name);
4090 return((ChannelStatistics *) NULL);
4092 return(GetImageStatistics(wand->images,wand->exception));
4096 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4100 % 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 %
4104 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4106 % MagickGetImageColormapColor() returns the color of the specified colormap
4109 % The format of the MagickGetImageColormapColor method is:
4111 % MagickBooleanType MagickGetImageColormapColor(MagickWand *wand,
4112 % const size_t index,PixelWand *color)
4114 % A description of each parameter follows:
4116 % o wand: the magick wand.
4118 % o index: the offset into the image colormap.
4120 % o color: Return the colormap color in this wand.
4123 WandExport MagickBooleanType MagickGetImageColormapColor(MagickWand *wand,
4124 const size_t index,PixelWand *color)
4126 assert(wand != (MagickWand *) NULL);
4127 assert(wand->signature == WandSignature);
4128 if (IfMagickTrue(wand->debug))
4129 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4130 if (wand->images == (Image *) NULL)
4131 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4132 if ((wand->images->colormap == (PixelInfo *) NULL) ||
4133 (index >= wand->images->colors))
4135 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4136 "InvalidColormapIndex","`%s'",wand->name);
4137 return(MagickFalse);
4139 PixelSetPixelColor(color,wand->images->colormap+index);
4144 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4148 % M a g i c k G e t I m a g e C o l o r s %
4152 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4154 % MagickGetImageColors() gets the number of unique colors in the image.
4156 % The format of the MagickGetImageColors method is:
4158 % size_t MagickGetImageColors(MagickWand *wand)
4160 % A description of each parameter follows:
4162 % o wand: the magick wand.
4165 WandExport size_t MagickGetImageColors(MagickWand *wand)
4167 assert(wand != (MagickWand *) NULL);
4168 assert(wand->signature == WandSignature);
4169 if (IfMagickTrue(wand->debug))
4170 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4171 if (wand->images == (Image *) NULL)
4173 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4174 "ContainsNoImages","`%s'",wand->name);
4177 return(GetNumberColors(wand->images,(FILE *) NULL,wand->exception));
4181 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4185 % M a g i c k G e t I m a g e C o l o r s p a c e %
4189 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4191 % MagickGetImageColorspace() gets the image colorspace.
4193 % The format of the MagickGetImageColorspace method is:
4195 % ColorspaceType MagickGetImageColorspace(MagickWand *wand)
4197 % A description of each parameter follows:
4199 % o wand: the magick wand.
4202 WandExport ColorspaceType MagickGetImageColorspace(MagickWand *wand)
4204 assert(wand != (MagickWand *) NULL);
4205 assert(wand->signature == WandSignature);
4206 if (IfMagickTrue(wand->debug))
4207 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4208 if (wand->images == (Image *) NULL)
4210 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4211 "ContainsNoImages","`%s'",wand->name);
4212 return(UndefinedColorspace);
4214 return(wand->images->colorspace);
4218 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4222 % M a g i c k G e t I m a g e C o m p o s e %
4226 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4228 % MagickGetImageCompose() returns the composite operator associated with the
4231 % The format of the MagickGetImageCompose method is:
4233 % CompositeOperator MagickGetImageCompose(MagickWand *wand)
4235 % A description of each parameter follows:
4237 % o wand: the magick wand.
4240 WandExport CompositeOperator MagickGetImageCompose(MagickWand *wand)
4242 assert(wand != (MagickWand *) NULL);
4243 assert(wand->signature == WandSignature);
4244 if (IfMagickTrue(wand->debug))
4245 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4246 if (wand->images == (Image *) NULL)
4248 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4249 "ContainsNoImages","`%s'",wand->name);
4250 return(UndefinedCompositeOp);
4252 return(wand->images->compose);
4256 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4260 % 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 %
4264 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4266 % MagickGetImageCompression() gets the image compression.
4268 % The format of the MagickGetImageCompression method is:
4270 % CompressionType MagickGetImageCompression(MagickWand *wand)
4272 % A description of each parameter follows:
4274 % o wand: the magick wand.
4277 WandExport CompressionType MagickGetImageCompression(MagickWand *wand)
4279 assert(wand != (MagickWand *) NULL);
4280 assert(wand->signature == WandSignature);
4281 if (IfMagickTrue(wand->debug))
4282 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4283 if (wand->images == (Image *) NULL)
4285 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4286 "ContainsNoImages","`%s'",wand->name);
4287 return(UndefinedCompression);
4289 return(wand->images->compression);
4293 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4297 % 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 %
4301 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4303 % MagickGetImageCompressionQuality() gets the image compression quality.
4305 % The format of the MagickGetImageCompressionQuality method is:
4307 % size_t MagickGetImageCompressionQuality(MagickWand *wand)
4309 % A description of each parameter follows:
4311 % o wand: the magick wand.
4314 WandExport size_t MagickGetImageCompressionQuality(MagickWand *wand)
4316 assert(wand != (MagickWand *) NULL);
4317 assert(wand->signature == WandSignature);
4318 if (IfMagickTrue(wand->debug))
4319 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4320 if (wand->images == (Image *) NULL)
4322 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4323 "ContainsNoImages","`%s'",wand->name);
4326 return(wand->images->quality);
4330 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4334 % M a g i c k G e t I m a g e D e l a y %
4338 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4340 % MagickGetImageDelay() gets the image delay.
4342 % The format of the MagickGetImageDelay method is:
4344 % size_t MagickGetImageDelay(MagickWand *wand)
4346 % A description of each parameter follows:
4348 % o wand: the magick wand.
4351 WandExport size_t MagickGetImageDelay(MagickWand *wand)
4353 assert(wand != (MagickWand *) NULL);
4354 assert(wand->signature == WandSignature);
4355 if (IfMagickTrue(wand->debug))
4356 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4357 if (wand->images == (Image *) NULL)
4358 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4359 return(wand->images->delay);
4363 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4367 % M a g i c k G e t I m a g e D e p t h %
4371 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4373 % MagickGetImageDepth() gets the image depth.
4375 % The format of the MagickGetImageDepth method is:
4377 % size_t MagickGetImageDepth(MagickWand *wand)
4379 % A description of each parameter follows:
4381 % o wand: the magick wand.
4384 WandExport size_t MagickGetImageDepth(MagickWand *wand)
4386 assert(wand != (MagickWand *) NULL);
4387 assert(wand->signature == WandSignature);
4388 if (IfMagickTrue(wand->debug))
4389 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4390 if (wand->images == (Image *) NULL)
4391 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4392 return(wand->images->depth);
4396 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4400 % M a g i c k G e t I m a g e D i s p o s e %
4404 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4406 % MagickGetImageDispose() gets the image disposal method.
4408 % The format of the MagickGetImageDispose method is:
4410 % DisposeType MagickGetImageDispose(MagickWand *wand)
4412 % A description of each parameter follows:
4414 % o wand: the magick wand.
4417 WandExport DisposeType MagickGetImageDispose(MagickWand *wand)
4419 assert(wand != (MagickWand *) NULL);
4420 assert(wand->signature == WandSignature);
4421 if (IfMagickTrue(wand->debug))
4422 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4423 if (wand->images == (Image *) NULL)
4425 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4426 "ContainsNoImages","`%s'",wand->name);
4427 return(UndefinedDispose);
4429 return((DisposeType) wand->images->dispose);
4433 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4437 % M a g i c k G e t I m a g e D i s t o r t i o n %
4441 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4443 % MagickGetImageDistortion() compares an image to a reconstructed image and
4444 % returns the specified distortion metric.
4446 % The format of the MagickGetImageDistortion method is:
4448 % MagickBooleanType MagickGetImageDistortion(MagickWand *wand,
4449 % const MagickWand *reference,const MetricType metric,
4450 % double *distortion)
4452 % A description of each parameter follows:
4454 % o wand: the magick wand.
4456 % o reference: the reference wand.
4458 % o metric: the metric.
4460 % o distortion: the computed distortion between the images.
4463 WandExport MagickBooleanType MagickGetImageDistortion(MagickWand *wand,
4464 const MagickWand *reference,const MetricType metric,double *distortion)
4469 assert(wand != (MagickWand *) NULL);
4470 assert(wand->signature == WandSignature);
4471 if (IfMagickTrue(wand->debug))
4472 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4473 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
4474 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4475 status=GetImageDistortion(wand->images,reference->images,metric,distortion,
4481 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4485 % 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 %
4489 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4491 % MagickGetImageDistortions() compares one or more pixel channels of an
4492 % image to a reconstructed image and returns the specified distortion metrics.
4494 % Use MagickRelinquishMemory() to free the metrics when you are done with them.
4496 % The format of the MagickGetImageDistortion method is:
4498 % double *MagickGetImageDistortion(MagickWand *wand,
4499 % const MagickWand *reference,const MetricType metric)
4501 % A description of each parameter follows:
4503 % o wand: the magick wand.
4505 % o reference: the reference wand.
4507 % o metric: the metric.
4510 WandExport double *MagickGetImageDistortions(MagickWand *wand,
4511 const MagickWand *reference,const MetricType metric)
4514 *channel_distortion;
4516 assert(wand != (MagickWand *) NULL);
4517 assert(wand->signature == WandSignature);
4518 if (IfMagickTrue(wand->debug))
4519 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4520 assert(reference != (MagickWand *) NULL);
4521 assert(reference->signature == WandSignature);
4522 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
4524 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4525 "ContainsNoImages","`%s'",wand->name);
4526 return((double *) NULL);
4528 channel_distortion=GetImageDistortions(wand->images,reference->images,
4529 metric,wand->exception);
4530 return(channel_distortion);
4534 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4538 % M a g i c k G e t I m a g e E n d i a n %
4542 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4544 % MagickGetImageEndian() gets the image endian.
4546 % The format of the MagickGetImageEndian method is:
4548 % EndianType MagickGetImageEndian(MagickWand *wand)
4550 % A description of each parameter follows:
4552 % o wand: the magick wand.
4555 WandExport EndianType MagickGetImageEndian(MagickWand *wand)
4557 assert(wand != (MagickWand *) NULL);
4558 assert(wand->signature == WandSignature);
4559 if (IfMagickTrue(wand->debug))
4560 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4561 if (wand->images == (Image *) NULL)
4563 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4564 "ContainsNoImages","`%s'",wand->name);
4565 return(UndefinedEndian);
4567 return(wand->images->endian);
4571 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4575 % M a g i c k G e t I m a g e F i l e n a m e %
4579 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4581 % MagickGetImageFilename() returns the filename of a particular image in a
4584 % The format of the MagickGetImageFilename method is:
4586 % char *MagickGetImageFilename(MagickWand *wand)
4588 % A description of each parameter follows:
4590 % o wand: the magick wand.
4593 WandExport char *MagickGetImageFilename(MagickWand *wand)
4595 assert(wand != (MagickWand *) NULL);
4596 assert(wand->signature == WandSignature);
4597 if (IfMagickTrue(wand->debug))
4598 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4599 if (wand->images == (Image *) NULL)
4601 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4602 "ContainsNoImages","`%s'",wand->name);
4603 return((char *) NULL);
4605 return(AcquireString(wand->images->filename));
4609 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4613 % M a g i c k G e t I m a g e F o r m a t %
4617 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4619 % MagickGetImageFormat() returns the format of a particular image in a
4622 % The format of the MagickGetImageFormat method is:
4624 % char *MagickGetImageFormat(MagickWand *wand)
4626 % A description of each parameter follows:
4628 % o wand: the magick wand.
4631 WandExport char *MagickGetImageFormat(MagickWand *wand)
4633 assert(wand != (MagickWand *) NULL);
4634 assert(wand->signature == WandSignature);
4635 if (IfMagickTrue(wand->debug))
4636 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4637 if (wand->images == (Image *) NULL)
4639 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4640 "ContainsNoImages","`%s'",wand->name);
4641 return((char *) NULL);
4643 return(AcquireString(wand->images->magick));
4647 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4651 % M a g i c k G e t I m a g e F u z z %
4655 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4657 % MagickGetImageFuzz() gets the image fuzz.
4659 % The format of the MagickGetImageFuzz method is:
4661 % double MagickGetImageFuzz(MagickWand *wand)
4663 % A description of each parameter follows:
4665 % o wand: the magick wand.
4668 WandExport double MagickGetImageFuzz(MagickWand *wand)
4670 assert(wand != (MagickWand *) NULL);
4671 assert(wand->signature == WandSignature);
4672 if (IfMagickTrue(wand->debug))
4673 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4674 if (wand->images == (Image *) NULL)
4676 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4677 "ContainsNoImages","`%s'",wand->name);
4680 return(wand->images->fuzz);
4684 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4688 % M a g i c k G e t I m a g e G a m m a %
4692 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4694 % MagickGetImageGamma() gets the image gamma.
4696 % The format of the MagickGetImageGamma method is:
4698 % double MagickGetImageGamma(MagickWand *wand)
4700 % A description of each parameter follows:
4702 % o wand: the magick wand.
4705 WandExport double MagickGetImageGamma(MagickWand *wand)
4707 assert(wand != (MagickWand *) NULL);
4708 assert(wand->signature == WandSignature);
4709 if (IfMagickTrue(wand->debug))
4710 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4711 if (wand->images == (Image *) NULL)
4713 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4714 "ContainsNoImages","`%s'",wand->name);
4717 return(wand->images->gamma);
4721 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4725 % M a g i c k G e t I m a g e G r a v i t y %
4729 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4731 % MagickGetImageGravity() gets the image gravity.
4733 % The format of the MagickGetImageGravity method is:
4735 % GravityType MagickGetImageGravity(MagickWand *wand)
4737 % A description of each parameter follows:
4739 % o wand: the magick wand.
4742 WandExport GravityType MagickGetImageGravity(MagickWand *wand)
4744 assert(wand != (MagickWand *) NULL);
4745 assert(wand->signature == WandSignature);
4746 if (IfMagickTrue(wand->debug))
4747 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4748 if (wand->images == (Image *) NULL)
4750 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4751 "ContainsNoImages","`%s'",wand->name);
4752 return(UndefinedGravity);
4754 return(wand->images->gravity);
4758 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4762 % 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 %
4766 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4768 % MagickGetImageGreenPrimary() returns the chromaticy green primary point.
4770 % The format of the MagickGetImageGreenPrimary method is:
4772 % MagickBooleanType MagickGetImageGreenPrimary(MagickWand *wand,double *x,
4775 % A description of each parameter follows:
4777 % o wand: the magick wand.
4779 % o x: the chromaticity green primary x-point.
4781 % o y: the chromaticity green primary y-point.
4784 WandExport MagickBooleanType MagickGetImageGreenPrimary(MagickWand *wand,
4785 double *x,double *y)
4787 assert(wand != (MagickWand *) NULL);
4788 assert(wand->signature == WandSignature);
4789 if (IfMagickTrue(wand->debug))
4790 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4791 if (wand->images == (Image *) NULL)
4792 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4793 *x=wand->images->chromaticity.green_primary.x;
4794 *y=wand->images->chromaticity.green_primary.y;
4799 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4803 % M a g i c k G e t I m a g e H e i g h t %
4807 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4809 % MagickGetImageHeight() returns the image height.
4811 % The format of the MagickGetImageHeight method is:
4813 % size_t MagickGetImageHeight(MagickWand *wand)
4815 % A description of each parameter follows:
4817 % o wand: the magick wand.
4820 WandExport size_t MagickGetImageHeight(MagickWand *wand)
4822 assert(wand != (MagickWand *) NULL);
4823 assert(wand->signature == WandSignature);
4824 if (IfMagickTrue(wand->debug))
4825 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4826 if (wand->images == (Image *) NULL)
4827 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4828 return(wand->images->rows);
4832 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4836 % M a g i c k G e t I m a g e H i s t o g r a m %
4840 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4842 % MagickGetImageHistogram() returns the image histogram as an array of
4845 % The format of the MagickGetImageHistogram method is:
4847 % PixelWand **MagickGetImageHistogram(MagickWand *wand,
4848 % size_t *number_colors)
4850 % A description of each parameter follows:
4852 % o wand: the magick wand.
4854 % o number_colors: the number of unique colors in the image and the number
4855 % of pixel wands returned.
4858 WandExport PixelWand **MagickGetImageHistogram(MagickWand *wand,
4859 size_t *number_colors)
4870 assert(wand != (MagickWand *) NULL);
4871 assert(wand->signature == WandSignature);
4872 if (IfMagickTrue(wand->debug))
4873 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4874 if (wand->images == (Image *) NULL)
4876 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4877 "ContainsNoImages","`%s'",wand->name);
4878 return((PixelWand **) NULL);
4880 histogram=GetImageHistogram(wand->images,number_colors,wand->exception);
4881 if (histogram == (PixelInfo *) NULL)
4882 return((PixelWand **) NULL);
4883 pixel_wands=NewPixelWands(*number_colors);
4884 for (i=0; i < (ssize_t) *number_colors; i++)
4886 PixelSetPixelColor(pixel_wands[i],&histogram[i]);
4887 PixelSetColorCount(pixel_wands[i],(size_t) histogram[i].count);
4889 histogram=(PixelInfo *) RelinquishMagickMemory(histogram);
4890 return(pixel_wands);
4894 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4898 % 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 %
4902 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4904 % MagickGetImageInterlaceScheme() gets the image interlace scheme.
4906 % The format of the MagickGetImageInterlaceScheme method is:
4908 % InterlaceType MagickGetImageInterlaceScheme(MagickWand *wand)
4910 % A description of each parameter follows:
4912 % o wand: the magick wand.
4915 WandExport InterlaceType MagickGetImageInterlaceScheme(MagickWand *wand)
4917 assert(wand != (MagickWand *) NULL);
4918 assert(wand->signature == WandSignature);
4919 if (IfMagickTrue(wand->debug))
4920 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4921 if (wand->images == (Image *) NULL)
4923 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4924 "ContainsNoImages","`%s'",wand->name);
4925 return(UndefinedInterlace);
4927 return(wand->images->interlace);
4931 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4935 % 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 %
4939 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4941 % MagickGetImageInterpolateMethod() returns the interpolation method for the
4944 % The format of the MagickGetImageInterpolateMethod method is:
4946 % PixelInterpolateMethod MagickGetImagePixelInterpolateMethod(
4949 % A description of each parameter follows:
4951 % o wand: the magick wand.
4954 WandExport PixelInterpolateMethod MagickGetImageInterpolateMethod(
4957 assert(wand != (MagickWand *) NULL);
4958 assert(wand->signature == WandSignature);
4959 if (IfMagickTrue(wand->debug))
4960 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4961 if (wand->images == (Image *) NULL)
4963 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4964 "ContainsNoImages","`%s'",wand->name);
4965 return(UndefinedInterpolatePixel);
4967 return(wand->images->interpolate);
4971 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4975 % M a g i c k G e t I m a g e I t e r a t i o n s %
4979 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4981 % MagickGetImageIterations() gets the image iterations.
4983 % The format of the MagickGetImageIterations method is:
4985 % size_t MagickGetImageIterations(MagickWand *wand)
4987 % A description of each parameter follows:
4989 % o wand: the magick wand.
4992 WandExport size_t MagickGetImageIterations(MagickWand *wand)
4994 assert(wand != (MagickWand *) NULL);
4995 assert(wand->signature == WandSignature);
4996 if (IfMagickTrue(wand->debug))
4997 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4998 if (wand->images == (Image *) NULL)
4999 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5000 return(wand->images->iterations);
5004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5008 % M a g i c k G e t I m a g e L e n g t h %
5012 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5014 % MagickGetImageLength() returns the image length in bytes.
5016 % The format of the MagickGetImageLength method is:
5018 % MagickBooleanType MagickGetImageLength(MagickWand *wand,
5019 % MagickSizeType *length)
5021 % A description of each parameter follows:
5023 % o wand: the magick wand.
5025 % o length: the image length in bytes.
5028 WandExport MagickBooleanType MagickGetImageLength(MagickWand *wand,
5029 MagickSizeType *length)
5031 assert(wand != (MagickWand *) NULL);
5032 assert(wand->signature == WandSignature);
5033 if (IfMagickTrue(wand->debug))
5034 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5035 if (wand->images == (Image *) NULL)
5036 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5037 *length=GetBlobSize(wand->images);
5042 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5046 % M a g i c k G e t I m a g e M a t t e C o l o r %
5050 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5052 % MagickGetImageMatteColor() returns the image matte color.
5054 % The format of the MagickGetImageMatteColor method is:
5056 % MagickBooleanType MagickGetImagematteColor(MagickWand *wand,
5057 % PixelWand *matte_color)
5059 % A description of each parameter follows:
5061 % o wand: the magick wand.
5063 % o matte_color: Return the matte color.
5066 WandExport MagickBooleanType MagickGetImageMatteColor(MagickWand *wand,
5067 PixelWand *matte_color)
5069 assert(wand != (MagickWand *) NULL);
5070 assert(wand->signature == WandSignature);
5071 if (IfMagickTrue(wand->debug))
5072 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5073 if (wand->images == (Image *) NULL)
5074 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5075 PixelSetPixelColor(matte_color,&wand->images->matte_color);
5080 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5084 % 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 %
5088 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5090 % MagickGetImageOrientation() returns the image orientation.
5092 % The format of the MagickGetImageOrientation method is:
5094 % OrientationType MagickGetImageOrientation(MagickWand *wand)
5096 % A description of each parameter follows:
5098 % o wand: the magick wand.
5101 WandExport OrientationType MagickGetImageOrientation(MagickWand *wand)
5103 assert(wand != (MagickWand *) NULL);
5104 assert(wand->signature == WandSignature);
5105 if (IfMagickTrue(wand->debug))
5106 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5107 if (wand->images == (Image *) NULL)
5109 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5110 "ContainsNoImages","`%s'",wand->name);
5111 return(UndefinedOrientation);
5113 return(wand->images->orientation);
5117 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5121 % M a g i c k G e t I m a g e P a g e %
5125 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5127 % MagickGetImagePage() returns the page geometry associated with the image.
5129 % The format of the MagickGetImagePage method is:
5131 % MagickBooleanType MagickGetImagePage(MagickWand *wand,
5132 % size_t *width,size_t *height,ssize_t *x,ssize_t *y)
5134 % A description of each parameter follows:
5136 % o wand: the magick wand.
5138 % o width: the page width.
5140 % o height: the page height.
5142 % o x: the page x-offset.
5144 % o y: the page y-offset.
5147 WandExport MagickBooleanType MagickGetImagePage(MagickWand *wand,
5148 size_t *width,size_t *height,ssize_t *x,ssize_t *y)
5150 assert(wand != (const MagickWand *) NULL);
5151 assert(wand->signature == WandSignature);
5152 if (IfMagickTrue(wand->debug))
5153 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5154 if (wand->images == (Image *) NULL)
5155 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5156 *width=wand->images->page.width;
5157 *height=wand->images->page.height;
5158 *x=wand->images->page.x;
5159 *y=wand->images->page.y;
5164 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5168 % M a g i c k G e t I m a g e P i x e l C o l o r %
5172 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5174 % MagickGetImagePixelColor() returns the color of the specified pixel.
5176 % The format of the MagickGetImagePixelColor method is:
5178 % MagickBooleanType MagickGetImagePixelColor(MagickWand *wand,
5179 % const ssize_t x,const ssize_t y,PixelWand *color)
5181 % A description of each parameter follows:
5183 % o wand: the magick wand.
5185 % o x,y: the pixel offset into the image.
5187 % o color: Return the colormap color in this wand.
5190 WandExport MagickBooleanType MagickGetImagePixelColor(MagickWand *wand,
5191 const ssize_t x,const ssize_t y,PixelWand *color)
5193 register const Quantum
5199 assert(wand != (MagickWand *) NULL);
5200 assert(wand->signature == WandSignature);
5201 if (IfMagickTrue(wand->debug))
5202 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5203 if (wand->images == (Image *) NULL)
5204 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5205 image_view=AcquireVirtualCacheView(wand->images,wand->exception);
5206 p=GetCacheViewVirtualPixels(image_view,x,y,1,1,wand->exception);
5207 if (p == (const Quantum *) NULL)
5209 image_view=DestroyCacheView(image_view);
5210 return(MagickFalse);
5212 PixelSetQuantumPixel(wand->images,p,color);
5213 image_view=DestroyCacheView(image_view);
5218 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5222 % M a g i c k G e t I m a g e R e d P r i m a r y %
5226 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5228 % MagickGetImageRedPrimary() returns the chromaticy red primary point.
5230 % The format of the MagickGetImageRedPrimary method is:
5232 % MagickBooleanType MagickGetImageRedPrimary(MagickWand *wand,double *x,
5235 % A description of each parameter follows:
5237 % o wand: the magick wand.
5239 % o x: the chromaticity red primary x-point.
5241 % o y: the chromaticity red primary y-point.
5244 WandExport MagickBooleanType MagickGetImageRedPrimary(MagickWand *wand,
5245 double *x,double *y)
5247 assert(wand != (MagickWand *) NULL);
5248 assert(wand->signature == WandSignature);
5249 if (IfMagickTrue(wand->debug))
5250 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5251 if (wand->images == (Image *) NULL)
5252 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5253 *x=wand->images->chromaticity.red_primary.x;
5254 *y=wand->images->chromaticity.red_primary.y;
5259 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5263 % M a g i c k G e t I m a g e R e g i o n %
5267 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5269 % MagickGetImageRegion() extracts a region of the image and returns it as a
5272 % The format of the MagickGetImageRegion method is:
5274 % MagickWand *MagickGetImageRegion(MagickWand *wand,
5275 % const size_t width,const size_t height,const ssize_t x,
5278 % A description of each parameter follows:
5280 % o wand: the magick wand.
5282 % o width: the region width.
5284 % o height: the region height.
5286 % o x: the region x offset.
5288 % o y: the region y offset.
5291 WandExport MagickWand *MagickGetImageRegion(MagickWand *wand,
5292 const size_t width,const size_t height,const ssize_t x,
5301 assert(wand != (MagickWand *) NULL);
5302 assert(wand->signature == WandSignature);
5303 if (IfMagickTrue(wand->debug))
5304 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5305 if (wand->images == (Image *) NULL)
5306 return((MagickWand *) NULL);
5308 region.height=height;
5311 region_image=CropImage(wand->images,®ion,wand->exception);
5312 if (region_image == (Image *) NULL)
5313 return((MagickWand *) NULL);
5314 return(CloneMagickWandFromImages(wand,region_image));
5318 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5322 % 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 %
5326 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5328 % MagickGetImageRenderingIntent() gets the image rendering intent.
5330 % The format of the MagickGetImageRenderingIntent method is:
5332 % RenderingIntent MagickGetImageRenderingIntent(MagickWand *wand)
5334 % A description of each parameter follows:
5336 % o wand: the magick wand.
5339 WandExport RenderingIntent MagickGetImageRenderingIntent(MagickWand *wand)
5341 assert(wand != (MagickWand *) NULL);
5342 assert(wand->signature == WandSignature);
5343 if (IfMagickTrue(wand->debug))
5344 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5345 if (wand->images == (Image *) NULL)
5347 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5348 "ContainsNoImages","`%s'",wand->name);
5349 return(UndefinedIntent);
5351 return((RenderingIntent) wand->images->rendering_intent);
5355 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5359 % M a g i c k G e t I m a g e R e s o l u t i o n %
5363 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5365 % MagickGetImageResolution() gets the image X and Y resolution.
5367 % The format of the MagickGetImageResolution method is:
5369 % MagickBooleanType MagickGetImageResolution(MagickWand *wand,double *x,
5372 % A description of each parameter follows:
5374 % o wand: the magick wand.
5376 % o x: the image x-resolution.
5378 % o y: the image y-resolution.
5381 WandExport MagickBooleanType MagickGetImageResolution(MagickWand *wand,
5382 double *x,double *y)
5384 assert(wand != (MagickWand *) NULL);
5385 assert(wand->signature == WandSignature);
5386 if (IfMagickTrue(wand->debug))
5387 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5388 if (wand->images == (Image *) NULL)
5389 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5390 *x=wand->images->resolution.x;
5391 *y=wand->images->resolution.y;
5396 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5400 % M a g i c k G e t I m a g e S c e n e %
5404 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5406 % MagickGetImageScene() gets the image scene.
5408 % The format of the MagickGetImageScene method is:
5410 % size_t MagickGetImageScene(MagickWand *wand)
5412 % A description of each parameter follows:
5414 % o wand: the magick wand.
5417 WandExport size_t MagickGetImageScene(MagickWand *wand)
5419 assert(wand != (MagickWand *) NULL);
5420 assert(wand->signature == WandSignature);
5421 if (IfMagickTrue(wand->debug))
5422 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5423 if (wand->images == (Image *) NULL)
5424 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5425 return(wand->images->scene);
5429 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5433 % M a g i c k G e t I m a g e S i g n a t u r e %
5437 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5439 % MagickGetImageSignature() generates an SHA-256 message digest for the image
5442 % The format of the MagickGetImageSignature method is:
5444 % char *MagickGetImageSignature(MagickWand *wand)
5446 % A description of each parameter follows:
5448 % o wand: the magick wand.
5451 WandExport char *MagickGetImageSignature(MagickWand *wand)
5459 assert(wand != (MagickWand *) NULL);
5460 assert(wand->signature == WandSignature);
5461 if (IfMagickTrue(wand->debug))
5462 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5463 if (wand->images == (Image *) NULL)
5465 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5466 "ContainsNoImages","`%s'",wand->name);
5467 return((char *) NULL);
5469 status=SignatureImage(wand->images,wand->exception);
5470 if (IfMagickFalse(status))
5471 return((char *) NULL);
5472 value=GetImageProperty(wand->images,"signature",wand->exception);
5473 if (value == (const char *) NULL)
5474 return((char *) NULL);
5475 return(AcquireString(value));
5479 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5483 % 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 %
5487 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5489 % MagickGetImageTicksPerSecond() gets the image ticks-per-second.
5491 % The format of the MagickGetImageTicksPerSecond method is:
5493 % size_t MagickGetImageTicksPerSecond(MagickWand *wand)
5495 % A description of each parameter follows:
5497 % o wand: the magick wand.
5500 WandExport size_t MagickGetImageTicksPerSecond(MagickWand *wand)
5502 assert(wand != (MagickWand *) NULL);
5503 assert(wand->signature == WandSignature);
5504 if (IfMagickTrue(wand->debug))
5505 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5506 if (wand->images == (Image *) NULL)
5507 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5508 return((size_t) wand->images->ticks_per_second);
5512 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5516 % M a g i c k G e t I m a g e T y p e %
5520 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5522 % MagickGetImageType() gets the potential image type:
5524 % Bilevel Grayscale GrayscaleMatte
5525 % Palette PaletteMatte TrueColor
5526 % TrueColorMatte ColorSeparation ColorSeparationMatte
5528 % To ensure the image type matches its potential, use MagickSetImageType():
5530 % (void) MagickSetImageType(wand,MagickGetImageType(wand));
5532 % The format of the MagickGetImageType method is:
5534 % ImageType MagickGetImageType(MagickWand *wand)
5536 % A description of each parameter follows:
5538 % o wand: the magick wand.
5541 WandExport ImageType MagickGetImageType(MagickWand *wand)
5543 assert(wand != (MagickWand *) NULL);
5544 assert(wand->signature == WandSignature);
5545 if (IfMagickTrue(wand->debug))
5546 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5547 if (wand->images == (Image *) NULL)
5549 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5550 "ContainsNoImages","`%s'",wand->name);
5551 return(UndefinedType);
5553 return(GetImageType(wand->images,wand->exception));
5557 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5561 % M a g i c k G e t I m a g e U n i t s %
5565 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5567 % MagickGetImageUnits() gets the image units of resolution.
5569 % The format of the MagickGetImageUnits method is:
5571 % ResolutionType MagickGetImageUnits(MagickWand *wand)
5573 % A description of each parameter follows:
5575 % o wand: the magick wand.
5578 WandExport ResolutionType MagickGetImageUnits(MagickWand *wand)
5580 assert(wand != (MagickWand *) NULL);
5581 assert(wand->signature == WandSignature);
5582 if (IfMagickTrue(wand->debug))
5583 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5584 if (wand->images == (Image *) NULL)
5586 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5587 "ContainsNoImages","`%s'",wand->name);
5588 return(UndefinedResolution);
5590 return(wand->images->units);
5594 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5598 % 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 %
5602 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5604 % MagickGetImageVirtualPixelMethod() returns the virtual pixel method for the
5607 % The format of the MagickGetImageVirtualPixelMethod method is:
5609 % VirtualPixelMethod MagickGetImageVirtualPixelMethod(MagickWand *wand)
5611 % A description of each parameter follows:
5613 % o wand: the magick wand.
5616 WandExport VirtualPixelMethod MagickGetImageVirtualPixelMethod(MagickWand *wand)
5618 assert(wand != (MagickWand *) NULL);
5619 assert(wand->signature == WandSignature);
5620 if (IfMagickTrue(wand->debug))
5621 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5622 if (wand->images == (Image *) NULL)
5624 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5625 "ContainsNoImages","`%s'",wand->name);
5626 return(UndefinedVirtualPixelMethod);
5628 return(GetImageVirtualPixelMethod(wand->images));
5632 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5636 % M a g i c k G e t I m a g e W h i t e P o i n t %
5640 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5642 % MagickGetImageWhitePoint() returns the chromaticy white point.
5644 % The format of the MagickGetImageWhitePoint method is:
5646 % MagickBooleanType MagickGetImageWhitePoint(MagickWand *wand,double *x,
5649 % A description of each parameter follows:
5651 % o wand: the magick wand.
5653 % o x: the chromaticity white x-point.
5655 % o y: the chromaticity white y-point.
5658 WandExport MagickBooleanType MagickGetImageWhitePoint(MagickWand *wand,
5659 double *x,double *y)
5661 assert(wand != (MagickWand *) NULL);
5662 assert(wand->signature == WandSignature);
5663 if (IfMagickTrue(wand->debug))
5664 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5665 if (wand->images == (Image *) NULL)
5666 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5667 *x=wand->images->chromaticity.white_point.x;
5668 *y=wand->images->chromaticity.white_point.y;
5673 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5677 % M a g i c k G e t I m a g e W i d t h %
5681 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5683 % MagickGetImageWidth() returns the image width.
5685 % The format of the MagickGetImageWidth method is:
5687 % size_t MagickGetImageWidth(MagickWand *wand)
5689 % A description of each parameter follows:
5691 % o wand: the magick wand.
5694 WandExport size_t MagickGetImageWidth(MagickWand *wand)
5696 assert(wand != (MagickWand *) NULL);
5697 assert(wand->signature == WandSignature);
5698 if (IfMagickTrue(wand->debug))
5699 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5700 if (wand->images == (Image *) NULL)
5701 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5702 return(wand->images->columns);
5706 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5710 % M a g i c k G e t N u m b e r I m a g e s %
5714 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5716 % MagickGetNumberImages() returns the number of images associated with a
5719 % The format of the MagickGetNumberImages method is:
5721 % size_t MagickGetNumberImages(MagickWand *wand)
5723 % A description of each parameter follows:
5725 % o wand: the magick wand.
5728 WandExport size_t MagickGetNumberImages(MagickWand *wand)
5730 assert(wand != (MagickWand *) NULL);
5731 assert(wand->signature == WandSignature);
5732 if (IfMagickTrue(wand->debug))
5733 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5734 return(GetImageListLength(wand->images));
5738 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5742 % 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 %
5746 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5748 % MagickGetImageTotalInkDensity() gets the image total ink density.
5750 % The format of the MagickGetImageTotalInkDensity method is:
5752 % double MagickGetImageTotalInkDensity(MagickWand *wand)
5754 % A description of each parameter follows:
5756 % o wand: the magick wand.
5759 WandExport double MagickGetImageTotalInkDensity(MagickWand *wand)
5761 assert(wand != (MagickWand *) NULL);
5762 assert(wand->signature == WandSignature);
5763 if (IfMagickTrue(wand->debug))
5764 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5765 if (wand->images == (Image *) NULL)
5767 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5768 "ContainsNoImages","`%s'",wand->name);
5771 return(GetImageTotalInkDensity(wand->images,wand->exception));
5775 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5779 % M a g i c k H a l d C l u t I m a g e %
5783 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5785 % MagickHaldClutImage() replaces colors in the image from a Hald color lookup
5786 % table. A Hald color lookup table is a 3-dimensional color cube mapped to 2
5787 % dimensions. Create it with the HALD coder. You can apply any color
5788 % transformation to the Hald image and then use this method to apply the
5789 % transform to the image.
5791 % The format of the MagickHaldClutImage method is:
5793 % MagickBooleanType MagickHaldClutImage(MagickWand *wand,
5794 % const MagickWand *hald_wand)
5796 % A description of each parameter follows:
5798 % o wand: the magick wand.
5800 % o hald_image: the hald CLUT image.
5803 WandExport MagickBooleanType MagickHaldClutImage(MagickWand *wand,
5804 const MagickWand *hald_wand)
5809 assert(wand != (MagickWand *) NULL);
5810 assert(wand->signature == WandSignature);
5811 if (IfMagickTrue(wand->debug))
5812 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5813 if ((wand->images == (Image *) NULL) || (hald_wand->images == (Image *) NULL))
5814 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5815 status=HaldClutImage(wand->images,hald_wand->images,wand->exception);
5820 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5824 % M a g i c k H a s N e x t I m a g e %
5828 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5830 % MagickHasNextImage() returns MagickTrue if the wand has more images when
5831 % traversing the list in the forward direction
5833 % The format of the MagickHasNextImage method is:
5835 % MagickBooleanType MagickHasNextImage(MagickWand *wand)
5837 % A description of each parameter follows:
5839 % o wand: the magick wand.
5842 WandExport MagickBooleanType MagickHasNextImage(MagickWand *wand)
5844 assert(wand != (MagickWand *) NULL);
5845 assert(wand->signature == WandSignature);
5846 if (IfMagickTrue(wand->debug))
5847 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5848 if (wand->images == (Image *) NULL)
5849 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5850 if (GetNextImageInList(wand->images) == (Image *) NULL)
5851 return(MagickFalse);
5856 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5860 % M a g i c k H a s P r e v i o u s I m a g e %
5864 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5866 % MagickHasPreviousImage() returns MagickTrue if the wand has more images when
5867 % traversing the list in the reverse direction
5869 % The format of the MagickHasPreviousImage method is:
5871 % MagickBooleanType MagickHasPreviousImage(MagickWand *wand)
5873 % A description of each parameter follows:
5875 % o wand: the magick wand.
5878 WandExport MagickBooleanType MagickHasPreviousImage(MagickWand *wand)
5880 assert(wand != (MagickWand *) NULL);
5881 assert(wand->signature == WandSignature);
5882 if (IfMagickTrue(wand->debug))
5883 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5884 if (wand->images == (Image *) NULL)
5885 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5886 if (GetPreviousImageInList(wand->images) == (Image *) NULL)
5887 return(MagickFalse);
5892 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5896 % M a g i c k I d e n t i f y I m a g e %
5900 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5902 % MagickIdentifyImage() identifies an image by printing its attributes to the
5903 % file. Attributes include the image width, height, size, and others.
5905 % The format of the MagickIdentifyImage method is:
5907 % const char *MagickIdentifyImage(MagickWand *wand)
5909 % A description of each parameter follows:
5911 % o wand: the magick wand.
5914 WandExport char *MagickIdentifyImage(MagickWand *wand)
5918 filename[MaxTextExtent];
5926 assert(wand != (MagickWand *) NULL);
5927 assert(wand->signature == WandSignature);
5928 if (IfMagickTrue(wand->debug))
5929 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5930 if (wand->images == (Image *) NULL)
5932 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5933 "ContainsNoImages","`%s'",wand->name);
5934 return((char *) NULL);
5936 description=(char *) NULL;
5937 unique_file=AcquireUniqueFileResource(filename);
5939 if (unique_file != -1)
5940 file=fdopen(unique_file,"wb");
5941 if ((unique_file == -1) || (file == (FILE *) NULL))
5943 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5944 "UnableToCreateTemporaryFile","`%s'",wand->name);
5945 return((char *) NULL);
5947 (void) IdentifyImage(wand->images,file,MagickTrue,wand->exception);
5948 (void) fclose(file);
5949 description=FileToString(filename,~0,wand->exception);
5950 (void) RelinquishUniqueFileResource(filename);
5951 return(description);
5955 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5959 % M a g i c k I m p l o d e I m a g e %
5963 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5965 % MagickImplodeImage() creates a new image that is a copy of an existing
5966 % one with the image pixels "implode" by the specified percentage. It
5967 % allocates the memory necessary for the new Image structure and returns a
5968 % pointer to the new image.
5970 % The format of the MagickImplodeImage method is:
5972 % MagickBooleanType MagickImplodeImage(MagickWand *wand,
5973 % const double radius,const PixelInterpolateMethod method)
5975 % A description of each parameter follows:
5977 % o wand: the magick wand.
5979 % o amount: Define the extent of the implosion.
5981 % o method: the pixel interpolation method.
5984 WandExport MagickBooleanType MagickImplodeImage(MagickWand *wand,
5985 const double amount,const PixelInterpolateMethod method)
5990 assert(wand != (MagickWand *) NULL);
5991 assert(wand->signature == WandSignature);
5992 if (IfMagickTrue(wand->debug))
5993 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5994 if (wand->images == (Image *) NULL)
5995 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5996 implode_image=ImplodeImage(wand->images,amount,method,wand->exception);
5997 if (implode_image == (Image *) NULL)
5998 return(MagickFalse);
5999 ReplaceImageInList(&wand->images,implode_image);
6004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6008 % M a g i c k I m p o r t I m a g e P i x e l s %
6012 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6014 % MagickImportImagePixels() accepts pixel datand stores it in the image at the
6015 % location you specify. The method returns MagickFalse on success otherwise
6016 % MagickTrue if an error is encountered. The pixel data can be either char,
6017 % short int, int, ssize_t, float, or double in the order specified by map.
6019 % Suppose your want to upload the first scanline of a 640x480 image from
6020 % character data in red-green-blue order:
6022 % MagickImportImagePixels(wand,0,0,640,1,"RGB",CharPixel,pixels);
6024 % The format of the MagickImportImagePixels method is:
6026 % MagickBooleanType MagickImportImagePixels(MagickWand *wand,
6027 % const ssize_t x,const ssize_t y,const size_t columns,
6028 % const size_t rows,const char *map,const StorageType storage,
6029 % const void *pixels)
6031 % A description of each parameter follows:
6033 % o wand: the magick wand.
6035 % o x, y, columns, rows: These values define the perimeter of a region
6036 % of pixels you want to define.
6038 % o map: This string reflects the expected ordering of the pixel array.
6039 % It can be any combination or order of R = red, G = green, B = blue,
6040 % A = alpha (0 is transparent), O = alpha (0 is opaque), C = cyan,
6041 % Y = yellow, M = magenta, K = black, I = intensity (for grayscale),
6044 % o storage: Define the data type of the pixels. Float and double types are
6045 % expected to be normalized [0..1] otherwise [0..QuantumRange]. Choose from
6046 % these types: CharPixel, ShortPixel, IntegerPixel, LongPixel, FloatPixel,
6049 % o pixels: This array of values contain the pixel components as defined by
6050 % map and type. You must preallocate this array where the expected
6051 % length varies depending on the values of width, height, map, and type.
6054 WandExport MagickBooleanType MagickImportImagePixels(MagickWand *wand,
6055 const ssize_t x,const ssize_t y,const size_t columns,const size_t rows,
6056 const char *map,const StorageType storage,const void *pixels)
6061 assert(wand != (MagickWand *) NULL);
6062 assert(wand->signature == WandSignature);
6063 if (IfMagickTrue(wand->debug))
6064 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6065 if (wand->images == (Image *) NULL)
6066 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6067 status=ImportImagePixels(wand->images,x,y,columns,rows,map,storage,pixels,
6073 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6077 % 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 %
6081 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6083 % MagickInterpolativeResizeImage() resize image using a interpolative
6086 % MagickBooleanType MagickInterpolativeResizeImage(MagickWand *wand,
6087 % const size_t columns,const size_t rows,
6088 % const PixelInterpolateMethod method)
6090 % A description of each parameter follows:
6092 % o wand: the magick wand.
6094 % o columns: the number of columns in the scaled image.
6096 % o rows: the number of rows in the scaled image.
6098 % o interpolate: the pixel interpolation method.
6101 WandExport MagickBooleanType MagickInterpolativeResizeImage(MagickWand *wand,
6102 const size_t columns,const size_t rows,const PixelInterpolateMethod method)
6107 assert(wand != (MagickWand *) NULL);
6108 assert(wand->signature == WandSignature);
6109 if (IfMagickTrue(wand->debug))
6110 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6111 if (wand->images == (Image *) NULL)
6112 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6113 resize_image=InterpolativeResizeImage(wand->images,columns,rows,method,
6115 if (resize_image == (Image *) NULL)
6116 return(MagickFalse);
6117 ReplaceImageInList(&wand->images,resize_image);
6122 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6126 % 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 %
6130 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6132 % MagickInverseFourierTransformImage() implements the inverse discrete
6133 % Fourier transform (DFT) of the image either as a magnitude / phase or real /
6134 % imaginary image pair.
6136 % The format of the MagickInverseFourierTransformImage method is:
6138 % MagickBooleanType MagickInverseFourierTransformImage(
6139 % MagickWand *magnitude_wand,MagickWand *phase_wand,
6140 % const MagickBooleanType magnitude)
6142 % A description of each parameter follows:
6144 % o magnitude_wand: the magnitude or real wand.
6146 % o phase_wand: the phase or imaginary wand.
6148 % o magnitude: if true, return as magnitude / phase pair otherwise a real /
6149 % imaginary image pair.
6152 WandExport MagickBooleanType MagickInverseFourierTransformImage(
6153 MagickWand *magnitude_wand,MagickWand *phase_wand,
6154 const MagickBooleanType magnitude)
6162 assert(magnitude_wand != (MagickWand *) NULL);
6163 assert(magnitude_wand->signature == WandSignature);
6164 if (IfMagickTrue(magnitude_wand->debug))
6165 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",
6166 magnitude_wand->name);
6167 wand=magnitude_wand;
6168 if (magnitude_wand->images == (Image *) NULL)
6169 ThrowWandException(WandError,"ContainsNoImages",
6170 magnitude_wand->name);
6171 assert(phase_wand != (MagickWand *) NULL);
6172 assert(phase_wand->signature == WandSignature);
6173 inverse_image=InverseFourierTransformImage(magnitude_wand->images,
6174 phase_wand->images,magnitude,wand->exception);
6175 if (inverse_image == (Image *) NULL)
6176 return(MagickFalse);
6177 ReplaceImageInList(&wand->images,inverse_image);
6182 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6186 % M a g i c k L a b e l I m a g e %
6190 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6192 % MagickLabelImage() adds a label to your image.
6194 % The format of the MagickLabelImage method is:
6196 % MagickBooleanType MagickLabelImage(MagickWand *wand,const char *label)
6198 % A description of each parameter follows:
6200 % o wand: the magick wand.
6202 % o label: the image label.
6205 WandExport MagickBooleanType MagickLabelImage(MagickWand *wand,
6211 assert(wand != (MagickWand *) NULL);
6212 assert(wand->signature == WandSignature);
6213 if (IfMagickTrue(wand->debug))
6214 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6215 if (wand->images == (Image *) NULL)
6216 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6217 status=SetImageProperty(wand->images,"label",label,wand->exception);
6222 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6226 % M a g i c k L e v e l I m a g e %
6230 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6232 % MagickLevelImage() adjusts the levels of an image by scaling the colors
6233 % falling between specified white and black points to the full available
6234 % quantum range. The parameters provided represent the black, mid, and white
6235 % points. The black point specifies the darkest color in the image. Colors
6236 % darker than the black point are set to zero. Mid point specifies a gamma
6237 % correction to apply to the image. White point specifies the lightest color
6238 % in the image. Colors brighter than the white point are set to the maximum
6241 % The format of the MagickLevelImage method is:
6243 % MagickBooleanType MagickLevelImage(MagickWand *wand,
6244 % const double black_point,const double gamma,const double white_point)
6245 % MagickBooleanType MagickLevelImage(MagickWand *wand,
6246 % const ChannelType channel,const double black_point,const double gamma,
6247 % const double white_point)
6249 % A description of each parameter follows:
6251 % o wand: the magick wand.
6253 % o channel: Identify which channel to level: RedPixelChannel,
6254 % GreenPixelChannel, etc.
6256 % o black_point: the black point.
6258 % o gamma: the gamma.
6260 % o white_point: the white point.
6263 WandExport MagickBooleanType MagickLevelImage(MagickWand *wand,
6264 const double black_point,const double gamma,const double white_point)
6269 assert(wand != (MagickWand *) NULL);
6270 assert(wand->signature == WandSignature);
6271 if (IfMagickTrue(wand->debug))
6272 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6273 if (wand->images == (Image *) NULL)
6274 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6275 status=LevelImage(wand->images,black_point,white_point,gamma,
6281 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6285 % M a g i c k L i n e a r S t r e t c h I m a g e %
6289 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6291 % MagickLinearStretchImage() stretches with saturation the image intensity.
6293 % You can also reduce the influence of a particular channel with a gamma
6296 % The format of the MagickLinearStretchImage method is:
6298 % MagickBooleanType MagickLinearStretchImage(MagickWand *wand,
6299 % const double black_point,const double white_point)
6301 % A description of each parameter follows:
6303 % o wand: the magick wand.
6305 % o black_point: the black point.
6307 % o white_point: the white point.
6310 WandExport MagickBooleanType MagickLinearStretchImage(MagickWand *wand,
6311 const double black_point,const double white_point)
6316 assert(wand != (MagickWand *) NULL);
6317 assert(wand->signature == WandSignature);
6318 if (IfMagickTrue(wand->debug))
6319 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6320 if (wand->images == (Image *) NULL)
6321 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6322 status=LinearStretchImage(wand->images,black_point,white_point,
6328 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6332 % M a g i c k L i q u i d R e s c a l e I m a g e %
6336 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6338 % MagickLiquidRescaleImage() rescales image with seam carving.
6340 % MagickBooleanType MagickLiquidRescaleImage(MagickWand *wand,
6341 % const size_t columns,const size_t rows,
6342 % const double delta_x,const double rigidity)
6344 % A description of each parameter follows:
6346 % o wand: the magick wand.
6348 % o columns: the number of columns in the scaled image.
6350 % o rows: the number of rows in the scaled image.
6352 % o delta_x: maximum seam transversal step (0 means straight seams).
6354 % o rigidity: introduce a bias for non-straight seams (typically 0).
6357 WandExport MagickBooleanType MagickLiquidRescaleImage(MagickWand *wand,
6358 const size_t columns,const size_t rows,const double delta_x,
6359 const double rigidity)
6364 assert(wand != (MagickWand *) NULL);
6365 assert(wand->signature == WandSignature);
6366 if (IfMagickTrue(wand->debug))
6367 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6368 if (wand->images == (Image *) NULL)
6369 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6370 rescale_image=LiquidRescaleImage(wand->images,columns,rows,delta_x,
6371 rigidity,wand->exception);
6372 if (rescale_image == (Image *) NULL)
6373 return(MagickFalse);
6374 ReplaceImageInList(&wand->images,rescale_image);
6379 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6383 % M a g i c k M a g n i f y I m a g e %
6387 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6389 % MagickMagnifyImage() is a convenience method that scales an image
6390 % proportionally to twice its original size.
6392 % The format of the MagickMagnifyImage method is:
6394 % MagickBooleanType MagickMagnifyImage(MagickWand *wand)
6396 % A description of each parameter follows:
6398 % o wand: the magick wand.
6401 WandExport MagickBooleanType MagickMagnifyImage(MagickWand *wand)
6406 assert(wand != (MagickWand *) NULL);
6407 assert(wand->signature == WandSignature);
6408 if (IfMagickTrue(wand->debug))
6409 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6410 if (wand->images == (Image *) NULL)
6411 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6412 magnify_image=MagnifyImage(wand->images,wand->exception);
6413 if (magnify_image == (Image *) NULL)
6414 return(MagickFalse);
6415 ReplaceImageInList(&wand->images,magnify_image);
6420 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6424 % M a g i c k M e r g e I m a g e L a y e r s %
6428 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6430 % MagickMergeImageLayers() composes all the image layers from the current
6431 % given image onward to produce a single image of the merged layers.
6433 % The inital canvas's size depends on the given LayerMethod, and is
6434 % initialized using the first images background color. The images
6435 % are then compositied onto that image in sequence using the given
6436 % composition that has been assigned to each individual image.
6438 % The format of the MagickMergeImageLayers method is:
6440 % MagickWand *MagickMergeImageLayers(MagickWand *wand,
6441 % const LayerMethod method)
6443 % A description of each parameter follows:
6445 % o wand: the magick wand.
6447 % o method: the method of selecting the size of the initial canvas.
6449 % MergeLayer: Merge all layers onto a canvas just large enough
6450 % to hold all the actual images. The virtual canvas of the
6451 % first image is preserved but otherwise ignored.
6453 % FlattenLayer: Use the virtual canvas size of first image.
6454 % Images which fall outside this canvas is clipped.
6455 % This can be used to 'fill out' a given virtual canvas.
6457 % MosaicLayer: Start with the virtual canvas of the first image,
6458 % enlarging left and right edges to contain all images.
6459 % Images with negative offsets will be clipped.
6462 WandExport MagickWand *MagickMergeImageLayers(MagickWand *wand,
6463 const LayerMethod method)
6468 assert(wand != (MagickWand *) NULL);
6469 assert(wand->signature == WandSignature);
6470 if (IfMagickTrue(wand->debug))
6471 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6472 if (wand->images == (Image *) NULL)
6473 return((MagickWand *) NULL);
6474 mosaic_image=MergeImageLayers(wand->images,method,wand->exception);
6475 if (mosaic_image == (Image *) NULL)
6476 return((MagickWand *) NULL);
6477 return(CloneMagickWandFromImages(wand,mosaic_image));
6481 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6485 % M a g i c k M i n i f y I m a g e %
6489 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6491 % MagickMinifyImage() is a convenience method that scales an image
6492 % proportionally to one-half its original size
6494 % The format of the MagickMinifyImage method is:
6496 % MagickBooleanType MagickMinifyImage(MagickWand *wand)
6498 % A description of each parameter follows:
6500 % o wand: the magick wand.
6503 WandExport MagickBooleanType MagickMinifyImage(MagickWand *wand)
6508 assert(wand != (MagickWand *) NULL);
6509 assert(wand->signature == WandSignature);
6510 if (IfMagickTrue(wand->debug))
6511 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6512 if (wand->images == (Image *) NULL)
6513 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6514 minify_image=MinifyImage(wand->images,wand->exception);
6515 if (minify_image == (Image *) NULL)
6516 return(MagickFalse);
6517 ReplaceImageInList(&wand->images,minify_image);
6522 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6526 % M a g i c k M o d u l a t e I m a g e %
6530 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6532 % MagickModulateImage() lets you control the brightness, saturation, and hue
6533 % of an image. Hue is the percentage of absolute rotation from the current
6534 % position. For example 50 results in a counter-clockwise rotation of 90
6535 % degrees, 150 results in a clockwise rotation of 90 degrees, with 0 and 200
6536 % both resulting in a rotation of 180 degrees.
6538 % To increase the color brightness by 20% and decrease the color saturation by
6539 % 10% and leave the hue unchanged, use: 120,90,100.
6541 % The format of the MagickModulateImage method is:
6543 % MagickBooleanType MagickModulateImage(MagickWand *wand,
6544 % const double brightness,const double saturation,const double hue)
6546 % A description of each parameter follows:
6548 % o wand: the magick wand.
6550 % o brightness: the percent change in brighness.
6552 % o saturation: the percent change in saturation.
6554 % o hue: the percent change in hue.
6557 WandExport MagickBooleanType MagickModulateImage(MagickWand *wand,
6558 const double brightness,const double saturation,const double hue)
6561 modulate[MaxTextExtent];
6566 assert(wand != (MagickWand *) NULL);
6567 assert(wand->signature == WandSignature);
6568 if (IfMagickTrue(wand->debug))
6569 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6570 if (wand->images == (Image *) NULL)
6571 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6572 (void) FormatLocaleString(modulate,MaxTextExtent,"%g,%g,%g",
6573 brightness,saturation,hue);
6574 status=ModulateImage(wand->images,modulate,wand->exception);
6579 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6583 % M a g i c k M o n t a g e I m a g e %
6587 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6589 % MagickMontageImage() creates a composite image by combining several
6590 % separate images. The images are tiled on the composite image with the name
6591 % of the image optionally appearing just below the individual tile.
6593 % The format of the MagickMontageImage method is:
6595 % MagickWand *MagickMontageImage(MagickWand *wand,
6596 % const DrawingWand drawing_wand,const char *tile_geometry,
6597 % const char *thumbnail_geometry,const MontageMode mode,
6598 % const char *frame)
6600 % A description of each parameter follows:
6602 % o wand: the magick wand.
6604 % o drawing_wand: the drawing wand. The font name, size, and color are
6605 % obtained from this wand.
6607 % o tile_geometry: the number of tiles per row and page (e.g. 6x4+0+0).
6609 % o thumbnail_geometry: Preferred image size and border size of each
6610 % thumbnail (e.g. 120x120+4+3>).
6612 % o mode: Thumbnail framing mode: Frame, Unframe, or Concatenate.
6614 % o frame: Surround the image with an ornamental border (e.g. 15x15+3+3).
6615 % The frame color is that of the thumbnail's matte color.
6618 WandExport MagickWand *MagickMontageImage(MagickWand *wand,
6619 const DrawingWand *drawing_wand,const char *tile_geometry,
6620 const char *thumbnail_geometry,const MontageMode mode,const char *frame)
6634 assert(wand != (MagickWand *) NULL);
6635 assert(wand->signature == WandSignature);
6636 if (IfMagickTrue(wand->debug))
6637 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6638 if (wand->images == (Image *) NULL)
6639 return((MagickWand *) NULL);
6640 montage_info=CloneMontageInfo(wand->image_info,(MontageInfo *) NULL);
6645 (void) CloneString(&montage_info->frame,"15x15+3+3");
6646 montage_info->shadow=MagickTrue;
6651 montage_info->frame=(char *) NULL;
6652 montage_info->shadow=MagickFalse;
6653 montage_info->border_width=0;
6656 case ConcatenateMode:
6658 montage_info->frame=(char *) NULL;
6659 montage_info->shadow=MagickFalse;
6660 (void) CloneString(&montage_info->geometry,"+0+0");
6661 montage_info->border_width=0;
6667 font=DrawGetFont(drawing_wand);
6668 if (font != (char *) NULL)
6669 (void) CloneString(&montage_info->font,font);
6670 if (frame != (char *) NULL)
6671 (void) CloneString(&montage_info->frame,frame);
6672 montage_info->pointsize=DrawGetFontSize(drawing_wand);
6673 pixel_wand=NewPixelWand();
6674 DrawGetFillColor(drawing_wand,pixel_wand);
6675 PixelGetQuantumPacket(pixel_wand,&montage_info->fill);
6676 DrawGetStrokeColor(drawing_wand,pixel_wand);
6677 PixelGetQuantumPacket(pixel_wand,&montage_info->stroke);
6678 pixel_wand=DestroyPixelWand(pixel_wand);
6679 if (thumbnail_geometry != (char *) NULL)
6680 (void) CloneString(&montage_info->geometry,thumbnail_geometry);
6681 if (tile_geometry != (char *) NULL)
6682 (void) CloneString(&montage_info->tile,tile_geometry);
6683 montage_image=MontageImageList(wand->image_info,montage_info,wand->images,
6685 montage_info=DestroyMontageInfo(montage_info);
6686 if (montage_image == (Image *) NULL)
6687 return((MagickWand *) NULL);
6688 return(CloneMagickWandFromImages(wand,montage_image));
6692 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6696 % M a g i c k M o r p h I m a g e s %
6700 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6702 % MagickMorphImages() method morphs a set of images. Both the image pixels
6703 % and size are linearly interpolated to give the appearance of a
6704 % meta-morphosis from one image to the next.
6706 % The format of the MagickMorphImages method is:
6708 % MagickWand *MagickMorphImages(MagickWand *wand,
6709 % const size_t number_frames)
6711 % A description of each parameter follows:
6713 % o wand: the magick wand.
6715 % o number_frames: the number of in-between images to generate.
6718 WandExport MagickWand *MagickMorphImages(MagickWand *wand,
6719 const size_t number_frames)
6724 assert(wand != (MagickWand *) NULL);
6725 assert(wand->signature == WandSignature);
6726 if (IfMagickTrue(wand->debug))
6727 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6728 if (wand->images == (Image *) NULL)
6729 return((MagickWand *) NULL);
6730 morph_image=MorphImages(wand->images,number_frames,wand->exception);
6731 if (morph_image == (Image *) NULL)
6732 return((MagickWand *) NULL);
6733 return(CloneMagickWandFromImages(wand,morph_image));
6737 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6741 % M a g i c k M o r p h o l o g y I m a g e %
6745 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6747 % MagickMorphologyImage() applies a user supplied kernel to the image
6748 % according to the given mophology method.
6750 % The format of the MagickMorphologyImage method is:
6752 % MagickBooleanType MagickMorphologyImage(MagickWand *wand,
6753 % MorphologyMethod method,const ssize_t iterations,KernelInfo *kernel)
6755 % A description of each parameter follows:
6757 % o wand: the magick wand.
6759 % o method: the morphology method to be applied.
6761 % o iterations: apply the operation this many times (or no change).
6762 % A value of -1 means loop until no change found. How this is applied
6763 % may depend on the morphology method. Typically this is a value of 1.
6765 % o kernel: An array of doubles representing the morphology kernel.
6768 WandExport MagickBooleanType MagickMorphologyImage(MagickWand *wand,
6769 MorphologyMethod method,const ssize_t iterations,KernelInfo *kernel)
6774 assert(wand != (MagickWand *) NULL);
6775 assert(wand->signature == WandSignature);
6776 if (IfMagickTrue(wand->debug))
6777 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6778 if (kernel == (const KernelInfo *) NULL)
6779 return(MagickFalse);
6780 if (wand->images == (Image *) NULL)
6781 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6782 morphology_image=MorphologyImage(wand->images,method,iterations,kernel,
6784 if (morphology_image == (Image *) NULL)
6785 return(MagickFalse);
6786 ReplaceImageInList(&wand->images,morphology_image);
6791 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6795 % M a g i c k M o t i o n B l u r I m a g e %
6799 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6801 % MagickMotionBlurImage() simulates motion blur. We convolve the image with a
6802 % Gaussian operator of the given radius and standard deviation (sigma).
6803 % For reasonable results, radius should be larger than sigma. Use a
6804 % radius of 0 and MotionBlurImage() selects a suitable radius for you.
6805 % Angle gives the angle of the blurring motion.
6807 % The format of the MagickMotionBlurImage method is:
6809 % MagickBooleanType MagickMotionBlurImage(MagickWand *wand,
6810 % const double radius,const double sigma,const double angle)
6812 % A description of each parameter follows:
6814 % o wand: the magick wand.
6816 % o radius: the radius of the Gaussian, in pixels, not counting
6819 % o sigma: the standard deviation of the Gaussian, in pixels.
6821 % o angle: Apply the effect along this angle.
6824 WandExport MagickBooleanType MagickMotionBlurImage(MagickWand *wand,
6825 const double radius,const double sigma,const double angle)
6830 assert(wand != (MagickWand *) NULL);
6831 assert(wand->signature == WandSignature);
6832 if (IfMagickTrue(wand->debug))
6833 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6834 if (wand->images == (Image *) NULL)
6835 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6836 blur_image=MotionBlurImage(wand->images,radius,sigma,angle,wand->exception);
6837 if (blur_image == (Image *) NULL)
6838 return(MagickFalse);
6839 ReplaceImageInList(&wand->images,blur_image);
6844 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6848 % M a g i c k N e g a t e I m a g e %
6852 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6854 % MagickNegateImage() negates the colors in the reference image. The
6855 % Grayscale option means that only grayscale values within the image are
6858 % You can also reduce the influence of a particular channel with a gamma
6861 % The format of the MagickNegateImage method is:
6863 % MagickBooleanType MagickNegateImage(MagickWand *wand,
6864 % const MagickBooleanType gray)
6866 % A description of each parameter follows:
6868 % o wand: the magick wand.
6870 % o gray: If MagickTrue, only negate grayscale pixels within the image.
6873 WandExport MagickBooleanType MagickNegateImage(MagickWand *wand,
6874 const MagickBooleanType gray)
6879 assert(wand != (MagickWand *) NULL);
6880 assert(wand->signature == WandSignature);
6881 if (IfMagickTrue(wand->debug))
6882 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6883 if (wand->images == (Image *) NULL)
6884 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6885 status=NegateImage(wand->images,gray,wand->exception);
6890 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6894 % M a g i c k N e w I m a g e %
6898 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6900 % MagickNewImage() adds a blank image canvas of the specified size and
6901 % background color to the wand.
6903 % The format of the MagickNewImage method is:
6905 % MagickBooleanType MagickNewImage(MagickWand *wand,
6906 % const size_t columns,const size_t rows,
6907 % const PixelWand *background)
6909 % A description of each parameter follows:
6911 % o wand: the magick wand.
6913 % o width: the image width.
6915 % o height: the image height.
6917 % o background: the image color.
6920 WandExport MagickBooleanType MagickNewImage(MagickWand *wand,const size_t width,
6921 const size_t height,const PixelWand *background)
6929 assert(wand != (MagickWand *) NULL);
6930 assert(wand->signature == WandSignature);
6931 if (IfMagickTrue(wand->debug))
6932 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6933 PixelGetMagickColor(background,&pixel);
6934 images=NewMagickImage(wand->image_info,width,height,&pixel,wand->exception);
6935 if (images == (Image *) NULL)
6936 return(MagickFalse);
6937 return(InsertImageInWand(wand,images));
6941 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6945 % M a g i c k N e x t I m a g e %
6949 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6951 % MagickNextImage() sets the next image in the wand as the current image.
6953 % It is typically used after MagickResetIterator(), after which its first use
6954 % will set the first image as the current image (unless the wand is empty).
6956 % It will return MagickFalse when no more images are left to be returned
6957 % which happens when the wand is empty, or the current image is the last
6960 % When the above condition (end of image list) is reached, the iterator is
6961 % automaticall set so that you can start using MagickPreviousImage() to
6962 % again iterate over the images in the reverse direction, starting with the
6963 % last image (again). You can jump to this condition immeditally using
6964 % MagickSetLastIterator().
6966 % The format of the MagickNextImage method is:
6968 % MagickBooleanType MagickNextImage(MagickWand *wand)
6970 % A description of each parameter follows:
6972 % o wand: the magick wand.
6975 WandExport MagickBooleanType MagickNextImage(MagickWand *wand)
6977 assert(wand != (MagickWand *) NULL);
6978 assert(wand->signature == WandSignature);
6979 if (IfMagickTrue(wand->debug))
6980 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6981 if (wand->images == (Image *) NULL)
6982 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6983 wand->insert_before=MagickFalse; /* Inserts is now appended */
6984 if (IfMagickTrue(wand->image_pending))
6986 wand->image_pending=MagickFalse;
6989 if (GetNextImageInList(wand->images) == (Image *) NULL)
6991 wand->image_pending=MagickTrue; /* No image, PreviousImage re-gets */
6992 return(MagickFalse);
6994 wand->images=GetNextImageInList(wand->images);
6999 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7003 % M a g i c k N o r m a l i z e I m a g e %
7007 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7009 % MagickNormalizeImage() enhances the contrast of a color image by adjusting
7010 % the pixels color to span the entire range of colors available
7012 % You can also reduce the influence of a particular channel with a gamma
7015 % The format of the MagickNormalizeImage method is:
7017 % MagickBooleanType MagickNormalizeImage(MagickWand *wand)
7019 % A description of each parameter follows:
7021 % o wand: the magick wand.
7024 WandExport MagickBooleanType MagickNormalizeImage(MagickWand *wand)
7029 assert(wand != (MagickWand *) NULL);
7030 assert(wand->signature == WandSignature);
7031 if (IfMagickTrue(wand->debug))
7032 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7033 if (wand->images == (Image *) NULL)
7034 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7035 status=NormalizeImage(wand->images,wand->exception);
7040 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7044 % M a g i c k O i l P a i n t I m a g e %
7048 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7050 % MagickOilPaintImage() applies a special effect filter that simulates an oil
7051 % painting. Each pixel is replaced by the most frequent color occurring
7052 % in a circular region defined by radius.
7054 % The format of the MagickOilPaintImage method is:
7056 % MagickBooleanType MagickOilPaintImage(MagickWand *wand,
7057 % const double radius,const double sigma)
7059 % A description of each parameter follows:
7061 % o wand: the magick wand.
7063 % o radius: the radius of the circular neighborhood.
7065 % o sigma: the standard deviation of the Gaussian, in pixels.
7068 WandExport MagickBooleanType MagickOilPaintImage(MagickWand *wand,
7069 const double radius,const double sigma)
7074 assert(wand != (MagickWand *) NULL);
7075 assert(wand->signature == WandSignature);
7076 if (IfMagickTrue(wand->debug))
7077 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7078 if (wand->images == (Image *) NULL)
7079 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7080 paint_image=OilPaintImage(wand->images,radius,sigma,wand->exception);
7081 if (paint_image == (Image *) NULL)
7082 return(MagickFalse);
7083 ReplaceImageInList(&wand->images,paint_image);
7088 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7092 % M a g i c k O p a q u e P a i n t I m a g e %
7096 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7098 % MagickOpaquePaintImage() changes any pixel that matches color with the color
7101 % The format of the MagickOpaquePaintImage method is:
7103 % MagickBooleanType MagickOpaquePaintImage(MagickWand *wand,
7104 % const PixelWand *target,const PixelWand *fill,const double fuzz,
7105 % const MagickBooleanType invert)
7107 % A description of each parameter follows:
7109 % o wand: the magick wand.
7111 % o target: Change this target color to the fill color within the image.
7113 % o fill: the fill pixel wand.
7115 % o fuzz: By default target must match a particular pixel color
7116 % exactly. However, in many cases two colors may differ by a small amount.
7117 % The fuzz member of image defines how much tolerance is acceptable to
7118 % consider two colors as the same. For example, set fuzz to 10 and the
7119 % color red at intensities of 100 and 102 respectively are now interpreted
7120 % as the same color for the purposes of the floodfill.
7122 % o invert: paint any pixel that does not match the target color.
7125 WandExport MagickBooleanType MagickOpaquePaintImage(MagickWand *wand,
7126 const PixelWand *target,const PixelWand *fill,const double fuzz,
7127 const MagickBooleanType invert)
7136 assert(wand != (MagickWand *) NULL);
7137 assert(wand->signature == WandSignature);
7138 if (IfMagickTrue(wand->debug))
7139 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7140 if (wand->images == (Image *) NULL)
7141 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7142 PixelGetMagickColor(target,&target_pixel);
7143 PixelGetMagickColor(fill,&fill_pixel);
7144 wand->images->fuzz=fuzz;
7145 status=OpaquePaintImage(wand->images,&target_pixel,&fill_pixel,invert,
7151 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7155 % 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 %
7159 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7161 % MagickOptimizeImageLayers() compares each image the GIF disposed forms of the
7162 % previous image in the sequence. From this it attempts to select the
7163 % smallest cropped image to replace each frame, while preserving the results
7166 % The format of the MagickOptimizeImageLayers method is:
7168 % MagickWand *MagickOptimizeImageLayers(MagickWand *wand)
7170 % A description of each parameter follows:
7172 % o wand: the magick wand.
7175 WandExport MagickWand *MagickOptimizeImageLayers(MagickWand *wand)
7180 assert(wand != (MagickWand *) NULL);
7181 assert(wand->signature == WandSignature);
7182 if (IfMagickTrue(wand->debug))
7183 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7184 if (wand->images == (Image *) NULL)
7185 return((MagickWand *) NULL);
7186 optimize_image=OptimizeImageLayers(wand->images,wand->exception);
7187 if (optimize_image == (Image *) NULL)
7188 return((MagickWand *) NULL);
7189 return(CloneMagickWandFromImages(wand,optimize_image));
7193 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7197 % M a g i c k O p t i m i z e I m a g e T r a n s p a r e n c y %
7201 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7203 % MagickOptimizeImageTransparency() takes a frame optimized GIF animation, and
7204 % compares the overlayed pixels against the disposal image resulting from all
7205 % the previous frames in the animation. Any pixel that does not change the
7206 % disposal image (and thus does not effect the outcome of an overlay) is made
7209 % WARNING: This modifies the current images directly, rather than generate
7210 % a new image sequence.
7211 % The format of the MagickOptimizeImageTransparency method is:
7213 % MagickBooleanType MagickOptimizeImageTransparency(MagickWand *wand)
7215 % A description of each parameter follows:
7217 % o wand: the magick wand.
7220 WandExport MagickBooleanType MagickOptimizeImageTransparency(MagickWand *wand)
7222 assert(wand != (MagickWand *) NULL);
7223 assert(wand->signature == WandSignature);
7224 if (IfMagickTrue(wand->debug))
7225 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7226 if (wand->images == (Image *) NULL)
7227 return(MagickFalse);
7228 OptimizeImageTransparency(wand->images,wand->exception);
7233 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7237 % 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 %
7241 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7243 % MagickOrderedPosterizeImage() performs an ordered dither based on a number
7244 % of pre-defined dithering threshold maps, but over multiple intensity levels,
7245 % which can be different for different channels, according to the input
7248 % The format of the MagickOrderedPosterizeImage method is:
7250 % MagickBooleanType MagickOrderedPosterizeImage(MagickWand *wand,
7251 % const char *threshold_map)
7253 % A description of each parameter follows:
7255 % o image: the image.
7257 % o threshold_map: A string containing the name of the threshold dither
7258 % map to use, followed by zero or more numbers representing the number of
7259 % color levels tho dither between.
7261 % Any level number less than 2 is equivalent to 2, and means only binary
7262 % dithering will be applied to each color channel.
7264 % No numbers also means a 2 level (bitmap) dither will be applied to all
7265 % channels, while a single number is the number of levels applied to each
7266 % channel in sequence. More numbers will be applied in turn to each of
7267 % the color channels.
7269 % For example: "o3x3,6" generates a 6 level posterization of the image
7270 % with a ordered 3x3 diffused pixel dither being applied between each
7271 % level. While checker,8,8,4 will produce a 332 colormaped image with
7272 % only a single checkerboard hash pattern (50% grey) between each color
7273 % level, to basically double the number of color levels with a bare
7274 % minimim of dithering.
7277 WandExport MagickBooleanType MagickOrderedPosterizeImage(MagickWand *wand,
7278 const char *threshold_map)
7283 assert(wand != (MagickWand *) NULL);
7284 assert(wand->signature == WandSignature);
7285 if (IfMagickTrue(wand->debug))
7286 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7287 if (wand->images == (Image *) NULL)
7288 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7289 status=OrderedPosterizeImage(wand->images,threshold_map,wand->exception);
7294 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7298 % M a g i c k P i n g I m a g e %
7302 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7304 % MagickPingImage() is the same as MagickReadImage() except the only valid
7305 % information returned is the image width, height, size, and format. It
7306 % is designed to efficiently obtain this information from a file without
7307 % reading the entire image sequence into memory.
7309 % The format of the MagickPingImage method is:
7311 % MagickBooleanType MagickPingImage(MagickWand *wand,const char *filename)
7313 % A description of each parameter follows:
7315 % o wand: the magick wand.
7317 % o filename: the image filename.
7320 WandExport MagickBooleanType MagickPingImage(MagickWand *wand,
7321 const char *filename)
7329 assert(wand != (MagickWand *) NULL);
7330 assert(wand->signature == WandSignature);
7331 if (IfMagickTrue(wand->debug))
7332 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7333 ping_info=CloneImageInfo(wand->image_info);
7334 if (filename != (const char *) NULL)
7335 (void) CopyMagickString(ping_info->filename,filename,MaxTextExtent);
7336 images=PingImage(ping_info,wand->exception);
7337 ping_info=DestroyImageInfo(ping_info);
7338 if (images == (Image *) NULL)
7339 return(MagickFalse);
7340 return(InsertImageInWand(wand,images));
7344 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7348 % M a g i c k P i n g I m a g e B l o b %
7352 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7354 % MagickPingImageBlob() pings an image or image sequence from a blob.
7356 % The format of the MagickPingImageBlob method is:
7358 % MagickBooleanType MagickPingImageBlob(MagickWand *wand,
7359 % const void *blob,const size_t length)
7361 % A description of each parameter follows:
7363 % o wand: the magick wand.
7367 % o length: the blob length.
7370 WandExport MagickBooleanType MagickPingImageBlob(MagickWand *wand,
7371 const void *blob,const size_t length)
7379 assert(wand != (MagickWand *) NULL);
7380 assert(wand->signature == WandSignature);
7381 if (IfMagickTrue(wand->debug))
7382 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7383 read_info=CloneImageInfo(wand->image_info);
7384 SetImageInfoBlob(read_info,blob,length);
7385 images=PingImage(read_info,wand->exception);
7386 read_info=DestroyImageInfo(read_info);
7387 if (images == (Image *) NULL)
7388 return(MagickFalse);
7389 return(InsertImageInWand(wand,images));
7393 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7397 % M a g i c k P i n g I m a g e F i l e %
7401 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7403 % MagickPingImageFile() pings an image or image sequence from an open file
7406 % The format of the MagickPingImageFile method is:
7408 % MagickBooleanType MagickPingImageFile(MagickWand *wand,FILE *file)
7410 % A description of each parameter follows:
7412 % o wand: the magick wand.
7414 % o file: the file descriptor.
7417 WandExport MagickBooleanType MagickPingImageFile(MagickWand *wand,FILE *file)
7425 assert(wand != (MagickWand *) NULL);
7426 assert(wand->signature == WandSignature);
7427 assert(file != (FILE *) NULL);
7428 if (IfMagickTrue(wand->debug))
7429 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7430 read_info=CloneImageInfo(wand->image_info);
7431 SetImageInfoFile(read_info,file);
7432 images=PingImage(read_info,wand->exception);
7433 read_info=DestroyImageInfo(read_info);
7434 if (images == (Image *) NULL)
7435 return(MagickFalse);
7436 return(InsertImageInWand(wand,images));
7440 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7444 % M a g i c k P o l a r o i d I m a g e %
7448 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7450 % MagickPolaroidImage() simulates a Polaroid picture.
7452 % The format of the MagickPolaroidImage method is:
7454 % MagickBooleanType MagickPolaroidImage(MagickWand *wand,
7455 % const DrawingWand *drawing_wand,const char *caption,const double angle,
7456 % const PixelInterpolateMethod method)
7458 % A description of each parameter follows:
7460 % o wand: the magick wand.
7462 % o drawing_wand: the draw wand.
7464 % o caption: the Polaroid caption.
7466 % o angle: Apply the effect along this angle.
7468 % o method: the pixel interpolation method.
7471 WandExport MagickBooleanType MagickPolaroidImage(MagickWand *wand,
7472 const DrawingWand *drawing_wand,const char *caption,const double angle,
7473 const PixelInterpolateMethod method)
7481 assert(wand != (MagickWand *) NULL);
7482 assert(wand->signature == WandSignature);
7483 if (IfMagickTrue(wand->debug))
7484 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7485 if (wand->images == (Image *) NULL)
7486 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7487 draw_info=PeekDrawingWand(drawing_wand);
7488 if (draw_info == (DrawInfo *) NULL)
7489 return(MagickFalse);
7490 polaroid_image=PolaroidImage(wand->images,draw_info,caption,angle,method,
7492 if (polaroid_image == (Image *) NULL)
7493 return(MagickFalse);
7494 ReplaceImageInList(&wand->images,polaroid_image);
7499 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7503 % M a g i c k P o s t e r i z e I m a g e %
7507 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7509 % MagickPosterizeImage() reduces the image to a limited number of color level.
7511 % The format of the MagickPosterizeImage method is:
7513 % MagickBooleanType MagickPosterizeImage(MagickWand *wand,
7514 % const size_t levels,const DitherMethod method)
7516 % A description of each parameter follows:
7518 % o wand: the magick wand.
7520 % o levels: Number of color levels allowed in each channel. Very low values
7521 % (2, 3, or 4) have the most visible effect.
7523 % o method: choose the dither method: UndefinedDitherMethod,
7524 % NoDitherMethod, RiemersmaDitherMethod, or FloydSteinbergDitherMethod.
7527 WandExport MagickBooleanType MagickPosterizeImage(MagickWand *wand,
7528 const size_t levels,const DitherMethod dither)
7533 assert(wand != (MagickWand *) NULL);
7534 assert(wand->signature == WandSignature);
7535 if (IfMagickTrue(wand->debug))
7536 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7537 if (wand->images == (Image *) NULL)
7538 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7539 status=PosterizeImage(wand->images,levels,dither,wand->exception);
7544 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7548 % M a g i c k P r e v i e w I m a g e s %
7552 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7554 % MagickPreviewImages() tiles 9 thumbnails of the specified image with an
7555 % image processing operation applied at varying strengths. This helpful
7556 % to quickly pin-point an appropriate parameter for an image processing
7559 % The format of the MagickPreviewImages method is:
7561 % MagickWand *MagickPreviewImages(MagickWand *wand,
7562 % const PreviewType preview)
7564 % A description of each parameter follows:
7566 % o wand: the magick wand.
7568 % o preview: the preview type.
7571 WandExport MagickWand *MagickPreviewImages(MagickWand *wand,
7572 const PreviewType preview)
7577 assert(wand != (MagickWand *) NULL);
7578 assert(wand->signature == WandSignature);
7579 if (IfMagickTrue(wand->debug))
7580 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7581 if (wand->images == (Image *) NULL)
7582 return((MagickWand *) NULL);
7583 preview_image=PreviewImage(wand->images,preview,wand->exception);
7584 if (preview_image == (Image *) NULL)
7585 return((MagickWand *) NULL);
7586 return(CloneMagickWandFromImages(wand,preview_image));
7590 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7594 % M a g i c k P r e v i o u s I m a g e %
7598 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7600 % MagickPreviousImage() sets the previous image in the wand as the current
7603 % It is typically used after MagickSetLastIterator(), after which its first
7604 % use will set the last image as the current image (unless the wand is empty).
7606 % It will return MagickFalse when no more images are left to be returned
7607 % which happens when the wand is empty, or the current image is the first
7608 % image. At that point the iterator is than reset to again process images in
7609 % the forward direction, again starting with the first image in list. Images
7610 % added at this point are prepended.
7612 % Also at that point any images added to the wand using MagickAddImages() or
7613 % MagickReadImages() will be prepended before the first image. In this sense
7614 % the condition is not quite exactly the same as MagickResetIterator().
7616 % The format of the MagickPreviousImage method is:
7618 % MagickBooleanType MagickPreviousImage(MagickWand *wand)
7620 % A description of each parameter follows:
7622 % o wand: the magick wand.
7625 WandExport MagickBooleanType MagickPreviousImage(MagickWand *wand)
7627 assert(wand != (MagickWand *) NULL);
7628 assert(wand->signature == WandSignature);
7629 if (IfMagickTrue(wand->debug))
7630 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7631 if (wand->images == (Image *) NULL)
7632 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7633 if (IfMagickTrue(wand->image_pending))
7635 wand->image_pending=MagickFalse; /* image returned no longer pending */
7638 if (GetPreviousImageInList(wand->images) == (Image *) NULL)
7640 wand->image_pending=MagickTrue; /* Next now re-gets first image */
7641 wand->insert_before=MagickTrue; /* insert/add prepends new images */
7642 return(MagickFalse);
7644 wand->images=GetPreviousImageInList(wand->images);
7649 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7653 % M a g i c k Q u a n t i z e I m a g e %
7657 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7659 % MagickQuantizeImage() analyzes the colors within a reference image and
7660 % chooses a fixed number of colors to represent the image. The goal of the
7661 % algorithm is to minimize the color difference between the input and output
7662 % image while minimizing the processing time.
7664 % The format of the MagickQuantizeImage method is:
7666 % MagickBooleanType MagickQuantizeImage(MagickWand *wand,
7667 % const size_t number_colors,const ColorspaceType colorspace,
7668 % const size_t treedepth,const DitherMethod dither_method,
7669 % const MagickBooleanType measure_error)
7671 % A description of each parameter follows:
7673 % o wand: the magick wand.
7675 % o number_colors: the number of colors.
7677 % o colorspace: Perform color reduction in this colorspace, typically
7680 % o treedepth: Normally, this integer value is zero or one. A zero or
7681 % 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
7682 % reference image with the least amount of memory and the fastest
7683 % computational speed. In some cases, such as an image with low color
7684 % dispersion (a few number of colors), a value other than
7685 % Log4(number_colors) is required. To expand the color tree completely,
7688 % o dither_method: choose from UndefinedDitherMethod, NoDitherMethod,
7689 % RiemersmaDitherMethod, FloydSteinbergDitherMethod.
7691 % o measure_error: A value other than zero measures the difference between
7692 % the original and quantized images. This difference is the total
7693 % quantization error. The error is computed by summing over all pixels
7694 % in an image the distance squared in RGB space between each reference
7695 % pixel value and its quantized value.
7698 WandExport MagickBooleanType MagickQuantizeImage(MagickWand *wand,
7699 const size_t number_colors,const ColorspaceType colorspace,
7700 const size_t treedepth,const DitherMethod dither_method,
7701 const MagickBooleanType measure_error)
7709 assert(wand != (MagickWand *) NULL);
7710 assert(wand->signature == WandSignature);
7711 if (IfMagickTrue(wand->debug))
7712 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7713 if (wand->images == (Image *) NULL)
7714 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7715 quantize_info=CloneQuantizeInfo((QuantizeInfo *) NULL);
7716 quantize_info->number_colors=number_colors;
7717 quantize_info->dither_method=dither_method;
7718 quantize_info->tree_depth=treedepth;
7719 quantize_info->colorspace=colorspace;
7720 quantize_info->measure_error=measure_error;
7721 status=QuantizeImage(quantize_info,wand->images,wand->exception);
7722 quantize_info=DestroyQuantizeInfo(quantize_info);
7727 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7731 % M a g i c k Q u a n t i z e I m a g e s %
7735 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7737 % MagickQuantizeImages() analyzes the colors within a sequence of images and
7738 % chooses a fixed number of colors to represent the image. The goal of the
7739 % algorithm is to minimize the color difference between the input and output
7740 % image while minimizing the processing time.
7742 % The format of the MagickQuantizeImages method is:
7744 % MagickBooleanType MagickQuantizeImages(MagickWand *wand,
7745 % const size_t number_colors,const ColorspaceType colorspace,
7746 % const size_t treedepth,const DitherMethod dither_method,
7747 % const MagickBooleanType measure_error)
7749 % A description of each parameter follows:
7751 % o wand: the magick wand.
7753 % o number_colors: the number of colors.
7755 % o colorspace: Perform color reduction in this colorspace, typically
7758 % o treedepth: Normally, this integer value is zero or one. A zero or
7759 % 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
7760 % reference image with the least amount of memory and the fastest
7761 % computational speed. In some cases, such as an image with low color
7762 % dispersion (a few number of colors), a value other than
7763 % Log4(number_colors) is required. To expand the color tree completely,
7766 % o dither_method: choose from these dither methods: NoDitherMethod,
7767 % RiemersmaDitherMethod, or FloydSteinbergDitherMethod.
7769 % o measure_error: A value other than zero measures the difference between
7770 % the original and quantized images. This difference is the total
7771 % quantization error. The error is computed by summing over all pixels
7772 % in an image the distance squared in RGB space between each reference
7773 % pixel value and its quantized value.
7776 WandExport MagickBooleanType MagickQuantizeImages(MagickWand *wand,
7777 const size_t number_colors,const ColorspaceType colorspace,
7778 const size_t treedepth,const DitherMethod dither_method,
7779 const MagickBooleanType measure_error)
7787 assert(wand != (MagickWand *) NULL);
7788 assert(wand->signature == WandSignature);
7789 if (IfMagickTrue(wand->debug))
7790 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7791 if (wand->images == (Image *) NULL)
7792 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7793 quantize_info=CloneQuantizeInfo((QuantizeInfo *) NULL);
7794 quantize_info->number_colors=number_colors;
7795 quantize_info->dither_method=dither_method;
7796 quantize_info->tree_depth=treedepth;
7797 quantize_info->colorspace=colorspace;
7798 quantize_info->measure_error=measure_error;
7799 status=QuantizeImages(quantize_info,wand->images,wand->exception);
7800 quantize_info=DestroyQuantizeInfo(quantize_info);
7805 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7809 % M a g i c k R a d i a l B l u r I m a g e %
7813 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7815 % MagickRadialBlurImage() radial blurs an image.
7817 % The format of the MagickRadialBlurImage method is:
7819 % MagickBooleanType MagickRadialBlurImage(MagickWand *wand,
7820 % const double angle)
7822 % A description of each parameter follows:
7824 % o wand: the magick wand.
7826 % o angle: the angle of the blur in degrees.
7829 WandExport MagickBooleanType MagickRadialBlurImage(MagickWand *wand,
7835 assert(wand != (MagickWand *) NULL);
7836 assert(wand->signature == WandSignature);
7837 if (IfMagickTrue(wand->debug))
7838 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7839 if (wand->images == (Image *) NULL)
7840 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7841 blur_image=RadialBlurImage(wand->images,angle,wand->exception);
7842 if (blur_image == (Image *) NULL)
7843 return(MagickFalse);
7844 ReplaceImageInList(&wand->images,blur_image);
7849 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7853 % M a g i c k R a i s e I m a g e %
7857 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7859 % MagickRaiseImage() creates a simulated three-dimensional button-like effect
7860 % by lightening and darkening the edges of the image. Members width and
7861 % height of raise_info define the width of the vertical and horizontal
7862 % edge of the effect.
7864 % The format of the MagickRaiseImage method is:
7866 % MagickBooleanType MagickRaiseImage(MagickWand *wand,
7867 % const size_t width,const size_t height,const ssize_t x,
7868 % const ssize_t y,const MagickBooleanType raise)
7870 % A description of each parameter follows:
7872 % o wand: the magick wand.
7874 % o width,height,x,y: Define the dimensions of the area to raise.
7876 % o raise: A value other than zero creates a 3-D raise effect,
7877 % otherwise it has a lowered effect.
7880 WandExport MagickBooleanType MagickRaiseImage(MagickWand *wand,
7881 const size_t width,const size_t height,const ssize_t x,
7882 const ssize_t y,const MagickBooleanType raise)
7890 assert(wand != (MagickWand *) NULL);
7891 assert(wand->signature == WandSignature);
7892 if (IfMagickTrue(wand->debug))
7893 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7894 if (wand->images == (Image *) NULL)
7895 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7896 raise_info.width=width;
7897 raise_info.height=height;
7900 status=RaiseImage(wand->images,&raise_info,raise,wand->exception);
7905 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7909 % 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 %
7913 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7915 % MagickRandomThresholdImage() changes the value of individual pixels based on
7916 % the intensity of each pixel compared to threshold. The result is a
7917 % high-contrast, two color image.
7919 % The format of the MagickRandomThresholdImage method is:
7921 % MagickBooleanType MagickRandomThresholdImage(MagickWand *wand,
7922 % const double low,const double high)
7924 % A description of each parameter follows:
7926 % o wand: the magick wand.
7928 % o low,high: Specify the high and low thresholds. These values range from
7929 % 0 to QuantumRange.
7932 WandExport MagickBooleanType MagickRandomThresholdImage(MagickWand *wand,
7933 const double low,const double high)
7936 threshold[MaxTextExtent];
7938 assert(wand != (MagickWand *) NULL);
7939 assert(wand->signature == WandSignature);
7940 if (IfMagickTrue(wand->debug))
7941 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7942 if (wand->images == (Image *) NULL)
7943 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7944 (void) FormatLocaleString(threshold,MaxTextExtent,"%gx%g",low,high);
7945 return(RandomThresholdImage(wand->images,threshold,wand->exception));
7949 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7953 % M a g i c k R e a d I m a g e %
7957 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7959 % MagickReadImage() reads an image or image sequence. The images are inserted
7960 % jjust before the current image pointer position.
7962 % Use MagickSetFirstIterator(), to insert new images before all the current
7963 % images in the wand, MagickSetLastIterator() to append add to the end,
7964 % MagickSetImageIndex() to place images just after the given index.
7966 % The format of the MagickReadImage method is:
7968 % MagickBooleanType MagickReadImage(MagickWand *wand,const char *filename)
7970 % A description of each parameter follows:
7972 % o wand: the magick wand.
7974 % o filename: the image filename.
7977 WandExport MagickBooleanType MagickReadImage(MagickWand *wand,
7978 const char *filename)
7986 assert(wand != (MagickWand *) NULL);
7987 assert(wand->signature == WandSignature);
7988 if (IfMagickTrue(wand->debug))
7989 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7990 read_info=CloneImageInfo(wand->image_info);
7991 if (filename != (const char *) NULL)
7992 (void) CopyMagickString(read_info->filename,filename,MaxTextExtent);
7993 images=ReadImage(read_info,wand->exception);
7994 read_info=DestroyImageInfo(read_info);
7995 if (images == (Image *) NULL)
7996 return(MagickFalse);
7997 return(InsertImageInWand(wand,images));
8001 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8005 % M a g i c k R e a d I m a g e B l o b %
8009 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8011 % MagickReadImageBlob() reads an image or image sequence from a blob.
8012 % In all other respects it is like MagickReadImage().
8014 % The format of the MagickReadImageBlob method is:
8016 % MagickBooleanType MagickReadImageBlob(MagickWand *wand,
8017 % const void *blob,const size_t length)
8019 % A description of each parameter follows:
8021 % o wand: the magick wand.
8025 % o length: the blob length.
8028 WandExport MagickBooleanType MagickReadImageBlob(MagickWand *wand,
8029 const void *blob,const size_t length)
8034 assert(wand != (MagickWand *) NULL);
8035 assert(wand->signature == WandSignature);
8036 if (IfMagickTrue(wand->debug))
8037 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8038 images=BlobToImage(wand->image_info,blob,length,wand->exception);
8039 if (images == (Image *) NULL)
8040 return(MagickFalse);
8041 return(InsertImageInWand(wand,images));
8045 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8049 % M a g i c k R e a d I m a g e F i l e %
8053 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8055 % MagickReadImageFile() reads an image or image sequence from an already
8056 % opened file descriptor. Otherwise it is like MagickReadImage().
8058 % The format of the MagickReadImageFile method is:
8060 % MagickBooleanType MagickReadImageFile(MagickWand *wand,FILE *file)
8062 % A description of each parameter follows:
8064 % o wand: the magick wand.
8066 % o file: the file descriptor.
8069 WandExport MagickBooleanType MagickReadImageFile(MagickWand *wand,FILE *file)
8077 assert(wand != (MagickWand *) NULL);
8078 assert(wand->signature == WandSignature);
8079 assert(file != (FILE *) NULL);
8080 if (IfMagickTrue(wand->debug))
8081 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8082 read_info=CloneImageInfo(wand->image_info);
8083 SetImageInfoFile(read_info,file);
8084 images=ReadImage(read_info,wand->exception);
8085 read_info=DestroyImageInfo(read_info);
8086 if (images == (Image *) NULL)
8087 return(MagickFalse);
8088 return(InsertImageInWand(wand,images));
8092 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8096 % M a g i c k R e m a p I m a g e %
8100 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8102 % MagickRemapImage() replaces the colors of an image with the closest color
8103 % from a reference image.
8105 % The format of the MagickRemapImage method is:
8107 % MagickBooleanType MagickRemapImage(MagickWand *wand,
8108 % const MagickWand *remap_wand,const DitherMethod method)
8110 % A description of each parameter follows:
8112 % o wand: the magick wand.
8114 % o affinity: the affinity wand.
8116 % o method: choose from these dither methods: NoDitherMethod,
8117 % RiemersmaDitherMethod, or FloydSteinbergDitherMethod.
8120 WandExport MagickBooleanType MagickRemapImage(MagickWand *wand,
8121 const MagickWand *remap_wand,const DitherMethod dither_method)
8129 assert(wand != (MagickWand *) NULL);
8130 assert(wand->signature == WandSignature);
8131 if (IfMagickTrue(wand->debug))
8132 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8133 if ((wand->images == (Image *) NULL) ||
8134 (remap_wand->images == (Image *) NULL))
8135 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8136 quantize_info=AcquireQuantizeInfo(wand->image_info);
8137 quantize_info->dither_method=dither_method;
8138 status=RemapImage(quantize_info,wand->images,remap_wand->images,
8140 quantize_info=DestroyQuantizeInfo(quantize_info);
8145 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8149 % M a g i c k R e m o v e I m a g e %
8153 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8155 % MagickRemoveImage() removes an image from the image list.
8157 % The format of the MagickRemoveImage method is:
8159 % MagickBooleanType MagickRemoveImage(MagickWand *wand)
8161 % A description of each parameter follows:
8163 % o wand: the magick wand.
8165 % o insert: the splice wand.
8168 WandExport MagickBooleanType MagickRemoveImage(MagickWand *wand)
8170 assert(wand != (MagickWand *) NULL);
8171 assert(wand->signature == WandSignature);
8172 if (IfMagickTrue(wand->debug))
8173 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8174 if (wand->images == (Image *) NULL)
8175 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8176 DeleteImageFromList(&wand->images);
8181 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8185 % M a g i c k R e s a m p l e I m a g e %
8189 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8191 % MagickResampleImage() resample image to desired resolution.
8193 % Bessel Blackman Box
8194 % Catrom Cubic Gaussian
8195 % Hanning Hermite Lanczos
8196 % Mitchell Point Quandratic
8199 % Most of the filters are FIR (finite impulse response), however, Bessel,
8200 % Gaussian, and Sinc are IIR (infinite impulse response). Bessel and Sinc
8201 % are windowed (brought down to zero) with the Blackman filter.
8203 % The format of the MagickResampleImage method is:
8205 % MagickBooleanType MagickResampleImage(MagickWand *wand,
8206 % const double x_resolution,const double y_resolution,
8207 % const FilterTypes filter)
8209 % A description of each parameter follows:
8211 % o wand: the magick wand.
8213 % o x_resolution: the new image x resolution.
8215 % o y_resolution: the new image y resolution.
8217 % o filter: Image filter to use.
8220 WandExport MagickBooleanType MagickResampleImage(MagickWand *wand,
8221 const double x_resolution,const double y_resolution,const FilterTypes filter)
8226 assert(wand != (MagickWand *) NULL);
8227 assert(wand->signature == WandSignature);
8228 if (IfMagickTrue(wand->debug))
8229 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8230 if (wand->images == (Image *) NULL)
8231 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8232 resample_image=ResampleImage(wand->images,x_resolution,y_resolution,filter,
8234 if (resample_image == (Image *) NULL)
8235 return(MagickFalse);
8236 ReplaceImageInList(&wand->images,resample_image);
8241 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8245 % M a g i c k R e s e t I m a g e P a g e %
8249 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8251 % MagickResetImagePage() resets the Wand page canvas and position.
8253 % The format of the MagickResetImagePage method is:
8255 % MagickBooleanType MagickResetImagePage(MagickWand *wand,
8258 % A description of each parameter follows:
8260 % o wand: the magick wand.
8262 % o page: the relative page specification.
8265 WandExport MagickBooleanType MagickResetImagePage(MagickWand *wand,
8268 assert(wand != (MagickWand *) NULL);
8269 assert(wand->signature == WandSignature);
8270 if (IfMagickTrue(wand->debug))
8271 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8272 if (wand->images == (Image *) NULL)
8273 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8274 if ((page == (char *) NULL) || (*page == '\0'))
8276 (void) ParseAbsoluteGeometry("0x0+0+0",&wand->images->page);
8279 return(ResetImagePage(wand->images,page));
8283 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8287 % M a g i c k R e s i z e I m a g e %
8291 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8293 % MagickResizeImage() scales an image to the desired dimensions with one of
8296 % Bessel Blackman Box
8297 % Catrom Cubic Gaussian
8298 % Hanning Hermite Lanczos
8299 % Mitchell Point Quandratic
8302 % Most of the filters are FIR (finite impulse response), however, Bessel,
8303 % Gaussian, and Sinc are IIR (infinite impulse response). Bessel and Sinc
8304 % are windowed (brought down to zero) with the Blackman filter.
8306 % The format of the MagickResizeImage method is:
8308 % MagickBooleanType MagickResizeImage(MagickWand *wand,
8309 % const size_t columns,const size_t rows,const FilterTypes filter)
8311 % A description of each parameter follows:
8313 % o wand: the magick wand.
8315 % o columns: the number of columns in the scaled image.
8317 % o rows: the number of rows in the scaled image.
8319 % o filter: Image filter to use.
8322 WandExport MagickBooleanType MagickResizeImage(MagickWand *wand,
8323 const size_t columns,const size_t rows,const FilterTypes filter)
8328 assert(wand != (MagickWand *) NULL);
8329 assert(wand->signature == WandSignature);
8330 if (IfMagickTrue(wand->debug))
8331 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8332 if (wand->images == (Image *) NULL)
8333 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8334 resize_image=ResizeImage(wand->images,columns,rows,filter,wand->exception);
8335 if (resize_image == (Image *) NULL)
8336 return(MagickFalse);
8337 ReplaceImageInList(&wand->images,resize_image);
8342 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8346 % M a g i c k R o l l I m a g e %
8350 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8352 % MagickRollImage() offsets an image as defined by x and y.
8354 % The format of the MagickRollImage method is:
8356 % MagickBooleanType MagickRollImage(MagickWand *wand,const ssize_t x,
8359 % A description of each parameter follows:
8361 % o wand: the magick wand.
8363 % o x: the x offset.
8365 % o y: the y offset.
8369 WandExport MagickBooleanType MagickRollImage(MagickWand *wand,
8370 const ssize_t x,const ssize_t y)
8375 assert(wand != (MagickWand *) NULL);
8376 assert(wand->signature == WandSignature);
8377 if (IfMagickTrue(wand->debug))
8378 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8379 if (wand->images == (Image *) NULL)
8380 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8381 roll_image=RollImage(wand->images,x,y,wand->exception);
8382 if (roll_image == (Image *) NULL)
8383 return(MagickFalse);
8384 ReplaceImageInList(&wand->images,roll_image);
8389 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8393 % M a g i c k R o t a t e I m a g e %
8397 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8399 % MagickRotateImage() rotates an image the specified number of degrees. Empty
8400 % triangles left over from rotating the image are filled with the
8403 % The format of the MagickRotateImage method is:
8405 % MagickBooleanType MagickRotateImage(MagickWand *wand,
8406 % const PixelWand *background,const double degrees)
8408 % A description of each parameter follows:
8410 % o wand: the magick wand.
8412 % o background: the background pixel wand.
8414 % o degrees: the number of degrees to rotate the image.
8418 WandExport MagickBooleanType MagickRotateImage(MagickWand *wand,
8419 const PixelWand *background,const double degrees)
8424 assert(wand != (MagickWand *) NULL);
8425 assert(wand->signature == WandSignature);
8426 if (IfMagickTrue(wand->debug))
8427 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8428 if (wand->images == (Image *) NULL)
8429 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8430 PixelGetQuantumPacket(background,&wand->images->background_color);
8431 rotate_image=RotateImage(wand->images,degrees,wand->exception);
8432 if (rotate_image == (Image *) NULL)
8433 return(MagickFalse);
8434 ReplaceImageInList(&wand->images,rotate_image);
8439 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8443 % M a g i c k S a m p l e I m a g e %
8447 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8449 % MagickSampleImage() scales an image to the desired dimensions with pixel
8450 % sampling. Unlike other scaling methods, this method does not introduce
8451 % any additional color into the scaled image.
8453 % The format of the MagickSampleImage method is:
8455 % MagickBooleanType MagickSampleImage(MagickWand *wand,
8456 % const size_t columns,const size_t rows)
8458 % A description of each parameter follows:
8460 % o wand: the magick wand.
8462 % o columns: the number of columns in the scaled image.
8464 % o rows: the number of rows in the scaled image.
8468 WandExport MagickBooleanType MagickSampleImage(MagickWand *wand,
8469 const size_t columns,const size_t rows)
8474 assert(wand != (MagickWand *) NULL);
8475 assert(wand->signature == WandSignature);
8476 if (IfMagickTrue(wand->debug))
8477 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8478 if (wand->images == (Image *) NULL)
8479 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8480 sample_image=SampleImage(wand->images,columns,rows,wand->exception);
8481 if (sample_image == (Image *) NULL)
8482 return(MagickFalse);
8483 ReplaceImageInList(&wand->images,sample_image);
8488 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8492 % M a g i c k S c a l e I m a g e %
8496 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8498 % MagickScaleImage() scales the size of an image to the given dimensions.
8500 % The format of the MagickScaleImage method is:
8502 % MagickBooleanType MagickScaleImage(MagickWand *wand,
8503 % const size_t columns,const size_t rows)
8505 % A description of each parameter follows:
8507 % o wand: the magick wand.
8509 % o columns: the number of columns in the scaled image.
8511 % o rows: the number of rows in the scaled image.
8515 WandExport MagickBooleanType MagickScaleImage(MagickWand *wand,
8516 const size_t columns,const size_t rows)
8521 assert(wand != (MagickWand *) NULL);
8522 assert(wand->signature == WandSignature);
8523 if (IfMagickTrue(wand->debug))
8524 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8525 if (wand->images == (Image *) NULL)
8526 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8527 scale_image=ScaleImage(wand->images,columns,rows,wand->exception);
8528 if (scale_image == (Image *) NULL)
8529 return(MagickFalse);
8530 ReplaceImageInList(&wand->images,scale_image);
8535 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8539 % M a g i c k S e g m e n t I m a g e %
8543 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8545 % MagickSegmentImage() segments an image by analyzing the histograms of the
8546 % color components and identifying units that are homogeneous with the fuzzy
8547 % C-means technique.
8549 % The format of the SegmentImage method is:
8551 % MagickBooleanType MagickSegmentImage(MagickWand *wand,
8552 % const ColorspaceType colorspace,const MagickBooleanType verbose,
8553 % const double cluster_threshold,const double smooth_threshold)
8555 % A description of each parameter follows.
8559 % o colorspace: the image colorspace.
8561 % o verbose: Set to MagickTrue to print detailed information about the
8562 % identified classes.
8564 % o cluster_threshold: This represents the minimum number of pixels
8565 % contained in a hexahedra before it can be considered valid (expressed as
8568 % o smooth_threshold: the smoothing threshold eliminates noise in the second
8569 % derivative of the histogram. As the value is increased, you can expect a
8570 % smoother second derivative.
8573 MagickExport MagickBooleanType MagickSegmentImage(MagickWand *wand,
8574 const ColorspaceType colorspace,const MagickBooleanType verbose,
8575 const double cluster_threshold,const double smooth_threshold)
8580 assert(wand != (MagickWand *) NULL);
8581 assert(wand->signature == WandSignature);
8582 if (IfMagickTrue(wand->debug))
8583 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8584 if (wand->images == (Image *) NULL)
8585 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8586 status=SegmentImage(wand->images,colorspace,verbose,cluster_threshold,
8587 smooth_threshold,wand->exception);
8592 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8596 % M a g i c k S e l e c t i v e B l u r I m a g e %
8600 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8602 % MagickSelectiveBlurImage() selectively blur an image within a contrast
8603 % threshold. It is similar to the unsharpen mask that sharpens everything with
8604 % contrast above a certain threshold.
8606 % The format of the MagickSelectiveBlurImage method is:
8608 % MagickBooleanType MagickSelectiveBlurImage(MagickWand *wand,
8609 % const double radius,const double sigma,const double threshold)
8611 % A description of each parameter follows:
8613 % o wand: the magick wand.
8615 % o radius: the radius of the gaussian, in pixels, not counting the center
8618 % o sigma: the standard deviation of the gaussian, in pixels.
8620 % o threshold: only pixels within this contrast threshold are included
8621 % in the blur operation.
8624 WandExport MagickBooleanType MagickSelectiveBlurImage(MagickWand *wand,
8625 const double radius,const double sigma,const double threshold)
8630 assert(wand != (MagickWand *) NULL);
8631 assert(wand->signature == WandSignature);
8632 if (IfMagickTrue(wand->debug))
8633 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8634 if (wand->images == (Image *) NULL)
8635 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8636 blur_image=SelectiveBlurImage(wand->images,radius,sigma,threshold,
8638 if (blur_image == (Image *) NULL)
8639 return(MagickFalse);
8640 ReplaceImageInList(&wand->images,blur_image);
8645 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8649 % 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 %
8653 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8655 % MagickSeparateImage() separates a channel from the image and returns a
8656 % grayscale image. A channel is a particular color component of each pixel
8659 % The format of the MagickSeparateImage method is:
8661 % MagickBooleanType MagickSeparateImage(MagickWand *wand,
8662 % const ChannelType channel)
8664 % A description of each parameter follows:
8666 % o wand: the magick wand.
8668 % o channel: the channel.
8671 WandExport MagickBooleanType MagickSeparateImage(MagickWand *wand,
8672 const ChannelType channel)
8677 assert(wand != (MagickWand *) NULL);
8678 assert(wand->signature == WandSignature);
8679 if (IfMagickTrue(wand->debug))
8680 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8681 if (wand->images == (Image *) NULL)
8682 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8683 separate_image=SeparateImage(wand->images,channel,wand->exception);
8684 if (separate_image == (Image *) NULL)
8685 return(MagickFalse);
8686 ReplaceImageInList(&wand->images,separate_image);
8691 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8695 % M a g i c k S e p i a T o n e I m a g e %
8699 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8701 % MagickSepiaToneImage() applies a special effect to the image, similar to the
8702 % effect achieved in a photo darkroom by sepia toning. Threshold ranges from
8703 % 0 to QuantumRange and is a measure of the extent of the sepia toning. A
8704 % threshold of 80% is a good starting point for a reasonable tone.
8706 % The format of the MagickSepiaToneImage method is:
8708 % MagickBooleanType MagickSepiaToneImage(MagickWand *wand,
8709 % const double threshold)
8711 % A description of each parameter follows:
8713 % o wand: the magick wand.
8715 % o threshold: Define the extent of the sepia toning.
8718 WandExport MagickBooleanType MagickSepiaToneImage(MagickWand *wand,
8719 const double threshold)
8724 assert(wand != (MagickWand *) NULL);
8725 assert(wand->signature == WandSignature);
8726 if (IfMagickTrue(wand->debug))
8727 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8728 if (wand->images == (Image *) NULL)
8729 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8730 sepia_image=SepiaToneImage(wand->images,threshold,wand->exception);
8731 if (sepia_image == (Image *) NULL)
8732 return(MagickFalse);
8733 ReplaceImageInList(&wand->images,sepia_image);
8738 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8742 % M a g i c k S e t I m a g e %
8746 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8748 % MagickSetImage() replaces the last image returned by MagickSetImageIndex(),
8749 % MagickNextImage(), MagickPreviousImage() with the images from the specified
8752 % The format of the MagickSetImage method is:
8754 % MagickBooleanType MagickSetImage(MagickWand *wand,
8755 % const MagickWand *set_wand)
8757 % A description of each parameter follows:
8759 % o wand: the magick wand.
8761 % o set_wand: the set_wand wand.
8764 WandExport MagickBooleanType MagickSetImage(MagickWand *wand,
8765 const MagickWand *set_wand)
8770 assert(wand != (MagickWand *) NULL);
8771 assert(wand->signature == WandSignature);
8772 if (IfMagickTrue(wand->debug))
8773 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8774 assert(set_wand != (MagickWand *) NULL);
8775 assert(set_wand->signature == WandSignature);
8776 if (IfMagickTrue(wand->debug))
8777 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",set_wand->name);
8778 if (set_wand->images == (Image *) NULL)
8779 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8780 images=CloneImageList(set_wand->images,wand->exception);
8781 if (images == (Image *) NULL)
8782 return(MagickFalse);
8783 ReplaceImageInList(&wand->images,images);
8788 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8792 % 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 %
8796 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8798 % MagickSetImageAlphaChannel() activates, deactivates, resets, or sets the
8801 % The format of the MagickSetImageAlphaChannel method is:
8803 % MagickBooleanType MagickSetImageAlphaChannel(MagickWand *wand,
8804 % const AlphaChannelOption alpha_type)
8806 % A description of each parameter follows:
8808 % o wand: the magick wand.
8810 % o alpha_type: the alpha channel type: ActivateAlphaChannel,
8811 % DeactivateAlphaChannel, OpaqueAlphaChannel, or SetAlphaChannel.
8814 WandExport MagickBooleanType MagickSetImageAlphaChannel(MagickWand *wand,
8815 const AlphaChannelOption alpha_type)
8817 assert(wand != (MagickWand *) NULL);
8818 assert(wand->signature == WandSignature);
8819 if (IfMagickTrue(wand->debug))
8820 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8821 if (wand->images == (Image *) NULL)
8822 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8823 return(SetImageAlphaChannel(wand->images,alpha_type,wand->exception));
8827 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8831 % 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 %
8835 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8837 % MagickSetImageBackgroundColor() sets the image background color.
8839 % The format of the MagickSetImageBackgroundColor method is:
8841 % MagickBooleanType MagickSetImageBackgroundColor(MagickWand *wand,
8842 % const PixelWand *background)
8844 % A description of each parameter follows:
8846 % o wand: the magick wand.
8848 % o background: the background pixel wand.
8851 WandExport MagickBooleanType MagickSetImageBackgroundColor(MagickWand *wand,
8852 const PixelWand *background)
8854 assert(wand != (MagickWand *) NULL);
8855 assert(wand->signature == WandSignature);
8856 if (IfMagickTrue(wand->debug))
8857 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8858 if (wand->images == (Image *) NULL)
8859 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8860 PixelGetQuantumPacket(background,&wand->images->background_color);
8865 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8869 % 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 %
8873 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8875 % MagickSetImageBluePrimary() sets the image chromaticity blue primary point.
8877 % The format of the MagickSetImageBluePrimary method is:
8879 % MagickBooleanType MagickSetImageBluePrimary(MagickWand *wand,
8880 % const double x,const double y)
8882 % A description of each parameter follows:
8884 % o wand: the magick wand.
8886 % o x: the blue primary x-point.
8888 % o y: the blue primary y-point.
8891 WandExport MagickBooleanType MagickSetImageBluePrimary(MagickWand *wand,
8892 const double x,const double y)
8894 assert(wand != (MagickWand *) NULL);
8895 assert(wand->signature == WandSignature);
8896 if (IfMagickTrue(wand->debug))
8897 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8898 if (wand->images == (Image *) NULL)
8899 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8900 wand->images->chromaticity.blue_primary.x=x;
8901 wand->images->chromaticity.blue_primary.y=y;
8906 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8910 % 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 %
8914 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8916 % MagickSetImageBorderColor() sets the image border color.
8918 % The format of the MagickSetImageBorderColor method is:
8920 % MagickBooleanType MagickSetImageBorderColor(MagickWand *wand,
8921 % const PixelWand *border)
8923 % A description of each parameter follows:
8925 % o wand: the magick wand.
8927 % o border: the border pixel wand.
8930 WandExport MagickBooleanType MagickSetImageBorderColor(MagickWand *wand,
8931 const PixelWand *border)
8933 assert(wand != (MagickWand *) NULL);
8934 assert(wand->signature == WandSignature);
8935 if (IfMagickTrue(wand->debug))
8936 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8937 if (wand->images == (Image *) NULL)
8938 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8939 PixelGetQuantumPacket(border,&wand->images->border_color);
8944 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8948 % M a g i c k S e t I m a g e C l i p M a s k %
8952 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8954 % MagickSetImageMask() sets image clip mask.
8956 % The format of the MagickSetImageMask method is:
8958 % MagickBooleanType MagickSetImageMask(MagickWand *wand,
8959 % const MagickWand *clip_mask)
8961 % A description of each parameter follows:
8963 % o wand: the magick wand.
8965 % o clip_mask: the clip_mask wand.
8968 WandExport MagickBooleanType MagickSetImageMask(MagickWand *wand,
8969 const MagickWand *clip_mask)
8971 assert(wand != (MagickWand *) NULL);
8972 assert(wand->signature == WandSignature);
8973 if (IfMagickTrue(wand->debug))
8974 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8975 assert(clip_mask != (MagickWand *) NULL);
8976 assert(clip_mask->signature == WandSignature);
8977 if (IfMagickTrue(clip_mask->debug))
8978 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",clip_mask->name);
8979 if (clip_mask->images == (Image *) NULL)
8980 ThrowWandException(WandError,"ContainsNoImages",clip_mask->name);
8981 return(SetImageMask(wand->images,clip_mask->images,wand->exception));
8985 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8989 % M a g i c k S e t I m a g e C o l o r %
8993 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8995 % MagickSetImageColor() set the entire wand canvas to the specified color.
8997 % The format of the MagickSetImageColor method is:
8999 % MagickBooleanType MagickSetImageColor(MagickWand *wand,
9000 % const PixelWand *color)
9002 % A description of each parameter follows:
9004 % o wand: the magick wand.
9006 % o background: the image color.
9009 WandExport MagickBooleanType MagickSetImageColor(MagickWand *wand,
9010 const PixelWand *color)
9015 assert(wand != (MagickWand *) NULL);
9016 assert(wand->signature == WandSignature);
9017 if (IfMagickTrue(wand->debug))
9018 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9019 PixelGetMagickColor(color,&pixel);
9020 return(SetImageColor(wand->images,&pixel,wand->exception));
9024 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9028 % 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 %
9032 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9034 % MagickSetImageColormapColor() sets the color of the specified colormap
9037 % The format of the MagickSetImageColormapColor method is:
9039 % MagickBooleanType MagickSetImageColormapColor(MagickWand *wand,
9040 % const size_t index,const PixelWand *color)
9042 % A description of each parameter follows:
9044 % o wand: the magick wand.
9046 % o index: the offset into the image colormap.
9048 % o color: Return the colormap color in this wand.
9051 WandExport MagickBooleanType MagickSetImageColormapColor(MagickWand *wand,
9052 const size_t index,const PixelWand *color)
9054 assert(wand != (MagickWand *) NULL);
9055 assert(wand->signature == WandSignature);
9056 if (IfMagickTrue(wand->debug))
9057 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9058 if (wand->images == (Image *) NULL)
9059 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9060 if ((wand->images->colormap == (PixelInfo *) NULL) ||
9061 (index >= wand->images->colors))
9062 ThrowWandException(WandError,"InvalidColormapIndex",wand->name);
9063 PixelGetQuantumPacket(color,wand->images->colormap+index);
9064 return(SyncImage(wand->images,wand->exception));
9068 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9072 % M a g i c k S e t I m a g e C o l o r s p a c e %
9076 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9078 % MagickSetImageColorspace() sets the image colorspace. But does not modify
9081 % The format of the MagickSetImageColorspace method is:
9083 % MagickBooleanType MagickSetImageColorspace(MagickWand *wand,
9084 % const ColorspaceType colorspace)
9086 % A description of each parameter follows:
9088 % o wand: the magick wand.
9090 % o colorspace: the image colorspace: UndefinedColorspace, RGBColorspace,
9091 % GRAYColorspace, TransparentColorspace, OHTAColorspace, XYZColorspace,
9092 % YCbCrColorspace, YCCColorspace, YIQColorspace, YPbPrColorspace,
9093 % YPbPrColorspace, YUVColorspace, CMYKColorspace, sRGBColorspace,
9094 % HSLColorspace, or HWBColorspace.
9097 WandExport MagickBooleanType MagickSetImageColorspace(MagickWand *wand,
9098 const ColorspaceType colorspace)
9100 assert(wand != (MagickWand *) NULL);
9101 assert(wand->signature == WandSignature);
9102 if (IfMagickTrue(wand->debug))
9103 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9104 if (wand->images == (Image *) NULL)
9105 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9106 return(SetImageColorspace(wand->images,colorspace,wand->exception));
9110 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9114 % M a g i c k S e t I m a g e C o m p o s e %
9118 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9120 % MagickSetImageCompose() sets the image composite operator, useful for
9121 % specifying how to composite the image thumbnail when using the
9122 % MagickMontageImage() method.
9124 % The format of the MagickSetImageCompose method is:
9126 % MagickBooleanType MagickSetImageCompose(MagickWand *wand,
9127 % const CompositeOperator compose)
9129 % A description of each parameter follows:
9131 % o wand: the magick wand.
9133 % o compose: the image composite operator.
9136 WandExport MagickBooleanType MagickSetImageCompose(MagickWand *wand,
9137 const CompositeOperator compose)
9139 assert(wand != (MagickWand *) NULL);
9140 assert(wand->signature == WandSignature);
9141 if (IfMagickTrue(wand->debug))
9142 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9143 if (wand->images == (Image *) NULL)
9144 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9145 wand->images->compose=compose;
9150 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9154 % 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 %
9158 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9160 % MagickSetImageCompression() sets the image compression.
9162 % The format of the MagickSetImageCompression method is:
9164 % MagickBooleanType MagickSetImageCompression(MagickWand *wand,
9165 % const CompressionType compression)
9167 % A description of each parameter follows:
9169 % o wand: the magick wand.
9171 % o compression: the image compression type.
9174 WandExport MagickBooleanType MagickSetImageCompression(MagickWand *wand,
9175 const CompressionType compression)
9177 assert(wand != (MagickWand *) NULL);
9178 assert(wand->signature == WandSignature);
9179 if (IfMagickTrue(wand->debug))
9180 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9181 if (wand->images == (Image *) NULL)
9182 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9183 wand->images->compression=compression;
9188 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9192 % 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 %
9196 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9198 % MagickSetImageCompressionQuality() sets the image compression quality.
9200 % The format of the MagickSetImageCompressionQuality method is:
9202 % MagickBooleanType MagickSetImageCompressionQuality(MagickWand *wand,
9203 % const size_t quality)
9205 % A description of each parameter follows:
9207 % o wand: the magick wand.
9209 % o quality: the image compression tlityype.
9212 WandExport MagickBooleanType MagickSetImageCompressionQuality(MagickWand *wand,
9213 const size_t quality)
9215 assert(wand != (MagickWand *) NULL);
9216 assert(wand->signature == WandSignature);
9217 if (IfMagickTrue(wand->debug))
9218 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9219 if (wand->images == (Image *) NULL)
9220 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9221 wand->images->quality=quality;
9226 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9230 % M a g i c k S e t I m a g e D e l a y %
9234 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9236 % MagickSetImageDelay() sets the image delay.
9238 % The format of the MagickSetImageDelay method is:
9240 % MagickBooleanType MagickSetImageDelay(MagickWand *wand,
9241 % const size_t delay)
9243 % A description of each parameter follows:
9245 % o wand: the magick wand.
9247 % o delay: the image delay in ticks-per-second units.
9250 WandExport MagickBooleanType MagickSetImageDelay(MagickWand *wand,
9253 assert(wand != (MagickWand *) NULL);
9254 assert(wand->signature == WandSignature);
9255 if (IfMagickTrue(wand->debug))
9256 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9257 if (wand->images == (Image *) NULL)
9258 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9259 wand->images->delay=delay;
9264 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9268 % M a g i c k S e t I m a g e D e p t h %
9272 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9274 % MagickSetImageDepth() sets the image depth.
9276 % The format of the MagickSetImageDepth method is:
9278 % MagickBooleanType MagickSetImageDepth(MagickWand *wand,
9279 % const size_t depth)
9281 % A description of each parameter follows:
9283 % o wand: the magick wand.
9285 % o depth: the image depth in bits: 8, 16, or 32.
9288 WandExport MagickBooleanType MagickSetImageDepth(MagickWand *wand,
9291 assert(wand != (MagickWand *) NULL);
9292 assert(wand->signature == WandSignature);
9293 if (IfMagickTrue(wand->debug))
9294 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9295 if (wand->images == (Image *) NULL)
9296 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9297 return(SetImageDepth(wand->images,depth,wand->exception));
9301 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9305 % M a g i c k S e t I m a g e D i s p o s e %
9309 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9311 % MagickSetImageDispose() sets the image disposal method.
9313 % The format of the MagickSetImageDispose method is:
9315 % MagickBooleanType MagickSetImageDispose(MagickWand *wand,
9316 % const DisposeType dispose)
9318 % A description of each parameter follows:
9320 % o wand: the magick wand.
9322 % o dispose: the image disposeal type.
9325 WandExport MagickBooleanType MagickSetImageDispose(MagickWand *wand,
9326 const DisposeType dispose)
9328 assert(wand != (MagickWand *) NULL);
9329 assert(wand->signature == WandSignature);
9330 if (IfMagickTrue(wand->debug))
9331 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9332 if (wand->images == (Image *) NULL)
9333 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9334 wand->images->dispose=dispose;
9339 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9343 % M a g i c k S e t I m a g e E n d i a n %
9347 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9349 % MagickSetImageEndian() sets the image endian method.
9351 % The format of the MagickSetImageEndian method is:
9353 % MagickBooleanType MagickSetImageEndian(MagickWand *wand,
9354 % const EndianType endian)
9356 % A description of each parameter follows:
9358 % o wand: the magick wand.
9360 % o endian: the image endian type.
9363 WandExport MagickBooleanType MagickSetImageEndian(MagickWand *wand,
9364 const EndianType endian)
9366 assert(wand != (MagickWand *) NULL);
9367 assert(wand->signature == WandSignature);
9368 if (wand->debug != MagickFalse)
9369 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9370 if (wand->images == (Image *) NULL)
9371 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9372 wand->images->endian=endian;
9377 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9381 % M a g i c k S e t I m a g e E x t e n t %
9385 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9387 % MagickSetImageExtent() sets the image size (i.e. columns & rows).
9389 % The format of the MagickSetImageExtent method is:
9391 % MagickBooleanType MagickSetImageExtent(MagickWand *wand,
9392 % const size_t columns,const unsigned rows)
9394 % A description of each parameter follows:
9396 % o wand: the magick wand.
9398 % o columns: The image width in pixels.
9400 % o rows: The image height in pixels.
9403 WandExport MagickBooleanType MagickSetImageExtent(MagickWand *wand,
9404 const size_t columns,const size_t rows)
9406 assert(wand != (MagickWand *) NULL);
9407 assert(wand->signature == WandSignature);
9408 if (IfMagickTrue(wand->debug))
9409 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9410 if (wand->images == (Image *) NULL)
9411 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9412 return(SetImageExtent(wand->images,columns,rows,wand->exception));
9416 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9420 % M a g i c k S e t I m a g e F i l e n a m e %
9424 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9426 % MagickSetImageFilename() sets the filename of a particular image in a
9429 % The format of the MagickSetImageFilename method is:
9431 % MagickBooleanType MagickSetImageFilename(MagickWand *wand,
9432 % const char *filename)
9434 % A description of each parameter follows:
9436 % o wand: the magick wand.
9438 % o filename: the image filename.
9441 WandExport MagickBooleanType MagickSetImageFilename(MagickWand *wand,
9442 const char *filename)
9444 assert(wand != (MagickWand *) NULL);
9445 assert(wand->signature == WandSignature);
9446 if (IfMagickTrue(wand->debug))
9447 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9448 if (wand->images == (Image *) NULL)
9449 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9450 if (filename != (const char *) NULL)
9451 (void) CopyMagickString(wand->images->filename,filename,MaxTextExtent);
9456 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9460 % M a g i c k S e t I m a g e F o r m a t %
9464 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9466 % MagickSetImageFormat() sets the format of a particular image in a
9469 % The format of the MagickSetImageFormat method is:
9471 % MagickBooleanType MagickSetImageFormat(MagickWand *wand,
9472 % const char *format)
9474 % A description of each parameter follows:
9476 % o wand: the magick wand.
9478 % o format: the image format.
9481 WandExport MagickBooleanType MagickSetImageFormat(MagickWand *wand,
9487 assert(wand != (MagickWand *) NULL);
9488 assert(wand->signature == WandSignature);
9489 if (IfMagickTrue(wand->debug))
9490 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9491 if (wand->images == (Image *) NULL)
9492 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9493 if ((format == (char *) NULL) || (*format == '\0'))
9495 *wand->images->magick='\0';
9498 magick_info=GetMagickInfo(format,wand->exception);
9499 if (magick_info == (const MagickInfo *) NULL)
9500 return(MagickFalse);
9501 ClearMagickException(wand->exception);
9502 (void) CopyMagickString(wand->images->magick,format,MaxTextExtent);
9507 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9511 % M a g i c k S e t I m a g e F u z z %
9515 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9517 % MagickSetImageFuzz() sets the image fuzz.
9519 % The format of the MagickSetImageFuzz method is:
9521 % MagickBooleanType MagickSetImageFuzz(MagickWand *wand,
9522 % const double fuzz)
9524 % A description of each parameter follows:
9526 % o wand: the magick wand.
9528 % o fuzz: the image fuzz.
9531 WandExport MagickBooleanType MagickSetImageFuzz(MagickWand *wand,
9534 assert(wand != (MagickWand *) NULL);
9535 assert(wand->signature == WandSignature);
9536 if (IfMagickTrue(wand->debug))
9537 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9538 if (wand->images == (Image *) NULL)
9539 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9540 wand->images->fuzz=fuzz;
9545 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9549 % M a g i c k S e t I m a g e G a m m a %
9553 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9555 % MagickSetImageGamma() sets the image gamma.
9557 % The format of the MagickSetImageGamma method is:
9559 % MagickBooleanType MagickSetImageGamma(MagickWand *wand,
9560 % const double gamma)
9562 % A description of each parameter follows:
9564 % o wand: the magick wand.
9566 % o gamma: the image gamma.
9569 WandExport MagickBooleanType MagickSetImageGamma(MagickWand *wand,
9572 assert(wand != (MagickWand *) NULL);
9573 assert(wand->signature == WandSignature);
9574 if (IfMagickTrue(wand->debug))
9575 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9576 if (wand->images == (Image *) NULL)
9577 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9578 wand->images->gamma=gamma;
9583 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9587 % M a g i c k S e t I m a g e G r a v i t y %
9591 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9593 % MagickSetImageGravity() sets the image gravity type.
9595 % The format of the MagickSetImageGravity method is:
9597 % MagickBooleanType MagickSetImageGravity(MagickWand *wand,
9598 % const GravityType gravity)
9600 % A description of each parameter follows:
9602 % o wand: the magick wand.
9604 % o gravity: the image interlace scheme: NoInterlace, LineInterlace,
9605 % PlaneInterlace, PartitionInterlace.
9608 WandExport MagickBooleanType MagickSetImageGravity(MagickWand *wand,
9609 const GravityType gravity)
9611 assert(wand != (MagickWand *) NULL);
9612 assert(wand->signature == WandSignature);
9613 if (IfMagickTrue(wand->debug))
9614 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9615 if (wand->images == (Image *) NULL)
9616 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9617 wand->images->gravity=gravity;
9622 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9626 % 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 %
9630 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9632 % MagickSetImageGreenPrimary() sets the image chromaticity green primary
9635 % The format of the MagickSetImageGreenPrimary method is:
9637 % MagickBooleanType MagickSetImageGreenPrimary(MagickWand *wand,
9638 % const double x,const double y)
9640 % A description of each parameter follows:
9642 % o wand: the magick wand.
9644 % o x: the green primary x-point.
9646 % o y: the green primary y-point.
9650 WandExport MagickBooleanType MagickSetImageGreenPrimary(MagickWand *wand,
9651 const double x,const double y)
9653 assert(wand != (MagickWand *) NULL);
9654 assert(wand->signature == WandSignature);
9655 if (IfMagickTrue(wand->debug))
9656 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9657 if (wand->images == (Image *) NULL)
9658 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9659 wand->images->chromaticity.green_primary.x=x;
9660 wand->images->chromaticity.green_primary.y=y;
9665 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9669 % 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 %
9673 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9675 % MagickSetImageInterlaceScheme() sets the image interlace scheme.
9677 % The format of the MagickSetImageInterlaceScheme method is:
9679 % MagickBooleanType MagickSetImageInterlaceScheme(MagickWand *wand,
9680 % const InterlaceType interlace)
9682 % A description of each parameter follows:
9684 % o wand: the magick wand.
9686 % o interlace: the image interlace scheme: NoInterlace, LineInterlace,
9687 % PlaneInterlace, PartitionInterlace.
9690 WandExport MagickBooleanType MagickSetImageInterlaceScheme(MagickWand *wand,
9691 const InterlaceType interlace)
9693 assert(wand != (MagickWand *) NULL);
9694 assert(wand->signature == WandSignature);
9695 if (IfMagickTrue(wand->debug))
9696 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9697 if (wand->images == (Image *) NULL)
9698 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9699 wand->images->interlace=interlace;
9704 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9708 % 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 %
9712 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9714 % MagickSetImagePixelInterpolateMethod() sets the image interpolate pixel
9717 % The format of the MagickSetImagePixelInterpolateMethod method is:
9719 % MagickBooleanType MagickSetImagePixelInterpolateMethod(MagickWand *wand,
9720 % const PixelInterpolateMethod method)
9722 % A description of each parameter follows:
9724 % o wand: the magick wand.
9726 % o method: the image interpole pixel methods: choose from Undefined,
9727 % Average, Bicubic, Bilinear, Filter, Integer, Mesh, NearestNeighbor.
9730 WandExport MagickBooleanType MagickSetImagePixelInterpolateMethod(
9731 MagickWand *wand,const PixelInterpolateMethod method)
9733 assert(wand != (MagickWand *) NULL);
9734 assert(wand->signature == WandSignature);
9735 if (IfMagickTrue(wand->debug))
9736 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9737 if (wand->images == (Image *) NULL)
9738 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9739 wand->images->interpolate=method;
9744 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9748 % M a g i c k S e t I m a g e I t e r a t i o n s %
9752 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9754 % MagickSetImageIterations() sets the image iterations.
9756 % The format of the MagickSetImageIterations method is:
9758 % MagickBooleanType MagickSetImageIterations(MagickWand *wand,
9759 % const size_t iterations)
9761 % A description of each parameter follows:
9763 % o wand: the magick wand.
9765 % o delay: the image delay in 1/100th of a second.
9768 WandExport MagickBooleanType MagickSetImageIterations(MagickWand *wand,
9769 const size_t iterations)
9771 assert(wand != (MagickWand *) NULL);
9772 assert(wand->signature == WandSignature);
9773 if (IfMagickTrue(wand->debug))
9774 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9775 if (wand->images == (Image *) NULL)
9776 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9777 wand->images->iterations=iterations;
9782 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9786 % M a g i c k S e t I m a g e M a t t e %
9790 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9792 % MagickSetImageMatte() sets the image matte channel.
9794 % The format of the MagickSetImageMatteColor method is:
9796 % MagickBooleanType MagickSetImageMatteColor(MagickWand *wand,
9797 % const MagickBooleanType *matte)
9799 % A description of each parameter follows:
9801 % o wand: the magick wand.
9803 % o matte: Set to MagickTrue to enable the image matte channel otherwise
9807 WandExport MagickBooleanType MagickSetImageMatte(MagickWand *wand,
9808 const MagickBooleanType matte)
9810 assert(wand != (MagickWand *) NULL);
9811 assert(wand->signature == WandSignature);
9812 if (IfMagickTrue(wand->debug))
9813 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9814 if (wand->images == (Image *) NULL)
9815 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9816 if ((wand->images->alpha_trait != BlendPixelTrait) && IsMagickTrue(matte))
9817 (void) SetImageAlpha(wand->images,OpaqueAlpha,wand->exception);
9818 wand->images->alpha_trait=matte != MagickFalse ? BlendPixelTrait :
9819 UndefinedPixelTrait;
9824 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9828 % M a g i c k S e t I m a g e M a t t e C o l o r %
9832 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9834 % MagickSetImageMatteColor() sets the image matte color.
9836 % The format of the MagickSetImageMatteColor method is:
9838 % MagickBooleanType MagickSetImageMatteColor(MagickWand *wand,
9839 % const PixelWand *matte)
9841 % A description of each parameter follows:
9843 % o wand: the magick wand.
9845 % o matte: the matte pixel wand.
9848 WandExport MagickBooleanType MagickSetImageMatteColor(MagickWand *wand,
9849 const PixelWand *matte)
9851 assert(wand != (MagickWand *) NULL);
9852 assert(wand->signature == WandSignature);
9853 if (IfMagickTrue(wand->debug))
9854 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9855 if (wand->images == (Image *) NULL)
9856 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9857 PixelGetQuantumPacket(matte,&wand->images->matte_color);
9862 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9866 % M a g i c k S e t I m a g e O p a c i t y %
9870 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9872 % MagickSetImageAlpha() sets the image to the specified alpha level.
9874 % The format of the MagickSetImageAlpha method is:
9876 % MagickBooleanType MagickSetImageAlpha(MagickWand *wand,
9877 % const double alpha)
9879 % A description of each parameter follows:
9881 % o wand: the magick wand.
9883 % o alpha: the level of transparency: 1.0 is fully opaque and 0.0 is fully
9887 WandExport MagickBooleanType MagickSetImageAlpha(MagickWand *wand,
9893 assert(wand != (MagickWand *) NULL);
9894 assert(wand->signature == WandSignature);
9895 if (IfMagickTrue(wand->debug))
9896 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9897 if (wand->images == (Image *) NULL)
9898 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9899 status=SetImageAlpha(wand->images,ClampToQuantum(QuantumRange*alpha),
9905 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9909 % 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 %
9913 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9915 % MagickSetImageOrientation() sets the image orientation.
9917 % The format of the MagickSetImageOrientation method is:
9919 % MagickBooleanType MagickSetImageOrientation(MagickWand *wand,
9920 % const OrientationType orientation)
9922 % A description of each parameter follows:
9924 % o wand: the magick wand.
9926 % o orientation: the image orientation type.
9929 WandExport MagickBooleanType MagickSetImageOrientation(MagickWand *wand,
9930 const OrientationType orientation)
9932 assert(wand != (MagickWand *) NULL);
9933 assert(wand->signature == WandSignature);
9934 if (IfMagickTrue(wand->debug))
9935 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9936 if (wand->images == (Image *) NULL)
9937 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9938 wand->images->orientation=orientation;
9943 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9947 % M a g i c k S e t I m a g e P a g e %
9951 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9953 % MagickSetImagePage() sets the page geometry of the image.
9955 % The format of the MagickSetImagePage method is:
9957 % MagickBooleanType MagickSetImagePage(MagickWand *wand,const size_t width,% const size_t height,const ssize_t x,const ssize_t y)
9959 % A description of each parameter follows:
9961 % o wand: the magick wand.
9963 % o width: the page width.
9965 % o height: the page height.
9967 % o x: the page x-offset.
9969 % o y: the page y-offset.
9972 WandExport MagickBooleanType MagickSetImagePage(MagickWand *wand,
9973 const size_t width,const size_t height,const ssize_t x,
9976 assert(wand != (MagickWand *) NULL);
9977 assert(wand->signature == WandSignature);
9978 if (IfMagickTrue(wand->debug))
9979 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9980 if (wand->images == (Image *) NULL)
9981 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9982 wand->images->page.width=width;
9983 wand->images->page.height=height;
9984 wand->images->page.x=x;
9985 wand->images->page.y=y;
9990 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9994 % 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 %
9998 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10000 % MagickSetImageProgressMonitor() sets the wand image progress monitor to the
10001 % specified method and returns the previous progress monitor if any. The
10002 % progress monitor method looks like this:
10004 % MagickBooleanType MagickProgressMonitor(const char *text,
10005 % const MagickOffsetType offset,const MagickSizeType span,
10006 % void *client_data)
10008 % If the progress monitor returns MagickFalse, the current operation is
10011 % The format of the MagickSetImageProgressMonitor method is:
10013 % MagickProgressMonitor MagickSetImageProgressMonitor(MagickWand *wand
10014 % const MagickProgressMonitor progress_monitor,void *client_data)
10016 % A description of each parameter follows:
10018 % o wand: the magick wand.
10020 % o progress_monitor: Specifies a pointer to a method to monitor progress
10021 % of an image operation.
10023 % o client_data: Specifies a pointer to any client data.
10026 WandExport MagickProgressMonitor MagickSetImageProgressMonitor(MagickWand *wand,
10027 const MagickProgressMonitor progress_monitor,void *client_data)
10029 MagickProgressMonitor
10032 assert(wand != (MagickWand *) NULL);
10033 assert(wand->signature == WandSignature);
10034 if (IfMagickTrue(wand->debug))
10035 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10036 if (wand->images == (Image *) NULL)
10038 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
10039 "ContainsNoImages","`%s'",wand->name);
10040 return((MagickProgressMonitor) NULL);
10042 previous_monitor=SetImageProgressMonitor(wand->images,
10043 progress_monitor,client_data);
10044 return(previous_monitor);
10048 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10052 % M a g i c k S e t I m a g e R e d P r i m a r y %
10056 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10058 % MagickSetImageRedPrimary() sets the image chromaticity red primary point.
10060 % The format of the MagickSetImageRedPrimary method is:
10062 % MagickBooleanType MagickSetImageRedPrimary(MagickWand *wand,
10063 % const double x,const double y)
10065 % A description of each parameter follows:
10067 % o wand: the magick wand.
10069 % o x: the red primary x-point.
10071 % o y: the red primary y-point.
10074 WandExport MagickBooleanType MagickSetImageRedPrimary(MagickWand *wand,
10075 const double x,const double y)
10077 assert(wand != (MagickWand *) NULL);
10078 assert(wand->signature == WandSignature);
10079 if (IfMagickTrue(wand->debug))
10080 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10081 if (wand->images == (Image *) NULL)
10082 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10083 wand->images->chromaticity.red_primary.x=x;
10084 wand->images->chromaticity.red_primary.y=y;
10085 return(MagickTrue);
10089 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10093 % 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 %
10097 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10099 % MagickSetImageRenderingIntent() sets the image rendering intent.
10101 % The format of the MagickSetImageRenderingIntent method is:
10103 % MagickBooleanType MagickSetImageRenderingIntent(MagickWand *wand,
10104 % const RenderingIntent rendering_intent)
10106 % A description of each parameter follows:
10108 % o wand: the magick wand.
10110 % o rendering_intent: the image rendering intent: UndefinedIntent,
10111 % SaturationIntent, PerceptualIntent, AbsoluteIntent, or RelativeIntent.
10114 WandExport MagickBooleanType MagickSetImageRenderingIntent(MagickWand *wand,
10115 const RenderingIntent rendering_intent)
10117 assert(wand != (MagickWand *) NULL);
10118 assert(wand->signature == WandSignature);
10119 if (IfMagickTrue(wand->debug))
10120 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10121 if (wand->images == (Image *) NULL)
10122 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10123 wand->images->rendering_intent=rendering_intent;
10124 return(MagickTrue);
10128 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10132 % M a g i c k S e t I m a g e R e s o l u t i o n %
10136 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10138 % MagickSetImageResolution() sets the image resolution.
10140 % The format of the MagickSetImageResolution method is:
10142 % MagickBooleanType MagickSetImageResolution(MagickWand *wand,
10143 % const double x_resolution,const double y_resolution)
10145 % A description of each parameter follows:
10147 % o wand: the magick wand.
10149 % o x_resolution: the image x resolution.
10151 % o y_resolution: the image y resolution.
10154 WandExport MagickBooleanType MagickSetImageResolution(MagickWand *wand,
10155 const double x_resolution,const double y_resolution)
10157 assert(wand != (MagickWand *) NULL);
10158 assert(wand->signature == WandSignature);
10159 if (IfMagickTrue(wand->debug))
10160 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10161 if (wand->images == (Image *) NULL)
10162 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10163 wand->images->resolution.x=x_resolution;
10164 wand->images->resolution.y=y_resolution;
10165 return(MagickTrue);
10169 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10173 % M a g i c k S e t I m a g e S c e n e %
10177 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10179 % MagickSetImageScene() sets the image scene.
10181 % The format of the MagickSetImageScene method is:
10183 % MagickBooleanType MagickSetImageScene(MagickWand *wand,
10184 % const size_t scene)
10186 % A description of each parameter follows:
10188 % o wand: the magick wand.
10190 % o delay: the image scene number.
10193 WandExport MagickBooleanType MagickSetImageScene(MagickWand *wand,
10194 const size_t scene)
10196 assert(wand != (MagickWand *) NULL);
10197 assert(wand->signature == WandSignature);
10198 if (IfMagickTrue(wand->debug))
10199 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10200 if (wand->images == (Image *) NULL)
10201 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10202 wand->images->scene=scene;
10203 return(MagickTrue);
10207 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10211 % 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 %
10215 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10217 % MagickSetImageTicksPerSecond() sets the image ticks-per-second.
10219 % The format of the MagickSetImageTicksPerSecond method is:
10221 % MagickBooleanType MagickSetImageTicksPerSecond(MagickWand *wand,
10222 % const ssize_t ticks_per-second)
10224 % A description of each parameter follows:
10226 % o wand: the magick wand.
10228 % o ticks_per_second: the units to use for the image delay.
10231 WandExport MagickBooleanType MagickSetImageTicksPerSecond(MagickWand *wand,
10232 const ssize_t ticks_per_second)
10234 assert(wand != (MagickWand *) NULL);
10235 assert(wand->signature == WandSignature);
10236 if (IfMagickTrue(wand->debug))
10237 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10238 if (wand->images == (Image *) NULL)
10239 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10240 wand->images->ticks_per_second=ticks_per_second;
10241 return(MagickTrue);
10245 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10249 % M a g i c k S e t I m a g e T y p e %
10253 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10255 % MagickSetImageType() sets the image type.
10257 % The format of the MagickSetImageType method is:
10259 % MagickBooleanType MagickSetImageType(MagickWand *wand,
10260 % const ImageType image_type)
10262 % A description of each parameter follows:
10264 % o wand: the magick wand.
10266 % o image_type: the image type: UndefinedType, BilevelType, GrayscaleType,
10267 % GrayscaleMatteType, PaletteType, PaletteMatteType, TrueColorType,
10268 % TrueColorMatteType, ColorSeparationType, ColorSeparationMatteType,
10272 WandExport MagickBooleanType MagickSetImageType(MagickWand *wand,
10273 const ImageType image_type)
10275 assert(wand != (MagickWand *) NULL);
10276 assert(wand->signature == WandSignature);
10277 if (IfMagickTrue(wand->debug))
10278 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10279 if (wand->images == (Image *) NULL)
10280 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10281 return(SetImageType(wand->images,image_type,wand->exception));
10285 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10289 % M a g i c k S e t I m a g e U n i t s %
10293 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10295 % MagickSetImageUnits() sets the image units of resolution.
10297 % The format of the MagickSetImageUnits method is:
10299 % MagickBooleanType MagickSetImageUnits(MagickWand *wand,
10300 % const ResolutionType units)
10302 % A description of each parameter follows:
10304 % o wand: the magick wand.
10306 % o units: the image units of resolution : UndefinedResolution,
10307 % PixelsPerInchResolution, or PixelsPerCentimeterResolution.
10310 WandExport MagickBooleanType MagickSetImageUnits(MagickWand *wand,
10311 const ResolutionType units)
10313 assert(wand != (MagickWand *) NULL);
10314 assert(wand->signature == WandSignature);
10315 if (IfMagickTrue(wand->debug))
10316 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10317 if (wand->images == (Image *) NULL)
10318 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10319 wand->images->units=units;
10320 return(MagickTrue);
10324 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10328 % 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 %
10332 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10334 % MagickSetImageVirtualPixelMethod() sets the image virtual pixel method.
10336 % The format of the MagickSetImageVirtualPixelMethod method is:
10338 % VirtualPixelMethod MagickSetImageVirtualPixelMethod(MagickWand *wand,
10339 % const VirtualPixelMethod method)
10341 % A description of each parameter follows:
10343 % o wand: the magick wand.
10345 % o method: the image virtual pixel method : UndefinedVirtualPixelMethod,
10346 % ConstantVirtualPixelMethod, EdgeVirtualPixelMethod,
10347 % MirrorVirtualPixelMethod, or TileVirtualPixelMethod.
10350 WandExport VirtualPixelMethod MagickSetImageVirtualPixelMethod(MagickWand *wand,
10351 const VirtualPixelMethod method)
10353 assert(wand != (MagickWand *) NULL);
10354 assert(wand->signature == WandSignature);
10355 if (IfMagickTrue(wand->debug))
10356 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10357 if (wand->images == (Image *) NULL)
10358 return(UndefinedVirtualPixelMethod);
10359 return(SetImageVirtualPixelMethod(wand->images,method,wand->exception));
10363 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10367 % M a g i c k S e t I m a g e W h i t e P o i n t %
10371 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10373 % MagickSetImageWhitePoint() sets the image chromaticity white point.
10375 % The format of the MagickSetImageWhitePoint method is:
10377 % MagickBooleanType MagickSetImageWhitePoint(MagickWand *wand,
10378 % const double x,const double y)
10380 % A description of each parameter follows:
10382 % o wand: the magick wand.
10384 % o x: the white x-point.
10386 % o y: the white y-point.
10389 WandExport MagickBooleanType MagickSetImageWhitePoint(MagickWand *wand,
10390 const double x,const double y)
10392 assert(wand != (MagickWand *) NULL);
10393 assert(wand->signature == WandSignature);
10394 if (IfMagickTrue(wand->debug))
10395 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10396 if (wand->images == (Image *) NULL)
10397 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10398 wand->images->chromaticity.white_point.x=x;
10399 wand->images->chromaticity.white_point.y=y;
10400 return(MagickTrue);
10404 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10408 % M a g i c k S h a d e I m a g e C h a n n e l %
10412 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10414 % MagickShadeImage() shines a distant light on an image to create a
10415 % three-dimensional effect. You control the positioning of the light with
10416 % azimuth and elevation; azimuth is measured in degrees off the x axis
10417 % and elevation is measured in pixels above the Z axis.
10419 % The format of the MagickShadeImage method is:
10421 % MagickBooleanType MagickShadeImage(MagickWand *wand,
10422 % const MagickBooleanType gray,const double azimuth,
10423 % const double elevation)
10425 % A description of each parameter follows:
10427 % o wand: the magick wand.
10429 % o gray: A value other than zero shades the intensity of each pixel.
10431 % o azimuth, elevation: Define the light source direction.
10434 WandExport MagickBooleanType MagickShadeImage(MagickWand *wand,
10435 const MagickBooleanType gray,const double asimuth,const double elevation)
10440 assert(wand != (MagickWand *) NULL);
10441 assert(wand->signature == WandSignature);
10442 if (IfMagickTrue(wand->debug))
10443 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10444 if (wand->images == (Image *) NULL)
10445 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10446 shade_image=ShadeImage(wand->images,gray,asimuth,elevation,wand->exception);
10447 if (shade_image == (Image *) NULL)
10448 return(MagickFalse);
10449 ReplaceImageInList(&wand->images,shade_image);
10450 return(MagickTrue);
10454 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10458 % M a g i c k S h a d o w I m a g e %
10462 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10464 % MagickShadowImage() simulates an image shadow.
10466 % The format of the MagickShadowImage method is:
10468 % MagickBooleanType MagickShadowImage(MagickWand *wand,const double alpha,
10469 % const double sigma,const ssize_t x,const ssize_t y)
10471 % A description of each parameter follows:
10473 % o wand: the magick wand.
10475 % o alpha: percentage transparency.
10477 % o sigma: the standard deviation of the Gaussian, in pixels.
10479 % o x: the shadow x-offset.
10481 % o y: the shadow y-offset.
10484 WandExport MagickBooleanType MagickShadowImage(MagickWand *wand,
10485 const double alpha,const double sigma,const ssize_t x,const ssize_t y)
10490 assert(wand != (MagickWand *) NULL);
10491 assert(wand->signature == WandSignature);
10492 if (IfMagickTrue(wand->debug))
10493 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10494 if (wand->images == (Image *) NULL)
10495 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10496 shadow_image=ShadowImage(wand->images,alpha,sigma,x,y,wand->exception);
10497 if (shadow_image == (Image *) NULL)
10498 return(MagickFalse);
10499 ReplaceImageInList(&wand->images,shadow_image);
10500 return(MagickTrue);
10504 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10508 % M a g i c k S h a r p e n I m a g e %
10512 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10514 % MagickSharpenImage() sharpens an image. We convolve the image with a
10515 % Gaussian operator of the given radius and standard deviation (sigma).
10516 % For reasonable results, the radius should be larger than sigma. Use a
10517 % radius of 0 and MagickSharpenImage() selects a suitable radius for you.
10519 % The format of the MagickSharpenImage method is:
10521 % MagickBooleanType MagickSharpenImage(MagickWand *wand,
10522 % const double radius,const double sigma)
10524 % A description of each parameter follows:
10526 % o wand: the magick wand.
10528 % o radius: the radius of the Gaussian, in pixels, not counting the center
10531 % o sigma: the standard deviation of the Gaussian, in pixels.
10534 WandExport MagickBooleanType MagickSharpenImage(MagickWand *wand,
10535 const double radius,const double sigma)
10540 assert(wand != (MagickWand *) NULL);
10541 assert(wand->signature == WandSignature);
10542 if (IfMagickTrue(wand->debug))
10543 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10544 if (wand->images == (Image *) NULL)
10545 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10546 sharp_image=SharpenImage(wand->images,radius,sigma,wand->exception);
10547 if (sharp_image == (Image *) NULL)
10548 return(MagickFalse);
10549 ReplaceImageInList(&wand->images,sharp_image);
10550 return(MagickTrue);
10554 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10558 % M a g i c k S h a v e I m a g e %
10562 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10564 % MagickShaveImage() shaves pixels from the image edges. It allocates the
10565 % memory necessary for the new Image structure and returns a pointer to the
10568 % The format of the MagickShaveImage method is:
10570 % MagickBooleanType MagickShaveImage(MagickWand *wand,
10571 % const size_t columns,const size_t rows)
10573 % A description of each parameter follows:
10575 % o wand: the magick wand.
10577 % o columns: the number of columns in the scaled image.
10579 % o rows: the number of rows in the scaled image.
10583 WandExport MagickBooleanType MagickShaveImage(MagickWand *wand,
10584 const size_t columns,const size_t rows)
10592 assert(wand != (MagickWand *) NULL);
10593 assert(wand->signature == WandSignature);
10594 if (IfMagickTrue(wand->debug))
10595 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10596 if (wand->images == (Image *) NULL)
10597 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10598 shave_info.width=columns;
10599 shave_info.height=rows;
10602 shave_image=ShaveImage(wand->images,&shave_info,wand->exception);
10603 if (shave_image == (Image *) NULL)
10604 return(MagickFalse);
10605 ReplaceImageInList(&wand->images,shave_image);
10606 return(MagickTrue);
10610 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10614 % M a g i c k S h e a r I m a g e %
10618 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10620 % MagickShearImage() slides one edge of an image along the X or Y axis,
10621 % creating a parallelogram. An X direction shear slides an edge along the X
10622 % axis, while a Y direction shear slides an edge along the Y axis. The amount
10623 % of the shear is controlled by a shear angle. For X direction shears, x_shear
10624 % is measured relative to the Y axis, and similarly, for Y direction shears
10625 % y_shear is measured relative to the X axis. Empty triangles left over from
10626 % shearing the image are filled with the background color.
10628 % The format of the MagickShearImage method is:
10630 % MagickBooleanType MagickShearImage(MagickWand *wand,
10631 % const PixelWand *background,const double x_shear,const double y_shear)
10633 % A description of each parameter follows:
10635 % o wand: the magick wand.
10637 % o background: the background pixel wand.
10639 % o x_shear: the number of degrees to shear the image.
10641 % o y_shear: the number of degrees to shear the image.
10644 WandExport MagickBooleanType MagickShearImage(MagickWand *wand,
10645 const PixelWand *background,const double x_shear,const double y_shear)
10650 assert(wand != (MagickWand *) NULL);
10651 assert(wand->signature == WandSignature);
10652 if (IfMagickTrue(wand->debug))
10653 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10654 if (wand->images == (Image *) NULL)
10655 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10656 PixelGetQuantumPacket(background,&wand->images->background_color);
10657 shear_image=ShearImage(wand->images,x_shear,y_shear,wand->exception);
10658 if (shear_image == (Image *) NULL)
10659 return(MagickFalse);
10660 ReplaceImageInList(&wand->images,shear_image);
10661 return(MagickTrue);
10665 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10669 % 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 %
10673 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10675 % MagickSigmoidalContrastImage() adjusts the contrast of an image with a
10676 % non-linear sigmoidal contrast algorithm. Increase the contrast of the
10677 % image using a sigmoidal transfer function without saturating highlights or
10678 % shadows. Contrast indicates how much to increase the contrast (0 is none;
10679 % 3 is typical; 20 is pushing it); mid-point indicates where midtones fall in
10680 % the resultant image (0 is white; 50% is middle-gray; 100% is black). Set
10681 % sharpen to MagickTrue to increase the image contrast otherwise the contrast
10684 % The format of the MagickSigmoidalContrastImage method is:
10686 % MagickBooleanType MagickSigmoidalContrastImage(MagickWand *wand,
10687 % const MagickBooleanType sharpen,const double alpha,const double beta)
10689 % A description of each parameter follows:
10691 % o wand: the magick wand.
10693 % o sharpen: Increase or decrease image contrast.
10695 % o alpha: strength of the contrast, the larger the number the more
10696 % 'threshold-like' it becomes.
10698 % o beta: midpoint of the function as a color value 0 to QuantumRange.
10701 WandExport MagickBooleanType MagickSigmoidalContrastImage(
10702 MagickWand *wand,const MagickBooleanType sharpen,const double alpha,
10708 assert(wand != (MagickWand *) NULL);
10709 assert(wand->signature == WandSignature);
10710 if (IfMagickTrue(wand->debug))
10711 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10712 if (wand->images == (Image *) NULL)
10713 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10714 status=SigmoidalContrastImage(wand->images,sharpen,alpha,beta,
10720 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10724 % M a g i c k S i m i l a r i t y I m a g e %
10728 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10730 % MagickSimilarityImage() compares the reference image of the image and
10731 % returns the best match offset. In addition, it returns a similarity image
10732 % such that an exact match location is completely white and if none of the
10733 % pixels match, black, otherwise some gray level in-between.
10735 % The format of the MagickSimilarityImage method is:
10737 % MagickWand *MagickSimilarityImage(MagickWand *wand,
10738 % const MagickWand *reference,const MetricType metric,
10739 % const double similarity_threshold,RectangeInfo *offset,
10740 % double *similarity)
10742 % A description of each parameter follows:
10744 % o wand: the magick wand.
10746 % o reference: the reference wand.
10748 % o metric: the metric.
10750 % o similarity_threshold: minimum distortion for (sub)image match.
10752 % o offset: the best match offset of the reference image within the image.
10754 % o similarity: the computed similarity between the images.
10757 WandExport MagickWand *MagickSimilarityImage(MagickWand *wand,
10758 const MagickWand *reference,const MetricType metric,
10759 const double similarity_threshold,RectangleInfo *offset,double *similarity)
10764 assert(wand != (MagickWand *) NULL);
10765 assert(wand->signature == WandSignature);
10766 if (IfMagickTrue(wand->debug))
10767 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10768 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
10770 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
10771 "ContainsNoImages","`%s'",wand->name);
10772 return((MagickWand *) NULL);
10774 similarity_image=SimilarityImage(wand->images,reference->images,metric,
10775 similarity_threshold,offset,similarity,wand->exception);
10776 if (similarity_image == (Image *) NULL)
10777 return((MagickWand *) NULL);
10778 return(CloneMagickWandFromImages(wand,similarity_image));
10782 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10786 % M a g i c k S k e t c h I m a g e %
10790 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10792 % MagickSketchImage() simulates a pencil sketch. We convolve the image with
10793 % a Gaussian operator of the given radius and standard deviation (sigma).
10794 % For reasonable results, radius should be larger than sigma. Use a
10795 % radius of 0 and SketchImage() selects a suitable radius for you.
10796 % Angle gives the angle of the blurring motion.
10798 % The format of the MagickSketchImage method is:
10800 % MagickBooleanType MagickSketchImage(MagickWand *wand,
10801 % const double radius,const double sigma,const double angle)
10803 % A description of each parameter follows:
10805 % o wand: the magick wand.
10807 % o radius: the radius of the Gaussian, in pixels, not counting
10808 % the center pixel.
10810 % o sigma: the standard deviation of the Gaussian, in pixels.
10812 % o angle: apply the effect along this angle.
10815 WandExport MagickBooleanType MagickSketchImage(MagickWand *wand,
10816 const double radius,const double sigma,const double angle)
10821 assert(wand != (MagickWand *) NULL);
10822 assert(wand->signature == WandSignature);
10823 if (IfMagickTrue(wand->debug))
10824 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10825 if (wand->images == (Image *) NULL)
10826 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10827 sketch_image=SketchImage(wand->images,radius,sigma,angle,wand->exception);
10828 if (sketch_image == (Image *) NULL)
10829 return(MagickFalse);
10830 ReplaceImageInList(&wand->images,sketch_image);
10831 return(MagickTrue);
10835 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10839 % M a g i c k S m u s h I m a g e s %
10843 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10845 % MagickSmushImages() takes all images from the current image pointer to the
10846 % end of the image list and smushs them to each other top-to-bottom if the
10847 % stack parameter is true, otherwise left-to-right.
10849 % The format of the MagickSmushImages method is:
10851 % MagickWand *MagickSmushImages(MagickWand *wand,
10852 % const MagickBooleanType stack,const ssize_t offset)
10854 % A description of each parameter follows:
10856 % o wand: the magick wand.
10858 % o stack: By default, images are stacked left-to-right. Set stack to
10859 % MagickTrue to stack them top-to-bottom.
10861 % o offset: minimum distance in pixels between images.
10864 WandExport MagickWand *MagickSmushImages(MagickWand *wand,
10865 const MagickBooleanType stack,const ssize_t offset)
10870 assert(wand != (MagickWand *) NULL);
10871 assert(wand->signature == WandSignature);
10872 if (IfMagickTrue(wand->debug))
10873 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10874 if (wand->images == (Image *) NULL)
10875 return((MagickWand *) NULL);
10876 smush_image=SmushImages(wand->images,stack,offset,wand->exception);
10877 if (smush_image == (Image *) NULL)
10878 return((MagickWand *) NULL);
10879 return(CloneMagickWandFromImages(wand,smush_image));
10883 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10887 % M a g i c k S o l a r i z e I m a g e %
10891 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10893 % MagickSolarizeImage() applies a special effect to the image, similar to the
10894 % effect achieved in a photo darkroom by selectively exposing areas of photo
10895 % sensitive paper to light. Threshold ranges from 0 to QuantumRange and is a
10896 % measure of the extent of the solarization.
10898 % The format of the MagickSolarizeImage method is:
10900 % MagickBooleanType MagickSolarizeImage(MagickWand *wand,
10901 % const double threshold)
10903 % A description of each parameter follows:
10905 % o wand: the magick wand.
10907 % o threshold: Define the extent of the solarization.
10910 WandExport MagickBooleanType MagickSolarizeImage(MagickWand *wand,
10911 const double threshold)
10916 assert(wand != (MagickWand *) NULL);
10917 assert(wand->signature == WandSignature);
10918 if (IfMagickTrue(wand->debug))
10919 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10920 if (wand->images == (Image *) NULL)
10921 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10922 status=SolarizeImage(wand->images,threshold,wand->exception);
10927 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10931 % M a g i c k S p a r s e C o l o r I m a g e %
10935 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10937 % MagickSparseColorImage(), given a set of coordinates, interpolates the
10938 % colors found at those coordinates, across the whole image, using various
10941 % The format of the MagickSparseColorImage method is:
10943 % MagickBooleanType MagickSparseColorImage(MagickWand *wand,
10944 % const SparseColorMethod method,const size_t number_arguments,
10945 % const double *arguments)
10947 % A description of each parameter follows:
10949 % o image: the image to be sparseed.
10951 % o method: the method of image sparseion.
10953 % ArcSparseColorion will always ignore source image offset, and always
10954 % 'bestfit' the destination image with the top left corner offset
10955 % relative to the polar mapping center.
10957 % Bilinear has no simple inverse mapping so will not allow 'bestfit'
10958 % style of image sparseion.
10960 % Affine, Perspective, and Bilinear, will do least squares fitting of
10961 % the distrotion when more than the minimum number of control point
10962 % pairs are provided.
10964 % Perspective, and Bilinear, will fall back to a Affine sparseion when
10965 % less than 4 control point pairs are provided. While Affine sparseions
10966 % will let you use any number of control point pairs, that is Zero pairs
10967 % is a No-Op (viewport only) distrotion, one pair is a translation and
10968 % two pairs of control points will do a scale-rotate-translate, without
10971 % o number_arguments: the number of arguments given for this sparseion
10974 % o arguments: the arguments for this sparseion method.
10977 WandExport MagickBooleanType MagickSparseColorImage(MagickWand *wand,
10978 const SparseColorMethod method,const size_t number_arguments,
10979 const double *arguments)
10984 assert(wand != (MagickWand *) NULL);
10985 assert(wand->signature == WandSignature);
10986 if (IfMagickTrue(wand->debug))
10987 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10988 if (wand->images == (Image *) NULL)
10989 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10990 sparse_image=SparseColorImage(wand->images,method,number_arguments,arguments,
10992 if (sparse_image == (Image *) NULL)
10993 return(MagickFalse);
10994 ReplaceImageInList(&wand->images,sparse_image);
10995 return(MagickTrue);
10999 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11003 % M a g i c k S p l i c e I m a g e %
11007 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11009 % MagickSpliceImage() splices a solid color into the image.
11011 % The format of the MagickSpliceImage method is:
11013 % MagickBooleanType MagickSpliceImage(MagickWand *wand,
11014 % const size_t width,const size_t height,const ssize_t x,
11017 % A description of each parameter follows:
11019 % o wand: the magick wand.
11021 % o width: the region width.
11023 % o height: the region height.
11025 % o x: the region x offset.
11027 % o y: the region y offset.
11030 WandExport MagickBooleanType MagickSpliceImage(MagickWand *wand,
11031 const size_t width,const size_t height,const ssize_t x,
11040 assert(wand != (MagickWand *) NULL);
11041 assert(wand->signature == WandSignature);
11042 if (IfMagickTrue(wand->debug))
11043 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11044 if (wand->images == (Image *) NULL)
11045 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11046 splice.width=width;
11047 splice.height=height;
11050 splice_image=SpliceImage(wand->images,&splice,wand->exception);
11051 if (splice_image == (Image *) NULL)
11052 return(MagickFalse);
11053 ReplaceImageInList(&wand->images,splice_image);
11054 return(MagickTrue);
11058 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11062 % M a g i c k S p r e a d I m a g e %
11066 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11068 % MagickSpreadImage() is a special effects method that randomly displaces each
11069 % pixel in a block defined by the radius parameter.
11071 % The format of the MagickSpreadImage method is:
11073 % MagickBooleanType MagickSpreadImage(MagickWand *wand,const double radius,
11074 % const PixelInterpolateMethod method)
11076 % A description of each parameter follows:
11078 % o wand: the magick wand.
11080 % o radius: Choose a random pixel in a neighborhood of this extent.
11082 % o method: the pixel interpolation method.
11085 WandExport MagickBooleanType MagickSpreadImage(MagickWand *wand,
11086 const double radius,const PixelInterpolateMethod method)
11091 assert(wand != (MagickWand *) NULL);
11092 assert(wand->signature == WandSignature);
11093 if (IfMagickTrue(wand->debug))
11094 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11095 if (wand->images == (Image *) NULL)
11096 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11097 spread_image=SpreadImage(wand->images,radius,method,wand->exception);
11098 if (spread_image == (Image *) NULL)
11099 return(MagickFalse);
11100 ReplaceImageInList(&wand->images,spread_image);
11101 return(MagickTrue);
11105 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11109 % M a g i c k S t a t i s t i c I m a g e %
11113 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11115 % MagickStatisticImage() replace each pixel with corresponding statistic from
11116 % the neighborhood of the specified width and height.
11118 % The format of the MagickStatisticImage method is:
11120 % MagickBooleanType MagickStatisticImage(MagickWand *wand,
11121 % const StatisticType type,const double width,const size_t height)
11123 % A description of each parameter follows:
11125 % o wand: the magick wand.
11127 % o type: the statistic type (e.g. median, mode, etc.).
11129 % o width: the width of the pixel neighborhood.
11131 % o height: the height of the pixel neighborhood.
11134 WandExport MagickBooleanType MagickStatisticImage(MagickWand *wand,
11135 const StatisticType type,const size_t width,const size_t height)
11140 assert(wand != (MagickWand *) NULL);
11141 assert(wand->signature == WandSignature);
11142 if (IfMagickTrue(wand->debug))
11143 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11144 if (wand->images == (Image *) NULL)
11145 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11146 statistic_image=StatisticImage(wand->images,type,width,height,
11148 if (statistic_image == (Image *) NULL)
11149 return(MagickFalse);
11150 ReplaceImageInList(&wand->images,statistic_image);
11151 return(MagickTrue);
11155 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11159 % M a g i c k S t e g a n o I m a g e %
11163 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11165 % MagickSteganoImage() hides a digital watermark within the image.
11166 % Recover the hidden watermark later to prove that the authenticity of
11167 % an image. Offset defines the start position within the image to hide
11170 % The format of the MagickSteganoImage method is:
11172 % MagickWand *MagickSteganoImage(MagickWand *wand,
11173 % const MagickWand *watermark_wand,const ssize_t offset)
11175 % A description of each parameter follows:
11177 % o wand: the magick wand.
11179 % o watermark_wand: the watermark wand.
11181 % o offset: Start hiding at this offset into the image.
11184 WandExport MagickWand *MagickSteganoImage(MagickWand *wand,
11185 const MagickWand *watermark_wand,const ssize_t offset)
11190 assert(wand != (MagickWand *) NULL);
11191 assert(wand->signature == WandSignature);
11192 if (IfMagickTrue(wand->debug))
11193 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11194 if ((wand->images == (Image *) NULL) ||
11195 (watermark_wand->images == (Image *) NULL))
11197 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
11198 "ContainsNoImages","`%s'",wand->name);
11199 return((MagickWand *) NULL);
11201 wand->images->offset=offset;
11202 stegano_image=SteganoImage(wand->images,watermark_wand->images,
11204 if (stegano_image == (Image *) NULL)
11205 return((MagickWand *) NULL);
11206 return(CloneMagickWandFromImages(wand,stegano_image));
11210 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11214 % M a g i c k S t e r e o I m a g e %
11218 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11220 % MagickStereoImage() composites two images and produces a single image that
11221 % is the composite of a left and right image of a stereo pair
11223 % The format of the MagickStereoImage method is:
11225 % MagickWand *MagickStereoImage(MagickWand *wand,
11226 % const MagickWand *offset_wand)
11228 % A description of each parameter follows:
11230 % o wand: the magick wand.
11232 % o offset_wand: Another image wand.
11235 WandExport MagickWand *MagickStereoImage(MagickWand *wand,
11236 const MagickWand *offset_wand)
11241 assert(wand != (MagickWand *) NULL);
11242 assert(wand->signature == WandSignature);
11243 if (IfMagickTrue(wand->debug))
11244 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11245 if ((wand->images == (Image *) NULL) ||
11246 (offset_wand->images == (Image *) NULL))
11248 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
11249 "ContainsNoImages","`%s'",wand->name);
11250 return((MagickWand *) NULL);
11252 stereo_image=StereoImage(wand->images,offset_wand->images,wand->exception);
11253 if (stereo_image == (Image *) NULL)
11254 return((MagickWand *) NULL);
11255 return(CloneMagickWandFromImages(wand,stereo_image));
11259 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11263 % M a g i c k S t r i p I m a g e %
11267 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11269 % MagickStripImage() strips an image of all profiles and comments.
11271 % The format of the MagickStripImage method is:
11273 % MagickBooleanType MagickStripImage(MagickWand *wand)
11275 % A description of each parameter follows:
11277 % o wand: the magick wand.
11280 WandExport MagickBooleanType MagickStripImage(MagickWand *wand)
11282 assert(wand != (MagickWand *) NULL);
11283 assert(wand->signature == WandSignature);
11284 if (IfMagickTrue(wand->debug))
11285 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11286 if (wand->images == (Image *) NULL)
11287 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11288 return(StripImage(wand->images,wand->exception));
11292 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11296 % M a g i c k S w i r l I m a g e %
11300 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11302 % MagickSwirlImage() swirls the pixels about the center of the image, where
11303 % degrees indicates the sweep of the arc through which each pixel is moved.
11304 % You get a more dramatic effect as the degrees move from 1 to 360.
11306 % The format of the MagickSwirlImage method is:
11308 % MagickBooleanType MagickSwirlImage(MagickWand *wand,const double degrees,
11309 % const PixelInterpolateMethod method)
11311 % A description of each parameter follows:
11313 % o wand: the magick wand.
11315 % o degrees: Define the tightness of the swirling effect.
11317 % o method: the pixel interpolation method.
11320 WandExport MagickBooleanType MagickSwirlImage(MagickWand *wand,
11321 const double degrees,const PixelInterpolateMethod method)
11326 assert(wand != (MagickWand *) NULL);
11327 assert(wand->signature == WandSignature);
11328 if (IfMagickTrue(wand->debug))
11329 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11330 if (wand->images == (Image *) NULL)
11331 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11332 swirl_image=SwirlImage(wand->images,degrees,method,wand->exception);
11333 if (swirl_image == (Image *) NULL)
11334 return(MagickFalse);
11335 ReplaceImageInList(&wand->images,swirl_image);
11336 return(MagickTrue);
11340 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11344 % M a g i c k T e x t u r e I m a g e %
11348 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11350 % MagickTextureImage() repeatedly tiles the texture image across and down the
11353 % The format of the MagickTextureImage method is:
11355 % MagickWand *MagickTextureImage(MagickWand *wand,
11356 % const MagickWand *texture_wand)
11358 % A description of each parameter follows:
11360 % o wand: the magick wand.
11362 % o texture_wand: the texture wand
11365 WandExport MagickWand *MagickTextureImage(MagickWand *wand,
11366 const MagickWand *texture_wand)
11374 assert(wand != (MagickWand *) NULL);
11375 assert(wand->signature == WandSignature);
11376 if (IfMagickTrue(wand->debug))
11377 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11378 if ((wand->images == (Image *) NULL) ||
11379 (texture_wand->images == (Image *) NULL))
11381 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
11382 "ContainsNoImages","`%s'",wand->name);
11383 return((MagickWand *) NULL);
11385 texture_image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
11386 if (texture_image == (Image *) NULL)
11387 return((MagickWand *) NULL);
11388 status=TextureImage(texture_image,texture_wand->images,wand->exception);
11389 if (IfMagickFalse(status))
11391 texture_image=DestroyImage(texture_image);
11392 return((MagickWand *) NULL);
11394 return(CloneMagickWandFromImages(wand,texture_image));
11398 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11402 % M a g i c k T h r e s h o l d I m a g e %
11406 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11408 % MagickThresholdImage() changes the value of individual pixels based on
11409 % the intensity of each pixel compared to threshold. The result is a
11410 % high-contrast, two color image.
11412 % The format of the MagickThresholdImage method is:
11414 % MagickBooleanType MagickThresholdImage(MagickWand *wand,
11415 % const double threshold)
11416 % MagickBooleanType MagickThresholdImageChannel(MagickWand *wand,
11417 % const ChannelType channel,const double threshold)
11419 % A description of each parameter follows:
11421 % o wand: the magick wand.
11423 % o channel: the image channel(s).
11425 % o threshold: Define the threshold value.
11428 WandExport MagickBooleanType MagickThresholdImage(MagickWand *wand,
11429 const double threshold)
11434 status=MagickThresholdImageChannel(wand,DefaultChannels,threshold);
11438 WandExport MagickBooleanType MagickThresholdImageChannel(MagickWand *wand,
11439 const ChannelType channel,const double threshold)
11444 assert(wand != (MagickWand *) NULL);
11445 assert(wand->signature == WandSignature);
11446 if (IfMagickTrue(wand->debug))
11447 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11448 if (wand->images == (Image *) NULL)
11449 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11450 status=BilevelImage(wand->images,threshold,wand->exception);
11455 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11459 % M a g i c k T h u m b n a i l I m a g e %
11463 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11465 % MagickThumbnailImage() changes the size of an image to the given dimensions
11466 % and removes any associated profiles. The goal is to produce small low cost
11467 % thumbnail images suited for display on the Web.
11469 % The format of the MagickThumbnailImage method is:
11471 % MagickBooleanType MagickThumbnailImage(MagickWand *wand,
11472 % const size_t columns,const size_t rows)
11474 % A description of each parameter follows:
11476 % o wand: the magick wand.
11478 % o columns: the number of columns in the scaled image.
11480 % o rows: the number of rows in the scaled image.
11483 WandExport MagickBooleanType MagickThumbnailImage(MagickWand *wand,
11484 const size_t columns,const size_t rows)
11489 assert(wand != (MagickWand *) NULL);
11490 assert(wand->signature == WandSignature);
11491 if (IfMagickTrue(wand->debug))
11492 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11493 if (wand->images == (Image *) NULL)
11494 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11495 thumbnail_image=ThumbnailImage(wand->images,columns,rows,wand->exception);
11496 if (thumbnail_image == (Image *) NULL)
11497 return(MagickFalse);
11498 ReplaceImageInList(&wand->images,thumbnail_image);
11499 return(MagickTrue);
11503 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11507 % M a g i c k T i n t I m a g e %
11511 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11513 % MagickTintImage() applies a color vector to each pixel in the image. The
11514 % length of the vector is 0 for black and white and at its maximum for the
11515 % midtones. The vector weighting function is
11516 % f(x)=(1-(4.0*((x-0.5)*(x-0.5)))).
11518 % The format of the MagickTintImage method is:
11520 % MagickBooleanType MagickTintImage(MagickWand *wand,
11521 % const PixelWand *tint,const PixelWand *blend)
11523 % A description of each parameter follows:
11525 % o wand: the magick wand.
11527 % o tint: the tint pixel wand.
11529 % o alpha: the alpha pixel wand.
11532 WandExport MagickBooleanType MagickTintImage(MagickWand *wand,
11533 const PixelWand *tint,const PixelWand *blend)
11536 percent_blend[MaxTextExtent];
11544 assert(wand != (MagickWand *) NULL);
11545 assert(wand->signature == WandSignature);
11546 if (IfMagickTrue(wand->debug))
11547 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11548 if (wand->images == (Image *) NULL)
11549 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11550 if (wand->images->colorspace != CMYKColorspace)
11551 (void) FormatLocaleString(percent_blend,MaxTextExtent,
11552 "%g,%g,%g,%g",(double) (100.0*QuantumScale*
11553 PixelGetRedQuantum(blend)),(double) (100.0*QuantumScale*
11554 PixelGetGreenQuantum(blend)),(double) (100.0*QuantumScale*
11555 PixelGetBlueQuantum(blend)),(double) (100.0*QuantumScale*
11556 PixelGetAlphaQuantum(blend)));
11558 (void) FormatLocaleString(percent_blend,MaxTextExtent,
11559 "%g,%g,%g,%g,%g",(double) (100.0*QuantumScale*
11560 PixelGetCyanQuantum(blend)),(double) (100.0*QuantumScale*
11561 PixelGetMagentaQuantum(blend)),(double) (100.0*QuantumScale*
11562 PixelGetYellowQuantum(blend)),(double) (100.0*QuantumScale*
11563 PixelGetBlackQuantum(blend)),(double) (100.0*QuantumScale*
11564 PixelGetAlphaQuantum(blend)));
11565 target=PixelGetPixel(tint);
11566 tint_image=TintImage(wand->images,percent_blend,&target,wand->exception);
11567 if (tint_image == (Image *) NULL)
11568 return(MagickFalse);
11569 ReplaceImageInList(&wand->images,tint_image);
11570 return(MagickTrue);
11574 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11578 % M a g i c k T r a n s f o r m I m a g e %
11582 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11584 % MagickTransformImage() is a convenience method that behaves like
11585 % MagickResizeImage() or MagickCropImage() but accepts scaling and/or cropping
11586 % information as a region geometry specification. If the operation fails,
11587 % a NULL image handle is returned.
11589 % The format of the MagickTransformImage method is:
11591 % MagickWand *MagickTransformImage(MagickWand *wand,const char *crop,
11592 % const char *geometry)
11594 % A description of each parameter follows:
11596 % o wand: the magick wand.
11598 % o crop: A crop geometry string. This geometry defines a subregion of the
11601 % o geometry: An image geometry string. This geometry defines the final
11602 % size of the image.
11605 WandExport MagickWand *MagickTransformImage(MagickWand *wand,
11606 const char *crop,const char *geometry)
11614 assert(wand != (MagickWand *) NULL);
11615 assert(wand->signature == WandSignature);
11616 if (IfMagickTrue(wand->debug))
11617 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11618 if (wand->images == (Image *) NULL)
11619 return((MagickWand *) NULL);
11620 transform_image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
11621 if (transform_image == (Image *) NULL)
11622 return((MagickWand *) NULL);
11623 status=TransformImage(&transform_image,crop,geometry,wand->exception);
11624 if (IfMagickFalse(status))
11626 transform_image=DestroyImage(transform_image);
11627 return((MagickWand *) NULL);
11629 return(CloneMagickWandFromImages(wand,transform_image));
11633 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11637 % 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 %
11641 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11643 % MagickTransformImageColorspace() transform the image colorspace, setting
11644 % the images colorspace while transforming the images data to that
11647 % The format of the MagickTransformImageColorspace method is:
11649 % MagickBooleanType MagickTransformImageColorspace(MagickWand *wand,
11650 % const ColorspaceType colorspace)
11652 % A description of each parameter follows:
11654 % o wand: the magick wand.
11656 % o colorspace: the image colorspace: UndefinedColorspace,
11657 % sRGBColorspace, RGBColorspace, GRAYColorspace,
11658 % OHTAColorspace, XYZColorspace, YCbCrColorspace,
11659 % YCCColorspace, YIQColorspace, YPbPrColorspace,
11660 % YPbPrColorspace, YUVColorspace, CMYKColorspace,
11661 % HSLColorspace, HWBColorspace.
11664 WandExport MagickBooleanType MagickTransformImageColorspace(MagickWand *wand,
11665 const ColorspaceType colorspace)
11667 assert(wand != (MagickWand *) NULL);
11668 assert(wand->signature == WandSignature);
11669 if (IfMagickTrue(wand->debug))
11670 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11671 if (wand->images == (Image *) NULL)
11672 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11673 return(TransformImageColorspace(wand->images,colorspace,wand->exception));
11677 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11681 % 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 %
11685 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11687 % MagickTransparentPaintImage() changes any pixel that matches color with the
11688 % color defined by fill.
11690 % The format of the MagickTransparentPaintImage method is:
11692 % MagickBooleanType MagickTransparentPaintImage(MagickWand *wand,
11693 % const PixelWand *target,const double alpha,const double fuzz,
11694 % const MagickBooleanType invert)
11696 % A description of each parameter follows:
11698 % o wand: the magick wand.
11700 % o target: Change this target color to specified alpha value within
11703 % o alpha: the level of transparency: 1.0 is fully opaque and 0.0 is fully
11706 % o fuzz: By default target must match a particular pixel color
11707 % exactly. However, in many cases two colors may differ by a small amount.
11708 % The fuzz member of image defines how much tolerance is acceptable to
11709 % consider two colors as the same. For example, set fuzz to 10 and the
11710 % color red at intensities of 100 and 102 respectively are now interpreted
11711 % as the same color for the purposes of the floodfill.
11713 % o invert: paint any pixel that does not match the target color.
11716 WandExport MagickBooleanType MagickTransparentPaintImage(MagickWand *wand,
11717 const PixelWand *target,const double alpha,const double fuzz,
11718 const MagickBooleanType invert)
11726 assert(wand != (MagickWand *) NULL);
11727 assert(wand->signature == WandSignature);
11728 if (IfMagickTrue(wand->debug))
11729 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11730 if (wand->images == (Image *) NULL)
11731 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11732 PixelGetMagickColor(target,&target_pixel);
11733 wand->images->fuzz=fuzz;
11734 status=TransparentPaintImage(wand->images,&target_pixel,ClampToQuantum(
11735 QuantumRange*alpha),invert,wand->exception);
11740 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11744 % M a g i c k T r a n s p o s e I m a g e %
11748 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11750 % MagickTransposeImage() creates a vertical mirror image by reflecting the
11751 % pixels around the central x-axis while rotating them 90-degrees.
11753 % The format of the MagickTransposeImage method is:
11755 % MagickBooleanType MagickTransposeImage(MagickWand *wand)
11757 % A description of each parameter follows:
11759 % o wand: the magick wand.
11762 WandExport MagickBooleanType MagickTransposeImage(MagickWand *wand)
11767 assert(wand != (MagickWand *) NULL);
11768 assert(wand->signature == WandSignature);
11769 if (IfMagickTrue(wand->debug))
11770 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11771 if (wand->images == (Image *) NULL)
11772 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11773 transpose_image=TransposeImage(wand->images,wand->exception);
11774 if (transpose_image == (Image *) NULL)
11775 return(MagickFalse);
11776 ReplaceImageInList(&wand->images,transpose_image);
11777 return(MagickTrue);
11781 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11785 % M a g i c k T r a n s v e r s e I m a g e %
11789 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11791 % MagickTransverseImage() creates a horizontal mirror image by reflecting the
11792 % pixels around the central y-axis while rotating them 270-degrees.
11794 % The format of the MagickTransverseImage method is:
11796 % MagickBooleanType MagickTransverseImage(MagickWand *wand)
11798 % A description of each parameter follows:
11800 % o wand: the magick wand.
11803 WandExport MagickBooleanType MagickTransverseImage(MagickWand *wand)
11808 assert(wand != (MagickWand *) NULL);
11809 assert(wand->signature == WandSignature);
11810 if (IfMagickTrue(wand->debug))
11811 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11812 if (wand->images == (Image *) NULL)
11813 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11814 transverse_image=TransverseImage(wand->images,wand->exception);
11815 if (transverse_image == (Image *) NULL)
11816 return(MagickFalse);
11817 ReplaceImageInList(&wand->images,transverse_image);
11818 return(MagickTrue);
11822 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11826 % M a g i c k T r i m I m a g e %
11830 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11832 % MagickTrimImage() remove edges that are the background color from the image.
11834 % The format of the MagickTrimImage method is:
11836 % MagickBooleanType MagickTrimImage(MagickWand *wand,const double fuzz)
11838 % A description of each parameter follows:
11840 % o wand: the magick wand.
11842 % o fuzz: By default target must match a particular pixel color
11843 % exactly. However, in many cases two colors may differ by a small amount.
11844 % The fuzz member of image defines how much tolerance is acceptable to
11845 % consider two colors as the same. For example, set fuzz to 10 and the
11846 % color red at intensities of 100 and 102 respectively are now interpreted
11847 % as the same color for the purposes of the floodfill.
11850 WandExport MagickBooleanType MagickTrimImage(MagickWand *wand,const double fuzz)
11855 assert(wand != (MagickWand *) NULL);
11856 assert(wand->signature == WandSignature);
11857 if (IfMagickTrue(wand->debug))
11858 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11859 if (wand->images == (Image *) NULL)
11860 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11861 wand->images->fuzz=fuzz;
11862 trim_image=TrimImage(wand->images,wand->exception);
11863 if (trim_image == (Image *) NULL)
11864 return(MagickFalse);
11865 ReplaceImageInList(&wand->images,trim_image);
11866 return(MagickTrue);
11870 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11874 % M a g i c k U n i q u e I m a g e C o l o r s %
11878 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11880 % MagickUniqueImageColors() discards all but one of any pixel color.
11882 % The format of the MagickUniqueImageColors method is:
11884 % MagickBooleanType MagickUniqueImageColors(MagickWand *wand)
11886 % A description of each parameter follows:
11888 % o wand: the magick wand.
11891 WandExport MagickBooleanType MagickUniqueImageColors(MagickWand *wand)
11896 assert(wand != (MagickWand *) NULL);
11897 assert(wand->signature == WandSignature);
11898 if (IfMagickTrue(wand->debug))
11899 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11900 if (wand->images == (Image *) NULL)
11901 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11902 unique_image=UniqueImageColors(wand->images,wand->exception);
11903 if (unique_image == (Image *) NULL)
11904 return(MagickFalse);
11905 ReplaceImageInList(&wand->images,unique_image);
11906 return(MagickTrue);
11910 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11914 % M a g i c k U n s h a r p M a s k I m a g e %
11918 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11920 % MagickUnsharpMaskImage() sharpens an image. We convolve the image with a
11921 % Gaussian operator of the given radius and standard deviation (sigma).
11922 % For reasonable results, radius should be larger than sigma. Use a radius
11923 % of 0 and UnsharpMaskImage() selects a suitable radius for you.
11925 % The format of the MagickUnsharpMaskImage method is:
11927 % MagickBooleanType MagickUnsharpMaskImage(MagickWand *wand,
11928 % const double radius,const double sigma,const double gain,
11929 % const double threshold)
11931 % A description of each parameter follows:
11933 % o wand: the magick wand.
11935 % o radius: the radius of the Gaussian, in pixels, not counting the center
11938 % o sigma: the standard deviation of the Gaussian, in pixels.
11940 % o gain: the percentage of the difference between the original and the
11941 % blur image that is added back into the original.
11943 % o threshold: the threshold in pixels needed to apply the diffence gain.
11946 WandExport MagickBooleanType MagickUnsharpMaskImage(MagickWand *wand,
11947 const double radius,const double sigma,const double gain,
11948 const double threshold)
11953 assert(wand != (MagickWand *) NULL);
11954 assert(wand->signature == WandSignature);
11955 if (IfMagickTrue(wand->debug))
11956 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11957 if (wand->images == (Image *) NULL)
11958 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11959 unsharp_image=UnsharpMaskImage(wand->images,radius,sigma,gain,threshold,
11961 if (unsharp_image == (Image *) NULL)
11962 return(MagickFalse);
11963 ReplaceImageInList(&wand->images,unsharp_image);
11964 return(MagickTrue);
11968 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11972 % M a g i c k V i g n e t t e I m a g e %
11976 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11978 % MagickVignetteImage() softens the edges of the image in vignette style.
11980 % The format of the MagickVignetteImage method is:
11982 % MagickBooleanType MagickVignetteImage(MagickWand *wand,
11983 % const double radius,const double sigma,const ssize_t x,
11986 % A description of each parameter follows:
11988 % o wand: the magick wand.
11990 % o radius: the radius.
11992 % o sigma: the sigma.
11994 % o x, y: Define the x and y ellipse offset.
11997 WandExport MagickBooleanType MagickVignetteImage(MagickWand *wand,
11998 const double radius,const double sigma,const ssize_t x,const ssize_t y)
12003 assert(wand != (MagickWand *) NULL);
12004 assert(wand->signature == WandSignature);
12005 if (IfMagickTrue(wand->debug))
12006 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12007 if (wand->images == (Image *) NULL)
12008 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12009 vignette_image=VignetteImage(wand->images,radius,sigma,x,y,wand->exception);
12010 if (vignette_image == (Image *) NULL)
12011 return(MagickFalse);
12012 ReplaceImageInList(&wand->images,vignette_image);
12013 return(MagickTrue);
12017 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12021 % M a g i c k W a v e I m a g e %
12025 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12027 % MagickWaveImage() creates a "ripple" effect in the image by shifting
12028 % the pixels vertically along a sine wave whose amplitude and wavelength
12029 % is specified by the given parameters.
12031 % The format of the MagickWaveImage method is:
12033 % MagickBooleanType MagickWaveImage(MagickWand *wand,
12034 % const double amplitude,const double wave_length,
12035 % const PixelInterpolateMethod method)
12037 % A description of each parameter follows:
12039 % o wand: the magick wand.
12041 % o amplitude, wave_length: Define the amplitude and wave length of the
12044 % o method: the pixel interpolation method.
12047 WandExport MagickBooleanType MagickWaveImage(MagickWand *wand,
12048 const double amplitude,const double wave_length,
12049 const PixelInterpolateMethod method)
12054 assert(wand != (MagickWand *) NULL);
12055 assert(wand->signature == WandSignature);
12056 if (IfMagickTrue(wand->debug))
12057 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12058 if (wand->images == (Image *) NULL)
12059 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12060 wave_image=WaveImage(wand->images,amplitude,wave_length,method,
12062 if (wave_image == (Image *) NULL)
12063 return(MagickFalse);
12064 ReplaceImageInList(&wand->images,wave_image);
12065 return(MagickTrue);
12069 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12073 % 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 %
12077 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12079 % MagickWhiteThresholdImage() is like ThresholdImage() but force all pixels
12080 % above the threshold into white while leaving all pixels below the threshold
12083 % The format of the MagickWhiteThresholdImage method is:
12085 % MagickBooleanType MagickWhiteThresholdImage(MagickWand *wand,
12086 % const PixelWand *threshold)
12088 % A description of each parameter follows:
12090 % o wand: the magick wand.
12092 % o threshold: the pixel wand.
12095 WandExport MagickBooleanType MagickWhiteThresholdImage(MagickWand *wand,
12096 const PixelWand *threshold)
12099 thresholds[MaxTextExtent];
12101 assert(wand != (MagickWand *) NULL);
12102 assert(wand->signature == WandSignature);
12103 if (IfMagickTrue(wand->debug))
12104 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12105 if (wand->images == (Image *) NULL)
12106 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12107 (void) FormatLocaleString(thresholds,MaxTextExtent,
12108 QuantumFormat "," QuantumFormat "," QuantumFormat "," QuantumFormat,
12109 PixelGetRedQuantum(threshold),PixelGetGreenQuantum(threshold),
12110 PixelGetBlueQuantum(threshold),PixelGetAlphaQuantum(threshold));
12111 return(WhiteThresholdImage(wand->images,thresholds,wand->exception));
12115 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12119 % M a g i c k W r i t e I m a g e %
12123 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12125 % MagickWriteImage() writes an image to the specified filename. If the
12126 % filename parameter is NULL, the image is written to the filename set
12127 % by MagickReadImage() or MagickSetImageFilename().
12129 % The format of the MagickWriteImage method is:
12131 % MagickBooleanType MagickWriteImage(MagickWand *wand,
12132 % const char *filename)
12134 % A description of each parameter follows:
12136 % o wand: the magick wand.
12138 % o filename: the image filename.
12142 WandExport MagickBooleanType MagickWriteImage(MagickWand *wand,
12143 const char *filename)
12154 assert(wand != (MagickWand *) NULL);
12155 assert(wand->signature == WandSignature);
12156 if (IfMagickTrue(wand->debug))
12157 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12158 if (wand->images == (Image *) NULL)
12159 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12160 if (filename != (const char *) NULL)
12161 (void) CopyMagickString(wand->images->filename,filename,MaxTextExtent);
12162 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
12163 if (image == (Image *) NULL)
12164 return(MagickFalse);
12165 write_info=CloneImageInfo(wand->image_info);
12166 write_info->adjoin=MagickTrue;
12167 status=WriteImage(write_info,image,wand->exception);
12168 image=DestroyImage(image);
12169 write_info=DestroyImageInfo(write_info);
12174 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12178 % M a g i c k W r i t e I m a g e F i l e %
12182 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12184 % MagickWriteImageFile() writes an image to an open file descriptor.
12186 % The format of the MagickWriteImageFile method is:
12188 % MagickBooleanType MagickWriteImageFile(MagickWand *wand,FILE *file)
12190 % A description of each parameter follows:
12192 % o wand: the magick wand.
12194 % o file: the file descriptor.
12197 WandExport MagickBooleanType MagickWriteImageFile(MagickWand *wand,FILE *file)
12208 assert(wand != (MagickWand *) NULL);
12209 assert(wand->signature == WandSignature);
12210 assert(file != (FILE *) NULL);
12211 if (IfMagickTrue(wand->debug))
12212 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12213 if (wand->images == (Image *) NULL)
12214 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12215 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
12216 if (image == (Image *) NULL)
12217 return(MagickFalse);
12218 write_info=CloneImageInfo(wand->image_info);
12219 SetImageInfoFile(write_info,file);
12220 write_info->adjoin=MagickTrue;
12221 status=WriteImage(write_info,image,wand->exception);
12222 write_info=DestroyImageInfo(write_info);
12223 image=DestroyImage(image);
12228 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12232 % M a g i c k W r i t e I m a g e s %
12236 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12238 % MagickWriteImages() writes an image or image sequence.
12240 % The format of the MagickWriteImages method is:
12242 % MagickBooleanType MagickWriteImages(MagickWand *wand,
12243 % const char *filename,const MagickBooleanType adjoin)
12245 % A description of each parameter follows:
12247 % o wand: the magick wand.
12249 % o filename: the image filename.
12251 % o adjoin: join images into a single multi-image file.
12254 WandExport MagickBooleanType MagickWriteImages(MagickWand *wand,
12255 const char *filename,const MagickBooleanType adjoin)
12263 assert(wand != (MagickWand *) NULL);
12264 assert(wand->signature == WandSignature);
12265 if (IfMagickTrue(wand->debug))
12266 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12267 if (wand->images == (Image *) NULL)
12268 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12269 write_info=CloneImageInfo(wand->image_info);
12270 write_info->adjoin=adjoin;
12271 status=WriteImages(write_info,wand->images,filename,wand->exception);
12272 write_info=DestroyImageInfo(write_info);
12277 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12281 % M a g i c k W r i t e I m a g e s F i l e %
12285 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12287 % MagickWriteImagesFile() writes an image sequence to an open file descriptor.
12289 % The format of the MagickWriteImagesFile method is:
12291 % MagickBooleanType MagickWriteImagesFile(MagickWand *wand,FILE *file)
12293 % A description of each parameter follows:
12295 % o wand: the magick wand.
12297 % o file: the file descriptor.
12300 WandExport MagickBooleanType MagickWriteImagesFile(MagickWand *wand,FILE *file)
12308 assert(wand != (MagickWand *) NULL);
12309 assert(wand->signature == WandSignature);
12310 if (IfMagickTrue(wand->debug))
12311 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12312 if (wand->images == (Image *) NULL)
12313 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12314 write_info=CloneImageInfo(wand->image_info);
12315 SetImageInfoFile(write_info,file);
12316 write_info->adjoin=MagickTrue;
12317 status=WriteImages(write_info,wand->images,(const char *) NULL,
12319 write_info=DestroyImageInfo(write_info);