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-2014 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"
54 #include "MagickCore/image-private.h"
59 #define MagickWandId "MagickWand"
62 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
66 + 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 %
70 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
72 % CloneMagickWandFromImages() clones the magick wand and inserts a new image
75 % The format of the CloneMagickWandFromImages method is:
77 % MagickWand *CloneMagickWandFromImages(const MagickWand *wand,
80 % A description of each parameter follows:
82 % o wand: the magick wand.
84 % o images: replace the image list with these image(s).
87 static MagickWand *CloneMagickWandFromImages(const MagickWand *wand,
93 assert(wand != (MagickWand *) NULL);
94 assert(wand->signature == WandSignature);
95 if (IfMagickTrue(wand->debug))
96 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
97 clone_wand=(MagickWand *) AcquireMagickMemory(sizeof(*clone_wand));
98 if (clone_wand == (MagickWand *) NULL)
99 ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed",
101 (void) ResetMagickMemory(clone_wand,0,sizeof(*clone_wand));
102 clone_wand->id=AcquireWandId();
103 (void) FormatLocaleString(clone_wand->name,MaxTextExtent,"%s-%.20g",
104 MagickWandId,(double) clone_wand->id);
105 clone_wand->exception=AcquireExceptionInfo();
106 InheritException(clone_wand->exception,wand->exception);
107 clone_wand->image_info=CloneImageInfo(wand->image_info);
108 clone_wand->images=images;
109 clone_wand->debug=IsEventLogging();
110 clone_wand->signature=WandSignature;
111 if (IfMagickTrue(clone_wand->debug))
112 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",clone_wand->name);
117 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
121 % G e t I m a g e F r o m M a g i c k W a n d %
125 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
127 % GetImageFromMagickWand() returns the current image from the magick wand.
129 % The format of the GetImageFromMagickWand method is:
131 % Image *GetImageFromMagickWand(const MagickWand *wand)
133 % A description of each parameter follows:
135 % o wand: the magick wand.
138 WandExport Image *GetImageFromMagickWand(const MagickWand *wand)
140 assert(wand != (MagickWand *) NULL);
141 assert(wand->signature == WandSignature);
142 if (IfMagickTrue(wand->debug))
143 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
144 if (wand->images == (Image *) NULL)
146 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
147 "ContainsNoImages","`%s'",wand->name);
148 return((Image *) NULL);
150 return(wand->images);
154 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
158 % 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 %
162 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
164 % MagickAdaptiveBlurImage() adaptively blurs the image by blurring
165 % less intensely near image edges and more intensely far from edges. We
166 % blur the image with a Gaussian operator of the given radius and standard
167 % deviation (sigma). For reasonable results, radius should be larger than
168 % sigma. Use a radius of 0 and MagickAdaptiveBlurImage() selects a
169 % suitable radius for you.
171 % The format of the MagickAdaptiveBlurImage method is:
173 % MagickBooleanType MagickAdaptiveBlurImage(MagickWand *wand,
174 % const double radius,const double sigma)
176 % A description of each parameter follows:
178 % o wand: the magick wand.
180 % o radius: the radius of the Gaussian, in pixels, not counting the center
183 % o sigma: the standard deviation of the Gaussian, in pixels.
186 WandExport MagickBooleanType MagickAdaptiveBlurImage(MagickWand *wand,
187 const double radius,const double sigma)
192 assert(wand != (MagickWand *) NULL);
193 assert(wand->signature == WandSignature);
194 if (IfMagickTrue(wand->debug))
195 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
196 if (wand->images == (Image *) NULL)
197 ThrowWandException(WandError,"ContainsNoImages",wand->name);
198 sharp_image=AdaptiveBlurImage(wand->images,radius,sigma,wand->exception);
199 if (sharp_image == (Image *) NULL)
201 ReplaceImageInList(&wand->images,sharp_image);
206 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
210 % 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 %
214 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
216 % MagickAdaptiveResizeImage() adaptively resize image with data dependent
219 % MagickBooleanType MagickAdaptiveResizeImage(MagickWand *wand,
220 % const size_t columns,const size_t rows)
222 % A description of each parameter follows:
224 % o wand: the magick wand.
226 % o columns: the number of columns in the scaled image.
228 % o rows: the number of rows in the scaled image.
231 WandExport MagickBooleanType MagickAdaptiveResizeImage(MagickWand *wand,
232 const size_t columns,const size_t rows)
237 assert(wand != (MagickWand *) NULL);
238 assert(wand->signature == WandSignature);
239 if (IfMagickTrue(wand->debug))
240 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
241 if (wand->images == (Image *) NULL)
242 ThrowWandException(WandError,"ContainsNoImages",wand->name);
243 resize_image=AdaptiveResizeImage(wand->images,columns,rows,wand->exception);
244 if (resize_image == (Image *) NULL)
246 ReplaceImageInList(&wand->images,resize_image);
251 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
255 % 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 %
259 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
261 % MagickAdaptiveSharpenImage() adaptively sharpens the image by sharpening
262 % more intensely near image edges and less intensely far from edges. We
263 % sharpen the image with a Gaussian operator of the given radius and standard
264 % deviation (sigma). For reasonable results, radius should be larger than
265 % sigma. Use a radius of 0 and MagickAdaptiveSharpenImage() selects a
266 % suitable radius for you.
268 % The format of the MagickAdaptiveSharpenImage method is:
270 % MagickBooleanType MagickAdaptiveSharpenImage(MagickWand *wand,
271 % const double radius,const double sigma)
273 % A description of each parameter follows:
275 % o wand: the magick wand.
277 % o radius: the radius of the Gaussian, in pixels, not counting the center
280 % o sigma: the standard deviation of the Gaussian, in pixels.
283 WandExport MagickBooleanType MagickAdaptiveSharpenImage(MagickWand *wand,
284 const double radius,const double sigma)
289 assert(wand != (MagickWand *) NULL);
290 assert(wand->signature == WandSignature);
291 if (IfMagickTrue(wand->debug))
292 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
293 if (wand->images == (Image *) NULL)
294 ThrowWandException(WandError,"ContainsNoImages",wand->name);
295 sharp_image=AdaptiveSharpenImage(wand->images,radius,sigma,wand->exception);
296 if (sharp_image == (Image *) NULL)
298 ReplaceImageInList(&wand->images,sharp_image);
303 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
307 % 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 %
311 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
313 % MagickAdaptiveThresholdImage() selects an individual threshold for each pixel
314 % based on the range of intensity values in its local neighborhood. This
315 % allows for thresholding of an image whose global intensity histogram
316 % doesn't contain distinctive peaks.
318 % The format of the AdaptiveThresholdImage method is:
320 % MagickBooleanType MagickAdaptiveThresholdImage(MagickWand *wand,
321 % const size_t width,const size_t height,const double bias)
323 % A description of each parameter follows:
325 % o wand: the magick wand.
327 % o width: the width of the local neighborhood.
329 % o height: the height of the local neighborhood.
331 % o offset: the mean bias.
334 WandExport MagickBooleanType MagickAdaptiveThresholdImage(MagickWand *wand,
335 const size_t width,const size_t height,const double bias)
340 assert(wand != (MagickWand *) NULL);
341 assert(wand->signature == WandSignature);
342 if (IfMagickTrue(wand->debug))
343 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
344 if (wand->images == (Image *) NULL)
345 ThrowWandException(WandError,"ContainsNoImages",wand->name);
346 threshold_image=AdaptiveThresholdImage(wand->images,width,height,bias,
348 if (threshold_image == (Image *) NULL)
350 ReplaceImageInList(&wand->images,threshold_image);
355 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
359 % M a g i c k A d d I m a g e %
363 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
365 % MagickAddImage() adds a clone of the images from the second wand and
366 % inserts them into the first wand.
368 % Use MagickSetLastIterator(), to append new images into an existing wand,
369 % current image will be set to last image so later adds with also be
370 % appened to end of wand.
372 % Use MagickSetFirstIterator() to prepend new images into wand, any more
373 % images added will also be prepended before other images in the wand.
374 % However the order of a list of new images will not change.
376 % Otherwise the new images will be inserted just after the current image,
377 % and any later image will also be added after this current image but
378 % before the previously added images. Caution is advised when multiple
379 % image adds are inserted into the middle of the wand image list.
381 % The format of the MagickAddImage method is:
383 % MagickBooleanType MagickAddImage(MagickWand *wand,
384 % const MagickWand *add_wand)
386 % A description of each parameter follows:
388 % o wand: the magick wand.
390 % o add_wand: A wand that contains the image list to be added
393 static inline MagickBooleanType InsertImageInWand(MagickWand *wand,
396 if (wand->images == (Image *) NULL)
399 No images in wand, just add them, set current as appropriate.
401 if (IfMagickTrue(wand->insert_before))
402 wand->images=GetFirstImageInList(images);
404 wand->images=GetLastImageInList(images);
407 /* user jumped to first image, so prepend new images - remain active */
408 if (IfMagickTrue((wand->insert_before)) &&
409 (wand->images->previous == (Image *) NULL))
411 PrependImageToList(&wand->images,images);
412 wand->images=GetFirstImageInList(images);
416 Note you should never have 'insert_before' true when current image is not
417 the first image in the wand! That is no insert before current image, only
420 if (wand->images->next == (Image *) NULL)
423 At last image, append new images.
425 InsertImageInList(&wand->images,images);
426 wand->images=GetLastImageInList(images);
430 Insert new images, just after the current image.
432 InsertImageInList(&wand->images,images);
436 WandExport MagickBooleanType MagickAddImage(MagickWand *wand,
437 const MagickWand *add_wand)
442 assert(wand != (MagickWand *) NULL);
443 assert(wand->signature == WandSignature);
444 if (IfMagickTrue(wand->debug))
445 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
446 assert(add_wand != (MagickWand *) NULL);
447 assert(add_wand->signature == WandSignature);
448 if (add_wand->images == (Image *) NULL)
449 ThrowWandException(WandError,"ContainsNoImages",add_wand->name);
451 Clone images in second wand, and insert into first.
453 images=CloneImageList(add_wand->images,wand->exception);
454 if (images == (Image *) NULL)
456 return(InsertImageInWand(wand,images));
460 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
464 % M a g i c k A d d N o i s e I m a g e %
468 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
470 % MagickAddNoiseImage() adds random noise to the image.
472 % The format of the MagickAddNoiseImage method is:
474 % MagickBooleanType MagickAddNoiseImage(MagickWand *wand,
475 % const NoiseType noise_type,const double attenuate)
477 % A description of each parameter follows:
479 % o wand: the magick wand.
481 % o noise_type: The type of noise: Uniform, Gaussian, Multiplicative,
482 % Impulse, Laplacian, or Poisson.
484 % o attenuate: attenuate the random distribution.
487 WandExport MagickBooleanType MagickAddNoiseImage(MagickWand *wand,
488 const NoiseType noise_type,const double attenuate)
493 assert(wand != (MagickWand *) NULL);
494 assert(wand->signature == WandSignature);
495 if (IfMagickTrue(wand->debug))
496 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
497 if (wand->images == (Image *) NULL)
498 ThrowWandException(WandError,"ContainsNoImages",wand->name);
499 noise_image=AddNoiseImage(wand->images,noise_type,attenuate,wand->exception);
500 if (noise_image == (Image *) NULL)
502 ReplaceImageInList(&wand->images,noise_image);
507 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
511 % 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 %
515 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
517 % MagickAffineTransformImage() transforms an image as dictated by the affine
518 % matrix of the drawing wand.
520 % The format of the MagickAffineTransformImage method is:
522 % MagickBooleanType MagickAffineTransformImage(MagickWand *wand,
523 % const DrawingWand *drawing_wand)
525 % A description of each parameter follows:
527 % o wand: the magick wand.
529 % o drawing_wand: the draw wand.
532 WandExport MagickBooleanType MagickAffineTransformImage(MagickWand *wand,
533 const DrawingWand *drawing_wand)
541 assert(wand != (MagickWand *) NULL);
542 assert(wand->signature == WandSignature);
543 if (IfMagickTrue(wand->debug))
544 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
545 if (wand->images == (Image *) NULL)
546 ThrowWandException(WandError,"ContainsNoImages",wand->name);
547 draw_info=PeekDrawingWand(drawing_wand);
548 if (draw_info == (DrawInfo *) NULL)
550 affine_image=AffineTransformImage(wand->images,&draw_info->affine,
552 draw_info=DestroyDrawInfo(draw_info);
553 if (affine_image == (Image *) NULL)
555 ReplaceImageInList(&wand->images,affine_image);
560 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
564 % M a g i c k A n n o t a t e I m a g e %
568 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
570 % MagickAnnotateImage() annotates an image with text.
572 % The format of the MagickAnnotateImage method is:
574 % MagickBooleanType MagickAnnotateImage(MagickWand *wand,
575 % const DrawingWand *drawing_wand,const double x,const double y,
576 % const double angle,const char *text)
578 % A description of each parameter follows:
580 % o wand: the magick wand.
582 % o drawing_wand: the draw wand.
584 % o x: x ordinate to left of text
586 % o y: y ordinate to text baseline
588 % o angle: rotate text relative to this angle.
590 % o text: text to draw
593 WandExport MagickBooleanType MagickAnnotateImage(MagickWand *wand,
594 const DrawingWand *drawing_wand,const double x,const double y,
595 const double angle,const char *text)
598 geometry[MaxTextExtent];
606 assert(wand != (MagickWand *) NULL);
607 assert(wand->signature == WandSignature);
608 if (IfMagickTrue(wand->debug))
609 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
610 if (wand->images == (Image *) NULL)
611 ThrowWandException(WandError,"ContainsNoImages",wand->name);
612 draw_info=PeekDrawingWand(drawing_wand);
613 if (draw_info == (DrawInfo *) NULL)
615 (void) CloneString(&draw_info->text,text);
616 (void) FormatLocaleString(geometry,MaxTextExtent,"%+g%+g",x,y);
617 draw_info->affine.sx=cos((double) DegreesToRadians(fmod(angle,360.0)));
618 draw_info->affine.rx=sin((double) DegreesToRadians(fmod(angle,360.0)));
619 draw_info->affine.ry=(-sin((double) DegreesToRadians(fmod(angle,360.0))));
620 draw_info->affine.sy=cos((double) DegreesToRadians(fmod(angle,360.0)));
621 (void) CloneString(&draw_info->geometry,geometry);
622 status=AnnotateImage(wand->images,draw_info,wand->exception);
623 draw_info=DestroyDrawInfo(draw_info);
628 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
632 % M a g i c k A n i m a t e I m a g e s %
636 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
638 % MagickAnimateImages() animates an image or image sequence.
640 % The format of the MagickAnimateImages method is:
642 % MagickBooleanType MagickAnimateImages(MagickWand *wand,
643 % const char *server_name)
645 % A description of each parameter follows:
647 % o wand: the magick wand.
649 % o server_name: the X server name.
652 WandExport MagickBooleanType MagickAnimateImages(MagickWand *wand,
653 const char *server_name)
658 assert(wand != (MagickWand *) NULL);
659 assert(wand->signature == WandSignature);
660 if (IfMagickTrue(wand->debug))
661 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
662 (void) CloneString(&wand->image_info->server_name,server_name);
663 status=AnimateImages(wand->image_info,wand->images,wand->exception);
668 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
672 % M a g i c k A p p e n d I m a g e s %
676 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
678 % MagickAppendImages() append the images in a wand from the current image
679 % onwards, creating a new wand with the single image result. This is
680 % affected by the gravity and background settings of the first image.
682 % Typically you would call either MagickResetIterator() or
683 % MagickSetFirstImage() before calling this function to ensure that all
684 % the images in the wand's image list will be appended together.
686 % The format of the MagickAppendImages method is:
688 % MagickWand *MagickAppendImages(MagickWand *wand,
689 % const MagickBooleanType stack)
691 % A description of each parameter follows:
693 % o wand: the magick wand.
695 % o stack: By default, images are stacked left-to-right. Set stack to
696 % MagickTrue to stack them top-to-bottom.
699 WandExport MagickWand *MagickAppendImages(MagickWand *wand,
700 const MagickBooleanType stack)
705 assert(wand != (MagickWand *) NULL);
706 assert(wand->signature == WandSignature);
707 if (IfMagickTrue(wand->debug))
708 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
709 if (wand->images == (Image *) NULL)
710 return((MagickWand *) NULL);
711 append_image=AppendImages(wand->images,stack,wand->exception);
712 if (append_image == (Image *) NULL)
713 return((MagickWand *) NULL);
714 return(CloneMagickWandFromImages(wand,append_image));
718 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
722 % M a g i c k A u t o G a m m a I m a g e %
726 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
728 % MagickAutoGammaImage() extracts the 'mean' from the image and adjust the
729 % image to try make set its gamma appropriatally.
731 % The format of the MagickAutoGammaImage method is:
733 % MagickBooleanType MagickAutoGammaImage(MagickWand *wand)
735 % A description of each parameter follows:
737 % o wand: the magick wand.
740 WandExport MagickBooleanType MagickAutoGammaImage(MagickWand *wand)
745 assert(wand != (MagickWand *) NULL);
746 assert(wand->signature == WandSignature);
747 if (IfMagickTrue(wand->debug))
748 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
749 if (wand->images == (Image *) NULL)
750 ThrowWandException(WandError,"ContainsNoImages",wand->name);
751 status=AutoGammaImage(wand->images,wand->exception);
756 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
760 % M a g i c k A u t o L e v e l I m a g e %
764 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
766 % MagickAutoLevelImage() adjusts the levels of a particular image channel by
767 % scaling the minimum and maximum values to the full quantum range.
769 % The format of the MagickAutoLevelImage method is:
771 % MagickBooleanType MagickAutoLevelImage(MagickWand *wand)
773 % A description of each parameter follows:
775 % o wand: the magick wand.
778 WandExport MagickBooleanType MagickAutoLevelImage(MagickWand *wand)
783 assert(wand != (MagickWand *) NULL);
784 assert(wand->signature == WandSignature);
785 if (IfMagickTrue(wand->debug))
786 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
787 if (wand->images == (Image *) NULL)
788 ThrowWandException(WandError,"ContainsNoImages",wand->name);
789 status=AutoLevelImage(wand->images,wand->exception);
794 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
798 % 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 %
802 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
804 % MagickBlackThresholdImage() is like MagickThresholdImage() but forces all
805 % pixels below the threshold into black while leaving all pixels above the
806 % threshold unchanged.
808 % The format of the MagickBlackThresholdImage method is:
810 % MagickBooleanType MagickBlackThresholdImage(MagickWand *wand,
811 % const PixelWand *threshold)
813 % A description of each parameter follows:
815 % o wand: the magick wand.
817 % o threshold: the pixel wand.
820 WandExport MagickBooleanType MagickBlackThresholdImage(MagickWand *wand,
821 const PixelWand *threshold)
824 thresholds[MaxTextExtent];
829 assert(wand != (MagickWand *) NULL);
830 assert(wand->signature == WandSignature);
831 if (IfMagickTrue(wand->debug))
832 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
833 if (wand->images == (Image *) NULL)
834 ThrowWandException(WandError,"ContainsNoImages",wand->name);
835 (void) FormatLocaleString(thresholds,MaxTextExtent,
836 QuantumFormat "," QuantumFormat "," QuantumFormat "," QuantumFormat,
837 PixelGetRedQuantum(threshold),PixelGetGreenQuantum(threshold),
838 PixelGetBlueQuantum(threshold),PixelGetAlphaQuantum(threshold));
839 status=BlackThresholdImage(wand->images,thresholds,wand->exception);
844 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
848 % M a g i c k B l u e S h i f t I m a g e %
852 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
854 % MagickBlueShiftImage() mutes the colors of the image to simulate a scene at
855 % nighttime in the moonlight.
857 % The format of the MagickBlueShiftImage method is:
859 % MagickBooleanType MagickBlueShiftImage(MagickWand *wand,
860 % const double factor)
862 % A description of each parameter follows:
864 % o wand: the magick wand.
866 % o factor: the blue shift factor (default 1.5)
869 WandExport MagickBooleanType MagickBlueShiftImage(MagickWand *wand,
875 assert(wand != (MagickWand *) NULL);
876 assert(wand->signature == WandSignature);
877 if (IfMagickTrue(wand->debug))
878 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
879 if (wand->images == (Image *) NULL)
880 ThrowWandException(WandError,"ContainsNoImages",wand->name);
881 shift_image=BlueShiftImage(wand->images,factor,wand->exception);
882 if (shift_image == (Image *) NULL)
884 ReplaceImageInList(&wand->images,shift_image);
889 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
893 % M a g i c k B l u r I m a g e %
897 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
899 % MagickBlurImage() blurs an image. We convolve the image with a
900 % gaussian operator of the given radius and standard deviation (sigma).
901 % For reasonable results, the radius should be larger than sigma. Use a
902 % radius of 0 and BlurImage() selects a suitable radius for you.
904 % The format of the MagickBlurImage method is:
906 % MagickBooleanType MagickBlurImage(MagickWand *wand,const double radius,
907 % const double sigma)
909 % A description of each parameter follows:
911 % o wand: the magick wand.
913 % o radius: the radius of the , in pixels, not counting the center
916 % o sigma: the standard deviation of the , in pixels.
919 WandExport MagickBooleanType MagickBlurImage(MagickWand *wand,
920 const double radius,const double sigma)
925 assert(wand != (MagickWand *) NULL);
926 assert(wand->signature == WandSignature);
927 if (IfMagickTrue(wand->debug))
928 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
929 if (wand->images == (Image *) NULL)
930 ThrowWandException(WandError,"ContainsNoImages",wand->name);
931 blur_image=BlurImage(wand->images,radius,sigma,wand->exception);
932 if (blur_image == (Image *) NULL)
934 ReplaceImageInList(&wand->images,blur_image);
939 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
943 % M a g i c k B o r d e r I m a g e %
947 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
949 % MagickBorderImage() surrounds the image with a border of the color defined
950 % by the bordercolor pixel wand.
952 % The format of the MagickBorderImage method is:
954 % MagickBooleanType MagickBorderImage(MagickWand *wand,
955 % const PixelWand *bordercolor,const size_t width,
956 % const size_t height,const CompositeOperator compose)
958 % A description of each parameter follows:
960 % o wand: the magick wand.
962 % o bordercolor: the border color pixel wand.
964 % o width: the border width.
966 % o height: the border height.
968 % o compose: the composite operator.
971 WandExport MagickBooleanType MagickBorderImage(MagickWand *wand,
972 const PixelWand *bordercolor,const size_t width,const size_t height,
973 const CompositeOperator compose)
981 assert(wand != (MagickWand *) NULL);
982 assert(wand->signature == WandSignature);
983 if (IfMagickTrue(wand->debug))
984 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
985 if (wand->images == (Image *) NULL)
986 ThrowWandException(WandError,"ContainsNoImages",wand->name);
987 border_info.width=width;
988 border_info.height=height;
991 PixelGetQuantumPacket(bordercolor,&wand->images->border_color);
992 border_image=BorderImage(wand->images,&border_info,compose,wand->exception);
993 if (border_image == (Image *) NULL)
995 ReplaceImageInList(&wand->images,border_image);
1000 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1004 % 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 %
1008 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1010 % Use MagickBrightnessContrastImage() to change the brightness and/or contrast
1011 % of an image. It converts the brightness and contrast parameters into slope
1012 % and intercept and calls a polynomical function to apply to the image.
1015 % The format of the MagickBrightnessContrastImage method is:
1017 % MagickBooleanType MagickBrightnessContrastImage(MagickWand *wand,
1018 % const double brightness,const double contrast)
1020 % A description of each parameter follows:
1022 % o wand: the magick wand.
1024 % o brightness: the brightness percent (-100 .. 100).
1026 % o contrast: the contrast percent (-100 .. 100).
1029 WandExport MagickBooleanType MagickBrightnessContrastImage(
1030 MagickWand *wand,const double brightness,const double contrast)
1035 assert(wand != (MagickWand *) NULL);
1036 assert(wand->signature == WandSignature);
1037 if (IfMagickTrue(wand->debug))
1038 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1039 if (wand->images == (Image *) NULL)
1040 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1041 status=BrightnessContrastImage(wand->images,brightness,contrast,
1047 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1051 % M a g i c k C h a n n e l F x I m a g e %
1055 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1057 % MagickChannelFxImage() applies a channel expression to the specified image.
1058 % The expression consists of one or more channels, either mnemonic or numeric
1059 % (e.g. red, 1), separated by actions as follows:
1061 % <=> exchange two channels (e.g. red<=>blue)
1062 % => transfer a channel to another (e.g. red=>green)
1063 % , separate channel operations (e.g. red, green)
1064 % | read channels from next input image (e.g. red | green)
1065 % ; write channels to next output image (e.g. red; green; blue)
1067 % A channel without a operation symbol implies extract. For example, to create
1068 % 3 grayscale images from the red, green, and blue channels of an image, use:
1070 % -channel-fx "red; green; blue"
1072 % The format of the MagickChannelFxImage method is:
1074 % MagickWand *MagickChannelFxImage(MagickWand *wand,const char *expression)
1076 % A description of each parameter follows:
1078 % o wand: the magick wand.
1080 % o expression: the expression.
1083 WandExport MagickWand *MagickChannelFxImage(MagickWand *wand,
1084 const char *expression)
1089 assert(wand != (MagickWand *) NULL);
1090 assert(wand->signature == WandSignature);
1091 if (IfMagickTrue(wand->debug))
1092 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1093 if (wand->images == (Image *) NULL)
1094 return((MagickWand *) NULL);
1095 fx_image=ChannelFxImage(wand->images,expression,wand->exception);
1096 if (fx_image == (Image *) NULL)
1097 return((MagickWand *) NULL);
1098 return(CloneMagickWandFromImages(wand,fx_image));
1102 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1106 % M a g i c k C h a r c o a l I m a g e %
1110 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1112 % MagickCharcoalImage() simulates a charcoal drawing.
1114 % The format of the MagickCharcoalImage method is:
1116 % MagickBooleanType MagickCharcoalImage(MagickWand *wand,
1117 % const double radius,const double sigma)
1119 % A description of each parameter follows:
1121 % o wand: the magick wand.
1123 % o radius: the radius of the Gaussian, in pixels, not counting the center
1126 % o sigma: the standard deviation of the Gaussian, in pixels.
1129 WandExport MagickBooleanType MagickCharcoalImage(MagickWand *wand,
1130 const double radius,const double sigma)
1135 assert(wand != (MagickWand *) NULL);
1136 assert(wand->signature == WandSignature);
1137 if (IfMagickTrue(wand->debug))
1138 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1139 if (wand->images == (Image *) NULL)
1140 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1141 charcoal_image=CharcoalImage(wand->images,radius,sigma,wand->exception);
1142 if (charcoal_image == (Image *) NULL)
1143 return(MagickFalse);
1144 ReplaceImageInList(&wand->images,charcoal_image);
1149 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1153 % M a g i c k C h o p I m a g e %
1157 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1159 % MagickChopImage() removes a region of an image and collapses the image to
1160 % occupy the removed portion
1162 % The format of the MagickChopImage method is:
1164 % MagickBooleanType MagickChopImage(MagickWand *wand,
1165 % const size_t width,const size_t height,const ssize_t x,
1168 % A description of each parameter follows:
1170 % o wand: the magick wand.
1172 % o width: the region width.
1174 % o height: the region height.
1176 % o x: the region x offset.
1178 % o y: the region y offset.
1182 WandExport MagickBooleanType MagickChopImage(MagickWand *wand,
1183 const size_t width,const size_t height,const ssize_t x,
1192 assert(wand != (MagickWand *) NULL);
1193 assert(wand->signature == WandSignature);
1194 if (IfMagickTrue(wand->debug))
1195 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1196 if (wand->images == (Image *) NULL)
1197 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1202 chop_image=ChopImage(wand->images,&chop,wand->exception);
1203 if (chop_image == (Image *) NULL)
1204 return(MagickFalse);
1205 ReplaceImageInList(&wand->images,chop_image);
1210 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1214 % M a g i c k C l a m p I m a g e %
1218 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1220 % MagickClampImage() restricts the color range from 0 to the quantum depth.
1222 % The format of the MagickClampImage method is:
1224 % MagickBooleanType MagickClampImage(MagickWand *wand)
1226 % A description of each parameter follows:
1228 % o wand: the magick wand.
1230 % o channel: the channel.
1233 WandExport MagickBooleanType MagickClampImage(MagickWand *wand)
1235 assert(wand != (MagickWand *) NULL);
1236 assert(wand->signature == WandSignature);
1237 if (IfMagickTrue(wand->debug))
1238 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1239 if (wand->images == (Image *) NULL)
1240 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1241 return(ClampImage(wand->images,wand->exception));
1245 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1249 % M a g i c k C l i p I m a g e %
1253 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1255 % MagickClipImage() clips along the first path from the 8BIM profile, if
1258 % The format of the MagickClipImage method is:
1260 % MagickBooleanType MagickClipImage(MagickWand *wand)
1262 % A description of each parameter follows:
1264 % o wand: the magick wand.
1267 WandExport MagickBooleanType MagickClipImage(MagickWand *wand)
1272 assert(wand != (MagickWand *) NULL);
1273 assert(wand->signature == WandSignature);
1274 if (IfMagickTrue(wand->debug))
1275 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1276 if (wand->images == (Image *) NULL)
1277 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1278 status=ClipImage(wand->images,wand->exception);
1283 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1287 % M a g i c k C l i p I m a g e P a t h %
1291 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1293 % MagickClipImagePath() clips along the named paths from the 8BIM profile, if
1294 % present. Later operations take effect inside the path. Id may be a number
1295 % if preceded with #, to work on a numbered path, e.g., "#1" to use the first
1298 % The format of the MagickClipImagePath method is:
1300 % MagickBooleanType MagickClipImagePath(MagickWand *wand,
1301 % const char *pathname,const MagickBooleanType inside)
1303 % A description of each parameter follows:
1305 % o wand: the magick wand.
1307 % o pathname: name of clipping path resource. If name is preceded by #, use
1308 % clipping path numbered by name.
1310 % o inside: if non-zero, later operations take effect inside clipping path.
1311 % Otherwise later operations take effect outside clipping path.
1314 WandExport MagickBooleanType MagickClipImagePath(MagickWand *wand,
1315 const char *pathname,const MagickBooleanType inside)
1320 assert(wand != (MagickWand *) NULL);
1321 assert(wand->signature == WandSignature);
1322 if (IfMagickTrue(wand->debug))
1323 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1324 if (wand->images == (Image *) NULL)
1325 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1326 status=ClipImagePath(wand->images,pathname,inside,wand->exception);
1331 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1335 % M a g i c k C l u t I m a g e %
1339 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1341 % MagickClutImage() replaces colors in the image from a color lookup table.
1343 % The format of the MagickClutImage method is:
1345 % MagickBooleanType MagickClutImage(MagickWand *wand,
1346 % const MagickWand *clut_wand,const PixelInterpolateMethod method)
1348 % A description of each parameter follows:
1350 % o wand: the magick wand.
1352 % o clut_image: the clut image.
1354 % o method: the pixel interpolation method.
1357 WandExport MagickBooleanType MagickClutImage(MagickWand *wand,
1358 const MagickWand *clut_wand,const PixelInterpolateMethod method)
1363 assert(wand != (MagickWand *) NULL);
1364 assert(wand->signature == WandSignature);
1365 if (IfMagickTrue(wand->debug))
1366 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1367 if ((wand->images == (Image *) NULL) || (clut_wand->images == (Image *) NULL))
1368 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1369 status=ClutImage(wand->images,clut_wand->images,method,wand->exception);
1374 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1378 % M a g i c k C o a l e s c e I m a g e s %
1382 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1384 % MagickCoalesceImages() composites a set of images while respecting any page
1385 % offsets and disposal methods. GIF, MIFF, and MNG animation sequences
1386 % typically start with an image background and each subsequent image
1387 % varies in size and offset. MagickCoalesceImages() returns a new sequence
1388 % where each image in the sequence is the same size as the first and
1389 % composited with the next image in the sequence.
1391 % The format of the MagickCoalesceImages method is:
1393 % MagickWand *MagickCoalesceImages(MagickWand *wand)
1395 % A description of each parameter follows:
1397 % o wand: the magick wand.
1400 WandExport MagickWand *MagickCoalesceImages(MagickWand *wand)
1405 assert(wand != (MagickWand *) NULL);
1406 assert(wand->signature == WandSignature);
1407 if (IfMagickTrue(wand->debug))
1408 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1409 if (wand->images == (Image *) NULL)
1410 return((MagickWand *) NULL);
1411 coalesce_image=CoalesceImages(wand->images,wand->exception);
1412 if (coalesce_image == (Image *) NULL)
1413 return((MagickWand *) NULL);
1414 return(CloneMagickWandFromImages(wand,coalesce_image));
1418 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1422 % M a g i c k C o l o r D e c i s i o n I m a g e %
1426 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1428 % MagickColorDecisionListImage() accepts a lightweight Color Correction
1429 % Collection (CCC) file which solely contains one or more color corrections
1430 % and applies the color correction to the image. Here is a sample CCC file:
1432 % <ColorCorrectionCollection xmlns="urn:ASC:CDL:v1.2">
1433 % <ColorCorrection id="cc03345">
1435 % <Slope> 0.9 1.2 0.5 </Slope>
1436 % <Offset> 0.4 -0.5 0.6 </Offset>
1437 % <Power> 1.0 0.8 1.5 </Power>
1440 % <Saturation> 0.85 </Saturation>
1442 % </ColorCorrection>
1443 % </ColorCorrectionCollection>
1445 % which includes the offset, slope, and power for each of the RGB channels
1446 % as well as the saturation.
1448 % The format of the MagickColorDecisionListImage method is:
1450 % MagickBooleanType MagickColorDecisionListImage(MagickWand *wand,
1451 % const char *color_correction_collection)
1453 % A description of each parameter follows:
1455 % o wand: the magick wand.
1457 % o color_correction_collection: the color correction collection in XML.
1460 WandExport MagickBooleanType MagickColorDecisionListImage(MagickWand *wand,
1461 const char *color_correction_collection)
1466 assert(wand != (MagickWand *) NULL);
1467 assert(wand->signature == WandSignature);
1468 if (IfMagickTrue(wand->debug))
1469 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1470 if (wand->images == (Image *) NULL)
1471 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1472 status=ColorDecisionListImage(wand->images,color_correction_collection,
1478 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1482 % M a g i c k C o l o r i z e I m a g e %
1486 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1488 % MagickColorizeImage() blends the fill color with each pixel in the image.
1490 % The format of the MagickColorizeImage method is:
1492 % MagickBooleanType MagickColorizeImage(MagickWand *wand,
1493 % const PixelWand *colorize,const PixelWand *blend)
1495 % A description of each parameter follows:
1497 % o wand: the magick wand.
1499 % o colorize: the colorize pixel wand.
1501 % o alpha: the alpha pixel wand.
1504 WandExport MagickBooleanType MagickColorizeImage(MagickWand *wand,
1505 const PixelWand *colorize,const PixelWand *blend)
1508 percent_blend[MaxTextExtent];
1516 assert(wand != (MagickWand *) NULL);
1517 assert(wand->signature == WandSignature);
1518 if (IfMagickTrue(wand->debug))
1519 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1520 if (wand->images == (Image *) NULL)
1521 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1522 GetPixelInfo(wand->images,&target);
1523 if (target.colorspace != CMYKColorspace)
1524 (void) FormatLocaleString(percent_blend,MaxTextExtent,
1525 "%g,%g,%g,%g",(double) (100.0*QuantumScale*
1526 PixelGetRedQuantum(blend)),(double) (100.0*QuantumScale*
1527 PixelGetGreenQuantum(blend)),(double) (100.0*QuantumScale*
1528 PixelGetBlueQuantum(blend)),(double) (100.0*QuantumScale*
1529 PixelGetAlphaQuantum(blend)));
1531 (void) FormatLocaleString(percent_blend,MaxTextExtent,
1532 "%g,%g,%g,%g,%g",(double) (100.0*QuantumScale*
1533 PixelGetRedQuantum(blend)),(double) (100.0*QuantumScale*
1534 PixelGetGreenQuantum(blend)),(double) (100.0*QuantumScale*
1535 PixelGetBlueQuantum(blend)),(double) (100.0*QuantumScale*
1536 PixelGetBlackQuantum(blend)),(double) (100.0*QuantumScale*
1537 PixelGetAlphaQuantum(blend)));
1538 target=PixelGetPixel(colorize);
1539 colorize_image=ColorizeImage(wand->images,percent_blend,&target,
1541 if (colorize_image == (Image *) NULL)
1542 return(MagickFalse);
1543 ReplaceImageInList(&wand->images,colorize_image);
1548 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1552 % M a g i c k C o l o r M a t r i x I m a g e %
1556 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1558 % MagickColorMatrixImage() apply color transformation to an image. The method
1559 % permits saturation changes, hue rotation, luminance to alpha, and various
1560 % other effects. Although variable-sized transformation matrices can be used,
1561 % typically one uses a 5x5 matrix for an RGBA image and a 6x6 for CMYKA
1562 % (or RGBA with offsets). The matrix is similar to those used by Adobe Flash
1563 % except offsets are in column 6 rather than 5 (in support of CMYKA images)
1564 % and offsets are normalized (divide Flash offset by 255).
1566 % The format of the MagickColorMatrixImage method is:
1568 % MagickBooleanType MagickColorMatrixImage(MagickWand *wand,
1569 % const KernelInfo *color_matrix)
1571 % A description of each parameter follows:
1573 % o wand: the magick wand.
1575 % o color_matrix: the color matrix.
1578 WandExport MagickBooleanType MagickColorMatrixImage(MagickWand *wand,
1579 const KernelInfo *color_matrix)
1584 assert(wand != (MagickWand *) NULL);
1585 assert(wand->signature == WandSignature);
1586 if (IfMagickTrue(wand->debug))
1587 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1588 if (color_matrix == (const KernelInfo *) NULL)
1589 return(MagickFalse);
1590 if (wand->images == (Image *) NULL)
1591 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1592 color_image=ColorMatrixImage(wand->images,color_matrix,wand->exception);
1593 if (color_image == (Image *) NULL)
1594 return(MagickFalse);
1595 ReplaceImageInList(&wand->images,color_image);
1600 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1604 % M a g i c k C o m b i n e I m a g e s %
1608 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1610 % MagickCombineImages() combines one or more images into a single image. The
1611 % grayscale value of the pixels of each image in the sequence is assigned in
1612 % order to the specified hannels of the combined image. The typical
1613 % ordering would be image 1 => Red, 2 => Green, 3 => Blue, etc.
1615 % The format of the MagickCombineImages method is:
1617 % MagickWand *MagickCombineImages(MagickWand *wand,
1618 % const ColorspaceType colorspace)
1620 % A description of each parameter follows:
1622 % o wand: the magick wand.
1624 % o colorspace: the colorspace.
1627 WandExport MagickWand *MagickCombineImages(MagickWand *wand,
1628 const ColorspaceType colorspace)
1633 assert(wand != (MagickWand *) NULL);
1634 assert(wand->signature == WandSignature);
1635 if (IfMagickTrue(wand->debug))
1636 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1637 if (wand->images == (Image *) NULL)
1638 return((MagickWand *) NULL);
1639 combine_image=CombineImages(wand->images,colorspace,wand->exception);
1640 if (combine_image == (Image *) NULL)
1641 return((MagickWand *) NULL);
1642 return(CloneMagickWandFromImages(wand,combine_image));
1646 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1650 % M a g i c k C o m m e n t I m a g e %
1654 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1656 % MagickCommentImage() adds a comment to your image.
1658 % The format of the MagickCommentImage method is:
1660 % MagickBooleanType MagickCommentImage(MagickWand *wand,
1661 % const char *comment)
1663 % A description of each parameter follows:
1665 % o wand: the magick wand.
1667 % o comment: the image comment.
1670 WandExport MagickBooleanType MagickCommentImage(MagickWand *wand,
1671 const char *comment)
1676 assert(wand != (MagickWand *) NULL);
1677 assert(wand->signature == WandSignature);
1678 if (IfMagickTrue(wand->debug))
1679 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1680 if (wand->images == (Image *) NULL)
1681 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1682 status=SetImageProperty(wand->images,"comment",comment,wand->exception);
1687 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1691 % M a g i c k C o m p a r e I m a g e L a y e r s %
1695 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1697 % MagickCompareImagesLayers() compares each image with the next in a sequence
1698 % and returns the maximum bounding region of any pixel differences it
1701 % The format of the MagickCompareImagesLayers method is:
1703 % MagickWand *MagickCompareImagesLayers(MagickWand *wand,
1704 % const LayerMethod method)
1706 % A description of each parameter follows:
1708 % o wand: the magick wand.
1710 % o method: the compare method.
1713 WandExport MagickWand *MagickCompareImagesLayers(MagickWand *wand,
1714 const LayerMethod method)
1719 assert(wand != (MagickWand *) NULL);
1720 assert(wand->signature == WandSignature);
1721 if (IfMagickTrue(wand->debug))
1722 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1723 if (wand->images == (Image *) NULL)
1724 return((MagickWand *) NULL);
1725 layers_image=CompareImagesLayers(wand->images,method,wand->exception);
1726 if (layers_image == (Image *) NULL)
1727 return((MagickWand *) NULL);
1728 return(CloneMagickWandFromImages(wand,layers_image));
1732 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1736 % M a g i c k C o m p a r e I m a g e s %
1740 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1742 % MagickCompareImages() compares an image to a reconstructed image and returns
1743 % the specified difference image.
1745 % The format of the MagickCompareImages method is:
1747 % MagickWand *MagickCompareImages(MagickWand *wand,
1748 % const MagickWand *reference,const MetricType metric,
1749 % double *distortion)
1751 % A description of each parameter follows:
1753 % o wand: the magick wand.
1755 % o reference: the reference wand.
1757 % o metric: the metric.
1759 % o distortion: the computed distortion between the images.
1762 WandExport MagickWand *MagickCompareImages(MagickWand *wand,
1763 const MagickWand *reference,const MetricType metric,double *distortion)
1769 assert(wand != (MagickWand *) NULL);
1770 assert(wand->signature == WandSignature);
1771 if (IfMagickTrue(wand->debug))
1772 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1773 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
1775 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
1776 "ContainsNoImages","`%s'",wand->name);
1777 return((MagickWand *) NULL);
1779 compare_image=CompareImages(wand->images,reference->images,metric,distortion,
1781 if (compare_image == (Image *) NULL)
1782 return((MagickWand *) NULL);
1783 return(CloneMagickWandFromImages(wand,compare_image));
1787 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1791 % M a g i c k C o m p o s i t e I m a g e %
1795 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1797 % MagickCompositeImage() composite one image onto another at the specified
1800 % The format of the MagickCompositeImage method is:
1802 % MagickBooleanType MagickCompositeImage(MagickWand *wand,
1803 % const MagickWand *source_wand,const CompositeOperator compose,
1804 % const MagickBooleanType clip_to_self,const ssize_t x,const ssize_t y)
1806 % A description of each parameter follows:
1808 % o wand: the magick wand holding the destination images
1810 % o source_image: the magick wand holding source image.
1812 % o compose: This operator affects how the composite is applied to the
1813 % image. The default is Over. These are some of the compose methods
1816 % OverCompositeOp InCompositeOp OutCompositeOp
1817 % AtopCompositeOp XorCompositeOp PlusCompositeOp
1818 % MinusCompositeOp AddCompositeOp SubtractCompositeOp
1819 % DifferenceCompositeOp BumpmapCompositeOp CopyCompositeOp
1820 % DisplaceCompositeOp
1822 % o clip_to_self: set to MagickTrue to limit composition to area composed.
1824 % o x: the column offset of the composited image.
1826 % o y: the row offset of the composited image.
1829 WandExport MagickBooleanType MagickCompositeImage(MagickWand *wand,
1830 const MagickWand *source_wand,const CompositeOperator compose,
1831 const MagickBooleanType clip_to_self,const ssize_t x,const ssize_t y)
1836 assert(wand != (MagickWand *) NULL);
1837 assert(wand->signature == WandSignature);
1838 if (IfMagickTrue(wand->debug))
1839 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1840 if ((wand->images == (Image *) NULL) ||
1841 (source_wand->images == (Image *) NULL))
1842 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1843 status=CompositeImage(wand->images,source_wand->images,compose,clip_to_self,
1844 x,y,wand->exception);
1849 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1853 % M a g i c k C o m p o s i t e L a y e r s %
1857 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1859 % MagickCompositeLayers() composite the images in the source wand over the
1860 % images in the destination wand in sequence, starting with the current
1861 % image in both lists.
1863 % Each layer from the two image lists are composted together until the end of
1864 % one of the image lists is reached. The offset of each composition is also
1865 % adjusted to match the virtual canvas offsets of each layer. As such the
1866 % given offset is relative to the virtual canvas, and not the actual image.
1868 % Composition uses given x and y offsets, as the 'origin' location of the
1869 % source images virtual canvas (not the real image) allowing you to compose a
1870 % list of 'layer images' into the destiantioni images. This makes it well
1871 % sutiable for directly composing 'Clears Frame Animations' or 'Coaleased
1872 % Animations' onto a static or other 'Coaleased Animation' destination image
1873 % list. GIF disposal handling is not looked at.
1875 % Special case:- If one of the image sequences is the last image (just a
1876 % single image remaining), that image is repeatally composed with all the
1877 % images in the other image list. Either the source or destination lists may
1878 % be the single image, for this situation.
1880 % In the case of a single destination image (or last image given), that image
1881 % will ve cloned to match the number of images remaining in the source image
1884 % This is equivelent to the "-layer Composite" Shell API operator.
1886 % The format of the MagickCompositeLayers method is:
1888 % MagickBooleanType MagickCompositeLayers(MagickWand *wand,
1889 % const MagickWand *source_wand, const CompositeOperator compose,
1890 % const ssize_t x,const ssize_t y)
1892 % A description of each parameter follows:
1894 % o wand: the magick wand holding destaintion images
1896 % o source_wand: the wand holding the source images
1898 % o compose, x, y: composition arguments
1901 WandExport MagickBooleanType MagickCompositeLayers(MagickWand *wand,
1902 const MagickWand *source_wand,const CompositeOperator compose,
1903 const ssize_t x,const ssize_t y)
1908 assert(wand != (MagickWand *) NULL);
1909 assert(wand->signature == WandSignature);
1910 if (IfMagickTrue(wand->debug))
1911 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1912 if ((wand->images == (Image *) NULL) ||
1913 (source_wand->images == (Image *) NULL))
1914 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1915 CompositeLayers(wand->images,compose,source_wand->images,x,y,wand->exception);
1916 status=MagickTrue; /* FUTURE: determine status from exceptions */
1921 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1925 % M a g i c k C o n t r a s t I m a g e %
1929 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1931 % MagickContrastImage() enhances the intensity differences between the lighter
1932 % and darker elements of the image. Set sharpen to a value other than 0 to
1933 % increase the image contrast otherwise the contrast is reduced.
1935 % The format of the MagickContrastImage method is:
1937 % MagickBooleanType MagickContrastImage(MagickWand *wand,
1938 % const MagickBooleanType sharpen)
1940 % A description of each parameter follows:
1942 % o wand: the magick wand.
1944 % o sharpen: Increase or decrease image contrast.
1948 WandExport MagickBooleanType MagickContrastImage(MagickWand *wand,
1949 const MagickBooleanType sharpen)
1954 assert(wand != (MagickWand *) NULL);
1955 assert(wand->signature == WandSignature);
1956 if (IfMagickTrue(wand->debug))
1957 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1958 if (wand->images == (Image *) NULL)
1959 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1960 status=ContrastImage(wand->images,sharpen,wand->exception);
1965 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1969 % 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 %
1973 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1975 % MagickContrastStretchImage() enhances the contrast of a color image by
1976 % adjusting the pixels color to span the entire range of colors available.
1977 % You can also reduce the influence of a particular channel with a gamma
1980 % The format of the MagickContrastStretchImage method is:
1982 % MagickBooleanType MagickContrastStretchImage(MagickWand *wand,
1983 % const double black_point,const double white_point)
1985 % A description of each parameter follows:
1987 % o wand: the magick wand.
1989 % o black_point: the black point.
1991 % o white_point: the white point.
1994 WandExport MagickBooleanType MagickContrastStretchImage(MagickWand *wand,
1995 const double black_point,const double white_point)
2000 assert(wand != (MagickWand *) NULL);
2001 assert(wand->signature == WandSignature);
2002 if (IfMagickTrue(wand->debug))
2003 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2004 if (wand->images == (Image *) NULL)
2005 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2006 status=ContrastStretchImage(wand->images,black_point,white_point,
2012 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2016 % M a g i c k C o n v o l v e I m a g e %
2020 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2022 % MagickConvolveImage() applies a custom convolution kernel to the image.
2024 % The format of the MagickConvolveImage method is:
2026 % MagickBooleanType MagickConvolveImage(MagickWand *wand,
2027 % const KernelInfo *kernel)
2029 % A description of each parameter follows:
2031 % o wand: the magick wand.
2033 % o kernel: An array of doubles representing the convolution kernel.
2036 WandExport MagickBooleanType MagickConvolveImage(MagickWand *wand,
2037 const KernelInfo *kernel)
2042 assert(wand != (MagickWand *) NULL);
2043 assert(wand->signature == WandSignature);
2044 if (IfMagickTrue(wand->debug))
2045 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2046 if (kernel == (const KernelInfo *) NULL)
2047 return(MagickFalse);
2048 if (wand->images == (Image *) NULL)
2049 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2050 filter_image=ConvolveImage(wand->images,kernel,wand->exception);
2051 if (filter_image == (Image *) NULL)
2052 return(MagickFalse);
2053 ReplaceImageInList(&wand->images,filter_image);
2058 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2062 % M a g i c k C r o p I m a g e %
2066 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2068 % MagickCropImage() extracts a region of the image.
2070 % The format of the MagickCropImage method is:
2072 % MagickBooleanType MagickCropImage(MagickWand *wand,
2073 % const size_t width,const size_t height,const ssize_t x,const ssize_t y)
2075 % A description of each parameter follows:
2077 % o wand: the magick wand.
2079 % o width: the region width.
2081 % o height: the region height.
2083 % o x: the region x-offset.
2085 % o y: the region y-offset.
2088 WandExport MagickBooleanType MagickCropImage(MagickWand *wand,
2089 const size_t width,const size_t height,const ssize_t x,const ssize_t y)
2097 assert(wand != (MagickWand *) NULL);
2098 assert(wand->signature == WandSignature);
2099 if (IfMagickTrue(wand->debug))
2100 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2101 if (wand->images == (Image *) NULL)
2102 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2107 crop_image=CropImage(wand->images,&crop,wand->exception);
2108 if (crop_image == (Image *) NULL)
2109 return(MagickFalse);
2110 ReplaceImageInList(&wand->images,crop_image);
2115 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2119 % M a g i c k C y c l e C o l o r m a p I m a g e %
2123 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2125 % MagickCycleColormapImage() displaces an image's colormap by a given number
2126 % of positions. If you cycle the colormap a number of times you can produce
2127 % a psychodelic effect.
2129 % The format of the MagickCycleColormapImage method is:
2131 % MagickBooleanType MagickCycleColormapImage(MagickWand *wand,
2132 % const ssize_t displace)
2134 % A description of each parameter follows:
2136 % o wand: the magick wand.
2138 % o pixel_wand: the pixel wand.
2141 WandExport MagickBooleanType MagickCycleColormapImage(MagickWand *wand,
2142 const ssize_t displace)
2147 assert(wand != (MagickWand *) NULL);
2148 assert(wand->signature == WandSignature);
2149 if (IfMagickTrue(wand->debug))
2150 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2151 if (wand->images == (Image *) NULL)
2152 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2153 status=CycleColormapImage(wand->images,displace,wand->exception);
2158 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2162 % M a g i c k C o n s t i t u t e I m a g e %
2166 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2168 % MagickConstituteImage() adds an image to the wand comprised of the pixel
2169 % data you supply. The pixel data must be in scanline order top-to-bottom.
2170 % The data can be char, short int, int, float, or double. Float and double
2171 % require the pixels to be normalized [0..1], otherwise [0..Max], where Max
2172 % is the maximum value the type can accomodate (e.g. 255 for char). For
2173 % example, to create a 640x480 image from unsigned red-green-blue character
2176 % MagickConstituteImage(wand,640,640,"RGB",CharPixel,pixels);
2178 % The format of the MagickConstituteImage method is:
2180 % MagickBooleanType MagickConstituteImage(MagickWand *wand,
2181 % const size_t columns,const size_t rows,const char *map,
2182 % const StorageType storage,void *pixels)
2184 % A description of each parameter follows:
2186 % o wand: the magick wand.
2188 % o columns: width in pixels of the image.
2190 % o rows: height in pixels of the image.
2192 % o map: This string reflects the expected ordering of the pixel array.
2193 % It can be any combination or order of R = red, G = green, B = blue,
2194 % A = alpha (0 is transparent), O = alpha (0 is opaque), C = cyan,
2195 % Y = yellow, M = magenta, K = black, I = intensity (for grayscale),
2198 % o storage: Define the data type of the pixels. Float and double types are
2199 % expected to be normalized [0..1] otherwise [0..QuantumRange]. Choose from
2200 % these types: CharPixel, DoublePixel, FloatPixel, IntegerPixel,
2201 % LongPixel, QuantumPixel, or ShortPixel.
2203 % o pixels: This array of values contain the pixel components as defined by
2204 % map and type. You must preallocate this array where the expected
2205 % length varies depending on the values of width, height, map, and type.
2209 WandExport MagickBooleanType MagickConstituteImage(MagickWand *wand,
2210 const size_t columns,const size_t rows,const char *map,
2211 const StorageType storage,const void *pixels)
2216 assert(wand != (MagickWand *) NULL);
2217 assert(wand->signature == WandSignature);
2218 if (IfMagickTrue(wand->debug))
2219 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2220 images=ConstituteImage(columns,rows,map,storage,pixels,wand->exception);
2221 if (images == (Image *) NULL)
2222 return(MagickFalse);
2223 return(InsertImageInWand(wand,images));
2227 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2231 % M a g i c k D e c i p h e r I m a g e %
2235 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2237 % MagickDecipherImage() converts cipher pixels to plain pixels.
2239 % The format of the MagickDecipherImage method is:
2241 % MagickBooleanType MagickDecipherImage(MagickWand *wand,
2242 % const char *passphrase)
2244 % A description of each parameter follows:
2246 % o wand: the magick wand.
2248 % o passphrase: the passphrase.
2251 WandExport MagickBooleanType MagickDecipherImage(MagickWand *wand,
2252 const char *passphrase)
2254 assert(wand != (MagickWand *) NULL);
2255 assert(wand->signature == WandSignature);
2256 if (IfMagickTrue(wand->debug))
2257 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2258 if (wand->images == (Image *) NULL)
2259 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2260 return(DecipherImage(wand->images,passphrase,wand->exception));
2264 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2268 % M a g i c k D e c o n s t r u c t I m a g e s %
2272 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2274 % MagickDeconstructImages() compares each image with the next in a sequence
2275 % and returns the maximum bounding region of any pixel differences it
2278 % The format of the MagickDeconstructImages method is:
2280 % MagickWand *MagickDeconstructImages(MagickWand *wand)
2282 % A description of each parameter follows:
2284 % o wand: the magick wand.
2287 WandExport MagickWand *MagickDeconstructImages(MagickWand *wand)
2292 assert(wand != (MagickWand *) NULL);
2293 assert(wand->signature == WandSignature);
2294 if (IfMagickTrue(wand->debug))
2295 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2296 if (wand->images == (Image *) NULL)
2297 return((MagickWand *) NULL);
2298 deconstruct_image=CompareImagesLayers(wand->images,CompareAnyLayer,
2300 if (deconstruct_image == (Image *) NULL)
2301 return((MagickWand *) NULL);
2302 return(CloneMagickWandFromImages(wand,deconstruct_image));
2306 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2310 % M a g i c k D e s k e w I m a g e %
2314 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2316 % MagickDeskewImage() removes skew from the image. Skew is an artifact that
2317 % occurs in scanned images because of the camera being misaligned,
2318 % imperfections in the scanning or surface, or simply because the paper was
2319 % not placed completely flat when scanned.
2321 % The format of the MagickDeskewImage method is:
2323 % MagickBooleanType MagickDeskewImage(MagickWand *wand,
2324 % const double threshold)
2326 % A description of each parameter follows:
2328 % o wand: the magick wand.
2330 % o threshold: separate background from foreground.
2333 WandExport MagickBooleanType MagickDeskewImage(MagickWand *wand,
2334 const double threshold)
2339 assert(wand != (MagickWand *) NULL);
2340 assert(wand->signature == WandSignature);
2341 if (IfMagickTrue(wand->debug))
2342 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2343 if (wand->images == (Image *) NULL)
2344 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2345 sepia_image=DeskewImage(wand->images,threshold,wand->exception);
2346 if (sepia_image == (Image *) NULL)
2347 return(MagickFalse);
2348 ReplaceImageInList(&wand->images,sepia_image);
2353 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2357 % M a g i c k D e s p e c k l e I m a g e %
2361 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2363 % MagickDespeckleImage() reduces the speckle noise in an image while
2364 % perserving the edges of the original image.
2366 % The format of the MagickDespeckleImage method is:
2368 % MagickBooleanType MagickDespeckleImage(MagickWand *wand)
2370 % A description of each parameter follows:
2372 % o wand: the magick wand.
2375 WandExport MagickBooleanType MagickDespeckleImage(MagickWand *wand)
2380 assert(wand != (MagickWand *) NULL);
2381 assert(wand->signature == WandSignature);
2382 if (IfMagickTrue(wand->debug))
2383 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2384 if (wand->images == (Image *) NULL)
2385 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2386 despeckle_image=DespeckleImage(wand->images,wand->exception);
2387 if (despeckle_image == (Image *) NULL)
2388 return(MagickFalse);
2389 ReplaceImageInList(&wand->images,despeckle_image);
2394 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2398 % M a g i c k D e s t r o y I m a g e %
2402 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2404 % MagickDestroyImage() dereferences an image, deallocating memory associated
2405 % with the image if the reference count becomes zero.
2407 % The format of the MagickDestroyImage method is:
2409 % Image *MagickDestroyImage(Image *image)
2411 % A description of each parameter follows:
2413 % o image: the image.
2416 WandExport Image *MagickDestroyImage(Image *image)
2418 return(DestroyImage(image));
2422 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2426 % M a g i c k D i s p l a y I m a g e %
2430 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2432 % MagickDisplayImage() displays an image.
2434 % The format of the MagickDisplayImage method is:
2436 % MagickBooleanType MagickDisplayImage(MagickWand *wand,
2437 % const char *server_name)
2439 % A description of each parameter follows:
2441 % o wand: the magick wand.
2443 % o server_name: the X server name.
2446 WandExport MagickBooleanType MagickDisplayImage(MagickWand *wand,
2447 const char *server_name)
2455 assert(wand != (MagickWand *) NULL);
2456 assert(wand->signature == WandSignature);
2457 if (IfMagickTrue(wand->debug))
2458 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2459 if (wand->images == (Image *) NULL)
2460 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2461 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
2462 if (image == (Image *) NULL)
2463 return(MagickFalse);
2464 (void) CloneString(&wand->image_info->server_name,server_name);
2465 status=DisplayImages(wand->image_info,image,wand->exception);
2466 image=DestroyImage(image);
2471 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2475 % M a g i c k D i s p l a y I m a g e s %
2479 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2481 % MagickDisplayImages() displays an image or image sequence.
2483 % The format of the MagickDisplayImages method is:
2485 % MagickBooleanType MagickDisplayImages(MagickWand *wand,
2486 % const char *server_name)
2488 % A description of each parameter follows:
2490 % o wand: the magick wand.
2492 % o server_name: the X server name.
2495 WandExport MagickBooleanType MagickDisplayImages(MagickWand *wand,
2496 const char *server_name)
2501 assert(wand != (MagickWand *) NULL);
2502 assert(wand->signature == WandSignature);
2503 if (IfMagickTrue(wand->debug))
2504 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2505 (void) CloneString(&wand->image_info->server_name,server_name);
2506 status=DisplayImages(wand->image_info,wand->images,wand->exception);
2511 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2515 % M a g i c k D i s t o r t I m a g e %
2519 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2521 % MagickDistortImage() distorts an image using various distortion methods, by
2522 % mapping color lookups of the source image to a new destination image
2523 % usally of the same size as the source image, unless 'bestfit' is set to
2526 % If 'bestfit' is enabled, and distortion allows it, the destination image is
2527 % adjusted to ensure the whole source 'image' will just fit within the final
2528 % destination image, which will be sized and offset accordingly. Also in
2529 % many cases the virtual offset of the source image will be taken into
2530 % account in the mapping.
2532 % The format of the MagickDistortImage method is:
2534 % MagickBooleanType MagickDistortImage(MagickWand *wand,
2535 % const DistortImageMethod method,const size_t number_arguments,
2536 % const double *arguments,const MagickBooleanType bestfit)
2538 % A description of each parameter follows:
2540 % o image: the image to be distorted.
2542 % o method: the method of image distortion.
2544 % ArcDistortion always ignores the source image offset, and always
2545 % 'bestfit' the destination image with the top left corner offset
2546 % relative to the polar mapping center.
2548 % Bilinear has no simple inverse mapping so it does not allow 'bestfit'
2549 % style of image distortion.
2551 % Affine, Perspective, and Bilinear, do least squares fitting of the
2552 % distortion when more than the minimum number of control point pairs
2555 % Perspective, and Bilinear, falls back to a Affine distortion when less
2556 % that 4 control point pairs are provided. While Affine distortions let
2557 % you use any number of control point pairs, that is Zero pairs is a
2558 % no-Op (viewport only) distrotion, one pair is a translation and two
2559 % pairs of control points do a scale-rotate-translate, without any
2562 % o number_arguments: the number of arguments given for this distortion
2565 % o arguments: the arguments for this distortion method.
2567 % o bestfit: Attempt to resize destination to fit distorted source.
2570 WandExport MagickBooleanType MagickDistortImage(MagickWand *wand,
2571 const DistortImageMethod method,const size_t number_arguments,
2572 const double *arguments,const MagickBooleanType bestfit)
2577 assert(wand != (MagickWand *) NULL);
2578 assert(wand->signature == WandSignature);
2579 if (IfMagickTrue(wand->debug))
2580 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2581 if (wand->images == (Image *) NULL)
2582 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2583 distort_image=DistortImage(wand->images,method,number_arguments,arguments,
2584 bestfit,wand->exception);
2585 if (distort_image == (Image *) NULL)
2586 return(MagickFalse);
2587 ReplaceImageInList(&wand->images,distort_image);
2592 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2596 % M a g i c k D r a w I m a g e %
2600 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2602 % MagickDrawImage() renders the drawing wand on the current image.
2604 % The format of the MagickDrawImage method is:
2606 % MagickBooleanType MagickDrawImage(MagickWand *wand,
2607 % const DrawingWand *drawing_wand)
2609 % A description of each parameter follows:
2611 % o wand: the magick wand.
2613 % o drawing_wand: the draw wand.
2616 WandExport MagickBooleanType MagickDrawImage(MagickWand *wand,
2617 const DrawingWand *drawing_wand)
2628 assert(wand != (MagickWand *) NULL);
2629 assert(wand->signature == WandSignature);
2630 if (IfMagickTrue(wand->debug))
2631 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2632 if (wand->images == (Image *) NULL)
2633 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2634 draw_info=PeekDrawingWand(drawing_wand);
2635 if ((draw_info == (DrawInfo *) NULL) ||
2636 (draw_info->primitive == (char *) NULL))
2637 return(MagickFalse);
2638 primitive=AcquireString(draw_info->primitive);
2639 draw_info=DestroyDrawInfo(draw_info);
2640 draw_info=CloneDrawInfo(wand->image_info,(DrawInfo *) NULL);
2641 draw_info->primitive=primitive;
2642 status=DrawImage(wand->images,draw_info,wand->exception);
2643 draw_info=DestroyDrawInfo(draw_info);
2648 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2652 % M a g i c k E d g e I m a g e %
2656 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2658 % MagickEdgeImage() enhance edges within the image with a convolution filter
2659 % of the given radius. Use a radius of 0 and Edge() selects a suitable
2662 % The format of the MagickEdgeImage method is:
2664 % MagickBooleanType MagickEdgeImage(MagickWand *wand,const double radius)
2666 % A description of each parameter follows:
2668 % o wand: the magick wand.
2670 % o radius: the radius of the pixel neighborhood.
2673 WandExport MagickBooleanType MagickEdgeImage(MagickWand *wand,
2674 const double radius)
2679 assert(wand != (MagickWand *) NULL);
2680 assert(wand->signature == WandSignature);
2681 if (IfMagickTrue(wand->debug))
2682 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2683 if (wand->images == (Image *) NULL)
2684 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2685 edge_image=EdgeImage(wand->images,radius,wand->exception);
2686 if (edge_image == (Image *) NULL)
2687 return(MagickFalse);
2688 ReplaceImageInList(&wand->images,edge_image);
2693 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2697 % M a g i c k E m b o s s I m a g e %
2701 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2703 % MagickEmbossImage() returns a grayscale image with a three-dimensional
2704 % effect. We convolve the image with a Gaussian operator of the given radius
2705 % and standard deviation (sigma). For reasonable results, radius should be
2706 % larger than sigma. Use a radius of 0 and Emboss() selects a suitable
2709 % The format of the MagickEmbossImage method is:
2711 % MagickBooleanType MagickEmbossImage(MagickWand *wand,const double radius,
2712 % const double sigma)
2714 % A description of each parameter follows:
2716 % o wand: the magick wand.
2718 % o radius: the radius of the Gaussian, in pixels, not counting the center
2721 % o sigma: the standard deviation of the Gaussian, in pixels.
2724 WandExport MagickBooleanType MagickEmbossImage(MagickWand *wand,
2725 const double radius,const double sigma)
2730 assert(wand != (MagickWand *) NULL);
2731 assert(wand->signature == WandSignature);
2732 if (IfMagickTrue(wand->debug))
2733 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2734 if (wand->images == (Image *) NULL)
2735 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2736 emboss_image=EmbossImage(wand->images,radius,sigma,wand->exception);
2737 if (emboss_image == (Image *) NULL)
2738 return(MagickFalse);
2739 ReplaceImageInList(&wand->images,emboss_image);
2744 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2748 % M a g i c k E n c i p h e r I m a g e %
2752 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2754 % MagickEncipherImage() converts plaint pixels to cipher pixels.
2756 % The format of the MagickEncipherImage method is:
2758 % MagickBooleanType MagickEncipherImage(MagickWand *wand,
2759 % const char *passphrase)
2761 % A description of each parameter follows:
2763 % o wand: the magick wand.
2765 % o passphrase: the passphrase.
2768 WandExport MagickBooleanType MagickEncipherImage(MagickWand *wand,
2769 const char *passphrase)
2771 assert(wand != (MagickWand *) NULL);
2772 assert(wand->signature == WandSignature);
2773 if (IfMagickTrue(wand->debug))
2774 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2775 if (wand->images == (Image *) NULL)
2776 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2777 return(EncipherImage(wand->images,passphrase,wand->exception));
2781 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2785 % M a g i c k E n h a n c e I m a g e %
2789 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2791 % MagickEnhanceImage() applies a digital filter that improves the quality of a
2794 % The format of the MagickEnhanceImage method is:
2796 % MagickBooleanType MagickEnhanceImage(MagickWand *wand)
2798 % A description of each parameter follows:
2800 % o wand: the magick wand.
2803 WandExport MagickBooleanType MagickEnhanceImage(MagickWand *wand)
2808 assert(wand != (MagickWand *) NULL);
2809 assert(wand->signature == WandSignature);
2810 if (IfMagickTrue(wand->debug))
2811 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2812 if (wand->images == (Image *) NULL)
2813 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2814 enhance_image=EnhanceImage(wand->images,wand->exception);
2815 if (enhance_image == (Image *) NULL)
2816 return(MagickFalse);
2817 ReplaceImageInList(&wand->images,enhance_image);
2822 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2826 % M a g i c k E q u a l i z e I m a g e %
2830 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2832 % MagickEqualizeImage() equalizes the image histogram.
2834 % The format of the MagickEqualizeImage method is:
2836 % MagickBooleanType MagickEqualizeImage(MagickWand *wand)
2838 % A description of each parameter follows:
2840 % o wand: the magick wand.
2842 % o channel: the image channel(s).
2845 WandExport MagickBooleanType MagickEqualizeImage(MagickWand *wand)
2850 assert(wand != (MagickWand *) NULL);
2851 assert(wand->signature == WandSignature);
2852 if (IfMagickTrue(wand->debug))
2853 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2854 if (wand->images == (Image *) NULL)
2855 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2856 status=EqualizeImage(wand->images,wand->exception);
2861 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2865 % M a g i c k E v a l u a t e I m a g e %
2869 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2871 % MagickEvaluateImage() applys an arithmetic, relational, or logical
2872 % expression to an image. Use these operators to lighten or darken an image,
2873 % to increase or decrease contrast in an image, or to produce the "negative"
2876 % The format of the MagickEvaluateImage method is:
2878 % MagickBooleanType MagickEvaluateImage(MagickWand *wand,
2879 % const MagickEvaluateOperator operator,const double value)
2880 % MagickBooleanType MagickEvaluateImages(MagickWand *wand,
2881 % const MagickEvaluateOperator operator)
2883 % A description of each parameter follows:
2885 % o wand: the magick wand.
2887 % o op: A channel operator.
2889 % o value: A value value.
2893 WandExport MagickWand *MagickEvaluateImages(MagickWand *wand,
2894 const MagickEvaluateOperator op)
2899 assert(wand != (MagickWand *) NULL);
2900 assert(wand->signature == WandSignature);
2901 if (IfMagickTrue(wand->debug))
2902 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2903 if (wand->images == (Image *) NULL)
2904 return((MagickWand *) NULL);
2905 evaluate_image=EvaluateImages(wand->images,op,wand->exception);
2906 if (evaluate_image == (Image *) NULL)
2907 return((MagickWand *) NULL);
2908 return(CloneMagickWandFromImages(wand,evaluate_image));
2911 WandExport MagickBooleanType MagickEvaluateImage(MagickWand *wand,
2912 const MagickEvaluateOperator op,const double value)
2917 assert(wand != (MagickWand *) NULL);
2918 assert(wand->signature == WandSignature);
2919 if (IfMagickTrue(wand->debug))
2920 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2921 if (wand->images == (Image *) NULL)
2922 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2923 status=EvaluateImage(wand->images,op,value,wand->exception);
2928 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2932 % M a g i c k E x p o r t I m a g e P i x e l s %
2936 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2938 % MagickExportImagePixels() extracts pixel data from an image and returns it
2939 % to you. The method returns MagickTrue on success otherwise MagickFalse if
2940 % an error is encountered. The data is returned as char, short int, int,
2941 % ssize_t, float, or double in the order specified by map.
2943 % Suppose you want to extract the first scanline of a 640x480 image as
2944 % character data in red-green-blue order:
2946 % MagickExportImagePixels(wand,0,0,640,1,"RGB",CharPixel,pixels);
2948 % The format of the MagickExportImagePixels method is:
2950 % MagickBooleanType MagickExportImagePixels(MagickWand *wand,
2951 % const ssize_t x,const ssize_t y,const size_t columns,
2952 % const size_t rows,const char *map,const StorageType storage,
2955 % A description of each parameter follows:
2957 % o wand: the magick wand.
2959 % o x, y, columns, rows: These values define the perimeter
2960 % of a region of pixels you want to extract.
2962 % o map: This string reflects the expected ordering of the pixel array.
2963 % It can be any combination or order of R = red, G = green, B = blue,
2964 % A = alpha (0 is transparent), O = alpha (0 is opaque), C = cyan,
2965 % Y = yellow, M = magenta, K = black, I = intensity (for grayscale),
2968 % o storage: Define the data type of the pixels. Float and double types are
2969 % expected to be normalized [0..1] otherwise [0..QuantumRange]. Choose from
2970 % these types: CharPixel, DoublePixel, FloatPixel, IntegerPixel,
2971 % LongPixel, QuantumPixel, or ShortPixel.
2973 % o pixels: This array of values contain the pixel components as defined by
2974 % map and type. You must preallocate this array where the expected
2975 % length varies depending on the values of width, height, map, and type.
2978 WandExport MagickBooleanType MagickExportImagePixels(MagickWand *wand,
2979 const ssize_t x,const ssize_t y,const size_t columns,
2980 const size_t rows,const char *map,const StorageType storage,
2986 assert(wand != (MagickWand *) NULL);
2987 assert(wand->signature == WandSignature);
2988 if (IfMagickTrue(wand->debug))
2989 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2990 if (wand->images == (Image *) NULL)
2991 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2992 status=ExportImagePixels(wand->images,x,y,columns,rows,map,
2993 storage,pixels,wand->exception);
2998 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3002 % M a g i c k E x t e n t I m a g e %
3006 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3008 % MagickExtentImage() extends the image as defined by the geometry, gravity,
3009 % and wand background color. Set the (x,y) offset of the geometry to move
3010 % the original wand relative to the extended wand.
3012 % The format of the MagickExtentImage method is:
3014 % MagickBooleanType MagickExtentImage(MagickWand *wand,const size_t width,
3015 % const size_t height,const ssize_t x,const ssize_t y)
3017 % A description of each parameter follows:
3019 % o wand: the magick wand.
3021 % o width: the region width.
3023 % o height: the region height.
3025 % o x: the region x offset.
3027 % o y: the region y offset.
3030 WandExport MagickBooleanType MagickExtentImage(MagickWand *wand,
3031 const size_t width,const size_t height,const ssize_t x,const ssize_t y)
3039 assert(wand != (MagickWand *) NULL);
3040 assert(wand->signature == WandSignature);
3041 if (IfMagickTrue(wand->debug))
3042 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3043 if (wand->images == (Image *) NULL)
3044 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3046 extent.height=height;
3049 extent_image=ExtentImage(wand->images,&extent,wand->exception);
3050 if (extent_image == (Image *) NULL)
3051 return(MagickFalse);
3052 ReplaceImageInList(&wand->images,extent_image);
3057 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3061 % M a g i c k F l i p I m a g e %
3065 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3067 % MagickFlipImage() creates a vertical mirror image by reflecting the pixels
3068 % around the central x-axis.
3070 % The format of the MagickFlipImage method is:
3072 % MagickBooleanType MagickFlipImage(MagickWand *wand)
3074 % A description of each parameter follows:
3076 % o wand: the magick wand.
3079 WandExport MagickBooleanType MagickFlipImage(MagickWand *wand)
3084 assert(wand != (MagickWand *) NULL);
3085 assert(wand->signature == WandSignature);
3086 if (IfMagickTrue(wand->debug))
3087 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3088 if (wand->images == (Image *) NULL)
3089 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3090 flip_image=FlipImage(wand->images,wand->exception);
3091 if (flip_image == (Image *) NULL)
3092 return(MagickFalse);
3093 ReplaceImageInList(&wand->images,flip_image);
3098 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3102 % 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 %
3106 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3108 % MagickFloodfillPaintImage() changes the color value of any pixel that matches
3109 % target and is an immediate neighbor. If the method FillToBorderMethod is
3110 % specified, the color value is changed for any neighbor pixel that does not
3111 % match the bordercolor member of image.
3113 % The format of the MagickFloodfillPaintImage method is:
3115 % MagickBooleanType MagickFloodfillPaintImage(MagickWand *wand,
3116 % const PixelWand *fill,const double fuzz,const PixelWand *bordercolor,
3117 % const ssize_t x,const ssize_t y,const MagickBooleanType invert)
3119 % A description of each parameter follows:
3121 % o wand: the magick wand.
3123 % o fill: the floodfill color pixel wand.
3125 % o fuzz: By default target must match a particular pixel color
3126 % exactly. However, in many cases two colors may differ by a small amount.
3127 % The fuzz member of image defines how much tolerance is acceptable to
3128 % consider two colors as the same. For example, set fuzz to 10 and the
3129 % color red at intensities of 100 and 102 respectively are now interpreted
3130 % as the same color for the purposes of the floodfill.
3132 % o bordercolor: the border color pixel wand.
3134 % o x,y: the starting location of the operation.
3136 % o invert: paint any pixel that does not match the target color.
3139 WandExport MagickBooleanType MagickFloodfillPaintImage(MagickWand *wand,
3140 const PixelWand *fill,const double fuzz,const PixelWand *bordercolor,
3141 const ssize_t x,const ssize_t y,const MagickBooleanType invert)
3152 assert(wand != (MagickWand *) NULL);
3153 assert(wand->signature == WandSignature);
3154 if (IfMagickTrue(wand->debug))
3155 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3156 if (wand->images == (Image *) NULL)
3157 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3158 draw_info=CloneDrawInfo(wand->image_info,(DrawInfo *) NULL);
3159 PixelGetQuantumPacket(fill,&draw_info->fill);
3160 (void) GetOneVirtualPixelInfo(wand->images,TileVirtualPixelMethod,x %
3161 wand->images->columns,y % wand->images->rows,&target,wand->exception);
3162 if (bordercolor != (PixelWand *) NULL)
3163 PixelGetMagickColor(bordercolor,&target);
3164 wand->images->fuzz=fuzz;
3165 status=FloodfillPaintImage(wand->images,draw_info,&target,x,y,invert,
3167 draw_info=DestroyDrawInfo(draw_info);
3172 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3176 % M a g i c k F l o p I m a g e %
3180 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3182 % MagickFlopImage() creates a horizontal mirror image by reflecting the pixels
3183 % around the central y-axis.
3185 % The format of the MagickFlopImage method is:
3187 % MagickBooleanType MagickFlopImage(MagickWand *wand)
3189 % A description of each parameter follows:
3191 % o wand: the magick wand.
3194 WandExport MagickBooleanType MagickFlopImage(MagickWand *wand)
3199 assert(wand != (MagickWand *) NULL);
3200 assert(wand->signature == WandSignature);
3201 if (IfMagickTrue(wand->debug))
3202 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3203 if (wand->images == (Image *) NULL)
3204 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3205 flop_image=FlopImage(wand->images,wand->exception);
3206 if (flop_image == (Image *) NULL)
3207 return(MagickFalse);
3208 ReplaceImageInList(&wand->images,flop_image);
3213 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3217 % 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 %
3221 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3223 % MagickForwardFourierTransformImage() implements the discrete Fourier
3224 % transform (DFT) of the image either as a magnitude / phase or real /
3225 % imaginary image pair.
3227 % The format of the MagickForwardFourierTransformImage method is:
3229 % MagickBooleanType MagickForwardFourierTransformImage(MagickWand *wand,
3230 % const MagickBooleanType magnitude)
3232 % A description of each parameter follows:
3234 % o wand: the magick wand.
3236 % o magnitude: if true, return as magnitude / phase pair otherwise a real /
3237 % imaginary image pair.
3240 WandExport MagickBooleanType MagickForwardFourierTransformImage(
3241 MagickWand *wand,const MagickBooleanType magnitude)
3246 assert(wand != (MagickWand *) NULL);
3247 assert(wand->signature == WandSignature);
3248 if (IfMagickTrue(wand->debug))
3249 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3250 if (wand->images == (Image *) NULL)
3251 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3252 forward_image=ForwardFourierTransformImage(wand->images,magnitude,
3254 if (forward_image == (Image *) NULL)
3255 return(MagickFalse);
3256 ReplaceImageInList(&wand->images,forward_image);
3261 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3265 % M a g i c k F r a m e I m a g e %
3269 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3271 % MagickFrameImage() adds a simulated three-dimensional border around the
3272 % image. The width and height specify the border width of the vertical and
3273 % horizontal sides of the frame. The inner and outer bevels indicate the
3274 % width of the inner and outer shadows of the frame.
3276 % The format of the MagickFrameImage method is:
3278 % MagickBooleanType MagickFrameImage(MagickWand *wand,
3279 % const PixelWand *matte_color,const size_t width,
3280 % const size_t height,const ssize_t inner_bevel,
3281 % const ssize_t outer_bevel,const CompositeOperator compose)
3283 % A description of each parameter follows:
3285 % o wand: the magick wand.
3287 % o matte_color: the frame color pixel wand.
3289 % o width: the border width.
3291 % o height: the border height.
3293 % o inner_bevel: the inner bevel width.
3295 % o outer_bevel: the outer bevel width.
3297 % o compose: the composite operator.
3300 WandExport MagickBooleanType MagickFrameImage(MagickWand *wand,
3301 const PixelWand *matte_color,const size_t width,const size_t height,
3302 const ssize_t inner_bevel,const ssize_t outer_bevel,
3303 const CompositeOperator compose)
3311 assert(wand != (MagickWand *) NULL);
3312 assert(wand->signature == WandSignature);
3313 if (IfMagickTrue(wand->debug))
3314 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3315 if (wand->images == (Image *) NULL)
3316 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3317 (void) ResetMagickMemory(&frame_info,0,sizeof(frame_info));
3318 frame_info.width=wand->images->columns+2*width;
3319 frame_info.height=wand->images->rows+2*height;
3320 frame_info.x=(ssize_t) width;
3321 frame_info.y=(ssize_t) height;
3322 frame_info.inner_bevel=inner_bevel;
3323 frame_info.outer_bevel=outer_bevel;
3324 PixelGetQuantumPacket(matte_color,&wand->images->matte_color);
3325 frame_image=FrameImage(wand->images,&frame_info,compose,wand->exception);
3326 if (frame_image == (Image *) NULL)
3327 return(MagickFalse);
3328 ReplaceImageInList(&wand->images,frame_image);
3333 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3337 % M a g i c k F u n c t i o n I m a g e %
3341 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3343 % MagickFunctionImage() applys an arithmetic, relational, or logical
3344 % expression to an image. Use these operators to lighten or darken an image,
3345 % to increase or decrease contrast in an image, or to produce the "negative"
3348 % The format of the MagickFunctionImage method is:
3350 % MagickBooleanType MagickFunctionImage(MagickWand *wand,
3351 % const MagickFunction function,const size_t number_arguments,
3352 % const double *arguments)
3354 % A description of each parameter follows:
3356 % o wand: the magick wand.
3358 % o function: the image function.
3360 % o number_arguments: the number of function arguments.
3362 % o arguments: the function arguments.
3365 WandExport MagickBooleanType MagickFunctionImage(MagickWand *wand,
3366 const MagickFunction function,const size_t number_arguments,
3367 const double *arguments)
3372 assert(wand != (MagickWand *) NULL);
3373 assert(wand->signature == WandSignature);
3374 if (IfMagickTrue(wand->debug))
3375 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3376 if (wand->images == (Image *) NULL)
3377 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3378 status=FunctionImage(wand->images,function,number_arguments,arguments,
3384 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3388 % M a g i c k F x I m a g e %
3392 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3394 % MagickFxImage() evaluate expression for each pixel in the image.
3396 % The format of the MagickFxImage method is:
3398 % MagickWand *MagickFxImage(MagickWand *wand,const char *expression)
3400 % A description of each parameter follows:
3402 % o wand: the magick wand.
3404 % o expression: the expression.
3407 WandExport MagickWand *MagickFxImage(MagickWand *wand,const char *expression)
3412 assert(wand != (MagickWand *) NULL);
3413 assert(wand->signature == WandSignature);
3414 if (IfMagickTrue(wand->debug))
3415 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3416 if (wand->images == (Image *) NULL)
3417 return((MagickWand *) NULL);
3418 fx_image=FxImage(wand->images,expression,wand->exception);
3419 if (fx_image == (Image *) NULL)
3420 return((MagickWand *) NULL);
3421 return(CloneMagickWandFromImages(wand,fx_image));
3425 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3429 % M a g i c k G a m m a I m a g e %
3433 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3435 % MagickGammaImage() gamma-corrects an image. The same image viewed on
3436 % different devices will have perceptual differences in the way the image's
3437 % intensities are represented on the screen. Specify individual gamma levels
3438 % for the red, green, and blue channels, or adjust all three with the gamma
3439 % parameter. Values typically range from 0.8 to 2.3.
3441 % You can also reduce the influence of a particular channel with a gamma
3444 % The format of the MagickGammaImage method is:
3446 % MagickBooleanType MagickGammaImage(MagickWand *wand,const double gamma)
3448 % A description of each parameter follows:
3450 % o wand: the magick wand.
3452 % o level: Define the level of gamma correction.
3455 WandExport MagickBooleanType MagickGammaImage(MagickWand *wand,
3461 assert(wand != (MagickWand *) NULL);
3462 assert(wand->signature == WandSignature);
3463 if (IfMagickTrue(wand->debug))
3464 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3465 if (wand->images == (Image *) NULL)
3466 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3467 status=GammaImage(wand->images,gamma,wand->exception);
3472 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3476 % M a g i c k G a u s s i a n B l u r I m a g e %
3480 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3482 % MagickGaussianBlurImage() blurs an image. We convolve the image with a
3483 % Gaussian operator of the given radius and standard deviation (sigma).
3484 % For reasonable results, the radius should be larger than sigma. Use a
3485 % radius of 0 and MagickGaussianBlurImage() selects a suitable radius for you.
3487 % The format of the MagickGaussianBlurImage method is:
3489 % MagickBooleanType MagickGaussianBlurImage(MagickWand *wand,
3490 % const double radius,const double sigma)
3492 % A description of each parameter follows:
3494 % o wand: the magick wand.
3496 % o radius: the radius of the Gaussian, in pixels, not counting the center
3499 % o sigma: the standard deviation of the Gaussian, in pixels.
3502 WandExport MagickBooleanType MagickGaussianBlurImage(MagickWand *wand,
3503 const double radius,const double sigma)
3508 assert(wand != (MagickWand *) NULL);
3509 assert(wand->signature == WandSignature);
3510 if (IfMagickTrue(wand->debug))
3511 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3512 if (wand->images == (Image *) NULL)
3513 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3514 blur_image=GaussianBlurImage(wand->images,radius,sigma,wand->exception);
3515 if (blur_image == (Image *) NULL)
3516 return(MagickFalse);
3517 ReplaceImageInList(&wand->images,blur_image);
3522 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3526 % M a g i c k G e t I m a g e %
3530 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3532 % MagickGetImage() gets the image at the current image index.
3534 % The format of the MagickGetImage method is:
3536 % MagickWand *MagickGetImage(MagickWand *wand)
3538 % A description of each parameter follows:
3540 % o wand: the magick wand.
3543 WandExport MagickWand *MagickGetImage(MagickWand *wand)
3548 assert(wand != (MagickWand *) NULL);
3549 assert(wand->signature == WandSignature);
3550 if (IfMagickTrue(wand->debug))
3551 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3552 if (wand->images == (Image *) NULL)
3554 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3555 "ContainsNoImages","`%s'",wand->name);
3556 return((MagickWand *) NULL);
3558 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
3559 if (image == (Image *) NULL)
3560 return((MagickWand *) NULL);
3561 return(CloneMagickWandFromImages(wand,image));
3565 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3569 % 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 %
3573 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3575 % MagickGetImageAlphaChannel() returns MagickFalse if the image alpha channel
3576 % is not activated. That is, the image is RGB rather than RGBA or CMYK rather
3579 % The format of the MagickGetImageAlphaChannel method is:
3581 % size_t MagickGetImageAlphaChannel(MagickWand *wand)
3583 % A description of each parameter follows:
3585 % o wand: the magick wand.
3588 WandExport MagickBooleanType MagickGetImageAlphaChannel(MagickWand *wand)
3590 assert(wand != (MagickWand *) NULL);
3591 assert(wand->signature == WandSignature);
3592 if (IfMagickTrue(wand->debug))
3593 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3594 if (wand->images == (Image *) NULL)
3595 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3596 return(GetImageAlphaChannel(wand->images));
3600 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3604 % M a g i c k G e t I m a g e C l i p M a s k %
3608 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3610 % MagickGetImageMask() gets the image clip mask at the current image index.
3612 % The format of the MagickGetImageMask method is:
3614 % MagickWand *MagickGetImageMask(MagickWand *wand)
3616 % A description of each parameter follows:
3618 % o wand: the magick wand.
3621 WandExport MagickWand *MagickGetImageMask(MagickWand *wand)
3626 assert(wand != (MagickWand *) NULL);
3627 assert(wand->signature == WandSignature);
3628 if (IfMagickTrue(wand->debug))
3629 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3630 if (wand->images == (Image *) NULL)
3632 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3633 "ContainsNoImages","`%s'",wand->name);
3634 return((MagickWand *) NULL);
3636 image=GetImageMask(wand->images,wand->exception);
3637 if (image == (Image *) NULL)
3638 return((MagickWand *) NULL);
3639 return(CloneMagickWandFromImages(wand,image));
3643 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3647 % 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 %
3651 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3653 % MagickGetImageBackgroundColor() returns the image background color.
3655 % The format of the MagickGetImageBackgroundColor method is:
3657 % MagickBooleanType MagickGetImageBackgroundColor(MagickWand *wand,
3658 % PixelWand *background_color)
3660 % A description of each parameter follows:
3662 % o wand: the magick wand.
3664 % o background_color: Return the background color.
3667 WandExport MagickBooleanType MagickGetImageBackgroundColor(MagickWand *wand,
3668 PixelWand *background_color)
3670 assert(wand != (MagickWand *) NULL);
3671 assert(wand->signature == WandSignature);
3672 if (IfMagickTrue(wand->debug))
3673 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3674 if (wand->images == (Image *) NULL)
3675 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3676 PixelSetPixelColor(background_color,&wand->images->background_color);
3681 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3685 % M a g i c k G e t I m a g e B l o b %
3689 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3691 % MagickGetImageBlob() implements direct to memory image formats. It returns
3692 % the image as a blob (a formatted "file" in memory) and its length, starting
3693 % from the current position in the image sequence. Use MagickSetImageFormat()
3694 % to set the format to write to the blob (GIF, JPEG, PNG, etc.).
3696 % Utilize MagickResetIterator() to ensure the write is from the beginning of
3697 % the image sequence.
3699 % Use MagickRelinquishMemory() to free the blob when you are done with it.
3701 % The format of the MagickGetImageBlob method is:
3703 % unsigned char *MagickGetImageBlob(MagickWand *wand,size_t *length)
3705 % A description of each parameter follows:
3707 % o wand: the magick wand.
3709 % o length: the length of the blob.
3712 WandExport unsigned char *MagickGetImageBlob(MagickWand *wand,size_t *length)
3714 assert(wand != (MagickWand *) NULL);
3715 assert(wand->signature == WandSignature);
3716 if (IfMagickTrue(wand->debug))
3717 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3718 if (wand->images == (Image *) NULL)
3720 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3721 "ContainsNoImages","`%s'",wand->name);
3722 return((unsigned char *) NULL);
3724 return(ImageToBlob(wand->image_info,wand->images,length,wand->exception));
3728 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3732 % M a g i c k G e t I m a g e s B l o b %
3736 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3738 % MagickGetImageBlob() implements direct to memory image formats. It
3739 % returns the image sequence as a blob and its length. The format of the image
3740 % determines the format of the returned blob (GIF, JPEG, PNG, etc.). To
3741 % return a different image format, use MagickSetImageFormat().
3743 % Note, some image formats do not permit multiple images to the same image
3744 % stream (e.g. JPEG). in this instance, just the first image of the
3745 % sequence is returned as a blob.
3747 % The format of the MagickGetImagesBlob method is:
3749 % unsigned char *MagickGetImagesBlob(MagickWand *wand,size_t *length)
3751 % A description of each parameter follows:
3753 % o wand: the magick wand.
3755 % o length: the length of the blob.
3758 WandExport unsigned char *MagickGetImagesBlob(MagickWand *wand,size_t *length)
3763 assert(wand != (MagickWand *) NULL);
3764 assert(wand->signature == WandSignature);
3765 if (IfMagickTrue(wand->debug))
3766 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3767 if (wand->images == (Image *) NULL)
3769 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3770 "ContainsNoImages","`%s'",wand->name);
3771 return((unsigned char *) NULL);
3773 blob=ImagesToBlob(wand->image_info,GetFirstImageInList(wand->images),length,
3779 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3783 % 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 %
3787 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3789 % MagickGetImageBluePrimary() returns the chromaticy blue primary point for the
3792 % The format of the MagickGetImageBluePrimary method is:
3794 % MagickBooleanType MagickGetImageBluePrimary(MagickWand *wand,double *x,
3797 % A description of each parameter follows:
3799 % o wand: the magick wand.
3801 % o x: the chromaticity blue primary x-point.
3803 % o y: the chromaticity blue primary y-point.
3806 WandExport MagickBooleanType MagickGetImageBluePrimary(MagickWand *wand,
3807 double *x,double *y)
3809 assert(wand != (MagickWand *) NULL);
3810 assert(wand->signature == WandSignature);
3811 if (IfMagickTrue(wand->debug))
3812 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3813 if (wand->images == (Image *) NULL)
3814 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3815 *x=wand->images->chromaticity.blue_primary.x;
3816 *y=wand->images->chromaticity.blue_primary.y;
3821 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3825 % 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 %
3829 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3831 % MagickGetImageBorderColor() returns the image border color.
3833 % The format of the MagickGetImageBorderColor method is:
3835 % MagickBooleanType MagickGetImageBorderColor(MagickWand *wand,
3836 % PixelWand *border_color)
3838 % A description of each parameter follows:
3840 % o wand: the magick wand.
3842 % o border_color: Return the border color.
3845 WandExport MagickBooleanType MagickGetImageBorderColor(MagickWand *wand,
3846 PixelWand *border_color)
3848 assert(wand != (MagickWand *) NULL);
3849 assert(wand->signature == WandSignature);
3850 if (IfMagickTrue(wand->debug))
3851 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3852 if (wand->images == (Image *) NULL)
3853 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3854 PixelSetPixelColor(border_color,&wand->images->border_color);
3859 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3863 % M a g i c k G e t I m a g e F e a t u r e s %
3867 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3869 % MagickGetImageFeatures() returns features for each channel in the
3870 % image in each of four directions (horizontal, vertical, left and right
3871 % diagonals) for the specified distance. The features include the angular
3872 % second moment, contrast, correlation, sum of squares: variance, inverse
3873 % difference moment, sum average, sum varience, sum entropy, entropy,
3874 % difference variance, difference entropy, information measures of
3875 % correlation 1, information measures of correlation 2, and maximum
3876 % correlation coefficient. You can access the red channel contrast, for
3877 % example, like this:
3879 % channel_features=MagickGetImageFeatures(wand,1);
3880 % contrast=channel_features[RedPixelChannel].contrast[0];
3882 % Use MagickRelinquishMemory() to free the statistics buffer.
3884 % The format of the MagickGetImageFeatures method is:
3886 % ChannelFeatures *MagickGetImageFeatures(MagickWand *wand,
3887 % const size_t distance)
3889 % A description of each parameter follows:
3891 % o wand: the magick wand.
3893 % o distance: the distance.
3896 WandExport ChannelFeatures *MagickGetImageFeatures(MagickWand *wand,
3897 const size_t distance)
3899 assert(wand != (MagickWand *) NULL);
3900 assert(wand->signature == WandSignature);
3901 if (IfMagickTrue(wand->debug))
3902 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3903 if (wand->images == (Image *) NULL)
3905 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3906 "ContainsNoImages","`%s'",wand->name);
3907 return((ChannelFeatures *) NULL);
3909 return(GetImageFeatures(wand->images,distance,wand->exception));
3913 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3917 % M a g i c k G e t I m a g e K u r t o s i s %
3921 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3923 % MagickGetImageKurtosis() gets the kurtosis and skewness of one or
3924 % more image channels.
3926 % The format of the MagickGetImageKurtosis method is:
3928 % MagickBooleanType MagickGetImageKurtosis(MagickWand *wand,
3929 % double *kurtosis,double *skewness)
3931 % A description of each parameter follows:
3933 % o wand: the magick wand.
3935 % o kurtosis: The kurtosis for the specified channel(s).
3937 % o skewness: The skewness for the specified channel(s).
3940 WandExport MagickBooleanType MagickGetImageKurtosis(MagickWand *wand,
3941 double *kurtosis,double *skewness)
3946 assert(wand != (MagickWand *) NULL);
3947 assert(wand->signature == WandSignature);
3948 if (IfMagickTrue(wand->debug))
3949 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3950 if (wand->images == (Image *) NULL)
3951 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3952 status=GetImageKurtosis(wand->images,kurtosis,skewness,wand->exception);
3957 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3961 % M a g i c k G e t I m a g e M e a n %
3965 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3967 % MagickGetImageMean() gets the mean and standard deviation of one or more
3970 % The format of the MagickGetImageMean method is:
3972 % MagickBooleanType MagickGetImageMean(MagickWand *wand,double *mean,
3973 % double *standard_deviation)
3975 % A description of each parameter follows:
3977 % o wand: the magick wand.
3979 % o channel: the image channel(s).
3981 % o mean: The mean pixel value for the specified channel(s).
3983 % o standard_deviation: The standard deviation for the specified channel(s).
3986 WandExport MagickBooleanType MagickGetImageMean(MagickWand *wand,double *mean,
3987 double *standard_deviation)
3992 assert(wand != (MagickWand *) NULL);
3993 assert(wand->signature == WandSignature);
3994 if (IfMagickTrue(wand->debug))
3995 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3996 if (wand->images == (Image *) NULL)
3997 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3998 status=GetImageMean(wand->images,mean,standard_deviation,wand->exception);
4003 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4007 % M a g i c k G e t I m a g e R a n g e %
4011 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4013 % MagickGetImageRange() gets the range for one or more image channels.
4015 % The format of the MagickGetImageRange method is:
4017 % MagickBooleanType MagickGetImageRange(MagickWand *wand,double *minima,
4020 % A description of each parameter follows:
4022 % o wand: the magick wand.
4024 % o minima: The minimum pixel value for the specified channel(s).
4026 % o maxima: The maximum pixel value for the specified channel(s).
4029 WandExport MagickBooleanType MagickGetImageRange(MagickWand *wand,
4030 double *minima,double *maxima)
4035 assert(wand != (MagickWand *) NULL);
4036 assert(wand->signature == WandSignature);
4037 if (IfMagickTrue(wand->debug))
4038 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4039 if (wand->images == (Image *) NULL)
4040 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4041 status=GetImageRange(wand->images,minima,maxima,wand->exception);
4046 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4050 % M a g i c k G e t I m a g e S t a t i s t i c s %
4054 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4056 % MagickGetImageStatistics() returns statistics for each channel in the
4057 % image. The statistics include the channel depth, its minima and
4058 % maxima, the mean, the standard deviation, the kurtosis and the skewness.
4059 % You can access the red channel mean, for example, like this:
4061 % channel_statistics=MagickGetImageStatistics(wand);
4062 % red_mean=channel_statistics[RedPixelChannel].mean;
4064 % Use MagickRelinquishMemory() to free the statistics buffer.
4066 % The format of the MagickGetImageStatistics method is:
4068 % ChannelStatistics *MagickGetImageStatistics(MagickWand *wand)
4070 % A description of each parameter follows:
4072 % o wand: the magick wand.
4075 WandExport ChannelStatistics *MagickGetImageStatistics(MagickWand *wand)
4077 assert(wand != (MagickWand *) NULL);
4078 assert(wand->signature == WandSignature);
4079 if (IfMagickTrue(wand->debug))
4080 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4081 if (wand->images == (Image *) NULL)
4083 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4084 "ContainsNoImages","`%s'",wand->name);
4085 return((ChannelStatistics *) NULL);
4087 return(GetImageStatistics(wand->images,wand->exception));
4091 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4095 % 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 %
4099 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4101 % MagickGetImageColormapColor() returns the color of the specified colormap
4104 % The format of the MagickGetImageColormapColor method is:
4106 % MagickBooleanType MagickGetImageColormapColor(MagickWand *wand,
4107 % const size_t index,PixelWand *color)
4109 % A description of each parameter follows:
4111 % o wand: the magick wand.
4113 % o index: the offset into the image colormap.
4115 % o color: Return the colormap color in this wand.
4118 WandExport MagickBooleanType MagickGetImageColormapColor(MagickWand *wand,
4119 const size_t index,PixelWand *color)
4121 assert(wand != (MagickWand *) NULL);
4122 assert(wand->signature == WandSignature);
4123 if (IfMagickTrue(wand->debug))
4124 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4125 if (wand->images == (Image *) NULL)
4126 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4127 if ((wand->images->colormap == (PixelInfo *) NULL) ||
4128 (index >= wand->images->colors))
4130 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4131 "InvalidColormapIndex","`%s'",wand->name);
4132 return(MagickFalse);
4134 PixelSetPixelColor(color,wand->images->colormap+index);
4139 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4143 % M a g i c k G e t I m a g e C o l o r s %
4147 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4149 % MagickGetImageColors() gets the number of unique colors in the image.
4151 % The format of the MagickGetImageColors method is:
4153 % size_t MagickGetImageColors(MagickWand *wand)
4155 % A description of each parameter follows:
4157 % o wand: the magick wand.
4160 WandExport size_t MagickGetImageColors(MagickWand *wand)
4162 assert(wand != (MagickWand *) NULL);
4163 assert(wand->signature == WandSignature);
4164 if (IfMagickTrue(wand->debug))
4165 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4166 if (wand->images == (Image *) NULL)
4168 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4169 "ContainsNoImages","`%s'",wand->name);
4172 return(GetNumberColors(wand->images,(FILE *) NULL,wand->exception));
4176 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4180 % M a g i c k G e t I m a g e C o l o r s p a c e %
4184 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4186 % MagickGetImageColorspace() gets the image colorspace.
4188 % The format of the MagickGetImageColorspace method is:
4190 % ColorspaceType MagickGetImageColorspace(MagickWand *wand)
4192 % A description of each parameter follows:
4194 % o wand: the magick wand.
4197 WandExport ColorspaceType MagickGetImageColorspace(MagickWand *wand)
4199 assert(wand != (MagickWand *) NULL);
4200 assert(wand->signature == WandSignature);
4201 if (IfMagickTrue(wand->debug))
4202 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4203 if (wand->images == (Image *) NULL)
4205 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4206 "ContainsNoImages","`%s'",wand->name);
4207 return(UndefinedColorspace);
4209 return(wand->images->colorspace);
4213 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4217 % M a g i c k G e t I m a g e C o m p o s e %
4221 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4223 % MagickGetImageCompose() returns the composite operator associated with the
4226 % The format of the MagickGetImageCompose method is:
4228 % CompositeOperator MagickGetImageCompose(MagickWand *wand)
4230 % A description of each parameter follows:
4232 % o wand: the magick wand.
4235 WandExport CompositeOperator MagickGetImageCompose(MagickWand *wand)
4237 assert(wand != (MagickWand *) NULL);
4238 assert(wand->signature == WandSignature);
4239 if (IfMagickTrue(wand->debug))
4240 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4241 if (wand->images == (Image *) NULL)
4243 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4244 "ContainsNoImages","`%s'",wand->name);
4245 return(UndefinedCompositeOp);
4247 return(wand->images->compose);
4251 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4255 % 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 %
4259 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4261 % MagickGetImageCompression() gets the image compression.
4263 % The format of the MagickGetImageCompression method is:
4265 % CompressionType MagickGetImageCompression(MagickWand *wand)
4267 % A description of each parameter follows:
4269 % o wand: the magick wand.
4272 WandExport CompressionType MagickGetImageCompression(MagickWand *wand)
4274 assert(wand != (MagickWand *) NULL);
4275 assert(wand->signature == WandSignature);
4276 if (IfMagickTrue(wand->debug))
4277 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4278 if (wand->images == (Image *) NULL)
4280 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4281 "ContainsNoImages","`%s'",wand->name);
4282 return(UndefinedCompression);
4284 return(wand->images->compression);
4288 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4292 % 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 %
4296 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4298 % MagickGetImageCompressionQuality() gets the image compression quality.
4300 % The format of the MagickGetImageCompressionQuality method is:
4302 % size_t MagickGetImageCompressionQuality(MagickWand *wand)
4304 % A description of each parameter follows:
4306 % o wand: the magick wand.
4309 WandExport size_t MagickGetImageCompressionQuality(MagickWand *wand)
4311 assert(wand != (MagickWand *) NULL);
4312 assert(wand->signature == WandSignature);
4313 if (IfMagickTrue(wand->debug))
4314 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4315 if (wand->images == (Image *) NULL)
4317 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4318 "ContainsNoImages","`%s'",wand->name);
4321 return(wand->images->quality);
4325 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4329 % M a g i c k G e t I m a g e D e l a y %
4333 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4335 % MagickGetImageDelay() gets the image delay.
4337 % The format of the MagickGetImageDelay method is:
4339 % size_t MagickGetImageDelay(MagickWand *wand)
4341 % A description of each parameter follows:
4343 % o wand: the magick wand.
4346 WandExport size_t MagickGetImageDelay(MagickWand *wand)
4348 assert(wand != (MagickWand *) NULL);
4349 assert(wand->signature == WandSignature);
4350 if (IfMagickTrue(wand->debug))
4351 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4352 if (wand->images == (Image *) NULL)
4353 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4354 return(wand->images->delay);
4358 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4362 % M a g i c k G e t I m a g e D e p t h %
4366 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4368 % MagickGetImageDepth() gets the image depth.
4370 % The format of the MagickGetImageDepth method is:
4372 % size_t MagickGetImageDepth(MagickWand *wand)
4374 % A description of each parameter follows:
4376 % o wand: the magick wand.
4379 WandExport size_t MagickGetImageDepth(MagickWand *wand)
4381 assert(wand != (MagickWand *) NULL);
4382 assert(wand->signature == WandSignature);
4383 if (IfMagickTrue(wand->debug))
4384 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4385 if (wand->images == (Image *) NULL)
4386 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4387 return(wand->images->depth);
4391 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4395 % M a g i c k G e t I m a g e D i s p o s e %
4399 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4401 % MagickGetImageDispose() gets the image disposal method.
4403 % The format of the MagickGetImageDispose method is:
4405 % DisposeType MagickGetImageDispose(MagickWand *wand)
4407 % A description of each parameter follows:
4409 % o wand: the magick wand.
4412 WandExport DisposeType MagickGetImageDispose(MagickWand *wand)
4414 assert(wand != (MagickWand *) NULL);
4415 assert(wand->signature == WandSignature);
4416 if (IfMagickTrue(wand->debug))
4417 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4418 if (wand->images == (Image *) NULL)
4420 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4421 "ContainsNoImages","`%s'",wand->name);
4422 return(UndefinedDispose);
4424 return((DisposeType) wand->images->dispose);
4428 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4432 % M a g i c k G e t I m a g e D i s t o r t i o n %
4436 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4438 % MagickGetImageDistortion() compares an image to a reconstructed image and
4439 % returns the specified distortion metric.
4441 % The format of the MagickGetImageDistortion method is:
4443 % MagickBooleanType MagickGetImageDistortion(MagickWand *wand,
4444 % const MagickWand *reference,const MetricType metric,
4445 % double *distortion)
4447 % A description of each parameter follows:
4449 % o wand: the magick wand.
4451 % o reference: the reference wand.
4453 % o metric: the metric.
4455 % o distortion: the computed distortion between the images.
4458 WandExport MagickBooleanType MagickGetImageDistortion(MagickWand *wand,
4459 const MagickWand *reference,const MetricType metric,double *distortion)
4464 assert(wand != (MagickWand *) NULL);
4465 assert(wand->signature == WandSignature);
4466 if (IfMagickTrue(wand->debug))
4467 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4468 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
4469 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4470 status=GetImageDistortion(wand->images,reference->images,metric,distortion,
4476 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4480 % 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 %
4484 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4486 % MagickGetImageDistortions() compares one or more pixel channels of an
4487 % image to a reconstructed image and returns the specified distortion metrics.
4489 % Use MagickRelinquishMemory() to free the metrics when you are done with them.
4491 % The format of the MagickGetImageDistortion method is:
4493 % double *MagickGetImageDistortion(MagickWand *wand,
4494 % const MagickWand *reference,const MetricType metric)
4496 % A description of each parameter follows:
4498 % o wand: the magick wand.
4500 % o reference: the reference wand.
4502 % o metric: the metric.
4505 WandExport double *MagickGetImageDistortions(MagickWand *wand,
4506 const MagickWand *reference,const MetricType metric)
4509 *channel_distortion;
4511 assert(wand != (MagickWand *) NULL);
4512 assert(wand->signature == WandSignature);
4513 if (IfMagickTrue(wand->debug))
4514 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4515 assert(reference != (MagickWand *) NULL);
4516 assert(reference->signature == WandSignature);
4517 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
4519 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4520 "ContainsNoImages","`%s'",wand->name);
4521 return((double *) NULL);
4523 channel_distortion=GetImageDistortions(wand->images,reference->images,
4524 metric,wand->exception);
4525 return(channel_distortion);
4529 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4533 % M a g i c k G e t I m a g e E n d i a n %
4537 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4539 % MagickGetImageEndian() gets the image endian.
4541 % The format of the MagickGetImageEndian method is:
4543 % EndianType MagickGetImageEndian(MagickWand *wand)
4545 % A description of each parameter follows:
4547 % o wand: the magick wand.
4550 WandExport EndianType MagickGetImageEndian(MagickWand *wand)
4552 assert(wand != (MagickWand *) NULL);
4553 assert(wand->signature == WandSignature);
4554 if (IfMagickTrue(wand->debug))
4555 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4556 if (wand->images == (Image *) NULL)
4558 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4559 "ContainsNoImages","`%s'",wand->name);
4560 return(UndefinedEndian);
4562 return(wand->images->endian);
4566 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4570 % M a g i c k G e t I m a g e F i l e n a m e %
4574 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4576 % MagickGetImageFilename() returns the filename of a particular image in a
4579 % The format of the MagickGetImageFilename method is:
4581 % char *MagickGetImageFilename(MagickWand *wand)
4583 % A description of each parameter follows:
4585 % o wand: the magick wand.
4588 WandExport char *MagickGetImageFilename(MagickWand *wand)
4590 assert(wand != (MagickWand *) NULL);
4591 assert(wand->signature == WandSignature);
4592 if (IfMagickTrue(wand->debug))
4593 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4594 if (wand->images == (Image *) NULL)
4596 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4597 "ContainsNoImages","`%s'",wand->name);
4598 return((char *) NULL);
4600 return(AcquireString(wand->images->filename));
4604 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4608 % M a g i c k G e t I m a g e F o r m a t %
4612 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4614 % MagickGetImageFormat() returns the format of a particular image in a
4617 % The format of the MagickGetImageFormat method is:
4619 % char *MagickGetImageFormat(MagickWand *wand)
4621 % A description of each parameter follows:
4623 % o wand: the magick wand.
4626 WandExport char *MagickGetImageFormat(MagickWand *wand)
4628 assert(wand != (MagickWand *) NULL);
4629 assert(wand->signature == WandSignature);
4630 if (IfMagickTrue(wand->debug))
4631 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4632 if (wand->images == (Image *) NULL)
4634 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4635 "ContainsNoImages","`%s'",wand->name);
4636 return((char *) NULL);
4638 return(AcquireString(wand->images->magick));
4642 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4646 % M a g i c k G e t I m a g e F u z z %
4650 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4652 % MagickGetImageFuzz() gets the image fuzz.
4654 % The format of the MagickGetImageFuzz method is:
4656 % double MagickGetImageFuzz(MagickWand *wand)
4658 % A description of each parameter follows:
4660 % o wand: the magick wand.
4663 WandExport double MagickGetImageFuzz(MagickWand *wand)
4665 assert(wand != (MagickWand *) NULL);
4666 assert(wand->signature == WandSignature);
4667 if (IfMagickTrue(wand->debug))
4668 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4669 if (wand->images == (Image *) NULL)
4671 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4672 "ContainsNoImages","`%s'",wand->name);
4675 return(wand->images->fuzz);
4679 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4683 % M a g i c k G e t I m a g e G a m m a %
4687 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4689 % MagickGetImageGamma() gets the image gamma.
4691 % The format of the MagickGetImageGamma method is:
4693 % double MagickGetImageGamma(MagickWand *wand)
4695 % A description of each parameter follows:
4697 % o wand: the magick wand.
4700 WandExport double MagickGetImageGamma(MagickWand *wand)
4702 assert(wand != (MagickWand *) NULL);
4703 assert(wand->signature == WandSignature);
4704 if (IfMagickTrue(wand->debug))
4705 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4706 if (wand->images == (Image *) NULL)
4708 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4709 "ContainsNoImages","`%s'",wand->name);
4712 return(wand->images->gamma);
4716 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4720 % M a g i c k G e t I m a g e G r a v i t y %
4724 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4726 % MagickGetImageGravity() gets the image gravity.
4728 % The format of the MagickGetImageGravity method is:
4730 % GravityType MagickGetImageGravity(MagickWand *wand)
4732 % A description of each parameter follows:
4734 % o wand: the magick wand.
4737 WandExport GravityType MagickGetImageGravity(MagickWand *wand)
4739 assert(wand != (MagickWand *) NULL);
4740 assert(wand->signature == WandSignature);
4741 if (IfMagickTrue(wand->debug))
4742 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4743 if (wand->images == (Image *) NULL)
4745 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4746 "ContainsNoImages","`%s'",wand->name);
4747 return(UndefinedGravity);
4749 return(wand->images->gravity);
4753 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4757 % 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 %
4761 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4763 % MagickGetImageGreenPrimary() returns the chromaticy green primary point.
4765 % The format of the MagickGetImageGreenPrimary method is:
4767 % MagickBooleanType MagickGetImageGreenPrimary(MagickWand *wand,double *x,
4770 % A description of each parameter follows:
4772 % o wand: the magick wand.
4774 % o x: the chromaticity green primary x-point.
4776 % o y: the chromaticity green primary y-point.
4779 WandExport MagickBooleanType MagickGetImageGreenPrimary(MagickWand *wand,
4780 double *x,double *y)
4782 assert(wand != (MagickWand *) NULL);
4783 assert(wand->signature == WandSignature);
4784 if (IfMagickTrue(wand->debug))
4785 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4786 if (wand->images == (Image *) NULL)
4787 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4788 *x=wand->images->chromaticity.green_primary.x;
4789 *y=wand->images->chromaticity.green_primary.y;
4794 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4798 % M a g i c k G e t I m a g e H e i g h t %
4802 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4804 % MagickGetImageHeight() returns the image height.
4806 % The format of the MagickGetImageHeight method is:
4808 % size_t MagickGetImageHeight(MagickWand *wand)
4810 % A description of each parameter follows:
4812 % o wand: the magick wand.
4815 WandExport size_t MagickGetImageHeight(MagickWand *wand)
4817 assert(wand != (MagickWand *) NULL);
4818 assert(wand->signature == WandSignature);
4819 if (IfMagickTrue(wand->debug))
4820 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4821 if (wand->images == (Image *) NULL)
4822 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4823 return(wand->images->rows);
4827 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4831 % M a g i c k G e t I m a g e H i s t o g r a m %
4835 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4837 % MagickGetImageHistogram() returns the image histogram as an array of
4840 % The format of the MagickGetImageHistogram method is:
4842 % PixelWand **MagickGetImageHistogram(MagickWand *wand,
4843 % size_t *number_colors)
4845 % A description of each parameter follows:
4847 % o wand: the magick wand.
4849 % o number_colors: the number of unique colors in the image and the number
4850 % of pixel wands returned.
4853 WandExport PixelWand **MagickGetImageHistogram(MagickWand *wand,
4854 size_t *number_colors)
4865 assert(wand != (MagickWand *) NULL);
4866 assert(wand->signature == WandSignature);
4867 if (IfMagickTrue(wand->debug))
4868 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4869 if (wand->images == (Image *) NULL)
4871 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4872 "ContainsNoImages","`%s'",wand->name);
4873 return((PixelWand **) NULL);
4875 histogram=GetImageHistogram(wand->images,number_colors,wand->exception);
4876 if (histogram == (PixelInfo *) NULL)
4877 return((PixelWand **) NULL);
4878 pixel_wands=NewPixelWands(*number_colors);
4879 for (i=0; i < (ssize_t) *number_colors; i++)
4881 PixelSetPixelColor(pixel_wands[i],&histogram[i]);
4882 PixelSetColorCount(pixel_wands[i],(size_t) histogram[i].count);
4884 histogram=(PixelInfo *) RelinquishMagickMemory(histogram);
4885 return(pixel_wands);
4889 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4893 % 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 %
4897 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4899 % MagickGetImageInterlaceScheme() gets the image interlace scheme.
4901 % The format of the MagickGetImageInterlaceScheme method is:
4903 % InterlaceType MagickGetImageInterlaceScheme(MagickWand *wand)
4905 % A description of each parameter follows:
4907 % o wand: the magick wand.
4910 WandExport InterlaceType MagickGetImageInterlaceScheme(MagickWand *wand)
4912 assert(wand != (MagickWand *) NULL);
4913 assert(wand->signature == WandSignature);
4914 if (IfMagickTrue(wand->debug))
4915 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4916 if (wand->images == (Image *) NULL)
4918 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4919 "ContainsNoImages","`%s'",wand->name);
4920 return(UndefinedInterlace);
4922 return(wand->images->interlace);
4926 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4930 % 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 %
4934 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4936 % MagickGetImageInterpolateMethod() returns the interpolation method for the
4939 % The format of the MagickGetImageInterpolateMethod method is:
4941 % PixelInterpolateMethod MagickGetImagePixelInterpolateMethod(
4944 % A description of each parameter follows:
4946 % o wand: the magick wand.
4949 WandExport PixelInterpolateMethod MagickGetImageInterpolateMethod(
4952 assert(wand != (MagickWand *) NULL);
4953 assert(wand->signature == WandSignature);
4954 if (IfMagickTrue(wand->debug))
4955 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4956 if (wand->images == (Image *) NULL)
4958 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4959 "ContainsNoImages","`%s'",wand->name);
4960 return(UndefinedInterpolatePixel);
4962 return(wand->images->interpolate);
4966 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4970 % M a g i c k G e t I m a g e I t e r a t i o n s %
4974 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4976 % MagickGetImageIterations() gets the image iterations.
4978 % The format of the MagickGetImageIterations method is:
4980 % size_t MagickGetImageIterations(MagickWand *wand)
4982 % A description of each parameter follows:
4984 % o wand: the magick wand.
4987 WandExport size_t MagickGetImageIterations(MagickWand *wand)
4989 assert(wand != (MagickWand *) NULL);
4990 assert(wand->signature == WandSignature);
4991 if (IfMagickTrue(wand->debug))
4992 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4993 if (wand->images == (Image *) NULL)
4994 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4995 return(wand->images->iterations);
4999 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5003 % M a g i c k G e t I m a g e L e n g t h %
5007 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5009 % MagickGetImageLength() returns the image length in bytes.
5011 % The format of the MagickGetImageLength method is:
5013 % MagickBooleanType MagickGetImageLength(MagickWand *wand,
5014 % MagickSizeType *length)
5016 % A description of each parameter follows:
5018 % o wand: the magick wand.
5020 % o length: the image length in bytes.
5023 WandExport MagickBooleanType MagickGetImageLength(MagickWand *wand,
5024 MagickSizeType *length)
5026 assert(wand != (MagickWand *) NULL);
5027 assert(wand->signature == WandSignature);
5028 if (IfMagickTrue(wand->debug))
5029 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5030 if (wand->images == (Image *) NULL)
5031 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5032 *length=GetBlobSize(wand->images);
5037 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5041 % M a g i c k G e t I m a g e M a t t e C o l o r %
5045 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5047 % MagickGetImageMatteColor() returns the image matte color.
5049 % The format of the MagickGetImageMatteColor method is:
5051 % MagickBooleanType MagickGetImagematteColor(MagickWand *wand,
5052 % PixelWand *matte_color)
5054 % A description of each parameter follows:
5056 % o wand: the magick wand.
5058 % o matte_color: Return the matte color.
5061 WandExport MagickBooleanType MagickGetImageMatteColor(MagickWand *wand,
5062 PixelWand *matte_color)
5064 assert(wand != (MagickWand *) NULL);
5065 assert(wand->signature == WandSignature);
5066 if (IfMagickTrue(wand->debug))
5067 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5068 if (wand->images == (Image *) NULL)
5069 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5070 PixelSetPixelColor(matte_color,&wand->images->matte_color);
5075 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5079 % 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 %
5083 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5085 % MagickGetImageOrientation() returns the image orientation.
5087 % The format of the MagickGetImageOrientation method is:
5089 % OrientationType MagickGetImageOrientation(MagickWand *wand)
5091 % A description of each parameter follows:
5093 % o wand: the magick wand.
5096 WandExport OrientationType MagickGetImageOrientation(MagickWand *wand)
5098 assert(wand != (MagickWand *) NULL);
5099 assert(wand->signature == WandSignature);
5100 if (IfMagickTrue(wand->debug))
5101 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5102 if (wand->images == (Image *) NULL)
5104 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5105 "ContainsNoImages","`%s'",wand->name);
5106 return(UndefinedOrientation);
5108 return(wand->images->orientation);
5112 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5116 % M a g i c k G e t I m a g e P a g e %
5120 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5122 % MagickGetImagePage() returns the page geometry associated with the image.
5124 % The format of the MagickGetImagePage method is:
5126 % MagickBooleanType MagickGetImagePage(MagickWand *wand,
5127 % size_t *width,size_t *height,ssize_t *x,ssize_t *y)
5129 % A description of each parameter follows:
5131 % o wand: the magick wand.
5133 % o width: the page width.
5135 % o height: the page height.
5137 % o x: the page x-offset.
5139 % o y: the page y-offset.
5142 WandExport MagickBooleanType MagickGetImagePage(MagickWand *wand,
5143 size_t *width,size_t *height,ssize_t *x,ssize_t *y)
5145 assert(wand != (const MagickWand *) NULL);
5146 assert(wand->signature == WandSignature);
5147 if (IfMagickTrue(wand->debug))
5148 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5149 if (wand->images == (Image *) NULL)
5150 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5151 *width=wand->images->page.width;
5152 *height=wand->images->page.height;
5153 *x=wand->images->page.x;
5154 *y=wand->images->page.y;
5159 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5163 % M a g i c k G e t I m a g e P i x e l C o l o r %
5167 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5169 % MagickGetImagePixelColor() returns the color of the specified pixel.
5171 % The format of the MagickGetImagePixelColor method is:
5173 % MagickBooleanType MagickGetImagePixelColor(MagickWand *wand,
5174 % const ssize_t x,const ssize_t y,PixelWand *color)
5176 % A description of each parameter follows:
5178 % o wand: the magick wand.
5180 % o x,y: the pixel offset into the image.
5182 % o color: Return the colormap color in this wand.
5185 WandExport MagickBooleanType MagickGetImagePixelColor(MagickWand *wand,
5186 const ssize_t x,const ssize_t y,PixelWand *color)
5188 register const Quantum
5194 assert(wand != (MagickWand *) NULL);
5195 assert(wand->signature == WandSignature);
5196 if (IfMagickTrue(wand->debug))
5197 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5198 if (wand->images == (Image *) NULL)
5199 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5200 image_view=AcquireVirtualCacheView(wand->images,wand->exception);
5201 p=GetCacheViewVirtualPixels(image_view,x,y,1,1,wand->exception);
5202 if (p == (const Quantum *) NULL)
5204 image_view=DestroyCacheView(image_view);
5205 return(MagickFalse);
5207 PixelSetQuantumPixel(wand->images,p,color);
5208 image_view=DestroyCacheView(image_view);
5213 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5217 % M a g i c k G e t I m a g e R e d P r i m a r y %
5221 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5223 % MagickGetImageRedPrimary() returns the chromaticy red primary point.
5225 % The format of the MagickGetImageRedPrimary method is:
5227 % MagickBooleanType MagickGetImageRedPrimary(MagickWand *wand,double *x,
5230 % A description of each parameter follows:
5232 % o wand: the magick wand.
5234 % o x: the chromaticity red primary x-point.
5236 % o y: the chromaticity red primary y-point.
5239 WandExport MagickBooleanType MagickGetImageRedPrimary(MagickWand *wand,
5240 double *x,double *y)
5242 assert(wand != (MagickWand *) NULL);
5243 assert(wand->signature == WandSignature);
5244 if (IfMagickTrue(wand->debug))
5245 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5246 if (wand->images == (Image *) NULL)
5247 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5248 *x=wand->images->chromaticity.red_primary.x;
5249 *y=wand->images->chromaticity.red_primary.y;
5254 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5258 % M a g i c k G e t I m a g e R e g i o n %
5262 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5264 % MagickGetImageRegion() extracts a region of the image and returns it as a
5267 % The format of the MagickGetImageRegion method is:
5269 % MagickWand *MagickGetImageRegion(MagickWand *wand,
5270 % const size_t width,const size_t height,const ssize_t x,
5273 % A description of each parameter follows:
5275 % o wand: the magick wand.
5277 % o width: the region width.
5279 % o height: the region height.
5281 % o x: the region x offset.
5283 % o y: the region y offset.
5286 WandExport MagickWand *MagickGetImageRegion(MagickWand *wand,
5287 const size_t width,const size_t height,const ssize_t x,
5296 assert(wand != (MagickWand *) NULL);
5297 assert(wand->signature == WandSignature);
5298 if (IfMagickTrue(wand->debug))
5299 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5300 if (wand->images == (Image *) NULL)
5301 return((MagickWand *) NULL);
5303 region.height=height;
5306 region_image=CropImage(wand->images,®ion,wand->exception);
5307 if (region_image == (Image *) NULL)
5308 return((MagickWand *) NULL);
5309 return(CloneMagickWandFromImages(wand,region_image));
5313 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5317 % 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 %
5321 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5323 % MagickGetImageRenderingIntent() gets the image rendering intent.
5325 % The format of the MagickGetImageRenderingIntent method is:
5327 % RenderingIntent MagickGetImageRenderingIntent(MagickWand *wand)
5329 % A description of each parameter follows:
5331 % o wand: the magick wand.
5334 WandExport RenderingIntent MagickGetImageRenderingIntent(MagickWand *wand)
5336 assert(wand != (MagickWand *) NULL);
5337 assert(wand->signature == WandSignature);
5338 if (IfMagickTrue(wand->debug))
5339 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5340 if (wand->images == (Image *) NULL)
5342 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5343 "ContainsNoImages","`%s'",wand->name);
5344 return(UndefinedIntent);
5346 return((RenderingIntent) wand->images->rendering_intent);
5350 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5354 % M a g i c k G e t I m a g e R e s o l u t i o n %
5358 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5360 % MagickGetImageResolution() gets the image X and Y resolution.
5362 % The format of the MagickGetImageResolution method is:
5364 % MagickBooleanType MagickGetImageResolution(MagickWand *wand,double *x,
5367 % A description of each parameter follows:
5369 % o wand: the magick wand.
5371 % o x: the image x-resolution.
5373 % o y: the image y-resolution.
5376 WandExport MagickBooleanType MagickGetImageResolution(MagickWand *wand,
5377 double *x,double *y)
5379 assert(wand != (MagickWand *) NULL);
5380 assert(wand->signature == WandSignature);
5381 if (IfMagickTrue(wand->debug))
5382 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5383 if (wand->images == (Image *) NULL)
5384 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5385 *x=wand->images->resolution.x;
5386 *y=wand->images->resolution.y;
5391 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5395 % M a g i c k G e t I m a g e S c e n e %
5399 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5401 % MagickGetImageScene() gets the image scene.
5403 % The format of the MagickGetImageScene method is:
5405 % size_t MagickGetImageScene(MagickWand *wand)
5407 % A description of each parameter follows:
5409 % o wand: the magick wand.
5412 WandExport size_t MagickGetImageScene(MagickWand *wand)
5414 assert(wand != (MagickWand *) NULL);
5415 assert(wand->signature == WandSignature);
5416 if (IfMagickTrue(wand->debug))
5417 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5418 if (wand->images == (Image *) NULL)
5419 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5420 return(wand->images->scene);
5424 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5428 % M a g i c k G e t I m a g e S i g n a t u r e %
5432 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5434 % MagickGetImageSignature() generates an SHA-256 message digest for the image
5437 % The format of the MagickGetImageSignature method is:
5439 % char *MagickGetImageSignature(MagickWand *wand)
5441 % A description of each parameter follows:
5443 % o wand: the magick wand.
5446 WandExport char *MagickGetImageSignature(MagickWand *wand)
5454 assert(wand != (MagickWand *) NULL);
5455 assert(wand->signature == WandSignature);
5456 if (IfMagickTrue(wand->debug))
5457 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5458 if (wand->images == (Image *) NULL)
5460 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5461 "ContainsNoImages","`%s'",wand->name);
5462 return((char *) NULL);
5464 status=SignatureImage(wand->images,wand->exception);
5465 if (IfMagickFalse(status))
5466 return((char *) NULL);
5467 value=GetImageProperty(wand->images,"signature",wand->exception);
5468 if (value == (const char *) NULL)
5469 return((char *) NULL);
5470 return(AcquireString(value));
5474 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5478 % 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 %
5482 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5484 % MagickGetImageTicksPerSecond() gets the image ticks-per-second.
5486 % The format of the MagickGetImageTicksPerSecond method is:
5488 % size_t MagickGetImageTicksPerSecond(MagickWand *wand)
5490 % A description of each parameter follows:
5492 % o wand: the magick wand.
5495 WandExport size_t MagickGetImageTicksPerSecond(MagickWand *wand)
5497 assert(wand != (MagickWand *) NULL);
5498 assert(wand->signature == WandSignature);
5499 if (IfMagickTrue(wand->debug))
5500 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5501 if (wand->images == (Image *) NULL)
5502 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5503 return((size_t) wand->images->ticks_per_second);
5507 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5511 % M a g i c k G e t I m a g e T y p e %
5515 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5517 % MagickGetImageType() gets the potential image type:
5519 % Bilevel Grayscale GrayscaleMatte
5520 % Palette PaletteMatte TrueColor
5521 % TrueColorMatte ColorSeparation ColorSeparationMatte
5523 % To ensure the image type matches its potential, use MagickSetImageType():
5525 % (void) MagickSetImageType(wand,MagickGetImageType(wand));
5527 % The format of the MagickGetImageType method is:
5529 % ImageType MagickGetImageType(MagickWand *wand)
5531 % A description of each parameter follows:
5533 % o wand: the magick wand.
5536 WandExport ImageType MagickGetImageType(MagickWand *wand)
5538 assert(wand != (MagickWand *) NULL);
5539 assert(wand->signature == WandSignature);
5540 if (IfMagickTrue(wand->debug))
5541 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5542 if (wand->images == (Image *) NULL)
5544 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5545 "ContainsNoImages","`%s'",wand->name);
5546 return(UndefinedType);
5548 return(GetImageType(wand->images,wand->exception));
5552 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5556 % M a g i c k G e t I m a g e U n i t s %
5560 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5562 % MagickGetImageUnits() gets the image units of resolution.
5564 % The format of the MagickGetImageUnits method is:
5566 % ResolutionType MagickGetImageUnits(MagickWand *wand)
5568 % A description of each parameter follows:
5570 % o wand: the magick wand.
5573 WandExport ResolutionType MagickGetImageUnits(MagickWand *wand)
5575 assert(wand != (MagickWand *) NULL);
5576 assert(wand->signature == WandSignature);
5577 if (IfMagickTrue(wand->debug))
5578 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5579 if (wand->images == (Image *) NULL)
5581 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5582 "ContainsNoImages","`%s'",wand->name);
5583 return(UndefinedResolution);
5585 return(wand->images->units);
5589 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5593 % 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 %
5597 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5599 % MagickGetImageVirtualPixelMethod() returns the virtual pixel method for the
5602 % The format of the MagickGetImageVirtualPixelMethod method is:
5604 % VirtualPixelMethod MagickGetImageVirtualPixelMethod(MagickWand *wand)
5606 % A description of each parameter follows:
5608 % o wand: the magick wand.
5611 WandExport VirtualPixelMethod MagickGetImageVirtualPixelMethod(MagickWand *wand)
5613 assert(wand != (MagickWand *) NULL);
5614 assert(wand->signature == WandSignature);
5615 if (IfMagickTrue(wand->debug))
5616 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5617 if (wand->images == (Image *) NULL)
5619 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5620 "ContainsNoImages","`%s'",wand->name);
5621 return(UndefinedVirtualPixelMethod);
5623 return(GetImageVirtualPixelMethod(wand->images));
5627 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5631 % M a g i c k G e t I m a g e W h i t e P o i n t %
5635 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5637 % MagickGetImageWhitePoint() returns the chromaticy white point.
5639 % The format of the MagickGetImageWhitePoint method is:
5641 % MagickBooleanType MagickGetImageWhitePoint(MagickWand *wand,double *x,
5644 % A description of each parameter follows:
5646 % o wand: the magick wand.
5648 % o x: the chromaticity white x-point.
5650 % o y: the chromaticity white y-point.
5653 WandExport MagickBooleanType MagickGetImageWhitePoint(MagickWand *wand,
5654 double *x,double *y)
5656 assert(wand != (MagickWand *) NULL);
5657 assert(wand->signature == WandSignature);
5658 if (IfMagickTrue(wand->debug))
5659 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5660 if (wand->images == (Image *) NULL)
5661 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5662 *x=wand->images->chromaticity.white_point.x;
5663 *y=wand->images->chromaticity.white_point.y;
5668 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5672 % M a g i c k G e t I m a g e W i d t h %
5676 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5678 % MagickGetImageWidth() returns the image width.
5680 % The format of the MagickGetImageWidth method is:
5682 % size_t MagickGetImageWidth(MagickWand *wand)
5684 % A description of each parameter follows:
5686 % o wand: the magick wand.
5689 WandExport size_t MagickGetImageWidth(MagickWand *wand)
5691 assert(wand != (MagickWand *) NULL);
5692 assert(wand->signature == WandSignature);
5693 if (IfMagickTrue(wand->debug))
5694 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5695 if (wand->images == (Image *) NULL)
5696 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5697 return(wand->images->columns);
5701 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5705 % M a g i c k G e t N u m b e r I m a g e s %
5709 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5711 % MagickGetNumberImages() returns the number of images associated with a
5714 % The format of the MagickGetNumberImages method is:
5716 % size_t MagickGetNumberImages(MagickWand *wand)
5718 % A description of each parameter follows:
5720 % o wand: the magick wand.
5723 WandExport size_t MagickGetNumberImages(MagickWand *wand)
5725 assert(wand != (MagickWand *) NULL);
5726 assert(wand->signature == WandSignature);
5727 if (IfMagickTrue(wand->debug))
5728 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5729 return(GetImageListLength(wand->images));
5733 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5737 % 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 %
5741 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5743 % MagickGetImageTotalInkDensity() gets the image total ink density.
5745 % The format of the MagickGetImageTotalInkDensity method is:
5747 % double MagickGetImageTotalInkDensity(MagickWand *wand)
5749 % A description of each parameter follows:
5751 % o wand: the magick wand.
5754 WandExport double MagickGetImageTotalInkDensity(MagickWand *wand)
5756 assert(wand != (MagickWand *) NULL);
5757 assert(wand->signature == WandSignature);
5758 if (IfMagickTrue(wand->debug))
5759 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5760 if (wand->images == (Image *) NULL)
5762 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5763 "ContainsNoImages","`%s'",wand->name);
5766 return(GetImageTotalInkDensity(wand->images,wand->exception));
5770 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5774 % M a g i c k H a l d C l u t I m a g e %
5778 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5780 % MagickHaldClutImage() replaces colors in the image from a Hald color lookup
5781 % table. A Hald color lookup table is a 3-dimensional color cube mapped to 2
5782 % dimensions. Create it with the HALD coder. You can apply any color
5783 % transformation to the Hald image and then use this method to apply the
5784 % transform to the image.
5786 % The format of the MagickHaldClutImage method is:
5788 % MagickBooleanType MagickHaldClutImage(MagickWand *wand,
5789 % const MagickWand *hald_wand)
5791 % A description of each parameter follows:
5793 % o wand: the magick wand.
5795 % o hald_image: the hald CLUT image.
5798 WandExport MagickBooleanType MagickHaldClutImage(MagickWand *wand,
5799 const MagickWand *hald_wand)
5804 assert(wand != (MagickWand *) NULL);
5805 assert(wand->signature == WandSignature);
5806 if (IfMagickTrue(wand->debug))
5807 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5808 if ((wand->images == (Image *) NULL) || (hald_wand->images == (Image *) NULL))
5809 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5810 status=HaldClutImage(wand->images,hald_wand->images,wand->exception);
5815 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5819 % M a g i c k H a s N e x t I m a g e %
5823 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5825 % MagickHasNextImage() returns MagickTrue if the wand has more images when
5826 % traversing the list in the forward direction
5828 % The format of the MagickHasNextImage method is:
5830 % MagickBooleanType MagickHasNextImage(MagickWand *wand)
5832 % A description of each parameter follows:
5834 % o wand: the magick wand.
5837 WandExport MagickBooleanType MagickHasNextImage(MagickWand *wand)
5839 assert(wand != (MagickWand *) NULL);
5840 assert(wand->signature == WandSignature);
5841 if (IfMagickTrue(wand->debug))
5842 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5843 if (wand->images == (Image *) NULL)
5844 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5845 if (GetNextImageInList(wand->images) == (Image *) NULL)
5846 return(MagickFalse);
5851 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5855 % M a g i c k H a s P r e v i o u s I m a g e %
5859 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5861 % MagickHasPreviousImage() returns MagickTrue if the wand has more images when
5862 % traversing the list in the reverse direction
5864 % The format of the MagickHasPreviousImage method is:
5866 % MagickBooleanType MagickHasPreviousImage(MagickWand *wand)
5868 % A description of each parameter follows:
5870 % o wand: the magick wand.
5873 WandExport MagickBooleanType MagickHasPreviousImage(MagickWand *wand)
5875 assert(wand != (MagickWand *) NULL);
5876 assert(wand->signature == WandSignature);
5877 if (IfMagickTrue(wand->debug))
5878 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5879 if (wand->images == (Image *) NULL)
5880 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5881 if (GetPreviousImageInList(wand->images) == (Image *) NULL)
5882 return(MagickFalse);
5887 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5891 % M a g i c k I d e n t i f y I m a g e %
5895 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5897 % MagickIdentifyImage() identifies an image by printing its attributes to the
5898 % file. Attributes include the image width, height, size, and others.
5900 % The format of the MagickIdentifyImage method is:
5902 % const char *MagickIdentifyImage(MagickWand *wand)
5904 % A description of each parameter follows:
5906 % o wand: the magick wand.
5909 WandExport char *MagickIdentifyImage(MagickWand *wand)
5913 filename[MaxTextExtent];
5921 assert(wand != (MagickWand *) NULL);
5922 assert(wand->signature == WandSignature);
5923 if (IfMagickTrue(wand->debug))
5924 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5925 if (wand->images == (Image *) NULL)
5927 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5928 "ContainsNoImages","`%s'",wand->name);
5929 return((char *) NULL);
5931 description=(char *) NULL;
5932 unique_file=AcquireUniqueFileResource(filename);
5934 if (unique_file != -1)
5935 file=fdopen(unique_file,"wb");
5936 if ((unique_file == -1) || (file == (FILE *) NULL))
5938 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5939 "UnableToCreateTemporaryFile","`%s'",wand->name);
5940 return((char *) NULL);
5942 (void) IdentifyImage(wand->images,file,MagickTrue,wand->exception);
5943 (void) fclose(file);
5944 description=FileToString(filename,~0UL,wand->exception);
5945 (void) RelinquishUniqueFileResource(filename);
5946 return(description);
5950 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5954 % M a g i c k I m p l o d e I m a g e %
5958 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5960 % MagickImplodeImage() creates a new image that is a copy of an existing
5961 % one with the image pixels "implode" by the specified percentage. It
5962 % allocates the memory necessary for the new Image structure and returns a
5963 % pointer to the new image.
5965 % The format of the MagickImplodeImage method is:
5967 % MagickBooleanType MagickImplodeImage(MagickWand *wand,
5968 % const double radius,const PixelInterpolateMethod method)
5970 % A description of each parameter follows:
5972 % o wand: the magick wand.
5974 % o amount: Define the extent of the implosion.
5976 % o method: the pixel interpolation method.
5979 WandExport MagickBooleanType MagickImplodeImage(MagickWand *wand,
5980 const double amount,const PixelInterpolateMethod method)
5985 assert(wand != (MagickWand *) NULL);
5986 assert(wand->signature == WandSignature);
5987 if (IfMagickTrue(wand->debug))
5988 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5989 if (wand->images == (Image *) NULL)
5990 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5991 implode_image=ImplodeImage(wand->images,amount,method,wand->exception);
5992 if (implode_image == (Image *) NULL)
5993 return(MagickFalse);
5994 ReplaceImageInList(&wand->images,implode_image);
5999 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6003 % M a g i c k I m p o r t I m a g e P i x e l s %
6007 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6009 % MagickImportImagePixels() accepts pixel datand stores it in the image at the
6010 % location you specify. The method returns MagickFalse on success otherwise
6011 % MagickTrue if an error is encountered. The pixel data can be either char,
6012 % short int, int, ssize_t, float, or double in the order specified by map.
6014 % Suppose your want to upload the first scanline of a 640x480 image from
6015 % character data in red-green-blue order:
6017 % MagickImportImagePixels(wand,0,0,640,1,"RGB",CharPixel,pixels);
6019 % The format of the MagickImportImagePixels method is:
6021 % MagickBooleanType MagickImportImagePixels(MagickWand *wand,
6022 % const ssize_t x,const ssize_t y,const size_t columns,
6023 % const size_t rows,const char *map,const StorageType storage,
6024 % const void *pixels)
6026 % A description of each parameter follows:
6028 % o wand: the magick wand.
6030 % o x, y, columns, rows: These values define the perimeter of a region
6031 % of pixels you want to define.
6033 % o map: This string reflects the expected ordering of the pixel array.
6034 % It can be any combination or order of R = red, G = green, B = blue,
6035 % A = alpha (0 is transparent), O = alpha (0 is opaque), C = cyan,
6036 % Y = yellow, M = magenta, K = black, I = intensity (for grayscale),
6039 % o storage: Define the data type of the pixels. Float and double types are
6040 % expected to be normalized [0..1] otherwise [0..QuantumRange]. Choose from
6041 % these types: CharPixel, ShortPixel, IntegerPixel, LongPixel, FloatPixel,
6044 % o pixels: This array of values contain the pixel components as defined by
6045 % map and type. You must preallocate this array where the expected
6046 % length varies depending on the values of width, height, map, and type.
6049 WandExport MagickBooleanType MagickImportImagePixels(MagickWand *wand,
6050 const ssize_t x,const ssize_t y,const size_t columns,const size_t rows,
6051 const char *map,const StorageType storage,const void *pixels)
6056 assert(wand != (MagickWand *) NULL);
6057 assert(wand->signature == WandSignature);
6058 if (IfMagickTrue(wand->debug))
6059 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6060 if (wand->images == (Image *) NULL)
6061 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6062 status=ImportImagePixels(wand->images,x,y,columns,rows,map,storage,pixels,
6068 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6072 % 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 %
6076 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6078 % MagickInterpolativeResizeImage() resize image using a interpolative
6081 % MagickBooleanType MagickInterpolativeResizeImage(MagickWand *wand,
6082 % const size_t columns,const size_t rows,
6083 % const PixelInterpolateMethod method)
6085 % A description of each parameter follows:
6087 % o wand: the magick wand.
6089 % o columns: the number of columns in the scaled image.
6091 % o rows: the number of rows in the scaled image.
6093 % o interpolate: the pixel interpolation method.
6096 WandExport MagickBooleanType MagickInterpolativeResizeImage(MagickWand *wand,
6097 const size_t columns,const size_t rows,const PixelInterpolateMethod method)
6102 assert(wand != (MagickWand *) NULL);
6103 assert(wand->signature == WandSignature);
6104 if (IfMagickTrue(wand->debug))
6105 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6106 if (wand->images == (Image *) NULL)
6107 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6108 resize_image=InterpolativeResizeImage(wand->images,columns,rows,method,
6110 if (resize_image == (Image *) NULL)
6111 return(MagickFalse);
6112 ReplaceImageInList(&wand->images,resize_image);
6117 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6121 % 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 %
6125 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6127 % MagickInverseFourierTransformImage() implements the inverse discrete
6128 % Fourier transform (DFT) of the image either as a magnitude / phase or real /
6129 % imaginary image pair.
6131 % The format of the MagickInverseFourierTransformImage method is:
6133 % MagickBooleanType MagickInverseFourierTransformImage(
6134 % MagickWand *magnitude_wand,MagickWand *phase_wand,
6135 % const MagickBooleanType magnitude)
6137 % A description of each parameter follows:
6139 % o magnitude_wand: the magnitude or real wand.
6141 % o phase_wand: the phase or imaginary wand.
6143 % o magnitude: if true, return as magnitude / phase pair otherwise a real /
6144 % imaginary image pair.
6147 WandExport MagickBooleanType MagickInverseFourierTransformImage(
6148 MagickWand *magnitude_wand,MagickWand *phase_wand,
6149 const MagickBooleanType magnitude)
6157 assert(magnitude_wand != (MagickWand *) NULL);
6158 assert(magnitude_wand->signature == WandSignature);
6159 if (IfMagickTrue(magnitude_wand->debug))
6160 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",
6161 magnitude_wand->name);
6162 wand=magnitude_wand;
6163 if (magnitude_wand->images == (Image *) NULL)
6164 ThrowWandException(WandError,"ContainsNoImages",
6165 magnitude_wand->name);
6166 assert(phase_wand != (MagickWand *) NULL);
6167 assert(phase_wand->signature == WandSignature);
6168 inverse_image=InverseFourierTransformImage(magnitude_wand->images,
6169 phase_wand->images,magnitude,wand->exception);
6170 if (inverse_image == (Image *) NULL)
6171 return(MagickFalse);
6172 ReplaceImageInList(&wand->images,inverse_image);
6177 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6181 % M a g i c k L a b e l I m a g e %
6185 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6187 % MagickLabelImage() adds a label to your image.
6189 % The format of the MagickLabelImage method is:
6191 % MagickBooleanType MagickLabelImage(MagickWand *wand,const char *label)
6193 % A description of each parameter follows:
6195 % o wand: the magick wand.
6197 % o label: the image label.
6200 WandExport MagickBooleanType MagickLabelImage(MagickWand *wand,
6206 assert(wand != (MagickWand *) NULL);
6207 assert(wand->signature == WandSignature);
6208 if (IfMagickTrue(wand->debug))
6209 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6210 if (wand->images == (Image *) NULL)
6211 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6212 status=SetImageProperty(wand->images,"label",label,wand->exception);
6217 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6221 % M a g i c k L e v e l I m a g e %
6225 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6227 % MagickLevelImage() adjusts the levels of an image by scaling the colors
6228 % falling between specified white and black points to the full available
6229 % quantum range. The parameters provided represent the black, mid, and white
6230 % points. The black point specifies the darkest color in the image. Colors
6231 % darker than the black point are set to zero. Mid point specifies a gamma
6232 % correction to apply to the image. White point specifies the lightest color
6233 % in the image. Colors brighter than the white point are set to the maximum
6236 % The format of the MagickLevelImage method is:
6238 % MagickBooleanType MagickLevelImage(MagickWand *wand,
6239 % const double black_point,const double gamma,const double white_point)
6240 % MagickBooleanType MagickLevelImage(MagickWand *wand,
6241 % const ChannelType channel,const double black_point,const double gamma,
6242 % const double white_point)
6244 % A description of each parameter follows:
6246 % o wand: the magick wand.
6248 % o channel: Identify which channel to level: RedPixelChannel,
6249 % GreenPixelChannel, etc.
6251 % o black_point: the black point.
6253 % o gamma: the gamma.
6255 % o white_point: the white point.
6258 WandExport MagickBooleanType MagickLevelImage(MagickWand *wand,
6259 const double black_point,const double gamma,const double white_point)
6264 assert(wand != (MagickWand *) NULL);
6265 assert(wand->signature == WandSignature);
6266 if (IfMagickTrue(wand->debug))
6267 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6268 if (wand->images == (Image *) NULL)
6269 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6270 status=LevelImage(wand->images,black_point,white_point,gamma,
6276 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6280 % M a g i c k L i n e a r S t r e t c h I m a g e %
6284 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6286 % MagickLinearStretchImage() stretches with saturation the image intensity.
6288 % You can also reduce the influence of a particular channel with a gamma
6291 % The format of the MagickLinearStretchImage method is:
6293 % MagickBooleanType MagickLinearStretchImage(MagickWand *wand,
6294 % const double black_point,const double white_point)
6296 % A description of each parameter follows:
6298 % o wand: the magick wand.
6300 % o black_point: the black point.
6302 % o white_point: the white point.
6305 WandExport MagickBooleanType MagickLinearStretchImage(MagickWand *wand,
6306 const double black_point,const double white_point)
6311 assert(wand != (MagickWand *) NULL);
6312 assert(wand->signature == WandSignature);
6313 if (IfMagickTrue(wand->debug))
6314 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6315 if (wand->images == (Image *) NULL)
6316 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6317 status=LinearStretchImage(wand->images,black_point,white_point,
6323 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6327 % M a g i c k L i q u i d R e s c a l e I m a g e %
6331 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6333 % MagickLiquidRescaleImage() rescales image with seam carving.
6335 % MagickBooleanType MagickLiquidRescaleImage(MagickWand *wand,
6336 % const size_t columns,const size_t rows,
6337 % const double delta_x,const double rigidity)
6339 % A description of each parameter follows:
6341 % o wand: the magick wand.
6343 % o columns: the number of columns in the scaled image.
6345 % o rows: the number of rows in the scaled image.
6347 % o delta_x: maximum seam transversal step (0 means straight seams).
6349 % o rigidity: introduce a bias for non-straight seams (typically 0).
6352 WandExport MagickBooleanType MagickLiquidRescaleImage(MagickWand *wand,
6353 const size_t columns,const size_t rows,const double delta_x,
6354 const double rigidity)
6359 assert(wand != (MagickWand *) NULL);
6360 assert(wand->signature == WandSignature);
6361 if (IfMagickTrue(wand->debug))
6362 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6363 if (wand->images == (Image *) NULL)
6364 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6365 rescale_image=LiquidRescaleImage(wand->images,columns,rows,delta_x,
6366 rigidity,wand->exception);
6367 if (rescale_image == (Image *) NULL)
6368 return(MagickFalse);
6369 ReplaceImageInList(&wand->images,rescale_image);
6374 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6378 % M a g i c k M a g n i f y I m a g e %
6382 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6384 % MagickMagnifyImage() is a convenience method that scales an image
6385 % proportionally to twice its original size.
6387 % The format of the MagickMagnifyImage method is:
6389 % MagickBooleanType MagickMagnifyImage(MagickWand *wand)
6391 % A description of each parameter follows:
6393 % o wand: the magick wand.
6396 WandExport MagickBooleanType MagickMagnifyImage(MagickWand *wand)
6401 assert(wand != (MagickWand *) NULL);
6402 assert(wand->signature == WandSignature);
6403 if (IfMagickTrue(wand->debug))
6404 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6405 if (wand->images == (Image *) NULL)
6406 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6407 magnify_image=MagnifyImage(wand->images,wand->exception);
6408 if (magnify_image == (Image *) NULL)
6409 return(MagickFalse);
6410 ReplaceImageInList(&wand->images,magnify_image);
6415 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6419 % M a g i c k M e r g e I m a g e L a y e r s %
6423 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6425 % MagickMergeImageLayers() composes all the image layers from the current
6426 % given image onward to produce a single image of the merged layers.
6428 % The inital canvas's size depends on the given LayerMethod, and is
6429 % initialized using the first images background color. The images
6430 % are then compositied onto that image in sequence using the given
6431 % composition that has been assigned to each individual image.
6433 % The format of the MagickMergeImageLayers method is:
6435 % MagickWand *MagickMergeImageLayers(MagickWand *wand,
6436 % const LayerMethod method)
6438 % A description of each parameter follows:
6440 % o wand: the magick wand.
6442 % o method: the method of selecting the size of the initial canvas.
6444 % MergeLayer: Merge all layers onto a canvas just large enough
6445 % to hold all the actual images. The virtual canvas of the
6446 % first image is preserved but otherwise ignored.
6448 % FlattenLayer: Use the virtual canvas size of first image.
6449 % Images which fall outside this canvas is clipped.
6450 % This can be used to 'fill out' a given virtual canvas.
6452 % MosaicLayer: Start with the virtual canvas of the first image,
6453 % enlarging left and right edges to contain all images.
6454 % Images with negative offsets will be clipped.
6457 WandExport MagickWand *MagickMergeImageLayers(MagickWand *wand,
6458 const LayerMethod method)
6463 assert(wand != (MagickWand *) NULL);
6464 assert(wand->signature == WandSignature);
6465 if (IfMagickTrue(wand->debug))
6466 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6467 if (wand->images == (Image *) NULL)
6468 return((MagickWand *) NULL);
6469 mosaic_image=MergeImageLayers(wand->images,method,wand->exception);
6470 if (mosaic_image == (Image *) NULL)
6471 return((MagickWand *) NULL);
6472 return(CloneMagickWandFromImages(wand,mosaic_image));
6476 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6480 % M a g i c k M i n i f y I m a g e %
6484 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6486 % MagickMinifyImage() is a convenience method that scales an image
6487 % proportionally to one-half its original size
6489 % The format of the MagickMinifyImage method is:
6491 % MagickBooleanType MagickMinifyImage(MagickWand *wand)
6493 % A description of each parameter follows:
6495 % o wand: the magick wand.
6498 WandExport MagickBooleanType MagickMinifyImage(MagickWand *wand)
6503 assert(wand != (MagickWand *) NULL);
6504 assert(wand->signature == WandSignature);
6505 if (IfMagickTrue(wand->debug))
6506 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6507 if (wand->images == (Image *) NULL)
6508 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6509 minify_image=MinifyImage(wand->images,wand->exception);
6510 if (minify_image == (Image *) NULL)
6511 return(MagickFalse);
6512 ReplaceImageInList(&wand->images,minify_image);
6517 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6521 % M a g i c k M o d u l a t e I m a g e %
6525 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6527 % MagickModulateImage() lets you control the brightness, saturation, and hue
6528 % of an image. Hue is the percentage of absolute rotation from the current
6529 % position. For example 50 results in a counter-clockwise rotation of 90
6530 % degrees, 150 results in a clockwise rotation of 90 degrees, with 0 and 200
6531 % both resulting in a rotation of 180 degrees.
6533 % To increase the color brightness by 20% and decrease the color saturation by
6534 % 10% and leave the hue unchanged, use: 120,90,100.
6536 % The format of the MagickModulateImage method is:
6538 % MagickBooleanType MagickModulateImage(MagickWand *wand,
6539 % const double brightness,const double saturation,const double hue)
6541 % A description of each parameter follows:
6543 % o wand: the magick wand.
6545 % o brightness: the percent change in brighness.
6547 % o saturation: the percent change in saturation.
6549 % o hue: the percent change in hue.
6552 WandExport MagickBooleanType MagickModulateImage(MagickWand *wand,
6553 const double brightness,const double saturation,const double hue)
6556 modulate[MaxTextExtent];
6561 assert(wand != (MagickWand *) NULL);
6562 assert(wand->signature == WandSignature);
6563 if (IfMagickTrue(wand->debug))
6564 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6565 if (wand->images == (Image *) NULL)
6566 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6567 (void) FormatLocaleString(modulate,MaxTextExtent,"%g,%g,%g",
6568 brightness,saturation,hue);
6569 status=ModulateImage(wand->images,modulate,wand->exception);
6574 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6578 % M a g i c k M o n t a g e I m a g e %
6582 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6584 % MagickMontageImage() creates a composite image by combining several
6585 % separate images. The images are tiled on the composite image with the name
6586 % of the image optionally appearing just below the individual tile.
6588 % The format of the MagickMontageImage method is:
6590 % MagickWand *MagickMontageImage(MagickWand *wand,
6591 % const DrawingWand drawing_wand,const char *tile_geometry,
6592 % const char *thumbnail_geometry,const MontageMode mode,
6593 % const char *frame)
6595 % A description of each parameter follows:
6597 % o wand: the magick wand.
6599 % o drawing_wand: the drawing wand. The font name, size, and color are
6600 % obtained from this wand.
6602 % o tile_geometry: the number of tiles per row and page (e.g. 6x4+0+0).
6604 % o thumbnail_geometry: Preferred image size and border size of each
6605 % thumbnail (e.g. 120x120+4+3>).
6607 % o mode: Thumbnail framing mode: Frame, Unframe, or Concatenate.
6609 % o frame: Surround the image with an ornamental border (e.g. 15x15+3+3).
6610 % The frame color is that of the thumbnail's matte color.
6613 WandExport MagickWand *MagickMontageImage(MagickWand *wand,
6614 const DrawingWand *drawing_wand,const char *tile_geometry,
6615 const char *thumbnail_geometry,const MontageMode mode,const char *frame)
6629 assert(wand != (MagickWand *) NULL);
6630 assert(wand->signature == WandSignature);
6631 if (IfMagickTrue(wand->debug))
6632 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6633 if (wand->images == (Image *) NULL)
6634 return((MagickWand *) NULL);
6635 montage_info=CloneMontageInfo(wand->image_info,(MontageInfo *) NULL);
6640 (void) CloneString(&montage_info->frame,"15x15+3+3");
6641 montage_info->shadow=MagickTrue;
6646 montage_info->frame=(char *) NULL;
6647 montage_info->shadow=MagickFalse;
6648 montage_info->border_width=0;
6651 case ConcatenateMode:
6653 montage_info->frame=(char *) NULL;
6654 montage_info->shadow=MagickFalse;
6655 (void) CloneString(&montage_info->geometry,"+0+0");
6656 montage_info->border_width=0;
6662 font=DrawGetFont(drawing_wand);
6663 if (font != (char *) NULL)
6664 (void) CloneString(&montage_info->font,font);
6665 if (frame != (char *) NULL)
6666 (void) CloneString(&montage_info->frame,frame);
6667 montage_info->pointsize=DrawGetFontSize(drawing_wand);
6668 pixel_wand=NewPixelWand();
6669 DrawGetFillColor(drawing_wand,pixel_wand);
6670 PixelGetQuantumPacket(pixel_wand,&montage_info->fill);
6671 DrawGetStrokeColor(drawing_wand,pixel_wand);
6672 PixelGetQuantumPacket(pixel_wand,&montage_info->stroke);
6673 pixel_wand=DestroyPixelWand(pixel_wand);
6674 if (thumbnail_geometry != (char *) NULL)
6675 (void) CloneString(&montage_info->geometry,thumbnail_geometry);
6676 if (tile_geometry != (char *) NULL)
6677 (void) CloneString(&montage_info->tile,tile_geometry);
6678 montage_image=MontageImageList(wand->image_info,montage_info,wand->images,
6680 montage_info=DestroyMontageInfo(montage_info);
6681 if (montage_image == (Image *) NULL)
6682 return((MagickWand *) NULL);
6683 return(CloneMagickWandFromImages(wand,montage_image));
6687 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6691 % M a g i c k M o r p h I m a g e s %
6695 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6697 % MagickMorphImages() method morphs a set of images. Both the image pixels
6698 % and size are linearly interpolated to give the appearance of a
6699 % meta-morphosis from one image to the next.
6701 % The format of the MagickMorphImages method is:
6703 % MagickWand *MagickMorphImages(MagickWand *wand,
6704 % const size_t number_frames)
6706 % A description of each parameter follows:
6708 % o wand: the magick wand.
6710 % o number_frames: the number of in-between images to generate.
6713 WandExport MagickWand *MagickMorphImages(MagickWand *wand,
6714 const size_t number_frames)
6719 assert(wand != (MagickWand *) NULL);
6720 assert(wand->signature == WandSignature);
6721 if (IfMagickTrue(wand->debug))
6722 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6723 if (wand->images == (Image *) NULL)
6724 return((MagickWand *) NULL);
6725 morph_image=MorphImages(wand->images,number_frames,wand->exception);
6726 if (morph_image == (Image *) NULL)
6727 return((MagickWand *) NULL);
6728 return(CloneMagickWandFromImages(wand,morph_image));
6732 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6736 % M a g i c k M o r p h o l o g y I m a g e %
6740 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6742 % MagickMorphologyImage() applies a user supplied kernel to the image
6743 % according to the given mophology method.
6745 % The format of the MagickMorphologyImage method is:
6747 % MagickBooleanType MagickMorphologyImage(MagickWand *wand,
6748 % MorphologyMethod method,const ssize_t iterations,KernelInfo *kernel)
6750 % A description of each parameter follows:
6752 % o wand: the magick wand.
6754 % o method: the morphology method to be applied.
6756 % o iterations: apply the operation this many times (or no change).
6757 % A value of -1 means loop until no change found. How this is applied
6758 % may depend on the morphology method. Typically this is a value of 1.
6760 % o kernel: An array of doubles representing the morphology kernel.
6763 WandExport MagickBooleanType MagickMorphologyImage(MagickWand *wand,
6764 MorphologyMethod method,const ssize_t iterations,KernelInfo *kernel)
6769 assert(wand != (MagickWand *) NULL);
6770 assert(wand->signature == WandSignature);
6771 if (IfMagickTrue(wand->debug))
6772 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6773 if (kernel == (const KernelInfo *) NULL)
6774 return(MagickFalse);
6775 if (wand->images == (Image *) NULL)
6776 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6777 morphology_image=MorphologyImage(wand->images,method,iterations,kernel,
6779 if (morphology_image == (Image *) NULL)
6780 return(MagickFalse);
6781 ReplaceImageInList(&wand->images,morphology_image);
6786 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6790 % M a g i c k M o t i o n B l u r I m a g e %
6794 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6796 % MagickMotionBlurImage() simulates motion blur. We convolve the image with a
6797 % Gaussian operator of the given radius and standard deviation (sigma).
6798 % For reasonable results, radius should be larger than sigma. Use a
6799 % radius of 0 and MotionBlurImage() selects a suitable radius for you.
6800 % Angle gives the angle of the blurring motion.
6802 % The format of the MagickMotionBlurImage method is:
6804 % MagickBooleanType MagickMotionBlurImage(MagickWand *wand,
6805 % const double radius,const double sigma,const double angle)
6807 % A description of each parameter follows:
6809 % o wand: the magick wand.
6811 % o radius: the radius of the Gaussian, in pixels, not counting
6814 % o sigma: the standard deviation of the Gaussian, in pixels.
6816 % o angle: Apply the effect along this angle.
6819 WandExport MagickBooleanType MagickMotionBlurImage(MagickWand *wand,
6820 const double radius,const double sigma,const double angle)
6825 assert(wand != (MagickWand *) NULL);
6826 assert(wand->signature == WandSignature);
6827 if (IfMagickTrue(wand->debug))
6828 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6829 if (wand->images == (Image *) NULL)
6830 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6831 blur_image=MotionBlurImage(wand->images,radius,sigma,angle,wand->exception);
6832 if (blur_image == (Image *) NULL)
6833 return(MagickFalse);
6834 ReplaceImageInList(&wand->images,blur_image);
6839 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6843 % M a g i c k N e g a t e I m a g e %
6847 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6849 % MagickNegateImage() negates the colors in the reference image. The
6850 % Grayscale option means that only grayscale values within the image are
6853 % You can also reduce the influence of a particular channel with a gamma
6856 % The format of the MagickNegateImage method is:
6858 % MagickBooleanType MagickNegateImage(MagickWand *wand,
6859 % const MagickBooleanType gray)
6861 % A description of each parameter follows:
6863 % o wand: the magick wand.
6865 % o gray: If MagickTrue, only negate grayscale pixels within the image.
6868 WandExport MagickBooleanType MagickNegateImage(MagickWand *wand,
6869 const MagickBooleanType gray)
6874 assert(wand != (MagickWand *) NULL);
6875 assert(wand->signature == WandSignature);
6876 if (IfMagickTrue(wand->debug))
6877 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6878 if (wand->images == (Image *) NULL)
6879 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6880 status=NegateImage(wand->images,gray,wand->exception);
6885 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6889 % M a g i c k N e w I m a g e %
6893 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6895 % MagickNewImage() adds a blank image canvas of the specified size and
6896 % background color to the wand.
6898 % The format of the MagickNewImage method is:
6900 % MagickBooleanType MagickNewImage(MagickWand *wand,
6901 % const size_t columns,const size_t rows,
6902 % const PixelWand *background)
6904 % A description of each parameter follows:
6906 % o wand: the magick wand.
6908 % o width: the image width.
6910 % o height: the image height.
6912 % o background: the image color.
6915 WandExport MagickBooleanType MagickNewImage(MagickWand *wand,const size_t width,
6916 const size_t height,const PixelWand *background)
6924 assert(wand != (MagickWand *) NULL);
6925 assert(wand->signature == WandSignature);
6926 if (IfMagickTrue(wand->debug))
6927 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6928 PixelGetMagickColor(background,&pixel);
6929 images=NewMagickImage(wand->image_info,width,height,&pixel,wand->exception);
6930 if (images == (Image *) NULL)
6931 return(MagickFalse);
6932 return(InsertImageInWand(wand,images));
6936 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6940 % M a g i c k N e x t I m a g e %
6944 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6946 % MagickNextImage() sets the next image in the wand as the current image.
6948 % It is typically used after MagickResetIterator(), after which its first use
6949 % will set the first image as the current image (unless the wand is empty).
6951 % It will return MagickFalse when no more images are left to be returned
6952 % which happens when the wand is empty, or the current image is the last
6955 % When the above condition (end of image list) is reached, the iterator is
6956 % automaticall set so that you can start using MagickPreviousImage() to
6957 % again iterate over the images in the reverse direction, starting with the
6958 % last image (again). You can jump to this condition immeditally using
6959 % MagickSetLastIterator().
6961 % The format of the MagickNextImage method is:
6963 % MagickBooleanType MagickNextImage(MagickWand *wand)
6965 % A description of each parameter follows:
6967 % o wand: the magick wand.
6970 WandExport MagickBooleanType MagickNextImage(MagickWand *wand)
6972 assert(wand != (MagickWand *) NULL);
6973 assert(wand->signature == WandSignature);
6974 if (IfMagickTrue(wand->debug))
6975 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6976 if (wand->images == (Image *) NULL)
6977 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6978 wand->insert_before=MagickFalse; /* Inserts is now appended */
6979 if (IfMagickTrue(wand->image_pending))
6981 wand->image_pending=MagickFalse;
6984 if (GetNextImageInList(wand->images) == (Image *) NULL)
6986 wand->image_pending=MagickTrue; /* No image, PreviousImage re-gets */
6987 return(MagickFalse);
6989 wand->images=GetNextImageInList(wand->images);
6994 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6998 % M a g i c k N o r m a l i z e I m a g e %
7002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7004 % MagickNormalizeImage() enhances the contrast of a color image by adjusting
7005 % the pixels color to span the entire range of colors available
7007 % You can also reduce the influence of a particular channel with a gamma
7010 % The format of the MagickNormalizeImage method is:
7012 % MagickBooleanType MagickNormalizeImage(MagickWand *wand)
7014 % A description of each parameter follows:
7016 % o wand: the magick wand.
7019 WandExport MagickBooleanType MagickNormalizeImage(MagickWand *wand)
7024 assert(wand != (MagickWand *) NULL);
7025 assert(wand->signature == WandSignature);
7026 if (IfMagickTrue(wand->debug))
7027 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7028 if (wand->images == (Image *) NULL)
7029 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7030 status=NormalizeImage(wand->images,wand->exception);
7035 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7039 % M a g i c k O i l P a i n t I m a g e %
7043 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7045 % MagickOilPaintImage() applies a special effect filter that simulates an oil
7046 % painting. Each pixel is replaced by the most frequent color occurring
7047 % in a circular region defined by radius.
7049 % The format of the MagickOilPaintImage method is:
7051 % MagickBooleanType MagickOilPaintImage(MagickWand *wand,
7052 % const double radius,const double sigma)
7054 % A description of each parameter follows:
7056 % o wand: the magick wand.
7058 % o radius: the radius of the circular neighborhood.
7060 % o sigma: the standard deviation of the Gaussian, in pixels.
7063 WandExport MagickBooleanType MagickOilPaintImage(MagickWand *wand,
7064 const double radius,const double sigma)
7069 assert(wand != (MagickWand *) NULL);
7070 assert(wand->signature == WandSignature);
7071 if (IfMagickTrue(wand->debug))
7072 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7073 if (wand->images == (Image *) NULL)
7074 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7075 paint_image=OilPaintImage(wand->images,radius,sigma,wand->exception);
7076 if (paint_image == (Image *) NULL)
7077 return(MagickFalse);
7078 ReplaceImageInList(&wand->images,paint_image);
7083 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7087 % M a g i c k O p a q u e P a i n t I m a g e %
7091 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7093 % MagickOpaquePaintImage() changes any pixel that matches color with the color
7096 % The format of the MagickOpaquePaintImage method is:
7098 % MagickBooleanType MagickOpaquePaintImage(MagickWand *wand,
7099 % const PixelWand *target,const PixelWand *fill,const double fuzz,
7100 % const MagickBooleanType invert)
7102 % A description of each parameter follows:
7104 % o wand: the magick wand.
7106 % o target: Change this target color to the fill color within the image.
7108 % o fill: the fill pixel wand.
7110 % o fuzz: By default target must match a particular pixel color
7111 % exactly. However, in many cases two colors may differ by a small amount.
7112 % The fuzz member of image defines how much tolerance is acceptable to
7113 % consider two colors as the same. For example, set fuzz to 10 and the
7114 % color red at intensities of 100 and 102 respectively are now interpreted
7115 % as the same color for the purposes of the floodfill.
7117 % o invert: paint any pixel that does not match the target color.
7120 WandExport MagickBooleanType MagickOpaquePaintImage(MagickWand *wand,
7121 const PixelWand *target,const PixelWand *fill,const double fuzz,
7122 const MagickBooleanType invert)
7131 assert(wand != (MagickWand *) NULL);
7132 assert(wand->signature == WandSignature);
7133 if (IfMagickTrue(wand->debug))
7134 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7135 if (wand->images == (Image *) NULL)
7136 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7137 PixelGetMagickColor(target,&target_pixel);
7138 PixelGetMagickColor(fill,&fill_pixel);
7139 wand->images->fuzz=fuzz;
7140 status=OpaquePaintImage(wand->images,&target_pixel,&fill_pixel,invert,
7146 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7150 % 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 %
7154 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7156 % MagickOptimizeImageLayers() compares each image the GIF disposed forms of the
7157 % previous image in the sequence. From this it attempts to select the
7158 % smallest cropped image to replace each frame, while preserving the results
7161 % The format of the MagickOptimizeImageLayers method is:
7163 % MagickWand *MagickOptimizeImageLayers(MagickWand *wand)
7165 % A description of each parameter follows:
7167 % o wand: the magick wand.
7170 WandExport MagickWand *MagickOptimizeImageLayers(MagickWand *wand)
7175 assert(wand != (MagickWand *) NULL);
7176 assert(wand->signature == WandSignature);
7177 if (IfMagickTrue(wand->debug))
7178 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7179 if (wand->images == (Image *) NULL)
7180 return((MagickWand *) NULL);
7181 optimize_image=OptimizeImageLayers(wand->images,wand->exception);
7182 if (optimize_image == (Image *) NULL)
7183 return((MagickWand *) NULL);
7184 return(CloneMagickWandFromImages(wand,optimize_image));
7188 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7192 % 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 %
7196 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7198 % MagickOptimizeImageTransparency() takes a frame optimized GIF animation, and
7199 % compares the overlayed pixels against the disposal image resulting from all
7200 % the previous frames in the animation. Any pixel that does not change the
7201 % disposal image (and thus does not effect the outcome of an overlay) is made
7204 % WARNING: This modifies the current images directly, rather than generate
7205 % a new image sequence.
7206 % The format of the MagickOptimizeImageTransparency method is:
7208 % MagickBooleanType MagickOptimizeImageTransparency(MagickWand *wand)
7210 % A description of each parameter follows:
7212 % o wand: the magick wand.
7215 WandExport MagickBooleanType MagickOptimizeImageTransparency(MagickWand *wand)
7217 assert(wand != (MagickWand *) NULL);
7218 assert(wand->signature == WandSignature);
7219 if (IfMagickTrue(wand->debug))
7220 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7221 if (wand->images == (Image *) NULL)
7222 return(MagickFalse);
7223 OptimizeImageTransparency(wand->images,wand->exception);
7228 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7232 % 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 %
7236 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7238 % MagickOrderedPosterizeImage() performs an ordered dither based on a number
7239 % of pre-defined dithering threshold maps, but over multiple intensity levels,
7240 % which can be different for different channels, according to the input
7243 % The format of the MagickOrderedPosterizeImage method is:
7245 % MagickBooleanType MagickOrderedPosterizeImage(MagickWand *wand,
7246 % const char *threshold_map)
7248 % A description of each parameter follows:
7250 % o image: the image.
7252 % o threshold_map: A string containing the name of the threshold dither
7253 % map to use, followed by zero or more numbers representing the number of
7254 % color levels tho dither between.
7256 % Any level number less than 2 is equivalent to 2, and means only binary
7257 % dithering will be applied to each color channel.
7259 % No numbers also means a 2 level (bitmap) dither will be applied to all
7260 % channels, while a single number is the number of levels applied to each
7261 % channel in sequence. More numbers will be applied in turn to each of
7262 % the color channels.
7264 % For example: "o3x3,6" generates a 6 level posterization of the image
7265 % with a ordered 3x3 diffused pixel dither being applied between each
7266 % level. While checker,8,8,4 will produce a 332 colormaped image with
7267 % only a single checkerboard hash pattern (50% grey) between each color
7268 % level, to basically double the number of color levels with a bare
7269 % minimim of dithering.
7272 WandExport MagickBooleanType MagickOrderedPosterizeImage(MagickWand *wand,
7273 const char *threshold_map)
7278 assert(wand != (MagickWand *) NULL);
7279 assert(wand->signature == WandSignature);
7280 if (IfMagickTrue(wand->debug))
7281 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7282 if (wand->images == (Image *) NULL)
7283 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7284 status=OrderedPosterizeImage(wand->images,threshold_map,wand->exception);
7289 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7293 % M a g i c k P i n g I m a g e %
7297 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7299 % MagickPingImage() is the same as MagickReadImage() except the only valid
7300 % information returned is the image width, height, size, and format. It
7301 % is designed to efficiently obtain this information from a file without
7302 % reading the entire image sequence into memory.
7304 % The format of the MagickPingImage method is:
7306 % MagickBooleanType MagickPingImage(MagickWand *wand,const char *filename)
7308 % A description of each parameter follows:
7310 % o wand: the magick wand.
7312 % o filename: the image filename.
7315 WandExport MagickBooleanType MagickPingImage(MagickWand *wand,
7316 const char *filename)
7324 assert(wand != (MagickWand *) NULL);
7325 assert(wand->signature == WandSignature);
7326 if (IfMagickTrue(wand->debug))
7327 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7328 ping_info=CloneImageInfo(wand->image_info);
7329 if (filename != (const char *) NULL)
7330 (void) CopyMagickString(ping_info->filename,filename,MaxTextExtent);
7331 images=PingImage(ping_info,wand->exception);
7332 ping_info=DestroyImageInfo(ping_info);
7333 if (images == (Image *) NULL)
7334 return(MagickFalse);
7335 return(InsertImageInWand(wand,images));
7339 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7343 % M a g i c k P i n g I m a g e B l o b %
7347 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7349 % MagickPingImageBlob() pings an image or image sequence from a blob.
7351 % The format of the MagickPingImageBlob method is:
7353 % MagickBooleanType MagickPingImageBlob(MagickWand *wand,
7354 % const void *blob,const size_t length)
7356 % A description of each parameter follows:
7358 % o wand: the magick wand.
7362 % o length: the blob length.
7365 WandExport MagickBooleanType MagickPingImageBlob(MagickWand *wand,
7366 const void *blob,const size_t length)
7374 assert(wand != (MagickWand *) NULL);
7375 assert(wand->signature == WandSignature);
7376 if (IfMagickTrue(wand->debug))
7377 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7378 read_info=CloneImageInfo(wand->image_info);
7379 SetImageInfoBlob(read_info,blob,length);
7380 images=PingImage(read_info,wand->exception);
7381 read_info=DestroyImageInfo(read_info);
7382 if (images == (Image *) NULL)
7383 return(MagickFalse);
7384 return(InsertImageInWand(wand,images));
7388 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7392 % M a g i c k P i n g I m a g e F i l e %
7396 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7398 % MagickPingImageFile() pings an image or image sequence from an open file
7401 % The format of the MagickPingImageFile method is:
7403 % MagickBooleanType MagickPingImageFile(MagickWand *wand,FILE *file)
7405 % A description of each parameter follows:
7407 % o wand: the magick wand.
7409 % o file: the file descriptor.
7412 WandExport MagickBooleanType MagickPingImageFile(MagickWand *wand,FILE *file)
7420 assert(wand != (MagickWand *) NULL);
7421 assert(wand->signature == WandSignature);
7422 assert(file != (FILE *) NULL);
7423 if (IfMagickTrue(wand->debug))
7424 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7425 read_info=CloneImageInfo(wand->image_info);
7426 SetImageInfoFile(read_info,file);
7427 images=PingImage(read_info,wand->exception);
7428 read_info=DestroyImageInfo(read_info);
7429 if (images == (Image *) NULL)
7430 return(MagickFalse);
7431 return(InsertImageInWand(wand,images));
7435 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7439 % M a g i c k P o l a r o i d I m a g e %
7443 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7445 % MagickPolaroidImage() simulates a Polaroid picture.
7447 % The format of the MagickPolaroidImage method is:
7449 % MagickBooleanType MagickPolaroidImage(MagickWand *wand,
7450 % const DrawingWand *drawing_wand,const char *caption,const double angle,
7451 % const PixelInterpolateMethod method)
7453 % A description of each parameter follows:
7455 % o wand: the magick wand.
7457 % o drawing_wand: the draw wand.
7459 % o caption: the Polaroid caption.
7461 % o angle: Apply the effect along this angle.
7463 % o method: the pixel interpolation method.
7466 WandExport MagickBooleanType MagickPolaroidImage(MagickWand *wand,
7467 const DrawingWand *drawing_wand,const char *caption,const double angle,
7468 const PixelInterpolateMethod method)
7476 assert(wand != (MagickWand *) NULL);
7477 assert(wand->signature == WandSignature);
7478 if (IfMagickTrue(wand->debug))
7479 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7480 if (wand->images == (Image *) NULL)
7481 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7482 draw_info=PeekDrawingWand(drawing_wand);
7483 if (draw_info == (DrawInfo *) NULL)
7484 return(MagickFalse);
7485 polaroid_image=PolaroidImage(wand->images,draw_info,caption,angle,method,
7487 if (polaroid_image == (Image *) NULL)
7488 return(MagickFalse);
7489 ReplaceImageInList(&wand->images,polaroid_image);
7494 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7498 % M a g i c k P o s t e r i z e I m a g e %
7502 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7504 % MagickPosterizeImage() reduces the image to a limited number of color level.
7506 % The format of the MagickPosterizeImage method is:
7508 % MagickBooleanType MagickPosterizeImage(MagickWand *wand,
7509 % const size_t levels,const DitherMethod method)
7511 % A description of each parameter follows:
7513 % o wand: the magick wand.
7515 % o levels: Number of color levels allowed in each channel. Very low values
7516 % (2, 3, or 4) have the most visible effect.
7518 % o method: choose the dither method: UndefinedDitherMethod,
7519 % NoDitherMethod, RiemersmaDitherMethod, or FloydSteinbergDitherMethod.
7522 WandExport MagickBooleanType MagickPosterizeImage(MagickWand *wand,
7523 const size_t levels,const DitherMethod dither)
7528 assert(wand != (MagickWand *) NULL);
7529 assert(wand->signature == WandSignature);
7530 if (IfMagickTrue(wand->debug))
7531 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7532 if (wand->images == (Image *) NULL)
7533 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7534 status=PosterizeImage(wand->images,levels,dither,wand->exception);
7539 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7543 % M a g i c k P r e v i e w I m a g e s %
7547 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7549 % MagickPreviewImages() tiles 9 thumbnails of the specified image with an
7550 % image processing operation applied at varying strengths. This helpful
7551 % to quickly pin-point an appropriate parameter for an image processing
7554 % The format of the MagickPreviewImages method is:
7556 % MagickWand *MagickPreviewImages(MagickWand *wand,
7557 % const PreviewType preview)
7559 % A description of each parameter follows:
7561 % o wand: the magick wand.
7563 % o preview: the preview type.
7566 WandExport MagickWand *MagickPreviewImages(MagickWand *wand,
7567 const PreviewType preview)
7572 assert(wand != (MagickWand *) NULL);
7573 assert(wand->signature == WandSignature);
7574 if (IfMagickTrue(wand->debug))
7575 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7576 if (wand->images == (Image *) NULL)
7577 return((MagickWand *) NULL);
7578 preview_image=PreviewImage(wand->images,preview,wand->exception);
7579 if (preview_image == (Image *) NULL)
7580 return((MagickWand *) NULL);
7581 return(CloneMagickWandFromImages(wand,preview_image));
7585 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7589 % M a g i c k P r e v i o u s I m a g e %
7593 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7595 % MagickPreviousImage() sets the previous image in the wand as the current
7598 % It is typically used after MagickSetLastIterator(), after which its first
7599 % use will set the last image as the current image (unless the wand is empty).
7601 % It will return MagickFalse when no more images are left to be returned
7602 % which happens when the wand is empty, or the current image is the first
7603 % image. At that point the iterator is than reset to again process images in
7604 % the forward direction, again starting with the first image in list. Images
7605 % added at this point are prepended.
7607 % Also at that point any images added to the wand using MagickAddImages() or
7608 % MagickReadImages() will be prepended before the first image. In this sense
7609 % the condition is not quite exactly the same as MagickResetIterator().
7611 % The format of the MagickPreviousImage method is:
7613 % MagickBooleanType MagickPreviousImage(MagickWand *wand)
7615 % A description of each parameter follows:
7617 % o wand: the magick wand.
7620 WandExport MagickBooleanType MagickPreviousImage(MagickWand *wand)
7622 assert(wand != (MagickWand *) NULL);
7623 assert(wand->signature == WandSignature);
7624 if (IfMagickTrue(wand->debug))
7625 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7626 if (wand->images == (Image *) NULL)
7627 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7628 if (IfMagickTrue(wand->image_pending))
7630 wand->image_pending=MagickFalse; /* image returned no longer pending */
7633 if (GetPreviousImageInList(wand->images) == (Image *) NULL)
7635 wand->image_pending=MagickTrue; /* Next now re-gets first image */
7636 wand->insert_before=MagickTrue; /* insert/add prepends new images */
7637 return(MagickFalse);
7639 wand->images=GetPreviousImageInList(wand->images);
7644 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7648 % M a g i c k Q u a n t i z e I m a g e %
7652 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7654 % MagickQuantizeImage() analyzes the colors within a reference image and
7655 % chooses a fixed number of colors to represent the image. The goal of the
7656 % algorithm is to minimize the color difference between the input and output
7657 % image while minimizing the processing time.
7659 % The format of the MagickQuantizeImage method is:
7661 % MagickBooleanType MagickQuantizeImage(MagickWand *wand,
7662 % const size_t number_colors,const ColorspaceType colorspace,
7663 % const size_t treedepth,const DitherMethod dither_method,
7664 % const MagickBooleanType measure_error)
7666 % A description of each parameter follows:
7668 % o wand: the magick wand.
7670 % o number_colors: the number of colors.
7672 % o colorspace: Perform color reduction in this colorspace, typically
7675 % o treedepth: Normally, this integer value is zero or one. A zero or
7676 % 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
7677 % reference image with the least amount of memory and the fastest
7678 % computational speed. In some cases, such as an image with low color
7679 % dispersion (a few number of colors), a value other than
7680 % Log4(number_colors) is required. To expand the color tree completely,
7683 % o dither_method: choose from UndefinedDitherMethod, NoDitherMethod,
7684 % RiemersmaDitherMethod, FloydSteinbergDitherMethod.
7686 % o measure_error: A value other than zero measures the difference between
7687 % the original and quantized images. This difference is the total
7688 % quantization error. The error is computed by summing over all pixels
7689 % in an image the distance squared in RGB space between each reference
7690 % pixel value and its quantized value.
7693 WandExport MagickBooleanType MagickQuantizeImage(MagickWand *wand,
7694 const size_t number_colors,const ColorspaceType colorspace,
7695 const size_t treedepth,const DitherMethod dither_method,
7696 const MagickBooleanType measure_error)
7704 assert(wand != (MagickWand *) NULL);
7705 assert(wand->signature == WandSignature);
7706 if (IfMagickTrue(wand->debug))
7707 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7708 if (wand->images == (Image *) NULL)
7709 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7710 quantize_info=CloneQuantizeInfo((QuantizeInfo *) NULL);
7711 quantize_info->number_colors=number_colors;
7712 quantize_info->dither_method=dither_method;
7713 quantize_info->tree_depth=treedepth;
7714 quantize_info->colorspace=colorspace;
7715 quantize_info->measure_error=measure_error;
7716 status=QuantizeImage(quantize_info,wand->images,wand->exception);
7717 quantize_info=DestroyQuantizeInfo(quantize_info);
7722 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7726 % M a g i c k Q u a n t i z e I m a g e s %
7730 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7732 % MagickQuantizeImages() analyzes the colors within a sequence of images and
7733 % chooses a fixed number of colors to represent the image. The goal of the
7734 % algorithm is to minimize the color difference between the input and output
7735 % image while minimizing the processing time.
7737 % The format of the MagickQuantizeImages method is:
7739 % MagickBooleanType MagickQuantizeImages(MagickWand *wand,
7740 % const size_t number_colors,const ColorspaceType colorspace,
7741 % const size_t treedepth,const DitherMethod dither_method,
7742 % const MagickBooleanType measure_error)
7744 % A description of each parameter follows:
7746 % o wand: the magick wand.
7748 % o number_colors: the number of colors.
7750 % o colorspace: Perform color reduction in this colorspace, typically
7753 % o treedepth: Normally, this integer value is zero or one. A zero or
7754 % 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
7755 % reference image with the least amount of memory and the fastest
7756 % computational speed. In some cases, such as an image with low color
7757 % dispersion (a few number of colors), a value other than
7758 % Log4(number_colors) is required. To expand the color tree completely,
7761 % o dither_method: choose from these dither methods: NoDitherMethod,
7762 % RiemersmaDitherMethod, or FloydSteinbergDitherMethod.
7764 % o measure_error: A value other than zero measures the difference between
7765 % the original and quantized images. This difference is the total
7766 % quantization error. The error is computed by summing over all pixels
7767 % in an image the distance squared in RGB space between each reference
7768 % pixel value and its quantized value.
7771 WandExport MagickBooleanType MagickQuantizeImages(MagickWand *wand,
7772 const size_t number_colors,const ColorspaceType colorspace,
7773 const size_t treedepth,const DitherMethod dither_method,
7774 const MagickBooleanType measure_error)
7782 assert(wand != (MagickWand *) NULL);
7783 assert(wand->signature == WandSignature);
7784 if (IfMagickTrue(wand->debug))
7785 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7786 if (wand->images == (Image *) NULL)
7787 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7788 quantize_info=CloneQuantizeInfo((QuantizeInfo *) NULL);
7789 quantize_info->number_colors=number_colors;
7790 quantize_info->dither_method=dither_method;
7791 quantize_info->tree_depth=treedepth;
7792 quantize_info->colorspace=colorspace;
7793 quantize_info->measure_error=measure_error;
7794 status=QuantizeImages(quantize_info,wand->images,wand->exception);
7795 quantize_info=DestroyQuantizeInfo(quantize_info);
7800 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7804 % M a g i c k R o t a t i o n a l B l u r I m a g e %
7808 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7810 % MagickRotationalBlurImage() rotational blurs an image.
7812 % The format of the MagickRotationalBlurImage method is:
7814 % MagickBooleanType MagickRotationalBlurImage(MagickWand *wand,
7815 % const double angle)
7817 % A description of each parameter follows:
7819 % o wand: the magick wand.
7821 % o angle: the angle of the blur in degrees.
7824 WandExport MagickBooleanType MagickRotationalBlurImage(MagickWand *wand,
7830 assert(wand != (MagickWand *) NULL);
7831 assert(wand->signature == WandSignature);
7832 if (IfMagickTrue(wand->debug))
7833 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7834 if (wand->images == (Image *) NULL)
7835 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7836 blur_image=RotationalBlurImage(wand->images,angle,wand->exception);
7837 if (blur_image == (Image *) NULL)
7838 return(MagickFalse);
7839 ReplaceImageInList(&wand->images,blur_image);
7844 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7848 % M a g i c k R a i s e I m a g e %
7852 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7854 % MagickRaiseImage() creates a simulated three-dimensional button-like effect
7855 % by lightening and darkening the edges of the image. Members width and
7856 % height of raise_info define the width of the vertical and horizontal
7857 % edge of the effect.
7859 % The format of the MagickRaiseImage method is:
7861 % MagickBooleanType MagickRaiseImage(MagickWand *wand,
7862 % const size_t width,const size_t height,const ssize_t x,
7863 % const ssize_t y,const MagickBooleanType raise)
7865 % A description of each parameter follows:
7867 % o wand: the magick wand.
7869 % o width,height,x,y: Define the dimensions of the area to raise.
7871 % o raise: A value other than zero creates a 3-D raise effect,
7872 % otherwise it has a lowered effect.
7875 WandExport MagickBooleanType MagickRaiseImage(MagickWand *wand,
7876 const size_t width,const size_t height,const ssize_t x,
7877 const ssize_t y,const MagickBooleanType raise)
7885 assert(wand != (MagickWand *) NULL);
7886 assert(wand->signature == WandSignature);
7887 if (IfMagickTrue(wand->debug))
7888 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7889 if (wand->images == (Image *) NULL)
7890 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7891 raise_info.width=width;
7892 raise_info.height=height;
7895 status=RaiseImage(wand->images,&raise_info,raise,wand->exception);
7900 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7904 % 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 %
7908 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7910 % MagickRandomThresholdImage() changes the value of individual pixels based on
7911 % the intensity of each pixel compared to threshold. The result is a
7912 % high-contrast, two color image.
7914 % The format of the MagickRandomThresholdImage method is:
7916 % MagickBooleanType MagickRandomThresholdImage(MagickWand *wand,
7917 % const double low,const double high)
7919 % A description of each parameter follows:
7921 % o wand: the magick wand.
7923 % o low,high: Specify the high and low thresholds. These values range from
7924 % 0 to QuantumRange.
7927 WandExport MagickBooleanType MagickRandomThresholdImage(MagickWand *wand,
7928 const double low,const double high)
7931 threshold[MaxTextExtent];
7933 assert(wand != (MagickWand *) NULL);
7934 assert(wand->signature == WandSignature);
7935 if (IfMagickTrue(wand->debug))
7936 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7937 if (wand->images == (Image *) NULL)
7938 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7939 (void) FormatLocaleString(threshold,MaxTextExtent,"%gx%g",low,high);
7940 return(RandomThresholdImage(wand->images,threshold,wand->exception));
7944 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7948 % M a g i c k R e a d I m a g e %
7952 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7954 % MagickReadImage() reads an image or image sequence. The images are inserted
7955 % jjust before the current image pointer position.
7957 % Use MagickSetFirstIterator(), to insert new images before all the current
7958 % images in the wand, MagickSetLastIterator() to append add to the end,
7959 % MagickSetImageIndex() to place images just after the given index.
7961 % The format of the MagickReadImage method is:
7963 % MagickBooleanType MagickReadImage(MagickWand *wand,const char *filename)
7965 % A description of each parameter follows:
7967 % o wand: the magick wand.
7969 % o filename: the image filename.
7972 WandExport MagickBooleanType MagickReadImage(MagickWand *wand,
7973 const char *filename)
7981 assert(wand != (MagickWand *) NULL);
7982 assert(wand->signature == WandSignature);
7983 if (IfMagickTrue(wand->debug))
7984 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7985 read_info=CloneImageInfo(wand->image_info);
7986 if (filename != (const char *) NULL)
7987 (void) CopyMagickString(read_info->filename,filename,MaxTextExtent);
7988 images=ReadImage(read_info,wand->exception);
7989 read_info=DestroyImageInfo(read_info);
7990 if (images == (Image *) NULL)
7991 return(MagickFalse);
7992 return(InsertImageInWand(wand,images));
7996 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8000 % M a g i c k R e a d I m a g e B l o b %
8004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8006 % MagickReadImageBlob() reads an image or image sequence from a blob.
8007 % In all other respects it is like MagickReadImage().
8009 % The format of the MagickReadImageBlob method is:
8011 % MagickBooleanType MagickReadImageBlob(MagickWand *wand,
8012 % const void *blob,const size_t length)
8014 % A description of each parameter follows:
8016 % o wand: the magick wand.
8020 % o length: the blob length.
8023 WandExport MagickBooleanType MagickReadImageBlob(MagickWand *wand,
8024 const void *blob,const size_t length)
8029 assert(wand != (MagickWand *) NULL);
8030 assert(wand->signature == WandSignature);
8031 if (IfMagickTrue(wand->debug))
8032 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8033 images=BlobToImage(wand->image_info,blob,length,wand->exception);
8034 if (images == (Image *) NULL)
8035 return(MagickFalse);
8036 return(InsertImageInWand(wand,images));
8040 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8044 % M a g i c k R e a d I m a g e F i l e %
8048 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8050 % MagickReadImageFile() reads an image or image sequence from an already
8051 % opened file descriptor. Otherwise it is like MagickReadImage().
8053 % The format of the MagickReadImageFile method is:
8055 % MagickBooleanType MagickReadImageFile(MagickWand *wand,FILE *file)
8057 % A description of each parameter follows:
8059 % o wand: the magick wand.
8061 % o file: the file descriptor.
8064 WandExport MagickBooleanType MagickReadImageFile(MagickWand *wand,FILE *file)
8072 assert(wand != (MagickWand *) NULL);
8073 assert(wand->signature == WandSignature);
8074 assert(file != (FILE *) NULL);
8075 if (IfMagickTrue(wand->debug))
8076 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8077 read_info=CloneImageInfo(wand->image_info);
8078 SetImageInfoFile(read_info,file);
8079 images=ReadImage(read_info,wand->exception);
8080 read_info=DestroyImageInfo(read_info);
8081 if (images == (Image *) NULL)
8082 return(MagickFalse);
8083 return(InsertImageInWand(wand,images));
8087 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8091 % M a g i c k R e m a p I m a g e %
8095 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8097 % MagickRemapImage() replaces the colors of an image with the closest color
8098 % from a reference image.
8100 % The format of the MagickRemapImage method is:
8102 % MagickBooleanType MagickRemapImage(MagickWand *wand,
8103 % const MagickWand *remap_wand,const DitherMethod method)
8105 % A description of each parameter follows:
8107 % o wand: the magick wand.
8109 % o affinity: the affinity wand.
8111 % o method: choose from these dither methods: NoDitherMethod,
8112 % RiemersmaDitherMethod, or FloydSteinbergDitherMethod.
8115 WandExport MagickBooleanType MagickRemapImage(MagickWand *wand,
8116 const MagickWand *remap_wand,const DitherMethod dither_method)
8124 assert(wand != (MagickWand *) NULL);
8125 assert(wand->signature == WandSignature);
8126 if (IfMagickTrue(wand->debug))
8127 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8128 if ((wand->images == (Image *) NULL) ||
8129 (remap_wand->images == (Image *) NULL))
8130 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8131 quantize_info=AcquireQuantizeInfo(wand->image_info);
8132 quantize_info->dither_method=dither_method;
8133 status=RemapImage(quantize_info,wand->images,remap_wand->images,
8135 quantize_info=DestroyQuantizeInfo(quantize_info);
8140 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8144 % M a g i c k R e m o v e I m a g e %
8148 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8150 % MagickRemoveImage() removes an image from the image list.
8152 % The format of the MagickRemoveImage method is:
8154 % MagickBooleanType MagickRemoveImage(MagickWand *wand)
8156 % A description of each parameter follows:
8158 % o wand: the magick wand.
8160 % o insert: the splice wand.
8163 WandExport MagickBooleanType MagickRemoveImage(MagickWand *wand)
8165 assert(wand != (MagickWand *) NULL);
8166 assert(wand->signature == WandSignature);
8167 if (IfMagickTrue(wand->debug))
8168 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8169 if (wand->images == (Image *) NULL)
8170 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8171 DeleteImageFromList(&wand->images);
8176 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8180 % M a g i c k R e s a m p l e I m a g e %
8184 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8186 % MagickResampleImage() resample image to desired resolution.
8188 % Bessel Blackman Box
8189 % Catrom Cubic Gaussian
8190 % Hanning Hermite Lanczos
8191 % Mitchell Point Quandratic
8194 % Most of the filters are FIR (finite impulse response), however, Bessel,
8195 % Gaussian, and Sinc are IIR (infinite impulse response). Bessel and Sinc
8196 % are windowed (brought down to zero) with the Blackman filter.
8198 % The format of the MagickResampleImage method is:
8200 % MagickBooleanType MagickResampleImage(MagickWand *wand,
8201 % const double x_resolution,const double y_resolution,
8202 % const FilterTypes filter)
8204 % A description of each parameter follows:
8206 % o wand: the magick wand.
8208 % o x_resolution: the new image x resolution.
8210 % o y_resolution: the new image y resolution.
8212 % o filter: Image filter to use.
8215 WandExport MagickBooleanType MagickResampleImage(MagickWand *wand,
8216 const double x_resolution,const double y_resolution,const FilterTypes filter)
8221 assert(wand != (MagickWand *) NULL);
8222 assert(wand->signature == WandSignature);
8223 if (IfMagickTrue(wand->debug))
8224 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8225 if (wand->images == (Image *) NULL)
8226 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8227 resample_image=ResampleImage(wand->images,x_resolution,y_resolution,filter,
8229 if (resample_image == (Image *) NULL)
8230 return(MagickFalse);
8231 ReplaceImageInList(&wand->images,resample_image);
8236 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8240 % M a g i c k R e s e t I m a g e P a g e %
8244 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8246 % MagickResetImagePage() resets the Wand page canvas and position.
8248 % The format of the MagickResetImagePage method is:
8250 % MagickBooleanType MagickResetImagePage(MagickWand *wand,
8253 % A description of each parameter follows:
8255 % o wand: the magick wand.
8257 % o page: the relative page specification.
8260 WandExport MagickBooleanType MagickResetImagePage(MagickWand *wand,
8263 assert(wand != (MagickWand *) NULL);
8264 assert(wand->signature == WandSignature);
8265 if (IfMagickTrue(wand->debug))
8266 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8267 if (wand->images == (Image *) NULL)
8268 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8269 if ((page == (char *) NULL) || (*page == '\0'))
8271 (void) ParseAbsoluteGeometry("0x0+0+0",&wand->images->page);
8274 return(ResetImagePage(wand->images,page));
8278 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8282 % M a g i c k R e s i z e I m a g e %
8286 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8288 % MagickResizeImage() scales an image to the desired dimensions with one of
8291 % Bessel Blackman Box
8292 % Catrom Cubic Gaussian
8293 % Hanning Hermite Lanczos
8294 % Mitchell Point Quandratic
8297 % Most of the filters are FIR (finite impulse response), however, Bessel,
8298 % Gaussian, and Sinc are IIR (infinite impulse response). Bessel and Sinc
8299 % are windowed (brought down to zero) with the Blackman filter.
8301 % The format of the MagickResizeImage method is:
8303 % MagickBooleanType MagickResizeImage(MagickWand *wand,
8304 % const size_t columns,const size_t rows,const FilterTypes filter)
8306 % A description of each parameter follows:
8308 % o wand: the magick wand.
8310 % o columns: the number of columns in the scaled image.
8312 % o rows: the number of rows in the scaled image.
8314 % o filter: Image filter to use.
8317 WandExport MagickBooleanType MagickResizeImage(MagickWand *wand,
8318 const size_t columns,const size_t rows,const FilterTypes filter)
8323 assert(wand != (MagickWand *) NULL);
8324 assert(wand->signature == WandSignature);
8325 if (IfMagickTrue(wand->debug))
8326 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8327 if (wand->images == (Image *) NULL)
8328 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8329 resize_image=ResizeImage(wand->images,columns,rows,filter,wand->exception);
8330 if (resize_image == (Image *) NULL)
8331 return(MagickFalse);
8332 ReplaceImageInList(&wand->images,resize_image);
8337 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8341 % M a g i c k R o l l I m a g e %
8345 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8347 % MagickRollImage() offsets an image as defined by x and y.
8349 % The format of the MagickRollImage method is:
8351 % MagickBooleanType MagickRollImage(MagickWand *wand,const ssize_t x,
8354 % A description of each parameter follows:
8356 % o wand: the magick wand.
8358 % o x: the x offset.
8360 % o y: the y offset.
8364 WandExport MagickBooleanType MagickRollImage(MagickWand *wand,
8365 const ssize_t x,const ssize_t y)
8370 assert(wand != (MagickWand *) NULL);
8371 assert(wand->signature == WandSignature);
8372 if (IfMagickTrue(wand->debug))
8373 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8374 if (wand->images == (Image *) NULL)
8375 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8376 roll_image=RollImage(wand->images,x,y,wand->exception);
8377 if (roll_image == (Image *) NULL)
8378 return(MagickFalse);
8379 ReplaceImageInList(&wand->images,roll_image);
8384 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8388 % M a g i c k R o t a t e I m a g e %
8392 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8394 % MagickRotateImage() rotates an image the specified number of degrees. Empty
8395 % triangles left over from rotating the image are filled with the
8398 % The format of the MagickRotateImage method is:
8400 % MagickBooleanType MagickRotateImage(MagickWand *wand,
8401 % const PixelWand *background,const double degrees)
8403 % A description of each parameter follows:
8405 % o wand: the magick wand.
8407 % o background: the background pixel wand.
8409 % o degrees: the number of degrees to rotate the image.
8413 WandExport MagickBooleanType MagickRotateImage(MagickWand *wand,
8414 const PixelWand *background,const double degrees)
8419 assert(wand != (MagickWand *) NULL);
8420 assert(wand->signature == WandSignature);
8421 if (IfMagickTrue(wand->debug))
8422 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8423 if (wand->images == (Image *) NULL)
8424 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8425 PixelGetQuantumPacket(background,&wand->images->background_color);
8426 rotate_image=RotateImage(wand->images,degrees,wand->exception);
8427 if (rotate_image == (Image *) NULL)
8428 return(MagickFalse);
8429 ReplaceImageInList(&wand->images,rotate_image);
8434 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8438 % M a g i c k S a m p l e I m a g e %
8442 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8444 % MagickSampleImage() scales an image to the desired dimensions with pixel
8445 % sampling. Unlike other scaling methods, this method does not introduce
8446 % any additional color into the scaled image.
8448 % The format of the MagickSampleImage method is:
8450 % MagickBooleanType MagickSampleImage(MagickWand *wand,
8451 % const size_t columns,const size_t rows)
8453 % A description of each parameter follows:
8455 % o wand: the magick wand.
8457 % o columns: the number of columns in the scaled image.
8459 % o rows: the number of rows in the scaled image.
8463 WandExport MagickBooleanType MagickSampleImage(MagickWand *wand,
8464 const size_t columns,const size_t rows)
8469 assert(wand != (MagickWand *) NULL);
8470 assert(wand->signature == WandSignature);
8471 if (IfMagickTrue(wand->debug))
8472 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8473 if (wand->images == (Image *) NULL)
8474 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8475 sample_image=SampleImage(wand->images,columns,rows,wand->exception);
8476 if (sample_image == (Image *) NULL)
8477 return(MagickFalse);
8478 ReplaceImageInList(&wand->images,sample_image);
8483 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8487 % M a g i c k S c a l e I m a g e %
8491 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8493 % MagickScaleImage() scales the size of an image to the given dimensions.
8495 % The format of the MagickScaleImage method is:
8497 % MagickBooleanType MagickScaleImage(MagickWand *wand,
8498 % const size_t columns,const size_t rows)
8500 % A description of each parameter follows:
8502 % o wand: the magick wand.
8504 % o columns: the number of columns in the scaled image.
8506 % o rows: the number of rows in the scaled image.
8510 WandExport MagickBooleanType MagickScaleImage(MagickWand *wand,
8511 const size_t columns,const size_t rows)
8516 assert(wand != (MagickWand *) NULL);
8517 assert(wand->signature == WandSignature);
8518 if (IfMagickTrue(wand->debug))
8519 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8520 if (wand->images == (Image *) NULL)
8521 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8522 scale_image=ScaleImage(wand->images,columns,rows,wand->exception);
8523 if (scale_image == (Image *) NULL)
8524 return(MagickFalse);
8525 ReplaceImageInList(&wand->images,scale_image);
8530 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8534 % M a g i c k S e g m e n t I m a g e %
8538 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8540 % MagickSegmentImage() segments an image by analyzing the histograms of the
8541 % color components and identifying units that are homogeneous with the fuzzy
8542 % C-means technique.
8544 % The format of the SegmentImage method is:
8546 % MagickBooleanType MagickSegmentImage(MagickWand *wand,
8547 % const ColorspaceType colorspace,const MagickBooleanType verbose,
8548 % const double cluster_threshold,const double smooth_threshold)
8550 % A description of each parameter follows.
8554 % o colorspace: the image colorspace.
8556 % o verbose: Set to MagickTrue to print detailed information about the
8557 % identified classes.
8559 % o cluster_threshold: This represents the minimum number of pixels
8560 % contained in a hexahedra before it can be considered valid (expressed as
8563 % o smooth_threshold: the smoothing threshold eliminates noise in the second
8564 % derivative of the histogram. As the value is increased, you can expect a
8565 % smoother second derivative.
8568 MagickExport MagickBooleanType MagickSegmentImage(MagickWand *wand,
8569 const ColorspaceType colorspace,const MagickBooleanType verbose,
8570 const double cluster_threshold,const double smooth_threshold)
8575 assert(wand != (MagickWand *) NULL);
8576 assert(wand->signature == WandSignature);
8577 if (IfMagickTrue(wand->debug))
8578 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8579 if (wand->images == (Image *) NULL)
8580 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8581 status=SegmentImage(wand->images,colorspace,verbose,cluster_threshold,
8582 smooth_threshold,wand->exception);
8587 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8591 % M a g i c k S e l e c t i v e B l u r I m a g e %
8595 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8597 % MagickSelectiveBlurImage() selectively blur an image within a contrast
8598 % threshold. It is similar to the unsharpen mask that sharpens everything with
8599 % contrast above a certain threshold.
8601 % The format of the MagickSelectiveBlurImage method is:
8603 % MagickBooleanType MagickSelectiveBlurImage(MagickWand *wand,
8604 % const double radius,const double sigma,const double threshold)
8606 % A description of each parameter follows:
8608 % o wand: the magick wand.
8610 % o radius: the radius of the gaussian, in pixels, not counting the center
8613 % o sigma: the standard deviation of the gaussian, in pixels.
8615 % o threshold: only pixels within this contrast threshold are included
8616 % in the blur operation.
8619 WandExport MagickBooleanType MagickSelectiveBlurImage(MagickWand *wand,
8620 const double radius,const double sigma,const double threshold)
8625 assert(wand != (MagickWand *) NULL);
8626 assert(wand->signature == WandSignature);
8627 if (IfMagickTrue(wand->debug))
8628 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8629 if (wand->images == (Image *) NULL)
8630 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8631 blur_image=SelectiveBlurImage(wand->images,radius,sigma,threshold,
8633 if (blur_image == (Image *) NULL)
8634 return(MagickFalse);
8635 ReplaceImageInList(&wand->images,blur_image);
8640 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8644 % 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 %
8648 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8650 % MagickSeparateImage() separates a channel from the image and returns a
8651 % grayscale image. A channel is a particular color component of each pixel
8654 % The format of the MagickSeparateImage method is:
8656 % MagickBooleanType MagickSeparateImage(MagickWand *wand,
8657 % const ChannelType channel)
8659 % A description of each parameter follows:
8661 % o wand: the magick wand.
8663 % o channel: the channel.
8666 WandExport MagickBooleanType MagickSeparateImage(MagickWand *wand,
8667 const ChannelType channel)
8672 assert(wand != (MagickWand *) NULL);
8673 assert(wand->signature == WandSignature);
8674 if (IfMagickTrue(wand->debug))
8675 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8676 if (wand->images == (Image *) NULL)
8677 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8678 separate_image=SeparateImage(wand->images,channel,wand->exception);
8679 if (separate_image == (Image *) NULL)
8680 return(MagickFalse);
8681 ReplaceImageInList(&wand->images,separate_image);
8686 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8690 % M a g i c k S e p i a T o n e I m a g e %
8694 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8696 % MagickSepiaToneImage() applies a special effect to the image, similar to the
8697 % effect achieved in a photo darkroom by sepia toning. Threshold ranges from
8698 % 0 to QuantumRange and is a measure of the extent of the sepia toning. A
8699 % threshold of 80% is a good starting point for a reasonable tone.
8701 % The format of the MagickSepiaToneImage method is:
8703 % MagickBooleanType MagickSepiaToneImage(MagickWand *wand,
8704 % const double threshold)
8706 % A description of each parameter follows:
8708 % o wand: the magick wand.
8710 % o threshold: Define the extent of the sepia toning.
8713 WandExport MagickBooleanType MagickSepiaToneImage(MagickWand *wand,
8714 const double threshold)
8719 assert(wand != (MagickWand *) NULL);
8720 assert(wand->signature == WandSignature);
8721 if (IfMagickTrue(wand->debug))
8722 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8723 if (wand->images == (Image *) NULL)
8724 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8725 sepia_image=SepiaToneImage(wand->images,threshold,wand->exception);
8726 if (sepia_image == (Image *) NULL)
8727 return(MagickFalse);
8728 ReplaceImageInList(&wand->images,sepia_image);
8733 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8737 % M a g i c k S e t I m a g e %
8741 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8743 % MagickSetImage() replaces the last image returned by MagickSetImageIndex(),
8744 % MagickNextImage(), MagickPreviousImage() with the images from the specified
8747 % The format of the MagickSetImage method is:
8749 % MagickBooleanType MagickSetImage(MagickWand *wand,
8750 % const MagickWand *set_wand)
8752 % A description of each parameter follows:
8754 % o wand: the magick wand.
8756 % o set_wand: the set_wand wand.
8759 WandExport MagickBooleanType MagickSetImage(MagickWand *wand,
8760 const MagickWand *set_wand)
8765 assert(wand != (MagickWand *) NULL);
8766 assert(wand->signature == WandSignature);
8767 if (IfMagickTrue(wand->debug))
8768 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8769 assert(set_wand != (MagickWand *) NULL);
8770 assert(set_wand->signature == WandSignature);
8771 if (IfMagickTrue(wand->debug))
8772 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",set_wand->name);
8773 if (set_wand->images == (Image *) NULL)
8774 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8775 images=CloneImageList(set_wand->images,wand->exception);
8776 if (images == (Image *) NULL)
8777 return(MagickFalse);
8778 ReplaceImageInList(&wand->images,images);
8783 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8787 % 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 %
8791 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8793 % MagickSetImageAlphaChannel() activates, deactivates, resets, or sets the
8796 % The format of the MagickSetImageAlphaChannel method is:
8798 % MagickBooleanType MagickSetImageAlphaChannel(MagickWand *wand,
8799 % const AlphaChannelOption alpha_type)
8801 % A description of each parameter follows:
8803 % o wand: the magick wand.
8805 % o alpha_type: the alpha channel type: ActivateAlphaChannel,
8806 % DeactivateAlphaChannel, OpaqueAlphaChannel, or SetAlphaChannel.
8809 WandExport MagickBooleanType MagickSetImageAlphaChannel(MagickWand *wand,
8810 const AlphaChannelOption alpha_type)
8812 assert(wand != (MagickWand *) NULL);
8813 assert(wand->signature == WandSignature);
8814 if (IfMagickTrue(wand->debug))
8815 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8816 if (wand->images == (Image *) NULL)
8817 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8818 return(SetImageAlphaChannel(wand->images,alpha_type,wand->exception));
8822 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8826 % 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 %
8830 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8832 % MagickSetImageBackgroundColor() sets the image background color.
8834 % The format of the MagickSetImageBackgroundColor method is:
8836 % MagickBooleanType MagickSetImageBackgroundColor(MagickWand *wand,
8837 % const PixelWand *background)
8839 % A description of each parameter follows:
8841 % o wand: the magick wand.
8843 % o background: the background pixel wand.
8846 WandExport MagickBooleanType MagickSetImageBackgroundColor(MagickWand *wand,
8847 const PixelWand *background)
8849 assert(wand != (MagickWand *) NULL);
8850 assert(wand->signature == WandSignature);
8851 if (IfMagickTrue(wand->debug))
8852 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8853 if (wand->images == (Image *) NULL)
8854 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8855 PixelGetQuantumPacket(background,&wand->images->background_color);
8860 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8864 % 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 %
8868 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8870 % MagickSetImageBluePrimary() sets the image chromaticity blue primary point.
8872 % The format of the MagickSetImageBluePrimary method is:
8874 % MagickBooleanType MagickSetImageBluePrimary(MagickWand *wand,
8875 % const double x,const double y)
8877 % A description of each parameter follows:
8879 % o wand: the magick wand.
8881 % o x: the blue primary x-point.
8883 % o y: the blue primary y-point.
8886 WandExport MagickBooleanType MagickSetImageBluePrimary(MagickWand *wand,
8887 const double x,const double y)
8889 assert(wand != (MagickWand *) NULL);
8890 assert(wand->signature == WandSignature);
8891 if (IfMagickTrue(wand->debug))
8892 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8893 if (wand->images == (Image *) NULL)
8894 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8895 wand->images->chromaticity.blue_primary.x=x;
8896 wand->images->chromaticity.blue_primary.y=y;
8901 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8905 % 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 %
8909 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8911 % MagickSetImageBorderColor() sets the image border color.
8913 % The format of the MagickSetImageBorderColor method is:
8915 % MagickBooleanType MagickSetImageBorderColor(MagickWand *wand,
8916 % const PixelWand *border)
8918 % A description of each parameter follows:
8920 % o wand: the magick wand.
8922 % o border: the border pixel wand.
8925 WandExport MagickBooleanType MagickSetImageBorderColor(MagickWand *wand,
8926 const PixelWand *border)
8928 assert(wand != (MagickWand *) NULL);
8929 assert(wand->signature == WandSignature);
8930 if (IfMagickTrue(wand->debug))
8931 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8932 if (wand->images == (Image *) NULL)
8933 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8934 PixelGetQuantumPacket(border,&wand->images->border_color);
8939 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8943 % M a g i c k S e t I m a g e C l i p M a s k %
8947 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8949 % MagickSetImageMask() sets image clip mask.
8951 % The format of the MagickSetImageMask method is:
8953 % MagickBooleanType MagickSetImageMask(MagickWand *wand,
8954 % const MagickWand *clip_mask)
8956 % A description of each parameter follows:
8958 % o wand: the magick wand.
8960 % o clip_mask: the clip_mask wand.
8963 WandExport MagickBooleanType MagickSetImageMask(MagickWand *wand,
8964 const MagickWand *clip_mask)
8966 assert(wand != (MagickWand *) NULL);
8967 assert(wand->signature == WandSignature);
8968 if (IfMagickTrue(wand->debug))
8969 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8970 assert(clip_mask != (MagickWand *) NULL);
8971 assert(clip_mask->signature == WandSignature);
8972 if (IfMagickTrue(clip_mask->debug))
8973 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",clip_mask->name);
8974 if (clip_mask->images == (Image *) NULL)
8975 ThrowWandException(WandError,"ContainsNoImages",clip_mask->name);
8976 return(SetImageMask(wand->images,clip_mask->images,wand->exception));
8980 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8984 % M a g i c k S e t I m a g e C o l o r %
8988 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8990 % MagickSetImageColor() set the entire wand canvas to the specified color.
8992 % The format of the MagickSetImageColor method is:
8994 % MagickBooleanType MagickSetImageColor(MagickWand *wand,
8995 % const PixelWand *color)
8997 % A description of each parameter follows:
8999 % o wand: the magick wand.
9001 % o background: the image color.
9004 WandExport MagickBooleanType MagickSetImageColor(MagickWand *wand,
9005 const PixelWand *color)
9010 assert(wand != (MagickWand *) NULL);
9011 assert(wand->signature == WandSignature);
9012 if (IfMagickTrue(wand->debug))
9013 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9014 PixelGetMagickColor(color,&pixel);
9015 return(SetImageColor(wand->images,&pixel,wand->exception));
9019 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9023 % 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 %
9027 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9029 % MagickSetImageColormapColor() sets the color of the specified colormap
9032 % The format of the MagickSetImageColormapColor method is:
9034 % MagickBooleanType MagickSetImageColormapColor(MagickWand *wand,
9035 % const size_t index,const PixelWand *color)
9037 % A description of each parameter follows:
9039 % o wand: the magick wand.
9041 % o index: the offset into the image colormap.
9043 % o color: Return the colormap color in this wand.
9046 WandExport MagickBooleanType MagickSetImageColormapColor(MagickWand *wand,
9047 const size_t index,const PixelWand *color)
9049 assert(wand != (MagickWand *) NULL);
9050 assert(wand->signature == WandSignature);
9051 if (IfMagickTrue(wand->debug))
9052 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9053 if (wand->images == (Image *) NULL)
9054 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9055 if ((wand->images->colormap == (PixelInfo *) NULL) ||
9056 (index >= wand->images->colors))
9057 ThrowWandException(WandError,"InvalidColormapIndex",wand->name);
9058 PixelGetQuantumPacket(color,wand->images->colormap+index);
9059 return(SyncImage(wand->images,wand->exception));
9063 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9067 % M a g i c k S e t I m a g e C o l o r s p a c e %
9071 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9073 % MagickSetImageColorspace() sets the image colorspace. But does not modify
9076 % The format of the MagickSetImageColorspace method is:
9078 % MagickBooleanType MagickSetImageColorspace(MagickWand *wand,
9079 % const ColorspaceType colorspace)
9081 % A description of each parameter follows:
9083 % o wand: the magick wand.
9085 % o colorspace: the image colorspace: UndefinedColorspace, RGBColorspace,
9086 % GRAYColorspace, TransparentColorspace, OHTAColorspace, XYZColorspace,
9087 % YCbCrColorspace, YCCColorspace, YIQColorspace, YPbPrColorspace,
9088 % YPbPrColorspace, YUVColorspace, CMYKColorspace, sRGBColorspace,
9089 % HSLColorspace, or HWBColorspace.
9092 WandExport MagickBooleanType MagickSetImageColorspace(MagickWand *wand,
9093 const ColorspaceType colorspace)
9095 assert(wand != (MagickWand *) NULL);
9096 assert(wand->signature == WandSignature);
9097 if (IfMagickTrue(wand->debug))
9098 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9099 if (wand->images == (Image *) NULL)
9100 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9101 return(SetImageColorspace(wand->images,colorspace,wand->exception));
9105 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9109 % M a g i c k S e t I m a g e C o m p o s e %
9113 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9115 % MagickSetImageCompose() sets the image composite operator, useful for
9116 % specifying how to composite the image thumbnail when using the
9117 % MagickMontageImage() method.
9119 % The format of the MagickSetImageCompose method is:
9121 % MagickBooleanType MagickSetImageCompose(MagickWand *wand,
9122 % const CompositeOperator compose)
9124 % A description of each parameter follows:
9126 % o wand: the magick wand.
9128 % o compose: the image composite operator.
9131 WandExport MagickBooleanType MagickSetImageCompose(MagickWand *wand,
9132 const CompositeOperator compose)
9134 assert(wand != (MagickWand *) NULL);
9135 assert(wand->signature == WandSignature);
9136 if (IfMagickTrue(wand->debug))
9137 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9138 if (wand->images == (Image *) NULL)
9139 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9140 wand->images->compose=compose;
9145 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9149 % 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 %
9153 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9155 % MagickSetImageCompression() sets the image compression.
9157 % The format of the MagickSetImageCompression method is:
9159 % MagickBooleanType MagickSetImageCompression(MagickWand *wand,
9160 % const CompressionType compression)
9162 % A description of each parameter follows:
9164 % o wand: the magick wand.
9166 % o compression: the image compression type.
9169 WandExport MagickBooleanType MagickSetImageCompression(MagickWand *wand,
9170 const CompressionType compression)
9172 assert(wand != (MagickWand *) NULL);
9173 assert(wand->signature == WandSignature);
9174 if (IfMagickTrue(wand->debug))
9175 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9176 if (wand->images == (Image *) NULL)
9177 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9178 wand->images->compression=compression;
9183 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9187 % 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 %
9191 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9193 % MagickSetImageCompressionQuality() sets the image compression quality.
9195 % The format of the MagickSetImageCompressionQuality method is:
9197 % MagickBooleanType MagickSetImageCompressionQuality(MagickWand *wand,
9198 % const size_t quality)
9200 % A description of each parameter follows:
9202 % o wand: the magick wand.
9204 % o quality: the image compression tlityype.
9207 WandExport MagickBooleanType MagickSetImageCompressionQuality(MagickWand *wand,
9208 const size_t quality)
9210 assert(wand != (MagickWand *) NULL);
9211 assert(wand->signature == WandSignature);
9212 if (IfMagickTrue(wand->debug))
9213 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9214 if (wand->images == (Image *) NULL)
9215 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9216 wand->images->quality=quality;
9221 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9225 % M a g i c k S e t I m a g e D e l a y %
9229 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9231 % MagickSetImageDelay() sets the image delay.
9233 % The format of the MagickSetImageDelay method is:
9235 % MagickBooleanType MagickSetImageDelay(MagickWand *wand,
9236 % const size_t delay)
9238 % A description of each parameter follows:
9240 % o wand: the magick wand.
9242 % o delay: the image delay in ticks-per-second units.
9245 WandExport MagickBooleanType MagickSetImageDelay(MagickWand *wand,
9248 assert(wand != (MagickWand *) NULL);
9249 assert(wand->signature == WandSignature);
9250 if (IfMagickTrue(wand->debug))
9251 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9252 if (wand->images == (Image *) NULL)
9253 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9254 wand->images->delay=delay;
9259 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9263 % M a g i c k S e t I m a g e D e p t h %
9267 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9269 % MagickSetImageDepth() sets the image depth.
9271 % The format of the MagickSetImageDepth method is:
9273 % MagickBooleanType MagickSetImageDepth(MagickWand *wand,
9274 % const size_t depth)
9276 % A description of each parameter follows:
9278 % o wand: the magick wand.
9280 % o depth: the image depth in bits: 8, 16, or 32.
9283 WandExport MagickBooleanType MagickSetImageDepth(MagickWand *wand,
9286 assert(wand != (MagickWand *) NULL);
9287 assert(wand->signature == WandSignature);
9288 if (IfMagickTrue(wand->debug))
9289 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9290 if (wand->images == (Image *) NULL)
9291 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9292 return(SetImageDepth(wand->images,depth,wand->exception));
9296 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9300 % M a g i c k S e t I m a g e D i s p o s e %
9304 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9306 % MagickSetImageDispose() sets the image disposal method.
9308 % The format of the MagickSetImageDispose method is:
9310 % MagickBooleanType MagickSetImageDispose(MagickWand *wand,
9311 % const DisposeType dispose)
9313 % A description of each parameter follows:
9315 % o wand: the magick wand.
9317 % o dispose: the image disposeal type.
9320 WandExport MagickBooleanType MagickSetImageDispose(MagickWand *wand,
9321 const DisposeType dispose)
9323 assert(wand != (MagickWand *) NULL);
9324 assert(wand->signature == WandSignature);
9325 if (IfMagickTrue(wand->debug))
9326 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9327 if (wand->images == (Image *) NULL)
9328 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9329 wand->images->dispose=dispose;
9334 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9338 % M a g i c k S e t I m a g e E n d i a n %
9342 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9344 % MagickSetImageEndian() sets the image endian method.
9346 % The format of the MagickSetImageEndian method is:
9348 % MagickBooleanType MagickSetImageEndian(MagickWand *wand,
9349 % const EndianType endian)
9351 % A description of each parameter follows:
9353 % o wand: the magick wand.
9355 % o endian: the image endian type.
9358 WandExport MagickBooleanType MagickSetImageEndian(MagickWand *wand,
9359 const EndianType endian)
9361 assert(wand != (MagickWand *) NULL);
9362 assert(wand->signature == WandSignature);
9363 if (wand->debug != MagickFalse)
9364 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9365 if (wand->images == (Image *) NULL)
9366 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9367 wand->images->endian=endian;
9372 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9376 % M a g i c k S e t I m a g e E x t e n t %
9380 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9382 % MagickSetImageExtent() sets the image size (i.e. columns & rows).
9384 % The format of the MagickSetImageExtent method is:
9386 % MagickBooleanType MagickSetImageExtent(MagickWand *wand,
9387 % const size_t columns,const unsigned rows)
9389 % A description of each parameter follows:
9391 % o wand: the magick wand.
9393 % o columns: The image width in pixels.
9395 % o rows: The image height in pixels.
9398 WandExport MagickBooleanType MagickSetImageExtent(MagickWand *wand,
9399 const size_t columns,const size_t rows)
9401 assert(wand != (MagickWand *) NULL);
9402 assert(wand->signature == WandSignature);
9403 if (IfMagickTrue(wand->debug))
9404 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9405 if (wand->images == (Image *) NULL)
9406 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9407 return(SetImageExtent(wand->images,columns,rows,wand->exception));
9411 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9415 % M a g i c k S e t I m a g e F i l e n a m e %
9419 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9421 % MagickSetImageFilename() sets the filename of a particular image in a
9424 % The format of the MagickSetImageFilename method is:
9426 % MagickBooleanType MagickSetImageFilename(MagickWand *wand,
9427 % const char *filename)
9429 % A description of each parameter follows:
9431 % o wand: the magick wand.
9433 % o filename: the image filename.
9436 WandExport MagickBooleanType MagickSetImageFilename(MagickWand *wand,
9437 const char *filename)
9439 assert(wand != (MagickWand *) NULL);
9440 assert(wand->signature == WandSignature);
9441 if (IfMagickTrue(wand->debug))
9442 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9443 if (wand->images == (Image *) NULL)
9444 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9445 if (filename != (const char *) NULL)
9446 (void) CopyMagickString(wand->images->filename,filename,MaxTextExtent);
9451 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9455 % M a g i c k S e t I m a g e F o r m a t %
9459 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9461 % MagickSetImageFormat() sets the format of a particular image in a
9464 % The format of the MagickSetImageFormat method is:
9466 % MagickBooleanType MagickSetImageFormat(MagickWand *wand,
9467 % const char *format)
9469 % A description of each parameter follows:
9471 % o wand: the magick wand.
9473 % o format: the image format.
9476 WandExport MagickBooleanType MagickSetImageFormat(MagickWand *wand,
9482 assert(wand != (MagickWand *) NULL);
9483 assert(wand->signature == WandSignature);
9484 if (IfMagickTrue(wand->debug))
9485 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9486 if (wand->images == (Image *) NULL)
9487 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9488 if ((format == (char *) NULL) || (*format == '\0'))
9490 *wand->images->magick='\0';
9493 magick_info=GetMagickInfo(format,wand->exception);
9494 if (magick_info == (const MagickInfo *) NULL)
9495 return(MagickFalse);
9496 ClearMagickException(wand->exception);
9497 (void) CopyMagickString(wand->images->magick,format,MaxTextExtent);
9502 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9506 % M a g i c k S e t I m a g e F u z z %
9510 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9512 % MagickSetImageFuzz() sets the image fuzz.
9514 % The format of the MagickSetImageFuzz method is:
9516 % MagickBooleanType MagickSetImageFuzz(MagickWand *wand,
9517 % const double fuzz)
9519 % A description of each parameter follows:
9521 % o wand: the magick wand.
9523 % o fuzz: the image fuzz.
9526 WandExport MagickBooleanType MagickSetImageFuzz(MagickWand *wand,
9529 assert(wand != (MagickWand *) NULL);
9530 assert(wand->signature == WandSignature);
9531 if (IfMagickTrue(wand->debug))
9532 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9533 if (wand->images == (Image *) NULL)
9534 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9535 wand->images->fuzz=fuzz;
9540 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9544 % M a g i c k S e t I m a g e G a m m a %
9548 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9550 % MagickSetImageGamma() sets the image gamma.
9552 % The format of the MagickSetImageGamma method is:
9554 % MagickBooleanType MagickSetImageGamma(MagickWand *wand,
9555 % const double gamma)
9557 % A description of each parameter follows:
9559 % o wand: the magick wand.
9561 % o gamma: the image gamma.
9564 WandExport MagickBooleanType MagickSetImageGamma(MagickWand *wand,
9567 assert(wand != (MagickWand *) NULL);
9568 assert(wand->signature == WandSignature);
9569 if (IfMagickTrue(wand->debug))
9570 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9571 if (wand->images == (Image *) NULL)
9572 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9573 wand->images->gamma=gamma;
9578 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9582 % M a g i c k S e t I m a g e G r a v i t y %
9586 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9588 % MagickSetImageGravity() sets the image gravity type.
9590 % The format of the MagickSetImageGravity method is:
9592 % MagickBooleanType MagickSetImageGravity(MagickWand *wand,
9593 % const GravityType gravity)
9595 % A description of each parameter follows:
9597 % o wand: the magick wand.
9599 % o gravity: the image interlace scheme: NoInterlace, LineInterlace,
9600 % PlaneInterlace, PartitionInterlace.
9603 WandExport MagickBooleanType MagickSetImageGravity(MagickWand *wand,
9604 const GravityType gravity)
9606 assert(wand != (MagickWand *) NULL);
9607 assert(wand->signature == WandSignature);
9608 if (IfMagickTrue(wand->debug))
9609 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9610 if (wand->images == (Image *) NULL)
9611 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9612 wand->images->gravity=gravity;
9617 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9621 % 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 %
9625 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9627 % MagickSetImageGreenPrimary() sets the image chromaticity green primary
9630 % The format of the MagickSetImageGreenPrimary method is:
9632 % MagickBooleanType MagickSetImageGreenPrimary(MagickWand *wand,
9633 % const double x,const double y)
9635 % A description of each parameter follows:
9637 % o wand: the magick wand.
9639 % o x: the green primary x-point.
9641 % o y: the green primary y-point.
9645 WandExport MagickBooleanType MagickSetImageGreenPrimary(MagickWand *wand,
9646 const double x,const double y)
9648 assert(wand != (MagickWand *) NULL);
9649 assert(wand->signature == WandSignature);
9650 if (IfMagickTrue(wand->debug))
9651 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9652 if (wand->images == (Image *) NULL)
9653 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9654 wand->images->chromaticity.green_primary.x=x;
9655 wand->images->chromaticity.green_primary.y=y;
9660 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9664 % 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 %
9668 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9670 % MagickSetImageInterlaceScheme() sets the image interlace scheme.
9672 % The format of the MagickSetImageInterlaceScheme method is:
9674 % MagickBooleanType MagickSetImageInterlaceScheme(MagickWand *wand,
9675 % const InterlaceType interlace)
9677 % A description of each parameter follows:
9679 % o wand: the magick wand.
9681 % o interlace: the image interlace scheme: NoInterlace, LineInterlace,
9682 % PlaneInterlace, PartitionInterlace.
9685 WandExport MagickBooleanType MagickSetImageInterlaceScheme(MagickWand *wand,
9686 const InterlaceType interlace)
9688 assert(wand != (MagickWand *) NULL);
9689 assert(wand->signature == WandSignature);
9690 if (IfMagickTrue(wand->debug))
9691 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9692 if (wand->images == (Image *) NULL)
9693 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9694 wand->images->interlace=interlace;
9699 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9703 % 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 %
9707 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9709 % MagickSetImagePixelInterpolateMethod() sets the image interpolate pixel
9712 % The format of the MagickSetImagePixelInterpolateMethod method is:
9714 % MagickBooleanType MagickSetImagePixelInterpolateMethod(MagickWand *wand,
9715 % const PixelInterpolateMethod method)
9717 % A description of each parameter follows:
9719 % o wand: the magick wand.
9721 % o method: the image interpole pixel methods: choose from Undefined,
9722 % Average, Bicubic, Bilinear, Filter, Integer, Mesh, NearestNeighbor.
9725 WandExport MagickBooleanType MagickSetImagePixelInterpolateMethod(
9726 MagickWand *wand,const PixelInterpolateMethod method)
9728 assert(wand != (MagickWand *) NULL);
9729 assert(wand->signature == WandSignature);
9730 if (IfMagickTrue(wand->debug))
9731 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9732 if (wand->images == (Image *) NULL)
9733 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9734 wand->images->interpolate=method;
9739 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9743 % M a g i c k S e t I m a g e I t e r a t i o n s %
9747 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9749 % MagickSetImageIterations() sets the image iterations.
9751 % The format of the MagickSetImageIterations method is:
9753 % MagickBooleanType MagickSetImageIterations(MagickWand *wand,
9754 % const size_t iterations)
9756 % A description of each parameter follows:
9758 % o wand: the magick wand.
9760 % o delay: the image delay in 1/100th of a second.
9763 WandExport MagickBooleanType MagickSetImageIterations(MagickWand *wand,
9764 const size_t iterations)
9766 assert(wand != (MagickWand *) NULL);
9767 assert(wand->signature == WandSignature);
9768 if (IfMagickTrue(wand->debug))
9769 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9770 if (wand->images == (Image *) NULL)
9771 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9772 wand->images->iterations=iterations;
9777 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9781 % M a g i c k S e t I m a g e M a t t e %
9785 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9787 % MagickSetImageMatte() sets the image matte channel.
9789 % The format of the MagickSetImageMatteColor method is:
9791 % MagickBooleanType MagickSetImageMatteColor(MagickWand *wand,
9792 % const MagickBooleanType *matte)
9794 % A description of each parameter follows:
9796 % o wand: the magick wand.
9798 % o matte: Set to MagickTrue to enable the image matte channel otherwise
9802 WandExport MagickBooleanType MagickSetImageMatte(MagickWand *wand,
9803 const MagickBooleanType matte)
9805 assert(wand != (MagickWand *) NULL);
9806 assert(wand->signature == WandSignature);
9807 if (IfMagickTrue(wand->debug))
9808 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9809 if (wand->images == (Image *) NULL)
9810 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9811 if ((wand->images->alpha_trait != BlendPixelTrait) && IsMagickTrue(matte))
9812 (void) SetImageAlpha(wand->images,OpaqueAlpha,wand->exception);
9813 wand->images->alpha_trait=matte != MagickFalse ? BlendPixelTrait :
9814 UndefinedPixelTrait;
9819 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9823 % M a g i c k S e t I m a g e M a t t e C o l o r %
9827 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9829 % MagickSetImageMatteColor() sets the image matte color.
9831 % The format of the MagickSetImageMatteColor method is:
9833 % MagickBooleanType MagickSetImageMatteColor(MagickWand *wand,
9834 % const PixelWand *matte)
9836 % A description of each parameter follows:
9838 % o wand: the magick wand.
9840 % o matte: the matte pixel wand.
9843 WandExport MagickBooleanType MagickSetImageMatteColor(MagickWand *wand,
9844 const PixelWand *matte)
9846 assert(wand != (MagickWand *) NULL);
9847 assert(wand->signature == WandSignature);
9848 if (IfMagickTrue(wand->debug))
9849 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9850 if (wand->images == (Image *) NULL)
9851 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9852 PixelGetQuantumPacket(matte,&wand->images->matte_color);
9857 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9861 % M a g i c k S e t I m a g e O p a c i t y %
9865 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9867 % MagickSetImageAlpha() sets the image to the specified alpha level.
9869 % The format of the MagickSetImageAlpha method is:
9871 % MagickBooleanType MagickSetImageAlpha(MagickWand *wand,
9872 % const double alpha)
9874 % A description of each parameter follows:
9876 % o wand: the magick wand.
9878 % o alpha: the level of transparency: 1.0 is fully opaque and 0.0 is fully
9882 WandExport MagickBooleanType MagickSetImageAlpha(MagickWand *wand,
9888 assert(wand != (MagickWand *) NULL);
9889 assert(wand->signature == WandSignature);
9890 if (IfMagickTrue(wand->debug))
9891 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9892 if (wand->images == (Image *) NULL)
9893 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9894 status=SetImageAlpha(wand->images,ClampToQuantum(QuantumRange*alpha),
9900 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9904 % 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 %
9908 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9910 % MagickSetImageOrientation() sets the image orientation.
9912 % The format of the MagickSetImageOrientation method is:
9914 % MagickBooleanType MagickSetImageOrientation(MagickWand *wand,
9915 % const OrientationType orientation)
9917 % A description of each parameter follows:
9919 % o wand: the magick wand.
9921 % o orientation: the image orientation type.
9924 WandExport MagickBooleanType MagickSetImageOrientation(MagickWand *wand,
9925 const OrientationType orientation)
9927 assert(wand != (MagickWand *) NULL);
9928 assert(wand->signature == WandSignature);
9929 if (IfMagickTrue(wand->debug))
9930 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9931 if (wand->images == (Image *) NULL)
9932 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9933 wand->images->orientation=orientation;
9938 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9942 % M a g i c k S e t I m a g e P a g e %
9946 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9948 % MagickSetImagePage() sets the page geometry of the image.
9950 % The format of the MagickSetImagePage method is:
9952 % MagickBooleanType MagickSetImagePage(MagickWand *wand,const size_t width,% const size_t height,const ssize_t x,const ssize_t y)
9954 % A description of each parameter follows:
9956 % o wand: the magick wand.
9958 % o width: the page width.
9960 % o height: the page height.
9962 % o x: the page x-offset.
9964 % o y: the page y-offset.
9967 WandExport MagickBooleanType MagickSetImagePage(MagickWand *wand,
9968 const size_t width,const size_t height,const ssize_t x,
9971 assert(wand != (MagickWand *) NULL);
9972 assert(wand->signature == WandSignature);
9973 if (IfMagickTrue(wand->debug))
9974 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9975 if (wand->images == (Image *) NULL)
9976 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9977 wand->images->page.width=width;
9978 wand->images->page.height=height;
9979 wand->images->page.x=x;
9980 wand->images->page.y=y;
9985 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9989 % 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 %
9993 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9995 % MagickSetImageProgressMonitor() sets the wand image progress monitor to the
9996 % specified method and returns the previous progress monitor if any. The
9997 % progress monitor method looks like this:
9999 % MagickBooleanType MagickProgressMonitor(const char *text,
10000 % const MagickOffsetType offset,const MagickSizeType span,
10001 % void *client_data)
10003 % If the progress monitor returns MagickFalse, the current operation is
10006 % The format of the MagickSetImageProgressMonitor method is:
10008 % MagickProgressMonitor MagickSetImageProgressMonitor(MagickWand *wand
10009 % const MagickProgressMonitor progress_monitor,void *client_data)
10011 % A description of each parameter follows:
10013 % o wand: the magick wand.
10015 % o progress_monitor: Specifies a pointer to a method to monitor progress
10016 % of an image operation.
10018 % o client_data: Specifies a pointer to any client data.
10021 WandExport MagickProgressMonitor MagickSetImageProgressMonitor(MagickWand *wand,
10022 const MagickProgressMonitor progress_monitor,void *client_data)
10024 MagickProgressMonitor
10027 assert(wand != (MagickWand *) NULL);
10028 assert(wand->signature == WandSignature);
10029 if (IfMagickTrue(wand->debug))
10030 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10031 if (wand->images == (Image *) NULL)
10033 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
10034 "ContainsNoImages","`%s'",wand->name);
10035 return((MagickProgressMonitor) NULL);
10037 previous_monitor=SetImageProgressMonitor(wand->images,
10038 progress_monitor,client_data);
10039 return(previous_monitor);
10043 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10047 % M a g i c k S e t I m a g e R e d P r i m a r y %
10051 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10053 % MagickSetImageRedPrimary() sets the image chromaticity red primary point.
10055 % The format of the MagickSetImageRedPrimary method is:
10057 % MagickBooleanType MagickSetImageRedPrimary(MagickWand *wand,
10058 % const double x,const double y)
10060 % A description of each parameter follows:
10062 % o wand: the magick wand.
10064 % o x: the red primary x-point.
10066 % o y: the red primary y-point.
10069 WandExport MagickBooleanType MagickSetImageRedPrimary(MagickWand *wand,
10070 const double x,const double y)
10072 assert(wand != (MagickWand *) NULL);
10073 assert(wand->signature == WandSignature);
10074 if (IfMagickTrue(wand->debug))
10075 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10076 if (wand->images == (Image *) NULL)
10077 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10078 wand->images->chromaticity.red_primary.x=x;
10079 wand->images->chromaticity.red_primary.y=y;
10080 return(MagickTrue);
10084 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10088 % 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 %
10092 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10094 % MagickSetImageRenderingIntent() sets the image rendering intent.
10096 % The format of the MagickSetImageRenderingIntent method is:
10098 % MagickBooleanType MagickSetImageRenderingIntent(MagickWand *wand,
10099 % const RenderingIntent rendering_intent)
10101 % A description of each parameter follows:
10103 % o wand: the magick wand.
10105 % o rendering_intent: the image rendering intent: UndefinedIntent,
10106 % SaturationIntent, PerceptualIntent, AbsoluteIntent, or RelativeIntent.
10109 WandExport MagickBooleanType MagickSetImageRenderingIntent(MagickWand *wand,
10110 const RenderingIntent rendering_intent)
10112 assert(wand != (MagickWand *) NULL);
10113 assert(wand->signature == WandSignature);
10114 if (IfMagickTrue(wand->debug))
10115 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10116 if (wand->images == (Image *) NULL)
10117 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10118 wand->images->rendering_intent=rendering_intent;
10119 return(MagickTrue);
10123 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10127 % M a g i c k S e t I m a g e R e s o l u t i o n %
10131 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10133 % MagickSetImageResolution() sets the image resolution.
10135 % The format of the MagickSetImageResolution method is:
10137 % MagickBooleanType MagickSetImageResolution(MagickWand *wand,
10138 % const double x_resolution,const double y_resolution)
10140 % A description of each parameter follows:
10142 % o wand: the magick wand.
10144 % o x_resolution: the image x resolution.
10146 % o y_resolution: the image y resolution.
10149 WandExport MagickBooleanType MagickSetImageResolution(MagickWand *wand,
10150 const double x_resolution,const double y_resolution)
10152 assert(wand != (MagickWand *) NULL);
10153 assert(wand->signature == WandSignature);
10154 if (IfMagickTrue(wand->debug))
10155 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10156 if (wand->images == (Image *) NULL)
10157 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10158 wand->images->resolution.x=x_resolution;
10159 wand->images->resolution.y=y_resolution;
10160 return(MagickTrue);
10164 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10168 % M a g i c k S e t I m a g e S c e n e %
10172 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10174 % MagickSetImageScene() sets the image scene.
10176 % The format of the MagickSetImageScene method is:
10178 % MagickBooleanType MagickSetImageScene(MagickWand *wand,
10179 % const size_t scene)
10181 % A description of each parameter follows:
10183 % o wand: the magick wand.
10185 % o delay: the image scene number.
10188 WandExport MagickBooleanType MagickSetImageScene(MagickWand *wand,
10189 const size_t scene)
10191 assert(wand != (MagickWand *) NULL);
10192 assert(wand->signature == WandSignature);
10193 if (IfMagickTrue(wand->debug))
10194 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10195 if (wand->images == (Image *) NULL)
10196 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10197 wand->images->scene=scene;
10198 return(MagickTrue);
10202 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10206 % 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 %
10210 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10212 % MagickSetImageTicksPerSecond() sets the image ticks-per-second.
10214 % The format of the MagickSetImageTicksPerSecond method is:
10216 % MagickBooleanType MagickSetImageTicksPerSecond(MagickWand *wand,
10217 % const ssize_t ticks_per-second)
10219 % A description of each parameter follows:
10221 % o wand: the magick wand.
10223 % o ticks_per_second: the units to use for the image delay.
10226 WandExport MagickBooleanType MagickSetImageTicksPerSecond(MagickWand *wand,
10227 const ssize_t ticks_per_second)
10229 assert(wand != (MagickWand *) NULL);
10230 assert(wand->signature == WandSignature);
10231 if (IfMagickTrue(wand->debug))
10232 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10233 if (wand->images == (Image *) NULL)
10234 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10235 wand->images->ticks_per_second=ticks_per_second;
10236 return(MagickTrue);
10240 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10244 % M a g i c k S e t I m a g e T y p e %
10248 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10250 % MagickSetImageType() sets the image type.
10252 % The format of the MagickSetImageType method is:
10254 % MagickBooleanType MagickSetImageType(MagickWand *wand,
10255 % const ImageType image_type)
10257 % A description of each parameter follows:
10259 % o wand: the magick wand.
10261 % o image_type: the image type: UndefinedType, BilevelType, GrayscaleType,
10262 % GrayscaleMatteType, PaletteType, PaletteMatteType, TrueColorType,
10263 % TrueColorMatteType, ColorSeparationType, ColorSeparationMatteType,
10267 WandExport MagickBooleanType MagickSetImageType(MagickWand *wand,
10268 const ImageType image_type)
10270 assert(wand != (MagickWand *) NULL);
10271 assert(wand->signature == WandSignature);
10272 if (IfMagickTrue(wand->debug))
10273 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10274 if (wand->images == (Image *) NULL)
10275 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10276 return(SetImageType(wand->images,image_type,wand->exception));
10280 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10284 % M a g i c k S e t I m a g e U n i t s %
10288 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10290 % MagickSetImageUnits() sets the image units of resolution.
10292 % The format of the MagickSetImageUnits method is:
10294 % MagickBooleanType MagickSetImageUnits(MagickWand *wand,
10295 % const ResolutionType units)
10297 % A description of each parameter follows:
10299 % o wand: the magick wand.
10301 % o units: the image units of resolution : UndefinedResolution,
10302 % PixelsPerInchResolution, or PixelsPerCentimeterResolution.
10305 WandExport MagickBooleanType MagickSetImageUnits(MagickWand *wand,
10306 const ResolutionType units)
10308 assert(wand != (MagickWand *) NULL);
10309 assert(wand->signature == WandSignature);
10310 if (IfMagickTrue(wand->debug))
10311 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10312 if (wand->images == (Image *) NULL)
10313 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10314 wand->images->units=units;
10315 return(MagickTrue);
10319 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10323 % 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 %
10327 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10329 % MagickSetImageVirtualPixelMethod() sets the image virtual pixel method.
10331 % The format of the MagickSetImageVirtualPixelMethod method is:
10333 % VirtualPixelMethod MagickSetImageVirtualPixelMethod(MagickWand *wand,
10334 % const VirtualPixelMethod method)
10336 % A description of each parameter follows:
10338 % o wand: the magick wand.
10340 % o method: the image virtual pixel method : UndefinedVirtualPixelMethod,
10341 % ConstantVirtualPixelMethod, EdgeVirtualPixelMethod,
10342 % MirrorVirtualPixelMethod, or TileVirtualPixelMethod.
10345 WandExport VirtualPixelMethod MagickSetImageVirtualPixelMethod(MagickWand *wand,
10346 const VirtualPixelMethod method)
10348 assert(wand != (MagickWand *) NULL);
10349 assert(wand->signature == WandSignature);
10350 if (IfMagickTrue(wand->debug))
10351 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10352 if (wand->images == (Image *) NULL)
10353 return(UndefinedVirtualPixelMethod);
10354 return(SetImageVirtualPixelMethod(wand->images,method,wand->exception));
10358 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10362 % M a g i c k S e t I m a g e W h i t e P o i n t %
10366 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10368 % MagickSetImageWhitePoint() sets the image chromaticity white point.
10370 % The format of the MagickSetImageWhitePoint method is:
10372 % MagickBooleanType MagickSetImageWhitePoint(MagickWand *wand,
10373 % const double x,const double y)
10375 % A description of each parameter follows:
10377 % o wand: the magick wand.
10379 % o x: the white x-point.
10381 % o y: the white y-point.
10384 WandExport MagickBooleanType MagickSetImageWhitePoint(MagickWand *wand,
10385 const double x,const double y)
10387 assert(wand != (MagickWand *) NULL);
10388 assert(wand->signature == WandSignature);
10389 if (IfMagickTrue(wand->debug))
10390 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10391 if (wand->images == (Image *) NULL)
10392 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10393 wand->images->chromaticity.white_point.x=x;
10394 wand->images->chromaticity.white_point.y=y;
10395 return(MagickTrue);
10399 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10403 % M a g i c k S h a d e I m a g e C h a n n e l %
10407 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10409 % MagickShadeImage() shines a distant light on an image to create a
10410 % three-dimensional effect. You control the positioning of the light with
10411 % azimuth and elevation; azimuth is measured in degrees off the x axis
10412 % and elevation is measured in pixels above the Z axis.
10414 % The format of the MagickShadeImage method is:
10416 % MagickBooleanType MagickShadeImage(MagickWand *wand,
10417 % const MagickBooleanType gray,const double azimuth,
10418 % const double elevation)
10420 % A description of each parameter follows:
10422 % o wand: the magick wand.
10424 % o gray: A value other than zero shades the intensity of each pixel.
10426 % o azimuth, elevation: Define the light source direction.
10429 WandExport MagickBooleanType MagickShadeImage(MagickWand *wand,
10430 const MagickBooleanType gray,const double asimuth,const double elevation)
10435 assert(wand != (MagickWand *) NULL);
10436 assert(wand->signature == WandSignature);
10437 if (IfMagickTrue(wand->debug))
10438 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10439 if (wand->images == (Image *) NULL)
10440 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10441 shade_image=ShadeImage(wand->images,gray,asimuth,elevation,wand->exception);
10442 if (shade_image == (Image *) NULL)
10443 return(MagickFalse);
10444 ReplaceImageInList(&wand->images,shade_image);
10445 return(MagickTrue);
10449 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10453 % M a g i c k S h a d o w I m a g e %
10457 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10459 % MagickShadowImage() simulates an image shadow.
10461 % The format of the MagickShadowImage method is:
10463 % MagickBooleanType MagickShadowImage(MagickWand *wand,const double alpha,
10464 % const double sigma,const ssize_t x,const ssize_t y)
10466 % A description of each parameter follows:
10468 % o wand: the magick wand.
10470 % o alpha: percentage transparency.
10472 % o sigma: the standard deviation of the Gaussian, in pixels.
10474 % o x: the shadow x-offset.
10476 % o y: the shadow y-offset.
10479 WandExport MagickBooleanType MagickShadowImage(MagickWand *wand,
10480 const double alpha,const double sigma,const ssize_t x,const ssize_t y)
10485 assert(wand != (MagickWand *) NULL);
10486 assert(wand->signature == WandSignature);
10487 if (IfMagickTrue(wand->debug))
10488 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10489 if (wand->images == (Image *) NULL)
10490 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10491 shadow_image=ShadowImage(wand->images,alpha,sigma,x,y,wand->exception);
10492 if (shadow_image == (Image *) NULL)
10493 return(MagickFalse);
10494 ReplaceImageInList(&wand->images,shadow_image);
10495 return(MagickTrue);
10499 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10503 % M a g i c k S h a r p e n I m a g e %
10507 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10509 % MagickSharpenImage() sharpens an image. We convolve the image with a
10510 % Gaussian operator of the given radius and standard deviation (sigma).
10511 % For reasonable results, the radius should be larger than sigma. Use a
10512 % radius of 0 and MagickSharpenImage() selects a suitable radius for you.
10514 % The format of the MagickSharpenImage method is:
10516 % MagickBooleanType MagickSharpenImage(MagickWand *wand,
10517 % const double radius,const double sigma)
10519 % A description of each parameter follows:
10521 % o wand: the magick wand.
10523 % o radius: the radius of the Gaussian, in pixels, not counting the center
10526 % o sigma: the standard deviation of the Gaussian, in pixels.
10529 WandExport MagickBooleanType MagickSharpenImage(MagickWand *wand,
10530 const double radius,const double sigma)
10535 assert(wand != (MagickWand *) NULL);
10536 assert(wand->signature == WandSignature);
10537 if (IfMagickTrue(wand->debug))
10538 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10539 if (wand->images == (Image *) NULL)
10540 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10541 sharp_image=SharpenImage(wand->images,radius,sigma,wand->exception);
10542 if (sharp_image == (Image *) NULL)
10543 return(MagickFalse);
10544 ReplaceImageInList(&wand->images,sharp_image);
10545 return(MagickTrue);
10549 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10553 % M a g i c k S h a v e I m a g e %
10557 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10559 % MagickShaveImage() shaves pixels from the image edges. It allocates the
10560 % memory necessary for the new Image structure and returns a pointer to the
10563 % The format of the MagickShaveImage method is:
10565 % MagickBooleanType MagickShaveImage(MagickWand *wand,
10566 % const size_t columns,const size_t rows)
10568 % A description of each parameter follows:
10570 % o wand: the magick wand.
10572 % o columns: the number of columns in the scaled image.
10574 % o rows: the number of rows in the scaled image.
10578 WandExport MagickBooleanType MagickShaveImage(MagickWand *wand,
10579 const size_t columns,const size_t rows)
10587 assert(wand != (MagickWand *) NULL);
10588 assert(wand->signature == WandSignature);
10589 if (IfMagickTrue(wand->debug))
10590 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10591 if (wand->images == (Image *) NULL)
10592 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10593 shave_info.width=columns;
10594 shave_info.height=rows;
10597 shave_image=ShaveImage(wand->images,&shave_info,wand->exception);
10598 if (shave_image == (Image *) NULL)
10599 return(MagickFalse);
10600 ReplaceImageInList(&wand->images,shave_image);
10601 return(MagickTrue);
10605 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10609 % M a g i c k S h e a r I m a g e %
10613 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10615 % MagickShearImage() slides one edge of an image along the X or Y axis,
10616 % creating a parallelogram. An X direction shear slides an edge along the X
10617 % axis, while a Y direction shear slides an edge along the Y axis. The amount
10618 % of the shear is controlled by a shear angle. For X direction shears, x_shear
10619 % is measured relative to the Y axis, and similarly, for Y direction shears
10620 % y_shear is measured relative to the X axis. Empty triangles left over from
10621 % shearing the image are filled with the background color.
10623 % The format of the MagickShearImage method is:
10625 % MagickBooleanType MagickShearImage(MagickWand *wand,
10626 % const PixelWand *background,const double x_shear,const double y_shear)
10628 % A description of each parameter follows:
10630 % o wand: the magick wand.
10632 % o background: the background pixel wand.
10634 % o x_shear: the number of degrees to shear the image.
10636 % o y_shear: the number of degrees to shear the image.
10639 WandExport MagickBooleanType MagickShearImage(MagickWand *wand,
10640 const PixelWand *background,const double x_shear,const double y_shear)
10645 assert(wand != (MagickWand *) NULL);
10646 assert(wand->signature == WandSignature);
10647 if (IfMagickTrue(wand->debug))
10648 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10649 if (wand->images == (Image *) NULL)
10650 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10651 PixelGetQuantumPacket(background,&wand->images->background_color);
10652 shear_image=ShearImage(wand->images,x_shear,y_shear,wand->exception);
10653 if (shear_image == (Image *) NULL)
10654 return(MagickFalse);
10655 ReplaceImageInList(&wand->images,shear_image);
10656 return(MagickTrue);
10660 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10664 % 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 %
10668 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10670 % MagickSigmoidalContrastImage() adjusts the contrast of an image with a
10671 % non-linear sigmoidal contrast algorithm. Increase the contrast of the
10672 % image using a sigmoidal transfer function without saturating highlights or
10673 % shadows. Contrast indicates how much to increase the contrast (0 is none;
10674 % 3 is typical; 20 is pushing it); mid-point indicates where midtones fall in
10675 % the resultant image (0 is white; 50% is middle-gray; 100% is black). Set
10676 % sharpen to MagickTrue to increase the image contrast otherwise the contrast
10679 % The format of the MagickSigmoidalContrastImage method is:
10681 % MagickBooleanType MagickSigmoidalContrastImage(MagickWand *wand,
10682 % const MagickBooleanType sharpen,const double alpha,const double beta)
10684 % A description of each parameter follows:
10686 % o wand: the magick wand.
10688 % o sharpen: Increase or decrease image contrast.
10690 % o alpha: strength of the contrast, the larger the number the more
10691 % 'threshold-like' it becomes.
10693 % o beta: midpoint of the function as a color value 0 to QuantumRange.
10696 WandExport MagickBooleanType MagickSigmoidalContrastImage(
10697 MagickWand *wand,const MagickBooleanType sharpen,const double alpha,
10703 assert(wand != (MagickWand *) NULL);
10704 assert(wand->signature == WandSignature);
10705 if (IfMagickTrue(wand->debug))
10706 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10707 if (wand->images == (Image *) NULL)
10708 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10709 status=SigmoidalContrastImage(wand->images,sharpen,alpha,beta,
10715 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10719 % M a g i c k S i m i l a r i t y I m a g e %
10723 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10725 % MagickSimilarityImage() compares the reference image of the image and
10726 % returns the best match offset. In addition, it returns a similarity image
10727 % such that an exact match location is completely white and if none of the
10728 % pixels match, black, otherwise some gray level in-between.
10730 % The format of the MagickSimilarityImage method is:
10732 % MagickWand *MagickSimilarityImage(MagickWand *wand,
10733 % const MagickWand *reference,const MetricType metric,
10734 % const double similarity_threshold,RectangeInfo *offset,
10735 % double *similarity)
10737 % A description of each parameter follows:
10739 % o wand: the magick wand.
10741 % o reference: the reference wand.
10743 % o metric: the metric.
10745 % o similarity_threshold: minimum distortion for (sub)image match.
10747 % o offset: the best match offset of the reference image within the image.
10749 % o similarity: the computed similarity between the images.
10752 WandExport MagickWand *MagickSimilarityImage(MagickWand *wand,
10753 const MagickWand *reference,const MetricType metric,
10754 const double similarity_threshold,RectangleInfo *offset,double *similarity)
10759 assert(wand != (MagickWand *) NULL);
10760 assert(wand->signature == WandSignature);
10761 if (IfMagickTrue(wand->debug))
10762 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10763 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
10765 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
10766 "ContainsNoImages","`%s'",wand->name);
10767 return((MagickWand *) NULL);
10769 similarity_image=SimilarityImage(wand->images,reference->images,metric,
10770 similarity_threshold,offset,similarity,wand->exception);
10771 if (similarity_image == (Image *) NULL)
10772 return((MagickWand *) NULL);
10773 return(CloneMagickWandFromImages(wand,similarity_image));
10777 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10781 % M a g i c k S k e t c h I m a g e %
10785 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10787 % MagickSketchImage() simulates a pencil sketch. We convolve the image with
10788 % a Gaussian operator of the given radius and standard deviation (sigma).
10789 % For reasonable results, radius should be larger than sigma. Use a
10790 % radius of 0 and SketchImage() selects a suitable radius for you.
10791 % Angle gives the angle of the blurring motion.
10793 % The format of the MagickSketchImage method is:
10795 % MagickBooleanType MagickSketchImage(MagickWand *wand,
10796 % const double radius,const double sigma,const double angle)
10798 % A description of each parameter follows:
10800 % o wand: the magick wand.
10802 % o radius: the radius of the Gaussian, in pixels, not counting
10803 % the center pixel.
10805 % o sigma: the standard deviation of the Gaussian, in pixels.
10807 % o angle: apply the effect along this angle.
10810 WandExport MagickBooleanType MagickSketchImage(MagickWand *wand,
10811 const double radius,const double sigma,const double angle)
10816 assert(wand != (MagickWand *) NULL);
10817 assert(wand->signature == WandSignature);
10818 if (IfMagickTrue(wand->debug))
10819 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10820 if (wand->images == (Image *) NULL)
10821 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10822 sketch_image=SketchImage(wand->images,radius,sigma,angle,wand->exception);
10823 if (sketch_image == (Image *) NULL)
10824 return(MagickFalse);
10825 ReplaceImageInList(&wand->images,sketch_image);
10826 return(MagickTrue);
10830 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10834 % M a g i c k S m u s h I m a g e s %
10838 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10840 % MagickSmushImages() takes all images from the current image pointer to the
10841 % end of the image list and smushs them to each other top-to-bottom if the
10842 % stack parameter is true, otherwise left-to-right.
10844 % The format of the MagickSmushImages method is:
10846 % MagickWand *MagickSmushImages(MagickWand *wand,
10847 % const MagickBooleanType stack,const ssize_t offset)
10849 % A description of each parameter follows:
10851 % o wand: the magick wand.
10853 % o stack: By default, images are stacked left-to-right. Set stack to
10854 % MagickTrue to stack them top-to-bottom.
10856 % o offset: minimum distance in pixels between images.
10859 WandExport MagickWand *MagickSmushImages(MagickWand *wand,
10860 const MagickBooleanType stack,const ssize_t offset)
10865 assert(wand != (MagickWand *) NULL);
10866 assert(wand->signature == WandSignature);
10867 if (IfMagickTrue(wand->debug))
10868 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10869 if (wand->images == (Image *) NULL)
10870 return((MagickWand *) NULL);
10871 smush_image=SmushImages(wand->images,stack,offset,wand->exception);
10872 if (smush_image == (Image *) NULL)
10873 return((MagickWand *) NULL);
10874 return(CloneMagickWandFromImages(wand,smush_image));
10878 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10882 % M a g i c k S o l a r i z e I m a g e %
10886 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10888 % MagickSolarizeImage() applies a special effect to the image, similar to the
10889 % effect achieved in a photo darkroom by selectively exposing areas of photo
10890 % sensitive paper to light. Threshold ranges from 0 to QuantumRange and is a
10891 % measure of the extent of the solarization.
10893 % The format of the MagickSolarizeImage method is:
10895 % MagickBooleanType MagickSolarizeImage(MagickWand *wand,
10896 % const double threshold)
10898 % A description of each parameter follows:
10900 % o wand: the magick wand.
10902 % o threshold: Define the extent of the solarization.
10905 WandExport MagickBooleanType MagickSolarizeImage(MagickWand *wand,
10906 const double threshold)
10911 assert(wand != (MagickWand *) NULL);
10912 assert(wand->signature == WandSignature);
10913 if (IfMagickTrue(wand->debug))
10914 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10915 if (wand->images == (Image *) NULL)
10916 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10917 status=SolarizeImage(wand->images,threshold,wand->exception);
10922 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10926 % M a g i c k S p a r s e C o l o r I m a g e %
10930 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10932 % MagickSparseColorImage(), given a set of coordinates, interpolates the
10933 % colors found at those coordinates, across the whole image, using various
10936 % The format of the MagickSparseColorImage method is:
10938 % MagickBooleanType MagickSparseColorImage(MagickWand *wand,
10939 % const SparseColorMethod method,const size_t number_arguments,
10940 % const double *arguments)
10942 % A description of each parameter follows:
10944 % o image: the image to be sparseed.
10946 % o method: the method of image sparseion.
10948 % ArcSparseColorion will always ignore source image offset, and always
10949 % 'bestfit' the destination image with the top left corner offset
10950 % relative to the polar mapping center.
10952 % Bilinear has no simple inverse mapping so will not allow 'bestfit'
10953 % style of image sparseion.
10955 % Affine, Perspective, and Bilinear, will do least squares fitting of
10956 % the distrotion when more than the minimum number of control point
10957 % pairs are provided.
10959 % Perspective, and Bilinear, will fall back to a Affine sparseion when
10960 % less than 4 control point pairs are provided. While Affine sparseions
10961 % will let you use any number of control point pairs, that is Zero pairs
10962 % is a No-Op (viewport only) distrotion, one pair is a translation and
10963 % two pairs of control points will do a scale-rotate-translate, without
10966 % o number_arguments: the number of arguments given for this sparseion
10969 % o arguments: the arguments for this sparseion method.
10972 WandExport MagickBooleanType MagickSparseColorImage(MagickWand *wand,
10973 const SparseColorMethod method,const size_t number_arguments,
10974 const double *arguments)
10979 assert(wand != (MagickWand *) NULL);
10980 assert(wand->signature == WandSignature);
10981 if (IfMagickTrue(wand->debug))
10982 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10983 if (wand->images == (Image *) NULL)
10984 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10985 sparse_image=SparseColorImage(wand->images,method,number_arguments,arguments,
10987 if (sparse_image == (Image *) NULL)
10988 return(MagickFalse);
10989 ReplaceImageInList(&wand->images,sparse_image);
10990 return(MagickTrue);
10994 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10998 % M a g i c k S p l i c e I m a g e %
11002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11004 % MagickSpliceImage() splices a solid color into the image.
11006 % The format of the MagickSpliceImage method is:
11008 % MagickBooleanType MagickSpliceImage(MagickWand *wand,
11009 % const size_t width,const size_t height,const ssize_t x,
11012 % A description of each parameter follows:
11014 % o wand: the magick wand.
11016 % o width: the region width.
11018 % o height: the region height.
11020 % o x: the region x offset.
11022 % o y: the region y offset.
11025 WandExport MagickBooleanType MagickSpliceImage(MagickWand *wand,
11026 const size_t width,const size_t height,const ssize_t x,
11035 assert(wand != (MagickWand *) NULL);
11036 assert(wand->signature == WandSignature);
11037 if (IfMagickTrue(wand->debug))
11038 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11039 if (wand->images == (Image *) NULL)
11040 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11041 splice.width=width;
11042 splice.height=height;
11045 splice_image=SpliceImage(wand->images,&splice,wand->exception);
11046 if (splice_image == (Image *) NULL)
11047 return(MagickFalse);
11048 ReplaceImageInList(&wand->images,splice_image);
11049 return(MagickTrue);
11053 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11057 % M a g i c k S p r e a d I m a g e %
11061 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11063 % MagickSpreadImage() is a special effects method that randomly displaces each
11064 % pixel in a block defined by the radius parameter.
11066 % The format of the MagickSpreadImage method is:
11068 % MagickBooleanType MagickSpreadImage(MagickWand *wand,const double radius,
11069 % const PixelInterpolateMethod method)
11071 % A description of each parameter follows:
11073 % o wand: the magick wand.
11075 % o radius: Choose a random pixel in a neighborhood of this extent.
11077 % o method: the pixel interpolation method.
11080 WandExport MagickBooleanType MagickSpreadImage(MagickWand *wand,
11081 const double radius,const PixelInterpolateMethod method)
11086 assert(wand != (MagickWand *) NULL);
11087 assert(wand->signature == WandSignature);
11088 if (IfMagickTrue(wand->debug))
11089 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11090 if (wand->images == (Image *) NULL)
11091 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11092 spread_image=SpreadImage(wand->images,radius,method,wand->exception);
11093 if (spread_image == (Image *) NULL)
11094 return(MagickFalse);
11095 ReplaceImageInList(&wand->images,spread_image);
11096 return(MagickTrue);
11100 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11104 % M a g i c k S t a t i s t i c I m a g e %
11108 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11110 % MagickStatisticImage() replace each pixel with corresponding statistic from
11111 % the neighborhood of the specified width and height.
11113 % The format of the MagickStatisticImage method is:
11115 % MagickBooleanType MagickStatisticImage(MagickWand *wand,
11116 % const StatisticType type,const double width,const size_t height)
11118 % A description of each parameter follows:
11120 % o wand: the magick wand.
11122 % o type: the statistic type (e.g. median, mode, etc.).
11124 % o width: the width of the pixel neighborhood.
11126 % o height: the height of the pixel neighborhood.
11129 WandExport MagickBooleanType MagickStatisticImage(MagickWand *wand,
11130 const StatisticType type,const size_t width,const size_t height)
11135 assert(wand != (MagickWand *) NULL);
11136 assert(wand->signature == WandSignature);
11137 if (IfMagickTrue(wand->debug))
11138 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11139 if (wand->images == (Image *) NULL)
11140 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11141 statistic_image=StatisticImage(wand->images,type,width,height,
11143 if (statistic_image == (Image *) NULL)
11144 return(MagickFalse);
11145 ReplaceImageInList(&wand->images,statistic_image);
11146 return(MagickTrue);
11150 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11154 % M a g i c k S t e g a n o I m a g e %
11158 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11160 % MagickSteganoImage() hides a digital watermark within the image.
11161 % Recover the hidden watermark later to prove that the authenticity of
11162 % an image. Offset defines the start position within the image to hide
11165 % The format of the MagickSteganoImage method is:
11167 % MagickWand *MagickSteganoImage(MagickWand *wand,
11168 % const MagickWand *watermark_wand,const ssize_t offset)
11170 % A description of each parameter follows:
11172 % o wand: the magick wand.
11174 % o watermark_wand: the watermark wand.
11176 % o offset: Start hiding at this offset into the image.
11179 WandExport MagickWand *MagickSteganoImage(MagickWand *wand,
11180 const MagickWand *watermark_wand,const ssize_t offset)
11185 assert(wand != (MagickWand *) NULL);
11186 assert(wand->signature == WandSignature);
11187 if (IfMagickTrue(wand->debug))
11188 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11189 if ((wand->images == (Image *) NULL) ||
11190 (watermark_wand->images == (Image *) NULL))
11192 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
11193 "ContainsNoImages","`%s'",wand->name);
11194 return((MagickWand *) NULL);
11196 wand->images->offset=offset;
11197 stegano_image=SteganoImage(wand->images,watermark_wand->images,
11199 if (stegano_image == (Image *) NULL)
11200 return((MagickWand *) NULL);
11201 return(CloneMagickWandFromImages(wand,stegano_image));
11205 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11209 % M a g i c k S t e r e o I m a g e %
11213 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11215 % MagickStereoImage() composites two images and produces a single image that
11216 % is the composite of a left and right image of a stereo pair
11218 % The format of the MagickStereoImage method is:
11220 % MagickWand *MagickStereoImage(MagickWand *wand,
11221 % const MagickWand *offset_wand)
11223 % A description of each parameter follows:
11225 % o wand: the magick wand.
11227 % o offset_wand: Another image wand.
11230 WandExport MagickWand *MagickStereoImage(MagickWand *wand,
11231 const MagickWand *offset_wand)
11236 assert(wand != (MagickWand *) NULL);
11237 assert(wand->signature == WandSignature);
11238 if (IfMagickTrue(wand->debug))
11239 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11240 if ((wand->images == (Image *) NULL) ||
11241 (offset_wand->images == (Image *) NULL))
11243 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
11244 "ContainsNoImages","`%s'",wand->name);
11245 return((MagickWand *) NULL);
11247 stereo_image=StereoImage(wand->images,offset_wand->images,wand->exception);
11248 if (stereo_image == (Image *) NULL)
11249 return((MagickWand *) NULL);
11250 return(CloneMagickWandFromImages(wand,stereo_image));
11254 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11258 % M a g i c k S t r i p I m a g e %
11262 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11264 % MagickStripImage() strips an image of all profiles and comments.
11266 % The format of the MagickStripImage method is:
11268 % MagickBooleanType MagickStripImage(MagickWand *wand)
11270 % A description of each parameter follows:
11272 % o wand: the magick wand.
11275 WandExport MagickBooleanType MagickStripImage(MagickWand *wand)
11277 assert(wand != (MagickWand *) NULL);
11278 assert(wand->signature == WandSignature);
11279 if (IfMagickTrue(wand->debug))
11280 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11281 if (wand->images == (Image *) NULL)
11282 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11283 return(StripImage(wand->images,wand->exception));
11287 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11291 % M a g i c k S w i r l I m a g e %
11295 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11297 % MagickSwirlImage() swirls the pixels about the center of the image, where
11298 % degrees indicates the sweep of the arc through which each pixel is moved.
11299 % You get a more dramatic effect as the degrees move from 1 to 360.
11301 % The format of the MagickSwirlImage method is:
11303 % MagickBooleanType MagickSwirlImage(MagickWand *wand,const double degrees,
11304 % const PixelInterpolateMethod method)
11306 % A description of each parameter follows:
11308 % o wand: the magick wand.
11310 % o degrees: Define the tightness of the swirling effect.
11312 % o method: the pixel interpolation method.
11315 WandExport MagickBooleanType MagickSwirlImage(MagickWand *wand,
11316 const double degrees,const PixelInterpolateMethod method)
11321 assert(wand != (MagickWand *) NULL);
11322 assert(wand->signature == WandSignature);
11323 if (IfMagickTrue(wand->debug))
11324 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11325 if (wand->images == (Image *) NULL)
11326 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11327 swirl_image=SwirlImage(wand->images,degrees,method,wand->exception);
11328 if (swirl_image == (Image *) NULL)
11329 return(MagickFalse);
11330 ReplaceImageInList(&wand->images,swirl_image);
11331 return(MagickTrue);
11335 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11339 % M a g i c k T e x t u r e I m a g e %
11343 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11345 % MagickTextureImage() repeatedly tiles the texture image across and down the
11348 % The format of the MagickTextureImage method is:
11350 % MagickWand *MagickTextureImage(MagickWand *wand,
11351 % const MagickWand *texture_wand)
11353 % A description of each parameter follows:
11355 % o wand: the magick wand.
11357 % o texture_wand: the texture wand
11360 WandExport MagickWand *MagickTextureImage(MagickWand *wand,
11361 const MagickWand *texture_wand)
11369 assert(wand != (MagickWand *) NULL);
11370 assert(wand->signature == WandSignature);
11371 if (IfMagickTrue(wand->debug))
11372 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11373 if ((wand->images == (Image *) NULL) ||
11374 (texture_wand->images == (Image *) NULL))
11376 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
11377 "ContainsNoImages","`%s'",wand->name);
11378 return((MagickWand *) NULL);
11380 texture_image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
11381 if (texture_image == (Image *) NULL)
11382 return((MagickWand *) NULL);
11383 status=TextureImage(texture_image,texture_wand->images,wand->exception);
11384 if (IfMagickFalse(status))
11386 texture_image=DestroyImage(texture_image);
11387 return((MagickWand *) NULL);
11389 return(CloneMagickWandFromImages(wand,texture_image));
11393 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11397 % M a g i c k T h r e s h o l d I m a g e %
11401 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11403 % MagickThresholdImage() changes the value of individual pixels based on
11404 % the intensity of each pixel compared to threshold. The result is a
11405 % high-contrast, two color image.
11407 % The format of the MagickThresholdImage method is:
11409 % MagickBooleanType MagickThresholdImage(MagickWand *wand,
11410 % const double threshold)
11411 % MagickBooleanType MagickThresholdImageChannel(MagickWand *wand,
11412 % const ChannelType channel,const double threshold)
11414 % A description of each parameter follows:
11416 % o wand: the magick wand.
11418 % o channel: the image channel(s).
11420 % o threshold: Define the threshold value.
11423 WandExport MagickBooleanType MagickThresholdImage(MagickWand *wand,
11424 const double threshold)
11429 status=MagickThresholdImageChannel(wand,DefaultChannels,threshold);
11433 WandExport MagickBooleanType MagickThresholdImageChannel(MagickWand *wand,
11434 const ChannelType channel,const double threshold)
11439 assert(wand != (MagickWand *) NULL);
11440 assert(wand->signature == WandSignature);
11441 if (IfMagickTrue(wand->debug))
11442 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11443 if (wand->images == (Image *) NULL)
11444 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11445 status=BilevelImage(wand->images,threshold,wand->exception);
11450 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11454 % M a g i c k T h u m b n a i l I m a g e %
11458 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11460 % MagickThumbnailImage() changes the size of an image to the given dimensions
11461 % and removes any associated profiles. The goal is to produce small low cost
11462 % thumbnail images suited for display on the Web.
11464 % The format of the MagickThumbnailImage method is:
11466 % MagickBooleanType MagickThumbnailImage(MagickWand *wand,
11467 % const size_t columns,const size_t rows)
11469 % A description of each parameter follows:
11471 % o wand: the magick wand.
11473 % o columns: the number of columns in the scaled image.
11475 % o rows: the number of rows in the scaled image.
11478 WandExport MagickBooleanType MagickThumbnailImage(MagickWand *wand,
11479 const size_t columns,const size_t rows)
11484 assert(wand != (MagickWand *) NULL);
11485 assert(wand->signature == WandSignature);
11486 if (IfMagickTrue(wand->debug))
11487 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11488 if (wand->images == (Image *) NULL)
11489 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11490 thumbnail_image=ThumbnailImage(wand->images,columns,rows,wand->exception);
11491 if (thumbnail_image == (Image *) NULL)
11492 return(MagickFalse);
11493 ReplaceImageInList(&wand->images,thumbnail_image);
11494 return(MagickTrue);
11498 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11502 % M a g i c k T i n t I m a g e %
11506 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11508 % MagickTintImage() applies a color vector to each pixel in the image. The
11509 % length of the vector is 0 for black and white and at its maximum for the
11510 % midtones. The vector weighting function is
11511 % f(x)=(1-(4.0*((x-0.5)*(x-0.5)))).
11513 % The format of the MagickTintImage method is:
11515 % MagickBooleanType MagickTintImage(MagickWand *wand,
11516 % const PixelWand *tint,const PixelWand *blend)
11518 % A description of each parameter follows:
11520 % o wand: the magick wand.
11522 % o tint: the tint pixel wand.
11524 % o alpha: the alpha pixel wand.
11527 WandExport MagickBooleanType MagickTintImage(MagickWand *wand,
11528 const PixelWand *tint,const PixelWand *blend)
11531 percent_blend[MaxTextExtent];
11539 assert(wand != (MagickWand *) NULL);
11540 assert(wand->signature == WandSignature);
11541 if (IfMagickTrue(wand->debug))
11542 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11543 if (wand->images == (Image *) NULL)
11544 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11545 if (wand->images->colorspace != CMYKColorspace)
11546 (void) FormatLocaleString(percent_blend,MaxTextExtent,
11547 "%g,%g,%g,%g",(double) (100.0*QuantumScale*
11548 PixelGetRedQuantum(blend)),(double) (100.0*QuantumScale*
11549 PixelGetGreenQuantum(blend)),(double) (100.0*QuantumScale*
11550 PixelGetBlueQuantum(blend)),(double) (100.0*QuantumScale*
11551 PixelGetAlphaQuantum(blend)));
11553 (void) FormatLocaleString(percent_blend,MaxTextExtent,
11554 "%g,%g,%g,%g,%g",(double) (100.0*QuantumScale*
11555 PixelGetCyanQuantum(blend)),(double) (100.0*QuantumScale*
11556 PixelGetMagentaQuantum(blend)),(double) (100.0*QuantumScale*
11557 PixelGetYellowQuantum(blend)),(double) (100.0*QuantumScale*
11558 PixelGetBlackQuantum(blend)),(double) (100.0*QuantumScale*
11559 PixelGetAlphaQuantum(blend)));
11560 target=PixelGetPixel(tint);
11561 tint_image=TintImage(wand->images,percent_blend,&target,wand->exception);
11562 if (tint_image == (Image *) NULL)
11563 return(MagickFalse);
11564 ReplaceImageInList(&wand->images,tint_image);
11565 return(MagickTrue);
11569 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11573 % M a g i c k T r a n s f o r m I m a g e %
11577 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11579 % MagickTransformImage() is a convenience method that behaves like
11580 % MagickResizeImage() or MagickCropImage() but accepts scaling and/or cropping
11581 % information as a region geometry specification. If the operation fails,
11582 % a NULL image handle is returned.
11584 % The format of the MagickTransformImage method is:
11586 % MagickWand *MagickTransformImage(MagickWand *wand,const char *crop,
11587 % const char *geometry)
11589 % A description of each parameter follows:
11591 % o wand: the magick wand.
11593 % o crop: A crop geometry string. This geometry defines a subregion of the
11596 % o geometry: An image geometry string. This geometry defines the final
11597 % size of the image.
11600 WandExport MagickWand *MagickTransformImage(MagickWand *wand,
11601 const char *crop,const char *geometry)
11609 assert(wand != (MagickWand *) NULL);
11610 assert(wand->signature == WandSignature);
11611 if (IfMagickTrue(wand->debug))
11612 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11613 if (wand->images == (Image *) NULL)
11614 return((MagickWand *) NULL);
11615 transform_image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
11616 if (transform_image == (Image *) NULL)
11617 return((MagickWand *) NULL);
11618 status=TransformImage(&transform_image,crop,geometry,wand->exception);
11619 if (IfMagickFalse(status))
11621 transform_image=DestroyImage(transform_image);
11622 return((MagickWand *) NULL);
11624 return(CloneMagickWandFromImages(wand,transform_image));
11628 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11632 % 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 %
11636 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11638 % MagickTransformImageColorspace() transform the image colorspace, setting
11639 % the images colorspace while transforming the images data to that
11642 % The format of the MagickTransformImageColorspace method is:
11644 % MagickBooleanType MagickTransformImageColorspace(MagickWand *wand,
11645 % const ColorspaceType colorspace)
11647 % A description of each parameter follows:
11649 % o wand: the magick wand.
11651 % o colorspace: the image colorspace: UndefinedColorspace,
11652 % sRGBColorspace, RGBColorspace, GRAYColorspace,
11653 % OHTAColorspace, XYZColorspace, YCbCrColorspace,
11654 % YCCColorspace, YIQColorspace, YPbPrColorspace,
11655 % YPbPrColorspace, YUVColorspace, CMYKColorspace,
11656 % HSLColorspace, HWBColorspace.
11659 WandExport MagickBooleanType MagickTransformImageColorspace(MagickWand *wand,
11660 const ColorspaceType colorspace)
11662 assert(wand != (MagickWand *) NULL);
11663 assert(wand->signature == WandSignature);
11664 if (IfMagickTrue(wand->debug))
11665 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11666 if (wand->images == (Image *) NULL)
11667 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11668 return(TransformImageColorspace(wand->images,colorspace,wand->exception));
11672 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11676 % 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 %
11680 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11682 % MagickTransparentPaintImage() changes any pixel that matches color with the
11683 % color defined by fill.
11685 % The format of the MagickTransparentPaintImage method is:
11687 % MagickBooleanType MagickTransparentPaintImage(MagickWand *wand,
11688 % const PixelWand *target,const double alpha,const double fuzz,
11689 % const MagickBooleanType invert)
11691 % A description of each parameter follows:
11693 % o wand: the magick wand.
11695 % o target: Change this target color to specified alpha value within
11698 % o alpha: the level of transparency: 1.0 is fully opaque and 0.0 is fully
11701 % o fuzz: By default target must match a particular pixel color
11702 % exactly. However, in many cases two colors may differ by a small amount.
11703 % The fuzz member of image defines how much tolerance is acceptable to
11704 % consider two colors as the same. For example, set fuzz to 10 and the
11705 % color red at intensities of 100 and 102 respectively are now interpreted
11706 % as the same color for the purposes of the floodfill.
11708 % o invert: paint any pixel that does not match the target color.
11711 WandExport MagickBooleanType MagickTransparentPaintImage(MagickWand *wand,
11712 const PixelWand *target,const double alpha,const double fuzz,
11713 const MagickBooleanType invert)
11721 assert(wand != (MagickWand *) NULL);
11722 assert(wand->signature == WandSignature);
11723 if (IfMagickTrue(wand->debug))
11724 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11725 if (wand->images == (Image *) NULL)
11726 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11727 PixelGetMagickColor(target,&target_pixel);
11728 wand->images->fuzz=fuzz;
11729 status=TransparentPaintImage(wand->images,&target_pixel,ClampToQuantum(
11730 QuantumRange*alpha),invert,wand->exception);
11735 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11739 % M a g i c k T r a n s p o s e I m a g e %
11743 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11745 % MagickTransposeImage() creates a vertical mirror image by reflecting the
11746 % pixels around the central x-axis while rotating them 90-degrees.
11748 % The format of the MagickTransposeImage method is:
11750 % MagickBooleanType MagickTransposeImage(MagickWand *wand)
11752 % A description of each parameter follows:
11754 % o wand: the magick wand.
11757 WandExport MagickBooleanType MagickTransposeImage(MagickWand *wand)
11762 assert(wand != (MagickWand *) NULL);
11763 assert(wand->signature == WandSignature);
11764 if (IfMagickTrue(wand->debug))
11765 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11766 if (wand->images == (Image *) NULL)
11767 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11768 transpose_image=TransposeImage(wand->images,wand->exception);
11769 if (transpose_image == (Image *) NULL)
11770 return(MagickFalse);
11771 ReplaceImageInList(&wand->images,transpose_image);
11772 return(MagickTrue);
11776 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11780 % M a g i c k T r a n s v e r s e I m a g e %
11784 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11786 % MagickTransverseImage() creates a horizontal mirror image by reflecting the
11787 % pixels around the central y-axis while rotating them 270-degrees.
11789 % The format of the MagickTransverseImage method is:
11791 % MagickBooleanType MagickTransverseImage(MagickWand *wand)
11793 % A description of each parameter follows:
11795 % o wand: the magick wand.
11798 WandExport MagickBooleanType MagickTransverseImage(MagickWand *wand)
11803 assert(wand != (MagickWand *) NULL);
11804 assert(wand->signature == WandSignature);
11805 if (IfMagickTrue(wand->debug))
11806 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11807 if (wand->images == (Image *) NULL)
11808 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11809 transverse_image=TransverseImage(wand->images,wand->exception);
11810 if (transverse_image == (Image *) NULL)
11811 return(MagickFalse);
11812 ReplaceImageInList(&wand->images,transverse_image);
11813 return(MagickTrue);
11817 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11821 % M a g i c k T r i m I m a g e %
11825 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11827 % MagickTrimImage() remove edges that are the background color from the image.
11829 % The format of the MagickTrimImage method is:
11831 % MagickBooleanType MagickTrimImage(MagickWand *wand,const double fuzz)
11833 % A description of each parameter follows:
11835 % o wand: the magick wand.
11837 % o fuzz: By default target must match a particular pixel color
11838 % exactly. However, in many cases two colors may differ by a small amount.
11839 % The fuzz member of image defines how much tolerance is acceptable to
11840 % consider two colors as the same. For example, set fuzz to 10 and the
11841 % color red at intensities of 100 and 102 respectively are now interpreted
11842 % as the same color for the purposes of the floodfill.
11845 WandExport MagickBooleanType MagickTrimImage(MagickWand *wand,const double fuzz)
11850 assert(wand != (MagickWand *) NULL);
11851 assert(wand->signature == WandSignature);
11852 if (IfMagickTrue(wand->debug))
11853 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11854 if (wand->images == (Image *) NULL)
11855 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11856 wand->images->fuzz=fuzz;
11857 trim_image=TrimImage(wand->images,wand->exception);
11858 if (trim_image == (Image *) NULL)
11859 return(MagickFalse);
11860 ReplaceImageInList(&wand->images,trim_image);
11861 return(MagickTrue);
11865 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11869 % M a g i c k U n i q u e I m a g e C o l o r s %
11873 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11875 % MagickUniqueImageColors() discards all but one of any pixel color.
11877 % The format of the MagickUniqueImageColors method is:
11879 % MagickBooleanType MagickUniqueImageColors(MagickWand *wand)
11881 % A description of each parameter follows:
11883 % o wand: the magick wand.
11886 WandExport MagickBooleanType MagickUniqueImageColors(MagickWand *wand)
11891 assert(wand != (MagickWand *) NULL);
11892 assert(wand->signature == WandSignature);
11893 if (IfMagickTrue(wand->debug))
11894 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11895 if (wand->images == (Image *) NULL)
11896 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11897 unique_image=UniqueImageColors(wand->images,wand->exception);
11898 if (unique_image == (Image *) NULL)
11899 return(MagickFalse);
11900 ReplaceImageInList(&wand->images,unique_image);
11901 return(MagickTrue);
11905 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11909 % M a g i c k U n s h a r p M a s k I m a g e %
11913 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11915 % MagickUnsharpMaskImage() sharpens an image. We convolve the image with a
11916 % Gaussian operator of the given radius and standard deviation (sigma).
11917 % For reasonable results, radius should be larger than sigma. Use a radius
11918 % of 0 and UnsharpMaskImage() selects a suitable radius for you.
11920 % The format of the MagickUnsharpMaskImage method is:
11922 % MagickBooleanType MagickUnsharpMaskImage(MagickWand *wand,
11923 % const double radius,const double sigma,const double gain,
11924 % const double threshold)
11926 % A description of each parameter follows:
11928 % o wand: the magick wand.
11930 % o radius: the radius of the Gaussian, in pixels, not counting the center
11933 % o sigma: the standard deviation of the Gaussian, in pixels.
11935 % o gain: the percentage of the difference between the original and the
11936 % blur image that is added back into the original.
11938 % o threshold: the threshold in pixels needed to apply the diffence gain.
11941 WandExport MagickBooleanType MagickUnsharpMaskImage(MagickWand *wand,
11942 const double radius,const double sigma,const double gain,
11943 const double threshold)
11948 assert(wand != (MagickWand *) NULL);
11949 assert(wand->signature == WandSignature);
11950 if (IfMagickTrue(wand->debug))
11951 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11952 if (wand->images == (Image *) NULL)
11953 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11954 unsharp_image=UnsharpMaskImage(wand->images,radius,sigma,gain,threshold,
11956 if (unsharp_image == (Image *) NULL)
11957 return(MagickFalse);
11958 ReplaceImageInList(&wand->images,unsharp_image);
11959 return(MagickTrue);
11963 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11967 % M a g i c k V i g n e t t e I m a g e %
11971 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11973 % MagickVignetteImage() softens the edges of the image in vignette style.
11975 % The format of the MagickVignetteImage method is:
11977 % MagickBooleanType MagickVignetteImage(MagickWand *wand,
11978 % const double radius,const double sigma,const ssize_t x,
11981 % A description of each parameter follows:
11983 % o wand: the magick wand.
11985 % o radius: the radius.
11987 % o sigma: the sigma.
11989 % o x, y: Define the x and y ellipse offset.
11992 WandExport MagickBooleanType MagickVignetteImage(MagickWand *wand,
11993 const double radius,const double sigma,const ssize_t x,const ssize_t y)
11998 assert(wand != (MagickWand *) NULL);
11999 assert(wand->signature == WandSignature);
12000 if (IfMagickTrue(wand->debug))
12001 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12002 if (wand->images == (Image *) NULL)
12003 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12004 vignette_image=VignetteImage(wand->images,radius,sigma,x,y,wand->exception);
12005 if (vignette_image == (Image *) NULL)
12006 return(MagickFalse);
12007 ReplaceImageInList(&wand->images,vignette_image);
12008 return(MagickTrue);
12012 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12016 % M a g i c k W a v e I m a g e %
12020 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12022 % MagickWaveImage() creates a "ripple" effect in the image by shifting
12023 % the pixels vertically along a sine wave whose amplitude and wavelength
12024 % is specified by the given parameters.
12026 % The format of the MagickWaveImage method is:
12028 % MagickBooleanType MagickWaveImage(MagickWand *wand,
12029 % const double amplitude,const double wave_length,
12030 % const PixelInterpolateMethod method)
12032 % A description of each parameter follows:
12034 % o wand: the magick wand.
12036 % o amplitude, wave_length: Define the amplitude and wave length of the
12039 % o method: the pixel interpolation method.
12042 WandExport MagickBooleanType MagickWaveImage(MagickWand *wand,
12043 const double amplitude,const double wave_length,
12044 const PixelInterpolateMethod method)
12049 assert(wand != (MagickWand *) NULL);
12050 assert(wand->signature == WandSignature);
12051 if (IfMagickTrue(wand->debug))
12052 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12053 if (wand->images == (Image *) NULL)
12054 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12055 wave_image=WaveImage(wand->images,amplitude,wave_length,method,
12057 if (wave_image == (Image *) NULL)
12058 return(MagickFalse);
12059 ReplaceImageInList(&wand->images,wave_image);
12060 return(MagickTrue);
12064 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12068 % 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 %
12072 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12074 % MagickWhiteThresholdImage() is like ThresholdImage() but force all pixels
12075 % above the threshold into white while leaving all pixels below the threshold
12078 % The format of the MagickWhiteThresholdImage method is:
12080 % MagickBooleanType MagickWhiteThresholdImage(MagickWand *wand,
12081 % const PixelWand *threshold)
12083 % A description of each parameter follows:
12085 % o wand: the magick wand.
12087 % o threshold: the pixel wand.
12090 WandExport MagickBooleanType MagickWhiteThresholdImage(MagickWand *wand,
12091 const PixelWand *threshold)
12094 thresholds[MaxTextExtent];
12096 assert(wand != (MagickWand *) NULL);
12097 assert(wand->signature == WandSignature);
12098 if (IfMagickTrue(wand->debug))
12099 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12100 if (wand->images == (Image *) NULL)
12101 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12102 (void) FormatLocaleString(thresholds,MaxTextExtent,
12103 QuantumFormat "," QuantumFormat "," QuantumFormat "," QuantumFormat,
12104 PixelGetRedQuantum(threshold),PixelGetGreenQuantum(threshold),
12105 PixelGetBlueQuantum(threshold),PixelGetAlphaQuantum(threshold));
12106 return(WhiteThresholdImage(wand->images,thresholds,wand->exception));
12110 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12114 % M a g i c k W r i t e I m a g e %
12118 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12120 % MagickWriteImage() writes an image to the specified filename. If the
12121 % filename parameter is NULL, the image is written to the filename set
12122 % by MagickReadImage() or MagickSetImageFilename().
12124 % The format of the MagickWriteImage method is:
12126 % MagickBooleanType MagickWriteImage(MagickWand *wand,
12127 % const char *filename)
12129 % A description of each parameter follows:
12131 % o wand: the magick wand.
12133 % o filename: the image filename.
12137 WandExport MagickBooleanType MagickWriteImage(MagickWand *wand,
12138 const char *filename)
12149 assert(wand != (MagickWand *) NULL);
12150 assert(wand->signature == WandSignature);
12151 if (IfMagickTrue(wand->debug))
12152 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12153 if (wand->images == (Image *) NULL)
12154 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12155 if (filename != (const char *) NULL)
12156 (void) CopyMagickString(wand->images->filename,filename,MaxTextExtent);
12157 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
12158 if (image == (Image *) NULL)
12159 return(MagickFalse);
12160 write_info=CloneImageInfo(wand->image_info);
12161 write_info->adjoin=MagickTrue;
12162 status=WriteImage(write_info,image,wand->exception);
12163 image=DestroyImage(image);
12164 write_info=DestroyImageInfo(write_info);
12169 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12173 % M a g i c k W r i t e I m a g e F i l e %
12177 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12179 % MagickWriteImageFile() writes an image to an open file descriptor.
12181 % The format of the MagickWriteImageFile method is:
12183 % MagickBooleanType MagickWriteImageFile(MagickWand *wand,FILE *file)
12185 % A description of each parameter follows:
12187 % o wand: the magick wand.
12189 % o file: the file descriptor.
12192 WandExport MagickBooleanType MagickWriteImageFile(MagickWand *wand,FILE *file)
12203 assert(wand != (MagickWand *) NULL);
12204 assert(wand->signature == WandSignature);
12205 assert(file != (FILE *) NULL);
12206 if (IfMagickTrue(wand->debug))
12207 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12208 if (wand->images == (Image *) NULL)
12209 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12210 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
12211 if (image == (Image *) NULL)
12212 return(MagickFalse);
12213 write_info=CloneImageInfo(wand->image_info);
12214 SetImageInfoFile(write_info,file);
12215 write_info->adjoin=MagickTrue;
12216 status=WriteImage(write_info,image,wand->exception);
12217 write_info=DestroyImageInfo(write_info);
12218 image=DestroyImage(image);
12223 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12227 % M a g i c k W r i t e I m a g e s %
12231 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12233 % MagickWriteImages() writes an image or image sequence.
12235 % The format of the MagickWriteImages method is:
12237 % MagickBooleanType MagickWriteImages(MagickWand *wand,
12238 % const char *filename,const MagickBooleanType adjoin)
12240 % A description of each parameter follows:
12242 % o wand: the magick wand.
12244 % o filename: the image filename.
12246 % o adjoin: join images into a single multi-image file.
12249 WandExport MagickBooleanType MagickWriteImages(MagickWand *wand,
12250 const char *filename,const MagickBooleanType adjoin)
12258 assert(wand != (MagickWand *) NULL);
12259 assert(wand->signature == WandSignature);
12260 if (IfMagickTrue(wand->debug))
12261 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12262 if (wand->images == (Image *) NULL)
12263 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12264 write_info=CloneImageInfo(wand->image_info);
12265 write_info->adjoin=adjoin;
12266 status=WriteImages(write_info,wand->images,filename,wand->exception);
12267 write_info=DestroyImageInfo(write_info);
12272 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12276 % M a g i c k W r i t e I m a g e s F i l e %
12280 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12282 % MagickWriteImagesFile() writes an image sequence to an open file descriptor.
12284 % The format of the MagickWriteImagesFile method is:
12286 % MagickBooleanType MagickWriteImagesFile(MagickWand *wand,FILE *file)
12288 % A description of each parameter follows:
12290 % o wand: the magick wand.
12292 % o file: the file descriptor.
12295 WandExport MagickBooleanType MagickWriteImagesFile(MagickWand *wand,FILE *file)
12303 assert(wand != (MagickWand *) NULL);
12304 assert(wand->signature == WandSignature);
12305 if (IfMagickTrue(wand->debug))
12306 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12307 if (wand->images == (Image *) NULL)
12308 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12309 write_info=CloneImageInfo(wand->image_info);
12310 SetImageInfoFile(write_info,file);
12311 write_info->adjoin=MagickTrue;
12312 status=WriteImages(write_info,wand->images,(const char *) NULL,
12314 write_info=DestroyImageInfo(write_info);