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-2010 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 "wand/studio.h"
50 #include "wand/MagickWand.h"
51 #include "wand/magick-wand-private.h"
52 #include "wand/wand.h"
53 #include "wand/pixel-wand-private.h"
58 #define ThrowWandException(severity,tag,context) \
60 (void) ThrowMagickException(wand->exception,GetMagickModule(),severity, \
61 tag,"`%s'",context); \
62 return(MagickFalse); \
64 #define MagickWandId "MagickWand"
67 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
71 + C l o n e M a g i c k W a n d F r o m I m a g e s %
75 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
77 % CloneMagickWandFromImages() clones the magick wand and inserts a new image
80 % The format of the CloneMagickWandFromImages method is:
82 % MagickWand *CloneMagickWandFromImages(const MagickWand *wand,
85 % A description of each parameter follows:
87 % o wand: the magick wand.
89 % o images: replace the image list with these image(s).
92 static MagickWand *CloneMagickWandFromImages(const MagickWand *wand,
98 assert(wand != (MagickWand *) NULL);
99 assert(wand->signature == WandSignature);
100 if (wand->debug != MagickFalse)
101 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
102 clone_wand=(MagickWand *) AcquireMagickMemory(sizeof(*clone_wand));
103 if (clone_wand == (MagickWand *) NULL)
104 ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed",
106 (void) ResetMagickMemory(clone_wand,0,sizeof(*clone_wand));
107 clone_wand->id=AcquireWandId();
108 (void) FormatMagickString(clone_wand->name,MaxTextExtent,"%s-%.20g",
109 MagickWandId,(double) clone_wand->id);
110 clone_wand->exception=AcquireExceptionInfo();
111 InheritException(clone_wand->exception,wand->exception);
112 clone_wand->image_info=CloneImageInfo(wand->image_info);
113 clone_wand->quantize_info=CloneQuantizeInfo(wand->quantize_info);
114 clone_wand->images=images;
115 clone_wand->debug=IsEventLogging();
116 if (clone_wand->debug != MagickFalse)
117 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",clone_wand->name);
118 clone_wand->signature=WandSignature;
123 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
127 % G e t I m a g e F r o m M a g i c k W a n d %
131 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
133 % GetImageFromMagickWand() returns the current image from the magick wand.
135 % The format of the GetImageFromMagickWand method is:
137 % Image *GetImageFromMagickWand(const MagickWand *wand)
139 % A description of each parameter follows:
141 % o wand: the magick wand.
144 WandExport Image *GetImageFromMagickWand(const MagickWand *wand)
146 assert(wand != (MagickWand *) NULL);
147 assert(wand->signature == WandSignature);
148 if (wand->debug != MagickFalse)
149 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
150 if (wand->images == (Image *) NULL)
152 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
153 "ContainsNoImages","`%s'",wand->name);
154 return((Image *) NULL);
156 return(wand->images);
160 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
164 % M a g i c k A d a p t i v e S h a r p e n I m a g e %
168 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
170 % MagickAdaptiveBlurImage() adaptively blurs the image by blurring
171 % less intensely near image edges and more intensely far from edges. We
172 % blur the image with a Gaussian operator of the given radius and standard
173 % deviation (sigma). For reasonable results, radius should be larger than
174 % sigma. Use a radius of 0 and MagickAdaptiveBlurImage() selects a
175 % suitable radius for you.
177 % The format of the MagickAdaptiveBlurImage method is:
179 % MagickBooleanType MagickAdaptiveBlurImage(MagickWand *wand,
180 % const double radius,const double sigma)
181 % MagickBooleanType MagickAdaptiveBlurImageChannel(MagickWand *wand,
182 % const ChannelType channel,const double radius,const double sigma)
184 % A description of each parameter follows:
186 % o wand: the magick wand.
188 % o channel: the image channel(s).
190 % o radius: the radius of the Gaussian, in pixels, not counting the center
193 % o sigma: the standard deviation of the Gaussian, in pixels.
197 WandExport MagickBooleanType MagickAdaptiveBlurImage(MagickWand *wand,
198 const double radius,const double sigma)
203 status=MagickAdaptiveBlurImageChannel(wand,DefaultChannels,radius,sigma);
207 WandExport MagickBooleanType MagickAdaptiveBlurImageChannel(MagickWand *wand,
208 const ChannelType channel,const double radius,const double sigma)
213 assert(wand != (MagickWand *) NULL);
214 assert(wand->signature == WandSignature);
215 if (wand->debug != MagickFalse)
216 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
217 if (wand->images == (Image *) NULL)
218 ThrowWandException(WandError,"ContainsNoImages",wand->name);
219 sharp_image=AdaptiveBlurImageChannel(wand->images,channel,radius,sigma,
221 if (sharp_image == (Image *) NULL)
223 ReplaceImageInList(&wand->images,sharp_image);
228 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
232 % 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 %
236 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
238 % MagickAdaptiveResizeImage() adaptively resize image with data dependent
241 % MagickBooleanType MagickAdaptiveResizeImage(MagickWand *wand,
242 % const size_t columns,const size_t rows)
244 % A description of each parameter follows:
246 % o wand: the magick wand.
248 % o columns: the number of columns in the scaled image.
250 % o rows: the number of rows in the scaled image.
253 WandExport MagickBooleanType MagickAdaptiveResizeImage(MagickWand *wand,
254 const size_t columns,const size_t rows)
259 assert(wand != (MagickWand *) NULL);
260 assert(wand->signature == WandSignature);
261 if (wand->debug != MagickFalse)
262 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
263 if (wand->images == (Image *) NULL)
264 ThrowWandException(WandError,"ContainsNoImages",wand->name);
265 resize_image=AdaptiveResizeImage(wand->images,columns,rows,wand->exception);
266 if (resize_image == (Image *) NULL)
268 ReplaceImageInList(&wand->images,resize_image);
273 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
277 % 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 %
281 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
283 % MagickAdaptiveSharpenImage() adaptively sharpens the image by sharpening
284 % more intensely near image edges and less intensely far from edges. We
285 % sharpen the image with a Gaussian operator of the given radius and standard
286 % deviation (sigma). For reasonable results, radius should be larger than
287 % sigma. Use a radius of 0 and MagickAdaptiveSharpenImage() selects a
288 % suitable radius for you.
290 % The format of the MagickAdaptiveSharpenImage method is:
292 % MagickBooleanType MagickAdaptiveSharpenImage(MagickWand *wand,
293 % const double radius,const double sigma)
294 % MagickBooleanType MagickAdaptiveSharpenImageChannel(MagickWand *wand,
295 % const ChannelType channel,const double radius,const double sigma)
297 % A description of each parameter follows:
299 % o wand: the magick wand.
301 % o channel: the image channel(s).
303 % o radius: the radius of the Gaussian, in pixels, not counting the center
306 % o sigma: the standard deviation of the Gaussian, in pixels.
310 WandExport MagickBooleanType MagickAdaptiveSharpenImage(MagickWand *wand,
311 const double radius,const double sigma)
316 status=MagickAdaptiveSharpenImageChannel(wand,DefaultChannels,radius,sigma);
320 WandExport MagickBooleanType MagickAdaptiveSharpenImageChannel(MagickWand *wand,
321 const ChannelType channel,const double radius,const double sigma)
326 assert(wand != (MagickWand *) NULL);
327 assert(wand->signature == WandSignature);
328 if (wand->debug != MagickFalse)
329 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
330 if (wand->images == (Image *) NULL)
331 ThrowWandException(WandError,"ContainsNoImages",wand->name);
332 sharp_image=AdaptiveSharpenImageChannel(wand->images,channel,radius,sigma,
334 if (sharp_image == (Image *) NULL)
336 ReplaceImageInList(&wand->images,sharp_image);
341 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
345 % 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 %
349 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
351 % MagickAdaptiveThresholdImage() selects an individual threshold for each pixel
352 % based on the range of intensity values in its local neighborhood. This
353 % allows for thresholding of an image whose global intensity histogram
354 % doesn't contain distinctive peaks.
356 % The format of the AdaptiveThresholdImage method is:
358 % MagickBooleanType MagickAdaptiveThresholdImage(MagickWand *wand,
359 % const size_t width,const size_t height,const ssize_t offset)
361 % A description of each parameter follows:
363 % o wand: the magick wand.
365 % o width: the width of the local neighborhood.
367 % o height: the height of the local neighborhood.
369 % o offset: the mean offset.
372 WandExport MagickBooleanType MagickAdaptiveThresholdImage(MagickWand *wand,
373 const size_t width,const size_t height,const ssize_t offset)
378 assert(wand != (MagickWand *) NULL);
379 assert(wand->signature == WandSignature);
380 if (wand->debug != MagickFalse)
381 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
382 if (wand->images == (Image *) NULL)
383 ThrowWandException(WandError,"ContainsNoImages",wand->name);
384 threshold_image=AdaptiveThresholdImage(wand->images,width,height,offset,
386 if (threshold_image == (Image *) NULL)
388 ReplaceImageInList(&wand->images,threshold_image);
393 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
397 % M a g i c k A d d I m a g e %
401 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
403 % MagickAddImage() adds the specified images at the current image location.
405 % The format of the MagickAddImage method is:
407 % MagickBooleanType MagickAddImage(MagickWand *wand,
408 % const MagickWand *add_wand)
410 % A description of each parameter follows:
412 % o wand: the magick wand.
414 % o add_wand: A wand that contains images to add at the current image
419 static inline MagickBooleanType InsertImageInWand(MagickWand *wand,
425 sentinel=wand->images;
426 if (sentinel == (Image *) NULL)
428 wand->images=GetFirstImageInList(images);
431 if (wand->active == MagickFalse)
433 if ((wand->pend != MagickFalse) && (sentinel->next == (Image *) NULL))
435 AppendImageToList(&sentinel,images);
436 wand->images=GetLastImageInList(images);
439 if ((wand->pend != MagickFalse) && (sentinel->previous == (Image *) NULL))
441 PrependImageToList(&sentinel,images);
442 wand->images=GetFirstImageInList(images);
446 if (sentinel->next == (Image *) NULL)
448 InsertImageInList(&sentinel,images);
449 wand->images=GetLastImageInList(images);
452 InsertImageInList(&sentinel,images);
453 wand->images=GetFirstImageInList(images);
457 WandExport MagickBooleanType MagickAddImage(MagickWand *wand,
458 const MagickWand *add_wand)
463 assert(wand != (MagickWand *) NULL);
464 assert(wand->signature == WandSignature);
465 if (wand->debug != MagickFalse)
466 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
467 assert(add_wand != (MagickWand *) NULL);
468 assert(add_wand->signature == WandSignature);
469 if (add_wand->images == (Image *) NULL)
470 ThrowWandException(WandError,"ContainsNoImages",add_wand->name);
471 images=CloneImageList(add_wand->images,wand->exception);
472 if (images == (Image *) NULL)
474 return(InsertImageInWand(wand,images));
478 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
482 % M a g i c k A d d N o i s e I m a g e %
486 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
488 % MagickAddNoiseImage() adds random noise to the image.
490 % The format of the MagickAddNoiseImage method is:
492 % MagickBooleanType MagickAddNoiseImage(MagickWand *wand,
493 % const NoiseType noise_type)
494 % MagickBooleanType MagickAddNoiseImageChannel(MagickWand *wand,
495 % const ChannelType channel,const NoiseType noise_type)
497 % A description of each parameter follows:
499 % o wand: the magick wand.
501 % o channel: the image channel(s).
503 % o noise_type: The type of noise: Uniform, Gaussian, Multiplicative,
504 % Impulse, Laplacian, or Poisson.
508 WandExport MagickBooleanType MagickAddNoiseImage(MagickWand *wand,
509 const NoiseType noise_type)
514 status=MagickAddNoiseImageChannel(wand,DefaultChannels,noise_type);
518 WandExport MagickBooleanType MagickAddNoiseImageChannel(MagickWand *wand,
519 const ChannelType channel,const NoiseType noise_type)
524 assert(wand != (MagickWand *) NULL);
525 assert(wand->signature == WandSignature);
526 if (wand->debug != MagickFalse)
527 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
528 if (wand->images == (Image *) NULL)
529 ThrowWandException(WandError,"ContainsNoImages",wand->name);
530 noise_image=AddNoiseImageChannel(wand->images,channel,noise_type,
532 if (noise_image == (Image *) NULL)
534 ReplaceImageInList(&wand->images,noise_image);
539 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
543 % 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 %
547 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
549 % MagickAffineTransformImage() transforms an image as dictated by the affine
550 % matrix of the drawing wand.
552 % The format of the MagickAffineTransformImage method is:
554 % MagickBooleanType MagickAffineTransformImage(MagickWand *wand,
555 % const DrawingWand *drawing_wand)
557 % A description of each parameter follows:
559 % o wand: the magick wand.
561 % o drawing_wand: the draw wand.
564 WandExport MagickBooleanType MagickAffineTransformImage(MagickWand *wand,
565 const DrawingWand *drawing_wand)
573 assert(wand != (MagickWand *) NULL);
574 assert(wand->signature == WandSignature);
575 if (wand->debug != MagickFalse)
576 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
577 if (wand->images == (Image *) NULL)
578 ThrowWandException(WandError,"ContainsNoImages",wand->name);
579 draw_info=PeekDrawingWand(drawing_wand);
580 if (draw_info == (DrawInfo *) NULL)
582 affine_image=AffineTransformImage(wand->images,&draw_info->affine,
584 draw_info=DestroyDrawInfo(draw_info);
585 if (affine_image == (Image *) NULL)
587 ReplaceImageInList(&wand->images,affine_image);
592 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
596 % M a g i c k A n n o t a t e I m a g e %
600 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
602 % MagickAnnotateImage() annotates an image with text.
604 % The format of the MagickAnnotateImage method is:
606 % MagickBooleanType MagickAnnotateImage(MagickWand *wand,
607 % const DrawingWand *drawing_wand,const double x,const double y,
608 % const double angle,const char *text)
610 % A description of each parameter follows:
612 % o wand: the magick wand.
614 % o drawing_wand: the draw wand.
616 % o x: x ordinate to left of text
618 % o y: y ordinate to text baseline
620 % o angle: rotate text relative to this angle.
622 % o text: text to draw
625 WandExport MagickBooleanType MagickAnnotateImage(MagickWand *wand,
626 const DrawingWand *drawing_wand,const double x,const double y,
627 const double angle,const char *text)
630 geometry[MaxTextExtent];
638 assert(wand != (MagickWand *) NULL);
639 assert(wand->signature == WandSignature);
640 if (wand->debug != MagickFalse)
641 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
642 if (wand->images == (Image *) NULL)
643 ThrowWandException(WandError,"ContainsNoImages",wand->name);
644 draw_info=PeekDrawingWand(drawing_wand);
645 if (draw_info == (DrawInfo *) NULL)
647 (void) CloneString(&draw_info->text,text);
648 (void) FormatMagickString(geometry,MaxTextExtent,"%+g%+g",x,y);
649 draw_info->affine.sx=cos(DegreesToRadians(fmod(angle,360.0)));
650 draw_info->affine.rx=sin(DegreesToRadians(fmod(angle,360.0)));
651 draw_info->affine.ry=(-sin(DegreesToRadians(fmod(angle,360.0))));
652 draw_info->affine.sy=cos(DegreesToRadians(fmod(angle,360.0)));
653 (void) CloneString(&draw_info->geometry,geometry);
654 status=AnnotateImage(wand->images,draw_info);
655 draw_info=DestroyDrawInfo(draw_info);
656 if (status == MagickFalse)
657 InheritException(wand->exception,&wand->images->exception);
662 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
666 % M a g i c k A n i m a t e I m a g e s %
670 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
672 % MagickAnimateImages() animates an image or image sequence.
674 % The format of the MagickAnimateImages method is:
676 % MagickBooleanType MagickAnimateImages(MagickWand *wand,
677 % const char *server_name)
679 % A description of each parameter follows:
681 % o wand: the magick wand.
683 % o server_name: the X server name.
686 WandExport MagickBooleanType MagickAnimateImages(MagickWand *wand,
687 const char *server_name)
692 assert(wand != (MagickWand *) NULL);
693 assert(wand->signature == WandSignature);
694 if (wand->debug != MagickFalse)
695 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
696 (void) CloneString(&wand->image_info->server_name,server_name);
697 status=AnimateImages(wand->image_info,wand->images);
698 if (status == MagickFalse)
699 InheritException(wand->exception,&wand->images->exception);
704 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
708 % M a g i c k A p p e n d I m a g e s %
712 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
714 % MagickAppendImages() append a set of images.
716 % The format of the MagickAppendImages method is:
718 % MagickWand *MagickAppendImages(MagickWand *wand,
719 % const MagickBooleanType stack)
721 % A description of each parameter follows:
723 % o wand: the magick wand.
725 % o stack: By default, images are stacked left-to-right. Set stack to
726 % MagickTrue to stack them top-to-bottom.
729 WandExport MagickWand *MagickAppendImages(MagickWand *wand,
730 const MagickBooleanType stack)
735 assert(wand != (MagickWand *) NULL);
736 assert(wand->signature == WandSignature);
737 if (wand->debug != MagickFalse)
738 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
739 if (wand->images == (Image *) NULL)
740 return((MagickWand *) NULL);
741 append_image=AppendImages(wand->images,stack,wand->exception);
742 if (append_image == (Image *) NULL)
743 return((MagickWand *) NULL);
744 return(CloneMagickWandFromImages(wand,append_image));
748 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
752 % M a g i c k A u t o G a m m a I m a g e %
756 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
758 % MagickAutoGammaImage() extracts the 'mean' from the image and adjust the
759 % image to try make set its gamma appropriatally.
761 % The format of the MagickAutoGammaImage method is:
763 % MagickBooleanType MagickAutoGammaImage(MagickWand *wand)
764 % MagickBooleanType MagickAutoGammaImageChannel(MagickWand *wand,
765 % const ChannelType channel)
767 % A description of each parameter follows:
769 % o wand: the magick wand.
771 % o channel: the image channel(s).
774 WandExport MagickBooleanType MagickAutoGammaImage(MagickWand *wand)
779 status=MagickAutoGammaImageChannel(wand,DefaultChannels);
783 WandExport MagickBooleanType MagickAutoGammaImageChannel(MagickWand *wand,
784 const ChannelType channel)
789 assert(wand != (MagickWand *) NULL);
790 assert(wand->signature == WandSignature);
791 if (wand->debug != MagickFalse)
792 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
793 if (wand->images == (Image *) NULL)
794 ThrowWandException(WandError,"ContainsNoImages",wand->name);
795 status=AutoGammaImageChannel(wand->images,channel);
796 if (status == MagickFalse)
797 InheritException(wand->exception,&wand->images->exception);
802 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
806 % M a g i c k A u t o L e v e l I m a g e %
810 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
812 % MagickAutoLevelImage() adjusts the levels of a particular image channel by
813 % scaling the minimum and maximum values to the full quantum range.
815 % The format of the MagickAutoLevelImage method is:
817 % MagickBooleanType MagickAutoLevelImage(MagickWand *wand)
818 % MagickBooleanType MagickAutoLevelImageChannel(MagickWand *wand,
819 % const ChannelType channel)
821 % A description of each parameter follows:
823 % o wand: the magick wand.
825 % o channel: the image channel(s).
828 WandExport MagickBooleanType MagickAutoLevelImage(MagickWand *wand)
833 status=MagickAutoLevelImageChannel(wand,DefaultChannels);
837 WandExport MagickBooleanType MagickAutoLevelImageChannel(MagickWand *wand,
838 const ChannelType channel)
843 assert(wand != (MagickWand *) NULL);
844 assert(wand->signature == WandSignature);
845 if (wand->debug != MagickFalse)
846 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
847 if (wand->images == (Image *) NULL)
848 ThrowWandException(WandError,"ContainsNoImages",wand->name);
849 status=AutoLevelImageChannel(wand->images,channel);
850 if (status == MagickFalse)
851 InheritException(wand->exception,&wand->images->exception);
856 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
860 % 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 %
864 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
866 % MagickBlackThresholdImage() is like MagickThresholdImage() but forces all
867 % pixels below the threshold into black while leaving all pixels above the
868 % threshold unchanged.
870 % The format of the MagickBlackThresholdImage method is:
872 % MagickBooleanType MagickBlackThresholdImage(MagickWand *wand,
873 % const PixelWand *threshold)
875 % A description of each parameter follows:
877 % o wand: the magick wand.
879 % o threshold: the pixel wand.
882 WandExport MagickBooleanType MagickBlackThresholdImage(MagickWand *wand,
883 const PixelWand *threshold)
886 thresholds[MaxTextExtent];
891 assert(wand != (MagickWand *) NULL);
892 assert(wand->signature == WandSignature);
893 if (wand->debug != MagickFalse)
894 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
895 if (wand->images == (Image *) NULL)
896 ThrowWandException(WandError,"ContainsNoImages",wand->name);
897 (void) FormatMagickString(thresholds,MaxTextExtent,
898 QuantumFormat "," QuantumFormat "," QuantumFormat "," QuantumFormat,
899 PixelGetRedQuantum(threshold),PixelGetGreenQuantum(threshold),
900 PixelGetBlueQuantum(threshold),PixelGetOpacityQuantum(threshold));
901 status=BlackThresholdImage(wand->images,thresholds);
902 if (status == MagickFalse)
903 InheritException(wand->exception,&wand->images->exception);
908 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
912 % M a g i c k B l u e S h i f t I m a g e %
916 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
918 % MagickBlueShiftImage() mutes the colors of the image to simulate a scene at
919 % nighttime in the moonlight.
921 % The format of the MagickBlueShiftImage method is:
923 % MagickBooleanType MagickBlueShiftImage(MagickWand *wand,
924 % const double factor)
926 % A description of each parameter follows:
928 % o wand: the magick wand.
930 % o factor: the blue shift factor (default 1.5)
933 WandExport MagickBooleanType MagickBlueShiftImage(MagickWand *wand,
939 assert(wand != (MagickWand *) NULL);
940 assert(wand->signature == WandSignature);
941 if (wand->debug != MagickFalse)
942 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
943 if (wand->images == (Image *) NULL)
944 ThrowWandException(WandError,"ContainsNoImages",wand->name);
945 shift_image=BlueShiftImage(wand->images,factor,wand->exception);
946 if (shift_image == (Image *) NULL)
948 ReplaceImageInList(&wand->images,shift_image);
953 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
957 % M a g i c k B l u r I m a g e %
961 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
963 % MagickBlurImage() blurs an image. We convolve the image with a
964 % gaussian operator of the given radius and standard deviation (sigma).
965 % For reasonable results, the radius should be larger than sigma. Use a
966 % radius of 0 and BlurImage() selects a suitable radius for you.
968 % The format of the MagickBlurImage method is:
970 % MagickBooleanType MagickBlurImage(MagickWand *wand,const double radius,
971 % const double sigma)
972 % MagickBooleanType MagickBlurImageChannel(MagickWand *wand,
973 % const ChannelType channel,const double radius,const double sigma)
975 % A description of each parameter follows:
977 % o wand: the magick wand.
979 % o channel: the image channel(s).
981 % o radius: the radius of the , in pixels, not counting the center
984 % o sigma: the standard deviation of the , in pixels.
988 WandExport MagickBooleanType MagickBlurImage(MagickWand *wand,
989 const double radius,const double sigma)
994 status=MagickBlurImageChannel(wand,DefaultChannels,radius,sigma);
998 WandExport MagickBooleanType MagickBlurImageChannel(MagickWand *wand,
999 const ChannelType channel,const double radius,const double sigma)
1004 assert(wand != (MagickWand *) NULL);
1005 assert(wand->signature == WandSignature);
1006 if (wand->debug != MagickFalse)
1007 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1008 if (wand->images == (Image *) NULL)
1009 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1010 blur_image=BlurImageChannel(wand->images,channel,radius,sigma,
1012 if (blur_image == (Image *) NULL)
1013 return(MagickFalse);
1014 ReplaceImageInList(&wand->images,blur_image);
1019 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1023 % M a g i c k B o r d e r I m a g e %
1027 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1029 % MagickBorderImage() surrounds the image with a border of the color defined
1030 % by the bordercolor pixel wand.
1032 % The format of the MagickBorderImage method is:
1034 % MagickBooleanType MagickBorderImage(MagickWand *wand,
1035 % const PixelWand *bordercolor,const size_t width,
1036 % const size_t height)
1038 % A description of each parameter follows:
1040 % o wand: the magick wand.
1042 % o bordercolor: the border color pixel wand.
1044 % o width: the border width.
1046 % o height: the border height.
1049 WandExport MagickBooleanType MagickBorderImage(MagickWand *wand,
1050 const PixelWand *bordercolor,const size_t width,
1051 const size_t height)
1059 assert(wand != (MagickWand *) NULL);
1060 assert(wand->signature == WandSignature);
1061 if (wand->debug != MagickFalse)
1062 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1063 if (wand->images == (Image *) NULL)
1064 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1065 border_info.width=width;
1066 border_info.height=height;
1069 PixelGetQuantumColor(bordercolor,&wand->images->border_color);
1070 border_image=BorderImage(wand->images,&border_info,wand->exception);
1071 if (border_image == (Image *) NULL)
1072 return(MagickFalse);
1073 ReplaceImageInList(&wand->images,border_image);
1078 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1082 % 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 %
1086 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1088 % Use MagickBrightnessContrastImage() to change the brightness and/or contrast
1089 % of an image. It converts the brightness and contrast parameters into slope
1090 % and intercept and calls a polynomical function to apply to the image.
1093 % The format of the MagickBrightnessContrastImage method is:
1095 % MagickBooleanType MagickBrightnessContrastImage(MagickWand *wand,
1096 % const double brightness,const double contrast)
1097 % MagickBooleanType MagickBrightnessContrastImageChannel(MagickWand *wand,
1098 % const ChannelType channel,const double brightness,
1099 % const double contrast)
1101 % A description of each parameter follows:
1103 % o wand: the magick wand.
1105 % o channel: the image channel(s).
1107 % o brightness: the brightness percent (-100 .. 100).
1109 % o contrast: the contrast percent (-100 .. 100).
1113 WandExport MagickBooleanType MagickBrightnessContrastImage(MagickWand *wand,
1114 const double brightness,const double contrast)
1119 status=MagickBrightnessContrastImageChannel(wand,DefaultChannels,brightness,
1124 WandExport MagickBooleanType MagickBrightnessContrastImageChannel(
1125 MagickWand *wand,const ChannelType channel,const double brightness,
1126 const double contrast)
1131 assert(wand != (MagickWand *) NULL);
1132 assert(wand->signature == WandSignature);
1133 if (wand->debug != MagickFalse)
1134 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1135 if (wand->images == (Image *) NULL)
1136 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1137 status=BrightnessContrastImageChannel(wand->images,channel,brightness,
1139 if (status == MagickFalse)
1140 InheritException(wand->exception,&wand->images->exception);
1145 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1149 % M a g i c k C h a r c o a l I m a g e %
1153 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1155 % MagickCharcoalImage() simulates a charcoal drawing.
1157 % The format of the MagickCharcoalImage method is:
1159 % MagickBooleanType MagickCharcoalImage(MagickWand *wand,
1160 % const double radius,const double sigma)
1162 % A description of each parameter follows:
1164 % o wand: the magick wand.
1166 % o radius: the radius of the Gaussian, in pixels, not counting the center
1169 % o sigma: the standard deviation of the Gaussian, in pixels.
1172 WandExport MagickBooleanType MagickCharcoalImage(MagickWand *wand,
1173 const double radius,const double sigma)
1178 assert(wand != (MagickWand *) NULL);
1179 assert(wand->signature == WandSignature);
1180 if (wand->debug != MagickFalse)
1181 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1182 if (wand->images == (Image *) NULL)
1183 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1184 charcoal_image=CharcoalImage(wand->images,radius,sigma,wand->exception);
1185 if (charcoal_image == (Image *) NULL)
1186 return(MagickFalse);
1187 ReplaceImageInList(&wand->images,charcoal_image);
1192 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1196 % M a g i c k C h o p I m a g e %
1200 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1202 % MagickChopImage() removes a region of an image and collapses the image to
1203 % occupy the removed portion
1205 % The format of the MagickChopImage method is:
1207 % MagickBooleanType MagickChopImage(MagickWand *wand,
1208 % const size_t width,const size_t height,const ssize_t x,
1211 % A description of each parameter follows:
1213 % o wand: the magick wand.
1215 % o width: the region width.
1217 % o height: the region height.
1219 % o x: the region x offset.
1221 % o y: the region y offset.
1225 WandExport MagickBooleanType MagickChopImage(MagickWand *wand,
1226 const size_t width,const size_t height,const ssize_t x,
1235 assert(wand != (MagickWand *) NULL);
1236 assert(wand->signature == WandSignature);
1237 if (wand->debug != MagickFalse)
1238 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1239 if (wand->images == (Image *) NULL)
1240 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1245 chop_image=ChopImage(wand->images,&chop,wand->exception);
1246 if (chop_image == (Image *) NULL)
1247 return(MagickFalse);
1248 ReplaceImageInList(&wand->images,chop_image);
1253 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1257 % M a g i c k C l a m p I m a g e %
1261 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1263 % MagickClampImage() restricts the color range from 0 to the quantum depth.
1265 % The format of the MagickClampImage method is:
1267 % MagickBooleanType MagickClampImage(MagickWand *wand)
1268 % MagickBooleanType MagickClampImageChannel(MagickWand *wand,
1269 % const ChannelType channel)
1271 % A description of each parameter follows:
1273 % o wand: the magick wand.
1275 % o channel: the channel.
1279 WandExport MagickBooleanType MagickClampImage(MagickWand *wand)
1284 status=MagickClampImageChannel(wand,DefaultChannels);
1288 WandExport MagickBooleanType MagickClampImageChannel(MagickWand *wand,
1289 const ChannelType channel)
1294 assert(wand != (MagickWand *) NULL);
1295 assert(wand->signature == WandSignature);
1296 if (wand->debug != MagickFalse)
1297 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1298 if (wand->images == (Image *) NULL)
1299 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1300 status=ClampImageChannel(wand->images,channel);
1301 if (status == MagickFalse)
1302 InheritException(wand->exception,&wand->images->exception);
1307 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1311 % M a g i c k C l i p I m a g e %
1315 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1317 % MagickClipImage() clips along the first path from the 8BIM profile, if
1320 % The format of the MagickClipImage method is:
1322 % MagickBooleanType MagickClipImage(MagickWand *wand)
1324 % A description of each parameter follows:
1326 % o wand: the magick wand.
1329 WandExport MagickBooleanType MagickClipImage(MagickWand *wand)
1334 assert(wand != (MagickWand *) NULL);
1335 assert(wand->signature == WandSignature);
1336 if (wand->debug != MagickFalse)
1337 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1338 if (wand->images == (Image *) NULL)
1339 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1340 status=ClipImage(wand->images);
1341 if (status == MagickFalse)
1342 InheritException(wand->exception,&wand->images->exception);
1347 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1351 % M a g i c k C l i p I m a g e P a t h %
1355 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1357 % MagickClipImagePath() clips along the named paths from the 8BIM profile, if
1358 % present. Later operations take effect inside the path. Id may be a number
1359 % if preceded with #, to work on a numbered path, e.g., "#1" to use the first
1362 % The format of the MagickClipImagePath method is:
1364 % MagickBooleanType MagickClipImagePath(MagickWand *wand,
1365 % const char *pathname,const MagickBooleanType inside)
1367 % A description of each parameter follows:
1369 % o wand: the magick wand.
1371 % o pathname: name of clipping path resource. If name is preceded by #, use
1372 % clipping path numbered by name.
1374 % o inside: if non-zero, later operations take effect inside clipping path.
1375 % Otherwise later operations take effect outside clipping path.
1378 WandExport MagickBooleanType MagickClipImagePath(MagickWand *wand,
1379 const char *pathname,const MagickBooleanType inside)
1384 assert(wand != (MagickWand *) NULL);
1385 assert(wand->signature == WandSignature);
1386 if (wand->debug != MagickFalse)
1387 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1388 if (wand->images == (Image *) NULL)
1389 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1390 status=ClipImagePath(wand->images,pathname,inside);
1391 if (status == MagickFalse)
1392 InheritException(wand->exception,&wand->images->exception);
1397 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1401 % M a g i c k C l u t I m a g e %
1405 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1407 % MagickClutImage() replaces colors in the image from a color lookup table.
1409 % The format of the MagickClutImage method is:
1411 % MagickBooleanType MagickClutImage(MagickWand *wand,
1412 % const MagickWand *clut_wand)
1413 % MagickBooleanType MagickClutImageChannel(MagickWand *wand,
1414 % const ChannelType channel,const MagickWand *clut_wand)
1416 % A description of each parameter follows:
1418 % o wand: the magick wand.
1420 % o clut_image: the clut image.
1424 WandExport MagickBooleanType MagickClutImage(MagickWand *wand,
1425 const MagickWand *clut_wand)
1430 status=MagickClutImageChannel(wand,DefaultChannels,clut_wand);
1434 WandExport MagickBooleanType MagickClutImageChannel(MagickWand *wand,
1435 const ChannelType channel,const MagickWand *clut_wand)
1440 assert(wand != (MagickWand *) NULL);
1441 assert(wand->signature == WandSignature);
1442 if (wand->debug != MagickFalse)
1443 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1444 if ((wand->images == (Image *) NULL) || (clut_wand->images == (Image *) NULL))
1445 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1446 status=ClutImageChannel(wand->images,channel,clut_wand->images);
1447 if (status == MagickFalse)
1448 InheritException(wand->exception,&wand->images->exception);
1453 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1457 % M a g i c k C o a l e s c e I m a g e s %
1461 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1463 % MagickCoalesceImages() composites a set of images while respecting any page
1464 % offsets and disposal methods. GIF, MIFF, and MNG animation sequences
1465 % typically start with an image background and each subsequent image
1466 % varies in size and offset. MagickCoalesceImages() returns a new sequence
1467 % where each image in the sequence is the same size as the first and
1468 % composited with the next image in the sequence.
1470 % The format of the MagickCoalesceImages method is:
1472 % MagickWand *MagickCoalesceImages(MagickWand *wand)
1474 % A description of each parameter follows:
1476 % o wand: the magick wand.
1479 WandExport MagickWand *MagickCoalesceImages(MagickWand *wand)
1484 assert(wand != (MagickWand *) NULL);
1485 assert(wand->signature == WandSignature);
1486 if (wand->debug != MagickFalse)
1487 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1488 if (wand->images == (Image *) NULL)
1489 return((MagickWand *) NULL);
1490 coalesce_image=CoalesceImages(wand->images,wand->exception);
1491 if (coalesce_image == (Image *) NULL)
1492 return((MagickWand *) NULL);
1493 return(CloneMagickWandFromImages(wand,coalesce_image));
1497 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1501 % M a g i c k C o l o r D e c i s i o n I m a g e %
1505 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1507 % MagickColorDecisionListImage() accepts a lightweight Color Correction
1508 % Collection (CCC) file which solely contains one or more color corrections
1509 % and applies the color correction to the image. Here is a sample CCC file:
1511 % <ColorCorrectionCollection xmlns="urn:ASC:CDL:v1.2">
1512 % <ColorCorrection id="cc03345">
1514 % <Slope> 0.9 1.2 0.5 </Slope>
1515 % <Offset> 0.4 -0.5 0.6 </Offset>
1516 % <Power> 1.0 0.8 1.5 </Power>
1519 % <Saturation> 0.85 </Saturation>
1521 % </ColorCorrection>
1522 % </ColorCorrectionCollection>
1524 % which includes the offset, slope, and power for each of the RGB channels
1525 % as well as the saturation.
1527 % The format of the MagickColorDecisionListImage method is:
1529 % MagickBooleanType MagickColorDecisionListImage(MagickWand *wand,
1530 % const double gamma)
1532 % A description of each parameter follows:
1534 % o wand: the magick wand.
1536 % o color_correction_collection: the color correction collection in XML.
1539 WandExport MagickBooleanType MagickColorDecisionListImage(MagickWand *wand,
1540 const char *color_correction_collection)
1545 assert(wand != (MagickWand *) NULL);
1546 assert(wand->signature == WandSignature);
1547 if (wand->debug != MagickFalse)
1548 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1549 if (wand->images == (Image *) NULL)
1550 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1551 status=ColorDecisionListImage(wand->images,color_correction_collection);
1552 if (status == MagickFalse)
1553 InheritException(wand->exception,&wand->images->exception);
1558 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1562 % M a g i c k C o l o r i z e I m a g e %
1566 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1568 % MagickColorizeImage() blends the fill color with each pixel in the image.
1570 % The format of the MagickColorizeImage method is:
1572 % MagickBooleanType MagickColorizeImage(MagickWand *wand,
1573 % const PixelWand *colorize,const PixelWand *opacity)
1575 % A description of each parameter follows:
1577 % o wand: the magick wand.
1579 % o colorize: the colorize pixel wand.
1581 % o opacity: the opacity pixel wand.
1584 WandExport MagickBooleanType MagickColorizeImage(MagickWand *wand,
1585 const PixelWand *colorize,const PixelWand *opacity)
1588 percent_opaque[MaxTextExtent];
1596 assert(wand != (MagickWand *) NULL);
1597 assert(wand->signature == WandSignature);
1598 if (wand->debug != MagickFalse)
1599 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1600 if (wand->images == (Image *) NULL)
1601 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1602 (void) FormatMagickString(percent_opaque,MaxTextExtent,
1603 "%g,%g,%g,%g",(double) (100.0*QuantumScale*
1604 PixelGetRedQuantum(opacity)),(double) (100.0*QuantumScale*
1605 PixelGetGreenQuantum(opacity)),(double) (100.0*QuantumScale*
1606 PixelGetBlueQuantum(opacity)),(double) (100.0*QuantumScale*
1607 PixelGetOpacityQuantum(opacity)));
1608 PixelGetQuantumColor(colorize,&target);
1609 colorize_image=ColorizeImage(wand->images,percent_opaque,target,
1611 if (colorize_image == (Image *) NULL)
1612 return(MagickFalse);
1613 ReplaceImageInList(&wand->images,colorize_image);
1618 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1622 % M a g i c k C o l o r M a t r i x I m a g e %
1626 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1628 % MagickColorMatrixImage() apply color transformation to an image. The method
1629 % permits saturation changes, hue rotation, luminance to alpha, and various
1630 % other effects. Although variable-sized transformation matrices can be used,
1631 % typically one uses a 5x5 matrix for an RGBA image and a 6x6 for CMYKA
1632 % (or RGBA with offsets). The matrix is similar to those used by Adobe Flash
1633 % except offsets are in column 6 rather than 5 (in support of CMYKA images)
1634 % and offsets are normalized (divide Flash offset by 255).
1636 % The format of the MagickColorMatrixImage method is:
1638 % MagickBooleanType MagickColorMatrixImage(MagickWand *wand,
1639 % const KernelInfo *color_matrix)
1641 % A description of each parameter follows:
1643 % o wand: the magick wand.
1645 % o color_matrix: the color matrix.
1648 WandExport MagickBooleanType MagickColorMatrixImage(MagickWand *wand,
1649 const KernelInfo *color_matrix)
1654 assert(wand != (MagickWand *) NULL);
1655 assert(wand->signature == WandSignature);
1656 if (wand->debug != MagickFalse)
1657 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1658 if (color_matrix == (const KernelInfo *) NULL)
1659 return(MagickFalse);
1660 if (wand->images == (Image *) NULL)
1661 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1662 color_image=ColorMatrixImage(wand->images,color_matrix,wand->exception);
1663 if (color_image == (Image *) NULL)
1664 return(MagickFalse);
1665 ReplaceImageInList(&wand->images,color_image);
1670 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1674 % M a g i c k C o m b i n e I m a g e s %
1678 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1680 % MagickCombineImages() combines one or more images into a single image. The
1681 % grayscale value of the pixels of each image in the sequence is assigned in
1682 % order to the specified hannels of the combined image. The typical
1683 % ordering would be image 1 => Red, 2 => Green, 3 => Blue, etc.
1685 % The format of the MagickCombineImages method is:
1687 % MagickWand *MagickCombineImages(MagickWand *wand,
1688 % const ChannelType channel)
1690 % A description of each parameter follows:
1692 % o wand: the magick wand.
1694 % o channel: the channel.
1697 WandExport MagickWand *MagickCombineImages(MagickWand *wand,
1698 const ChannelType channel)
1703 assert(wand != (MagickWand *) NULL);
1704 assert(wand->signature == WandSignature);
1705 if (wand->debug != MagickFalse)
1706 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1707 if (wand->images == (Image *) NULL)
1708 return((MagickWand *) NULL);
1709 combine_image=CombineImages(wand->images,channel,wand->exception);
1710 if (combine_image == (Image *) NULL)
1711 return((MagickWand *) NULL);
1712 return(CloneMagickWandFromImages(wand,combine_image));
1716 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1720 % M a g i c k C o m m e n t I m a g e %
1724 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1726 % MagickCommentImage() adds a comment to your image.
1728 % The format of the MagickCommentImage method is:
1730 % MagickBooleanType MagickCommentImage(MagickWand *wand,
1731 % const char *comment)
1733 % A description of each parameter follows:
1735 % o wand: the magick wand.
1737 % o comment: the image comment.
1740 WandExport MagickBooleanType MagickCommentImage(MagickWand *wand,
1741 const char *comment)
1746 assert(wand != (MagickWand *) NULL);
1747 assert(wand->signature == WandSignature);
1748 if (wand->debug != MagickFalse)
1749 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1750 if (wand->images == (Image *) NULL)
1751 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1752 status=SetImageProperty(wand->images,"comment",comment);
1753 if (status == MagickFalse)
1754 InheritException(wand->exception,&wand->images->exception);
1759 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1763 % M a g i c k C o m p a r e I m a g e C h a n n e l s %
1767 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1769 % MagickCompareImageChannels() compares one or more image channels of an image
1770 % to a reconstructed image and returns the difference image.
1772 % The format of the MagickCompareImageChannels method is:
1774 % MagickWand *MagickCompareImageChannels(MagickWand *wand,
1775 % const MagickWand *reference,const ChannelType channel,
1776 % const MetricType metric,double *distortion)
1778 % A description of each parameter follows:
1780 % o wand: the magick wand.
1782 % o reference: the reference wand.
1784 % o channel: the channel.
1786 % o metric: the metric.
1788 % o distortion: the computed distortion between the images.
1791 WandExport MagickWand *MagickCompareImageChannels(MagickWand *wand,
1792 const MagickWand *reference,const ChannelType channel,const MetricType metric,
1798 assert(wand != (MagickWand *) NULL);
1799 assert(wand->signature == WandSignature);
1800 if (wand->debug != MagickFalse)
1801 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1802 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
1804 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
1805 "ContainsNoImages","`%s'",wand->name);
1806 return((MagickWand *) NULL);
1808 compare_image=CompareImageChannels(wand->images,reference->images,channel,
1809 metric,distortion,&wand->images->exception);
1810 if (compare_image == (Image *) NULL)
1811 return((MagickWand *) NULL);
1812 return(CloneMagickWandFromImages(wand,compare_image));
1816 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1820 % M a g i c k C o m p a r e I m a g e L a y e r s %
1824 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1826 % MagickCompareImageLayers() compares each image with the next in a sequence
1827 % and returns the maximum bounding region of any pixel differences it
1830 % The format of the MagickCompareImageLayers method is:
1832 % MagickWand *MagickCompareImageLayers(MagickWand *wand,
1833 % const ImageLayerMethod method)
1835 % A description of each parameter follows:
1837 % o wand: the magick wand.
1839 % o method: the compare method.
1842 WandExport MagickWand *MagickCompareImageLayers(MagickWand *wand,
1843 const ImageLayerMethod method)
1848 assert(wand != (MagickWand *) NULL);
1849 assert(wand->signature == WandSignature);
1850 if (wand->debug != MagickFalse)
1851 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1852 if (wand->images == (Image *) NULL)
1853 return((MagickWand *) NULL);
1854 layers_image=CompareImageLayers(wand->images,method,wand->exception);
1855 if (layers_image == (Image *) NULL)
1856 return((MagickWand *) NULL);
1857 return(CloneMagickWandFromImages(wand,layers_image));
1861 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1865 % M a g i c k C o m p a r e I m a g e s %
1869 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1871 % MagickCompareImages() compares an image to a reconstructed image and returns
1872 % the specified difference image.
1874 % The format of the MagickCompareImages method is:
1876 % MagickWand *MagickCompareImages(MagickWand *wand,
1877 % const MagickWand *reference,const MetricType metric,
1878 % double *distortion)
1880 % A description of each parameter follows:
1882 % o wand: the magick wand.
1884 % o reference: the reference wand.
1886 % o metric: the metric.
1888 % o distortion: the computed distortion between the images.
1891 WandExport MagickWand *MagickCompareImages(MagickWand *wand,
1892 const MagickWand *reference,const MetricType metric,double *distortion)
1898 assert(wand != (MagickWand *) NULL);
1899 assert(wand->signature == WandSignature);
1900 if (wand->debug != MagickFalse)
1901 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1902 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
1904 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
1905 "ContainsNoImages","`%s'",wand->name);
1906 return((MagickWand *) NULL);
1908 compare_image=CompareImages(wand->images,reference->images,metric,distortion,
1909 &wand->images->exception);
1910 if (compare_image == (Image *) NULL)
1911 return((MagickWand *) NULL);
1912 return(CloneMagickWandFromImages(wand,compare_image));
1916 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1920 % M a g i c k C o m p o s i t e I m a g e %
1924 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1926 % MagickCompositeImage() composite one image onto another at the specified
1929 % The format of the MagickCompositeImage method is:
1931 % MagickBooleanType MagickCompositeImage(MagickWand *wand,
1932 % const MagickWand *composite_wand,const CompositeOperator compose,
1933 % const ssize_t x,const ssize_t y)
1934 % MagickBooleanType MagickCompositeImageChannel(MagickWand *wand,
1935 % const ChannelType channel,const MagickWand *composite_wand,
1936 % const CompositeOperator compose,const ssize_t x,const ssize_t y)
1938 % A description of each parameter follows:
1940 % o wand: the magick wand.
1942 % o composite_image: the composite image.
1944 % o compose: This operator affects how the composite is applied to the
1945 % image. The default is Over. Choose from these operators:
1947 % OverCompositeOp InCompositeOp OutCompositeOp
1948 % AtopCompositeOp XorCompositeOp PlusCompositeOp
1949 % MinusCompositeOp AddCompositeOp SubtractCompositeOp
1950 % DifferenceCompositeOp BumpmapCompositeOp CopyCompositeOp
1951 % DisplaceCompositeOp
1953 % o x: the column offset of the composited image.
1955 % o y: the row offset of the composited image.
1959 WandExport MagickBooleanType MagickCompositeImage(MagickWand *wand,
1960 const MagickWand *composite_wand,const CompositeOperator compose,const ssize_t x,
1966 status=MagickCompositeImageChannel(wand,DefaultChannels,composite_wand,
1971 WandExport MagickBooleanType MagickCompositeImageChannel(MagickWand *wand,
1972 const ChannelType channel,const MagickWand *composite_wand,
1973 const CompositeOperator compose,const ssize_t x,const ssize_t y)
1978 assert(wand != (MagickWand *) NULL);
1979 assert(wand->signature == WandSignature);
1980 if (wand->debug != MagickFalse)
1981 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1982 if ((wand->images == (Image *) NULL) ||
1983 (composite_wand->images == (Image *) NULL))
1984 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1985 status=CompositeImageChannel(wand->images,channel,compose,
1986 composite_wand->images,x,y);
1987 if (status == MagickFalse)
1988 InheritException(wand->exception,&wand->images->exception);
1993 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1997 % M a g i c k C o n t r a s t I m a g e %
2001 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2003 % MagickContrastImage() enhances the intensity differences between the lighter
2004 % and darker elements of the image. Set sharpen to a value other than 0 to
2005 % increase the image contrast otherwise the contrast is reduced.
2007 % The format of the MagickContrastImage method is:
2009 % MagickBooleanType MagickContrastImage(MagickWand *wand,
2010 % const MagickBooleanType sharpen)
2012 % A description of each parameter follows:
2014 % o wand: the magick wand.
2016 % o sharpen: Increase or decrease image contrast.
2020 WandExport MagickBooleanType MagickContrastImage(MagickWand *wand,
2021 const MagickBooleanType sharpen)
2026 assert(wand != (MagickWand *) NULL);
2027 assert(wand->signature == WandSignature);
2028 if (wand->debug != MagickFalse)
2029 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2030 if (wand->images == (Image *) NULL)
2031 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2032 status=ContrastImage(wand->images,sharpen);
2033 if (status == MagickFalse)
2034 InheritException(wand->exception,&wand->images->exception);
2039 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2043 % 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 %
2047 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2049 % MagickContrastStretchImage() enhances the contrast of a color image by
2050 % adjusting the pixels color to span the entire range of colors available.
2051 % You can also reduce the influence of a particular channel with a gamma
2054 % The format of the MagickContrastStretchImage method is:
2056 % MagickBooleanType MagickContrastStretchImage(MagickWand *wand,
2057 % const double black_point,const double white_point)
2058 % MagickBooleanType MagickContrastStretchImageChannel(MagickWand *wand,
2059 % const ChannelType channel,const double black_point,
2060 % const double white_point)
2062 % A description of each parameter follows:
2064 % o wand: the magick wand.
2066 % o channel: the image channel(s).
2068 % o black_point: the black point.
2070 % o white_point: the white point.
2074 WandExport MagickBooleanType MagickContrastStretchImage(MagickWand *wand,
2075 const double black_point,const double white_point)
2080 status=MagickContrastStretchImageChannel(wand,DefaultChannels,black_point,
2085 WandExport MagickBooleanType MagickContrastStretchImageChannel(MagickWand *wand,
2086 const ChannelType channel,const double black_point,const double white_point)
2091 assert(wand != (MagickWand *) NULL);
2092 assert(wand->signature == WandSignature);
2093 if (wand->debug != MagickFalse)
2094 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2095 if (wand->images == (Image *) NULL)
2096 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2097 status=ContrastStretchImageChannel(wand->images,channel,black_point,
2099 if (status == MagickFalse)
2100 InheritException(wand->exception,&wand->images->exception);
2105 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2109 % M a g i c k C o n v o l v e I m a g e %
2113 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2115 % MagickConvolveImage() applies a custom convolution kernel to the image.
2117 % The format of the MagickConvolveImage method is:
2119 % MagickBooleanType MagickConvolveImage(MagickWand *wand,
2120 % const size_t order,const double *kernel)
2121 % MagickBooleanType MagickConvolveImageChannel(MagickWand *wand,
2122 % const ChannelType channel,const size_t order,
2123 % const double *kernel)
2125 % A description of each parameter follows:
2127 % o wand: the magick wand.
2129 % o channel: the image channel(s).
2131 % o order: the number of columns and rows in the filter kernel.
2133 % o kernel: An array of doubles representing the convolution kernel.
2137 WandExport MagickBooleanType MagickConvolveImage(MagickWand *wand,
2138 const size_t order,const double *kernel)
2143 status=MagickConvolveImageChannel(wand,DefaultChannels,order,kernel);
2147 WandExport MagickBooleanType MagickConvolveImageChannel(MagickWand *wand,
2148 const ChannelType channel,const size_t order,const double *kernel)
2153 assert(wand != (MagickWand *) NULL);
2154 assert(wand->signature == WandSignature);
2155 if (wand->debug != MagickFalse)
2156 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2157 if (kernel == (const double *) NULL)
2158 return(MagickFalse);
2159 if (wand->images == (Image *) NULL)
2160 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2161 convolve_image=ConvolveImageChannel(wand->images,channel,order,kernel,
2163 if (convolve_image == (Image *) NULL)
2164 return(MagickFalse);
2165 ReplaceImageInList(&wand->images,convolve_image);
2170 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2174 % M a g i c k C r o p I m a g e %
2178 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2180 % MagickCropImage() extracts a region of the image.
2182 % The format of the MagickCropImage method is:
2184 % MagickBooleanType MagickCropImage(MagickWand *wand,
2185 % const size_t width,const size_t height,const ssize_t x,const ssize_t y)
2187 % A description of each parameter follows:
2189 % o wand: the magick wand.
2191 % o width: the region width.
2193 % o height: the region height.
2195 % o x: the region x-offset.
2197 % o y: the region y-offset.
2200 WandExport MagickBooleanType MagickCropImage(MagickWand *wand,
2201 const size_t width,const size_t height,const ssize_t x,const ssize_t y)
2209 assert(wand != (MagickWand *) NULL);
2210 assert(wand->signature == WandSignature);
2211 if (wand->debug != MagickFalse)
2212 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2213 if (wand->images == (Image *) NULL)
2214 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2219 crop_image=CropImage(wand->images,&crop,wand->exception);
2220 if (crop_image == (Image *) NULL)
2221 return(MagickFalse);
2222 ReplaceImageInList(&wand->images,crop_image);
2227 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2231 % M a g i c k C y c l e C o l o r m a p I m a g e %
2235 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2237 % MagickCycleColormapImage() displaces an image's colormap by a given number
2238 % of positions. If you cycle the colormap a number of times you can produce
2239 % a psychodelic effect.
2241 % The format of the MagickCycleColormapImage method is:
2243 % MagickBooleanType MagickCycleColormapImage(MagickWand *wand,
2244 % const ssize_t displace)
2246 % A description of each parameter follows:
2248 % o wand: the magick wand.
2250 % o pixel_wand: the pixel wand.
2253 WandExport MagickBooleanType MagickCycleColormapImage(MagickWand *wand,
2254 const ssize_t displace)
2259 assert(wand != (MagickWand *) NULL);
2260 assert(wand->signature == WandSignature);
2261 if (wand->debug != MagickFalse)
2262 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2263 if (wand->images == (Image *) NULL)
2264 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2265 status=CycleColormapImage(wand->images,displace);
2266 if (status == MagickFalse)
2267 InheritException(wand->exception,&wand->images->exception);
2272 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2276 % M a g i c k C o n s t i t u t e I m a g e %
2280 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2282 % MagickConstituteImage() adds an image to the wand comprised of the pixel
2283 % data you supply. The pixel data must be in scanline order top-to-bottom.
2284 % The data can be char, short int, int, float, or double. Float and double
2285 % require the pixels to be normalized [0..1], otherwise [0..Max], where Max
2286 % is the maximum value the type can accomodate (e.g. 255 for char). For
2287 % example, to create a 640x480 image from unsigned red-green-blue character
2290 % MagickConstituteImage(wand,640,640,"RGB",CharPixel,pixels);
2292 % The format of the MagickConstituteImage method is:
2294 % MagickBooleanType MagickConstituteImage(MagickWand *wand,
2295 % const size_t columns,const size_t rows,const char *map,
2296 % const StorageType storage,void *pixels)
2298 % A description of each parameter follows:
2300 % o wand: the magick wand.
2302 % o columns: width in pixels of the image.
2304 % o rows: height in pixels of the image.
2306 % o map: This string reflects the expected ordering of the pixel array.
2307 % It can be any combination or order of R = red, G = green, B = blue,
2308 % A = alpha (0 is transparent), O = opacity (0 is opaque), C = cyan,
2309 % Y = yellow, M = magenta, K = black, I = intensity (for grayscale),
2312 % o storage: Define the data type of the pixels. Float and double types are
2313 % expected to be normalized [0..1] otherwise [0..QuantumRange]. Choose from
2314 % these types: CharPixel, DoublePixel, FloatPixel, IntegerPixel,
2315 % LongPixel, QuantumPixel, or ShortPixel.
2317 % o pixels: This array of values contain the pixel components as defined by
2318 % map and type. You must preallocate this array where the expected
2319 % length varies depending on the values of width, height, map, and type.
2323 WandExport MagickBooleanType MagickConstituteImage(MagickWand *wand,
2324 const size_t columns,const size_t rows,const char *map,
2325 const StorageType storage,const void *pixels)
2330 assert(wand != (MagickWand *) NULL);
2331 assert(wand->signature == WandSignature);
2332 if (wand->debug != MagickFalse)
2333 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2334 images=ConstituteImage(columns,rows,map,storage,pixels,wand->exception);
2335 if (images == (Image *) NULL)
2336 return(MagickFalse);
2337 return(InsertImageInWand(wand,images));
2341 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2345 % M a g i c k D e c i p h e r I m a g e %
2349 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2351 % MagickDecipherImage() converts cipher pixels to plain pixels.
2353 % The format of the MagickDecipherImage method is:
2355 % MagickBooleanType MagickDecipherImage(MagickWand *wand,
2356 % const char *passphrase)
2358 % A description of each parameter follows:
2360 % o wand: the magick wand.
2362 % o passphrase: the passphrase.
2365 WandExport MagickBooleanType MagickDecipherImage(MagickWand *wand,
2366 const char *passphrase)
2368 assert(wand != (MagickWand *) NULL);
2369 assert(wand->signature == WandSignature);
2370 if (wand->debug != MagickFalse)
2371 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2372 if (wand->images == (Image *) NULL)
2373 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2374 return(DecipherImage(wand->images,passphrase,&wand->images->exception));
2378 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2382 % M a g i c k D e c o n s t r u c t I m a g e s %
2386 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2388 % MagickDeconstructImages() compares each image with the next in a sequence
2389 % and returns the maximum bounding region of any pixel differences it
2392 % The format of the MagickDeconstructImages method is:
2394 % MagickWand *MagickDeconstructImages(MagickWand *wand)
2396 % A description of each parameter follows:
2398 % o wand: the magick wand.
2401 WandExport MagickWand *MagickDeconstructImages(MagickWand *wand)
2406 assert(wand != (MagickWand *) NULL);
2407 assert(wand->signature == WandSignature);
2408 if (wand->debug != MagickFalse)
2409 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2410 if (wand->images == (Image *) NULL)
2411 return((MagickWand *) NULL);
2412 deconstruct_image=DeconstructImages(wand->images,wand->exception);
2413 if (deconstruct_image == (Image *) NULL)
2414 return((MagickWand *) NULL);
2415 return(CloneMagickWandFromImages(wand,deconstruct_image));
2419 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2423 % M a g i c k D e s k e w I m a g e %
2427 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2429 % MagickDeskewImage() removes skew from the image. Skew is an artifact that
2430 % occurs in scanned images because of the camera being misaligned,
2431 % imperfections in the scanning or surface, or simply because the paper was
2432 % not placed completely flat when scanned.
2434 % The format of the MagickDeskewImage method is:
2436 % MagickBooleanType MagickDeskewImage(MagickWand *wand,
2437 % const double threshold)
2439 % A description of each parameter follows:
2441 % o wand: the magick wand.
2443 % o threshold: separate background from foreground.
2446 WandExport MagickBooleanType MagickDeskewImage(MagickWand *wand,
2447 const double threshold)
2452 assert(wand != (MagickWand *) NULL);
2453 assert(wand->signature == WandSignature);
2454 if (wand->debug != MagickFalse)
2455 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2456 if (wand->images == (Image *) NULL)
2457 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2458 sepia_image=DeskewImage(wand->images,threshold,wand->exception);
2459 if (sepia_image == (Image *) NULL)
2460 return(MagickFalse);
2461 ReplaceImageInList(&wand->images,sepia_image);
2466 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2470 % M a g i c k D e s p e c k l e I m a g e %
2474 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2476 % MagickDespeckleImage() reduces the speckle noise in an image while
2477 % perserving the edges of the original image.
2479 % The format of the MagickDespeckleImage method is:
2481 % MagickBooleanType MagickDespeckleImage(MagickWand *wand)
2483 % A description of each parameter follows:
2485 % o wand: the magick wand.
2488 WandExport MagickBooleanType MagickDespeckleImage(MagickWand *wand)
2493 assert(wand != (MagickWand *) NULL);
2494 assert(wand->signature == WandSignature);
2495 if (wand->debug != MagickFalse)
2496 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2497 if (wand->images == (Image *) NULL)
2498 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2499 despeckle_image=DespeckleImage(wand->images,wand->exception);
2500 if (despeckle_image == (Image *) NULL)
2501 return(MagickFalse);
2502 ReplaceImageInList(&wand->images,despeckle_image);
2507 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2511 % M a g i c k D e s t r o y I m a g e %
2515 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2517 % MagickDestroyImage() dereferences an image, deallocating memory associated
2518 % with the image if the reference count becomes zero.
2520 % The format of the MagickDestroyImage method is:
2522 % Image *MagickDestroyImage(Image *image)
2524 % A description of each parameter follows:
2526 % o image: the image.
2529 WandExport Image *MagickDestroyImage(Image *image)
2531 return(DestroyImage(image));
2535 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2539 % M a g i c k D i s p l a y I m a g e %
2543 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2545 % MagickDisplayImage() displays an image.
2547 % The format of the MagickDisplayImage method is:
2549 % MagickBooleanType MagickDisplayImage(MagickWand *wand,
2550 % const char *server_name)
2552 % A description of each parameter follows:
2554 % o wand: the magick wand.
2556 % o server_name: the X server name.
2559 WandExport MagickBooleanType MagickDisplayImage(MagickWand *wand,
2560 const char *server_name)
2568 assert(wand != (MagickWand *) NULL);
2569 assert(wand->signature == WandSignature);
2570 if (wand->debug != MagickFalse)
2571 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2572 if (wand->images == (Image *) NULL)
2573 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2574 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
2575 if (image == (Image *) NULL)
2576 return(MagickFalse);
2577 (void) CloneString(&wand->image_info->server_name,server_name);
2578 status=DisplayImages(wand->image_info,image);
2579 if (status == MagickFalse)
2580 InheritException(wand->exception,&image->exception);
2581 image=DestroyImage(image);
2586 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2590 % M a g i c k D i s p l a y I m a g e s %
2594 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2596 % MagickDisplayImages() displays an image or image sequence.
2598 % The format of the MagickDisplayImages method is:
2600 % MagickBooleanType MagickDisplayImages(MagickWand *wand,
2601 % const char *server_name)
2603 % A description of each parameter follows:
2605 % o wand: the magick wand.
2607 % o server_name: the X server name.
2610 WandExport MagickBooleanType MagickDisplayImages(MagickWand *wand,
2611 const char *server_name)
2616 assert(wand != (MagickWand *) NULL);
2617 assert(wand->signature == WandSignature);
2618 if (wand->debug != MagickFalse)
2619 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2620 (void) CloneString(&wand->image_info->server_name,server_name);
2621 status=DisplayImages(wand->image_info,wand->images);
2622 if (status == MagickFalse)
2623 InheritException(wand->exception,&wand->images->exception);
2628 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2632 % M a g i c k D i s t o r t I m a g e %
2636 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2638 % MagickDistortImage() distorts an image using various distortion methods, by
2639 % mapping color lookups of the source image to a new destination image
2640 % usally of the same size as the source image, unless 'bestfit' is set to
2643 % If 'bestfit' is enabled, and distortion allows it, the destination image is
2644 % adjusted to ensure the whole source 'image' will just fit within the final
2645 % destination image, which will be sized and offset accordingly. Also in
2646 % many cases the virtual offset of the source image will be taken into
2647 % account in the mapping.
2649 % The format of the MagickDistortImage method is:
2651 % MagickBooleanType MagickDistortImage(MagickWand *wand,
2652 % const DistortImageMethod method,const size_t number_arguments,
2653 % const double *arguments,const MagickBooleanType bestfit)
2655 % A description of each parameter follows:
2657 % o image: the image to be distorted.
2659 % o method: the method of image distortion.
2661 % ArcDistortion always ignores the source image offset, and always
2662 % 'bestfit' the destination image with the top left corner offset
2663 % relative to the polar mapping center.
2665 % Bilinear has no simple inverse mapping so it does not allow 'bestfit'
2666 % style of image distortion.
2668 % Affine, Perspective, and Bilinear, do least squares fitting of the
2669 % distortion when more than the minimum number of control point pairs
2672 % Perspective, and Bilinear, falls back to a Affine distortion when less
2673 % that 4 control point pairs are provided. While Affine distortions let
2674 % you use any number of control point pairs, that is Zero pairs is a
2675 % no-Op (viewport only) distrotion, one pair is a translation and two
2676 % pairs of control points do a scale-rotate-translate, without any
2679 % o number_arguments: the number of arguments given for this distortion
2682 % o arguments: the arguments for this distortion method.
2684 % o bestfit: Attempt to resize destination to fit distorted source.
2687 WandExport MagickBooleanType MagickDistortImage(MagickWand *wand,
2688 const DistortImageMethod method,const size_t number_arguments,
2689 const double *arguments,const MagickBooleanType bestfit)
2694 assert(wand != (MagickWand *) NULL);
2695 assert(wand->signature == WandSignature);
2696 if (wand->debug != MagickFalse)
2697 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2698 if (wand->images == (Image *) NULL)
2699 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2700 distort_image=DistortImage(wand->images,method,number_arguments,arguments,
2701 bestfit,wand->exception);
2702 if (distort_image == (Image *) NULL)
2703 return(MagickFalse);
2704 ReplaceImageInList(&wand->images,distort_image);
2709 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2713 % M a g i c k D r a w I m a g e %
2717 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2719 % MagickDrawImage() renders the drawing wand on the current image.
2721 % The format of the MagickDrawImage method is:
2723 % MagickBooleanType MagickDrawImage(MagickWand *wand,
2724 % const DrawingWand *drawing_wand)
2726 % A description of each parameter follows:
2728 % o wand: the magick wand.
2730 % o drawing_wand: the draw wand.
2733 WandExport MagickBooleanType MagickDrawImage(MagickWand *wand,
2734 const DrawingWand *drawing_wand)
2745 assert(wand != (MagickWand *) NULL);
2746 assert(wand->signature == WandSignature);
2747 if (wand->debug != MagickFalse)
2748 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2749 if (wand->images == (Image *) NULL)
2750 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2751 draw_info=PeekDrawingWand(drawing_wand);
2752 if ((draw_info == (DrawInfo *) NULL) ||
2753 (draw_info->primitive == (char *) NULL))
2754 return(MagickFalse);
2755 primitive=AcquireString(draw_info->primitive);
2756 draw_info=DestroyDrawInfo(draw_info);
2757 draw_info=CloneDrawInfo(wand->image_info,(DrawInfo *) NULL);
2758 draw_info->primitive=primitive;
2759 status=DrawImage(wand->images,draw_info);
2760 if (status == MagickFalse)
2761 InheritException(wand->exception,&wand->images->exception);
2762 draw_info=DestroyDrawInfo(draw_info);
2767 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2771 % M a g i c k E d g e I m a g e %
2775 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2777 % MagickEdgeImage() enhance edges within the image with a convolution filter
2778 % of the given radius. Use a radius of 0 and Edge() selects a suitable
2781 % The format of the MagickEdgeImage method is:
2783 % MagickBooleanType MagickEdgeImage(MagickWand *wand,const double radius)
2785 % A description of each parameter follows:
2787 % o wand: the magick wand.
2789 % o radius: the radius of the pixel neighborhood.
2792 WandExport MagickBooleanType MagickEdgeImage(MagickWand *wand,
2793 const double radius)
2798 assert(wand != (MagickWand *) NULL);
2799 assert(wand->signature == WandSignature);
2800 if (wand->debug != MagickFalse)
2801 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2802 if (wand->images == (Image *) NULL)
2803 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2804 edge_image=EdgeImage(wand->images,radius,wand->exception);
2805 if (edge_image == (Image *) NULL)
2806 return(MagickFalse);
2807 ReplaceImageInList(&wand->images,edge_image);
2812 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2816 % M a g i c k E m b o s s I m a g e %
2820 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2822 % MagickEmbossImage() returns a grayscale image with a three-dimensional
2823 % effect. We convolve the image with a Gaussian operator of the given radius
2824 % and standard deviation (sigma). For reasonable results, radius should be
2825 % larger than sigma. Use a radius of 0 and Emboss() selects a suitable
2828 % The format of the MagickEmbossImage method is:
2830 % MagickBooleanType MagickEmbossImage(MagickWand *wand,const double radius,
2831 % const double sigma)
2833 % A description of each parameter follows:
2835 % o wand: the magick wand.
2837 % o radius: the radius of the Gaussian, in pixels, not counting the center
2840 % o sigma: the standard deviation of the Gaussian, in pixels.
2843 WandExport MagickBooleanType MagickEmbossImage(MagickWand *wand,
2844 const double radius,const double sigma)
2849 assert(wand != (MagickWand *) NULL);
2850 assert(wand->signature == WandSignature);
2851 if (wand->debug != MagickFalse)
2852 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2853 if (wand->images == (Image *) NULL)
2854 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2855 emboss_image=EmbossImage(wand->images,radius,sigma,wand->exception);
2856 if (emboss_image == (Image *) NULL)
2857 return(MagickFalse);
2858 ReplaceImageInList(&wand->images,emboss_image);
2863 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2867 % M a g i c k E n c i p h e r I m a g e %
2871 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2873 % MagickEncipherImage() converts plaint pixels to cipher pixels.
2875 % The format of the MagickEncipherImage method is:
2877 % MagickBooleanType MagickEncipherImage(MagickWand *wand,
2878 % const char *passphrase)
2880 % A description of each parameter follows:
2882 % o wand: the magick wand.
2884 % o passphrase: the passphrase.
2887 WandExport MagickBooleanType MagickEncipherImage(MagickWand *wand,
2888 const char *passphrase)
2890 assert(wand != (MagickWand *) NULL);
2891 assert(wand->signature == WandSignature);
2892 if (wand->debug != MagickFalse)
2893 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2894 if (wand->images == (Image *) NULL)
2895 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2896 return(EncipherImage(wand->images,passphrase,&wand->images->exception));
2900 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2904 % M a g i c k E n h a n c e I m a g e %
2908 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2910 % MagickEnhanceImage() applies a digital filter that improves the quality of a
2913 % The format of the MagickEnhanceImage method is:
2915 % MagickBooleanType MagickEnhanceImage(MagickWand *wand)
2917 % A description of each parameter follows:
2919 % o wand: the magick wand.
2922 WandExport MagickBooleanType MagickEnhanceImage(MagickWand *wand)
2927 assert(wand != (MagickWand *) NULL);
2928 assert(wand->signature == WandSignature);
2929 if (wand->debug != MagickFalse)
2930 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2931 if (wand->images == (Image *) NULL)
2932 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2933 enhance_image=EnhanceImage(wand->images,wand->exception);
2934 if (enhance_image == (Image *) NULL)
2935 return(MagickFalse);
2936 ReplaceImageInList(&wand->images,enhance_image);
2941 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2945 % M a g i c k E q u a l i z e I m a g e %
2949 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2951 % MagickEqualizeImage() equalizes the image histogram.
2953 % The format of the MagickEqualizeImage method is:
2955 % MagickBooleanType MagickEqualizeImage(MagickWand *wand)
2956 % MagickBooleanType MagickEqualizeImageChannel(MagickWand *wand,
2957 % const ChannelType channel)
2959 % A description of each parameter follows:
2961 % o wand: the magick wand.
2963 % o channel: the image channel(s).
2967 WandExport MagickBooleanType MagickEqualizeImage(MagickWand *wand)
2972 status=MagickEqualizeImageChannel(wand,DefaultChannels);
2976 WandExport MagickBooleanType MagickEqualizeImageChannel(MagickWand *wand,
2977 const ChannelType channel)
2982 assert(wand != (MagickWand *) NULL);
2983 assert(wand->signature == WandSignature);
2984 if (wand->debug != MagickFalse)
2985 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2986 if (wand->images == (Image *) NULL)
2987 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2988 status=EqualizeImageChannel(wand->images,channel);
2989 if (status == MagickFalse)
2990 InheritException(wand->exception,&wand->images->exception);
2995 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2999 % M a g i c k E v a l u a t e I m a g e %
3003 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3005 % MagickEvaluateImage() applys an arithmetic, relational, or logical
3006 % expression to an image. Use these operators to lighten or darken an image,
3007 % to increase or decrease contrast in an image, or to produce the "negative"
3010 % The format of the MagickEvaluateImage method is:
3012 % MagickBooleanType MagickEvaluateImage(MagickWand *wand,
3013 % const MagickEvaluateOperator operator,const double value)
3014 % MagickBooleanType MagickEvaluateImages(MagickWand *wand,
3015 % const MagickEvaluateOperator operator)
3016 % MagickBooleanType MagickEvaluateImageChannel(MagickWand *wand,
3017 % const ChannelType channel,const MagickEvaluateOperator op,
3018 % const double value)
3020 % A description of each parameter follows:
3022 % o wand: the magick wand.
3024 % o channel: the channel(s).
3026 % o op: A channel operator.
3028 % o value: A value value.
3032 WandExport MagickBooleanType MagickEvaluateImage(MagickWand *wand,
3033 const MagickEvaluateOperator op,const double value)
3038 assert(wand != (MagickWand *) NULL);
3039 assert(wand->signature == WandSignature);
3040 if (wand->debug != MagickFalse)
3041 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3042 if (wand->images == (Image *) NULL)
3043 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3044 status=EvaluateImage(wand->images,op,value,&wand->images->exception);
3045 if (status == MagickFalse)
3046 InheritException(wand->exception,&wand->images->exception);
3050 WandExport MagickWand *MagickEvaluateImages(MagickWand *wand,
3051 const MagickEvaluateOperator op)
3056 assert(wand != (MagickWand *) NULL);
3057 assert(wand->signature == WandSignature);
3058 if (wand->debug != MagickFalse)
3059 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3060 if (wand->images == (Image *) NULL)
3061 return((MagickWand *) NULL);
3062 evaluate_image=EvaluateImages(wand->images,op,wand->exception);
3063 if (evaluate_image == (Image *) NULL)
3064 return((MagickWand *) NULL);
3065 return(CloneMagickWandFromImages(wand,evaluate_image));
3068 WandExport MagickBooleanType MagickEvaluateImageChannel(MagickWand *wand,
3069 const ChannelType channel,const MagickEvaluateOperator op,const double value)
3074 assert(wand != (MagickWand *) NULL);
3075 assert(wand->signature == WandSignature);
3076 if (wand->debug != MagickFalse)
3077 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3078 if (wand->images == (Image *) NULL)
3079 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3080 status=EvaluateImageChannel(wand->images,channel,op,value,
3081 &wand->images->exception);
3086 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3090 % M a g i c k E x p o r t I m a g e P i x e l s %
3094 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3096 % MagickExportImagePixels() extracts pixel data from an image and returns it
3097 % to you. The method returns MagickTrue on success otherwise MagickFalse if
3098 % an error is encountered. The data is returned as char, short int, int,
3099 % ssize_t, float, or double in the order specified by map.
3101 % Suppose you want to extract the first scanline of a 640x480 image as
3102 % character data in red-green-blue order:
3104 % MagickExportImagePixels(wand,0,0,640,1,"RGB",CharPixel,pixels);
3106 % The format of the MagickExportImagePixels method is:
3108 % MagickBooleanType MagickExportImagePixels(MagickWand *wand,
3109 % const ssize_t x,const ssize_t y,const size_t columns,
3110 % const size_t rows,const char *map,const StorageType storage,
3113 % A description of each parameter follows:
3115 % o wand: the magick wand.
3117 % o x, y, columns, rows: These values define the perimeter
3118 % of a region of pixels you want to extract.
3120 % o map: This string reflects the expected ordering of the pixel array.
3121 % It can be any combination or order of R = red, G = green, B = blue,
3122 % A = alpha (0 is transparent), O = opacity (0 is opaque), C = cyan,
3123 % Y = yellow, M = magenta, K = black, I = intensity (for grayscale),
3126 % o storage: Define the data type of the pixels. Float and double types are
3127 % expected to be normalized [0..1] otherwise [0..QuantumRange]. Choose from
3128 % these types: CharPixel, DoublePixel, FloatPixel, IntegerPixel,
3129 % LongPixel, QuantumPixel, or ShortPixel.
3131 % o pixels: This array of values contain the pixel components as defined by
3132 % map and type. You must preallocate this array where the expected
3133 % length varies depending on the values of width, height, map, and type.
3136 WandExport MagickBooleanType MagickExportImagePixels(MagickWand *wand,
3137 const ssize_t x,const ssize_t y,const size_t columns,
3138 const size_t rows,const char *map,const StorageType storage,
3144 assert(wand != (MagickWand *) NULL);
3145 assert(wand->signature == WandSignature);
3146 if (wand->debug != MagickFalse)
3147 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3148 if (wand->images == (Image *) NULL)
3149 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3150 status=ExportImagePixels(wand->images,x,y,columns,rows,map,
3151 storage,pixels,wand->exception);
3152 if (status == MagickFalse)
3153 InheritException(wand->exception,&wand->images->exception);
3158 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3162 % M a g i c k E x t e n t I m a g e %
3166 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3168 % MagickExtentImage() extends the image as defined by the geometry, gravity,
3169 % and wand background color. Set the (x,y) offset of the geometry to move
3170 % the original wand relative to the extended wand.
3172 % The format of the MagickExtentImage method is:
3174 % MagickBooleanType MagickExtentImage(MagickWand *wand,
3175 % const size_t width,const size_t height,const ssize_t x,
3178 % A description of each parameter follows:
3180 % o wand: the magick wand.
3182 % o width: the region width.
3184 % o height: the region height.
3186 % o x: the region x offset.
3188 % o y: the region y offset.
3191 WandExport MagickBooleanType MagickExtentImage(MagickWand *wand,
3192 const size_t width,const size_t height,const ssize_t x,
3201 assert(wand != (MagickWand *) NULL);
3202 assert(wand->signature == WandSignature);
3203 if (wand->debug != MagickFalse)
3204 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3205 if (wand->images == (Image *) NULL)
3206 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3208 extent.height=height;
3211 extent_image=ExtentImage(wand->images,&extent,wand->exception);
3212 if (extent_image == (Image *) NULL)
3213 return(MagickFalse);
3214 ReplaceImageInList(&wand->images,extent_image);
3219 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3223 % M a g i c k F i l t e r I m a g e %
3227 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3229 % MagickFilterImage() applies a custom convolution kernel to the image.
3231 % The format of the MagickFilterImage method is:
3233 % MagickBooleanType MagickFilterImage(MagickWand *wand,
3234 % const KernelInfo *kernel)
3235 % MagickBooleanType MagickFilterImageChannel(MagickWand *wand,
3236 % const ChannelType channel,const KernelInfo *kernel)
3238 % A description of each parameter follows:
3240 % o wand: the magick wand.
3242 % o channel: the image channel(s).
3244 % o kernel: An array of doubles representing the convolution kernel.
3248 WandExport MagickBooleanType MagickFilterImage(MagickWand *wand,
3249 const KernelInfo *kernel)
3254 status=MagickFilterImageChannel(wand,DefaultChannels,kernel);
3258 WandExport MagickBooleanType MagickFilterImageChannel(MagickWand *wand,
3259 const ChannelType channel,const KernelInfo *kernel)
3264 assert(wand != (MagickWand *) NULL);
3265 assert(wand->signature == WandSignature);
3266 if (wand->debug != MagickFalse)
3267 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3268 if (kernel == (const KernelInfo *) NULL)
3269 return(MagickFalse);
3270 if (wand->images == (Image *) NULL)
3271 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3272 filter_image=FilterImageChannel(wand->images,channel,kernel,wand->exception);
3273 if (filter_image == (Image *) NULL)
3274 return(MagickFalse);
3275 ReplaceImageInList(&wand->images,filter_image);
3280 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3284 % M a g i c k F l i p I m a g e %
3288 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3290 % MagickFlipImage() creates a vertical mirror image by reflecting the pixels
3291 % around the central x-axis.
3293 % The format of the MagickFlipImage method is:
3295 % MagickBooleanType MagickFlipImage(MagickWand *wand)
3297 % A description of each parameter follows:
3299 % o wand: the magick wand.
3302 WandExport MagickBooleanType MagickFlipImage(MagickWand *wand)
3307 assert(wand != (MagickWand *) NULL);
3308 assert(wand->signature == WandSignature);
3309 if (wand->debug != MagickFalse)
3310 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3311 if (wand->images == (Image *) NULL)
3312 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3313 flip_image=FlipImage(wand->images,wand->exception);
3314 if (flip_image == (Image *) NULL)
3315 return(MagickFalse);
3316 ReplaceImageInList(&wand->images,flip_image);
3321 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3325 % 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 %
3329 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3331 % MagickFloodfillPaintImage() changes the color value of any pixel that matches
3332 % target and is an immediate neighbor. If the method FillToBorderMethod is
3333 % specified, the color value is changed for any neighbor pixel that does not
3334 % match the bordercolor member of image.
3336 % The format of the MagickFloodfillPaintImage method is:
3338 % MagickBooleanType MagickFloodfillPaintImage(MagickWand *wand,
3339 % const ChannelType channel,const PixelWand *fill,const double fuzz,
3340 % const PixelWand *bordercolor,const ssize_t x,const ssize_t y,
3341 % const MagickBooleanType invert)
3343 % A description of each parameter follows:
3345 % o wand: the magick wand.
3347 % o channel: the channel(s).
3349 % o fill: the floodfill color pixel wand.
3351 % o fuzz: By default target must match a particular pixel color
3352 % exactly. However, in many cases two colors may differ by a small amount.
3353 % The fuzz member of image defines how much tolerance is acceptable to
3354 % consider two colors as the same. For example, set fuzz to 10 and the
3355 % color red at intensities of 100 and 102 respectively are now interpreted
3356 % as the same color for the purposes of the floodfill.
3358 % o bordercolor: the border color pixel wand.
3360 % o x,y: the starting location of the operation.
3362 % o invert: paint any pixel that does not match the target color.
3365 WandExport MagickBooleanType MagickFloodfillPaintImage(MagickWand *wand,
3366 const ChannelType channel,const PixelWand *fill,const double fuzz,
3367 const PixelWand *bordercolor,const ssize_t x,const ssize_t y,
3368 const MagickBooleanType invert)
3379 assert(wand != (MagickWand *) NULL);
3380 assert(wand->signature == WandSignature);
3381 if (wand->debug != MagickFalse)
3382 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3383 if (wand->images == (Image *) NULL)
3384 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3385 draw_info=CloneDrawInfo(wand->image_info,(DrawInfo *) NULL);
3386 PixelGetQuantumColor(fill,&draw_info->fill);
3387 (void) GetOneVirtualMagickPixel(wand->images,x % wand->images->columns,
3388 y % wand->images->rows,&target,wand->exception);
3389 if (bordercolor != (PixelWand *) NULL)
3390 PixelGetMagickColor(bordercolor,&target);
3391 wand->images->fuzz=fuzz;
3392 status=FloodfillPaintImage(wand->images,channel,draw_info,&target,x,y,
3394 if (status == MagickFalse)
3395 InheritException(wand->exception,&wand->images->exception);
3396 draw_info=DestroyDrawInfo(draw_info);
3401 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3405 % M a g i c k F l o p I m a g e %
3409 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3411 % MagickFlopImage() creates a horizontal mirror image by reflecting the pixels
3412 % around the central y-axis.
3414 % The format of the MagickFlopImage method is:
3416 % MagickBooleanType MagickFlopImage(MagickWand *wand)
3418 % A description of each parameter follows:
3420 % o wand: the magick wand.
3423 WandExport MagickBooleanType MagickFlopImage(MagickWand *wand)
3428 assert(wand != (MagickWand *) NULL);
3429 assert(wand->signature == WandSignature);
3430 if (wand->debug != MagickFalse)
3431 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3432 if (wand->images == (Image *) NULL)
3433 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3434 flop_image=FlopImage(wand->images,wand->exception);
3435 if (flop_image == (Image *) NULL)
3436 return(MagickFalse);
3437 ReplaceImageInList(&wand->images,flop_image);
3442 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3446 % 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 %
3450 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3452 % MagickForwardFourierTransformImage() implements the discrete Fourier
3453 % transform (DFT) of the image either as a magnitude / phase or real /
3454 % imaginary image pair.
3456 % The format of the MagickForwardFourierTransformImage method is:
3458 % MagickBooleanType MagickForwardFourierTransformImage(MagickWand *wand,
3459 % const MagickBooleanType magnitude)
3461 % A description of each parameter follows:
3463 % o wand: the magick wand.
3465 % o magnitude: if true, return as magnitude / phase pair otherwise a real /
3466 % imaginary image pair.
3469 WandExport MagickBooleanType MagickForwardFourierTransformImage(
3470 MagickWand *wand,const MagickBooleanType magnitude)
3475 assert(wand != (MagickWand *) NULL);
3476 assert(wand->signature == WandSignature);
3477 if (wand->debug != MagickFalse)
3478 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3479 if (wand->images == (Image *) NULL)
3480 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3481 forward_image=ForwardFourierTransformImage(wand->images,magnitude,
3483 if (forward_image == (Image *) NULL)
3484 return(MagickFalse);
3485 ReplaceImageInList(&wand->images,forward_image);
3490 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3494 % M a g i c k F r a m e I m a g e %
3498 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3500 % MagickFrameImage() adds a simulated three-dimensional border around the
3501 % image. The width and height specify the border width of the vertical and
3502 % horizontal sides of the frame. The inner and outer bevels indicate the
3503 % width of the inner and outer shadows of the frame.
3505 % The format of the MagickFrameImage method is:
3507 % MagickBooleanType MagickFrameImage(MagickWand *wand,
3508 % const PixelWand *matte_color,const size_t width,
3509 % const size_t height,const ssize_t inner_bevel,
3510 % const ssize_t outer_bevel)
3512 % A description of each parameter follows:
3514 % o wand: the magick wand.
3516 % o matte_color: the frame color pixel wand.
3518 % o width: the border width.
3520 % o height: the border height.
3522 % o inner_bevel: the inner bevel width.
3524 % o outer_bevel: the outer bevel width.
3527 WandExport MagickBooleanType MagickFrameImage(MagickWand *wand,
3528 const PixelWand *matte_color,const size_t width,
3529 const size_t height,const ssize_t inner_bevel,const ssize_t outer_bevel)
3537 assert(wand != (MagickWand *) NULL);
3538 assert(wand->signature == WandSignature);
3539 if (wand->debug != MagickFalse)
3540 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3541 if (wand->images == (Image *) NULL)
3542 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3543 (void) ResetMagickMemory(&frame_info,0,sizeof(frame_info));
3544 frame_info.width=wand->images->columns+2*width;
3545 frame_info.height=wand->images->rows+2*height;
3546 frame_info.x=(ssize_t) width;
3547 frame_info.y=(ssize_t) height;
3548 frame_info.inner_bevel=inner_bevel;
3549 frame_info.outer_bevel=outer_bevel;
3550 PixelGetQuantumColor(matte_color,&wand->images->matte_color);
3551 frame_image=FrameImage(wand->images,&frame_info,wand->exception);
3552 if (frame_image == (Image *) NULL)
3553 return(MagickFalse);
3554 ReplaceImageInList(&wand->images,frame_image);
3559 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3563 % M a g i c k F u n c t i o n I m a g e %
3567 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3569 % MagickFunctionImage() applys an arithmetic, relational, or logical
3570 % expression to an image. Use these operators to lighten or darken an image,
3571 % to increase or decrease contrast in an image, or to produce the "negative"
3574 % The format of the MagickFunctionImage method is:
3576 % MagickBooleanType MagickFunctionImage(MagickWand *wand,
3577 % const MagickFunction function,const size_t number_arguments,
3578 % const double *arguments)
3579 % MagickBooleanType MagickFunctionImageChannel(MagickWand *wand,
3580 % const ChannelType channel,const MagickFunction function,
3581 % const size_t number_arguments,const double *arguments)
3583 % A description of each parameter follows:
3585 % o wand: the magick wand.
3587 % o channel: the channel(s).
3589 % o function: the image function.
3591 % o number_arguments: the number of function arguments.
3593 % o arguments: the function arguments.
3597 WandExport MagickBooleanType MagickFunctionImage(MagickWand *wand,
3598 const MagickFunction function,const size_t number_arguments,
3599 const double *arguments)
3604 assert(wand != (MagickWand *) NULL);
3605 assert(wand->signature == WandSignature);
3606 if (wand->debug != MagickFalse)
3607 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3608 if (wand->images == (Image *) NULL)
3609 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3610 status=FunctionImage(wand->images,function,number_arguments,arguments,
3611 &wand->images->exception);
3612 if (status == MagickFalse)
3613 InheritException(wand->exception,&wand->images->exception);
3617 WandExport MagickBooleanType MagickFunctionImageChannel(MagickWand *wand,
3618 const ChannelType channel,const MagickFunction function,
3619 const size_t number_arguments,const double *arguments)
3624 assert(wand != (MagickWand *) NULL);
3625 assert(wand->signature == WandSignature);
3626 if (wand->debug != MagickFalse)
3627 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3628 if (wand->images == (Image *) NULL)
3629 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3630 status=FunctionImageChannel(wand->images,channel,function,number_arguments,
3631 arguments,&wand->images->exception);
3636 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3640 % M a g i c k F x I m a g e %
3644 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3646 % MagickFxImage() evaluate expression for each pixel in the image.
3648 % The format of the MagickFxImage method is:
3650 % MagickWand *MagickFxImage(MagickWand *wand,const char *expression)
3651 % MagickWand *MagickFxImageChannel(MagickWand *wand,
3652 % const ChannelType channel,const char *expression)
3654 % A description of each parameter follows:
3656 % o wand: the magick wand.
3658 % o channel: the image channel(s).
3660 % o expression: the expression.
3664 WandExport MagickWand *MagickFxImage(MagickWand *wand,const char *expression)
3669 fx_wand=MagickFxImageChannel(wand,DefaultChannels,expression);
3673 WandExport MagickWand *MagickFxImageChannel(MagickWand *wand,
3674 const ChannelType channel,const char *expression)
3679 assert(wand != (MagickWand *) NULL);
3680 assert(wand->signature == WandSignature);
3681 if (wand->debug != MagickFalse)
3682 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3683 if (wand->images == (Image *) NULL)
3684 return((MagickWand *) NULL);
3685 fx_image=FxImageChannel(wand->images,channel,expression,wand->exception);
3686 if (fx_image == (Image *) NULL)
3687 return((MagickWand *) NULL);
3688 return(CloneMagickWandFromImages(wand,fx_image));
3692 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3696 % M a g i c k G a m m a I m a g e %
3700 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3702 % MagickGammaImage() gamma-corrects an image. The same image viewed on
3703 % different devices will have perceptual differences in the way the image's
3704 % intensities are represented on the screen. Specify individual gamma levels
3705 % for the red, green, and blue channels, or adjust all three with the gamma
3706 % parameter. Values typically range from 0.8 to 2.3.
3708 % You can also reduce the influence of a particular channel with a gamma
3711 % The format of the MagickGammaImage method is:
3713 % MagickBooleanType MagickGammaImage(MagickWand *wand,const double gamma)
3714 % MagickBooleanType MagickGammaImageChannel(MagickWand *wand,
3715 % const ChannelType channel,const double gamma)
3717 % A description of each parameter follows:
3719 % o wand: the magick wand.
3721 % o channel: the channel.
3723 % o level: Define the level of gamma correction.
3727 WandExport MagickBooleanType MagickGammaImage(MagickWand *wand,
3733 status=MagickGammaImageChannel(wand,DefaultChannels,gamma);
3737 WandExport MagickBooleanType MagickGammaImageChannel(MagickWand *wand,
3738 const ChannelType channel,const double gamma)
3743 assert(wand != (MagickWand *) NULL);
3744 assert(wand->signature == WandSignature);
3745 if (wand->debug != MagickFalse)
3746 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3747 if (wand->images == (Image *) NULL)
3748 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3749 status=GammaImageChannel(wand->images,channel,gamma);
3750 if (status == MagickFalse)
3751 InheritException(wand->exception,&wand->images->exception);
3756 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3760 % M a g i c k G a u s s i a n B l u r I m a g e %
3764 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3766 % MagickGaussianBlurImage() blurs an image. We convolve the image with a
3767 % Gaussian operator of the given radius and standard deviation (sigma).
3768 % For reasonable results, the radius should be larger than sigma. Use a
3769 % radius of 0 and MagickGaussianBlurImage() selects a suitable radius for you.
3771 % The format of the MagickGaussianBlurImage method is:
3773 % MagickBooleanType MagickGaussianBlurImage(MagickWand *wand,
3774 % const double radius,const double sigma)
3775 % MagickBooleanType MagickGaussianBlurImageChannel(MagickWand *wand,
3776 % const ChannelType channel,const double radius,const double sigma)
3778 % A description of each parameter follows:
3780 % o wand: the magick wand.
3782 % o channel: the image channel(s).
3784 % o radius: the radius of the Gaussian, in pixels, not counting the center
3787 % o sigma: the standard deviation of the Gaussian, in pixels.
3791 WandExport MagickBooleanType MagickGaussianBlurImage(MagickWand *wand,
3792 const double radius,const double sigma)
3797 status=MagickGaussianBlurImageChannel(wand,DefaultChannels,radius,sigma);
3801 WandExport MagickBooleanType MagickGaussianBlurImageChannel(MagickWand *wand,
3802 const ChannelType channel,const double radius,const double sigma)
3807 assert(wand != (MagickWand *) NULL);
3808 assert(wand->signature == WandSignature);
3809 if (wand->debug != MagickFalse)
3810 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3811 if (wand->images == (Image *) NULL)
3812 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3813 blur_image=GaussianBlurImageChannel(wand->images,channel,radius,sigma,
3815 if (blur_image == (Image *) NULL)
3816 return(MagickFalse);
3817 ReplaceImageInList(&wand->images,blur_image);
3822 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3826 % M a g i c k G e t I m a g e %
3830 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3832 % MagickGetImage() gets the image at the current image index.
3834 % The format of the MagickGetImage method is:
3836 % MagickWand *MagickGetImage(MagickWand *wand)
3838 % A description of each parameter follows:
3840 % o wand: the magick wand.
3843 WandExport MagickWand *MagickGetImage(MagickWand *wand)
3848 assert(wand != (MagickWand *) NULL);
3849 assert(wand->signature == WandSignature);
3850 if (wand->debug != MagickFalse)
3851 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3852 if (wand->images == (Image *) NULL)
3854 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3855 "ContainsNoImages","`%s'",wand->name);
3856 return((MagickWand *) NULL);
3858 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
3859 if (image == (Image *) NULL)
3860 return((MagickWand *) NULL);
3861 return(CloneMagickWandFromImages(wand,image));
3865 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3869 % 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 %
3873 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3875 % MagickGetImageAlphaChannel() returns MagickFalse if the image alpha channel
3876 % is not activated. That is, the image is RGB rather than RGBA or CMYK rather
3879 % The format of the MagickGetImageAlphaChannel method is:
3881 % size_t MagickGetImageAlphaChannel(MagickWand *wand)
3883 % A description of each parameter follows:
3885 % o wand: the magick wand.
3888 WandExport MagickBooleanType MagickGetImageAlphaChannel(MagickWand *wand)
3890 assert(wand != (MagickWand *) NULL);
3891 assert(wand->signature == WandSignature);
3892 if (wand->debug != MagickFalse)
3893 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3894 if (wand->images == (Image *) NULL)
3895 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3896 return(GetImageAlphaChannel(wand->images));
3900 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3904 % M a g i c k G e t I m a g e C l i p M a s k %
3908 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3910 % MagickGetImageClipMask() gets the image clip mask at the current image index.
3912 % The format of the MagickGetImageClipMask method is:
3914 % MagickWand *MagickGetImageClipMask(MagickWand *wand)
3916 % A description of each parameter follows:
3918 % o wand: the magick wand.
3921 WandExport MagickWand *MagickGetImageClipMask(MagickWand *wand)
3926 assert(wand != (MagickWand *) NULL);
3927 assert(wand->signature == WandSignature);
3928 if (wand->debug != MagickFalse)
3929 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3930 if (wand->images == (Image *) NULL)
3932 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3933 "ContainsNoImages","`%s'",wand->name);
3934 return((MagickWand *) NULL);
3936 image=GetImageClipMask(wand->images,wand->exception);
3937 if (image == (Image *) NULL)
3938 return((MagickWand *) NULL);
3939 return(CloneMagickWandFromImages(wand,image));
3943 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3947 % 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 %
3951 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3953 % MagickGetImageBackgroundColor() returns the image background color.
3955 % The format of the MagickGetImageBackgroundColor method is:
3957 % MagickBooleanType MagickGetImageBackgroundColor(MagickWand *wand,
3958 % PixelWand *background_color)
3960 % A description of each parameter follows:
3962 % o wand: the magick wand.
3964 % o background_color: Return the background color.
3967 WandExport MagickBooleanType MagickGetImageBackgroundColor(MagickWand *wand,
3968 PixelWand *background_color)
3970 assert(wand != (MagickWand *) NULL);
3971 assert(wand->signature == WandSignature);
3972 if (wand->debug != MagickFalse)
3973 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3974 if (wand->images == (Image *) NULL)
3975 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3976 PixelSetQuantumColor(background_color,&wand->images->background_color);
3981 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3985 % M a g i c k G e t I m a g e B l o b %
3989 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3991 % MagickGetImageBlob() implements direct to memory image formats. It
3992 % returns the image as a blob and its length. Use MagickSetFormat() to
3993 % set the format of the returned blob (GIF, JPEG, PNG, etc.).
3995 % Use MagickRelinquishMemory() to free the blob when you are done with it.
3997 % The format of the MagickGetImageBlob method is:
3999 % unsigned char *MagickGetImageBlob(MagickWand *wand,size_t *length)
4001 % A description of each parameter follows:
4003 % o wand: the magick wand.
4005 % o length: the length of the blob.
4008 WandExport unsigned char *MagickGetImageBlob(MagickWand *wand,size_t *length)
4010 assert(wand != (MagickWand *) NULL);
4011 assert(wand->signature == WandSignature);
4012 if (wand->debug != MagickFalse)
4013 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4014 if (wand->images == (Image *) NULL)
4016 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4017 "ContainsNoImages","`%s'",wand->name);
4018 return((unsigned char *) NULL);
4020 return(ImageToBlob(wand->image_info,wand->images,length,wand->exception));
4024 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4028 % M a g i c k G e t I m a g e s B l o b %
4032 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4034 % MagickGetImageBlob() implements direct to memory image formats. It
4035 % returns the image sequence as a blob and its length. The format of the image
4036 % determines the format of the returned blob (GIF, JPEG, PNG, etc.). To
4037 % return a different image format, use MagickSetImageFormat().
4039 % Note, some image formats do not permit multiple images to the same image
4040 % stream (e.g. JPEG). in this instance, just the first image of the
4041 % sequence is returned as a blob.
4043 % The format of the MagickGetImagesBlob method is:
4045 % unsigned char *MagickGetImagesBlob(MagickWand *wand,size_t *length)
4047 % A description of each parameter follows:
4049 % o wand: the magick wand.
4051 % o length: the length of the blob.
4054 WandExport unsigned char *MagickGetImagesBlob(MagickWand *wand,size_t *length)
4059 assert(wand != (MagickWand *) NULL);
4060 assert(wand->signature == WandSignature);
4061 if (wand->debug != MagickFalse)
4062 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4063 if (wand->images == (Image *) NULL)
4065 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4066 "ContainsNoImages","`%s'",wand->name);
4067 return((unsigned char *) NULL);
4069 blob=ImagesToBlob(wand->image_info,GetFirstImageInList(wand->images),length,
4075 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4079 % 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 %
4083 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4085 % MagickGetImageBluePrimary() returns the chromaticy blue primary point for the
4088 % The format of the MagickGetImageBluePrimary method is:
4090 % MagickBooleanType MagickGetImageBluePrimary(MagickWand *wand,double *x,
4093 % A description of each parameter follows:
4095 % o wand: the magick wand.
4097 % o x: the chromaticity blue primary x-point.
4099 % o y: the chromaticity blue primary y-point.
4102 WandExport MagickBooleanType MagickGetImageBluePrimary(MagickWand *wand,
4103 double *x,double *y)
4105 assert(wand != (MagickWand *) NULL);
4106 assert(wand->signature == WandSignature);
4107 if (wand->debug != MagickFalse)
4108 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4109 if (wand->images == (Image *) NULL)
4110 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4111 *x=wand->images->chromaticity.blue_primary.x;
4112 *y=wand->images->chromaticity.blue_primary.y;
4117 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4121 % 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 %
4125 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4127 % MagickGetImageBorderColor() returns the image border color.
4129 % The format of the MagickGetImageBorderColor method is:
4131 % MagickBooleanType MagickGetImageBorderColor(MagickWand *wand,
4132 % PixelWand *border_color)
4134 % A description of each parameter follows:
4136 % o wand: the magick wand.
4138 % o border_color: Return the border color.
4141 WandExport MagickBooleanType MagickGetImageBorderColor(MagickWand *wand,
4142 PixelWand *border_color)
4144 assert(wand != (MagickWand *) NULL);
4145 assert(wand->signature == WandSignature);
4146 if (wand->debug != MagickFalse)
4147 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4148 if (wand->images == (Image *) NULL)
4149 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4150 PixelSetQuantumColor(border_color,&wand->images->border_color);
4155 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4159 % M a g i c k G e t I m a g e C h a n n e l D e p t h %
4163 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4165 % MagickGetImageChannelDepth() gets the depth for one or more image channels.
4167 % The format of the MagickGetImageChannelDepth method is:
4169 % size_t MagickGetImageChannelDepth(MagickWand *wand,
4170 % const ChannelType channel)
4172 % A description of each parameter follows:
4174 % o wand: the magick wand.
4176 % o channel: the image channel(s).
4179 WandExport size_t MagickGetImageChannelDepth(MagickWand *wand,
4180 const ChannelType channel)
4182 assert(wand != (MagickWand *) NULL);
4183 assert(wand->signature == WandSignature);
4184 if (wand->debug != MagickFalse)
4185 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4186 if (wand->images == (Image *) NULL)
4187 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4188 return(GetImageChannelDepth(wand->images,channel,wand->exception));
4192 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4196 % M a g i c k G e t I m a g e C h a n n e l D i s t o r t i o n %
4200 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4202 % MagickGetImageChannelDistortion() compares one or more image channels of an
4203 % image to a reconstructed image and returns the specified distortion metric.
4205 % The format of the MagickGetImageChannelDistortion method is:
4207 % MagickBooleanType MagickGetImageChannelDistortion(MagickWand *wand,
4208 % const MagickWand *reference,const ChannelType channel,
4209 % const MetricType metric,double *distortion)
4211 % A description of each parameter follows:
4213 % o wand: the magick wand.
4215 % o reference: the reference wand.
4217 % o channel: the channel.
4219 % o metric: the metric.
4221 % o distortion: the computed distortion between the images.
4224 WandExport MagickBooleanType MagickGetImageChannelDistortion(MagickWand *wand,
4225 const MagickWand *reference,const ChannelType channel,const MetricType metric,
4231 assert(wand != (MagickWand *) NULL);
4232 assert(wand->signature == WandSignature);
4233 if (wand->debug != MagickFalse)
4234 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4235 assert(reference != (MagickWand *) NULL);
4236 assert(reference->signature == WandSignature);
4237 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
4238 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4239 status=GetImageChannelDistortion(wand->images,reference->images,channel,
4240 metric,distortion,&wand->images->exception);
4245 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4249 % M a g i c k G e t I m a g e C h a n n e l D i s t o r t i o n s %
4253 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4255 % MagickGetImageChannelDistortions() compares one or more image channels of an
4256 % image to a reconstructed image and returns the specified distortion metrics.
4258 % Use MagickRelinquishMemory() to free the metrics when you are done with them.
4260 % The format of the MagickGetImageChannelDistortion method is:
4262 % double *MagickGetImageChannelDistortion(MagickWand *wand,
4263 % const MagickWand *reference,const MetricType metric)
4265 % A description of each parameter follows:
4267 % o wand: the magick wand.
4269 % o reference: the reference wand.
4271 % o metric: the metric.
4274 WandExport double *MagickGetImageChannelDistortions(MagickWand *wand,
4275 const MagickWand *reference,const MetricType metric)
4278 *channel_distortion;
4280 assert(wand != (MagickWand *) NULL);
4281 assert(wand->signature == WandSignature);
4282 if (wand->debug != MagickFalse)
4283 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4284 assert(reference != (MagickWand *) NULL);
4285 assert(reference->signature == WandSignature);
4286 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
4288 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4289 "ContainsNoImages","`%s'",wand->name);
4290 return((double *) NULL);
4292 channel_distortion=GetImageChannelDistortions(wand->images,reference->images,
4293 metric,&wand->images->exception);
4294 return(channel_distortion);
4298 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4302 % M a g i c k G e t I m a g e C h a n n e l F e a t u r e s %
4306 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4308 % MagickGetImageChannelFeatures() returns features for each channel in the
4309 % image in each of four directions (horizontal, vertical, left and right
4310 % diagonals) for the specified distance. The features include the angular
4311 % second moment, contrast, correlation, sum of squares: variance, inverse
4312 % difference moment, sum average, sum varience, sum entropy, entropy,
4313 % difference variance, difference entropy, information measures of
4314 % correlation 1, information measures of correlation 2, and maximum
4315 % correlation coefficient. You can access the red channel contrast, for
4316 % example, like this:
4318 % channel_features=MagickGetImageChannelFeatures(wand,1);
4319 % contrast=channel_features[RedChannel].contrast[0];
4321 % Use MagickRelinquishMemory() to free the statistics buffer.
4323 % The format of the MagickGetImageChannelFeatures method is:
4325 % ChannelFeatures *MagickGetImageChannelFeatures(MagickWand *wand,
4326 % const size_t distance)
4328 % A description of each parameter follows:
4330 % o wand: the magick wand.
4332 % o distance: the distance.
4335 WandExport ChannelFeatures *MagickGetImageChannelFeatures(MagickWand *wand,
4336 const size_t distance)
4338 assert(wand != (MagickWand *) NULL);
4339 assert(wand->signature == WandSignature);
4340 if (wand->debug != MagickFalse)
4341 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4342 if (wand->images == (Image *) NULL)
4344 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4345 "ContainsNoImages","`%s'",wand->name);
4346 return((ChannelFeatures *) NULL);
4348 return(GetImageChannelFeatures(wand->images,distance,wand->exception));
4352 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4356 % M a g i c k G e t I m a g e C h a n n e l K u r t o s i s %
4360 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4362 % MagickGetImageChannelKurtosis() gets the kurtosis and skewness of one or
4363 % more image channels.
4365 % The format of the MagickGetImageChannelKurtosis method is:
4367 % MagickBooleanType MagickGetImageChannelKurtosis(MagickWand *wand,
4368 % const ChannelType channel,double *kurtosis,double *skewness)
4370 % A description of each parameter follows:
4372 % o wand: the magick wand.
4374 % o channel: the image channel(s).
4376 % o kurtosis: The kurtosis for the specified channel(s).
4378 % o skewness: The skewness for the specified channel(s).
4381 WandExport MagickBooleanType MagickGetImageChannelKurtosis(MagickWand *wand,
4382 const ChannelType channel,double *kurtosis,double *skewness)
4387 assert(wand != (MagickWand *) NULL);
4388 assert(wand->signature == WandSignature);
4389 if (wand->debug != MagickFalse)
4390 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4391 if (wand->images == (Image *) NULL)
4392 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4393 status=GetImageChannelKurtosis(wand->images,channel,kurtosis,skewness,
4399 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4403 % M a g i c k G e t I m a g e C h a n n e l M e a n %
4407 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4409 % MagickGetImageChannelMean() gets the mean and standard deviation of one or
4410 % more image channels.
4412 % The format of the MagickGetImageChannelMean method is:
4414 % MagickBooleanType MagickGetImageChannelMean(MagickWand *wand,
4415 % const ChannelType channel,double *mean,double *standard_deviation)
4417 % A description of each parameter follows:
4419 % o wand: the magick wand.
4421 % o channel: the image channel(s).
4423 % o mean: The mean pixel value for the specified channel(s).
4425 % o standard_deviation: The standard deviation for the specified channel(s).
4428 WandExport MagickBooleanType MagickGetImageChannelMean(MagickWand *wand,
4429 const ChannelType channel,double *mean,double *standard_deviation)
4434 assert(wand != (MagickWand *) NULL);
4435 assert(wand->signature == WandSignature);
4436 if (wand->debug != MagickFalse)
4437 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4438 if (wand->images == (Image *) NULL)
4439 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4440 status=GetImageChannelMean(wand->images,channel,mean,standard_deviation,
4446 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4450 % M a g i c k G e t I m a g e C h a n n e l R a n g e %
4454 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4456 % MagickGetImageChannelRange() gets the range for one or more image channels.
4458 % The format of the MagickGetImageChannelRange method is:
4460 % MagickBooleanType MagickGetImageChannelRange(MagickWand *wand,
4461 % const ChannelType channel,double *minima,double *maxima)
4463 % A description of each parameter follows:
4465 % o wand: the magick wand.
4467 % o channel: the image channel(s).
4469 % o minima: The minimum pixel value for the specified channel(s).
4471 % o maxima: The maximum pixel value for the specified channel(s).
4474 WandExport MagickBooleanType MagickGetImageChannelRange(MagickWand *wand,
4475 const ChannelType channel,double *minima,double *maxima)
4480 assert(wand != (MagickWand *) NULL);
4481 assert(wand->signature == WandSignature);
4482 if (wand->debug != MagickFalse)
4483 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4484 if (wand->images == (Image *) NULL)
4485 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4486 status=GetImageChannelRange(wand->images,channel,minima,maxima,
4492 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4496 % M a g i c k G e t I m a g e C h a n n e l S t a t i s t i c s %
4500 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4502 % MagickGetImageChannelStatistics() returns statistics for each channel in the
4503 % image. The statistics include the channel depth, its minima and
4504 % maxima, the mean, the standard deviation, the kurtosis and the skewness.
4505 % You can access the red channel mean, for example, like this:
4507 % channel_statistics=MagickGetImageChannelStatistics(wand);
4508 % red_mean=channel_statistics[RedChannel].mean;
4510 % Use MagickRelinquishMemory() to free the statistics buffer.
4512 % The format of the MagickGetImageChannelStatistics method is:
4514 % ChannelStatistics *MagickGetImageChannelStatistics(MagickWand *wand)
4516 % A description of each parameter follows:
4518 % o wand: the magick wand.
4521 WandExport ChannelStatistics *MagickGetImageChannelStatistics(MagickWand *wand)
4523 assert(wand != (MagickWand *) NULL);
4524 assert(wand->signature == WandSignature);
4525 if (wand->debug != MagickFalse)
4526 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4527 if (wand->images == (Image *) NULL)
4529 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4530 "ContainsNoImages","`%s'",wand->name);
4531 return((ChannelStatistics *) NULL);
4533 return(GetImageChannelStatistics(wand->images,wand->exception));
4537 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4541 % 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 %
4545 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4547 % MagickGetImageColormapColor() returns the color of the specified colormap
4550 % The format of the MagickGetImageColormapColor method is:
4552 % MagickBooleanType MagickGetImageColormapColor(MagickWand *wand,
4553 % const size_t index,PixelWand *color)
4555 % A description of each parameter follows:
4557 % o wand: the magick wand.
4559 % o index: the offset into the image colormap.
4561 % o color: Return the colormap color in this wand.
4564 WandExport MagickBooleanType MagickGetImageColormapColor(MagickWand *wand,
4565 const size_t index,PixelWand *color)
4567 assert(wand != (MagickWand *) NULL);
4568 assert(wand->signature == WandSignature);
4569 if (wand->debug != MagickFalse)
4570 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4571 if (wand->images == (Image *) NULL)
4572 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4573 if ((wand->images->colormap == (PixelPacket *) NULL) ||
4574 (index >= wand->images->colors))
4576 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4577 "InvalidColormapIndex","`%s'",wand->name);
4578 return(MagickFalse);
4580 PixelSetQuantumColor(color,wand->images->colormap+index);
4585 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4589 % M a g i c k G e t I m a g e C o l o r s %
4593 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4595 % MagickGetImageColors() gets the number of unique colors in the image.
4597 % The format of the MagickGetImageColors method is:
4599 % size_t MagickGetImageColors(MagickWand *wand)
4601 % A description of each parameter follows:
4603 % o wand: the magick wand.
4606 WandExport size_t MagickGetImageColors(MagickWand *wand)
4608 assert(wand != (MagickWand *) NULL);
4609 assert(wand->signature == WandSignature);
4610 if (wand->debug != MagickFalse)
4611 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4612 if (wand->images == (Image *) NULL)
4614 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4615 "ContainsNoImages","`%s'",wand->name);
4618 return(GetNumberColors(wand->images,(FILE *) NULL,wand->exception));
4622 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4626 % M a g i c k G e t I m a g e C o l o r s p a c e %
4630 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4632 % MagickGetImageColorspace() gets the image colorspace.
4634 % The format of the MagickGetImageColorspace method is:
4636 % ColorspaceType MagickGetImageColorspace(MagickWand *wand)
4638 % A description of each parameter follows:
4640 % o wand: the magick wand.
4643 WandExport ColorspaceType MagickGetImageColorspace(MagickWand *wand)
4645 assert(wand != (MagickWand *) NULL);
4646 assert(wand->signature == WandSignature);
4647 if (wand->debug != MagickFalse)
4648 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4649 if (wand->images == (Image *) NULL)
4651 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4652 "ContainsNoImages","`%s'",wand->name);
4653 return(UndefinedColorspace);
4655 return(wand->images->colorspace);
4659 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4663 % M a g i c k G e t I m a g e C o m p o s e %
4667 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4669 % MagickGetImageCompose() returns the composite operator associated with the
4672 % The format of the MagickGetImageCompose method is:
4674 % CompositeOperator MagickGetImageCompose(MagickWand *wand)
4676 % A description of each parameter follows:
4678 % o wand: the magick wand.
4681 WandExport CompositeOperator MagickGetImageCompose(MagickWand *wand)
4683 assert(wand != (MagickWand *) NULL);
4684 assert(wand->signature == WandSignature);
4685 if (wand->debug != MagickFalse)
4686 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4687 if (wand->images == (Image *) NULL)
4689 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4690 "ContainsNoImages","`%s'",wand->name);
4691 return(UndefinedCompositeOp);
4693 return(wand->images->compose);
4697 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4701 % 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 %
4705 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4707 % MagickGetImageCompression() gets the image compression.
4709 % The format of the MagickGetImageCompression method is:
4711 % CompressionType MagickGetImageCompression(MagickWand *wand)
4713 % A description of each parameter follows:
4715 % o wand: the magick wand.
4718 WandExport CompressionType MagickGetImageCompression(MagickWand *wand)
4720 assert(wand != (MagickWand *) NULL);
4721 assert(wand->signature == WandSignature);
4722 if (wand->debug != MagickFalse)
4723 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4724 if (wand->images == (Image *) NULL)
4726 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4727 "ContainsNoImages","`%s'",wand->name);
4728 return(UndefinedCompression);
4730 return(wand->images->compression);
4734 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4738 % 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 %
4742 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4744 % MagickGetImageCompression() gets the image compression quality.
4746 % The format of the MagickGetImageCompression method is:
4748 % size_t MagickGetImageCompression(MagickWand *wand)
4750 % A description of each parameter follows:
4752 % o wand: the magick wand.
4755 WandExport size_t MagickGetImageCompressionQuality(MagickWand *wand)
4757 assert(wand != (MagickWand *) NULL);
4758 assert(wand->signature == WandSignature);
4759 if (wand->debug != MagickFalse)
4760 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4761 if (wand->images == (Image *) NULL)
4763 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4764 "ContainsNoImages","`%s'",wand->name);
4767 return(wand->images->quality);
4771 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4775 % M a g i c k G e t I m a g e D e l a y %
4779 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4781 % MagickGetImageDelay() gets the image delay.
4783 % The format of the MagickGetImageDelay method is:
4785 % size_t MagickGetImageDelay(MagickWand *wand)
4787 % A description of each parameter follows:
4789 % o wand: the magick wand.
4792 WandExport size_t MagickGetImageDelay(MagickWand *wand)
4794 assert(wand != (MagickWand *) NULL);
4795 assert(wand->signature == WandSignature);
4796 if (wand->debug != MagickFalse)
4797 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4798 if (wand->images == (Image *) NULL)
4799 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4800 return(wand->images->delay);
4804 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4808 % M a g i c k G e t I m a g e D e p t h %
4812 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4814 % MagickGetImageDepth() gets the image depth.
4816 % The format of the MagickGetImageDepth method is:
4818 % size_t MagickGetImageDepth(MagickWand *wand)
4820 % A description of each parameter follows:
4822 % o wand: the magick wand.
4825 WandExport size_t MagickGetImageDepth(MagickWand *wand)
4827 assert(wand != (MagickWand *) NULL);
4828 assert(wand->signature == WandSignature);
4829 if (wand->debug != MagickFalse)
4830 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4831 if (wand->images == (Image *) NULL)
4832 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4833 return(wand->images->depth);
4837 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4841 % M a g i c k G e t I m a g e D i s t o r t i o n %
4845 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4847 % MagickGetImageDistortion() compares an image to a reconstructed image and
4848 % returns the specified distortion metric.
4850 % The format of the MagickGetImageDistortion method is:
4852 % MagickBooleanType MagickGetImageDistortion(MagickWand *wand,
4853 % const MagickWand *reference,const MetricType metric,
4854 % double *distortion)
4856 % A description of each parameter follows:
4858 % o wand: the magick wand.
4860 % o reference: the reference wand.
4862 % o metric: the metric.
4864 % o distortion: the computed distortion between the images.
4867 WandExport MagickBooleanType MagickGetImageDistortion(MagickWand *wand,
4868 const MagickWand *reference,const MetricType metric,double *distortion)
4874 assert(wand != (MagickWand *) NULL);
4875 assert(wand->signature == WandSignature);
4876 if (wand->debug != MagickFalse)
4877 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4878 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
4879 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4880 status=GetImageDistortion(wand->images,reference->images,metric,distortion,
4881 &wand->images->exception);
4886 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4890 % M a g i c k G e t I m a g e D i s p o s e %
4894 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4896 % MagickGetImageDispose() gets the image disposal method.
4898 % The format of the MagickGetImageDispose method is:
4900 % DisposeType MagickGetImageDispose(MagickWand *wand)
4902 % A description of each parameter follows:
4904 % o wand: the magick wand.
4907 WandExport DisposeType MagickGetImageDispose(MagickWand *wand)
4909 assert(wand != (MagickWand *) NULL);
4910 assert(wand->signature == WandSignature);
4911 if (wand->debug != MagickFalse)
4912 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4913 if (wand->images == (Image *) NULL)
4915 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4916 "ContainsNoImages","`%s'",wand->name);
4917 return(UndefinedDispose);
4919 return((DisposeType) wand->images->dispose);
4923 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4927 % M a g i c k G e t I m a g e F i l e n a m e %
4931 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4933 % MagickGetImageFilename() returns the filename of a particular image in a
4936 % The format of the MagickGetImageFilename method is:
4938 % char *MagickGetImageFilename(MagickWand *wand)
4940 % A description of each parameter follows:
4942 % o wand: the magick wand.
4945 WandExport char *MagickGetImageFilename(MagickWand *wand)
4947 assert(wand != (MagickWand *) NULL);
4948 assert(wand->signature == WandSignature);
4949 if (wand->debug != MagickFalse)
4950 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4951 if (wand->images == (Image *) NULL)
4953 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4954 "ContainsNoImages","`%s'",wand->name);
4955 return((char *) NULL);
4957 return(AcquireString(wand->images->filename));
4961 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4965 % M a g i c k G e t I m a g e F o r m a t %
4969 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4971 % MagickGetImageFormat() returns the format of a particular image in a
4974 % The format of the MagickGetImageFormat method is:
4976 % const char *MagickGetImageFormat(MagickWand *wand)
4978 % A description of each parameter follows:
4980 % o wand: the magick wand.
4983 WandExport char *MagickGetImageFormat(MagickWand *wand)
4985 assert(wand != (MagickWand *) NULL);
4986 assert(wand->signature == WandSignature);
4987 if (wand->debug != MagickFalse)
4988 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4989 if (wand->images == (Image *) NULL)
4991 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4992 "ContainsNoImages","`%s'",wand->name);
4993 return((char *) NULL);
4995 return(AcquireString(wand->images->magick));
4999 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5003 % M a g i c k G e t I m a g e F u z z %
5007 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5009 % MagickGetImageFuzz() gets the image fuzz.
5011 % The format of the MagickGetImageFuzz method is:
5013 % double MagickGetImageFuzz(MagickWand *wand)
5015 % A description of each parameter follows:
5017 % o wand: the magick wand.
5020 WandExport double MagickGetImageFuzz(MagickWand *wand)
5022 assert(wand != (MagickWand *) NULL);
5023 assert(wand->signature == WandSignature);
5024 if (wand->debug != MagickFalse)
5025 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5026 if (wand->images == (Image *) NULL)
5028 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5029 "ContainsNoImages","`%s'",wand->name);
5032 return(wand->images->fuzz);
5036 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5040 % M a g i c k G e t I m a g e G a m m a %
5044 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5046 % MagickGetImageGamma() gets the image gamma.
5048 % The format of the MagickGetImageGamma method is:
5050 % double MagickGetImageGamma(MagickWand *wand)
5052 % A description of each parameter follows:
5054 % o wand: the magick wand.
5057 WandExport double MagickGetImageGamma(MagickWand *wand)
5059 assert(wand != (MagickWand *) NULL);
5060 assert(wand->signature == WandSignature);
5061 if (wand->debug != MagickFalse)
5062 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5063 if (wand->images == (Image *) NULL)
5065 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5066 "ContainsNoImages","`%s'",wand->name);
5069 return(wand->images->gamma);
5073 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5077 % 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 %
5081 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5083 % MagickGetImageGravity() gets the image gravity.
5085 % The format of the MagickGetImageGravity method is:
5087 % GravityType MagickGetImageGravity(MagickWand *wand)
5089 % A description of each parameter follows:
5091 % o wand: the magick wand.
5094 WandExport GravityType MagickGetImageGravity(MagickWand *wand)
5096 assert(wand != (MagickWand *) NULL);
5097 assert(wand->signature == WandSignature);
5098 if (wand->debug != MagickFalse)
5099 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5100 if (wand->images == (Image *) NULL)
5102 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5103 "ContainsNoImages","`%s'",wand->name);
5104 return(UndefinedGravity);
5106 return(wand->images->gravity);
5110 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5114 % 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 %
5118 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5120 % MagickGetImageGreenPrimary() returns the chromaticy green primary point.
5122 % The format of the MagickGetImageGreenPrimary method is:
5124 % MagickBooleanType MagickGetImageGreenPrimary(MagickWand *wand,double *x,
5127 % A description of each parameter follows:
5129 % o wand: the magick wand.
5131 % o x: the chromaticity green primary x-point.
5133 % o y: the chromaticity green primary y-point.
5136 WandExport MagickBooleanType MagickGetImageGreenPrimary(MagickWand *wand,
5137 double *x,double *y)
5139 assert(wand != (MagickWand *) NULL);
5140 assert(wand->signature == WandSignature);
5141 if (wand->debug != MagickFalse)
5142 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5143 if (wand->images == (Image *) NULL)
5144 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5145 *x=wand->images->chromaticity.green_primary.x;
5146 *y=wand->images->chromaticity.green_primary.y;
5151 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5155 % M a g i c k G e t I m a g e H e i g h t %
5159 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5161 % MagickGetImageHeight() returns the image height.
5163 % The format of the MagickGetImageHeight method is:
5165 % size_t MagickGetImageHeight(MagickWand *wand)
5167 % A description of each parameter follows:
5169 % o wand: the magick wand.
5172 WandExport size_t MagickGetImageHeight(MagickWand *wand)
5174 assert(wand != (MagickWand *) NULL);
5175 assert(wand->signature == WandSignature);
5176 if (wand->debug != MagickFalse)
5177 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5178 if (wand->images == (Image *) NULL)
5179 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5180 return(wand->images->rows);
5184 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5188 % M a g i c k G e t I m a g e H i s t o g r a m %
5192 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5194 % MagickGetImageHistogram() returns the image histogram as an array of
5197 % The format of the MagickGetImageHistogram method is:
5199 % PixelWand **MagickGetImageHistogram(MagickWand *wand,
5200 % size_t *number_colors)
5202 % A description of each parameter follows:
5204 % o wand: the magick wand.
5206 % o number_colors: the number of unique colors in the image and the number
5207 % of pixel wands returned.
5210 WandExport PixelWand **MagickGetImageHistogram(MagickWand *wand,
5211 size_t *number_colors)
5222 assert(wand != (MagickWand *) NULL);
5223 assert(wand->signature == WandSignature);
5224 if (wand->debug != MagickFalse)
5225 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5226 if (wand->images == (Image *) NULL)
5228 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5229 "ContainsNoImages","`%s'",wand->name);
5230 return((PixelWand **) NULL);
5232 histogram=GetImageHistogram(wand->images,number_colors,wand->exception);
5233 if (histogram == (ColorPacket *) NULL)
5234 return((PixelWand **) NULL);
5235 pixel_wands=NewPixelWands(*number_colors);
5236 for (i=0; i < (ssize_t) *number_colors; i++)
5238 PixelSetQuantumColor(pixel_wands[i],&histogram[i].pixel);
5239 PixelSetIndex(pixel_wands[i],histogram[i].index);
5240 PixelSetColorCount(pixel_wands[i],(size_t) histogram[i].count);
5242 histogram=(ColorPacket *) RelinquishMagickMemory(histogram);
5243 return(pixel_wands);
5247 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5251 % 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 %
5255 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5257 % MagickGetImageInterlaceScheme() gets the image interlace scheme.
5259 % The format of the MagickGetImageInterlaceScheme method is:
5261 % InterlaceType MagickGetImageInterlaceScheme(MagickWand *wand)
5263 % A description of each parameter follows:
5265 % o wand: the magick wand.
5268 WandExport InterlaceType MagickGetImageInterlaceScheme(MagickWand *wand)
5270 assert(wand != (MagickWand *) NULL);
5271 assert(wand->signature == WandSignature);
5272 if (wand->debug != MagickFalse)
5273 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5274 if (wand->images == (Image *) NULL)
5276 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5277 "ContainsNoImages","`%s'",wand->name);
5278 return(UndefinedInterlace);
5280 return(wand->images->interlace);
5284 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5288 % 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 %
5292 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5294 % MagickGetImageInterpolateMethod() returns the interpolation method for the
5297 % The format of the MagickGetImageInterpolateMethod method is:
5299 % InterpolatePixelMethod MagickGetImageInterpolateMethod(MagickWand *wand)
5301 % A description of each parameter follows:
5303 % o wand: the magick wand.
5306 WandExport InterpolatePixelMethod MagickGetImageInterpolateMethod(
5309 assert(wand != (MagickWand *) NULL);
5310 assert(wand->signature == WandSignature);
5311 if (wand->debug != MagickFalse)
5312 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5313 if (wand->images == (Image *) NULL)
5315 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5316 "ContainsNoImages","`%s'",wand->name);
5317 return(UndefinedInterpolatePixel);
5319 return(wand->images->interpolate);
5323 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5327 % M a g i c k G e t I m a g e I t e r a t i o n s %
5331 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5333 % MagickGetImageIterations() gets the image iterations.
5335 % The format of the MagickGetImageIterations method is:
5337 % size_t MagickGetImageIterations(MagickWand *wand)
5339 % A description of each parameter follows:
5341 % o wand: the magick wand.
5344 WandExport size_t MagickGetImageIterations(MagickWand *wand)
5346 assert(wand != (MagickWand *) NULL);
5347 assert(wand->signature == WandSignature);
5348 if (wand->debug != MagickFalse)
5349 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5350 if (wand->images == (Image *) NULL)
5351 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5352 return(wand->images->iterations);
5356 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5360 % M a g i c k G e t I m a g e L e n g t h %
5364 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5366 % MagickGetImageLength() returns the image length in bytes.
5368 % The format of the MagickGetImageLength method is:
5370 % MagickBooleanType MagickGetImageLength(MagickWand *wand,
5371 % MagickSizeType *length)
5373 % A description of each parameter follows:
5375 % o wand: the magick wand.
5377 % o length: the image length in bytes.
5380 WandExport MagickBooleanType MagickGetImageLength(MagickWand *wand,
5381 MagickSizeType *length)
5383 assert(wand != (MagickWand *) NULL);
5384 assert(wand->signature == WandSignature);
5385 if (wand->debug != MagickFalse)
5386 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5387 if (wand->images == (Image *) NULL)
5388 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5389 *length=GetBlobSize(wand->images);
5394 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5398 % M a g i c k G e t I m a g e M a t t e C o l o r %
5402 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5404 % MagickGetImageMatteColor() returns the image matte color.
5406 % The format of the MagickGetImageMatteColor method is:
5408 % MagickBooleanType MagickGetImagematteColor(MagickWand *wand,
5409 % PixelWand *matte_color)
5411 % A description of each parameter follows:
5413 % o wand: the magick wand.
5415 % o matte_color: Return the matte color.
5418 WandExport MagickBooleanType MagickGetImageMatteColor(MagickWand *wand,
5419 PixelWand *matte_color)
5421 assert(wand != (MagickWand *) NULL);
5422 assert(wand->signature == WandSignature);
5423 if (wand->debug != MagickFalse)
5424 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5425 if (wand->images == (Image *) NULL)
5426 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5427 PixelSetQuantumColor(matte_color,&wand->images->matte_color);
5432 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5436 % 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 %
5440 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5442 % MagickGetImageOrientation() returns the image orientation.
5444 % The format of the MagickGetImageOrientation method is:
5446 % OrientationType MagickGetImageOrientation(MagickWand *wand)
5448 % A description of each parameter follows:
5450 % o wand: the magick wand.
5453 WandExport OrientationType MagickGetImageOrientation(MagickWand *wand)
5455 assert(wand != (MagickWand *) NULL);
5456 assert(wand->signature == WandSignature);
5457 if (wand->debug != MagickFalse)
5458 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5459 if (wand->images == (Image *) NULL)
5461 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5462 "ContainsNoImages","`%s'",wand->name);
5463 return(UndefinedOrientation);
5465 return(wand->images->orientation);
5469 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5473 % M a g i c k G e t I m a g e P a g e %
5477 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5479 % MagickGetImagePage() returns the page geometry associated with the image.
5481 % The format of the MagickGetImagePage method is:
5483 % MagickBooleanType MagickGetImagePage(MagickWand *wand,
5484 % size_t *width,size_t *height,ssize_t *x,ssize_t *y)
5486 % A description of each parameter follows:
5488 % o wand: the magick wand.
5490 % o width: the page width.
5492 % o height: the page height.
5494 % o x: the page x-offset.
5496 % o y: the page y-offset.
5499 WandExport MagickBooleanType MagickGetImagePage(MagickWand *wand,
5500 size_t *width,size_t *height,ssize_t *x,ssize_t *y)
5502 assert(wand != (const MagickWand *) NULL);
5503 assert(wand->signature == WandSignature);
5504 if (wand->debug != MagickFalse)
5505 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5506 if (wand->images == (Image *) NULL)
5507 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5508 *width=wand->images->page.width;
5509 *height=wand->images->page.height;
5510 *x=wand->images->page.x;
5511 *y=wand->images->page.y;
5516 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5520 % M a g i c k G e t I m a g e P i x e l C o l o r %
5524 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5526 % MagickGetImagePixelColor() returns the color of the specified pixel.
5528 % The format of the MagickGetImagePixelColor method is:
5530 % MagickBooleanType MagickGetImagePixelColor(MagickWand *wand,
5531 % const ssize_t x,const ssize_t y,PixelWand *color)
5533 % A description of each parameter follows:
5535 % o wand: the magick wand.
5537 % o x,y: the pixel offset into the image.
5539 % o color: Return the colormap color in this wand.
5542 WandExport MagickBooleanType MagickGetImagePixelColor(MagickWand *wand,
5543 const ssize_t x,const ssize_t y,PixelWand *color)
5548 register const PixelPacket
5554 assert(wand != (MagickWand *) NULL);
5555 assert(wand->signature == WandSignature);
5556 if (wand->debug != MagickFalse)
5557 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5558 if (wand->images == (Image *) NULL)
5559 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5560 image_view=AcquireCacheView(wand->images);
5561 p=GetCacheViewVirtualPixels(image_view,x,y,1,1,wand->exception);
5562 if (p == (const PixelPacket *) NULL)
5564 image_view=DestroyCacheView(image_view);
5565 return(MagickFalse);
5567 indexes=GetCacheViewAuthenticIndexQueue(image_view);
5568 PixelSetQuantumColor(color,p);
5569 if (GetCacheViewColorspace(image_view) == CMYKColorspace)
5570 PixelSetBlackQuantum(color,*indexes);
5572 if (GetCacheViewStorageClass(image_view) == PseudoClass)
5573 PixelSetIndex(color,*indexes);
5574 image_view=DestroyCacheView(image_view);
5579 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5583 + M a g i c k G e t I m a g e R a n g e %
5587 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5589 % MagickGetImageRange() gets the pixel range for the image.
5591 % The format of the MagickGetImageRange method is:
5593 % MagickBooleanType MagickGetImageRange(MagickWand *wand,double *minima,
5596 % A description of each parameter follows:
5598 % o wand: the magick wand.
5600 % o minima: The minimum pixel value for the specified channel(s).
5602 % o maxima: The maximum pixel value for the specified channel(s).
5605 WandExport MagickBooleanType MagickGetImageRange(MagickWand *wand,
5606 double *minima,double *maxima)
5611 assert(wand != (MagickWand *) NULL);
5612 assert(wand->signature == WandSignature);
5613 if (wand->debug != MagickFalse)
5614 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5615 if (wand->images == (Image *) NULL)
5616 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5617 status=GetImageRange(wand->images,minima,maxima,wand->exception);
5622 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5626 % M a g i c k G e t I m a g e R e d P r i m a r y %
5630 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5632 % MagickGetImageRedPrimary() returns the chromaticy red primary point.
5634 % The format of the MagickGetImageRedPrimary method is:
5636 % MagickBooleanType MagickGetImageRedPrimary(MagickWand *wand,double *x,
5639 % A description of each parameter follows:
5641 % o wand: the magick wand.
5643 % o x: the chromaticity red primary x-point.
5645 % o y: the chromaticity red primary y-point.
5648 WandExport MagickBooleanType MagickGetImageRedPrimary(MagickWand *wand,
5649 double *x,double *y)
5651 assert(wand != (MagickWand *) NULL);
5652 assert(wand->signature == WandSignature);
5653 if (wand->debug != MagickFalse)
5654 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5655 if (wand->images == (Image *) NULL)
5656 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5657 *x=wand->images->chromaticity.red_primary.x;
5658 *y=wand->images->chromaticity.red_primary.y;
5663 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5667 % M a g i c k G e t I m a g e R e g i o n %
5671 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5673 % MagickGetImageRegion() extracts a region of the image and returns it as a
5676 % The format of the MagickGetImageRegion method is:
5678 % MagickWand *MagickGetImageRegion(MagickWand *wand,
5679 % const size_t width,const size_t height,const ssize_t x,
5682 % A description of each parameter follows:
5684 % o wand: the magick wand.
5686 % o width: the region width.
5688 % o height: the region height.
5690 % o x: the region x offset.
5692 % o y: the region y offset.
5695 WandExport MagickWand *MagickGetImageRegion(MagickWand *wand,
5696 const size_t width,const size_t height,const ssize_t x,
5705 assert(wand != (MagickWand *) NULL);
5706 assert(wand->signature == WandSignature);
5707 if (wand->debug != MagickFalse)
5708 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5709 if (wand->images == (Image *) NULL)
5710 return((MagickWand *) NULL);
5712 region.height=height;
5715 region_image=CropImage(wand->images,®ion,wand->exception);
5716 if (region_image == (Image *) NULL)
5717 return((MagickWand *) NULL);
5718 return(CloneMagickWandFromImages(wand,region_image));
5722 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5726 % 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 %
5730 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5732 % MagickGetImageRenderingIntent() gets the image rendering intent.
5734 % The format of the MagickGetImageRenderingIntent method is:
5736 % RenderingIntent MagickGetImageRenderingIntent(MagickWand *wand)
5738 % A description of each parameter follows:
5740 % o wand: the magick wand.
5743 WandExport RenderingIntent MagickGetImageRenderingIntent(MagickWand *wand)
5745 assert(wand != (MagickWand *) NULL);
5746 assert(wand->signature == WandSignature);
5747 if (wand->debug != MagickFalse)
5748 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5749 if (wand->images == (Image *) NULL)
5751 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5752 "ContainsNoImages","`%s'",wand->name);
5753 return(UndefinedIntent);
5755 return((RenderingIntent) wand->images->rendering_intent);
5759 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5763 % M a g i c k G e t I m a g e R e s o l u t i o n %
5767 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5769 % MagickGetImageResolution() gets the image X and Y resolution.
5771 % The format of the MagickGetImageResolution method is:
5773 % MagickBooleanType MagickGetImageResolution(MagickWand *wand,double *x,
5776 % A description of each parameter follows:
5778 % o wand: the magick wand.
5780 % o x: the image x-resolution.
5782 % o y: the image y-resolution.
5785 WandExport MagickBooleanType MagickGetImageResolution(MagickWand *wand,
5786 double *x,double *y)
5788 assert(wand != (MagickWand *) NULL);
5789 assert(wand->signature == WandSignature);
5790 if (wand->debug != MagickFalse)
5791 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5792 if (wand->images == (Image *) NULL)
5793 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5794 *x=wand->images->x_resolution;
5795 *y=wand->images->y_resolution;
5800 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5804 % M a g i c k G e t I m a g e S c e n e %
5808 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5810 % MagickGetImageScene() gets the image scene.
5812 % The format of the MagickGetImageScene method is:
5814 % size_t MagickGetImageScene(MagickWand *wand)
5816 % A description of each parameter follows:
5818 % o wand: the magick wand.
5821 WandExport size_t MagickGetImageScene(MagickWand *wand)
5823 assert(wand != (MagickWand *) NULL);
5824 assert(wand->signature == WandSignature);
5825 if (wand->debug != MagickFalse)
5826 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5827 if (wand->images == (Image *) NULL)
5828 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5829 return(wand->images->scene);
5833 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5837 % M a g i c k G e t I m a g e S i g n a t u r e %
5841 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5843 % MagickGetImageSignature() generates an SHA-256 message digest for the image
5846 % The format of the MagickGetImageSignature method is:
5848 % const char MagickGetImageSignature(MagickWand *wand)
5850 % A description of each parameter follows:
5852 % o wand: the magick wand.
5855 WandExport char *MagickGetImageSignature(MagickWand *wand)
5863 assert(wand != (MagickWand *) NULL);
5864 assert(wand->signature == WandSignature);
5865 if (wand->debug != MagickFalse)
5866 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5867 if (wand->images == (Image *) NULL)
5869 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5870 "ContainsNoImages","`%s'",wand->name);
5871 return((char *) NULL);
5873 status=SignatureImage(wand->images);
5874 if (status == MagickFalse)
5875 InheritException(wand->exception,&wand->images->exception);
5876 value=GetImageProperty(wand->images,"signature");
5877 if (value != (const char *) NULL)
5878 return(AcquireString(value));
5879 InheritException(wand->exception,&wand->images->exception);
5880 return((char *) NULL);
5884 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5888 % 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 %
5892 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5894 % MagickGetImageTicksPerSecond() gets the image ticks-per-second.
5896 % The format of the MagickGetImageTicksPerSecond method is:
5898 % size_t MagickGetImageTicksPerSecond(MagickWand *wand)
5900 % A description of each parameter follows:
5902 % o wand: the magick wand.
5905 WandExport size_t MagickGetImageTicksPerSecond(MagickWand *wand)
5907 assert(wand != (MagickWand *) NULL);
5908 assert(wand->signature == WandSignature);
5909 if (wand->debug != MagickFalse)
5910 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5911 if (wand->images == (Image *) NULL)
5912 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5913 return((size_t) wand->images->ticks_per_second);
5917 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5921 % M a g i c k G e t I m a g e T y p e %
5925 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5927 % MagickGetImageType() gets the potential image type:
5929 % Bilevel Grayscale GrayscaleMatte
5930 % Palette PaletteMatte TrueColor
5931 % TrueColorMatte ColorSeparation ColorSeparationMatte
5933 % To ensure the image type matches its potential, use MagickSetImageType():
5935 % (void) MagickSetImageType(wand,MagickGetImageType(wand));
5937 % The format of the MagickGetImageType method is:
5939 % ImageType MagickGetImageType(MagickWand *wand)
5941 % A description of each parameter follows:
5943 % o wand: the magick wand.
5946 WandExport ImageType MagickGetImageType(MagickWand *wand)
5948 assert(wand != (MagickWand *) NULL);
5949 assert(wand->signature == WandSignature);
5950 if (wand->debug != MagickFalse)
5951 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5952 if (wand->images == (Image *) NULL)
5954 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5955 "ContainsNoImages","`%s'",wand->name);
5956 return(UndefinedType);
5958 return(GetImageType(wand->images,wand->exception));
5962 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5966 % M a g i c k G e t I m a g e U n i t s %
5970 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5972 % MagickGetImageUnits() gets the image units of resolution.
5974 % The format of the MagickGetImageUnits method is:
5976 % ResolutionType MagickGetImageUnits(MagickWand *wand)
5978 % A description of each parameter follows:
5980 % o wand: the magick wand.
5983 WandExport ResolutionType MagickGetImageUnits(MagickWand *wand)
5985 assert(wand != (MagickWand *) NULL);
5986 assert(wand->signature == WandSignature);
5987 if (wand->debug != MagickFalse)
5988 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5989 if (wand->images == (Image *) NULL)
5991 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5992 "ContainsNoImages","`%s'",wand->name);
5993 return(UndefinedResolution);
5995 return(wand->images->units);
5999 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6003 % 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 %
6007 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6009 % MagickGetImageVirtualPixelMethod() returns the virtual pixel method for the
6012 % The format of the MagickGetImageVirtualPixelMethod method is:
6014 % VirtualPixelMethod MagickGetImageVirtualPixelMethod(MagickWand *wand)
6016 % A description of each parameter follows:
6018 % o wand: the magick wand.
6021 WandExport VirtualPixelMethod MagickGetImageVirtualPixelMethod(MagickWand *wand)
6023 assert(wand != (MagickWand *) NULL);
6024 assert(wand->signature == WandSignature);
6025 if (wand->debug != MagickFalse)
6026 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6027 if (wand->images == (Image *) NULL)
6029 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
6030 "ContainsNoImages","`%s'",wand->name);
6031 return(UndefinedVirtualPixelMethod);
6033 return(GetImageVirtualPixelMethod(wand->images));
6037 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6041 % M a g i c k G e t I m a g e W h i t e P o i n t %
6045 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6047 % MagickGetImageWhitePoint() returns the chromaticy white point.
6049 % The format of the MagickGetImageWhitePoint method is:
6051 % MagickBooleanType MagickGetImageWhitePoint(MagickWand *wand,double *x,
6054 % A description of each parameter follows:
6056 % o wand: the magick wand.
6058 % o x: the chromaticity white x-point.
6060 % o y: the chromaticity white y-point.
6063 WandExport MagickBooleanType MagickGetImageWhitePoint(MagickWand *wand,
6064 double *x,double *y)
6066 assert(wand != (MagickWand *) NULL);
6067 assert(wand->signature == WandSignature);
6068 if (wand->debug != MagickFalse)
6069 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6070 if (wand->images == (Image *) NULL)
6071 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6072 *x=wand->images->chromaticity.white_point.x;
6073 *y=wand->images->chromaticity.white_point.y;
6078 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6082 % M a g i c k G e t I m a g e W i d t h %
6086 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6088 % MagickGetImageWidth() returns the image width.
6090 % The format of the MagickGetImageWidth method is:
6092 % size_t MagickGetImageWidth(MagickWand *wand)
6094 % A description of each parameter follows:
6096 % o wand: the magick wand.
6099 WandExport size_t MagickGetImageWidth(MagickWand *wand)
6101 assert(wand != (MagickWand *) NULL);
6102 assert(wand->signature == WandSignature);
6103 if (wand->debug != MagickFalse)
6104 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6105 if (wand->images == (Image *) NULL)
6106 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6107 return(wand->images->columns);
6111 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6115 % M a g i c k G e t N u m b e r I m a g e s %
6119 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6121 % MagickGetNumberImages() returns the number of images associated with a
6124 % The format of the MagickGetNumberImages method is:
6126 % size_t MagickGetNumberImages(MagickWand *wand)
6128 % A description of each parameter follows:
6130 % o wand: the magick wand.
6133 WandExport size_t MagickGetNumberImages(MagickWand *wand)
6135 assert(wand != (MagickWand *) NULL);
6136 assert(wand->signature == WandSignature);
6137 if (wand->debug != MagickFalse)
6138 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6139 return(GetImageListLength(wand->images));
6143 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6147 % 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 %
6151 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6153 % MagickGetImageTotalInkDensity() gets the image total ink density.
6155 % The format of the MagickGetImageTotalInkDensity method is:
6157 % double MagickGetImageTotalInkDensity(MagickWand *wand)
6159 % A description of each parameter follows:
6161 % o wand: the magick wand.
6164 WandExport double MagickGetImageTotalInkDensity(MagickWand *wand)
6166 assert(wand != (MagickWand *) NULL);
6167 assert(wand->signature == WandSignature);
6168 if (wand->debug != MagickFalse)
6169 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6170 if (wand->images == (Image *) NULL)
6172 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
6173 "ContainsNoImages","`%s'",wand->name);
6176 return(GetImageTotalInkDensity(wand->images));
6180 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6184 % M a g i c k H a l d C l u t I m a g e %
6188 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6190 % MagickHaldClutImage() replaces colors in the image from a Hald color lookup
6191 % table. A Hald color lookup table is a 3-dimensional color cube mapped to 2
6192 % dimensions. Create it with the HALD coder. You can apply any color
6193 % transformation to the Hald image and then use this method to apply the
6194 % transform to the image.
6196 % The format of the MagickHaldClutImage method is:
6198 % MagickBooleanType MagickHaldClutImage(MagickWand *wand,
6199 % const MagickWand *hald_wand)
6200 % MagickBooleanType MagickHaldClutImageChannel(MagickWand *wand,
6201 % const ChannelType channel,const MagickWand *hald_wand)
6203 % A description of each parameter follows:
6205 % o wand: the magick wand.
6207 % o hald_image: the hald CLUT image.
6211 WandExport MagickBooleanType MagickHaldClutImage(MagickWand *wand,
6212 const MagickWand *hald_wand)
6217 status=MagickHaldClutImageChannel(wand,DefaultChannels,hald_wand);
6221 WandExport MagickBooleanType MagickHaldClutImageChannel(MagickWand *wand,
6222 const ChannelType channel,const MagickWand *hald_wand)
6227 assert(wand != (MagickWand *) NULL);
6228 assert(wand->signature == WandSignature);
6229 if (wand->debug != MagickFalse)
6230 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6231 if ((wand->images == (Image *) NULL) || (hald_wand->images == (Image *) NULL))
6232 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6233 status=HaldClutImageChannel(wand->images,channel,hald_wand->images);
6234 if (status == MagickFalse)
6235 InheritException(wand->exception,&wand->images->exception);
6240 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6244 % M a g i c k H a s N e x t I m a g e %
6248 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6250 % MagickHasNextImage() returns MagickTrue if the wand has more images when
6251 % traversing the list in the forward direction
6253 % The format of the MagickHasNextImage method is:
6255 % MagickBooleanType MagickHasNextImage(MagickWand *wand)
6257 % A description of each parameter follows:
6259 % o wand: the magick wand.
6262 WandExport MagickBooleanType MagickHasNextImage(MagickWand *wand)
6264 assert(wand != (MagickWand *) NULL);
6265 assert(wand->signature == WandSignature);
6266 if (wand->debug != MagickFalse)
6267 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6268 if (wand->images == (Image *) NULL)
6269 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6270 if (GetNextImageInList(wand->images) == (Image *) NULL)
6271 return(MagickFalse);
6276 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6280 % M a g i c k H a s P r e v i o u s I m a g e %
6284 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6286 % MagickHasPreviousImage() returns MagickTrue if the wand has more images when
6287 % traversing the list in the reverse direction
6289 % The format of the MagickHasPreviousImage method is:
6291 % MagickBooleanType MagickHasPreviousImage(MagickWand *wand)
6293 % A description of each parameter follows:
6295 % o wand: the magick wand.
6298 WandExport MagickBooleanType MagickHasPreviousImage(MagickWand *wand)
6300 assert(wand != (MagickWand *) NULL);
6301 assert(wand->signature == WandSignature);
6302 if (wand->debug != MagickFalse)
6303 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6304 if (wand->images == (Image *) NULL)
6305 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6306 if (GetPreviousImageInList(wand->images) == (Image *) NULL)
6307 return(MagickFalse);
6312 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6316 % M a g i c k I d e n t i f y I m a g e %
6320 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6322 % MagickIdentifyImage() identifies an image by printing its attributes to the
6323 % file. Attributes include the image width, height, size, and others.
6325 % The format of the MagickIdentifyImage method is:
6327 % const char *MagickIdentifyImage(MagickWand *wand)
6329 % A description of each parameter follows:
6331 % o wand: the magick wand.
6334 WandExport char *MagickIdentifyImage(MagickWand *wand)
6338 filename[MaxTextExtent];
6346 assert(wand != (MagickWand *) NULL);
6347 assert(wand->signature == WandSignature);
6348 if (wand->debug != MagickFalse)
6349 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6350 if (wand->images == (Image *) NULL)
6352 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
6353 "ContainsNoImages","`%s'",wand->name);
6354 return((char *) NULL);
6356 description=(char *) NULL;
6357 unique_file=AcquireUniqueFileResource(filename);
6359 if (unique_file != -1)
6360 file=fdopen(unique_file,"wb");
6361 if ((unique_file == -1) || (file == (FILE *) NULL))
6363 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
6364 "UnableToCreateTemporaryFile","`%s'",wand->name);
6365 return((char *) NULL);
6367 (void) IdentifyImage(wand->images,file,MagickTrue);
6368 (void) fclose(file);
6369 description=FileToString(filename,~0,wand->exception);
6370 (void) RelinquishUniqueFileResource(filename);
6371 return(description);
6375 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6379 % M a g i c k I m p l o d e I m a g e %
6383 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6385 % MagickImplodeImage() creates a new image that is a copy of an existing
6386 % one with the image pixels "implode" by the specified percentage. It
6387 % allocates the memory necessary for the new Image structure and returns a
6388 % pointer to the new image.
6390 % The format of the MagickImplodeImage method is:
6392 % MagickBooleanType MagickImplodeImage(MagickWand *wand,
6393 % const double radius)
6395 % A description of each parameter follows:
6397 % o wand: the magick wand.
6399 % o amount: Define the extent of the implosion.
6402 WandExport MagickBooleanType MagickImplodeImage(MagickWand *wand,
6403 const double amount)
6408 assert(wand != (MagickWand *) NULL);
6409 assert(wand->signature == WandSignature);
6410 if (wand->debug != MagickFalse)
6411 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6412 if (wand->images == (Image *) NULL)
6413 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6414 implode_image=ImplodeImage(wand->images,amount,wand->exception);
6415 if (implode_image == (Image *) NULL)
6416 return(MagickFalse);
6417 ReplaceImageInList(&wand->images,implode_image);
6422 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6426 % M a g i c k I m p o r t I m a g e P i x e l s %
6430 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6432 % MagickImportImagePixels() accepts pixel datand stores it in the image at the
6433 % location you specify. The method returns MagickFalse on success otherwise
6434 % MagickTrue if an error is encountered. The pixel data can be either char,
6435 % short int, int, ssize_t, float, or double in the order specified by map.
6437 % Suppose your want to upload the first scanline of a 640x480 image from
6438 % character data in red-green-blue order:
6440 % MagickImportImagePixels(wand,0,0,640,1,"RGB",CharPixel,pixels);
6442 % The format of the MagickImportImagePixels method is:
6444 % MagickBooleanType MagickImportImagePixels(MagickWand *wand,
6445 % const ssize_t x,const ssize_t y,const size_t columns,
6446 % const size_t rows,const char *map,const StorageType storage,
6447 % const void *pixels)
6449 % A description of each parameter follows:
6451 % o wand: the magick wand.
6453 % o x, y, columns, rows: These values define the perimeter of a region
6454 % of pixels you want to define.
6456 % o map: This string reflects the expected ordering of the pixel array.
6457 % It can be any combination or order of R = red, G = green, B = blue,
6458 % A = alpha (0 is transparent), O = opacity (0 is opaque), C = cyan,
6459 % Y = yellow, M = magenta, K = black, I = intensity (for grayscale),
6462 % o storage: Define the data type of the pixels. Float and double types are
6463 % expected to be normalized [0..1] otherwise [0..QuantumRange]. Choose from
6464 % these types: CharPixel, ShortPixel, IntegerPixel, LongPixel, FloatPixel,
6467 % o pixels: This array of values contain the pixel components as defined by
6468 % map and type. You must preallocate this array where the expected
6469 % length varies depending on the values of width, height, map, and type.
6472 WandExport MagickBooleanType MagickImportImagePixels(MagickWand *wand,
6473 const ssize_t x,const ssize_t y,const size_t columns,
6474 const size_t rows,const char *map,const StorageType storage,
6480 assert(wand != (MagickWand *) NULL);
6481 assert(wand->signature == WandSignature);
6482 if (wand->debug != MagickFalse)
6483 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6484 if (wand->images == (Image *) NULL)
6485 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6486 status=ImportImagePixels(wand->images,x,y,columns,rows,map,storage,pixels);
6487 if (status == MagickFalse)
6488 InheritException(wand->exception,&wand->images->exception);
6493 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6497 % 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 %
6501 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6503 % MagickInverseFourierTransformImage() implements the inverse discrete
6504 % Fourier transform (DFT) of the image either as a magnitude / phase or real /
6505 % imaginary image pair.
6507 % The format of the MagickInverseFourierTransformImage method is:
6509 % MagickBooleanType MagickInverseFourierTransformImage(
6510 % MagickWand *magnitude_wand,MagickWand *phase_wand,
6511 % const MagickBooleanType magnitude)
6513 % A description of each parameter follows:
6515 % o magnitude_wand: the magnitude or real wand.
6517 % o phase_wand: the phase or imaginary wand.
6519 % o magnitude: if true, return as magnitude / phase pair otherwise a real /
6520 % imaginary image pair.
6523 WandExport MagickBooleanType MagickInverseFourierTransformImage(
6524 MagickWand *magnitude_wand,MagickWand *phase_wand,
6525 const MagickBooleanType magnitude)
6533 assert(magnitude_wand != (MagickWand *) NULL);
6534 assert(magnitude_wand->signature == WandSignature);
6535 if (magnitude_wand->debug != MagickFalse)
6536 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",
6537 magnitude_wand->name);
6538 wand=magnitude_wand;
6539 if (magnitude_wand->images == (Image *) NULL)
6540 ThrowWandException(WandError,"ContainsNoImages",
6541 magnitude_wand->name);
6542 assert(phase_wand != (MagickWand *) NULL);
6543 assert(phase_wand->signature == WandSignature);
6544 inverse_image=InverseFourierTransformImage(magnitude_wand->images,
6545 phase_wand->images,magnitude,wand->exception);
6546 if (inverse_image == (Image *) NULL)
6547 return(MagickFalse);
6548 ReplaceImageInList(&wand->images,inverse_image);
6553 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6557 % M a g i c k L a b e l I m a g e %
6561 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6563 % MagickLabelImage() adds a label to your image.
6565 % The format of the MagickLabelImage method is:
6567 % MagickBooleanType MagickLabelImage(MagickWand *wand,const char *label)
6569 % A description of each parameter follows:
6571 % o wand: the magick wand.
6573 % o label: the image label.
6576 WandExport MagickBooleanType MagickLabelImage(MagickWand *wand,
6582 assert(wand != (MagickWand *) NULL);
6583 assert(wand->signature == WandSignature);
6584 if (wand->debug != MagickFalse)
6585 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6586 if (wand->images == (Image *) NULL)
6587 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6588 status=SetImageProperty(wand->images,"label",label);
6589 if (status == MagickFalse)
6590 InheritException(wand->exception,&wand->images->exception);
6595 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6599 % M a g i c k L e v e l I m a g e %
6603 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6605 % MagickLevelImage() adjusts the levels of an image by scaling the colors
6606 % falling between specified white and black points to the full available
6607 % quantum range. The parameters provided represent the black, mid, and white
6608 % points. The black point specifies the darkest color in the image. Colors
6609 % darker than the black point are set to zero. Mid point specifies a gamma
6610 % correction to apply to the image. White point specifies the lightest color
6611 % in the image. Colors brighter than the white point are set to the maximum
6614 % The format of the MagickLevelImage method is:
6616 % MagickBooleanType MagickLevelImage(MagickWand *wand,
6617 % const double black_point,const double gamma,const double white_point)
6618 % MagickBooleanType MagickLevelImageChannel(MagickWand *wand,
6619 % const ChannelType channel,const double black_point,const double gamma,
6620 % const double white_point)
6622 % A description of each parameter follows:
6624 % o wand: the magick wand.
6626 % o channel: Identify which channel to level: RedChannel, GreenChannel,
6628 % o black_point: the black point.
6630 % o gamma: the gamma.
6632 % o white_point: the white point.
6636 WandExport MagickBooleanType MagickLevelImage(MagickWand *wand,
6637 const double black_point,const double gamma,const double white_point)
6642 status=MagickLevelImageChannel(wand,DefaultChannels,black_point,gamma,
6647 WandExport MagickBooleanType MagickLevelImageChannel(MagickWand *wand,
6648 const ChannelType channel,const double black_point,const double gamma,
6649 const double white_point)
6654 assert(wand != (MagickWand *) NULL);
6655 assert(wand->signature == WandSignature);
6656 if (wand->debug != MagickFalse)
6657 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6658 if (wand->images == (Image *) NULL)
6659 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6660 status=LevelImageChannel(wand->images,channel,black_point,white_point,gamma);
6661 if (status == MagickFalse)
6662 InheritException(wand->exception,&wand->images->exception);
6667 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6671 % M a g i c k L i n e a r S t r e t c h I m a g e %
6675 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6677 % MagickLinearStretchImage() stretches with saturation the image intensity.
6679 % You can also reduce the influence of a particular channel with a gamma
6682 % The format of the MagickLinearStretchImage method is:
6684 % MagickBooleanType MagickLinearStretchImage(MagickWand *wand,
6685 % const double black_point,const double white_point)
6687 % A description of each parameter follows:
6689 % o wand: the magick wand.
6691 % o black_point: the black point.
6693 % o white_point: the white point.
6696 WandExport MagickBooleanType MagickLinearStretchImage(MagickWand *wand,
6697 const double black_point,const double white_point)
6702 assert(wand != (MagickWand *) NULL);
6703 assert(wand->signature == WandSignature);
6704 if (wand->debug != MagickFalse)
6705 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6706 if (wand->images == (Image *) NULL)
6707 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6708 status=LinearStretchImage(wand->images,black_point,white_point);
6709 if (status == MagickFalse)
6710 InheritException(wand->exception,&wand->images->exception);
6715 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6719 % M a g i c k L i q u i d R e s c a l e I m a g e %
6723 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6725 % MagickLiquidRescaleImage() rescales image with seam carving.
6727 % MagickBooleanType MagickLiquidRescaleImage(MagickWand *wand,
6728 % const size_t columns,const size_t rows,
6729 % const double delta_x,const double rigidity)
6731 % A description of each parameter follows:
6733 % o wand: the magick wand.
6735 % o columns: the number of columns in the scaled image.
6737 % o rows: the number of rows in the scaled image.
6739 % o delta_x: maximum seam transversal step (0 means straight seams).
6741 % o rigidity: introduce a bias for non-straight seams (typically 0).
6744 WandExport MagickBooleanType MagickLiquidRescaleImage(MagickWand *wand,
6745 const size_t columns,const size_t rows,const double delta_x,
6746 const double rigidity)
6751 assert(wand != (MagickWand *) NULL);
6752 assert(wand->signature == WandSignature);
6753 if (wand->debug != MagickFalse)
6754 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6755 if (wand->images == (Image *) NULL)
6756 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6757 rescale_image=LiquidRescaleImage(wand->images,columns,rows,delta_x,
6758 rigidity,wand->exception);
6759 if (rescale_image == (Image *) NULL)
6760 return(MagickFalse);
6761 ReplaceImageInList(&wand->images,rescale_image);
6766 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6770 % M a g i c k M a g n i f y I m a g e %
6774 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6776 % MagickMagnifyImage() is a convenience method that scales an image
6777 % proportionally to twice its original size.
6779 % The format of the MagickMagnifyImage method is:
6781 % MagickBooleanType MagickMagnifyImage(MagickWand *wand)
6783 % A description of each parameter follows:
6785 % o wand: the magick wand.
6788 WandExport MagickBooleanType MagickMagnifyImage(MagickWand *wand)
6793 assert(wand != (MagickWand *) NULL);
6794 assert(wand->signature == WandSignature);
6795 if (wand->debug != MagickFalse)
6796 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6797 if (wand->images == (Image *) NULL)
6798 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6799 magnify_image=MagnifyImage(wand->images,wand->exception);
6800 if (magnify_image == (Image *) NULL)
6801 return(MagickFalse);
6802 ReplaceImageInList(&wand->images,magnify_image);
6807 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6811 % M a g i c k M e d i a n F i l t e r I m a g e %
6815 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6817 % MagickMedianFilterImage() applies a digital filter that improves the quality
6818 % of a noisy image. Each pixel is replaced by the median in a set of
6819 % neighboring pixels as defined by radius.
6821 % The format of the MagickMedianFilterImage method is:
6823 % MagickBooleanType MagickMedianFilterImage(MagickWand *wand,
6824 % const double radius)
6826 % A description of each parameter follows:
6828 % o wand: the magick wand.
6830 % o radius: the radius of the pixel neighborhood.
6833 WandExport MagickBooleanType MagickMedianFilterImage(MagickWand *wand,
6834 const double radius)
6839 assert(wand != (MagickWand *) NULL);
6840 assert(wand->signature == WandSignature);
6841 if (wand->debug != MagickFalse)
6842 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6843 if (wand->images == (Image *) NULL)
6844 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6845 median_image=MedianFilterImage(wand->images,radius,wand->exception);
6846 if (median_image == (Image *) NULL)
6847 return(MagickFalse);
6848 ReplaceImageInList(&wand->images,median_image);
6853 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6857 % M a g i c k M e r g e I m a g e L a y e r s %
6861 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6863 % MagickMergeImageLayers() composes all the image layers from the current given
6864 % image onward to produce a single image of the merged layers.
6866 % The inital canvas's size depends on the given ImageLayerMethod, and is
6867 % initialized using the first images background color. The images
6868 % are then compositied onto that image in sequence using the given
6869 % composition that has been assigned to each individual image.
6871 % The format of the MagickMergeImageLayers method is:
6873 % MagickWand *MagickMergeImageLayers(MagickWand *wand,
6874 % const ImageLayerMethod method)
6876 % A description of each parameter follows:
6878 % o wand: the magick wand.
6880 % o method: the method of selecting the size of the initial canvas.
6882 % MergeLayer: Merge all layers onto a canvas just large enough
6883 % to hold all the actual images. The virtual canvas of the
6884 % first image is preserved but otherwise ignored.
6886 % FlattenLayer: Use the virtual canvas size of first image.
6887 % Images which fall outside this canvas is clipped.
6888 % This can be used to 'fill out' a given virtual canvas.
6890 % MosaicLayer: Start with the virtual canvas of the first image,
6891 % enlarging left and right edges to contain all images.
6892 % Images with negative offsets will be clipped.
6895 WandExport MagickWand *MagickMergeImageLayers(MagickWand *wand,
6896 const ImageLayerMethod method)
6901 assert(wand != (MagickWand *) NULL);
6902 assert(wand->signature == WandSignature);
6903 if (wand->debug != MagickFalse)
6904 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6905 if (wand->images == (Image *) NULL)
6906 return((MagickWand *) NULL);
6907 mosaic_image=MergeImageLayers(wand->images,method,wand->exception);
6908 if (mosaic_image == (Image *) NULL)
6909 return((MagickWand *) NULL);
6910 return(CloneMagickWandFromImages(wand,mosaic_image));
6914 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6918 % M a g i c k M i n i f y I m a g e %
6922 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6924 % MagickMinifyImage() is a convenience method that scales an image
6925 % proportionally to one-half its original size
6927 % The format of the MagickMinifyImage method is:
6929 % MagickBooleanType MagickMinifyImage(MagickWand *wand)
6931 % A description of each parameter follows:
6933 % o wand: the magick wand.
6936 WandExport MagickBooleanType MagickMinifyImage(MagickWand *wand)
6941 assert(wand != (MagickWand *) NULL);
6942 assert(wand->signature == WandSignature);
6943 if (wand->debug != MagickFalse)
6944 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6945 if (wand->images == (Image *) NULL)
6946 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6947 minify_image=MinifyImage(wand->images,wand->exception);
6948 if (minify_image == (Image *) NULL)
6949 return(MagickFalse);
6950 ReplaceImageInList(&wand->images,minify_image);
6955 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6959 % M a g i c k M o d u l a t e I m a g e %
6963 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6965 % MagickModulateImage() lets you control the brightness, saturation, and hue
6966 % of an image. Hue is the percentage of absolute rotation from the current
6967 % position. For example 50 results in a counter-clockwise rotation of 90
6968 % degrees, 150 results in a clockwise rotation of 90 degrees, with 0 and 200
6969 % both resulting in a rotation of 180 degrees.
6971 % To increase the color brightness by 20% and decrease the color saturation by
6972 % 10% and leave the hue unchanged, use: 120,90,100.
6974 % The format of the MagickModulateImage method is:
6976 % MagickBooleanType MagickModulateImage(MagickWand *wand,
6977 % const double brightness,const double saturation,const double hue)
6979 % A description of each parameter follows:
6981 % o wand: the magick wand.
6983 % o brightness: the percent change in brighness.
6985 % o saturation: the percent change in saturation.
6987 % o hue: the percent change in hue.
6990 WandExport MagickBooleanType MagickModulateImage(MagickWand *wand,
6991 const double brightness,const double saturation,const double hue)
6994 modulate[MaxTextExtent];
6999 assert(wand != (MagickWand *) NULL);
7000 assert(wand->signature == WandSignature);
7001 if (wand->debug != MagickFalse)
7002 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7003 if (wand->images == (Image *) NULL)
7004 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7005 (void) FormatMagickString(modulate,MaxTextExtent,"%g,%g,%g",
7006 brightness,saturation,hue);
7007 status=ModulateImage(wand->images,modulate);
7008 if (status == MagickFalse)
7009 InheritException(wand->exception,&wand->images->exception);
7014 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7018 % M a g i c k M o n t a g e I m a g e %
7022 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7024 % MagickMontageImage() creates a composite image by combining several
7025 % separate images. The images are tiled on the composite image with the name
7026 % of the image optionally appearing just below the individual tile.
7028 % The format of the MagickMontageImage method is:
7030 % MagickWand *MagickMontageImage(MagickWand *wand,
7031 % const DrawingWand drawing_wand,const char *tile_geometry,
7032 % const char *thumbnail_geometry,const MontageMode mode,
7033 % const char *frame)
7035 % A description of each parameter follows:
7037 % o wand: the magick wand.
7039 % o drawing_wand: the drawing wand. The font name, size, and color are
7040 % obtained from this wand.
7042 % o tile_geometry: the number of tiles per row and page (e.g. 6x4+0+0).
7044 % o thumbnail_geometry: Preferred image size and border size of each
7045 % thumbnail (e.g. 120x120+4+3>).
7047 % o mode: Thumbnail framing mode: Frame, Unframe, or Concatenate.
7049 % o frame: Surround the image with an ornamental border (e.g. 15x15+3+3).
7050 % The frame color is that of the thumbnail's matte color.
7053 WandExport MagickWand *MagickMontageImage(MagickWand *wand,
7054 const DrawingWand *drawing_wand,const char *tile_geometry,
7055 const char *thumbnail_geometry,const MontageMode mode,const char *frame)
7069 assert(wand != (MagickWand *) NULL);
7070 assert(wand->signature == WandSignature);
7071 if (wand->debug != MagickFalse)
7072 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7073 if (wand->images == (Image *) NULL)
7074 return((MagickWand *) NULL);
7075 montage_info=CloneMontageInfo(wand->image_info,(MontageInfo *) NULL);
7080 (void) CloneString(&montage_info->frame,"15x15+3+3");
7081 montage_info->shadow=MagickTrue;
7086 montage_info->frame=(char *) NULL;
7087 montage_info->shadow=MagickFalse;
7088 montage_info->border_width=0;
7091 case ConcatenateMode:
7093 montage_info->frame=(char *) NULL;
7094 montage_info->shadow=MagickFalse;
7095 (void) CloneString(&montage_info->geometry,"+0+0");
7096 montage_info->border_width=0;
7102 font=DrawGetFont(drawing_wand);
7103 if (font != (char *) NULL)
7104 (void) CloneString(&montage_info->font,font);
7105 if (frame != (char *) NULL)
7106 (void) CloneString(&montage_info->frame,frame);
7107 montage_info->pointsize=DrawGetFontSize(drawing_wand);
7108 pixel_wand=NewPixelWand();
7109 DrawGetFillColor(drawing_wand,pixel_wand);
7110 PixelGetQuantumColor(pixel_wand,&montage_info->fill);
7111 DrawGetStrokeColor(drawing_wand,pixel_wand);
7112 PixelGetQuantumColor(pixel_wand,&montage_info->stroke);
7113 pixel_wand=DestroyPixelWand(pixel_wand);
7114 if (thumbnail_geometry != (char *) NULL)
7115 (void) CloneString(&montage_info->geometry,thumbnail_geometry);
7116 if (tile_geometry != (char *) NULL)
7117 (void) CloneString(&montage_info->tile,tile_geometry);
7118 montage_image=MontageImageList(wand->image_info,montage_info,wand->images,
7120 montage_info=DestroyMontageInfo(montage_info);
7121 if (montage_image == (Image *) NULL)
7122 return((MagickWand *) NULL);
7123 return(CloneMagickWandFromImages(wand,montage_image));
7127 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7131 % M a g i c k M o r p h I m a g e s %
7135 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7137 % MagickMorphImages() method morphs a set of images. Both the image pixels
7138 % and size are linearly interpolated to give the appearance of a
7139 % meta-morphosis from one image to the next.
7141 % The format of the MagickMorphImages method is:
7143 % MagickWand *MagickMorphImages(MagickWand *wand,
7144 % const size_t number_frames)
7146 % A description of each parameter follows:
7148 % o wand: the magick wand.
7150 % o number_frames: the number of in-between images to generate.
7153 WandExport MagickWand *MagickMorphImages(MagickWand *wand,
7154 const size_t number_frames)
7159 assert(wand != (MagickWand *) NULL);
7160 assert(wand->signature == WandSignature);
7161 if (wand->debug != MagickFalse)
7162 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7163 if (wand->images == (Image *) NULL)
7164 return((MagickWand *) NULL);
7165 morph_image=MorphImages(wand->images,number_frames,wand->exception);
7166 if (morph_image == (Image *) NULL)
7167 return((MagickWand *) NULL);
7168 return(CloneMagickWandFromImages(wand,morph_image));
7172 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7176 % M a g i c k M o r p h o l o g y I m a g e %
7180 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7182 % MagickMorphologyImage() applies a user supplied kernel to the image
7183 % according to the given mophology method.
7185 % The format of the MagickMorphologyImage method is:
7187 % MagickBooleanType MagickMorphologyImage(MagickWand *wand,
7188 % MorphologyMethod method,const ssize_t iterations,KernelInfo *kernel)
7189 % MagickBooleanType MagickMorphologyImageChannel(MagickWand *wand,
7190 % ChannelType channel,MorphologyMethod method,const ssize_t iterations,
7191 % KernelInfo *kernel)
7193 % A description of each parameter follows:
7195 % o wand: the magick wand.
7197 % o channel: the image channel(s).
7199 % o method: the morphology method to be applied.
7201 % o iterations: apply the operation this many times (or no change).
7202 % A value of -1 means loop until no change found. How this is applied
7203 % may depend on the morphology method. Typically this is a value of 1.
7205 % o kernel: An array of doubles representing the morphology kernel.
7209 WandExport MagickBooleanType MagickMorphologyImage(MagickWand *wand,
7210 MorphologyMethod method,const ssize_t iterations,KernelInfo *kernel)
7215 status=MagickMorphologyImageChannel(wand,DefaultChannels,method,iterations,
7220 WandExport MagickBooleanType MagickMorphologyImageChannel(MagickWand *wand,
7221 const ChannelType channel,MorphologyMethod method,const ssize_t iterations,
7227 assert(wand != (MagickWand *) NULL);
7228 assert(wand->signature == WandSignature);
7229 if (wand->debug != MagickFalse)
7230 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7231 if (kernel == (const KernelInfo *) NULL)
7232 return(MagickFalse);
7233 if (wand->images == (Image *) NULL)
7234 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7235 morphology_image=MorphologyImageChannel(wand->images,channel,method,
7236 iterations,kernel,wand->exception);
7237 if (morphology_image == (Image *) NULL)
7238 return(MagickFalse);
7239 ReplaceImageInList(&wand->images,morphology_image);
7244 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7248 % M a g i c k M o t i o n B l u r I m a g e %
7252 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7254 % MagickMotionBlurImage() simulates motion blur. We convolve the image with a
7255 % Gaussian operator of the given radius and standard deviation (sigma).
7256 % For reasonable results, radius should be larger than sigma. Use a
7257 % radius of 0 and MotionBlurImage() selects a suitable radius for you.
7258 % Angle gives the angle of the blurring motion.
7260 % The format of the MagickMotionBlurImage method is:
7262 % MagickBooleanType MagickMotionBlurImage(MagickWand *wand,
7263 % const double radius,const double sigma,const double angle)
7264 % MagickBooleanType MagickMotionBlurImageChannel(MagickWand *wand,
7265 % const ChannelType channel,const double radius,const double sigma,
7266 % const double angle)
7268 % A description of each parameter follows:
7270 % o wand: the magick wand.
7272 % o channel: the image channel(s).
7274 % o radius: the radius of the Gaussian, in pixels, not counting
7277 % o sigma: the standard deviation of the Gaussian, in pixels.
7279 % o angle: Apply the effect along this angle.
7283 WandExport MagickBooleanType MagickMotionBlurImage(MagickWand *wand,
7284 const double radius,const double sigma,const double angle)
7289 status=MagickMotionBlurImageChannel(wand,DefaultChannels,radius,sigma,angle);
7293 WandExport MagickBooleanType MagickMotionBlurImageChannel(MagickWand *wand,
7294 const ChannelType channel,const double radius,const double sigma,
7300 assert(wand != (MagickWand *) NULL);
7301 assert(wand->signature == WandSignature);
7302 if (wand->debug != MagickFalse)
7303 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7304 if (wand->images == (Image *) NULL)
7305 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7306 blur_image=MotionBlurImageChannel(wand->images,channel,radius,sigma,angle,
7308 if (blur_image == (Image *) NULL)
7309 return(MagickFalse);
7310 ReplaceImageInList(&wand->images,blur_image);
7315 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7319 % M a g i c k N e g a t e I m a g e %
7323 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7325 % MagickNegateImage() negates the colors in the reference image. The
7326 % Grayscale option means that only grayscale values within the image are
7329 % You can also reduce the influence of a particular channel with a gamma
7332 % The format of the MagickNegateImage method is:
7334 % MagickBooleanType MagickNegateImage(MagickWand *wand,
7335 % const MagickBooleanType gray)
7336 % MagickBooleanType MagickNegateImage(MagickWand *wand,
7337 % const ChannelType channel,const MagickBooleanType gray)
7339 % A description of each parameter follows:
7341 % o wand: the magick wand.
7343 % o channel: the image channel(s).
7345 % o gray: If MagickTrue, only negate grayscale pixels within the image.
7349 WandExport MagickBooleanType MagickNegateImage(MagickWand *wand,
7350 const MagickBooleanType gray)
7355 status=MagickNegateImageChannel(wand,DefaultChannels,gray);
7359 WandExport MagickBooleanType MagickNegateImageChannel(MagickWand *wand,
7360 const ChannelType channel,const MagickBooleanType gray)
7365 assert(wand != (MagickWand *) NULL);
7366 assert(wand->signature == WandSignature);
7367 if (wand->debug != MagickFalse)
7368 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7369 if (wand->images == (Image *) NULL)
7370 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7371 status=NegateImageChannel(wand->images,channel,gray);
7372 if (status == MagickFalse)
7373 InheritException(wand->exception,&wand->images->exception);
7378 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7382 % M a g i c k N e w I m a g e %
7386 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7388 % MagickNewImage() adds a blank image canvas of the specified size and
7389 % background color to the wand.
7391 % The format of the MagickNewImage method is:
7393 % MagickBooleanType MagickNewImage(MagickWand *wand,
7394 % const size_t columns,const size_t rows,
7395 % const PixelWand *background)
7397 % A description of each parameter follows:
7399 % o wand: the magick wand.
7401 % o width: the image width.
7403 % o height: the image height.
7405 % o background: the image color.
7408 WandExport MagickBooleanType MagickNewImage(MagickWand *wand,
7409 const size_t width,const size_t height,
7410 const PixelWand *background)
7418 assert(wand != (MagickWand *) NULL);
7419 assert(wand->signature == WandSignature);
7420 if (wand->debug != MagickFalse)
7421 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7422 PixelGetMagickColor(background,&pixel);
7423 images=NewMagickImage(wand->image_info,width,height,&pixel);
7424 if (images == (Image *) NULL)
7425 return(MagickFalse);
7426 if (images->exception.severity != UndefinedException)
7427 InheritException(wand->exception,&images->exception);
7428 return(InsertImageInWand(wand,images));
7432 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7436 % M a g i c k N e x t I m a g e %
7440 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7442 % MagickNextImage() associates the next image in the image list with a magick
7445 % The format of the MagickNextImage method is:
7447 % MagickBooleanType MagickNextImage(MagickWand *wand)
7449 % A description of each parameter follows:
7451 % o wand: the magick wand.
7454 WandExport MagickBooleanType MagickNextImage(MagickWand *wand)
7456 assert(wand != (MagickWand *) NULL);
7457 assert(wand->signature == WandSignature);
7458 if (wand->debug != MagickFalse)
7459 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7460 if (wand->images == (Image *) NULL)
7461 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7462 if (wand->pend != MagickFalse)
7464 wand->pend=MagickFalse;
7467 if (GetNextImageInList(wand->images) == (Image *) NULL)
7469 wand->pend=MagickTrue;
7470 return(MagickFalse);
7472 wand->images=GetNextImageInList(wand->images);
7477 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7481 % M a g i c k N o r m a l i z e I m a g e %
7485 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7487 % MagickNormalizeImage() enhances the contrast of a color image by adjusting
7488 % the pixels color to span the entire range of colors available
7490 % You can also reduce the influence of a particular channel with a gamma
7493 % The format of the MagickNormalizeImage method is:
7495 % MagickBooleanType MagickNormalizeImage(MagickWand *wand)
7496 % MagickBooleanType MagickNormalizeImageChannel(MagickWand *wand,
7497 % const ChannelType channel)
7499 % A description of each parameter follows:
7501 % o wand: the magick wand.
7503 % o channel: the image channel(s).
7507 WandExport MagickBooleanType MagickNormalizeImage(MagickWand *wand)
7512 status=MagickNormalizeImageChannel(wand,DefaultChannels);
7516 WandExport MagickBooleanType MagickNormalizeImageChannel(MagickWand *wand,
7517 const ChannelType channel)
7522 assert(wand != (MagickWand *) NULL);
7523 assert(wand->signature == WandSignature);
7524 if (wand->debug != MagickFalse)
7525 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7526 if (wand->images == (Image *) NULL)
7527 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7528 status=NormalizeImageChannel(wand->images,channel);
7529 if (status == MagickFalse)
7530 InheritException(wand->exception,&wand->images->exception);
7535 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7539 % M a g i c k O i l P a i n t I m a g e %
7543 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7545 % MagickOilPaintImage() applies a special effect filter that simulates an oil
7546 % painting. Each pixel is replaced by the most frequent color occurring
7547 % in a circular region defined by radius.
7549 % The format of the MagickOilPaintImage method is:
7551 % MagickBooleanType MagickOilPaintImage(MagickWand *wand,
7552 % const double radius)
7554 % A description of each parameter follows:
7556 % o wand: the magick wand.
7558 % o radius: the radius of the circular neighborhood.
7561 WandExport MagickBooleanType MagickOilPaintImage(MagickWand *wand,
7562 const double radius)
7567 assert(wand != (MagickWand *) NULL);
7568 assert(wand->signature == WandSignature);
7569 if (wand->debug != MagickFalse)
7570 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7571 if (wand->images == (Image *) NULL)
7572 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7573 paint_image=OilPaintImage(wand->images,radius,wand->exception);
7574 if (paint_image == (Image *) NULL)
7575 return(MagickFalse);
7576 ReplaceImageInList(&wand->images,paint_image);
7581 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7585 % M a g i c k O p a q u e P a i n t I m a g e %
7589 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7591 % MagickOpaquePaintImage() changes any pixel that matches color with the color
7594 % The format of the MagickOpaquePaintImage method is:
7596 % MagickBooleanType MagickOpaquePaintImage(MagickWand *wand,
7597 % const PixelWand *target,const PixelWand *fill,const double fuzz,
7598 % const MagickBooleanType invert)
7599 % MagickBooleanType MagickOpaquePaintImageChannel(MagickWand *wand,
7600 % const ChannelType channel,const PixelWand *target,
7601 % const PixelWand *fill,const double fuzz,const MagickBooleanType invert)
7603 % A description of each parameter follows:
7605 % o wand: the magick wand.
7607 % o channel: the channel(s).
7609 % o target: Change this target color to the fill color within the image.
7611 % o fill: the fill pixel wand.
7613 % o fuzz: By default target must match a particular pixel color
7614 % exactly. However, in many cases two colors may differ by a small amount.
7615 % The fuzz member of image defines how much tolerance is acceptable to
7616 % consider two colors as the same. For example, set fuzz to 10 and the
7617 % color red at intensities of 100 and 102 respectively are now interpreted
7618 % as the same color for the purposes of the floodfill.
7620 % o invert: paint any pixel that does not match the target color.
7624 WandExport MagickBooleanType MagickOpaquePaintImage(MagickWand *wand,
7625 const PixelWand *target,const PixelWand *fill,const double fuzz,
7626 const MagickBooleanType invert)
7631 status=MagickOpaquePaintImageChannel(wand,DefaultChannels,target,fill,fuzz,
7636 WandExport MagickBooleanType MagickOpaquePaintImageChannel(MagickWand *wand,
7637 const ChannelType channel,const PixelWand *target,const PixelWand *fill,
7638 const double fuzz,const MagickBooleanType invert)
7647 assert(wand != (MagickWand *) NULL);
7648 assert(wand->signature == WandSignature);
7649 if (wand->debug != MagickFalse)
7650 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7651 if (wand->images == (Image *) NULL)
7652 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7653 PixelGetMagickColor(target,&target_pixel);
7654 PixelGetMagickColor(fill,&fill_pixel);
7655 wand->images->fuzz=fuzz;
7656 status=OpaquePaintImageChannel(wand->images,channel,&target_pixel,
7657 &fill_pixel,invert);
7658 if (status == MagickFalse)
7659 InheritException(wand->exception,&wand->images->exception);
7664 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7668 % 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 %
7672 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7674 % MagickOptimizeImageLayers() compares each image the GIF disposed forms of the
7675 % previous image in the sequence. From this it attempts to select the
7676 % smallest cropped image to replace each frame, while preserving the results
7679 % The format of the MagickOptimizeImageLayers method is:
7681 % MagickWand *MagickOptimizeImageLayers(MagickWand *wand)
7683 % A description of each parameter follows:
7685 % o wand: the magick wand.
7688 WandExport MagickWand *MagickOptimizeImageLayers(MagickWand *wand)
7693 assert(wand != (MagickWand *) NULL);
7694 assert(wand->signature == WandSignature);
7695 if (wand->debug != MagickFalse)
7696 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7697 if (wand->images == (Image *) NULL)
7698 return((MagickWand *) NULL);
7699 optimize_image=OptimizeImageLayers(wand->images,wand->exception);
7700 if (optimize_image == (Image *) NULL)
7701 return((MagickWand *) NULL);
7702 return(CloneMagickWandFromImages(wand,optimize_image));
7706 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7710 % 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 %
7714 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7716 % MagickOrderedPosterizeImage() performs an ordered dither based on a number
7717 % of pre-defined dithering threshold maps, but over multiple intensity levels,
7718 % which can be different for different channels, according to the input
7721 % The format of the MagickOrderedPosterizeImage method is:
7723 % MagickBooleanType MagickOrderedPosterizeImage(MagickWand *wand,
7724 % const char *threshold_map)
7725 % MagickBooleanType MagickOrderedPosterizeImageChannel(MagickWand *wand,
7726 % const ChannelType channel,const char *threshold_map)
7728 % A description of each parameter follows:
7730 % o image: the image.
7732 % o channel: the channel or channels to be thresholded.
7734 % o threshold_map: A string containing the name of the threshold dither
7735 % map to use, followed by zero or more numbers representing the number of
7736 % color levels tho dither between.
7738 % Any level number less than 2 is equivelent to 2, and means only binary
7739 % dithering will be applied to each color channel.
7741 % No numbers also means a 2 level (bitmap) dither will be applied to all
7742 % channels, while a single number is the number of levels applied to each
7743 % channel in sequence. More numbers will be applied in turn to each of
7744 % the color channels.
7746 % For example: "o3x3,6" generates a 6 level posterization of the image
7747 % with a ordered 3x3 diffused pixel dither being applied between each
7748 % level. While checker,8,8,4 will produce a 332 colormaped image with
7749 % only a single checkerboard hash pattern (50% grey) between each color
7750 % level, to basically double the number of color levels with a bare
7751 % minimim of dithering.
7755 WandExport MagickBooleanType MagickOrderedPosterizeImage(MagickWand *wand,
7756 const char *threshold_map)
7761 status=MagickOrderedPosterizeImageChannel(wand,DefaultChannels,threshold_map);
7765 WandExport MagickBooleanType MagickOrderedPosterizeImageChannel(
7766 MagickWand *wand,const ChannelType channel,const char *threshold_map)
7771 assert(wand != (MagickWand *) NULL);
7772 assert(wand->signature == WandSignature);
7773 if (wand->debug != MagickFalse)
7774 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7775 if (wand->images == (Image *) NULL)
7776 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7777 status=OrderedPosterizeImageChannel(wand->images,channel,threshold_map,
7783 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7787 % M a g i c k P i n g I m a g e %
7791 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7793 % MagickPingImage() is like MagickReadImage() except the only valid
7794 % information returned is the image width, height, size, and format. It
7795 % is designed to efficiently obtain this information from a file without
7796 % reading the entire image sequence into memory.
7798 % The format of the MagickPingImage method is:
7800 % MagickBooleanType MagickPingImage(MagickWand *wand,const char *filename)
7802 % A description of each parameter follows:
7804 % o wand: the magick wand.
7806 % o filename: the image filename.
7809 WandExport MagickBooleanType MagickPingImage(MagickWand *wand,
7810 const char *filename)
7818 assert(wand != (MagickWand *) NULL);
7819 assert(wand->signature == WandSignature);
7820 if (wand->debug != MagickFalse)
7821 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7822 ping_info=CloneImageInfo(wand->image_info);
7823 if (filename != (const char *) NULL)
7824 (void) CopyMagickString(ping_info->filename,filename,MaxTextExtent);
7825 images=PingImage(ping_info,wand->exception);
7826 ping_info=DestroyImageInfo(ping_info);
7827 if (images == (Image *) NULL)
7828 return(MagickFalse);
7829 return(InsertImageInWand(wand,images));
7833 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7837 % M a g i c k P i n g I m a g e B l o b %
7841 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7843 % MagickPingImageBlob() pings an image or image sequence from a blob.
7845 % The format of the MagickPingImageBlob method is:
7847 % MagickBooleanType MagickPingImageBlob(MagickWand *wand,
7848 % const void *blob,const size_t length)
7850 % A description of each parameter follows:
7852 % o wand: the magick wand.
7856 % o length: the blob length.
7859 WandExport MagickBooleanType MagickPingImageBlob(MagickWand *wand,
7860 const void *blob,const size_t length)
7868 assert(wand != (MagickWand *) NULL);
7869 assert(wand->signature == WandSignature);
7870 if (wand->debug != MagickFalse)
7871 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7872 read_info=CloneImageInfo(wand->image_info);
7873 SetImageInfoBlob(read_info,blob,length);
7874 images=PingImage(read_info,wand->exception);
7875 read_info=DestroyImageInfo(read_info);
7876 if (images == (Image *) NULL)
7877 return(MagickFalse);
7878 return(InsertImageInWand(wand,images));
7882 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7886 % M a g i c k P i n g I m a g e F i l e %
7890 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7892 % MagickPingImageFile() pings an image or image sequence from an open file
7895 % The format of the MagickPingImageFile method is:
7897 % MagickBooleanType MagickPingImageFile(MagickWand *wand,FILE *file)
7899 % A description of each parameter follows:
7901 % o wand: the magick wand.
7903 % o file: the file descriptor.
7906 WandExport MagickBooleanType MagickPingImageFile(MagickWand *wand,FILE *file)
7914 assert(wand != (MagickWand *) NULL);
7915 assert(wand->signature == WandSignature);
7916 assert(file != (FILE *) NULL);
7917 if (wand->debug != MagickFalse)
7918 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7919 read_info=CloneImageInfo(wand->image_info);
7920 SetImageInfoFile(read_info,file);
7921 images=PingImage(read_info,wand->exception);
7922 read_info=DestroyImageInfo(read_info);
7923 if (images == (Image *) NULL)
7924 return(MagickFalse);
7925 return(InsertImageInWand(wand,images));
7929 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7933 % M a g i c k P o l a r o i d I m a g e %
7937 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7939 % MagickPolaroidImage() simulates a Polaroid picture.
7941 % The format of the MagickPolaroidImage method is:
7943 % MagickBooleanType MagickPolaroidImage(MagickWand *wand,
7944 % const DrawingWand *drawing_wand,const double angle)
7946 % A description of each parameter follows:
7948 % o wand: the magick wand.
7950 % o drawing_wand: the draw wand.
7952 % o angle: Apply the effect along this angle.
7955 WandExport MagickBooleanType MagickPolaroidImage(MagickWand *wand,
7956 const DrawingWand *drawing_wand,const double angle)
7964 assert(wand != (MagickWand *) NULL);
7965 assert(wand->signature == WandSignature);
7966 if (wand->debug != MagickFalse)
7967 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7968 if (wand->images == (Image *) NULL)
7969 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7970 draw_info=PeekDrawingWand(drawing_wand);
7971 if (draw_info == (DrawInfo *) NULL)
7972 return(MagickFalse);
7973 polaroid_image=PolaroidImage(wand->images,draw_info,angle,wand->exception);
7974 if (polaroid_image == (Image *) NULL)
7975 return(MagickFalse);
7976 ReplaceImageInList(&wand->images,polaroid_image);
7981 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7985 % M a g i c k P o s t e r i z e I m a g e %
7989 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7991 % MagickPosterizeImage() reduces the image to a limited number of color level.
7993 % The format of the MagickPosterizeImage method is:
7995 % MagickBooleanType MagickPosterizeImage(MagickWand *wand,
7996 % const unsigned levels,const MagickBooleanType dither)
7998 % A description of each parameter follows:
8000 % o wand: the magick wand.
8002 % o levels: Number of color levels allowed in each channel. Very low values
8003 % (2, 3, or 4) have the most visible effect.
8005 % o dither: Set this integer value to something other than zero to dither
8009 WandExport MagickBooleanType MagickPosterizeImage(MagickWand *wand,
8010 const size_t levels,const MagickBooleanType dither)
8015 assert(wand != (MagickWand *) NULL);
8016 assert(wand->signature == WandSignature);
8017 if (wand->debug != MagickFalse)
8018 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8019 if (wand->images == (Image *) NULL)
8020 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8021 status=PosterizeImage(wand->images,levels,dither);
8022 if (status == MagickFalse)
8023 InheritException(wand->exception,&wand->images->exception);
8028 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8032 % M a g i c k P r e v i e w I m a g e s %
8036 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8038 % MagickPreviewImages() tiles 9 thumbnails of the specified image with an
8039 % image processing operation applied at varying strengths. This helpful
8040 % to quickly pin-point an appropriate parameter for an image processing
8043 % The format of the MagickPreviewImages method is:
8045 % MagickWand *MagickPreviewImages(MagickWand *wand,
8046 % const PreviewType preview)
8048 % A description of each parameter follows:
8050 % o wand: the magick wand.
8052 % o preview: the preview type.
8055 WandExport MagickWand *MagickPreviewImages(MagickWand *wand,
8056 const PreviewType preview)
8061 assert(wand != (MagickWand *) NULL);
8062 assert(wand->signature == WandSignature);
8063 if (wand->debug != MagickFalse)
8064 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8065 if (wand->images == (Image *) NULL)
8066 return((MagickWand *) NULL);
8067 preview_image=PreviewImage(wand->images,preview,wand->exception);
8068 if (preview_image == (Image *) NULL)
8069 return((MagickWand *) NULL);
8070 return(CloneMagickWandFromImages(wand,preview_image));
8074 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8078 % M a g i c k P r e v i o u s I m a g e %
8082 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8084 % MagickPreviousImage() assocates the previous image in an image list with
8087 % The format of the MagickPreviousImage method is:
8089 % MagickBooleanType MagickPreviousImage(MagickWand *wand)
8091 % A description of each parameter follows:
8093 % o wand: the magick wand.
8096 WandExport MagickBooleanType MagickPreviousImage(MagickWand *wand)
8098 assert(wand != (MagickWand *) NULL);
8099 assert(wand->signature == WandSignature);
8100 if (wand->debug != MagickFalse)
8101 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8102 if (wand->images == (Image *) NULL)
8103 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8104 if (wand->pend != MagickFalse)
8106 wand->pend=MagickFalse;
8109 if (GetPreviousImageInList(wand->images) == (Image *) NULL)
8111 wand->pend=MagickTrue;
8112 return(MagickFalse);
8114 wand->images=GetPreviousImageInList(wand->images);
8119 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8123 % M a g i c k Q u a n t i z e I m a g e %
8127 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8129 % MagickQuantizeImage() analyzes the colors within a reference image and
8130 % chooses a fixed number of colors to represent the image. The goal of the
8131 % algorithm is to minimize the color difference between the input and output
8132 % image while minimizing the processing time.
8134 % The format of the MagickQuantizeImage method is:
8136 % MagickBooleanType MagickQuantizeImage(MagickWand *wand,
8137 % const size_t number_colors,const ColorspaceType colorspace,
8138 % const size_t treedepth,const MagickBooleanType dither,
8139 % const MagickBooleanType measure_error)
8141 % A description of each parameter follows:
8143 % o wand: the magick wand.
8145 % o number_colors: the number of colors.
8147 % o colorspace: Perform color reduction in this colorspace, typically
8150 % o treedepth: Normally, this integer value is zero or one. A zero or
8151 % 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
8152 % reference image with the least amount of memory and the fastest
8153 % computational speed. In some cases, such as an image with low color
8154 % dispersion (a few number of colors), a value other than
8155 % Log4(number_colors) is required. To expand the color tree completely,
8158 % o dither: A value other than zero distributes the difference between an
8159 % original image and the corresponding color reduced image to
8160 % neighboring pixels along a Hilbert curve.
8162 % o measure_error: A value other than zero measures the difference between
8163 % the original and quantized images. This difference is the total
8164 % quantization error. The error is computed by summing over all pixels
8165 % in an image the distance squared in RGB space between each reference
8166 % pixel value and its quantized value.
8169 WandExport MagickBooleanType MagickQuantizeImage(MagickWand *wand,
8170 const size_t number_colors,const ColorspaceType colorspace,
8171 const size_t treedepth,const MagickBooleanType dither,
8172 const MagickBooleanType measure_error)
8180 assert(wand != (MagickWand *) NULL);
8181 assert(wand->signature == WandSignature);
8182 if (wand->debug != MagickFalse)
8183 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8184 if (wand->images == (Image *) NULL)
8185 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8186 quantize_info=CloneQuantizeInfo((QuantizeInfo *) NULL);
8187 quantize_info->number_colors=number_colors;
8188 quantize_info->dither=dither;
8189 quantize_info->tree_depth=treedepth;
8190 quantize_info->colorspace=colorspace;
8191 quantize_info->measure_error=measure_error;
8192 status=QuantizeImage(quantize_info,wand->images);
8193 if (status == MagickFalse)
8194 InheritException(wand->exception,&wand->images->exception);
8195 quantize_info=DestroyQuantizeInfo(quantize_info);
8200 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8204 % M a g i c k Q u a n t i z e I m a g e s %
8208 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8210 % MagickQuantizeImages() analyzes the colors within a sequence of images and
8211 % chooses a fixed number of colors to represent the image. The goal of the
8212 % algorithm is to minimize the color difference between the input and output
8213 % image while minimizing the processing time.
8215 % The format of the MagickQuantizeImages method is:
8217 % MagickBooleanType MagickQuantizeImages(MagickWand *wand,
8218 % const size_t number_colors,const ColorspaceType colorspace,
8219 % const size_t treedepth,const MagickBooleanType dither,
8220 % const MagickBooleanType measure_error)
8222 % A description of each parameter follows:
8224 % o wand: the magick wand.
8226 % o number_colors: the number of colors.
8228 % o colorspace: Perform color reduction in this colorspace, typically
8231 % o treedepth: Normally, this integer value is zero or one. A zero or
8232 % 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
8233 % reference image with the least amount of memory and the fastest
8234 % computational speed. In some cases, such as an image with low color
8235 % dispersion (a few number of colors), a value other than
8236 % Log4(number_colors) is required. To expand the color tree completely,
8239 % o dither: A value other than zero distributes the difference between an
8240 % original image and the corresponding color reduced algorithm to
8241 % neighboring pixels along a Hilbert curve.
8243 % o measure_error: A value other than zero measures the difference between
8244 % the original and quantized images. This difference is the total
8245 % quantization error. The error is computed by summing over all pixels
8246 % in an image the distance squared in RGB space between each reference
8247 % pixel value and its quantized value.
8250 WandExport MagickBooleanType MagickQuantizeImages(MagickWand *wand,
8251 const size_t number_colors,const ColorspaceType colorspace,
8252 const size_t treedepth,const MagickBooleanType dither,
8253 const MagickBooleanType measure_error)
8261 assert(wand != (MagickWand *) NULL);
8262 assert(wand->signature == WandSignature);
8263 if (wand->debug != MagickFalse)
8264 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8265 if (wand->images == (Image *) NULL)
8266 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8267 quantize_info=CloneQuantizeInfo((QuantizeInfo *) NULL);
8268 quantize_info->number_colors=number_colors;
8269 quantize_info->dither=dither;
8270 quantize_info->tree_depth=treedepth;
8271 quantize_info->colorspace=colorspace;
8272 quantize_info->measure_error=measure_error;
8273 status=QuantizeImages(quantize_info,wand->images);
8274 if (status == MagickFalse)
8275 InheritException(wand->exception,&wand->images->exception);
8276 quantize_info=DestroyQuantizeInfo(quantize_info);
8281 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8285 % M a g i c k R a d i a l B l u r I m a g e %
8289 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8291 % MagickRadialBlurImage() radial blurs an image.
8293 % The format of the MagickRadialBlurImage method is:
8295 % MagickBooleanType MagickRadialBlurImage(MagickWand *wand,
8296 % const double angle)
8297 % MagickBooleanType MagickRadialBlurImageChannel(MagickWand *wand,
8298 % const ChannelType channel,const double angle)
8300 % A description of each parameter follows:
8302 % o wand: the magick wand.
8304 % o channel: the image channel(s).
8306 % o angle: the angle of the blur in degrees.
8309 WandExport MagickBooleanType MagickRadialBlurImage(MagickWand *wand,
8315 status=MagickRadialBlurImageChannel(wand,DefaultChannels,angle);
8319 WandExport MagickBooleanType MagickRadialBlurImageChannel(MagickWand *wand,
8320 const ChannelType channel,const double angle)
8325 assert(wand != (MagickWand *) NULL);
8326 assert(wand->signature == WandSignature);
8327 if (wand->debug != MagickFalse)
8328 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8329 if (wand->images == (Image *) NULL)
8330 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8331 blur_image=RadialBlurImageChannel(wand->images,channel,angle,
8333 if (blur_image == (Image *) NULL)
8334 return(MagickFalse);
8335 ReplaceImageInList(&wand->images,blur_image);
8340 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8344 % M a g i c k R a i s e I m a g e %
8348 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8350 % MagickRaiseImage() creates a simulated three-dimensional button-like effect
8351 % by lightening and darkening the edges of the image. Members width and
8352 % height of raise_info define the width of the vertical and horizontal
8353 % edge of the effect.
8355 % The format of the MagickRaiseImage method is:
8357 % MagickBooleanType MagickRaiseImage(MagickWand *wand,
8358 % const size_t width,const size_t height,const ssize_t x,
8359 % const ssize_t y,const MagickBooleanType raise)
8361 % A description of each parameter follows:
8363 % o wand: the magick wand.
8365 % o width,height,x,y: Define the dimensions of the area to raise.
8367 % o raise: A value other than zero creates a 3-D raise effect,
8368 % otherwise it has a lowered effect.
8371 WandExport MagickBooleanType MagickRaiseImage(MagickWand *wand,
8372 const size_t width,const size_t height,const ssize_t x,
8373 const ssize_t y,const MagickBooleanType raise)
8381 assert(wand != (MagickWand *) NULL);
8382 assert(wand->signature == WandSignature);
8383 if (wand->debug != MagickFalse)
8384 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8385 if (wand->images == (Image *) NULL)
8386 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8387 raise_info.width=width;
8388 raise_info.height=height;
8391 status=RaiseImage(wand->images,&raise_info,raise);
8392 if (status == MagickFalse)
8393 InheritException(wand->exception,&wand->images->exception);
8398 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8402 % 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 %
8406 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8408 % MagickRandomThresholdImage() changes the value of individual pixels based on
8409 % the intensity of each pixel compared to threshold. The result is a
8410 % high-contrast, two color image.
8412 % The format of the MagickRandomThresholdImage method is:
8414 % MagickBooleanType MagickRandomThresholdImage(MagickWand *wand,
8415 % const double low,const double high)
8416 % MagickBooleanType MagickRandomThresholdImageChannel(MagickWand *wand,
8417 % const ChannelType channel,const double low,const double high)
8419 % A description of each parameter follows:
8421 % o wand: the magick wand.
8423 % o channel: the image channel(s).
8425 % o low,high: Specify the high and low thresholds. These values range from
8426 % 0 to QuantumRange.
8430 WandExport MagickBooleanType MagickRandomThresholdImage(MagickWand *wand,
8431 const double low,const double high)
8436 status=MagickRandomThresholdImageChannel(wand,DefaultChannels,low,high);
8440 WandExport MagickBooleanType MagickRandomThresholdImageChannel(
8441 MagickWand *wand,const ChannelType channel,const double low,
8445 threshold[MaxTextExtent];
8450 assert(wand != (MagickWand *) NULL);
8451 assert(wand->signature == WandSignature);
8452 if (wand->debug != MagickFalse)
8453 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8454 if (wand->images == (Image *) NULL)
8455 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8456 (void) FormatMagickString(threshold,MaxTextExtent,"%gx%g",low,high);
8457 status=RandomThresholdImageChannel(wand->images,channel,threshold,
8459 if (status == MagickFalse)
8460 InheritException(wand->exception,&wand->images->exception);
8465 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8469 % M a g i c k R e a d I m a g e %
8473 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8475 % MagickReadImage() reads an image or image sequence. The images are inserted
8476 % at the current image pointer position. Use MagickSetFirstIterator(),
8477 % MagickSetLastIterator, or MagickSetImageIndex() to specify the current
8478 % image pointer position at the beginning of the image list, the end, or
8479 % anywhere in-between respectively.
8481 % The format of the MagickReadImage method is:
8483 % MagickBooleanType MagickReadImage(MagickWand *wand,const char *filename)
8485 % A description of each parameter follows:
8487 % o wand: the magick wand.
8489 % o filename: the image filename.
8492 WandExport MagickBooleanType MagickReadImage(MagickWand *wand,
8493 const char *filename)
8501 assert(wand != (MagickWand *) NULL);
8502 assert(wand->signature == WandSignature);
8503 if (wand->debug != MagickFalse)
8504 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8505 read_info=CloneImageInfo(wand->image_info);
8506 if (filename != (const char *) NULL)
8507 (void) CopyMagickString(read_info->filename,filename,MaxTextExtent);
8508 images=ReadImage(read_info,wand->exception);
8509 read_info=DestroyImageInfo(read_info);
8510 if (images == (Image *) NULL)
8511 return(MagickFalse);
8512 return(InsertImageInWand(wand,images));
8516 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8520 % M a g i c k R e a d I m a g e B l o b %
8524 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8526 % MagickReadImageBlob() reads an image or image sequence from a blob.
8528 % The format of the MagickReadImageBlob method is:
8530 % MagickBooleanType MagickReadImageBlob(MagickWand *wand,
8531 % const void *blob,const size_t length)
8533 % A description of each parameter follows:
8535 % o wand: the magick wand.
8539 % o length: the blob length.
8542 WandExport MagickBooleanType MagickReadImageBlob(MagickWand *wand,
8543 const void *blob,const size_t length)
8548 assert(wand != (MagickWand *) NULL);
8549 assert(wand->signature == WandSignature);
8550 if (wand->debug != MagickFalse)
8551 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8552 images=BlobToImage(wand->image_info,blob,length,wand->exception);
8553 if (images == (Image *) NULL)
8554 return(MagickFalse);
8555 return(InsertImageInWand(wand,images));
8559 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8563 % M a g i c k R e a d I m a g e F i l e %
8567 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8569 % MagickReadImageFile() reads an image or image sequence from an open file
8572 % The format of the MagickReadImageFile method is:
8574 % MagickBooleanType MagickReadImageFile(MagickWand *wand,FILE *file)
8576 % A description of each parameter follows:
8578 % o wand: the magick wand.
8580 % o file: the file descriptor.
8583 WandExport MagickBooleanType MagickReadImageFile(MagickWand *wand,FILE *file)
8591 assert(wand != (MagickWand *) NULL);
8592 assert(wand->signature == WandSignature);
8593 assert(file != (FILE *) NULL);
8594 if (wand->debug != MagickFalse)
8595 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8596 read_info=CloneImageInfo(wand->image_info);
8597 SetImageInfoFile(read_info,file);
8598 images=ReadImage(read_info,wand->exception);
8599 read_info=DestroyImageInfo(read_info);
8600 if (images == (Image *) NULL)
8601 return(MagickFalse);
8602 return(InsertImageInWand(wand,images));
8606 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8610 % M a g i c k R e d u c e N o i s e I m a g e %
8614 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8616 % MagickReduceNoiseImage() smooths the contours of an image while still
8617 % preserving edge information. The algorithm works by replacing each pixel
8618 % with its neighbor closest in value. A neighbor is defined by radius. Use
8619 % a radius of 0 and ReduceNoise() selects a suitable radius for you.
8621 % The format of the MagickReduceNoiseImage method is:
8623 % MagickBooleanType MagickReduceNoiseImage(MagickWand *wand,
8624 % const double radius)
8626 % A description of each parameter follows:
8628 % o wand: the magick wand.
8630 % o radius: the radius of the pixel neighborhood.
8633 WandExport MagickBooleanType MagickReduceNoiseImage(MagickWand *wand,
8634 const double radius)
8639 assert(wand != (MagickWand *) NULL);
8640 assert(wand->signature == WandSignature);
8641 if (wand->debug != MagickFalse)
8642 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8643 if (wand->images == (Image *) NULL)
8644 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8645 noise_image=ReduceNoiseImage(wand->images,radius,wand->exception);
8646 if (noise_image == (Image *) NULL)
8647 return(MagickFalse);
8648 ReplaceImageInList(&wand->images,noise_image);
8653 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8657 % M a g i c k R e m a p I m a g e %
8661 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8663 % MagickRemapImage() replaces the colors of an image with the closest color
8664 % from a reference image.
8666 % The format of the MagickRemapImage method is:
8668 % MagickBooleanType MagickRemapImage(MagickWand *wand,
8669 % const MagickWand *remap_wand,const DitherMethod method)
8671 % A description of each parameter follows:
8673 % o wand: the magick wand.
8675 % o affinity: the affinity wand.
8677 % o method: choose from these dither methods: NoDitherMethod,
8678 % RiemersmaDitherMethod, or FloydSteinbergDitherMethod.
8681 WandExport MagickBooleanType MagickRemapImage(MagickWand *wand,
8682 const MagickWand *remap_wand,const DitherMethod method)
8690 assert(wand != (MagickWand *) NULL);
8691 assert(wand->signature == WandSignature);
8692 if (wand->debug != MagickFalse)
8693 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8694 if ((wand->images == (Image *) NULL) ||
8695 (remap_wand->images == (Image *) NULL))
8696 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8697 quantize_info=AcquireQuantizeInfo(wand->image_info);
8698 quantize_info->dither_method=method;
8699 if (method == NoDitherMethod)
8700 quantize_info->dither=MagickFalse;
8701 status=RemapImage(quantize_info,wand->images,remap_wand->images);
8702 quantize_info=DestroyQuantizeInfo(quantize_info);
8703 if (status == MagickFalse)
8704 InheritException(wand->exception,&wand->images->exception);
8709 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8713 % M a g i c k R e m o v e I m a g e %
8717 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8719 % MagickRemoveImage() removes an image from the image list.
8721 % The format of the MagickRemoveImage method is:
8723 % MagickBooleanType MagickRemoveImage(MagickWand *wand)
8725 % A description of each parameter follows:
8727 % o wand: the magick wand.
8729 % o insert: the splice wand.
8732 WandExport MagickBooleanType MagickRemoveImage(MagickWand *wand)
8734 assert(wand != (MagickWand *) NULL);
8735 assert(wand->signature == WandSignature);
8736 if (wand->debug != MagickFalse)
8737 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8738 if (wand->images == (Image *) NULL)
8739 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8740 DeleteImageFromList(&wand->images);
8745 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8749 % M a g i c k R e s a m p l e I m a g e %
8753 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8755 % MagickResampleImage() resample image to desired resolution.
8757 % Bessel Blackman Box
8758 % Catrom Cubic Gaussian
8759 % Hanning Hermite Lanczos
8760 % Mitchell Point Quandratic
8763 % Most of the filters are FIR (finite impulse response), however, Bessel,
8764 % Gaussian, and Sinc are IIR (infinite impulse response). Bessel and Sinc
8765 % are windowed (brought down to zero) with the Blackman filter.
8767 % The format of the MagickResampleImage method is:
8769 % MagickBooleanType MagickResampleImage(MagickWand *wand,
8770 % const double x_resolution,const double y_resolution,
8771 % const FilterTypes filter,const double blur)
8773 % A description of each parameter follows:
8775 % o wand: the magick wand.
8777 % o x_resolution: the new image x resolution.
8779 % o y_resolution: the new image y resolution.
8781 % o filter: Image filter to use.
8783 % o blur: the blur factor where > 1 is blurry, < 1 is sharp.
8786 WandExport MagickBooleanType MagickResampleImage(MagickWand *wand,
8787 const double x_resolution,const double y_resolution,const FilterTypes filter,
8793 assert(wand != (MagickWand *) NULL);
8794 assert(wand->signature == WandSignature);
8795 if (wand->debug != MagickFalse)
8796 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8797 if (wand->images == (Image *) NULL)
8798 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8799 resample_image=ResampleImage(wand->images,x_resolution,y_resolution,filter,
8800 blur,wand->exception);
8801 if (resample_image == (Image *) NULL)
8802 return(MagickFalse);
8803 ReplaceImageInList(&wand->images,resample_image);
8808 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8812 % M a g i c k R e s e t I m a g e P a g e %
8816 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8818 % MagickResetImagePage() resets the Wand page canvas and position.
8820 % The format of the MagickResetImagePage method is:
8822 % MagickBooleanType MagickResetImagePage(MagickWand *wand,
8825 % A description of each parameter follows:
8827 % o wand: the magick wand.
8829 % o page: the relative page specification.
8832 WandExport MagickBooleanType MagickResetImagePage(MagickWand *wand,
8835 assert(wand != (MagickWand *) NULL);
8836 assert(wand->signature == WandSignature);
8837 if (wand->debug != MagickFalse)
8838 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8839 if (wand->images == (Image *) NULL)
8840 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8841 if ((page == (char *) NULL) || (*page == '\0'))
8843 (void) ParseAbsoluteGeometry("0x0+0+0",&wand->images->page);
8846 return(ResetImagePage(wand->images,page));
8850 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8854 % M a g i c k R e s i z e I m a g e %
8858 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8860 % MagickResizeImage() scales an image to the desired dimensions with one of
8863 % Bessel Blackman Box
8864 % Catrom Cubic Gaussian
8865 % Hanning Hermite Lanczos
8866 % Mitchell Point Quandratic
8869 % Most of the filters are FIR (finite impulse response), however, Bessel,
8870 % Gaussian, and Sinc are IIR (infinite impulse response). Bessel and Sinc
8871 % are windowed (brought down to zero) with the Blackman filter.
8873 % The format of the MagickResizeImage method is:
8875 % MagickBooleanType MagickResizeImage(MagickWand *wand,
8876 % const size_t columns,const size_t rows,
8877 % const FilterTypes filter,const double blur)
8879 % A description of each parameter follows:
8881 % o wand: the magick wand.
8883 % o columns: the number of columns in the scaled image.
8885 % o rows: the number of rows in the scaled image.
8887 % o filter: Image filter to use.
8889 % o blur: the blur factor where > 1 is blurry, < 1 is sharp.
8892 WandExport MagickBooleanType MagickResizeImage(MagickWand *wand,
8893 const size_t columns,const size_t rows,const FilterTypes filter,
8899 assert(wand != (MagickWand *) NULL);
8900 assert(wand->signature == WandSignature);
8901 if (wand->debug != MagickFalse)
8902 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8903 if (wand->images == (Image *) NULL)
8904 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8905 resize_image=ResizeImage(wand->images,columns,rows,filter,blur,
8907 if (resize_image == (Image *) NULL)
8908 return(MagickFalse);
8909 ReplaceImageInList(&wand->images,resize_image);
8914 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8918 % M a g i c k R o l l I m a g e %
8922 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8924 % MagickRollImage() offsets an image as defined by x and y.
8926 % The format of the MagickRollImage method is:
8928 % MagickBooleanType MagickRollImage(MagickWand *wand,const ssize_t x,
8931 % A description of each parameter follows:
8933 % o wand: the magick wand.
8935 % o x: the x offset.
8937 % o y: the y offset.
8941 WandExport MagickBooleanType MagickRollImage(MagickWand *wand,
8942 const ssize_t x,const ssize_t y)
8947 assert(wand != (MagickWand *) NULL);
8948 assert(wand->signature == WandSignature);
8949 if (wand->debug != MagickFalse)
8950 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8951 if (wand->images == (Image *) NULL)
8952 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8953 roll_image=RollImage(wand->images,x,y,wand->exception);
8954 if (roll_image == (Image *) NULL)
8955 return(MagickFalse);
8956 ReplaceImageInList(&wand->images,roll_image);
8961 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8965 % M a g i c k R o t a t e I m a g e %
8969 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8971 % MagickRotateImage() rotates an image the specified number of degrees. Empty
8972 % triangles left over from rotating the image are filled with the
8975 % The format of the MagickRotateImage method is:
8977 % MagickBooleanType MagickRotateImage(MagickWand *wand,
8978 % const PixelWand *background,const double degrees)
8980 % A description of each parameter follows:
8982 % o wand: the magick wand.
8984 % o background: the background pixel wand.
8986 % o degrees: the number of degrees to rotate the image.
8990 WandExport MagickBooleanType MagickRotateImage(MagickWand *wand,
8991 const PixelWand *background,const double degrees)
8996 assert(wand != (MagickWand *) NULL);
8997 assert(wand->signature == WandSignature);
8998 if (wand->debug != MagickFalse)
8999 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9000 if (wand->images == (Image *) NULL)
9001 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9002 PixelGetQuantumColor(background,&wand->images->background_color);
9003 rotate_image=RotateImage(wand->images,degrees,wand->exception);
9004 if (rotate_image == (Image *) NULL)
9005 return(MagickFalse);
9006 ReplaceImageInList(&wand->images,rotate_image);
9011 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9015 % M a g i c k S a m p l e I m a g e %
9019 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9021 % MagickSampleImage() scales an image to the desired dimensions with pixel
9022 % sampling. Unlike other scaling methods, this method does not introduce
9023 % any additional color into the scaled image.
9025 % The format of the MagickSampleImage method is:
9027 % MagickBooleanType MagickSampleImage(MagickWand *wand,
9028 % const size_t columns,const size_t rows)
9030 % A description of each parameter follows:
9032 % o wand: the magick wand.
9034 % o columns: the number of columns in the scaled image.
9036 % o rows: the number of rows in the scaled image.
9040 WandExport MagickBooleanType MagickSampleImage(MagickWand *wand,
9041 const size_t columns,const size_t rows)
9046 assert(wand != (MagickWand *) NULL);
9047 assert(wand->signature == WandSignature);
9048 if (wand->debug != MagickFalse)
9049 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9050 if (wand->images == (Image *) NULL)
9051 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9052 sample_image=SampleImage(wand->images,columns,rows,wand->exception);
9053 if (sample_image == (Image *) NULL)
9054 return(MagickFalse);
9055 ReplaceImageInList(&wand->images,sample_image);
9060 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9064 % M a g i c k S c a l e I m a g e %
9068 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9070 % MagickScaleImage() scales the size of an image to the given dimensions.
9072 % The format of the MagickScaleImage method is:
9074 % MagickBooleanType MagickScaleImage(MagickWand *wand,
9075 % const size_t columns,const size_t rows)
9077 % A description of each parameter follows:
9079 % o wand: the magick wand.
9081 % o columns: the number of columns in the scaled image.
9083 % o rows: the number of rows in the scaled image.
9087 WandExport MagickBooleanType MagickScaleImage(MagickWand *wand,
9088 const size_t columns,const size_t rows)
9093 assert(wand != (MagickWand *) NULL);
9094 assert(wand->signature == WandSignature);
9095 if (wand->debug != MagickFalse)
9096 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9097 if (wand->images == (Image *) NULL)
9098 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9099 scale_image=ScaleImage(wand->images,columns,rows,wand->exception);
9100 if (scale_image == (Image *) NULL)
9101 return(MagickFalse);
9102 ReplaceImageInList(&wand->images,scale_image);
9107 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9111 % M a g i c k S e g m e n t I m a g e %
9115 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9117 % MagickSegmentImage() segments an image by analyzing the histograms of the
9118 % color components and identifying units that are homogeneous with the fuzzy
9119 % C-means technique.
9121 % The format of the SegmentImage method is:
9123 % MagickBooleanType MagickSegmentImage(MagickWand *wand,
9124 % const ColorspaceType colorspace,const MagickBooleanType verbose,
9125 % const double cluster_threshold,const double smooth_threshold)
9127 % A description of each parameter follows.
9131 % o colorspace: the image colorspace.
9133 % o verbose: Set to MagickTrue to print detailed information about the
9134 % identified classes.
9136 % o cluster_threshold: This represents the minimum number of pixels
9137 % contained in a hexahedra before it can be considered valid (expressed as
9140 % o smooth_threshold: the smoothing threshold eliminates noise in the second
9141 % derivative of the histogram. As the value is increased, you can expect a
9142 % smoother second derivative.
9145 MagickExport MagickBooleanType MagickSegmentImage(MagickWand *wand,
9146 const ColorspaceType colorspace,const MagickBooleanType verbose,
9147 const double cluster_threshold,const double smooth_threshold)
9152 assert(wand != (MagickWand *) NULL);
9153 assert(wand->signature == WandSignature);
9154 if (wand->debug != MagickFalse)
9155 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9156 if (wand->images == (Image *) NULL)
9157 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9158 status=SegmentImage(wand->images,colorspace,verbose,cluster_threshold,
9160 if (status == MagickFalse)
9161 InheritException(wand->exception,&wand->images->exception);
9166 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9170 % M a g i c k S e l e c t i v e B l u r I m a g e %
9174 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9176 % MagickSelectiveBlurImage() selectively blur an image within a contrast
9177 % threshold. It is similar to the unsharpen mask that sharpens everything with
9178 % contrast above a certain threshold.
9180 % The format of the MagickSelectiveBlurImage method is:
9182 % MagickBooleanType MagickSelectiveBlurImage(MagickWand *wand,
9183 % const double radius,const double sigma,const double threshold)
9184 % MagickBooleanType MagickSelectiveBlurImageChannel(MagickWand *wand,
9185 % const ChannelType channel,const double radius,const double sigma,
9186 % const double threshold)
9188 % A description of each parameter follows:
9190 % o wand: the magick wand.
9192 % o channel: the image channel(s).
9194 % o radius: the radius of the gaussian, in pixels, not counting the center
9197 % o sigma: the standard deviation of the gaussian, in pixels.
9199 % o threshold: only pixels within this contrast threshold are included
9200 % in the blur operation.
9204 WandExport MagickBooleanType MagickSelectiveBlurImage(MagickWand *wand,
9205 const double radius,const double sigma,const double threshold)
9210 status=MagickSelectiveBlurImageChannel(wand,DefaultChannels,radius,sigma,
9215 WandExport MagickBooleanType MagickSelectiveBlurImageChannel(MagickWand *wand,
9216 const ChannelType channel,const double radius,const double sigma,
9217 const double threshold)
9222 assert(wand != (MagickWand *) NULL);
9223 assert(wand->signature == WandSignature);
9224 if (wand->debug != MagickFalse)
9225 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9226 if (wand->images == (Image *) NULL)
9227 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9228 blur_image=SelectiveBlurImageChannel(wand->images,channel,radius,sigma,
9229 threshold,wand->exception);
9230 if (blur_image == (Image *) NULL)
9231 return(MagickFalse);
9232 ReplaceImageInList(&wand->images,blur_image);
9237 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9241 % 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 %
9245 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9247 % MagickSeparateImageChannel() separates a channel from the image and returns a
9248 % grayscale image. A channel is a particular color component of each pixel
9251 % The format of the MagickSeparateImageChannel method is:
9253 % MagickBooleanType MagickSeparateImageChannel(MagickWand *wand,
9254 % const ChannelType channel)
9256 % A description of each parameter follows:
9258 % o wand: the magick wand.
9260 % o channel: the image channel(s).
9263 WandExport MagickBooleanType MagickSeparateImageChannel(MagickWand *wand,
9264 const ChannelType channel)
9269 assert(wand != (MagickWand *) NULL);
9270 assert(wand->signature == WandSignature);
9271 if (wand->debug != MagickFalse)
9272 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9273 if (wand->images == (Image *) NULL)
9274 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9275 status=SeparateImageChannel(wand->images,channel);
9276 if (status == MagickFalse)
9277 InheritException(wand->exception,&wand->images->exception);
9282 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9286 % M a g i c k S e p i a T o n e I m a g e %
9290 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9292 % MagickSepiaToneImage() applies a special effect to the image, similar to the
9293 % effect achieved in a photo darkroom by sepia toning. Threshold ranges from
9294 % 0 to QuantumRange and is a measure of the extent of the sepia toning. A
9295 % threshold of 80% is a good starting point for a reasonable tone.
9297 % The format of the MagickSepiaToneImage method is:
9299 % MagickBooleanType MagickSepiaToneImage(MagickWand *wand,
9300 % const double threshold)
9302 % A description of each parameter follows:
9304 % o wand: the magick wand.
9306 % o threshold: Define the extent of the sepia toning.
9309 WandExport MagickBooleanType MagickSepiaToneImage(MagickWand *wand,
9310 const double threshold)
9315 assert(wand != (MagickWand *) NULL);
9316 assert(wand->signature == WandSignature);
9317 if (wand->debug != MagickFalse)
9318 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9319 if (wand->images == (Image *) NULL)
9320 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9321 sepia_image=SepiaToneImage(wand->images,threshold,wand->exception);
9322 if (sepia_image == (Image *) NULL)
9323 return(MagickFalse);
9324 ReplaceImageInList(&wand->images,sepia_image);
9329 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9333 % M a g i c k S e t I m a g e %
9337 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9339 % MagickSetImage() replaces the last image returned by MagickSetImageIndex(),
9340 % MagickNextImage(), MagickPreviousImage() with the images from the specified
9343 % The format of the MagickSetImage method is:
9345 % MagickBooleanType MagickSetImage(MagickWand *wand,
9346 % const MagickWand *set_wand)
9348 % A description of each parameter follows:
9350 % o wand: the magick wand.
9352 % o set_wand: the set_wand wand.
9355 WandExport MagickBooleanType MagickSetImage(MagickWand *wand,
9356 const MagickWand *set_wand)
9361 assert(wand != (MagickWand *) NULL);
9362 assert(wand->signature == WandSignature);
9363 if (wand->debug != MagickFalse)
9364 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9365 assert(set_wand != (MagickWand *) NULL);
9366 assert(set_wand->signature == WandSignature);
9367 if (wand->debug != MagickFalse)
9368 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",set_wand->name);
9369 if (set_wand->images == (Image *) NULL)
9370 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9371 images=CloneImageList(set_wand->images,wand->exception);
9372 if (images == (Image *) NULL)
9373 return(MagickFalse);
9374 ReplaceImageInList(&wand->images,images);
9379 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9383 % 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 %
9387 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9389 % MagickSetImageAlphaChannel() activates, deactivates, resets, or sets the
9392 % The format of the MagickSetImageAlphaChannel method is:
9394 % MagickBooleanType MagickSetImageAlphaChannel(MagickWand *wand,
9395 % const AlphaChannelType alpha_type)
9397 % A description of each parameter follows:
9399 % o wand: the magick wand.
9401 % o alpha_type: the alpha channel type: ActivateAlphaChannel,
9402 % DeactivateAlphaChannel, OpaqueAlphaChannel, or SetAlphaChannel.
9405 WandExport MagickBooleanType MagickSetImageAlphaChannel(MagickWand *wand,
9406 const AlphaChannelType alpha_type)
9408 assert(wand != (MagickWand *) NULL);
9409 assert(wand->signature == WandSignature);
9410 if (wand->debug != MagickFalse)
9411 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9412 if (wand->images == (Image *) NULL)
9413 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9414 return(SetImageAlphaChannel(wand->images,alpha_type));
9418 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9422 % 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 %
9426 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9428 % MagickSetImageBackgroundColor() sets the image background color.
9430 % The format of the MagickSetImageBackgroundColor method is:
9432 % MagickBooleanType MagickSetImageBackgroundColor(MagickWand *wand,
9433 % const PixelWand *background)
9435 % A description of each parameter follows:
9437 % o wand: the magick wand.
9439 % o background: the background pixel wand.
9442 WandExport MagickBooleanType MagickSetImageBackgroundColor(MagickWand *wand,
9443 const PixelWand *background)
9445 assert(wand != (MagickWand *) NULL);
9446 assert(wand->signature == WandSignature);
9447 if (wand->debug != MagickFalse)
9448 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9449 if (wand->images == (Image *) NULL)
9450 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9451 PixelGetQuantumColor(background,&wand->images->background_color);
9456 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9460 % M a g i c k S e t I m a g e B i a s %
9464 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9466 % MagickSetImageBias() sets the image bias for any method that convolves an
9467 % image (e.g. MagickConvolveImage()).
9469 % The format of the MagickSetImageBias method is:
9471 % MagickBooleanType MagickSetImageBias(MagickWand *wand,
9472 % const double bias)
9474 % A description of each parameter follows:
9476 % o wand: the magick wand.
9478 % o bias: the image bias.
9481 WandExport MagickBooleanType MagickSetImageBias(MagickWand *wand,
9484 assert(wand != (MagickWand *) NULL);
9485 assert(wand->signature == WandSignature);
9486 if (wand->debug != MagickFalse)
9487 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9488 if (wand->images == (Image *) NULL)
9489 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9490 wand->images->bias=bias;
9495 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9499 % 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 %
9503 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9505 % MagickSetImageBluePrimary() sets the image chromaticity blue primary point.
9507 % The format of the MagickSetImageBluePrimary method is:
9509 % MagickBooleanType MagickSetImageBluePrimary(MagickWand *wand,
9510 % const double x,const double y)
9512 % A description of each parameter follows:
9514 % o wand: the magick wand.
9516 % o x: the blue primary x-point.
9518 % o y: the blue primary y-point.
9521 WandExport MagickBooleanType MagickSetImageBluePrimary(MagickWand *wand,
9522 const double x,const double y)
9524 assert(wand != (MagickWand *) NULL);
9525 assert(wand->signature == WandSignature);
9526 if (wand->debug != MagickFalse)
9527 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9528 if (wand->images == (Image *) NULL)
9529 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9530 wand->images->chromaticity.blue_primary.x=x;
9531 wand->images->chromaticity.blue_primary.y=y;
9536 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9540 % 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 %
9544 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9546 % MagickSetImageBorderColor() sets the image border color.
9548 % The format of the MagickSetImageBorderColor method is:
9550 % MagickBooleanType MagickSetImageBorderColor(MagickWand *wand,
9551 % const PixelWand *border)
9553 % A description of each parameter follows:
9555 % o wand: the magick wand.
9557 % o border: the border pixel wand.
9560 WandExport MagickBooleanType MagickSetImageBorderColor(MagickWand *wand,
9561 const PixelWand *border)
9563 assert(wand != (MagickWand *) NULL);
9564 assert(wand->signature == WandSignature);
9565 if (wand->debug != MagickFalse)
9566 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9567 if (wand->images == (Image *) NULL)
9568 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9569 PixelGetQuantumColor(border,&wand->images->border_color);
9574 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9578 % M a g i c k S e t I m a g e C h a n n e l D e p t h %
9582 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9584 % MagickSetImageChannelDepth() sets the depth of a particular image channel.
9586 % The format of the MagickSetImageChannelDepth method is:
9588 % MagickBooleanType MagickSetImageChannelDepth(MagickWand *wand,
9589 % const ChannelType channel,const size_t depth)
9591 % A description of each parameter follows:
9593 % o wand: the magick wand.
9595 % o channel: the image channel(s).
9597 % o depth: the image depth in bits.
9600 WandExport MagickBooleanType MagickSetImageChannelDepth(MagickWand *wand,
9601 const ChannelType channel,const size_t depth)
9603 assert(wand != (MagickWand *) NULL);
9604 assert(wand->signature == WandSignature);
9605 if (wand->debug != MagickFalse)
9606 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9607 if (wand->images == (Image *) NULL)
9608 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9609 return(SetImageChannelDepth(wand->images,channel,depth));
9613 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9617 % M a g i c k S e t I m a g e C l i p M a s k %
9621 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9623 % MagickSetImageClipMask() sets image clip mask.
9625 % The format of the MagickSetImageClipMask method is:
9627 % MagickBooleanType MagickSetImageClipMask(MagickWand *wand,
9628 % const MagickWand *clip_mask)
9630 % A description of each parameter follows:
9632 % o wand: the magick wand.
9634 % o clip_mask: the clip_mask wand.
9637 WandExport MagickBooleanType MagickSetImageClipMask(MagickWand *wand,
9638 const MagickWand *clip_mask)
9640 assert(wand != (MagickWand *) NULL);
9641 assert(wand->signature == WandSignature);
9642 if (wand->debug != MagickFalse)
9643 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9644 assert(clip_mask != (MagickWand *) NULL);
9645 assert(clip_mask->signature == WandSignature);
9646 if (wand->debug != MagickFalse)
9647 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",clip_mask->name);
9648 if (clip_mask->images == (Image *) NULL)
9649 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9650 return(SetImageClipMask(wand->images,clip_mask->images));
9654 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9658 % M a g i c k S e t I m a g e C o l o r %
9662 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9664 % MagickSetImageColor() set the entire wand canvas to the specified color.
9666 % The format of the MagickSetImageColor method is:
9668 % MagickBooleanType MagickSetImageColor(MagickWand *wand,
9669 % const PixelWand *color)
9671 % A description of each parameter follows:
9673 % o wand: the magick wand.
9675 % o background: the image color.
9678 WandExport MagickBooleanType MagickSetImageColor(MagickWand *wand,
9679 const PixelWand *color)
9687 assert(wand != (MagickWand *) NULL);
9688 assert(wand->signature == WandSignature);
9689 if (wand->debug != MagickFalse)
9690 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9691 PixelGetMagickColor(color,&pixel);
9692 status=SetImageColor(wand->images,&pixel);
9693 if (status == MagickFalse)
9694 InheritException(wand->exception,&wand->images->exception);
9699 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9703 % 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 %
9707 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9709 % MagickSetImageColormapColor() sets the color of the specified colormap
9712 % The format of the MagickSetImageColormapColor method is:
9714 % MagickBooleanType MagickSetImageColormapColor(MagickWand *wand,
9715 % const size_t index,const PixelWand *color)
9717 % A description of each parameter follows:
9719 % o wand: the magick wand.
9721 % o index: the offset into the image colormap.
9723 % o color: Return the colormap color in this wand.
9726 WandExport MagickBooleanType MagickSetImageColormapColor(MagickWand *wand,
9727 const size_t index,const PixelWand *color)
9729 assert(wand != (MagickWand *) NULL);
9730 assert(wand->signature == WandSignature);
9731 if (wand->debug != MagickFalse)
9732 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9733 if (wand->images == (Image *) NULL)
9734 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9735 if ((wand->images->colormap == (PixelPacket *) NULL) ||
9736 (index >= wand->images->colors))
9737 ThrowWandException(WandError,"InvalidColormapIndex",wand->name);
9738 PixelGetQuantumColor(color,wand->images->colormap+index);
9739 return(SyncImage(wand->images));
9743 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9747 % M a g i c k S e t I m a g e C o l o r s p a c e %
9751 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9753 % MagickSetImageColorspace() sets the image colorspace.
9755 % The format of the MagickSetImageColorspace method is:
9757 % MagickBooleanType MagickSetImageColorspace(MagickWand *wand,
9758 % const ColorspaceType colorspace)
9760 % A description of each parameter follows:
9762 % o wand: the magick wand.
9764 % o colorspace: the image colorspace: UndefinedColorspace, RGBColorspace,
9765 % GRAYColorspace, TransparentColorspace, OHTAColorspace, XYZColorspace,
9766 % YCbCrColorspace, YCCColorspace, YIQColorspace, YPbPrColorspace,
9767 % YPbPrColorspace, YUVColorspace, CMYKColorspace, sRGBColorspace,
9768 % HSLColorspace, or HWBColorspace.
9771 WandExport MagickBooleanType MagickSetImageColorspace(MagickWand *wand,
9772 const ColorspaceType colorspace)
9774 assert(wand != (MagickWand *) NULL);
9775 assert(wand->signature == WandSignature);
9776 if (wand->debug != MagickFalse)
9777 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9778 if (wand->images == (Image *) NULL)
9779 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9780 return(SetImageColorspace(wand->images,colorspace));
9784 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9788 % M a g i c k S e t I m a g e C o m p o s e %
9792 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9794 % MagickSetImageCompose() sets the image composite operator, useful for
9795 % specifying how to composite the image thumbnail when using the
9796 % MagickMontageImage() method.
9798 % The format of the MagickSetImageCompose method is:
9800 % MagickBooleanType MagickSetImageCompose(MagickWand *wand,
9801 % const CompositeOperator compose)
9803 % A description of each parameter follows:
9805 % o wand: the magick wand.
9807 % o compose: the image composite operator.
9810 WandExport MagickBooleanType MagickSetImageCompose(MagickWand *wand,
9811 const CompositeOperator compose)
9813 assert(wand != (MagickWand *) NULL);
9814 assert(wand->signature == WandSignature);
9815 if (wand->debug != MagickFalse)
9816 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9817 if (wand->images == (Image *) NULL)
9818 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9819 wand->images->compose=compose;
9824 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9828 % 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 %
9832 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9834 % MagickSetImageCompression() sets the image compression.
9836 % The format of the MagickSetImageCompression method is:
9838 % MagickBooleanType MagickSetImageCompression(MagickWand *wand,
9839 % const CompressionType compression)
9841 % A description of each parameter follows:
9843 % o wand: the magick wand.
9845 % o compression: the image compression type.
9848 WandExport MagickBooleanType MagickSetImageCompression(MagickWand *wand,
9849 const CompressionType compression)
9851 assert(wand != (MagickWand *) NULL);
9852 assert(wand->signature == WandSignature);
9853 if (wand->debug != MagickFalse)
9854 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9855 if (wand->images == (Image *) NULL)
9856 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9857 wand->images->compression=compression;
9862 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9866 % 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 %
9870 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9872 % MagickSetImageCompressionQuality() sets the image compression quality.
9874 % The format of the MagickSetImageCompressionQuality method is:
9876 % MagickBooleanType MagickSetImageCompressionQuality(MagickWand *wand,
9877 % const size_t quality)
9879 % A description of each parameter follows:
9881 % o wand: the magick wand.
9883 % o quality: the image compression tlityype.
9886 WandExport MagickBooleanType MagickSetImageCompressionQuality(MagickWand *wand,
9887 const size_t quality)
9889 assert(wand != (MagickWand *) NULL);
9890 assert(wand->signature == WandSignature);
9891 if (wand->debug != MagickFalse)
9892 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9893 if (wand->images == (Image *) NULL)
9894 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9895 wand->images->quality=quality;
9900 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9904 % M a g i c k S e t I m a g e D e l a y %
9908 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9910 % MagickSetImageDelay() sets the image delay.
9912 % The format of the MagickSetImageDelay method is:
9914 % MagickBooleanType MagickSetImageDelay(MagickWand *wand,
9915 % const size_t delay)
9917 % A description of each parameter follows:
9919 % o wand: the magick wand.
9921 % o delay: the image delay in ticks-per-second units.
9924 WandExport MagickBooleanType MagickSetImageDelay(MagickWand *wand,
9927 assert(wand != (MagickWand *) NULL);
9928 assert(wand->signature == WandSignature);
9929 if (wand->debug != MagickFalse)
9930 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9931 if (wand->images == (Image *) NULL)
9932 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9933 wand->images->delay=delay;
9938 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9942 % M a g i c k S e t I m a g e D e p t h %
9946 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9948 % MagickSetImageDepth() sets the image depth.
9950 % The format of the MagickSetImageDepth method is:
9952 % MagickBooleanType MagickSetImageDepth(MagickWand *wand,
9953 % const size_t depth)
9955 % A description of each parameter follows:
9957 % o wand: the magick wand.
9959 % o depth: the image depth in bits: 8, 16, or 32.
9962 WandExport MagickBooleanType MagickSetImageDepth(MagickWand *wand,
9965 assert(wand != (MagickWand *) NULL);
9966 assert(wand->signature == WandSignature);
9967 if (wand->debug != MagickFalse)
9968 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9969 if (wand->images == (Image *) NULL)
9970 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9971 wand->images->depth=depth;
9976 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9980 % M a g i c k S e t I m a g e D i s p o s e %
9984 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9986 % MagickSetImageDispose() sets the image disposal method.
9988 % The format of the MagickSetImageDispose method is:
9990 % MagickBooleanType MagickSetImageDispose(MagickWand *wand,
9991 % const DisposeType dispose)
9993 % A description of each parameter follows:
9995 % o wand: the magick wand.
9997 % o dispose: the image disposeal type.
10000 WandExport MagickBooleanType MagickSetImageDispose(MagickWand *wand,
10001 const DisposeType dispose)
10003 assert(wand != (MagickWand *) NULL);
10004 assert(wand->signature == WandSignature);
10005 if (wand->debug != MagickFalse)
10006 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10007 if (wand->images == (Image *) NULL)
10008 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10009 wand->images->dispose=dispose;
10010 return(MagickTrue);
10014 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10018 % M a g i c k S e t I m a g e E x t e n t %
10022 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10024 % MagickSetImageExtent() sets the image size (i.e. columns & rows).
10026 % The format of the MagickSetImageExtent method is:
10028 % MagickBooleanType MagickSetImageExtent(MagickWand *wand,
10029 % const size_t columns,const unsigned rows)
10031 % A description of each parameter follows:
10033 % o wand: the magick wand.
10035 % o columns: The image width in pixels.
10037 % o rows: The image height in pixels.
10040 WandExport MagickBooleanType MagickSetImageExtent(MagickWand *wand,
10041 const size_t columns,const size_t rows)
10043 assert(wand != (MagickWand *) NULL);
10044 assert(wand->signature == WandSignature);
10045 if (wand->debug != MagickFalse)
10046 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10047 if (wand->images == (Image *) NULL)
10048 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10049 return(SetImageExtent(wand->images,columns,rows));
10053 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10057 % M a g i c k S e t I m a g e F i l e n a m e %
10061 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10063 % MagickSetImageFilename() sets the filename of a particular image in a
10066 % The format of the MagickSetImageFilename method is:
10068 % MagickBooleanType MagickSetImageFilename(MagickWand *wand,
10069 % const char *filename)
10071 % A description of each parameter follows:
10073 % o wand: the magick wand.
10075 % o filename: the image filename.
10078 WandExport MagickBooleanType MagickSetImageFilename(MagickWand *wand,
10079 const char *filename)
10081 assert(wand != (MagickWand *) NULL);
10082 assert(wand->signature == WandSignature);
10083 if (wand->debug != MagickFalse)
10084 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10085 if (wand->images == (Image *) NULL)
10086 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10087 if (filename != (const char *) NULL)
10088 (void) CopyMagickString(wand->images->filename,filename,MaxTextExtent);
10089 return(MagickTrue);
10093 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10097 % M a g i c k S e t I m a g e F o r m a t %
10101 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10103 % MagickSetImageFormat() sets the format of a particular image in a
10106 % The format of the MagickSetImageFormat method is:
10108 % MagickBooleanType MagickSetImageFormat(MagickWand *wand,
10109 % const char *format)
10111 % A description of each parameter follows:
10113 % o wand: the magick wand.
10115 % o format: the image format.
10118 WandExport MagickBooleanType MagickSetImageFormat(MagickWand *wand,
10119 const char *format)
10124 assert(wand != (MagickWand *) NULL);
10125 assert(wand->signature == WandSignature);
10126 if (wand->debug != MagickFalse)
10127 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10128 if (wand->images == (Image *) NULL)
10129 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10130 if ((format == (char *) NULL) || (*format == '\0'))
10132 *wand->images->magick='\0';
10133 return(MagickTrue);
10135 magick_info=GetMagickInfo(format,wand->exception);
10136 if (magick_info == (const MagickInfo *) NULL)
10137 return(MagickFalse);
10138 ClearMagickException(wand->exception);
10139 (void) CopyMagickString(wand->images->magick,format,MaxTextExtent);
10140 return(MagickTrue);
10144 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10148 % M a g i c k S e t I m a g e F u z z %
10152 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10154 % MagickSetImageFuzz() sets the image fuzz.
10156 % The format of the MagickSetImageFuzz method is:
10158 % MagickBooleanType MagickSetImageFuzz(MagickWand *wand,
10159 % const double fuzz)
10161 % A description of each parameter follows:
10163 % o wand: the magick wand.
10165 % o fuzz: the image fuzz.
10168 WandExport MagickBooleanType MagickSetImageFuzz(MagickWand *wand,
10171 assert(wand != (MagickWand *) NULL);
10172 assert(wand->signature == WandSignature);
10173 if (wand->debug != MagickFalse)
10174 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10175 if (wand->images == (Image *) NULL)
10176 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10177 wand->images->fuzz=fuzz;
10178 return(MagickTrue);
10182 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10186 % M a g i c k S e t I m a g e G a m m a %
10190 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10192 % MagickSetImageGamma() sets the image gamma.
10194 % The format of the MagickSetImageGamma method is:
10196 % MagickBooleanType MagickSetImageGamma(MagickWand *wand,
10197 % const double gamma)
10199 % A description of each parameter follows:
10201 % o wand: the magick wand.
10203 % o gamma: the image gamma.
10206 WandExport MagickBooleanType MagickSetImageGamma(MagickWand *wand,
10207 const double gamma)
10209 assert(wand != (MagickWand *) NULL);
10210 assert(wand->signature == WandSignature);
10211 if (wand->debug != MagickFalse)
10212 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10213 if (wand->images == (Image *) NULL)
10214 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10215 wand->images->gamma=gamma;
10216 return(MagickTrue);
10220 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10224 % M a g i c k S e t I m a g e G r a v i t y %
10228 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10230 % MagickSetImageGravity() sets the image gravity type.
10232 % The format of the MagickSetImageGravity method is:
10234 % MagickBooleanType MagickSetImageGravity(MagickWand *wand,
10235 % const GravityType gravity)
10237 % A description of each parameter follows:
10239 % o wand: the magick wand.
10241 % o gravity: the image interlace scheme: NoInterlace, LineInterlace,
10242 % PlaneInterlace, PartitionInterlace.
10245 WandExport MagickBooleanType MagickSetImageGravity(MagickWand *wand,
10246 const GravityType gravity)
10248 assert(wand != (MagickWand *) NULL);
10249 assert(wand->signature == WandSignature);
10250 if (wand->debug != MagickFalse)
10251 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10252 if (wand->images == (Image *) NULL)
10253 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10254 wand->images->gravity=gravity;
10255 return(MagickTrue);
10259 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10263 % 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 %
10267 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10269 % MagickSetImageGreenPrimary() sets the image chromaticity green primary
10272 % The format of the MagickSetImageGreenPrimary method is:
10274 % MagickBooleanType MagickSetImageGreenPrimary(MagickWand *wand,
10275 % const double x,const double y)
10277 % A description of each parameter follows:
10279 % o wand: the magick wand.
10281 % o x: the green primary x-point.
10283 % o y: the green primary y-point.
10287 WandExport MagickBooleanType MagickSetImageGreenPrimary(MagickWand *wand,
10288 const double x,const double y)
10290 assert(wand != (MagickWand *) NULL);
10291 assert(wand->signature == WandSignature);
10292 if (wand->debug != MagickFalse)
10293 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10294 if (wand->images == (Image *) NULL)
10295 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10296 wand->images->chromaticity.green_primary.x=x;
10297 wand->images->chromaticity.green_primary.y=y;
10298 return(MagickTrue);
10302 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10306 % 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 %
10310 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10312 % MagickSetImageInterlaceScheme() sets the image interlace scheme.
10314 % The format of the MagickSetImageInterlaceScheme method is:
10316 % MagickBooleanType MagickSetImageInterlaceScheme(MagickWand *wand,
10317 % const InterlaceType interlace)
10319 % A description of each parameter follows:
10321 % o wand: the magick wand.
10323 % o interlace: the image interlace scheme: NoInterlace, LineInterlace,
10324 % PlaneInterlace, PartitionInterlace.
10327 WandExport MagickBooleanType MagickSetImageInterlaceScheme(MagickWand *wand,
10328 const InterlaceType interlace)
10330 assert(wand != (MagickWand *) NULL);
10331 assert(wand->signature == WandSignature);
10332 if (wand->debug != MagickFalse)
10333 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10334 if (wand->images == (Image *) NULL)
10335 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10336 wand->images->interlace=interlace;
10337 return(MagickTrue);
10341 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10345 % 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 %
10349 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10351 % MagickSetImageInterpolateMethod() sets the image interpolate pixel method.
10353 % The format of the MagickSetImageInterpolateMethod method is:
10355 % MagickBooleanType MagickSetImageInterpolateMethod(MagickWand *wand,
10356 % const InterpolatePixelMethod method)
10358 % A description of each parameter follows:
10360 % o wand: the magick wand.
10362 % o method: the image interpole pixel methods: choose from Undefined,
10363 % Average, Bicubic, Bilinear, Filter, Integer, Mesh, NearestNeighbor.
10366 WandExport MagickBooleanType MagickSetImageInterpolateMethod(MagickWand *wand,
10367 const InterpolatePixelMethod method)
10369 assert(wand != (MagickWand *) NULL);
10370 assert(wand->signature == WandSignature);
10371 if (wand->debug != MagickFalse)
10372 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10373 if (wand->images == (Image *) NULL)
10374 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10375 wand->images->interpolate=method;
10376 return(MagickTrue);
10380 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10384 % M a g i c k S e t I m a g e I t e r a t i o n s %
10388 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10390 % MagickSetImageIterations() sets the image iterations.
10392 % The format of the MagickSetImageIterations method is:
10394 % MagickBooleanType MagickSetImageIterations(MagickWand *wand,
10395 % const size_t iterations)
10397 % A description of each parameter follows:
10399 % o wand: the magick wand.
10401 % o delay: the image delay in 1/100th of a second.
10404 WandExport MagickBooleanType MagickSetImageIterations(MagickWand *wand,
10405 const size_t iterations)
10407 assert(wand != (MagickWand *) NULL);
10408 assert(wand->signature == WandSignature);
10409 if (wand->debug != MagickFalse)
10410 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10411 if (wand->images == (Image *) NULL)
10412 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10413 wand->images->iterations=iterations;
10414 return(MagickTrue);
10418 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10422 % M a g i c k S e t I m a g e M a t t e %
10426 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10428 % MagickSetImageMatte() sets the image matte channel.
10430 % The format of the MagickSetImageMatteColor method is:
10432 % MagickBooleanType MagickSetImageMatteColor(MagickWand *wand,
10433 % const MagickBooleanType *matte)
10435 % A description of each parameter follows:
10437 % o wand: the magick wand.
10439 % o matte: Set to MagickTrue to enable the image matte channel otherwise
10443 WandExport MagickBooleanType MagickSetImageMatte(MagickWand *wand,
10444 const MagickBooleanType matte)
10446 assert(wand != (MagickWand *) NULL);
10447 assert(wand->signature == WandSignature);
10448 if (wand->debug != MagickFalse)
10449 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10450 if (wand->images == (Image *) NULL)
10451 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10452 if ((wand->images->matte == MagickFalse) && (matte != MagickFalse))
10453 (void) SetImageOpacity(wand->images,OpaqueOpacity);
10454 wand->images->matte=matte;
10455 return(MagickTrue);
10459 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10463 % M a g i c k S e t I m a g e M a t t e C o l o r %
10467 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10469 % MagickSetImageMatteColor() sets the image matte color.
10471 % The format of the MagickSetImageMatteColor method is:
10473 % MagickBooleanType MagickSetImageMatteColor(MagickWand *wand,
10474 % const PixelWand *matte)
10476 % A description of each parameter follows:
10478 % o wand: the magick wand.
10480 % o matte: the matte pixel wand.
10483 WandExport MagickBooleanType MagickSetImageMatteColor(MagickWand *wand,
10484 const PixelWand *matte)
10486 assert(wand != (MagickWand *) NULL);
10487 assert(wand->signature == WandSignature);
10488 if (wand->debug != MagickFalse)
10489 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10490 if (wand->images == (Image *) NULL)
10491 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10492 PixelGetQuantumColor(matte,&wand->images->matte_color);
10493 return(MagickTrue);
10497 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10501 % M a g i c k S e t I m a g e O p a c i t y %
10505 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10507 % MagickSetImageOpacity() sets the image to the specified opacity level.
10509 % The format of the MagickSetImageOpacity method is:
10511 % MagickBooleanType MagickSetImageOpacity(MagickWand *wand,
10512 % const double alpha)
10514 % A description of each parameter follows:
10516 % o wand: the magick wand.
10518 % o alpha: the level of transparency: 1.0 is fully opaque and 0.0 is fully
10522 WandExport MagickBooleanType MagickSetImageOpacity(MagickWand *wand,
10523 const double alpha)
10528 assert(wand != (MagickWand *) NULL);
10529 assert(wand->signature == WandSignature);
10530 if (wand->debug != MagickFalse)
10531 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10532 if (wand->images == (Image *) NULL)
10533 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10534 status=SetImageOpacity(wand->images,ClampToQuantum((MagickRealType)
10535 QuantumRange-QuantumRange*alpha));
10536 if (status == MagickFalse)
10537 InheritException(wand->exception,&wand->images->exception);
10542 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10546 % 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 %
10550 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10552 % MagickSetImageOrientation() sets the image orientation.
10554 % The format of the MagickSetImageOrientation method is:
10556 % MagickBooleanType MagickSetImageOrientation(MagickWand *wand,
10557 % const OrientationType orientation)
10559 % A description of each parameter follows:
10561 % o wand: the magick wand.
10563 % o orientation: the image orientation type.
10566 WandExport MagickBooleanType MagickSetImageOrientation(MagickWand *wand,
10567 const OrientationType orientation)
10569 assert(wand != (MagickWand *) NULL);
10570 assert(wand->signature == WandSignature);
10571 if (wand->debug != MagickFalse)
10572 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10573 if (wand->images == (Image *) NULL)
10574 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10575 wand->images->orientation=orientation;
10576 return(MagickTrue);
10580 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10584 % M a g i c k S e t I m a g e P a g e %
10588 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10590 % MagickSetImagePage() sets the page geometry of the image.
10592 % The format of the MagickSetImagePage method is:
10594 % MagickBooleanType MagickSetImagePage(MagickWand *wand,
10595 % const size_t width,const size_t height,const ssize_t x,
10598 % A description of each parameter follows:
10600 % o wand: the magick wand.
10602 % o width: the page width.
10604 % o height: the page height.
10606 % o x: the page x-offset.
10608 % o y: the page y-offset.
10611 WandExport MagickBooleanType MagickSetImagePage(MagickWand *wand,
10612 const size_t width,const size_t height,const ssize_t x,
10615 assert(wand != (MagickWand *) NULL);
10616 assert(wand->signature == WandSignature);
10617 if (wand->debug != MagickFalse)
10618 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10619 if (wand->images == (Image *) NULL)
10620 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10621 wand->images->page.width=width;
10622 wand->images->page.height=height;
10623 wand->images->page.x=x;
10624 wand->images->page.y=y;
10625 return(MagickTrue);
10629 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10633 % 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 %
10637 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10639 % MagickSetImageProgressMonitor() sets the wand image progress monitor to the
10640 % specified method and returns the previous progress monitor if any. The
10641 % progress monitor method looks like this:
10643 % MagickBooleanType MagickProgressMonitor(const char *text,
10644 % const MagickOffsetType offset,const MagickSizeType span,
10645 % void *client_data)
10647 % If the progress monitor returns MagickFalse, the current operation is
10650 % The format of the MagickSetImageProgressMonitor method is:
10652 % MagickProgressMonitor MagickSetImageProgressMonitor(MagickWand *wand
10653 % const MagickProgressMonitor progress_monitor,void *client_data)
10655 % A description of each parameter follows:
10657 % o wand: the magick wand.
10659 % o progress_monitor: Specifies a pointer to a method to monitor progress
10660 % of an image operation.
10662 % o client_data: Specifies a pointer to any client data.
10665 WandExport MagickProgressMonitor MagickSetImageProgressMonitor(MagickWand *wand,
10666 const MagickProgressMonitor progress_monitor,void *client_data)
10668 MagickProgressMonitor
10671 assert(wand != (MagickWand *) NULL);
10672 assert(wand->signature == WandSignature);
10673 if (wand->debug != MagickFalse)
10674 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10675 if (wand->images == (Image *) NULL)
10677 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
10678 "ContainsNoImages","`%s'",wand->name);
10679 return((MagickProgressMonitor) NULL);
10681 previous_monitor=SetImageProgressMonitor(wand->images,
10682 progress_monitor,client_data);
10683 return(previous_monitor);
10687 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10691 % M a g i c k S e t I m a g e R e d P r i m a r y %
10695 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10697 % MagickSetImageRedPrimary() sets the image chromaticity red primary point.
10699 % The format of the MagickSetImageRedPrimary method is:
10701 % MagickBooleanType MagickSetImageRedPrimary(MagickWand *wand,
10702 % const double x,const double y)
10704 % A description of each parameter follows:
10706 % o wand: the magick wand.
10708 % o x: the red primary x-point.
10710 % o y: the red primary y-point.
10713 WandExport MagickBooleanType MagickSetImageRedPrimary(MagickWand *wand,
10714 const double x,const double y)
10716 assert(wand != (MagickWand *) NULL);
10717 assert(wand->signature == WandSignature);
10718 if (wand->debug != MagickFalse)
10719 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10720 if (wand->images == (Image *) NULL)
10721 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10722 wand->images->chromaticity.red_primary.x=x;
10723 wand->images->chromaticity.red_primary.y=y;
10724 return(MagickTrue);
10728 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10732 % 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 %
10736 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10738 % MagickSetImageRenderingIntent() sets the image rendering intent.
10740 % The format of the MagickSetImageRenderingIntent method is:
10742 % MagickBooleanType MagickSetImageRenderingIntent(MagickWand *wand,
10743 % const RenderingIntent rendering_intent)
10745 % A description of each parameter follows:
10747 % o wand: the magick wand.
10749 % o rendering_intent: the image rendering intent: UndefinedIntent,
10750 % SaturationIntent, PerceptualIntent, AbsoluteIntent, or RelativeIntent.
10753 WandExport MagickBooleanType MagickSetImageRenderingIntent(MagickWand *wand,
10754 const RenderingIntent rendering_intent)
10756 assert(wand != (MagickWand *) NULL);
10757 assert(wand->signature == WandSignature);
10758 if (wand->debug != MagickFalse)
10759 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10760 if (wand->images == (Image *) NULL)
10761 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10762 wand->images->rendering_intent=rendering_intent;
10763 return(MagickTrue);
10767 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10771 % M a g i c k S e t I m a g e R e s o l u t i o n %
10775 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10777 % MagickSetImageResolution() sets the image resolution.
10779 % The format of the MagickSetImageResolution method is:
10781 % MagickBooleanType MagickSetImageResolution(MagickWand *wand,
10782 % const double x_resolution,const doubtl y_resolution)
10784 % A description of each parameter follows:
10786 % o wand: the magick wand.
10788 % o x_resolution: the image x resolution.
10790 % o y_resolution: the image y resolution.
10793 WandExport MagickBooleanType MagickSetImageResolution(MagickWand *wand,
10794 const double x_resolution,const double y_resolution)
10796 assert(wand != (MagickWand *) NULL);
10797 assert(wand->signature == WandSignature);
10798 if (wand->debug != MagickFalse)
10799 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10800 if (wand->images == (Image *) NULL)
10801 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10802 wand->images->x_resolution=x_resolution;
10803 wand->images->y_resolution=y_resolution;
10804 return(MagickTrue);
10808 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10812 % M a g i c k S e t I m a g e S c e n e %
10816 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10818 % MagickSetImageScene() sets the image scene.
10820 % The format of the MagickSetImageScene method is:
10822 % MagickBooleanType MagickSetImageScene(MagickWand *wand,
10823 % const size_t scene)
10825 % A description of each parameter follows:
10827 % o wand: the magick wand.
10829 % o delay: the image scene number.
10832 WandExport MagickBooleanType MagickSetImageScene(MagickWand *wand,
10833 const size_t scene)
10835 assert(wand != (MagickWand *) NULL);
10836 assert(wand->signature == WandSignature);
10837 if (wand->debug != MagickFalse)
10838 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10839 if (wand->images == (Image *) NULL)
10840 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10841 wand->images->scene=scene;
10842 return(MagickTrue);
10846 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10850 % 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 %
10854 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10856 % MagickSetImageTicksPerSecond() sets the image ticks-per-second.
10858 % The format of the MagickSetImageTicksPerSecond method is:
10860 % MagickBooleanType MagickSetImageTicksPerSecond(MagickWand *wand,
10861 % const ssize_t ticks_per-second)
10863 % A description of each parameter follows:
10865 % o wand: the magick wand.
10867 % o ticks_per_second: the units to use for the image delay.
10870 WandExport MagickBooleanType MagickSetImageTicksPerSecond(MagickWand *wand,
10871 const ssize_t ticks_per_second)
10873 assert(wand != (MagickWand *) NULL);
10874 assert(wand->signature == WandSignature);
10875 if (wand->debug != MagickFalse)
10876 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10877 if (wand->images == (Image *) NULL)
10878 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10879 wand->images->ticks_per_second=ticks_per_second;
10880 return(MagickTrue);
10884 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10888 % M a g i c k S e t I m a g e T y p e %
10892 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10894 % MagickSetImageType() sets the image type.
10896 % The format of the MagickSetImageType method is:
10898 % MagickBooleanType MagickSetImageType(MagickWand *wand,
10899 % const ImageType image_type)
10901 % A description of each parameter follows:
10903 % o wand: the magick wand.
10905 % o image_type: the image type: UndefinedType, BilevelType, GrayscaleType,
10906 % GrayscaleMatteType, PaletteType, PaletteMatteType, TrueColorType,
10907 % TrueColorMatteType, ColorSeparationType, ColorSeparationMatteType,
10911 WandExport MagickBooleanType MagickSetImageType(MagickWand *wand,
10912 const ImageType image_type)
10914 assert(wand != (MagickWand *) NULL);
10915 assert(wand->signature == WandSignature);
10916 if (wand->debug != MagickFalse)
10917 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10918 if (wand->images == (Image *) NULL)
10919 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10920 return(SetImageType(wand->images,image_type));
10924 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10928 % M a g i c k S e t I m a g e U n i t s %
10932 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10934 % MagickSetImageUnits() sets the image units of resolution.
10936 % The format of the MagickSetImageUnits method is:
10938 % MagickBooleanType MagickSetImageUnits(MagickWand *wand,
10939 % const ResolutionType units)
10941 % A description of each parameter follows:
10943 % o wand: the magick wand.
10945 % o units: the image units of resolution : UndefinedResolution,
10946 % PixelsPerInchResolution, or PixelsPerCentimeterResolution.
10949 WandExport MagickBooleanType MagickSetImageUnits(MagickWand *wand,
10950 const ResolutionType units)
10952 assert(wand != (MagickWand *) NULL);
10953 assert(wand->signature == WandSignature);
10954 if (wand->debug != MagickFalse)
10955 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10956 if (wand->images == (Image *) NULL)
10957 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10958 wand->images->units=units;
10959 return(MagickTrue);
10963 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10967 % 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 %
10971 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10973 % MagickSetImageVirtualPixelMethod() sets the image virtual pixel method.
10975 % The format of the MagickSetImageVirtualPixelMethod method is:
10977 % VirtualPixelMethod MagickSetImageVirtualPixelMethod(MagickWand *wand,
10978 % const VirtualPixelMethod method)
10980 % A description of each parameter follows:
10982 % o wand: the magick wand.
10984 % o method: the image virtual pixel method : UndefinedVirtualPixelMethod,
10985 % ConstantVirtualPixelMethod, EdgeVirtualPixelMethod,
10986 % MirrorVirtualPixelMethod, or TileVirtualPixelMethod.
10989 WandExport VirtualPixelMethod MagickSetImageVirtualPixelMethod(MagickWand *wand,
10990 const VirtualPixelMethod method)
10992 assert(wand != (MagickWand *) NULL);
10993 assert(wand->signature == WandSignature);
10994 if (wand->debug != MagickFalse)
10995 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10996 if (wand->images == (Image *) NULL)
10997 return(UndefinedVirtualPixelMethod);
10998 return(SetImageVirtualPixelMethod(wand->images,method));
11002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11006 % M a g i c k S e t I m a g e W h i t e P o i n t %
11010 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11012 % MagickSetImageWhitePoint() sets the image chromaticity white point.
11014 % The format of the MagickSetImageWhitePoint method is:
11016 % MagickBooleanType MagickSetImageWhitePoint(MagickWand *wand,
11017 % const double x,const double y)
11019 % A description of each parameter follows:
11021 % o wand: the magick wand.
11023 % o x: the white x-point.
11025 % o y: the white y-point.
11028 WandExport MagickBooleanType MagickSetImageWhitePoint(MagickWand *wand,
11029 const double x,const double y)
11031 assert(wand != (MagickWand *) NULL);
11032 assert(wand->signature == WandSignature);
11033 if (wand->debug != MagickFalse)
11034 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11035 if (wand->images == (Image *) NULL)
11036 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11037 wand->images->chromaticity.white_point.x=x;
11038 wand->images->chromaticity.white_point.y=y;
11039 return(MagickTrue);
11043 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11047 % M a g i c k S h a d e I m a g e C h a n n e l %
11051 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11053 % MagickShadeImage() shines a distant light on an image to create a
11054 % three-dimensional effect. You control the positioning of the light with
11055 % azimuth and elevation; azimuth is measured in degrees off the x axis
11056 % and elevation is measured in pixels above the Z axis.
11058 % The format of the MagickShadeImage method is:
11060 % MagickBooleanType MagickShadeImage(MagickWand *wand,
11061 % const MagickBooleanType gray,const double azimuth,
11062 % const double elevation)
11064 % A description of each parameter follows:
11066 % o wand: the magick wand.
11068 % o gray: A value other than zero shades the intensity of each pixel.
11070 % o azimuth, elevation: Define the light source direction.
11073 WandExport MagickBooleanType MagickShadeImage(MagickWand *wand,
11074 const MagickBooleanType gray,const double asimuth,const double elevation)
11079 assert(wand != (MagickWand *) NULL);
11080 assert(wand->signature == WandSignature);
11081 if (wand->debug != MagickFalse)
11082 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11083 if (wand->images == (Image *) NULL)
11084 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11085 shade_image=ShadeImage(wand->images,gray,asimuth,elevation,wand->exception);
11086 if (shade_image == (Image *) NULL)
11087 return(MagickFalse);
11088 ReplaceImageInList(&wand->images,shade_image);
11089 return(MagickTrue);
11093 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11097 % M a g i c k S h a d o w I m a g e %
11101 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11103 % MagickShadowImage() simulates an image shadow.
11105 % The format of the MagickShadowImage method is:
11107 % MagickBooleanType MagickShadowImage(MagickWand *wand,
11108 % const double opacity,const double sigma,const ssize_t x,const ssize_t y)
11110 % A description of each parameter follows:
11112 % o wand: the magick wand.
11114 % o opacity: percentage transparency.
11116 % o sigma: the standard deviation of the Gaussian, in pixels.
11118 % o x: the shadow x-offset.
11120 % o y: the shadow y-offset.
11123 WandExport MagickBooleanType MagickShadowImage(MagickWand *wand,
11124 const double opacity,const double sigma,const ssize_t x,const ssize_t y)
11129 assert(wand != (MagickWand *) NULL);
11130 assert(wand->signature == WandSignature);
11131 if (wand->debug != MagickFalse)
11132 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11133 if (wand->images == (Image *) NULL)
11134 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11135 shadow_image=ShadowImage(wand->images,opacity,sigma,x,y,wand->exception);
11136 if (shadow_image == (Image *) NULL)
11137 return(MagickFalse);
11138 ReplaceImageInList(&wand->images,shadow_image);
11139 return(MagickTrue);
11143 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11147 % M a g i c k S h a r p e n I m a g e %
11151 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11153 % MagickSharpenImage() sharpens an image. We convolve the image with a
11154 % Gaussian operator of the given radius and standard deviation (sigma).
11155 % For reasonable results, the radius should be larger than sigma. Use a
11156 % radius of 0 and MagickSharpenImage() selects a suitable radius for you.
11158 % The format of the MagickSharpenImage method is:
11160 % MagickBooleanType MagickSharpenImage(MagickWand *wand,
11161 % const double radius,const double sigma)
11162 % MagickBooleanType MagickSharpenImageChannel(MagickWand *wand,
11163 % const ChannelType channel,const double radius,const double sigma)
11165 % A description of each parameter follows:
11167 % o wand: the magick wand.
11169 % o channel: the image channel(s).
11171 % o radius: the radius of the Gaussian, in pixels, not counting the center
11174 % o sigma: the standard deviation of the Gaussian, in pixels.
11178 WandExport MagickBooleanType MagickSharpenImage(MagickWand *wand,
11179 const double radius,const double sigma)
11184 status=MagickSharpenImageChannel(wand,DefaultChannels,radius,sigma);
11188 WandExport MagickBooleanType MagickSharpenImageChannel(MagickWand *wand,
11189 const ChannelType channel,const double radius,const double sigma)
11194 assert(wand != (MagickWand *) NULL);
11195 assert(wand->signature == WandSignature);
11196 if (wand->debug != MagickFalse)
11197 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11198 if (wand->images == (Image *) NULL)
11199 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11200 sharp_image=SharpenImageChannel(wand->images,channel,radius,sigma,
11202 if (sharp_image == (Image *) NULL)
11203 return(MagickFalse);
11204 ReplaceImageInList(&wand->images,sharp_image);
11205 return(MagickTrue);
11209 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11213 % M a g i c k S h a v e I m a g e %
11217 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11219 % MagickShaveImage() shaves pixels from the image edges. It allocates the
11220 % memory necessary for the new Image structure and returns a pointer to the
11223 % The format of the MagickShaveImage method is:
11225 % MagickBooleanType MagickShaveImage(MagickWand *wand,
11226 % const size_t columns,const size_t rows)
11228 % A description of each parameter follows:
11230 % o wand: the magick wand.
11232 % o columns: the number of columns in the scaled image.
11234 % o rows: the number of rows in the scaled image.
11238 WandExport MagickBooleanType MagickShaveImage(MagickWand *wand,
11239 const size_t columns,const size_t rows)
11247 assert(wand != (MagickWand *) NULL);
11248 assert(wand->signature == WandSignature);
11249 if (wand->debug != MagickFalse)
11250 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11251 if (wand->images == (Image *) NULL)
11252 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11253 shave_info.width=columns;
11254 shave_info.height=rows;
11257 shave_image=ShaveImage(wand->images,&shave_info,wand->exception);
11258 if (shave_image == (Image *) NULL)
11259 return(MagickFalse);
11260 ReplaceImageInList(&wand->images,shave_image);
11261 return(MagickTrue);
11265 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11269 % M a g i c k S h e a r I m a g e %
11273 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11275 % MagickShearImage() slides one edge of an image along the X or Y axis,
11276 % creating a parallelogram. An X direction shear slides an edge along the X
11277 % axis, while a Y direction shear slides an edge along the Y axis. The amount
11278 % of the shear is controlled by a shear angle. For X direction shears, x_shear
11279 % is measured relative to the Y axis, and similarly, for Y direction shears
11280 % y_shear is measured relative to the X axis. Empty triangles left over from
11281 % shearing the image are filled with the background color.
11283 % The format of the MagickShearImage method is:
11285 % MagickBooleanType MagickShearImage(MagickWand *wand,
11286 % const PixelWand *background,const double x_shear,onst double y_shear)
11288 % A description of each parameter follows:
11290 % o wand: the magick wand.
11292 % o background: the background pixel wand.
11294 % o x_shear: the number of degrees to shear the image.
11296 % o y_shear: the number of degrees to shear the image.
11299 WandExport MagickBooleanType MagickShearImage(MagickWand *wand,
11300 const PixelWand *background,const double x_shear,const double y_shear)
11305 assert(wand != (MagickWand *) NULL);
11306 assert(wand->signature == WandSignature);
11307 if (wand->debug != MagickFalse)
11308 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11309 if (wand->images == (Image *) NULL)
11310 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11311 PixelGetQuantumColor(background,&wand->images->background_color);
11312 shear_image=ShearImage(wand->images,x_shear,y_shear,wand->exception);
11313 if (shear_image == (Image *) NULL)
11314 return(MagickFalse);
11315 ReplaceImageInList(&wand->images,shear_image);
11316 return(MagickTrue);
11320 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11324 % 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 %
11328 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11330 % MagickSigmoidalContrastImage() adjusts the contrast of an image with a
11331 % non-linear sigmoidal contrast algorithm. Increase the contrast of the
11332 % image using a sigmoidal transfer function without saturating highlights or
11333 % shadows. Contrast indicates how much to increase the contrast (0 is none;
11334 % 3 is typical; 20 is pushing it); mid-point indicates where midtones fall in
11335 % the resultant image (0 is white; 50% is middle-gray; 100% is black). Set
11336 % sharpen to MagickTrue to increase the image contrast otherwise the contrast
11339 % The format of the MagickSigmoidalContrastImage method is:
11341 % MagickBooleanType MagickSigmoidalContrastImage(MagickWand *wand,
11342 % const MagickBooleanType sharpen,const double alpha,const double beta)
11343 % MagickBooleanType MagickSigmoidalContrastImageChannel(MagickWand *wand,
11344 % const ChannelType channel,const MagickBooleanType sharpen,
11345 % const double alpha,const double beta)
11347 % A description of each parameter follows:
11349 % o wand: the magick wand.
11351 % o channel: Identify which channel to level: RedChannel, GreenChannel,
11353 % o sharpen: Increase or decrease image contrast.
11355 % o alpha: strength of the contrast, the larger the number the more
11356 % 'threshold-like' it becomes.
11358 % o beta: midpoint of the function as a color value 0 to QuantumRange.
11362 WandExport MagickBooleanType MagickSigmoidalContrastImage(MagickWand *wand,
11363 const MagickBooleanType sharpen,const double alpha,const double beta)
11368 status=MagickSigmoidalContrastImageChannel(wand,DefaultChannels,sharpen,
11373 WandExport MagickBooleanType MagickSigmoidalContrastImageChannel(
11374 MagickWand *wand,const ChannelType channel,const MagickBooleanType sharpen,
11375 const double alpha,const double beta)
11380 assert(wand != (MagickWand *) NULL);
11381 assert(wand->signature == WandSignature);
11382 if (wand->debug != MagickFalse)
11383 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11384 if (wand->images == (Image *) NULL)
11385 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11386 status=SigmoidalContrastImageChannel(wand->images,channel,sharpen,alpha,beta);
11387 if (status == MagickFalse)
11388 InheritException(wand->exception,&wand->images->exception);
11393 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11397 % M a g i c k S i m i l a r i t y I m a g e %
11401 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11403 % MagickSimilarityImage() compares the reference image of the image and
11404 % returns the best match offset. In addition, it returns a similarity image
11405 % such that an exact match location is completely white and if none of the
11406 % pixels match, black, otherwise some gray level in-between.
11408 % The format of the MagickSimilarityImage method is:
11410 % MagickWand *MagickSimilarityImage(MagickWand *wand,
11411 % const MagickWand *reference,RectangeInfo *offset,double *similarity)
11413 % A description of each parameter follows:
11415 % o wand: the magick wand.
11417 % o reference: the reference wand.
11419 % o offset: the best match offset of the reference image within the image.
11421 % o similarity: the computed similarity between the images.
11424 WandExport MagickWand *MagickSimilarityImage(MagickWand *wand,
11425 const MagickWand *reference,RectangleInfo *offset,double *similarity)
11430 assert(wand != (MagickWand *) NULL);
11431 assert(wand->signature == WandSignature);
11432 if (wand->debug != MagickFalse)
11433 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11434 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
11436 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
11437 "ContainsNoImages","`%s'",wand->name);
11438 return((MagickWand *) NULL);
11440 similarity_image=SimilarityImage(wand->images,reference->images,offset,
11441 similarity,&wand->images->exception);
11442 if (similarity_image == (Image *) NULL)
11443 return((MagickWand *) NULL);
11444 return(CloneMagickWandFromImages(wand,similarity_image));
11448 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11452 % M a g i c k S k e t c h I m a g e %
11456 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11458 % MagickSketchImage() simulates a pencil sketch. We convolve the image with
11459 % a Gaussian operator of the given radius and standard deviation (sigma).
11460 % For reasonable results, radius should be larger than sigma. Use a
11461 % radius of 0 and SketchImage() selects a suitable radius for you.
11462 % Angle gives the angle of the blurring motion.
11464 % The format of the MagickSketchImage method is:
11466 % MagickBooleanType MagickSketchImage(MagickWand *wand,
11467 % const double radius,const double sigma,const double angle)
11469 % A description of each parameter follows:
11471 % o wand: the magick wand.
11473 % o radius: the radius of the Gaussian, in pixels, not counting
11474 % the center pixel.
11476 % o sigma: the standard deviation of the Gaussian, in pixels.
11478 % o angle: Apply the effect along this angle.
11481 WandExport MagickBooleanType MagickSketchImage(MagickWand *wand,
11482 const double radius,const double sigma,const double angle)
11487 assert(wand != (MagickWand *) NULL);
11488 assert(wand->signature == WandSignature);
11489 if (wand->debug != MagickFalse)
11490 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11491 if (wand->images == (Image *) NULL)
11492 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11493 sketch_image=SketchImage(wand->images,radius,sigma,angle,wand->exception);
11494 if (sketch_image == (Image *) NULL)
11495 return(MagickFalse);
11496 ReplaceImageInList(&wand->images,sketch_image);
11497 return(MagickTrue);
11501 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11505 % M a g i c k S o l a r i z e I m a g e %
11509 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11511 % MagickSolarizeImage() applies a special effect to the image, similar to the
11512 % effect achieved in a photo darkroom by selectively exposing areas of photo
11513 % sensitive paper to light. Threshold ranges from 0 to QuantumRange and is a
11514 % measure of the extent of the solarization.
11516 % The format of the MagickSolarizeImage method is:
11518 % MagickBooleanType MagickSolarizeImage(MagickWand *wand,
11519 % const double threshold)
11521 % A description of each parameter follows:
11523 % o wand: the magick wand.
11525 % o threshold: Define the extent of the solarization.
11528 WandExport MagickBooleanType MagickSolarizeImage(MagickWand *wand,
11529 const double threshold)
11534 assert(wand != (MagickWand *) NULL);
11535 assert(wand->signature == WandSignature);
11536 if (wand->debug != MagickFalse)
11537 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11538 if (wand->images == (Image *) NULL)
11539 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11540 status=SolarizeImage(wand->images,threshold);
11541 if (status == MagickFalse)
11542 InheritException(wand->exception,&wand->images->exception);
11547 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11551 % M a g i c k S p a r s e C o l o r I m a g e %
11555 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11557 % MagickSparseColorImage(), given a set of coordinates, interpolates the
11558 % colors found at those coordinates, across the whole image, using various
11561 % The format of the MagickSparseColorImage method is:
11563 % MagickBooleanType MagickSparseColorImage(MagickWand *wand,
11564 % const ChannelType channel,const SparseColorMethod method,
11565 % const size_t number_arguments,const double *arguments)
11567 % A description of each parameter follows:
11569 % o image: the image to be sparseed.
11571 % o method: the method of image sparseion.
11573 % ArcSparseColorion will always ignore source image offset, and always
11574 % 'bestfit' the destination image with the top left corner offset
11575 % relative to the polar mapping center.
11577 % Bilinear has no simple inverse mapping so will not allow 'bestfit'
11578 % style of image sparseion.
11580 % Affine, Perspective, and Bilinear, will do least squares fitting of
11581 % the distrotion when more than the minimum number of control point
11582 % pairs are provided.
11584 % Perspective, and Bilinear, will fall back to a Affine sparseion when
11585 % less than 4 control point pairs are provided. While Affine sparseions
11586 % will let you use any number of control point pairs, that is Zero pairs
11587 % is a No-Op (viewport only) distrotion, one pair is a translation and
11588 % two pairs of control points will do a scale-rotate-translate, without
11591 % o number_arguments: the number of arguments given for this sparseion
11594 % o arguments: the arguments for this sparseion method.
11597 WandExport MagickBooleanType MagickSparseColorImage(MagickWand *wand,
11598 const ChannelType channel,const SparseColorMethod method,
11599 const size_t number_arguments,const double *arguments)
11604 assert(wand != (MagickWand *) NULL);
11605 assert(wand->signature == WandSignature);
11606 if (wand->debug != MagickFalse)
11607 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11608 if (wand->images == (Image *) NULL)
11609 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11610 sparse_image=SparseColorImage(wand->images,channel,method,number_arguments,
11611 arguments,wand->exception);
11612 if (sparse_image == (Image *) NULL)
11613 return(MagickFalse);
11614 ReplaceImageInList(&wand->images,sparse_image);
11615 return(MagickTrue);
11619 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11623 % M a g i c k S p l i c e I m a g e %
11627 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11629 % MagickSpliceImage() splices a solid color into the image.
11631 % The format of the MagickSpliceImage method is:
11633 % MagickBooleanType MagickSpliceImage(MagickWand *wand,
11634 % const size_t width,const size_t height,const ssize_t x,
11637 % A description of each parameter follows:
11639 % o wand: the magick wand.
11641 % o width: the region width.
11643 % o height: the region height.
11645 % o x: the region x offset.
11647 % o y: the region y offset.
11650 WandExport MagickBooleanType MagickSpliceImage(MagickWand *wand,
11651 const size_t width,const size_t height,const ssize_t x,
11660 assert(wand != (MagickWand *) NULL);
11661 assert(wand->signature == WandSignature);
11662 if (wand->debug != MagickFalse)
11663 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11664 if (wand->images == (Image *) NULL)
11665 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11666 splice.width=width;
11667 splice.height=height;
11670 splice_image=SpliceImage(wand->images,&splice,wand->exception);
11671 if (splice_image == (Image *) NULL)
11672 return(MagickFalse);
11673 ReplaceImageInList(&wand->images,splice_image);
11674 return(MagickTrue);
11678 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11682 % M a g i c k S p r e a d I m a g e %
11686 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11688 % MagickSpreadImage() is a special effects method that randomly displaces each
11689 % pixel in a block defined by the radius parameter.
11691 % The format of the MagickSpreadImage method is:
11693 % MagickBooleanType MagickSpreadImage(MagickWand *wand,const double radius)
11695 % A description of each parameter follows:
11697 % o wand: the magick wand.
11699 % o radius: Choose a random pixel in a neighborhood of this extent.
11702 WandExport MagickBooleanType MagickSpreadImage(MagickWand *wand,
11703 const double radius)
11708 assert(wand != (MagickWand *) NULL);
11709 assert(wand->signature == WandSignature);
11710 if (wand->debug != MagickFalse)
11711 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11712 if (wand->images == (Image *) NULL)
11713 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11714 spread_image=SpreadImage(wand->images,radius,wand->exception);
11715 if (spread_image == (Image *) NULL)
11716 return(MagickFalse);
11717 ReplaceImageInList(&wand->images,spread_image);
11718 return(MagickTrue);
11722 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11726 % M a g i c k S t e g a n o I m a g e %
11730 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11732 % MagickSteganoImage() hides a digital watermark within the image.
11733 % Recover the hidden watermark later to prove that the authenticity of
11734 % an image. Offset defines the start position within the image to hide
11737 % The format of the MagickSteganoImage method is:
11739 % MagickWand *MagickSteganoImage(MagickWand *wand,
11740 % const MagickWand *watermark_wand,const ssize_t offset)
11742 % A description of each parameter follows:
11744 % o wand: the magick wand.
11746 % o watermark_wand: the watermark wand.
11748 % o offset: Start hiding at this offset into the image.
11751 WandExport MagickWand *MagickSteganoImage(MagickWand *wand,
11752 const MagickWand *watermark_wand,const ssize_t offset)
11757 assert(wand != (MagickWand *) NULL);
11758 assert(wand->signature == WandSignature);
11759 if (wand->debug != MagickFalse)
11760 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11761 if ((wand->images == (Image *) NULL) ||
11762 (watermark_wand->images == (Image *) NULL))
11764 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
11765 "ContainsNoImages","`%s'",wand->name);
11766 return((MagickWand *) NULL);
11768 wand->images->offset=offset;
11769 stegano_image=SteganoImage(wand->images,watermark_wand->images,
11771 if (stegano_image == (Image *) NULL)
11772 return((MagickWand *) NULL);
11773 return(CloneMagickWandFromImages(wand,stegano_image));
11777 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11781 % M a g i c k S t e r e o I m a g e %
11785 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11787 % MagickStereoImage() composites two images and produces a single image that
11788 % is the composite of a left and right image of a stereo pair
11790 % The format of the MagickStereoImage method is:
11792 % MagickWand *MagickStereoImage(MagickWand *wand,
11793 % const MagickWand *offset_wand)
11795 % A description of each parameter follows:
11797 % o wand: the magick wand.
11799 % o offset_wand: Another image wand.
11802 WandExport MagickWand *MagickStereoImage(MagickWand *wand,
11803 const MagickWand *offset_wand)
11808 assert(wand != (MagickWand *) NULL);
11809 assert(wand->signature == WandSignature);
11810 if (wand->debug != MagickFalse)
11811 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11812 if ((wand->images == (Image *) NULL) ||
11813 (offset_wand->images == (Image *) NULL))
11815 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
11816 "ContainsNoImages","`%s'",wand->name);
11817 return((MagickWand *) NULL);
11819 stereo_image=StereoImage(wand->images,offset_wand->images,wand->exception);
11820 if (stereo_image == (Image *) NULL)
11821 return((MagickWand *) NULL);
11822 return(CloneMagickWandFromImages(wand,stereo_image));
11826 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11830 % M a g i c k S t r i p I m a g e %
11834 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11836 % MagickStripImage() strips an image of all profiles and comments.
11838 % The format of the MagickStripImage method is:
11840 % MagickBooleanType MagickStripImage(MagickWand *wand)
11842 % A description of each parameter follows:
11844 % o wand: the magick wand.
11847 WandExport MagickBooleanType MagickStripImage(MagickWand *wand)
11852 assert(wand != (MagickWand *) NULL);
11853 assert(wand->signature == WandSignature);
11854 if (wand->debug != MagickFalse)
11855 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11856 if (wand->images == (Image *) NULL)
11857 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11858 status=StripImage(wand->images);
11859 if (status == MagickFalse)
11860 InheritException(wand->exception,&wand->images->exception);
11865 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11869 % M a g i c k S w i r l I m a g e %
11873 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11875 % MagickSwirlImage() swirls the pixels about the center of the image, where
11876 % degrees indicates the sweep of the arc through which each pixel is moved.
11877 % You get a more dramatic effect as the degrees move from 1 to 360.
11879 % The format of the MagickSwirlImage method is:
11881 % MagickBooleanType MagickSwirlImage(MagickWand *wand,const double degrees)
11883 % A description of each parameter follows:
11885 % o wand: the magick wand.
11887 % o degrees: Define the tightness of the swirling effect.
11890 WandExport MagickBooleanType MagickSwirlImage(MagickWand *wand,
11891 const double degrees)
11896 assert(wand != (MagickWand *) NULL);
11897 assert(wand->signature == WandSignature);
11898 if (wand->debug != MagickFalse)
11899 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11900 if (wand->images == (Image *) NULL)
11901 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11902 swirl_image=SwirlImage(wand->images,degrees,wand->exception);
11903 if (swirl_image == (Image *) NULL)
11904 return(MagickFalse);
11905 ReplaceImageInList(&wand->images,swirl_image);
11906 return(MagickTrue);
11910 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11914 % M a g i c k T e x t u r e I m a g e %
11918 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11920 % MagickTextureImage() repeatedly tiles the texture image across and down the
11923 % The format of the MagickTextureImage method is:
11925 % MagickWand *MagickTextureImage(MagickWand *wand,
11926 % const MagickWand *texture_wand)
11928 % A description of each parameter follows:
11930 % o wand: the magick wand.
11932 % o texture_wand: the texture wand
11935 WandExport MagickWand *MagickTextureImage(MagickWand *wand,
11936 const MagickWand *texture_wand)
11944 assert(wand != (MagickWand *) NULL);
11945 assert(wand->signature == WandSignature);
11946 if (wand->debug != MagickFalse)
11947 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11948 if ((wand->images == (Image *) NULL) ||
11949 (texture_wand->images == (Image *) NULL))
11951 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
11952 "ContainsNoImages","`%s'",wand->name);
11953 return((MagickWand *) NULL);
11955 texture_image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
11956 if (texture_image == (Image *) NULL)
11957 return((MagickWand *) NULL);
11958 status=TextureImage(texture_image,texture_wand->images);
11959 if (status == MagickFalse)
11961 InheritException(wand->exception,&texture_image->exception);
11962 texture_image=DestroyImage(texture_image);
11963 return((MagickWand *) NULL);
11965 return(CloneMagickWandFromImages(wand,texture_image));
11969 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11973 % M a g i c k T h r e s h o l d I m a g e %
11977 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11979 % MagickThresholdImage() changes the value of individual pixels based on
11980 % the intensity of each pixel compared to threshold. The result is a
11981 % high-contrast, two color image.
11983 % The format of the MagickThresholdImage method is:
11985 % MagickBooleanType MagickThresholdImage(MagickWand *wand,
11986 % const double threshold)
11987 % MagickBooleanType MagickThresholdImageChannel(MagickWand *wand,
11988 % const ChannelType channel,const double threshold)
11990 % A description of each parameter follows:
11992 % o wand: the magick wand.
11994 % o channel: the image channel(s).
11996 % o threshold: Define the threshold value.
11999 WandExport MagickBooleanType MagickThresholdImage(MagickWand *wand,
12000 const double threshold)
12005 status=MagickThresholdImageChannel(wand,DefaultChannels,threshold);
12009 WandExport MagickBooleanType MagickThresholdImageChannel(MagickWand *wand,
12010 const ChannelType channel,const double threshold)
12015 assert(wand != (MagickWand *) NULL);
12016 assert(wand->signature == WandSignature);
12017 if (wand->debug != MagickFalse)
12018 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12019 if (wand->images == (Image *) NULL)
12020 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12021 status=BilevelImageChannel(wand->images,channel,threshold);
12022 if (status == MagickFalse)
12023 InheritException(wand->exception,&wand->images->exception);
12028 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12032 % M a g i c k T h u m b n a i l I m a g e %
12036 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12038 % MagickThumbnailImage() changes the size of an image to the given dimensions
12039 % and removes any associated profiles. The goal is to produce small low cost
12040 % thumbnail images suited for display on the Web.
12042 % The format of the MagickThumbnailImage method is:
12044 % MagickBooleanType MagickThumbnailImage(MagickWand *wand,
12045 % const size_t columns,const size_t rows)
12047 % A description of each parameter follows:
12049 % o wand: the magick wand.
12051 % o columns: the number of columns in the scaled image.
12053 % o rows: the number of rows in the scaled image.
12056 WandExport MagickBooleanType MagickThumbnailImage(MagickWand *wand,
12057 const size_t columns,const size_t rows)
12062 assert(wand != (MagickWand *) NULL);
12063 assert(wand->signature == WandSignature);
12064 if (wand->debug != MagickFalse)
12065 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12066 if (wand->images == (Image *) NULL)
12067 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12068 thumbnail_image=ThumbnailImage(wand->images,columns,rows,wand->exception);
12069 if (thumbnail_image == (Image *) NULL)
12070 return(MagickFalse);
12071 ReplaceImageInList(&wand->images,thumbnail_image);
12072 return(MagickTrue);
12076 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12080 % M a g i c k T i n t I m a g e %
12084 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12086 % MagickTintImage() applies a color vector to each pixel in the image. The
12087 % length of the vector is 0 for black and white and at its maximum for the
12088 % midtones. The vector weighting function is
12089 % f(x)=(1-(4.0*((x-0.5)*(x-0.5)))).
12091 % The format of the MagickTintImage method is:
12093 % MagickBooleanType MagickTintImage(MagickWand *wand,
12094 % const PixelWand *tint,const PixelWand *opacity)
12096 % A description of each parameter follows:
12098 % o wand: the magick wand.
12100 % o tint: the tint pixel wand.
12102 % o opacity: the opacity pixel wand.
12105 WandExport MagickBooleanType MagickTintImage(MagickWand *wand,
12106 const PixelWand *tint,const PixelWand *opacity)
12109 percent_opaque[MaxTextExtent];
12117 assert(wand != (MagickWand *) NULL);
12118 assert(wand->signature == WandSignature);
12119 if (wand->debug != MagickFalse)
12120 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12121 if (wand->images == (Image *) NULL)
12122 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12123 (void) FormatMagickString(percent_opaque,MaxTextExtent,
12124 "%g,%g,%g,%g",(double) (100.0*QuantumScale*
12125 PixelGetRedQuantum(opacity)),(double) (100.0*QuantumScale*
12126 PixelGetGreenQuantum(opacity)),(double) (100.0*QuantumScale*
12127 PixelGetBlueQuantum(opacity)),(double) (100.0*QuantumScale*
12128 PixelGetOpacityQuantum(opacity)));
12129 PixelGetQuantumColor(tint,&target);
12130 tint_image=TintImage(wand->images,percent_opaque,target,wand->exception);
12131 if (tint_image == (Image *) NULL)
12132 return(MagickFalse);
12133 ReplaceImageInList(&wand->images,tint_image);
12134 return(MagickTrue);
12138 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12142 % M a g i c k T r a n s f o r m I m a g e %
12146 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12148 % MagickTransformImage() is a convenience method that behaves like
12149 % MagickResizeImage() or MagickCropImage() but accepts scaling and/or cropping
12150 % information as a region geometry specification. If the operation fails,
12151 % a NULL image handle is returned.
12153 % The format of the MagickTransformImage method is:
12155 % MagickWand *MagickTransformImage(MagickWand *wand,const char *crop,
12156 % const char *geometry)
12158 % A description of each parameter follows:
12160 % o wand: the magick wand.
12162 % o crop: A crop geometry string. This geometry defines a subregion of the
12165 % o geometry: An image geometry string. This geometry defines the final
12166 % size of the image.
12169 WandExport MagickWand *MagickTransformImage(MagickWand *wand,
12170 const char *crop,const char *geometry)
12178 assert(wand != (MagickWand *) NULL);
12179 assert(wand->signature == WandSignature);
12180 if (wand->debug != MagickFalse)
12181 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12182 if (wand->images == (Image *) NULL)
12183 return((MagickWand *) NULL);
12184 transform_image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
12185 if (transform_image == (Image *) NULL)
12186 return((MagickWand *) NULL);
12187 status=TransformImage(&transform_image,crop,geometry);
12188 if (status == MagickFalse)
12190 InheritException(wand->exception,&transform_image->exception);
12191 transform_image=DestroyImage(transform_image);
12192 return((MagickWand *) NULL);
12194 return(CloneMagickWandFromImages(wand,transform_image));
12198 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12202 % 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 %
12206 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12208 % MagickTransformImageColorspace() transform the image colorspace.
12210 % The format of the MagickTransformImageColorspace method is:
12212 % MagickBooleanType MagickTransformImageColorspace(MagickWand *wand,
12213 % const ColorspaceType colorspace)
12215 % A description of each parameter follows:
12217 % o wand: the magick wand.
12219 % o colorspace: the image colorspace: UndefinedColorspace, RGBColorspace,
12220 % GRAYColorspace, TransparentColorspace, OHTAColorspace, XYZColorspace,
12221 % YCbCrColorspace, YCCColorspace, YIQColorspace, YPbPrColorspace,
12222 % YPbPrColorspace, YUVColorspace, CMYKColorspace, sRGBColorspace,
12223 % HSLColorspace, or HWBColorspace.
12226 WandExport MagickBooleanType MagickTransformImageColorspace(MagickWand *wand,
12227 const ColorspaceType colorspace)
12229 assert(wand != (MagickWand *) NULL);
12230 assert(wand->signature == WandSignature);
12231 if (wand->debug != MagickFalse)
12232 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12233 if (wand->images == (Image *) NULL)
12234 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12235 return(TransformImageColorspace(wand->images,colorspace));
12239 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12243 % 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 %
12247 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12249 % MagickTransparentPaintImage() changes any pixel that matches color with the
12250 % color defined by fill.
12252 % The format of the MagickTransparentPaintImage method is:
12254 % MagickBooleanType MagickTransparentPaintImage(MagickWand *wand,
12255 % const PixelWand *target,const double alpha,const double fuzz,
12256 % const MagickBooleanType invert)
12258 % A description of each parameter follows:
12260 % o wand: the magick wand.
12262 % o target: Change this target color to specified opacity value within
12265 % o alpha: the level of transparency: 1.0 is fully opaque and 0.0 is fully
12268 % o fuzz: By default target must match a particular pixel color
12269 % exactly. However, in many cases two colors may differ by a small amount.
12270 % The fuzz member of image defines how much tolerance is acceptable to
12271 % consider two colors as the same. For example, set fuzz to 10 and the
12272 % color red at intensities of 100 and 102 respectively are now interpreted
12273 % as the same color for the purposes of the floodfill.
12275 % o invert: paint any pixel that does not match the target color.
12278 WandExport MagickBooleanType MagickTransparentPaintImage(MagickWand *wand,
12279 const PixelWand *target,const double alpha,const double fuzz,
12280 const MagickBooleanType invert)
12288 assert(wand != (MagickWand *) NULL);
12289 assert(wand->signature == WandSignature);
12290 if (wand->debug != MagickFalse)
12291 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12292 if (wand->images == (Image *) NULL)
12293 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12294 PixelGetMagickColor(target,&target_pixel);
12295 wand->images->fuzz=fuzz;
12296 status=TransparentPaintImage(wand->images,&target_pixel,ClampToQuantum(
12297 (MagickRealType) QuantumRange-QuantumRange*alpha),invert);
12298 if (status == MagickFalse)
12299 InheritException(wand->exception,&wand->images->exception);
12304 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12308 % M a g i c k T r a n s p o s e I m a g e %
12312 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12314 % MagickTransposeImage() creates a vertical mirror image by reflecting the
12315 % pixels around the central x-axis while rotating them 90-degrees.
12317 % The format of the MagickTransposeImage method is:
12319 % MagickBooleanType MagickTransposeImage(MagickWand *wand)
12321 % A description of each parameter follows:
12323 % o wand: the magick wand.
12326 WandExport MagickBooleanType MagickTransposeImage(MagickWand *wand)
12331 assert(wand != (MagickWand *) NULL);
12332 assert(wand->signature == WandSignature);
12333 if (wand->debug != MagickFalse)
12334 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12335 if (wand->images == (Image *) NULL)
12336 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12337 transpose_image=TransposeImage(wand->images,wand->exception);
12338 if (transpose_image == (Image *) NULL)
12339 return(MagickFalse);
12340 ReplaceImageInList(&wand->images,transpose_image);
12341 return(MagickTrue);
12345 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12349 % M a g i c k T r a n s v e r s e I m a g e %
12353 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12355 % MagickTransverseImage() creates a horizontal mirror image by reflecting the
12356 % pixels around the central y-axis while rotating them 270-degrees.
12358 % The format of the MagickTransverseImage method is:
12360 % MagickBooleanType MagickTransverseImage(MagickWand *wand)
12362 % A description of each parameter follows:
12364 % o wand: the magick wand.
12367 WandExport MagickBooleanType MagickTransverseImage(MagickWand *wand)
12372 assert(wand != (MagickWand *) NULL);
12373 assert(wand->signature == WandSignature);
12374 if (wand->debug != MagickFalse)
12375 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12376 if (wand->images == (Image *) NULL)
12377 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12378 transverse_image=TransverseImage(wand->images,wand->exception);
12379 if (transverse_image == (Image *) NULL)
12380 return(MagickFalse);
12381 ReplaceImageInList(&wand->images,transverse_image);
12382 return(MagickTrue);
12386 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12390 % M a g i c k T r i m I m a g e %
12394 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12396 % MagickTrimImage() remove edges that are the background color from the image.
12398 % The format of the MagickTrimImage method is:
12400 % MagickBooleanType MagickTrimImage(MagickWand *wand,const double fuzz)
12402 % A description of each parameter follows:
12404 % o wand: the magick wand.
12406 % o fuzz: By default target must match a particular pixel color
12407 % exactly. However, in many cases two colors may differ by a small amount.
12408 % The fuzz member of image defines how much tolerance is acceptable to
12409 % consider two colors as the same. For example, set fuzz to 10 and the
12410 % color red at intensities of 100 and 102 respectively are now interpreted
12411 % as the same color for the purposes of the floodfill.
12414 WandExport MagickBooleanType MagickTrimImage(MagickWand *wand,const double fuzz)
12419 assert(wand != (MagickWand *) NULL);
12420 assert(wand->signature == WandSignature);
12421 if (wand->debug != MagickFalse)
12422 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12423 if (wand->images == (Image *) NULL)
12424 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12425 wand->images->fuzz=fuzz;
12426 trim_image=TrimImage(wand->images,wand->exception);
12427 if (trim_image == (Image *) NULL)
12428 return(MagickFalse);
12429 ReplaceImageInList(&wand->images,trim_image);
12430 return(MagickTrue);
12434 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12438 % M a g i c k U n i q u e I m a g e C o l o r s %
12442 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12444 % MagickUniqueImageColors() discards all but one of any pixel color.
12446 % The format of the MagickUniqueImageColors method is:
12448 % MagickBooleanType MagickUniqueImageColors(MagickWand *wand)
12450 % A description of each parameter follows:
12452 % o wand: the magick wand.
12455 WandExport MagickBooleanType MagickUniqueImageColors(MagickWand *wand)
12460 assert(wand != (MagickWand *) NULL);
12461 assert(wand->signature == WandSignature);
12462 if (wand->debug != MagickFalse)
12463 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12464 if (wand->images == (Image *) NULL)
12465 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12466 unique_image=UniqueImageColors(wand->images,wand->exception);
12467 if (unique_image == (Image *) NULL)
12468 return(MagickFalse);
12469 ReplaceImageInList(&wand->images,unique_image);
12470 return(MagickTrue);
12474 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12478 % M a g i c k U n s h a r p M a s k I m a g e %
12482 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12484 % MagickUnsharpMaskImage() sharpens an image. We convolve the image with a
12485 % Gaussian operator of the given radius and standard deviation (sigma).
12486 % For reasonable results, radius should be larger than sigma. Use a radius
12487 % of 0 and UnsharpMaskImage() selects a suitable radius for you.
12489 % The format of the MagickUnsharpMaskImage method is:
12491 % MagickBooleanType MagickUnsharpMaskImage(MagickWand *wand,
12492 % const double radius,const double sigma,const double amount,
12493 % const double threshold)
12494 % MagickBooleanType MagickUnsharpMaskImageChannel(MagickWand *wand,
12495 % const ChannelType channel,const double radius,const double sigma,
12496 % const double amount,const double threshold)
12498 % A description of each parameter follows:
12500 % o wand: the magick wand.
12502 % o channel: the image channel(s).
12504 % o radius: the radius of the Gaussian, in pixels, not counting the center
12507 % o sigma: the standard deviation of the Gaussian, in pixels.
12509 % o amount: the percentage of the difference between the original and the
12510 % blur image that is added back into the original.
12512 % o threshold: the threshold in pixels needed to apply the diffence amount.
12516 WandExport MagickBooleanType MagickUnsharpMaskImage(MagickWand *wand,
12517 const double radius,const double sigma,const double amount,
12518 const double threshold)
12523 status=MagickUnsharpMaskImageChannel(wand,DefaultChannels,radius,sigma,
12528 WandExport MagickBooleanType MagickUnsharpMaskImageChannel(MagickWand *wand,
12529 const ChannelType channel,const double radius,const double sigma,
12530 const double amount,const double threshold)
12535 assert(wand != (MagickWand *) NULL);
12536 assert(wand->signature == WandSignature);
12537 if (wand->debug != MagickFalse)
12538 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12539 if (wand->images == (Image *) NULL)
12540 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12541 unsharp_image=UnsharpMaskImageChannel(wand->images,channel,radius,sigma,
12542 amount,threshold,wand->exception);
12543 if (unsharp_image == (Image *) NULL)
12544 return(MagickFalse);
12545 ReplaceImageInList(&wand->images,unsharp_image);
12546 return(MagickTrue);
12550 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12554 % M a g i c k V i g n e t t e I m a g e %
12558 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12560 % MagickVignetteImage() softens the edges of the image in vignette style.
12562 % The format of the MagickVignetteImage method is:
12564 % MagickBooleanType MagickVignetteImage(MagickWand *wand,
12565 % const double black_point,const double white_point,const ssize_t x,
12568 % A description of each parameter follows:
12570 % o wand: the magick wand.
12572 % o black_point: the black point.
12574 % o white_point: the white point.
12576 % o x, y: Define the x and y ellipse offset.
12579 WandExport MagickBooleanType MagickVignetteImage(MagickWand *wand,
12580 const double black_point,const double white_point,const ssize_t x,const ssize_t y)
12585 assert(wand != (MagickWand *) NULL);
12586 assert(wand->signature == WandSignature);
12587 if (wand->debug != MagickFalse)
12588 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12589 if (wand->images == (Image *) NULL)
12590 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12591 vignette_image=VignetteImage(wand->images,black_point,white_point,x,y,
12593 if (vignette_image == (Image *) NULL)
12594 return(MagickFalse);
12595 ReplaceImageInList(&wand->images,vignette_image);
12596 return(MagickTrue);
12600 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12604 % M a g i c k W a v e I m a g e %
12608 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12610 % MagickWaveImage() creates a "ripple" effect in the image by shifting
12611 % the pixels vertically along a sine wave whose amplitude and wavelength
12612 % is specified by the given parameters.
12614 % The format of the MagickWaveImage method is:
12616 % MagickBooleanType MagickWaveImage(MagickWand *wand,const double amplitude,
12617 % const double wave_length)
12619 % A description of each parameter follows:
12621 % o wand: the magick wand.
12623 % o amplitude, wave_length: Define the amplitude and wave length of the
12627 WandExport MagickBooleanType MagickWaveImage(MagickWand *wand,
12628 const double amplitude,const double wave_length)
12633 assert(wand != (MagickWand *) NULL);
12634 assert(wand->signature == WandSignature);
12635 if (wand->debug != MagickFalse)
12636 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12637 if (wand->images == (Image *) NULL)
12638 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12639 wave_image=WaveImage(wand->images,amplitude,wave_length,wand->exception);
12640 if (wave_image == (Image *) NULL)
12641 return(MagickFalse);
12642 ReplaceImageInList(&wand->images,wave_image);
12643 return(MagickTrue);
12647 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12651 % 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 %
12655 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12657 % MagickWhiteThresholdImage() is like ThresholdImage() but force all pixels
12658 % above the threshold into white while leaving all pixels below the threshold
12661 % The format of the MagickWhiteThresholdImage method is:
12663 % MagickBooleanType MagickWhiteThresholdImage(MagickWand *wand,
12664 % const PixelWand *threshold)
12666 % A description of each parameter follows:
12668 % o wand: the magick wand.
12670 % o threshold: the pixel wand.
12673 WandExport MagickBooleanType MagickWhiteThresholdImage(MagickWand *wand,
12674 const PixelWand *threshold)
12677 thresholds[MaxTextExtent];
12682 assert(wand != (MagickWand *) NULL);
12683 assert(wand->signature == WandSignature);
12684 if (wand->debug != MagickFalse)
12685 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12686 if (wand->images == (Image *) NULL)
12687 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12688 (void) FormatMagickString(thresholds,MaxTextExtent,
12689 QuantumFormat "," QuantumFormat "," QuantumFormat "," QuantumFormat,
12690 PixelGetRedQuantum(threshold),PixelGetGreenQuantum(threshold),
12691 PixelGetBlueQuantum(threshold),PixelGetOpacityQuantum(threshold));
12692 status=WhiteThresholdImage(wand->images,thresholds);
12693 if (status == MagickFalse)
12694 InheritException(wand->exception,&wand->images->exception);
12699 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12703 % M a g i c k W r i t e I m a g e %
12707 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12709 % MagickWriteImage() writes an image to the specified filename. If the
12710 % filename parameter is NULL, the image is written to the filename set
12711 % by MagickReadImage() or MagickSetImageFilename().
12713 % The format of the MagickWriteImage method is:
12715 % MagickBooleanType MagickWriteImage(MagickWand *wand,
12716 % const char *filename)
12718 % A description of each parameter follows:
12720 % o wand: the magick wand.
12722 % o filename: the image filename.
12726 WandExport MagickBooleanType MagickWriteImage(MagickWand *wand,
12727 const char *filename)
12738 assert(wand != (MagickWand *) NULL);
12739 assert(wand->signature == WandSignature);
12740 if (wand->debug != MagickFalse)
12741 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12742 if (wand->images == (Image *) NULL)
12743 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12744 if (filename != (const char *) NULL)
12745 (void) CopyMagickString(wand->images->filename,filename,MaxTextExtent);
12746 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
12747 if (image == (Image *) NULL)
12748 return(MagickFalse);
12749 write_info=CloneImageInfo(wand->image_info);
12750 write_info->adjoin=MagickTrue;
12751 status=WriteImage(write_info,image);
12752 if (status == MagickFalse)
12753 InheritException(wand->exception,&image->exception);
12754 image=DestroyImage(image);
12755 write_info=DestroyImageInfo(write_info);
12760 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12764 % M a g i c k W r i t e I m a g e F i l e %
12768 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12770 % MagickWriteImageFile() writes an image to an open file descriptor.
12772 % The format of the MagickWriteImageFile method is:
12774 % MagickBooleanType MagickWriteImageFile(MagickWand *wand,FILE *file)
12776 % A description of each parameter follows:
12778 % o wand: the magick wand.
12780 % o file: the file descriptor.
12783 WandExport MagickBooleanType MagickWriteImageFile(MagickWand *wand,FILE *file)
12794 assert(wand != (MagickWand *) NULL);
12795 assert(wand->signature == WandSignature);
12796 assert(file != (FILE *) NULL);
12797 if (wand->debug != MagickFalse)
12798 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12799 if (wand->images == (Image *) NULL)
12800 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12801 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
12802 if (image == (Image *) NULL)
12803 return(MagickFalse);
12804 write_info=CloneImageInfo(wand->image_info);
12805 SetImageInfoFile(write_info,file);
12806 write_info->adjoin=MagickTrue;
12807 status=WriteImage(write_info,image);
12808 write_info=DestroyImageInfo(write_info);
12809 if (status == MagickFalse)
12810 InheritException(wand->exception,&image->exception);
12811 image=DestroyImage(image);
12816 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12820 % M a g i c k W r i t e I m a g e s %
12824 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12826 % MagickWriteImages() writes an image or image sequence.
12828 % The format of the MagickWriteImages method is:
12830 % MagickBooleanType MagickWriteImages(MagickWand *wand,
12831 % const char *filename,const MagickBooleanType adjoin)
12833 % A description of each parameter follows:
12835 % o wand: the magick wand.
12837 % o filename: the image filename.
12839 % o adjoin: join images into a single multi-image file.
12842 WandExport MagickBooleanType MagickWriteImages(MagickWand *wand,
12843 const char *filename,const MagickBooleanType adjoin)
12851 assert(wand != (MagickWand *) NULL);
12852 assert(wand->signature == WandSignature);
12853 if (wand->debug != MagickFalse)
12854 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12855 if (wand->images == (Image *) NULL)
12856 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12857 write_info=CloneImageInfo(wand->image_info);
12858 write_info->adjoin=adjoin;
12859 status=WriteImages(write_info,wand->images,filename,wand->exception);
12860 if (status == MagickFalse)
12861 InheritException(wand->exception,&wand->images->exception);
12862 write_info=DestroyImageInfo(write_info);
12867 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12871 % M a g i c k W r i t e I m a g e s F i l e %
12875 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12877 % MagickWriteImagesFile() writes an image sequence to an open file descriptor.
12879 % The format of the MagickWriteImagesFile method is:
12881 % MagickBooleanType MagickWriteImagesFile(MagickWand *wand,FILE *file)
12883 % A description of each parameter follows:
12885 % o wand: the magick wand.
12887 % o file: the file descriptor.
12890 WandExport MagickBooleanType MagickWriteImagesFile(MagickWand *wand,FILE *file)
12898 assert(wand != (MagickWand *) NULL);
12899 assert(wand->signature == WandSignature);
12900 if (wand->debug != MagickFalse)
12901 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12902 if (wand->images == (Image *) NULL)
12903 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12904 write_info=CloneImageInfo(wand->image_info);
12905 SetImageInfoFile(write_info,file);
12906 write_info->adjoin=MagickTrue;
12907 status=WriteImages(write_info,wand->images,(const char *) NULL,
12909 write_info=DestroyImageInfo(write_info);
12910 if (status == MagickFalse)
12911 InheritException(wand->exception,&wand->images->exception);