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-2011 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 returns
3992 % the image as a blob (a formatted "file" in memory) and its length, starting
3993 % from the current position in the image sequence. Use MagickSetImageFormat()
3994 % to set the format to write to the blob (GIF, JPEG, PNG, etc.).
3996 % Utilize MagickResetIterator() to ensure the write is from the beginning of
3997 % the image sequence.
3999 % Use MagickRelinquishMemory() to free the blob when you are done with it.
4001 % The format of the MagickGetImageBlob method is:
4003 % unsigned char *MagickGetImageBlob(MagickWand *wand,size_t *length)
4005 % A description of each parameter follows:
4007 % o wand: the magick wand.
4009 % o length: the length of the blob.
4012 WandExport unsigned char *MagickGetImageBlob(MagickWand *wand,size_t *length)
4014 assert(wand != (MagickWand *) NULL);
4015 assert(wand->signature == WandSignature);
4016 if (wand->debug != MagickFalse)
4017 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4018 if (wand->images == (Image *) NULL)
4020 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4021 "ContainsNoImages","`%s'",wand->name);
4022 return((unsigned char *) NULL);
4024 return(ImageToBlob(wand->image_info,wand->images,length,wand->exception));
4028 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4032 % M a g i c k G e t I m a g e s B l o b %
4036 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4038 % MagickGetImageBlob() implements direct to memory image formats. It
4039 % returns the image sequence as a blob and its length. The format of the image
4040 % determines the format of the returned blob (GIF, JPEG, PNG, etc.). To
4041 % return a different image format, use MagickSetImageFormat().
4043 % Note, some image formats do not permit multiple images to the same image
4044 % stream (e.g. JPEG). in this instance, just the first image of the
4045 % sequence is returned as a blob.
4047 % The format of the MagickGetImagesBlob method is:
4049 % unsigned char *MagickGetImagesBlob(MagickWand *wand,size_t *length)
4051 % A description of each parameter follows:
4053 % o wand: the magick wand.
4055 % o length: the length of the blob.
4058 WandExport unsigned char *MagickGetImagesBlob(MagickWand *wand,size_t *length)
4063 assert(wand != (MagickWand *) NULL);
4064 assert(wand->signature == WandSignature);
4065 if (wand->debug != MagickFalse)
4066 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4067 if (wand->images == (Image *) NULL)
4069 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4070 "ContainsNoImages","`%s'",wand->name);
4071 return((unsigned char *) NULL);
4073 blob=ImagesToBlob(wand->image_info,GetFirstImageInList(wand->images),length,
4079 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4083 % 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 %
4087 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4089 % MagickGetImageBluePrimary() returns the chromaticy blue primary point for the
4092 % The format of the MagickGetImageBluePrimary method is:
4094 % MagickBooleanType MagickGetImageBluePrimary(MagickWand *wand,double *x,
4097 % A description of each parameter follows:
4099 % o wand: the magick wand.
4101 % o x: the chromaticity blue primary x-point.
4103 % o y: the chromaticity blue primary y-point.
4106 WandExport MagickBooleanType MagickGetImageBluePrimary(MagickWand *wand,
4107 double *x,double *y)
4109 assert(wand != (MagickWand *) NULL);
4110 assert(wand->signature == WandSignature);
4111 if (wand->debug != MagickFalse)
4112 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4113 if (wand->images == (Image *) NULL)
4114 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4115 *x=wand->images->chromaticity.blue_primary.x;
4116 *y=wand->images->chromaticity.blue_primary.y;
4121 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4125 % 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 %
4129 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4131 % MagickGetImageBorderColor() returns the image border color.
4133 % The format of the MagickGetImageBorderColor method is:
4135 % MagickBooleanType MagickGetImageBorderColor(MagickWand *wand,
4136 % PixelWand *border_color)
4138 % A description of each parameter follows:
4140 % o wand: the magick wand.
4142 % o border_color: Return the border color.
4145 WandExport MagickBooleanType MagickGetImageBorderColor(MagickWand *wand,
4146 PixelWand *border_color)
4148 assert(wand != (MagickWand *) NULL);
4149 assert(wand->signature == WandSignature);
4150 if (wand->debug != MagickFalse)
4151 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4152 if (wand->images == (Image *) NULL)
4153 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4154 PixelSetQuantumColor(border_color,&wand->images->border_color);
4159 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4163 % 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 %
4167 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4169 % MagickGetImageChannelDepth() gets the depth for one or more image channels.
4171 % The format of the MagickGetImageChannelDepth method is:
4173 % size_t MagickGetImageChannelDepth(MagickWand *wand,
4174 % const ChannelType channel)
4176 % A description of each parameter follows:
4178 % o wand: the magick wand.
4180 % o channel: the image channel(s).
4183 WandExport size_t MagickGetImageChannelDepth(MagickWand *wand,
4184 const ChannelType channel)
4186 assert(wand != (MagickWand *) NULL);
4187 assert(wand->signature == WandSignature);
4188 if (wand->debug != MagickFalse)
4189 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4190 if (wand->images == (Image *) NULL)
4191 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4192 return(GetImageChannelDepth(wand->images,channel,wand->exception));
4196 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4200 % 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 %
4204 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4206 % MagickGetImageChannelDistortion() compares one or more image channels of an
4207 % image to a reconstructed image and returns the specified distortion metric.
4209 % The format of the MagickGetImageChannelDistortion method is:
4211 % MagickBooleanType MagickGetImageChannelDistortion(MagickWand *wand,
4212 % const MagickWand *reference,const ChannelType channel,
4213 % const MetricType metric,double *distortion)
4215 % A description of each parameter follows:
4217 % o wand: the magick wand.
4219 % o reference: the reference wand.
4221 % o channel: the channel.
4223 % o metric: the metric.
4225 % o distortion: the computed distortion between the images.
4228 WandExport MagickBooleanType MagickGetImageChannelDistortion(MagickWand *wand,
4229 const MagickWand *reference,const ChannelType channel,const MetricType metric,
4235 assert(wand != (MagickWand *) NULL);
4236 assert(wand->signature == WandSignature);
4237 if (wand->debug != MagickFalse)
4238 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4239 assert(reference != (MagickWand *) NULL);
4240 assert(reference->signature == WandSignature);
4241 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
4242 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4243 status=GetImageChannelDistortion(wand->images,reference->images,channel,
4244 metric,distortion,&wand->images->exception);
4249 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4253 % 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 %
4257 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4259 % MagickGetImageChannelDistortions() compares one or more image channels of an
4260 % image to a reconstructed image and returns the specified distortion metrics.
4262 % Use MagickRelinquishMemory() to free the metrics when you are done with them.
4264 % The format of the MagickGetImageChannelDistortion method is:
4266 % double *MagickGetImageChannelDistortion(MagickWand *wand,
4267 % const MagickWand *reference,const MetricType metric)
4269 % A description of each parameter follows:
4271 % o wand: the magick wand.
4273 % o reference: the reference wand.
4275 % o metric: the metric.
4278 WandExport double *MagickGetImageChannelDistortions(MagickWand *wand,
4279 const MagickWand *reference,const MetricType metric)
4282 *channel_distortion;
4284 assert(wand != (MagickWand *) NULL);
4285 assert(wand->signature == WandSignature);
4286 if (wand->debug != MagickFalse)
4287 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4288 assert(reference != (MagickWand *) NULL);
4289 assert(reference->signature == WandSignature);
4290 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
4292 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4293 "ContainsNoImages","`%s'",wand->name);
4294 return((double *) NULL);
4296 channel_distortion=GetImageChannelDistortions(wand->images,reference->images,
4297 metric,&wand->images->exception);
4298 return(channel_distortion);
4302 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4306 % 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 %
4310 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4312 % MagickGetImageChannelFeatures() returns features for each channel in the
4313 % image in each of four directions (horizontal, vertical, left and right
4314 % diagonals) for the specified distance. The features include the angular
4315 % second moment, contrast, correlation, sum of squares: variance, inverse
4316 % difference moment, sum average, sum varience, sum entropy, entropy,
4317 % difference variance, difference entropy, information measures of
4318 % correlation 1, information measures of correlation 2, and maximum
4319 % correlation coefficient. You can access the red channel contrast, for
4320 % example, like this:
4322 % channel_features=MagickGetImageChannelFeatures(wand,1);
4323 % contrast=channel_features[RedChannel].contrast[0];
4325 % Use MagickRelinquishMemory() to free the statistics buffer.
4327 % The format of the MagickGetImageChannelFeatures method is:
4329 % ChannelFeatures *MagickGetImageChannelFeatures(MagickWand *wand,
4330 % const size_t distance)
4332 % A description of each parameter follows:
4334 % o wand: the magick wand.
4336 % o distance: the distance.
4339 WandExport ChannelFeatures *MagickGetImageChannelFeatures(MagickWand *wand,
4340 const size_t distance)
4342 assert(wand != (MagickWand *) NULL);
4343 assert(wand->signature == WandSignature);
4344 if (wand->debug != MagickFalse)
4345 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4346 if (wand->images == (Image *) NULL)
4348 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4349 "ContainsNoImages","`%s'",wand->name);
4350 return((ChannelFeatures *) NULL);
4352 return(GetImageChannelFeatures(wand->images,distance,wand->exception));
4356 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4360 % 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 %
4364 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4366 % MagickGetImageChannelKurtosis() gets the kurtosis and skewness of one or
4367 % more image channels.
4369 % The format of the MagickGetImageChannelKurtosis method is:
4371 % MagickBooleanType MagickGetImageChannelKurtosis(MagickWand *wand,
4372 % const ChannelType channel,double *kurtosis,double *skewness)
4374 % A description of each parameter follows:
4376 % o wand: the magick wand.
4378 % o channel: the image channel(s).
4380 % o kurtosis: The kurtosis for the specified channel(s).
4382 % o skewness: The skewness for the specified channel(s).
4385 WandExport MagickBooleanType MagickGetImageChannelKurtosis(MagickWand *wand,
4386 const ChannelType channel,double *kurtosis,double *skewness)
4391 assert(wand != (MagickWand *) NULL);
4392 assert(wand->signature == WandSignature);
4393 if (wand->debug != MagickFalse)
4394 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4395 if (wand->images == (Image *) NULL)
4396 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4397 status=GetImageChannelKurtosis(wand->images,channel,kurtosis,skewness,
4403 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4407 % 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 %
4411 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4413 % MagickGetImageChannelMean() gets the mean and standard deviation of one or
4414 % more image channels.
4416 % The format of the MagickGetImageChannelMean method is:
4418 % MagickBooleanType MagickGetImageChannelMean(MagickWand *wand,
4419 % const ChannelType channel,double *mean,double *standard_deviation)
4421 % A description of each parameter follows:
4423 % o wand: the magick wand.
4425 % o channel: the image channel(s).
4427 % o mean: The mean pixel value for the specified channel(s).
4429 % o standard_deviation: The standard deviation for the specified channel(s).
4432 WandExport MagickBooleanType MagickGetImageChannelMean(MagickWand *wand,
4433 const ChannelType channel,double *mean,double *standard_deviation)
4438 assert(wand != (MagickWand *) NULL);
4439 assert(wand->signature == WandSignature);
4440 if (wand->debug != MagickFalse)
4441 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4442 if (wand->images == (Image *) NULL)
4443 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4444 status=GetImageChannelMean(wand->images,channel,mean,standard_deviation,
4450 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4454 % 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 %
4458 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4460 % MagickGetImageChannelRange() gets the range for one or more image channels.
4462 % The format of the MagickGetImageChannelRange method is:
4464 % MagickBooleanType MagickGetImageChannelRange(MagickWand *wand,
4465 % const ChannelType channel,double *minima,double *maxima)
4467 % A description of each parameter follows:
4469 % o wand: the magick wand.
4471 % o channel: the image channel(s).
4473 % o minima: The minimum pixel value for the specified channel(s).
4475 % o maxima: The maximum pixel value for the specified channel(s).
4478 WandExport MagickBooleanType MagickGetImageChannelRange(MagickWand *wand,
4479 const ChannelType channel,double *minima,double *maxima)
4484 assert(wand != (MagickWand *) NULL);
4485 assert(wand->signature == WandSignature);
4486 if (wand->debug != MagickFalse)
4487 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4488 if (wand->images == (Image *) NULL)
4489 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4490 status=GetImageChannelRange(wand->images,channel,minima,maxima,
4496 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4500 % 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 %
4504 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4506 % MagickGetImageChannelStatistics() returns statistics for each channel in the
4507 % image. The statistics include the channel depth, its minima and
4508 % maxima, the mean, the standard deviation, the kurtosis and the skewness.
4509 % You can access the red channel mean, for example, like this:
4511 % channel_statistics=MagickGetImageChannelStatistics(wand);
4512 % red_mean=channel_statistics[RedChannel].mean;
4514 % Use MagickRelinquishMemory() to free the statistics buffer.
4516 % The format of the MagickGetImageChannelStatistics method is:
4518 % ChannelStatistics *MagickGetImageChannelStatistics(MagickWand *wand)
4520 % A description of each parameter follows:
4522 % o wand: the magick wand.
4525 WandExport ChannelStatistics *MagickGetImageChannelStatistics(MagickWand *wand)
4527 assert(wand != (MagickWand *) NULL);
4528 assert(wand->signature == WandSignature);
4529 if (wand->debug != MagickFalse)
4530 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4531 if (wand->images == (Image *) NULL)
4533 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4534 "ContainsNoImages","`%s'",wand->name);
4535 return((ChannelStatistics *) NULL);
4537 return(GetImageChannelStatistics(wand->images,wand->exception));
4541 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4545 % 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 %
4549 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4551 % MagickGetImageColormapColor() returns the color of the specified colormap
4554 % The format of the MagickGetImageColormapColor method is:
4556 % MagickBooleanType MagickGetImageColormapColor(MagickWand *wand,
4557 % const size_t index,PixelWand *color)
4559 % A description of each parameter follows:
4561 % o wand: the magick wand.
4563 % o index: the offset into the image colormap.
4565 % o color: Return the colormap color in this wand.
4568 WandExport MagickBooleanType MagickGetImageColormapColor(MagickWand *wand,
4569 const size_t index,PixelWand *color)
4571 assert(wand != (MagickWand *) NULL);
4572 assert(wand->signature == WandSignature);
4573 if (wand->debug != MagickFalse)
4574 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4575 if (wand->images == (Image *) NULL)
4576 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4577 if ((wand->images->colormap == (PixelPacket *) NULL) ||
4578 (index >= wand->images->colors))
4580 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4581 "InvalidColormapIndex","`%s'",wand->name);
4582 return(MagickFalse);
4584 PixelSetQuantumColor(color,wand->images->colormap+index);
4589 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4593 % M a g i c k G e t I m a g e C o l o r s %
4597 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4599 % MagickGetImageColors() gets the number of unique colors in the image.
4601 % The format of the MagickGetImageColors method is:
4603 % size_t MagickGetImageColors(MagickWand *wand)
4605 % A description of each parameter follows:
4607 % o wand: the magick wand.
4610 WandExport size_t MagickGetImageColors(MagickWand *wand)
4612 assert(wand != (MagickWand *) NULL);
4613 assert(wand->signature == WandSignature);
4614 if (wand->debug != MagickFalse)
4615 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4616 if (wand->images == (Image *) NULL)
4618 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4619 "ContainsNoImages","`%s'",wand->name);
4622 return(GetNumberColors(wand->images,(FILE *) NULL,wand->exception));
4626 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4630 % M a g i c k G e t I m a g e C o l o r s p a c e %
4634 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4636 % MagickGetImageColorspace() gets the image colorspace.
4638 % The format of the MagickGetImageColorspace method is:
4640 % ColorspaceType MagickGetImageColorspace(MagickWand *wand)
4642 % A description of each parameter follows:
4644 % o wand: the magick wand.
4647 WandExport ColorspaceType MagickGetImageColorspace(MagickWand *wand)
4649 assert(wand != (MagickWand *) NULL);
4650 assert(wand->signature == WandSignature);
4651 if (wand->debug != MagickFalse)
4652 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4653 if (wand->images == (Image *) NULL)
4655 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4656 "ContainsNoImages","`%s'",wand->name);
4657 return(UndefinedColorspace);
4659 return(wand->images->colorspace);
4663 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4667 % M a g i c k G e t I m a g e C o m p o s e %
4671 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4673 % MagickGetImageCompose() returns the composite operator associated with the
4676 % The format of the MagickGetImageCompose method is:
4678 % CompositeOperator MagickGetImageCompose(MagickWand *wand)
4680 % A description of each parameter follows:
4682 % o wand: the magick wand.
4685 WandExport CompositeOperator MagickGetImageCompose(MagickWand *wand)
4687 assert(wand != (MagickWand *) NULL);
4688 assert(wand->signature == WandSignature);
4689 if (wand->debug != MagickFalse)
4690 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4691 if (wand->images == (Image *) NULL)
4693 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4694 "ContainsNoImages","`%s'",wand->name);
4695 return(UndefinedCompositeOp);
4697 return(wand->images->compose);
4701 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4705 % 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 %
4709 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4711 % MagickGetImageCompression() gets the image compression.
4713 % The format of the MagickGetImageCompression method is:
4715 % CompressionType MagickGetImageCompression(MagickWand *wand)
4717 % A description of each parameter follows:
4719 % o wand: the magick wand.
4722 WandExport CompressionType MagickGetImageCompression(MagickWand *wand)
4724 assert(wand != (MagickWand *) NULL);
4725 assert(wand->signature == WandSignature);
4726 if (wand->debug != MagickFalse)
4727 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4728 if (wand->images == (Image *) NULL)
4730 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4731 "ContainsNoImages","`%s'",wand->name);
4732 return(UndefinedCompression);
4734 return(wand->images->compression);
4738 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4742 % 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 %
4746 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4748 % MagickGetImageCompression() gets the image compression quality.
4750 % The format of the MagickGetImageCompression method is:
4752 % size_t MagickGetImageCompression(MagickWand *wand)
4754 % A description of each parameter follows:
4756 % o wand: the magick wand.
4759 WandExport size_t MagickGetImageCompressionQuality(MagickWand *wand)
4761 assert(wand != (MagickWand *) NULL);
4762 assert(wand->signature == WandSignature);
4763 if (wand->debug != MagickFalse)
4764 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4765 if (wand->images == (Image *) NULL)
4767 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4768 "ContainsNoImages","`%s'",wand->name);
4771 return(wand->images->quality);
4775 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4779 % M a g i c k G e t I m a g e D e l a y %
4783 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4785 % MagickGetImageDelay() gets the image delay.
4787 % The format of the MagickGetImageDelay method is:
4789 % size_t MagickGetImageDelay(MagickWand *wand)
4791 % A description of each parameter follows:
4793 % o wand: the magick wand.
4796 WandExport size_t MagickGetImageDelay(MagickWand *wand)
4798 assert(wand != (MagickWand *) NULL);
4799 assert(wand->signature == WandSignature);
4800 if (wand->debug != MagickFalse)
4801 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4802 if (wand->images == (Image *) NULL)
4803 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4804 return(wand->images->delay);
4808 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4812 % M a g i c k G e t I m a g e D e p t h %
4816 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4818 % MagickGetImageDepth() gets the image depth.
4820 % The format of the MagickGetImageDepth method is:
4822 % size_t MagickGetImageDepth(MagickWand *wand)
4824 % A description of each parameter follows:
4826 % o wand: the magick wand.
4829 WandExport size_t MagickGetImageDepth(MagickWand *wand)
4831 assert(wand != (MagickWand *) NULL);
4832 assert(wand->signature == WandSignature);
4833 if (wand->debug != MagickFalse)
4834 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4835 if (wand->images == (Image *) NULL)
4836 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4837 return(wand->images->depth);
4841 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4845 % M a g i c k G e t I m a g e D i s t o r t i o n %
4849 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4851 % MagickGetImageDistortion() compares an image to a reconstructed image and
4852 % returns the specified distortion metric.
4854 % The format of the MagickGetImageDistortion method is:
4856 % MagickBooleanType MagickGetImageDistortion(MagickWand *wand,
4857 % const MagickWand *reference,const MetricType metric,
4858 % double *distortion)
4860 % A description of each parameter follows:
4862 % o wand: the magick wand.
4864 % o reference: the reference wand.
4866 % o metric: the metric.
4868 % o distortion: the computed distortion between the images.
4871 WandExport MagickBooleanType MagickGetImageDistortion(MagickWand *wand,
4872 const MagickWand *reference,const MetricType metric,double *distortion)
4878 assert(wand != (MagickWand *) NULL);
4879 assert(wand->signature == WandSignature);
4880 if (wand->debug != MagickFalse)
4881 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4882 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
4883 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4884 status=GetImageDistortion(wand->images,reference->images,metric,distortion,
4885 &wand->images->exception);
4890 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4894 % M a g i c k G e t I m a g e D i s p o s e %
4898 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4900 % MagickGetImageDispose() gets the image disposal method.
4902 % The format of the MagickGetImageDispose method is:
4904 % DisposeType MagickGetImageDispose(MagickWand *wand)
4906 % A description of each parameter follows:
4908 % o wand: the magick wand.
4911 WandExport DisposeType MagickGetImageDispose(MagickWand *wand)
4913 assert(wand != (MagickWand *) NULL);
4914 assert(wand->signature == WandSignature);
4915 if (wand->debug != MagickFalse)
4916 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4917 if (wand->images == (Image *) NULL)
4919 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4920 "ContainsNoImages","`%s'",wand->name);
4921 return(UndefinedDispose);
4923 return((DisposeType) wand->images->dispose);
4927 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4931 % M a g i c k G e t I m a g e F i l e n a m e %
4935 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4937 % MagickGetImageFilename() returns the filename of a particular image in a
4940 % The format of the MagickGetImageFilename method is:
4942 % char *MagickGetImageFilename(MagickWand *wand)
4944 % A description of each parameter follows:
4946 % o wand: the magick wand.
4949 WandExport char *MagickGetImageFilename(MagickWand *wand)
4951 assert(wand != (MagickWand *) NULL);
4952 assert(wand->signature == WandSignature);
4953 if (wand->debug != MagickFalse)
4954 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4955 if (wand->images == (Image *) NULL)
4957 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4958 "ContainsNoImages","`%s'",wand->name);
4959 return((char *) NULL);
4961 return(AcquireString(wand->images->filename));
4965 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4969 % M a g i c k G e t I m a g e F o r m a t %
4973 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4975 % MagickGetImageFormat() returns the format of a particular image in a
4978 % The format of the MagickGetImageFormat method is:
4980 % const char *MagickGetImageFormat(MagickWand *wand)
4982 % A description of each parameter follows:
4984 % o wand: the magick wand.
4987 WandExport char *MagickGetImageFormat(MagickWand *wand)
4989 assert(wand != (MagickWand *) NULL);
4990 assert(wand->signature == WandSignature);
4991 if (wand->debug != MagickFalse)
4992 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4993 if (wand->images == (Image *) NULL)
4995 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4996 "ContainsNoImages","`%s'",wand->name);
4997 return((char *) NULL);
4999 return(AcquireString(wand->images->magick));
5003 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5007 % M a g i c k G e t I m a g e F u z z %
5011 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5013 % MagickGetImageFuzz() gets the image fuzz.
5015 % The format of the MagickGetImageFuzz method is:
5017 % double MagickGetImageFuzz(MagickWand *wand)
5019 % A description of each parameter follows:
5021 % o wand: the magick wand.
5024 WandExport double MagickGetImageFuzz(MagickWand *wand)
5026 assert(wand != (MagickWand *) NULL);
5027 assert(wand->signature == WandSignature);
5028 if (wand->debug != MagickFalse)
5029 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5030 if (wand->images == (Image *) NULL)
5032 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5033 "ContainsNoImages","`%s'",wand->name);
5036 return(wand->images->fuzz);
5040 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5044 % M a g i c k G e t I m a g e G a m m a %
5048 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5050 % MagickGetImageGamma() gets the image gamma.
5052 % The format of the MagickGetImageGamma method is:
5054 % double MagickGetImageGamma(MagickWand *wand)
5056 % A description of each parameter follows:
5058 % o wand: the magick wand.
5061 WandExport double MagickGetImageGamma(MagickWand *wand)
5063 assert(wand != (MagickWand *) NULL);
5064 assert(wand->signature == WandSignature);
5065 if (wand->debug != MagickFalse)
5066 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5067 if (wand->images == (Image *) NULL)
5069 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5070 "ContainsNoImages","`%s'",wand->name);
5073 return(wand->images->gamma);
5077 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5081 % 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 %
5085 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5087 % MagickGetImageGravity() gets the image gravity.
5089 % The format of the MagickGetImageGravity method is:
5091 % GravityType MagickGetImageGravity(MagickWand *wand)
5093 % A description of each parameter follows:
5095 % o wand: the magick wand.
5098 WandExport GravityType MagickGetImageGravity(MagickWand *wand)
5100 assert(wand != (MagickWand *) NULL);
5101 assert(wand->signature == WandSignature);
5102 if (wand->debug != MagickFalse)
5103 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5104 if (wand->images == (Image *) NULL)
5106 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5107 "ContainsNoImages","`%s'",wand->name);
5108 return(UndefinedGravity);
5110 return(wand->images->gravity);
5114 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5118 % 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 %
5122 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5124 % MagickGetImageGreenPrimary() returns the chromaticy green primary point.
5126 % The format of the MagickGetImageGreenPrimary method is:
5128 % MagickBooleanType MagickGetImageGreenPrimary(MagickWand *wand,double *x,
5131 % A description of each parameter follows:
5133 % o wand: the magick wand.
5135 % o x: the chromaticity green primary x-point.
5137 % o y: the chromaticity green primary y-point.
5140 WandExport MagickBooleanType MagickGetImageGreenPrimary(MagickWand *wand,
5141 double *x,double *y)
5143 assert(wand != (MagickWand *) NULL);
5144 assert(wand->signature == WandSignature);
5145 if (wand->debug != MagickFalse)
5146 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5147 if (wand->images == (Image *) NULL)
5148 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5149 *x=wand->images->chromaticity.green_primary.x;
5150 *y=wand->images->chromaticity.green_primary.y;
5155 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5159 % M a g i c k G e t I m a g e H e i g h t %
5163 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5165 % MagickGetImageHeight() returns the image height.
5167 % The format of the MagickGetImageHeight method is:
5169 % size_t MagickGetImageHeight(MagickWand *wand)
5171 % A description of each parameter follows:
5173 % o wand: the magick wand.
5176 WandExport size_t MagickGetImageHeight(MagickWand *wand)
5178 assert(wand != (MagickWand *) NULL);
5179 assert(wand->signature == WandSignature);
5180 if (wand->debug != MagickFalse)
5181 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5182 if (wand->images == (Image *) NULL)
5183 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5184 return(wand->images->rows);
5188 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5192 % M a g i c k G e t I m a g e H i s t o g r a m %
5196 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5198 % MagickGetImageHistogram() returns the image histogram as an array of
5201 % The format of the MagickGetImageHistogram method is:
5203 % PixelWand **MagickGetImageHistogram(MagickWand *wand,
5204 % size_t *number_colors)
5206 % A description of each parameter follows:
5208 % o wand: the magick wand.
5210 % o number_colors: the number of unique colors in the image and the number
5211 % of pixel wands returned.
5214 WandExport PixelWand **MagickGetImageHistogram(MagickWand *wand,
5215 size_t *number_colors)
5226 assert(wand != (MagickWand *) NULL);
5227 assert(wand->signature == WandSignature);
5228 if (wand->debug != MagickFalse)
5229 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5230 if (wand->images == (Image *) NULL)
5232 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5233 "ContainsNoImages","`%s'",wand->name);
5234 return((PixelWand **) NULL);
5236 histogram=GetImageHistogram(wand->images,number_colors,wand->exception);
5237 if (histogram == (ColorPacket *) NULL)
5238 return((PixelWand **) NULL);
5239 pixel_wands=NewPixelWands(*number_colors);
5240 for (i=0; i < (ssize_t) *number_colors; i++)
5242 PixelSetQuantumColor(pixel_wands[i],&histogram[i].pixel);
5243 PixelSetIndex(pixel_wands[i],histogram[i].index);
5244 PixelSetColorCount(pixel_wands[i],(size_t) histogram[i].count);
5246 histogram=(ColorPacket *) RelinquishMagickMemory(histogram);
5247 return(pixel_wands);
5251 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5255 % 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 %
5259 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5261 % MagickGetImageInterlaceScheme() gets the image interlace scheme.
5263 % The format of the MagickGetImageInterlaceScheme method is:
5265 % InterlaceType MagickGetImageInterlaceScheme(MagickWand *wand)
5267 % A description of each parameter follows:
5269 % o wand: the magick wand.
5272 WandExport InterlaceType MagickGetImageInterlaceScheme(MagickWand *wand)
5274 assert(wand != (MagickWand *) NULL);
5275 assert(wand->signature == WandSignature);
5276 if (wand->debug != MagickFalse)
5277 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5278 if (wand->images == (Image *) NULL)
5280 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5281 "ContainsNoImages","`%s'",wand->name);
5282 return(UndefinedInterlace);
5284 return(wand->images->interlace);
5288 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5292 % 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 %
5296 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5298 % MagickGetImageInterpolateMethod() returns the interpolation method for the
5301 % The format of the MagickGetImageInterpolateMethod method is:
5303 % InterpolatePixelMethod MagickGetImageInterpolateMethod(MagickWand *wand)
5305 % A description of each parameter follows:
5307 % o wand: the magick wand.
5310 WandExport InterpolatePixelMethod MagickGetImageInterpolateMethod(
5313 assert(wand != (MagickWand *) NULL);
5314 assert(wand->signature == WandSignature);
5315 if (wand->debug != MagickFalse)
5316 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5317 if (wand->images == (Image *) NULL)
5319 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5320 "ContainsNoImages","`%s'",wand->name);
5321 return(UndefinedInterpolatePixel);
5323 return(wand->images->interpolate);
5327 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5331 % M a g i c k G e t I m a g e I t e r a t i o n s %
5335 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5337 % MagickGetImageIterations() gets the image iterations.
5339 % The format of the MagickGetImageIterations method is:
5341 % size_t MagickGetImageIterations(MagickWand *wand)
5343 % A description of each parameter follows:
5345 % o wand: the magick wand.
5348 WandExport size_t MagickGetImageIterations(MagickWand *wand)
5350 assert(wand != (MagickWand *) NULL);
5351 assert(wand->signature == WandSignature);
5352 if (wand->debug != MagickFalse)
5353 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5354 if (wand->images == (Image *) NULL)
5355 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5356 return(wand->images->iterations);
5360 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5364 % M a g i c k G e t I m a g e L e n g t h %
5368 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5370 % MagickGetImageLength() returns the image length in bytes.
5372 % The format of the MagickGetImageLength method is:
5374 % MagickBooleanType MagickGetImageLength(MagickWand *wand,
5375 % MagickSizeType *length)
5377 % A description of each parameter follows:
5379 % o wand: the magick wand.
5381 % o length: the image length in bytes.
5384 WandExport MagickBooleanType MagickGetImageLength(MagickWand *wand,
5385 MagickSizeType *length)
5387 assert(wand != (MagickWand *) NULL);
5388 assert(wand->signature == WandSignature);
5389 if (wand->debug != MagickFalse)
5390 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5391 if (wand->images == (Image *) NULL)
5392 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5393 *length=GetBlobSize(wand->images);
5398 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5402 % M a g i c k G e t I m a g e M a t t e C o l o r %
5406 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5408 % MagickGetImageMatteColor() returns the image matte color.
5410 % The format of the MagickGetImageMatteColor method is:
5412 % MagickBooleanType MagickGetImagematteColor(MagickWand *wand,
5413 % PixelWand *matte_color)
5415 % A description of each parameter follows:
5417 % o wand: the magick wand.
5419 % o matte_color: Return the matte color.
5422 WandExport MagickBooleanType MagickGetImageMatteColor(MagickWand *wand,
5423 PixelWand *matte_color)
5425 assert(wand != (MagickWand *) NULL);
5426 assert(wand->signature == WandSignature);
5427 if (wand->debug != MagickFalse)
5428 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5429 if (wand->images == (Image *) NULL)
5430 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5431 PixelSetQuantumColor(matte_color,&wand->images->matte_color);
5436 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5440 % 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 %
5444 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5446 % MagickGetImageOrientation() returns the image orientation.
5448 % The format of the MagickGetImageOrientation method is:
5450 % OrientationType MagickGetImageOrientation(MagickWand *wand)
5452 % A description of each parameter follows:
5454 % o wand: the magick wand.
5457 WandExport OrientationType MagickGetImageOrientation(MagickWand *wand)
5459 assert(wand != (MagickWand *) NULL);
5460 assert(wand->signature == WandSignature);
5461 if (wand->debug != MagickFalse)
5462 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5463 if (wand->images == (Image *) NULL)
5465 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5466 "ContainsNoImages","`%s'",wand->name);
5467 return(UndefinedOrientation);
5469 return(wand->images->orientation);
5473 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5477 % M a g i c k G e t I m a g e P a g e %
5481 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5483 % MagickGetImagePage() returns the page geometry associated with the image.
5485 % The format of the MagickGetImagePage method is:
5487 % MagickBooleanType MagickGetImagePage(MagickWand *wand,
5488 % size_t *width,size_t *height,ssize_t *x,ssize_t *y)
5490 % A description of each parameter follows:
5492 % o wand: the magick wand.
5494 % o width: the page width.
5496 % o height: the page height.
5498 % o x: the page x-offset.
5500 % o y: the page y-offset.
5503 WandExport MagickBooleanType MagickGetImagePage(MagickWand *wand,
5504 size_t *width,size_t *height,ssize_t *x,ssize_t *y)
5506 assert(wand != (const MagickWand *) NULL);
5507 assert(wand->signature == WandSignature);
5508 if (wand->debug != MagickFalse)
5509 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5510 if (wand->images == (Image *) NULL)
5511 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5512 *width=wand->images->page.width;
5513 *height=wand->images->page.height;
5514 *x=wand->images->page.x;
5515 *y=wand->images->page.y;
5520 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5524 % M a g i c k G e t I m a g e P i x e l C o l o r %
5528 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5530 % MagickGetImagePixelColor() returns the color of the specified pixel.
5532 % The format of the MagickGetImagePixelColor method is:
5534 % MagickBooleanType MagickGetImagePixelColor(MagickWand *wand,
5535 % const ssize_t x,const ssize_t y,PixelWand *color)
5537 % A description of each parameter follows:
5539 % o wand: the magick wand.
5541 % o x,y: the pixel offset into the image.
5543 % o color: Return the colormap color in this wand.
5546 WandExport MagickBooleanType MagickGetImagePixelColor(MagickWand *wand,
5547 const ssize_t x,const ssize_t y,PixelWand *color)
5552 register const PixelPacket
5558 assert(wand != (MagickWand *) NULL);
5559 assert(wand->signature == WandSignature);
5560 if (wand->debug != MagickFalse)
5561 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5562 if (wand->images == (Image *) NULL)
5563 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5564 image_view=AcquireCacheView(wand->images);
5565 p=GetCacheViewVirtualPixels(image_view,x,y,1,1,wand->exception);
5566 if (p == (const PixelPacket *) NULL)
5568 image_view=DestroyCacheView(image_view);
5569 return(MagickFalse);
5571 indexes=GetCacheViewAuthenticIndexQueue(image_view);
5572 PixelSetQuantumColor(color,p);
5573 if (GetCacheViewColorspace(image_view) == CMYKColorspace)
5574 PixelSetBlackQuantum(color,*indexes);
5576 if (GetCacheViewStorageClass(image_view) == PseudoClass)
5577 PixelSetIndex(color,*indexes);
5578 image_view=DestroyCacheView(image_view);
5583 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5587 + M a g i c k G e t I m a g e R a n g e %
5591 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5593 % MagickGetImageRange() gets the pixel range for the image.
5595 % The format of the MagickGetImageRange method is:
5597 % MagickBooleanType MagickGetImageRange(MagickWand *wand,double *minima,
5600 % A description of each parameter follows:
5602 % o wand: the magick wand.
5604 % o minima: The minimum pixel value for the specified channel(s).
5606 % o maxima: The maximum pixel value for the specified channel(s).
5609 WandExport MagickBooleanType MagickGetImageRange(MagickWand *wand,
5610 double *minima,double *maxima)
5615 assert(wand != (MagickWand *) NULL);
5616 assert(wand->signature == WandSignature);
5617 if (wand->debug != MagickFalse)
5618 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5619 if (wand->images == (Image *) NULL)
5620 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5621 status=GetImageRange(wand->images,minima,maxima,wand->exception);
5626 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5630 % M a g i c k G e t I m a g e R e d P r i m a r y %
5634 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5636 % MagickGetImageRedPrimary() returns the chromaticy red primary point.
5638 % The format of the MagickGetImageRedPrimary method is:
5640 % MagickBooleanType MagickGetImageRedPrimary(MagickWand *wand,double *x,
5643 % A description of each parameter follows:
5645 % o wand: the magick wand.
5647 % o x: the chromaticity red primary x-point.
5649 % o y: the chromaticity red primary y-point.
5652 WandExport MagickBooleanType MagickGetImageRedPrimary(MagickWand *wand,
5653 double *x,double *y)
5655 assert(wand != (MagickWand *) NULL);
5656 assert(wand->signature == WandSignature);
5657 if (wand->debug != MagickFalse)
5658 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5659 if (wand->images == (Image *) NULL)
5660 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5661 *x=wand->images->chromaticity.red_primary.x;
5662 *y=wand->images->chromaticity.red_primary.y;
5667 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5671 % M a g i c k G e t I m a g e R e g i o n %
5675 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5677 % MagickGetImageRegion() extracts a region of the image and returns it as a
5680 % The format of the MagickGetImageRegion method is:
5682 % MagickWand *MagickGetImageRegion(MagickWand *wand,
5683 % const size_t width,const size_t height,const ssize_t x,
5686 % A description of each parameter follows:
5688 % o wand: the magick wand.
5690 % o width: the region width.
5692 % o height: the region height.
5694 % o x: the region x offset.
5696 % o y: the region y offset.
5699 WandExport MagickWand *MagickGetImageRegion(MagickWand *wand,
5700 const size_t width,const size_t height,const ssize_t x,
5709 assert(wand != (MagickWand *) NULL);
5710 assert(wand->signature == WandSignature);
5711 if (wand->debug != MagickFalse)
5712 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5713 if (wand->images == (Image *) NULL)
5714 return((MagickWand *) NULL);
5716 region.height=height;
5719 region_image=CropImage(wand->images,®ion,wand->exception);
5720 if (region_image == (Image *) NULL)
5721 return((MagickWand *) NULL);
5722 return(CloneMagickWandFromImages(wand,region_image));
5726 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5730 % 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 %
5734 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5736 % MagickGetImageRenderingIntent() gets the image rendering intent.
5738 % The format of the MagickGetImageRenderingIntent method is:
5740 % RenderingIntent MagickGetImageRenderingIntent(MagickWand *wand)
5742 % A description of each parameter follows:
5744 % o wand: the magick wand.
5747 WandExport RenderingIntent MagickGetImageRenderingIntent(MagickWand *wand)
5749 assert(wand != (MagickWand *) NULL);
5750 assert(wand->signature == WandSignature);
5751 if (wand->debug != MagickFalse)
5752 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5753 if (wand->images == (Image *) NULL)
5755 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5756 "ContainsNoImages","`%s'",wand->name);
5757 return(UndefinedIntent);
5759 return((RenderingIntent) wand->images->rendering_intent);
5763 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5767 % M a g i c k G e t I m a g e R e s o l u t i o n %
5771 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5773 % MagickGetImageResolution() gets the image X and Y resolution.
5775 % The format of the MagickGetImageResolution method is:
5777 % MagickBooleanType MagickGetImageResolution(MagickWand *wand,double *x,
5780 % A description of each parameter follows:
5782 % o wand: the magick wand.
5784 % o x: the image x-resolution.
5786 % o y: the image y-resolution.
5789 WandExport MagickBooleanType MagickGetImageResolution(MagickWand *wand,
5790 double *x,double *y)
5792 assert(wand != (MagickWand *) NULL);
5793 assert(wand->signature == WandSignature);
5794 if (wand->debug != MagickFalse)
5795 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5796 if (wand->images == (Image *) NULL)
5797 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5798 *x=wand->images->x_resolution;
5799 *y=wand->images->y_resolution;
5804 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5808 % M a g i c k G e t I m a g e S c e n e %
5812 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5814 % MagickGetImageScene() gets the image scene.
5816 % The format of the MagickGetImageScene method is:
5818 % size_t MagickGetImageScene(MagickWand *wand)
5820 % A description of each parameter follows:
5822 % o wand: the magick wand.
5825 WandExport size_t MagickGetImageScene(MagickWand *wand)
5827 assert(wand != (MagickWand *) NULL);
5828 assert(wand->signature == WandSignature);
5829 if (wand->debug != MagickFalse)
5830 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5831 if (wand->images == (Image *) NULL)
5832 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5833 return(wand->images->scene);
5837 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5841 % M a g i c k G e t I m a g e S i g n a t u r e %
5845 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5847 % MagickGetImageSignature() generates an SHA-256 message digest for the image
5850 % The format of the MagickGetImageSignature method is:
5852 % const char MagickGetImageSignature(MagickWand *wand)
5854 % A description of each parameter follows:
5856 % o wand: the magick wand.
5859 WandExport char *MagickGetImageSignature(MagickWand *wand)
5867 assert(wand != (MagickWand *) NULL);
5868 assert(wand->signature == WandSignature);
5869 if (wand->debug != MagickFalse)
5870 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5871 if (wand->images == (Image *) NULL)
5873 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5874 "ContainsNoImages","`%s'",wand->name);
5875 return((char *) NULL);
5877 status=SignatureImage(wand->images);
5878 if (status == MagickFalse)
5879 InheritException(wand->exception,&wand->images->exception);
5880 value=GetImageProperty(wand->images,"signature");
5881 if (value != (const char *) NULL)
5882 return(AcquireString(value));
5883 InheritException(wand->exception,&wand->images->exception);
5884 return((char *) NULL);
5888 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5892 % 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 %
5896 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5898 % MagickGetImageTicksPerSecond() gets the image ticks-per-second.
5900 % The format of the MagickGetImageTicksPerSecond method is:
5902 % size_t MagickGetImageTicksPerSecond(MagickWand *wand)
5904 % A description of each parameter follows:
5906 % o wand: the magick wand.
5909 WandExport size_t MagickGetImageTicksPerSecond(MagickWand *wand)
5911 assert(wand != (MagickWand *) NULL);
5912 assert(wand->signature == WandSignature);
5913 if (wand->debug != MagickFalse)
5914 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5915 if (wand->images == (Image *) NULL)
5916 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5917 return((size_t) wand->images->ticks_per_second);
5921 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5925 % M a g i c k G e t I m a g e T y p e %
5929 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5931 % MagickGetImageType() gets the potential image type:
5933 % Bilevel Grayscale GrayscaleMatte
5934 % Palette PaletteMatte TrueColor
5935 % TrueColorMatte ColorSeparation ColorSeparationMatte
5937 % To ensure the image type matches its potential, use MagickSetImageType():
5939 % (void) MagickSetImageType(wand,MagickGetImageType(wand));
5941 % The format of the MagickGetImageType method is:
5943 % ImageType MagickGetImageType(MagickWand *wand)
5945 % A description of each parameter follows:
5947 % o wand: the magick wand.
5950 WandExport ImageType MagickGetImageType(MagickWand *wand)
5952 assert(wand != (MagickWand *) NULL);
5953 assert(wand->signature == WandSignature);
5954 if (wand->debug != MagickFalse)
5955 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5956 if (wand->images == (Image *) NULL)
5958 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5959 "ContainsNoImages","`%s'",wand->name);
5960 return(UndefinedType);
5962 return(GetImageType(wand->images,wand->exception));
5966 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5970 % M a g i c k G e t I m a g e U n i t s %
5974 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5976 % MagickGetImageUnits() gets the image units of resolution.
5978 % The format of the MagickGetImageUnits method is:
5980 % ResolutionType MagickGetImageUnits(MagickWand *wand)
5982 % A description of each parameter follows:
5984 % o wand: the magick wand.
5987 WandExport ResolutionType MagickGetImageUnits(MagickWand *wand)
5989 assert(wand != (MagickWand *) NULL);
5990 assert(wand->signature == WandSignature);
5991 if (wand->debug != MagickFalse)
5992 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5993 if (wand->images == (Image *) NULL)
5995 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5996 "ContainsNoImages","`%s'",wand->name);
5997 return(UndefinedResolution);
5999 return(wand->images->units);
6003 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6007 % 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 %
6011 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6013 % MagickGetImageVirtualPixelMethod() returns the virtual pixel method for the
6016 % The format of the MagickGetImageVirtualPixelMethod method is:
6018 % VirtualPixelMethod MagickGetImageVirtualPixelMethod(MagickWand *wand)
6020 % A description of each parameter follows:
6022 % o wand: the magick wand.
6025 WandExport VirtualPixelMethod MagickGetImageVirtualPixelMethod(MagickWand *wand)
6027 assert(wand != (MagickWand *) NULL);
6028 assert(wand->signature == WandSignature);
6029 if (wand->debug != MagickFalse)
6030 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6031 if (wand->images == (Image *) NULL)
6033 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
6034 "ContainsNoImages","`%s'",wand->name);
6035 return(UndefinedVirtualPixelMethod);
6037 return(GetImageVirtualPixelMethod(wand->images));
6041 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6045 % M a g i c k G e t I m a g e W h i t e P o i n t %
6049 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6051 % MagickGetImageWhitePoint() returns the chromaticy white point.
6053 % The format of the MagickGetImageWhitePoint method is:
6055 % MagickBooleanType MagickGetImageWhitePoint(MagickWand *wand,double *x,
6058 % A description of each parameter follows:
6060 % o wand: the magick wand.
6062 % o x: the chromaticity white x-point.
6064 % o y: the chromaticity white y-point.
6067 WandExport MagickBooleanType MagickGetImageWhitePoint(MagickWand *wand,
6068 double *x,double *y)
6070 assert(wand != (MagickWand *) NULL);
6071 assert(wand->signature == WandSignature);
6072 if (wand->debug != MagickFalse)
6073 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6074 if (wand->images == (Image *) NULL)
6075 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6076 *x=wand->images->chromaticity.white_point.x;
6077 *y=wand->images->chromaticity.white_point.y;
6082 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6086 % M a g i c k G e t I m a g e W i d t h %
6090 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6092 % MagickGetImageWidth() returns the image width.
6094 % The format of the MagickGetImageWidth method is:
6096 % size_t MagickGetImageWidth(MagickWand *wand)
6098 % A description of each parameter follows:
6100 % o wand: the magick wand.
6103 WandExport size_t MagickGetImageWidth(MagickWand *wand)
6105 assert(wand != (MagickWand *) NULL);
6106 assert(wand->signature == WandSignature);
6107 if (wand->debug != MagickFalse)
6108 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6109 if (wand->images == (Image *) NULL)
6110 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6111 return(wand->images->columns);
6115 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6119 % M a g i c k G e t N u m b e r I m a g e s %
6123 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6125 % MagickGetNumberImages() returns the number of images associated with a
6128 % The format of the MagickGetNumberImages method is:
6130 % size_t MagickGetNumberImages(MagickWand *wand)
6132 % A description of each parameter follows:
6134 % o wand: the magick wand.
6137 WandExport size_t MagickGetNumberImages(MagickWand *wand)
6139 assert(wand != (MagickWand *) NULL);
6140 assert(wand->signature == WandSignature);
6141 if (wand->debug != MagickFalse)
6142 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6143 return(GetImageListLength(wand->images));
6147 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6151 % 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 %
6155 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6157 % MagickGetImageTotalInkDensity() gets the image total ink density.
6159 % The format of the MagickGetImageTotalInkDensity method is:
6161 % double MagickGetImageTotalInkDensity(MagickWand *wand)
6163 % A description of each parameter follows:
6165 % o wand: the magick wand.
6168 WandExport double MagickGetImageTotalInkDensity(MagickWand *wand)
6170 assert(wand != (MagickWand *) NULL);
6171 assert(wand->signature == WandSignature);
6172 if (wand->debug != MagickFalse)
6173 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6174 if (wand->images == (Image *) NULL)
6176 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
6177 "ContainsNoImages","`%s'",wand->name);
6180 return(GetImageTotalInkDensity(wand->images));
6184 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6188 % M a g i c k H a l d C l u t I m a g e %
6192 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6194 % MagickHaldClutImage() replaces colors in the image from a Hald color lookup
6195 % table. A Hald color lookup table is a 3-dimensional color cube mapped to 2
6196 % dimensions. Create it with the HALD coder. You can apply any color
6197 % transformation to the Hald image and then use this method to apply the
6198 % transform to the image.
6200 % The format of the MagickHaldClutImage method is:
6202 % MagickBooleanType MagickHaldClutImage(MagickWand *wand,
6203 % const MagickWand *hald_wand)
6204 % MagickBooleanType MagickHaldClutImageChannel(MagickWand *wand,
6205 % const ChannelType channel,const MagickWand *hald_wand)
6207 % A description of each parameter follows:
6209 % o wand: the magick wand.
6211 % o hald_image: the hald CLUT image.
6215 WandExport MagickBooleanType MagickHaldClutImage(MagickWand *wand,
6216 const MagickWand *hald_wand)
6221 status=MagickHaldClutImageChannel(wand,DefaultChannels,hald_wand);
6225 WandExport MagickBooleanType MagickHaldClutImageChannel(MagickWand *wand,
6226 const ChannelType channel,const MagickWand *hald_wand)
6231 assert(wand != (MagickWand *) NULL);
6232 assert(wand->signature == WandSignature);
6233 if (wand->debug != MagickFalse)
6234 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6235 if ((wand->images == (Image *) NULL) || (hald_wand->images == (Image *) NULL))
6236 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6237 status=HaldClutImageChannel(wand->images,channel,hald_wand->images);
6238 if (status == MagickFalse)
6239 InheritException(wand->exception,&wand->images->exception);
6244 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6248 % M a g i c k H a s N e x t I m a g e %
6252 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6254 % MagickHasNextImage() returns MagickTrue if the wand has more images when
6255 % traversing the list in the forward direction
6257 % The format of the MagickHasNextImage method is:
6259 % MagickBooleanType MagickHasNextImage(MagickWand *wand)
6261 % A description of each parameter follows:
6263 % o wand: the magick wand.
6266 WandExport MagickBooleanType MagickHasNextImage(MagickWand *wand)
6268 assert(wand != (MagickWand *) NULL);
6269 assert(wand->signature == WandSignature);
6270 if (wand->debug != MagickFalse)
6271 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6272 if (wand->images == (Image *) NULL)
6273 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6274 if (GetNextImageInList(wand->images) == (Image *) NULL)
6275 return(MagickFalse);
6280 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6284 % M a g i c k H a s P r e v i o u s I m a g e %
6288 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6290 % MagickHasPreviousImage() returns MagickTrue if the wand has more images when
6291 % traversing the list in the reverse direction
6293 % The format of the MagickHasPreviousImage method is:
6295 % MagickBooleanType MagickHasPreviousImage(MagickWand *wand)
6297 % A description of each parameter follows:
6299 % o wand: the magick wand.
6302 WandExport MagickBooleanType MagickHasPreviousImage(MagickWand *wand)
6304 assert(wand != (MagickWand *) NULL);
6305 assert(wand->signature == WandSignature);
6306 if (wand->debug != MagickFalse)
6307 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6308 if (wand->images == (Image *) NULL)
6309 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6310 if (GetPreviousImageInList(wand->images) == (Image *) NULL)
6311 return(MagickFalse);
6316 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6320 % M a g i c k I d e n t i f y I m a g e %
6324 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6326 % MagickIdentifyImage() identifies an image by printing its attributes to the
6327 % file. Attributes include the image width, height, size, and others.
6329 % The format of the MagickIdentifyImage method is:
6331 % const char *MagickIdentifyImage(MagickWand *wand)
6333 % A description of each parameter follows:
6335 % o wand: the magick wand.
6338 WandExport char *MagickIdentifyImage(MagickWand *wand)
6342 filename[MaxTextExtent];
6350 assert(wand != (MagickWand *) NULL);
6351 assert(wand->signature == WandSignature);
6352 if (wand->debug != MagickFalse)
6353 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6354 if (wand->images == (Image *) NULL)
6356 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
6357 "ContainsNoImages","`%s'",wand->name);
6358 return((char *) NULL);
6360 description=(char *) NULL;
6361 unique_file=AcquireUniqueFileResource(filename);
6363 if (unique_file != -1)
6364 file=fdopen(unique_file,"wb");
6365 if ((unique_file == -1) || (file == (FILE *) NULL))
6367 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
6368 "UnableToCreateTemporaryFile","`%s'",wand->name);
6369 return((char *) NULL);
6371 (void) IdentifyImage(wand->images,file,MagickTrue);
6372 (void) fclose(file);
6373 description=FileToString(filename,~0,wand->exception);
6374 (void) RelinquishUniqueFileResource(filename);
6375 return(description);
6379 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6383 % M a g i c k I m p l o d e I m a g e %
6387 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6389 % MagickImplodeImage() creates a new image that is a copy of an existing
6390 % one with the image pixels "implode" by the specified percentage. It
6391 % allocates the memory necessary for the new Image structure and returns a
6392 % pointer to the new image.
6394 % The format of the MagickImplodeImage method is:
6396 % MagickBooleanType MagickImplodeImage(MagickWand *wand,
6397 % const double radius)
6399 % A description of each parameter follows:
6401 % o wand: the magick wand.
6403 % o amount: Define the extent of the implosion.
6406 WandExport MagickBooleanType MagickImplodeImage(MagickWand *wand,
6407 const double amount)
6412 assert(wand != (MagickWand *) NULL);
6413 assert(wand->signature == WandSignature);
6414 if (wand->debug != MagickFalse)
6415 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6416 if (wand->images == (Image *) NULL)
6417 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6418 implode_image=ImplodeImage(wand->images,amount,wand->exception);
6419 if (implode_image == (Image *) NULL)
6420 return(MagickFalse);
6421 ReplaceImageInList(&wand->images,implode_image);
6426 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6430 % M a g i c k I m p o r t I m a g e P i x e l s %
6434 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6436 % MagickImportImagePixels() accepts pixel datand stores it in the image at the
6437 % location you specify. The method returns MagickFalse on success otherwise
6438 % MagickTrue if an error is encountered. The pixel data can be either char,
6439 % short int, int, ssize_t, float, or double in the order specified by map.
6441 % Suppose your want to upload the first scanline of a 640x480 image from
6442 % character data in red-green-blue order:
6444 % MagickImportImagePixels(wand,0,0,640,1,"RGB",CharPixel,pixels);
6446 % The format of the MagickImportImagePixels method is:
6448 % MagickBooleanType MagickImportImagePixels(MagickWand *wand,
6449 % const ssize_t x,const ssize_t y,const size_t columns,
6450 % const size_t rows,const char *map,const StorageType storage,
6451 % const void *pixels)
6453 % A description of each parameter follows:
6455 % o wand: the magick wand.
6457 % o x, y, columns, rows: These values define the perimeter of a region
6458 % of pixels you want to define.
6460 % o map: This string reflects the expected ordering of the pixel array.
6461 % It can be any combination or order of R = red, G = green, B = blue,
6462 % A = alpha (0 is transparent), O = opacity (0 is opaque), C = cyan,
6463 % Y = yellow, M = magenta, K = black, I = intensity (for grayscale),
6466 % o storage: Define the data type of the pixels. Float and double types are
6467 % expected to be normalized [0..1] otherwise [0..QuantumRange]. Choose from
6468 % these types: CharPixel, ShortPixel, IntegerPixel, LongPixel, FloatPixel,
6471 % o pixels: This array of values contain the pixel components as defined by
6472 % map and type. You must preallocate this array where the expected
6473 % length varies depending on the values of width, height, map, and type.
6476 WandExport MagickBooleanType MagickImportImagePixels(MagickWand *wand,
6477 const ssize_t x,const ssize_t y,const size_t columns,
6478 const size_t rows,const char *map,const StorageType storage,
6484 assert(wand != (MagickWand *) NULL);
6485 assert(wand->signature == WandSignature);
6486 if (wand->debug != MagickFalse)
6487 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6488 if (wand->images == (Image *) NULL)
6489 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6490 status=ImportImagePixels(wand->images,x,y,columns,rows,map,storage,pixels);
6491 if (status == MagickFalse)
6492 InheritException(wand->exception,&wand->images->exception);
6497 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6501 % 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 %
6505 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6507 % MagickInverseFourierTransformImage() implements the inverse discrete
6508 % Fourier transform (DFT) of the image either as a magnitude / phase or real /
6509 % imaginary image pair.
6511 % The format of the MagickInverseFourierTransformImage method is:
6513 % MagickBooleanType MagickInverseFourierTransformImage(
6514 % MagickWand *magnitude_wand,MagickWand *phase_wand,
6515 % const MagickBooleanType magnitude)
6517 % A description of each parameter follows:
6519 % o magnitude_wand: the magnitude or real wand.
6521 % o phase_wand: the phase or imaginary wand.
6523 % o magnitude: if true, return as magnitude / phase pair otherwise a real /
6524 % imaginary image pair.
6527 WandExport MagickBooleanType MagickInverseFourierTransformImage(
6528 MagickWand *magnitude_wand,MagickWand *phase_wand,
6529 const MagickBooleanType magnitude)
6537 assert(magnitude_wand != (MagickWand *) NULL);
6538 assert(magnitude_wand->signature == WandSignature);
6539 if (magnitude_wand->debug != MagickFalse)
6540 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",
6541 magnitude_wand->name);
6542 wand=magnitude_wand;
6543 if (magnitude_wand->images == (Image *) NULL)
6544 ThrowWandException(WandError,"ContainsNoImages",
6545 magnitude_wand->name);
6546 assert(phase_wand != (MagickWand *) NULL);
6547 assert(phase_wand->signature == WandSignature);
6548 inverse_image=InverseFourierTransformImage(magnitude_wand->images,
6549 phase_wand->images,magnitude,wand->exception);
6550 if (inverse_image == (Image *) NULL)
6551 return(MagickFalse);
6552 ReplaceImageInList(&wand->images,inverse_image);
6557 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6561 % M a g i c k L a b e l I m a g e %
6565 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6567 % MagickLabelImage() adds a label to your image.
6569 % The format of the MagickLabelImage method is:
6571 % MagickBooleanType MagickLabelImage(MagickWand *wand,const char *label)
6573 % A description of each parameter follows:
6575 % o wand: the magick wand.
6577 % o label: the image label.
6580 WandExport MagickBooleanType MagickLabelImage(MagickWand *wand,
6586 assert(wand != (MagickWand *) NULL);
6587 assert(wand->signature == WandSignature);
6588 if (wand->debug != MagickFalse)
6589 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6590 if (wand->images == (Image *) NULL)
6591 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6592 status=SetImageProperty(wand->images,"label",label);
6593 if (status == MagickFalse)
6594 InheritException(wand->exception,&wand->images->exception);
6599 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6603 % M a g i c k L e v e l I m a g e %
6607 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6609 % MagickLevelImage() adjusts the levels of an image by scaling the colors
6610 % falling between specified white and black points to the full available
6611 % quantum range. The parameters provided represent the black, mid, and white
6612 % points. The black point specifies the darkest color in the image. Colors
6613 % darker than the black point are set to zero. Mid point specifies a gamma
6614 % correction to apply to the image. White point specifies the lightest color
6615 % in the image. Colors brighter than the white point are set to the maximum
6618 % The format of the MagickLevelImage method is:
6620 % MagickBooleanType MagickLevelImage(MagickWand *wand,
6621 % const double black_point,const double gamma,const double white_point)
6622 % MagickBooleanType MagickLevelImageChannel(MagickWand *wand,
6623 % const ChannelType channel,const double black_point,const double gamma,
6624 % const double white_point)
6626 % A description of each parameter follows:
6628 % o wand: the magick wand.
6630 % o channel: Identify which channel to level: RedChannel, GreenChannel,
6632 % o black_point: the black point.
6634 % o gamma: the gamma.
6636 % o white_point: the white point.
6640 WandExport MagickBooleanType MagickLevelImage(MagickWand *wand,
6641 const double black_point,const double gamma,const double white_point)
6646 status=MagickLevelImageChannel(wand,DefaultChannels,black_point,gamma,
6651 WandExport MagickBooleanType MagickLevelImageChannel(MagickWand *wand,
6652 const ChannelType channel,const double black_point,const double gamma,
6653 const double white_point)
6658 assert(wand != (MagickWand *) NULL);
6659 assert(wand->signature == WandSignature);
6660 if (wand->debug != MagickFalse)
6661 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6662 if (wand->images == (Image *) NULL)
6663 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6664 status=LevelImageChannel(wand->images,channel,black_point,white_point,gamma);
6665 if (status == MagickFalse)
6666 InheritException(wand->exception,&wand->images->exception);
6671 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6675 % M a g i c k L i n e a r S t r e t c h I m a g e %
6679 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6681 % MagickLinearStretchImage() stretches with saturation the image intensity.
6683 % You can also reduce the influence of a particular channel with a gamma
6686 % The format of the MagickLinearStretchImage method is:
6688 % MagickBooleanType MagickLinearStretchImage(MagickWand *wand,
6689 % const double black_point,const double white_point)
6691 % A description of each parameter follows:
6693 % o wand: the magick wand.
6695 % o black_point: the black point.
6697 % o white_point: the white point.
6700 WandExport MagickBooleanType MagickLinearStretchImage(MagickWand *wand,
6701 const double black_point,const double white_point)
6706 assert(wand != (MagickWand *) NULL);
6707 assert(wand->signature == WandSignature);
6708 if (wand->debug != MagickFalse)
6709 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6710 if (wand->images == (Image *) NULL)
6711 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6712 status=LinearStretchImage(wand->images,black_point,white_point);
6713 if (status == MagickFalse)
6714 InheritException(wand->exception,&wand->images->exception);
6719 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6723 % M a g i c k L i q u i d R e s c a l e I m a g e %
6727 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6729 % MagickLiquidRescaleImage() rescales image with seam carving.
6731 % MagickBooleanType MagickLiquidRescaleImage(MagickWand *wand,
6732 % const size_t columns,const size_t rows,
6733 % const double delta_x,const double rigidity)
6735 % A description of each parameter follows:
6737 % o wand: the magick wand.
6739 % o columns: the number of columns in the scaled image.
6741 % o rows: the number of rows in the scaled image.
6743 % o delta_x: maximum seam transversal step (0 means straight seams).
6745 % o rigidity: introduce a bias for non-straight seams (typically 0).
6748 WandExport MagickBooleanType MagickLiquidRescaleImage(MagickWand *wand,
6749 const size_t columns,const size_t rows,const double delta_x,
6750 const double rigidity)
6755 assert(wand != (MagickWand *) NULL);
6756 assert(wand->signature == WandSignature);
6757 if (wand->debug != MagickFalse)
6758 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6759 if (wand->images == (Image *) NULL)
6760 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6761 rescale_image=LiquidRescaleImage(wand->images,columns,rows,delta_x,
6762 rigidity,wand->exception);
6763 if (rescale_image == (Image *) NULL)
6764 return(MagickFalse);
6765 ReplaceImageInList(&wand->images,rescale_image);
6770 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6774 % M a g i c k M a g n i f y I m a g e %
6778 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6780 % MagickMagnifyImage() is a convenience method that scales an image
6781 % proportionally to twice its original size.
6783 % The format of the MagickMagnifyImage method is:
6785 % MagickBooleanType MagickMagnifyImage(MagickWand *wand)
6787 % A description of each parameter follows:
6789 % o wand: the magick wand.
6792 WandExport MagickBooleanType MagickMagnifyImage(MagickWand *wand)
6797 assert(wand != (MagickWand *) NULL);
6798 assert(wand->signature == WandSignature);
6799 if (wand->debug != MagickFalse)
6800 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6801 if (wand->images == (Image *) NULL)
6802 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6803 magnify_image=MagnifyImage(wand->images,wand->exception);
6804 if (magnify_image == (Image *) NULL)
6805 return(MagickFalse);
6806 ReplaceImageInList(&wand->images,magnify_image);
6811 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6815 % M a g i c k M e d i a n F i l t e r I m a g e %
6819 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6821 % MagickMedianFilterImage() applies a digital filter that improves the quality
6822 % of a noisy image. Each pixel is replaced by the median in a set of
6823 % neighboring pixels as defined by radius.
6825 % The format of the MagickMedianFilterImage method is:
6827 % MagickBooleanType MagickMedianFilterImage(MagickWand *wand,
6828 % const double radius)
6830 % A description of each parameter follows:
6832 % o wand: the magick wand.
6834 % o radius: the radius of the pixel neighborhood.
6837 WandExport MagickBooleanType MagickMedianFilterImage(MagickWand *wand,
6838 const double radius)
6843 assert(wand != (MagickWand *) NULL);
6844 assert(wand->signature == WandSignature);
6845 if (wand->debug != MagickFalse)
6846 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6847 if (wand->images == (Image *) NULL)
6848 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6849 median_image=MedianFilterImage(wand->images,radius,wand->exception);
6850 if (median_image == (Image *) NULL)
6851 return(MagickFalse);
6852 ReplaceImageInList(&wand->images,median_image);
6857 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6861 % M a g i c k M e r g e I m a g e L a y e r s %
6865 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6867 % MagickMergeImageLayers() composes all the image layers from the current given
6868 % image onward to produce a single image of the merged layers.
6870 % The inital canvas's size depends on the given ImageLayerMethod, and is
6871 % initialized using the first images background color. The images
6872 % are then compositied onto that image in sequence using the given
6873 % composition that has been assigned to each individual image.
6875 % The format of the MagickMergeImageLayers method is:
6877 % MagickWand *MagickMergeImageLayers(MagickWand *wand,
6878 % const ImageLayerMethod method)
6880 % A description of each parameter follows:
6882 % o wand: the magick wand.
6884 % o method: the method of selecting the size of the initial canvas.
6886 % MergeLayer: Merge all layers onto a canvas just large enough
6887 % to hold all the actual images. The virtual canvas of the
6888 % first image is preserved but otherwise ignored.
6890 % FlattenLayer: Use the virtual canvas size of first image.
6891 % Images which fall outside this canvas is clipped.
6892 % This can be used to 'fill out' a given virtual canvas.
6894 % MosaicLayer: Start with the virtual canvas of the first image,
6895 % enlarging left and right edges to contain all images.
6896 % Images with negative offsets will be clipped.
6899 WandExport MagickWand *MagickMergeImageLayers(MagickWand *wand,
6900 const ImageLayerMethod method)
6905 assert(wand != (MagickWand *) NULL);
6906 assert(wand->signature == WandSignature);
6907 if (wand->debug != MagickFalse)
6908 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6909 if (wand->images == (Image *) NULL)
6910 return((MagickWand *) NULL);
6911 mosaic_image=MergeImageLayers(wand->images,method,wand->exception);
6912 if (mosaic_image == (Image *) NULL)
6913 return((MagickWand *) NULL);
6914 return(CloneMagickWandFromImages(wand,mosaic_image));
6918 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6922 % M a g i c k M i n i f y I m a g e %
6926 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6928 % MagickMinifyImage() is a convenience method that scales an image
6929 % proportionally to one-half its original size
6931 % The format of the MagickMinifyImage method is:
6933 % MagickBooleanType MagickMinifyImage(MagickWand *wand)
6935 % A description of each parameter follows:
6937 % o wand: the magick wand.
6940 WandExport MagickBooleanType MagickMinifyImage(MagickWand *wand)
6945 assert(wand != (MagickWand *) NULL);
6946 assert(wand->signature == WandSignature);
6947 if (wand->debug != MagickFalse)
6948 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6949 if (wand->images == (Image *) NULL)
6950 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6951 minify_image=MinifyImage(wand->images,wand->exception);
6952 if (minify_image == (Image *) NULL)
6953 return(MagickFalse);
6954 ReplaceImageInList(&wand->images,minify_image);
6959 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6963 % M a g i c k M o d u l a t e I m a g e %
6967 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6969 % MagickModulateImage() lets you control the brightness, saturation, and hue
6970 % of an image. Hue is the percentage of absolute rotation from the current
6971 % position. For example 50 results in a counter-clockwise rotation of 90
6972 % degrees, 150 results in a clockwise rotation of 90 degrees, with 0 and 200
6973 % both resulting in a rotation of 180 degrees.
6975 % To increase the color brightness by 20% and decrease the color saturation by
6976 % 10% and leave the hue unchanged, use: 120,90,100.
6978 % The format of the MagickModulateImage method is:
6980 % MagickBooleanType MagickModulateImage(MagickWand *wand,
6981 % const double brightness,const double saturation,const double hue)
6983 % A description of each parameter follows:
6985 % o wand: the magick wand.
6987 % o brightness: the percent change in brighness.
6989 % o saturation: the percent change in saturation.
6991 % o hue: the percent change in hue.
6994 WandExport MagickBooleanType MagickModulateImage(MagickWand *wand,
6995 const double brightness,const double saturation,const double hue)
6998 modulate[MaxTextExtent];
7003 assert(wand != (MagickWand *) NULL);
7004 assert(wand->signature == WandSignature);
7005 if (wand->debug != MagickFalse)
7006 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7007 if (wand->images == (Image *) NULL)
7008 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7009 (void) FormatMagickString(modulate,MaxTextExtent,"%g,%g,%g",
7010 brightness,saturation,hue);
7011 status=ModulateImage(wand->images,modulate);
7012 if (status == MagickFalse)
7013 InheritException(wand->exception,&wand->images->exception);
7018 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7022 % M a g i c k M o n t a g e I m a g e %
7026 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7028 % MagickMontageImage() creates a composite image by combining several
7029 % separate images. The images are tiled on the composite image with the name
7030 % of the image optionally appearing just below the individual tile.
7032 % The format of the MagickMontageImage method is:
7034 % MagickWand *MagickMontageImage(MagickWand *wand,
7035 % const DrawingWand drawing_wand,const char *tile_geometry,
7036 % const char *thumbnail_geometry,const MontageMode mode,
7037 % const char *frame)
7039 % A description of each parameter follows:
7041 % o wand: the magick wand.
7043 % o drawing_wand: the drawing wand. The font name, size, and color are
7044 % obtained from this wand.
7046 % o tile_geometry: the number of tiles per row and page (e.g. 6x4+0+0).
7048 % o thumbnail_geometry: Preferred image size and border size of each
7049 % thumbnail (e.g. 120x120+4+3>).
7051 % o mode: Thumbnail framing mode: Frame, Unframe, or Concatenate.
7053 % o frame: Surround the image with an ornamental border (e.g. 15x15+3+3).
7054 % The frame color is that of the thumbnail's matte color.
7057 WandExport MagickWand *MagickMontageImage(MagickWand *wand,
7058 const DrawingWand *drawing_wand,const char *tile_geometry,
7059 const char *thumbnail_geometry,const MontageMode mode,const char *frame)
7073 assert(wand != (MagickWand *) NULL);
7074 assert(wand->signature == WandSignature);
7075 if (wand->debug != MagickFalse)
7076 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7077 if (wand->images == (Image *) NULL)
7078 return((MagickWand *) NULL);
7079 montage_info=CloneMontageInfo(wand->image_info,(MontageInfo *) NULL);
7084 (void) CloneString(&montage_info->frame,"15x15+3+3");
7085 montage_info->shadow=MagickTrue;
7090 montage_info->frame=(char *) NULL;
7091 montage_info->shadow=MagickFalse;
7092 montage_info->border_width=0;
7095 case ConcatenateMode:
7097 montage_info->frame=(char *) NULL;
7098 montage_info->shadow=MagickFalse;
7099 (void) CloneString(&montage_info->geometry,"+0+0");
7100 montage_info->border_width=0;
7106 font=DrawGetFont(drawing_wand);
7107 if (font != (char *) NULL)
7108 (void) CloneString(&montage_info->font,font);
7109 if (frame != (char *) NULL)
7110 (void) CloneString(&montage_info->frame,frame);
7111 montage_info->pointsize=DrawGetFontSize(drawing_wand);
7112 pixel_wand=NewPixelWand();
7113 DrawGetFillColor(drawing_wand,pixel_wand);
7114 PixelGetQuantumColor(pixel_wand,&montage_info->fill);
7115 DrawGetStrokeColor(drawing_wand,pixel_wand);
7116 PixelGetQuantumColor(pixel_wand,&montage_info->stroke);
7117 pixel_wand=DestroyPixelWand(pixel_wand);
7118 if (thumbnail_geometry != (char *) NULL)
7119 (void) CloneString(&montage_info->geometry,thumbnail_geometry);
7120 if (tile_geometry != (char *) NULL)
7121 (void) CloneString(&montage_info->tile,tile_geometry);
7122 montage_image=MontageImageList(wand->image_info,montage_info,wand->images,
7124 montage_info=DestroyMontageInfo(montage_info);
7125 if (montage_image == (Image *) NULL)
7126 return((MagickWand *) NULL);
7127 return(CloneMagickWandFromImages(wand,montage_image));
7131 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7135 % M a g i c k M o r p h I m a g e s %
7139 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7141 % MagickMorphImages() method morphs a set of images. Both the image pixels
7142 % and size are linearly interpolated to give the appearance of a
7143 % meta-morphosis from one image to the next.
7145 % The format of the MagickMorphImages method is:
7147 % MagickWand *MagickMorphImages(MagickWand *wand,
7148 % const size_t number_frames)
7150 % A description of each parameter follows:
7152 % o wand: the magick wand.
7154 % o number_frames: the number of in-between images to generate.
7157 WandExport MagickWand *MagickMorphImages(MagickWand *wand,
7158 const size_t number_frames)
7163 assert(wand != (MagickWand *) NULL);
7164 assert(wand->signature == WandSignature);
7165 if (wand->debug != MagickFalse)
7166 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7167 if (wand->images == (Image *) NULL)
7168 return((MagickWand *) NULL);
7169 morph_image=MorphImages(wand->images,number_frames,wand->exception);
7170 if (morph_image == (Image *) NULL)
7171 return((MagickWand *) NULL);
7172 return(CloneMagickWandFromImages(wand,morph_image));
7176 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7180 % M a g i c k M o r p h o l o g y I m a g e %
7184 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7186 % MagickMorphologyImage() applies a user supplied kernel to the image
7187 % according to the given mophology method.
7189 % The format of the MagickMorphologyImage method is:
7191 % MagickBooleanType MagickMorphologyImage(MagickWand *wand,
7192 % MorphologyMethod method,const ssize_t iterations,KernelInfo *kernel)
7193 % MagickBooleanType MagickMorphologyImageChannel(MagickWand *wand,
7194 % ChannelType channel,MorphologyMethod method,const ssize_t iterations,
7195 % KernelInfo *kernel)
7197 % A description of each parameter follows:
7199 % o wand: the magick wand.
7201 % o channel: the image channel(s).
7203 % o method: the morphology method to be applied.
7205 % o iterations: apply the operation this many times (or no change).
7206 % A value of -1 means loop until no change found. How this is applied
7207 % may depend on the morphology method. Typically this is a value of 1.
7209 % o kernel: An array of doubles representing the morphology kernel.
7213 WandExport MagickBooleanType MagickMorphologyImage(MagickWand *wand,
7214 MorphologyMethod method,const ssize_t iterations,KernelInfo *kernel)
7219 status=MagickMorphologyImageChannel(wand,DefaultChannels,method,iterations,
7224 WandExport MagickBooleanType MagickMorphologyImageChannel(MagickWand *wand,
7225 const ChannelType channel,MorphologyMethod method,const ssize_t iterations,
7231 assert(wand != (MagickWand *) NULL);
7232 assert(wand->signature == WandSignature);
7233 if (wand->debug != MagickFalse)
7234 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7235 if (kernel == (const KernelInfo *) NULL)
7236 return(MagickFalse);
7237 if (wand->images == (Image *) NULL)
7238 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7239 morphology_image=MorphologyImageChannel(wand->images,channel,method,
7240 iterations,kernel,wand->exception);
7241 if (morphology_image == (Image *) NULL)
7242 return(MagickFalse);
7243 ReplaceImageInList(&wand->images,morphology_image);
7248 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7252 % M a g i c k M o t i o n B l u r I m a g e %
7256 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7258 % MagickMotionBlurImage() simulates motion blur. We convolve the image with a
7259 % Gaussian operator of the given radius and standard deviation (sigma).
7260 % For reasonable results, radius should be larger than sigma. Use a
7261 % radius of 0 and MotionBlurImage() selects a suitable radius for you.
7262 % Angle gives the angle of the blurring motion.
7264 % The format of the MagickMotionBlurImage method is:
7266 % MagickBooleanType MagickMotionBlurImage(MagickWand *wand,
7267 % const double radius,const double sigma,const double angle)
7268 % MagickBooleanType MagickMotionBlurImageChannel(MagickWand *wand,
7269 % const ChannelType channel,const double radius,const double sigma,
7270 % const double angle)
7272 % A description of each parameter follows:
7274 % o wand: the magick wand.
7276 % o channel: the image channel(s).
7278 % o radius: the radius of the Gaussian, in pixels, not counting
7281 % o sigma: the standard deviation of the Gaussian, in pixels.
7283 % o angle: Apply the effect along this angle.
7287 WandExport MagickBooleanType MagickMotionBlurImage(MagickWand *wand,
7288 const double radius,const double sigma,const double angle)
7293 status=MagickMotionBlurImageChannel(wand,DefaultChannels,radius,sigma,angle);
7297 WandExport MagickBooleanType MagickMotionBlurImageChannel(MagickWand *wand,
7298 const ChannelType channel,const double radius,const double sigma,
7304 assert(wand != (MagickWand *) NULL);
7305 assert(wand->signature == WandSignature);
7306 if (wand->debug != MagickFalse)
7307 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7308 if (wand->images == (Image *) NULL)
7309 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7310 blur_image=MotionBlurImageChannel(wand->images,channel,radius,sigma,angle,
7312 if (blur_image == (Image *) NULL)
7313 return(MagickFalse);
7314 ReplaceImageInList(&wand->images,blur_image);
7319 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7323 % M a g i c k N e g a t e I m a g e %
7327 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7329 % MagickNegateImage() negates the colors in the reference image. The
7330 % Grayscale option means that only grayscale values within the image are
7333 % You can also reduce the influence of a particular channel with a gamma
7336 % The format of the MagickNegateImage method is:
7338 % MagickBooleanType MagickNegateImage(MagickWand *wand,
7339 % const MagickBooleanType gray)
7340 % MagickBooleanType MagickNegateImage(MagickWand *wand,
7341 % const ChannelType channel,const MagickBooleanType gray)
7343 % A description of each parameter follows:
7345 % o wand: the magick wand.
7347 % o channel: the image channel(s).
7349 % o gray: If MagickTrue, only negate grayscale pixels within the image.
7353 WandExport MagickBooleanType MagickNegateImage(MagickWand *wand,
7354 const MagickBooleanType gray)
7359 status=MagickNegateImageChannel(wand,DefaultChannels,gray);
7363 WandExport MagickBooleanType MagickNegateImageChannel(MagickWand *wand,
7364 const ChannelType channel,const MagickBooleanType gray)
7369 assert(wand != (MagickWand *) NULL);
7370 assert(wand->signature == WandSignature);
7371 if (wand->debug != MagickFalse)
7372 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7373 if (wand->images == (Image *) NULL)
7374 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7375 status=NegateImageChannel(wand->images,channel,gray);
7376 if (status == MagickFalse)
7377 InheritException(wand->exception,&wand->images->exception);
7382 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7386 % M a g i c k N e w I m a g e %
7390 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7392 % MagickNewImage() adds a blank image canvas of the specified size and
7393 % background color to the wand.
7395 % The format of the MagickNewImage method is:
7397 % MagickBooleanType MagickNewImage(MagickWand *wand,
7398 % const size_t columns,const size_t rows,
7399 % const PixelWand *background)
7401 % A description of each parameter follows:
7403 % o wand: the magick wand.
7405 % o width: the image width.
7407 % o height: the image height.
7409 % o background: the image color.
7412 WandExport MagickBooleanType MagickNewImage(MagickWand *wand,
7413 const size_t width,const size_t height,
7414 const PixelWand *background)
7422 assert(wand != (MagickWand *) NULL);
7423 assert(wand->signature == WandSignature);
7424 if (wand->debug != MagickFalse)
7425 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7426 PixelGetMagickColor(background,&pixel);
7427 images=NewMagickImage(wand->image_info,width,height,&pixel);
7428 if (images == (Image *) NULL)
7429 return(MagickFalse);
7430 if (images->exception.severity != UndefinedException)
7431 InheritException(wand->exception,&images->exception);
7432 return(InsertImageInWand(wand,images));
7436 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7440 % M a g i c k N e x t I m a g e %
7444 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7446 % MagickNextImage() associates the next image in the image list with a magick
7449 % The format of the MagickNextImage method is:
7451 % MagickBooleanType MagickNextImage(MagickWand *wand)
7453 % A description of each parameter follows:
7455 % o wand: the magick wand.
7458 WandExport MagickBooleanType MagickNextImage(MagickWand *wand)
7460 assert(wand != (MagickWand *) NULL);
7461 assert(wand->signature == WandSignature);
7462 if (wand->debug != MagickFalse)
7463 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7464 if (wand->images == (Image *) NULL)
7465 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7466 if (wand->pend != MagickFalse)
7468 wand->pend=MagickFalse;
7471 if (GetNextImageInList(wand->images) == (Image *) NULL)
7473 wand->pend=MagickTrue;
7474 return(MagickFalse);
7476 wand->images=GetNextImageInList(wand->images);
7481 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7485 % M a g i c k N o r m a l i z e I m a g e %
7489 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7491 % MagickNormalizeImage() enhances the contrast of a color image by adjusting
7492 % the pixels color to span the entire range of colors available
7494 % You can also reduce the influence of a particular channel with a gamma
7497 % The format of the MagickNormalizeImage method is:
7499 % MagickBooleanType MagickNormalizeImage(MagickWand *wand)
7500 % MagickBooleanType MagickNormalizeImageChannel(MagickWand *wand,
7501 % const ChannelType channel)
7503 % A description of each parameter follows:
7505 % o wand: the magick wand.
7507 % o channel: the image channel(s).
7511 WandExport MagickBooleanType MagickNormalizeImage(MagickWand *wand)
7516 status=MagickNormalizeImageChannel(wand,DefaultChannels);
7520 WandExport MagickBooleanType MagickNormalizeImageChannel(MagickWand *wand,
7521 const ChannelType channel)
7526 assert(wand != (MagickWand *) NULL);
7527 assert(wand->signature == WandSignature);
7528 if (wand->debug != MagickFalse)
7529 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7530 if (wand->images == (Image *) NULL)
7531 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7532 status=NormalizeImageChannel(wand->images,channel);
7533 if (status == MagickFalse)
7534 InheritException(wand->exception,&wand->images->exception);
7539 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7543 % M a g i c k O i l P a i n t I m a g e %
7547 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7549 % MagickOilPaintImage() applies a special effect filter that simulates an oil
7550 % painting. Each pixel is replaced by the most frequent color occurring
7551 % in a circular region defined by radius.
7553 % The format of the MagickOilPaintImage method is:
7555 % MagickBooleanType MagickOilPaintImage(MagickWand *wand,
7556 % const double radius)
7558 % A description of each parameter follows:
7560 % o wand: the magick wand.
7562 % o radius: the radius of the circular neighborhood.
7565 WandExport MagickBooleanType MagickOilPaintImage(MagickWand *wand,
7566 const double radius)
7571 assert(wand != (MagickWand *) NULL);
7572 assert(wand->signature == WandSignature);
7573 if (wand->debug != MagickFalse)
7574 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7575 if (wand->images == (Image *) NULL)
7576 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7577 paint_image=OilPaintImage(wand->images,radius,wand->exception);
7578 if (paint_image == (Image *) NULL)
7579 return(MagickFalse);
7580 ReplaceImageInList(&wand->images,paint_image);
7585 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7589 % M a g i c k O p a q u e P a i n t I m a g e %
7593 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7595 % MagickOpaquePaintImage() changes any pixel that matches color with the color
7598 % The format of the MagickOpaquePaintImage method is:
7600 % MagickBooleanType MagickOpaquePaintImage(MagickWand *wand,
7601 % const PixelWand *target,const PixelWand *fill,const double fuzz,
7602 % const MagickBooleanType invert)
7603 % MagickBooleanType MagickOpaquePaintImageChannel(MagickWand *wand,
7604 % const ChannelType channel,const PixelWand *target,
7605 % const PixelWand *fill,const double fuzz,const MagickBooleanType invert)
7607 % A description of each parameter follows:
7609 % o wand: the magick wand.
7611 % o channel: the channel(s).
7613 % o target: Change this target color to the fill color within the image.
7615 % o fill: the fill pixel wand.
7617 % o fuzz: By default target must match a particular pixel color
7618 % exactly. However, in many cases two colors may differ by a small amount.
7619 % The fuzz member of image defines how much tolerance is acceptable to
7620 % consider two colors as the same. For example, set fuzz to 10 and the
7621 % color red at intensities of 100 and 102 respectively are now interpreted
7622 % as the same color for the purposes of the floodfill.
7624 % o invert: paint any pixel that does not match the target color.
7628 WandExport MagickBooleanType MagickOpaquePaintImage(MagickWand *wand,
7629 const PixelWand *target,const PixelWand *fill,const double fuzz,
7630 const MagickBooleanType invert)
7635 status=MagickOpaquePaintImageChannel(wand,DefaultChannels,target,fill,fuzz,
7640 WandExport MagickBooleanType MagickOpaquePaintImageChannel(MagickWand *wand,
7641 const ChannelType channel,const PixelWand *target,const PixelWand *fill,
7642 const double fuzz,const MagickBooleanType invert)
7651 assert(wand != (MagickWand *) NULL);
7652 assert(wand->signature == WandSignature);
7653 if (wand->debug != MagickFalse)
7654 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7655 if (wand->images == (Image *) NULL)
7656 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7657 PixelGetMagickColor(target,&target_pixel);
7658 PixelGetMagickColor(fill,&fill_pixel);
7659 wand->images->fuzz=fuzz;
7660 status=OpaquePaintImageChannel(wand->images,channel,&target_pixel,
7661 &fill_pixel,invert);
7662 if (status == MagickFalse)
7663 InheritException(wand->exception,&wand->images->exception);
7668 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7672 % 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 %
7676 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7678 % MagickOptimizeImageLayers() compares each image the GIF disposed forms of the
7679 % previous image in the sequence. From this it attempts to select the
7680 % smallest cropped image to replace each frame, while preserving the results
7683 % The format of the MagickOptimizeImageLayers method is:
7685 % MagickWand *MagickOptimizeImageLayers(MagickWand *wand)
7687 % A description of each parameter follows:
7689 % o wand: the magick wand.
7692 WandExport MagickWand *MagickOptimizeImageLayers(MagickWand *wand)
7697 assert(wand != (MagickWand *) NULL);
7698 assert(wand->signature == WandSignature);
7699 if (wand->debug != MagickFalse)
7700 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7701 if (wand->images == (Image *) NULL)
7702 return((MagickWand *) NULL);
7703 optimize_image=OptimizeImageLayers(wand->images,wand->exception);
7704 if (optimize_image == (Image *) NULL)
7705 return((MagickWand *) NULL);
7706 return(CloneMagickWandFromImages(wand,optimize_image));
7710 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7714 % 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 %
7718 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7720 % MagickOrderedPosterizeImage() performs an ordered dither based on a number
7721 % of pre-defined dithering threshold maps, but over multiple intensity levels,
7722 % which can be different for different channels, according to the input
7725 % The format of the MagickOrderedPosterizeImage method is:
7727 % MagickBooleanType MagickOrderedPosterizeImage(MagickWand *wand,
7728 % const char *threshold_map)
7729 % MagickBooleanType MagickOrderedPosterizeImageChannel(MagickWand *wand,
7730 % const ChannelType channel,const char *threshold_map)
7732 % A description of each parameter follows:
7734 % o image: the image.
7736 % o channel: the channel or channels to be thresholded.
7738 % o threshold_map: A string containing the name of the threshold dither
7739 % map to use, followed by zero or more numbers representing the number of
7740 % color levels tho dither between.
7742 % Any level number less than 2 is equivelent to 2, and means only binary
7743 % dithering will be applied to each color channel.
7745 % No numbers also means a 2 level (bitmap) dither will be applied to all
7746 % channels, while a single number is the number of levels applied to each
7747 % channel in sequence. More numbers will be applied in turn to each of
7748 % the color channels.
7750 % For example: "o3x3,6" generates a 6 level posterization of the image
7751 % with a ordered 3x3 diffused pixel dither being applied between each
7752 % level. While checker,8,8,4 will produce a 332 colormaped image with
7753 % only a single checkerboard hash pattern (50% grey) between each color
7754 % level, to basically double the number of color levels with a bare
7755 % minimim of dithering.
7759 WandExport MagickBooleanType MagickOrderedPosterizeImage(MagickWand *wand,
7760 const char *threshold_map)
7765 status=MagickOrderedPosterizeImageChannel(wand,DefaultChannels,threshold_map);
7769 WandExport MagickBooleanType MagickOrderedPosterizeImageChannel(
7770 MagickWand *wand,const ChannelType channel,const char *threshold_map)
7775 assert(wand != (MagickWand *) NULL);
7776 assert(wand->signature == WandSignature);
7777 if (wand->debug != MagickFalse)
7778 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7779 if (wand->images == (Image *) NULL)
7780 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7781 status=OrderedPosterizeImageChannel(wand->images,channel,threshold_map,
7787 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7791 % M a g i c k P i n g I m a g e %
7795 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7797 % MagickPingImage() is like MagickReadImage() except the only valid
7798 % information returned is the image width, height, size, and format. It
7799 % is designed to efficiently obtain this information from a file without
7800 % reading the entire image sequence into memory.
7802 % The format of the MagickPingImage method is:
7804 % MagickBooleanType MagickPingImage(MagickWand *wand,const char *filename)
7806 % A description of each parameter follows:
7808 % o wand: the magick wand.
7810 % o filename: the image filename.
7813 WandExport MagickBooleanType MagickPingImage(MagickWand *wand,
7814 const char *filename)
7822 assert(wand != (MagickWand *) NULL);
7823 assert(wand->signature == WandSignature);
7824 if (wand->debug != MagickFalse)
7825 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7826 ping_info=CloneImageInfo(wand->image_info);
7827 if (filename != (const char *) NULL)
7828 (void) CopyMagickString(ping_info->filename,filename,MaxTextExtent);
7829 images=PingImage(ping_info,wand->exception);
7830 ping_info=DestroyImageInfo(ping_info);
7831 if (images == (Image *) NULL)
7832 return(MagickFalse);
7833 return(InsertImageInWand(wand,images));
7837 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7841 % M a g i c k P i n g I m a g e B l o b %
7845 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7847 % MagickPingImageBlob() pings an image or image sequence from a blob.
7849 % The format of the MagickPingImageBlob method is:
7851 % MagickBooleanType MagickPingImageBlob(MagickWand *wand,
7852 % const void *blob,const size_t length)
7854 % A description of each parameter follows:
7856 % o wand: the magick wand.
7860 % o length: the blob length.
7863 WandExport MagickBooleanType MagickPingImageBlob(MagickWand *wand,
7864 const void *blob,const size_t length)
7872 assert(wand != (MagickWand *) NULL);
7873 assert(wand->signature == WandSignature);
7874 if (wand->debug != MagickFalse)
7875 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7876 read_info=CloneImageInfo(wand->image_info);
7877 SetImageInfoBlob(read_info,blob,length);
7878 images=PingImage(read_info,wand->exception);
7879 read_info=DestroyImageInfo(read_info);
7880 if (images == (Image *) NULL)
7881 return(MagickFalse);
7882 return(InsertImageInWand(wand,images));
7886 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7890 % M a g i c k P i n g I m a g e F i l e %
7894 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7896 % MagickPingImageFile() pings an image or image sequence from an open file
7899 % The format of the MagickPingImageFile method is:
7901 % MagickBooleanType MagickPingImageFile(MagickWand *wand,FILE *file)
7903 % A description of each parameter follows:
7905 % o wand: the magick wand.
7907 % o file: the file descriptor.
7910 WandExport MagickBooleanType MagickPingImageFile(MagickWand *wand,FILE *file)
7918 assert(wand != (MagickWand *) NULL);
7919 assert(wand->signature == WandSignature);
7920 assert(file != (FILE *) NULL);
7921 if (wand->debug != MagickFalse)
7922 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7923 read_info=CloneImageInfo(wand->image_info);
7924 SetImageInfoFile(read_info,file);
7925 images=PingImage(read_info,wand->exception);
7926 read_info=DestroyImageInfo(read_info);
7927 if (images == (Image *) NULL)
7928 return(MagickFalse);
7929 return(InsertImageInWand(wand,images));
7933 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7937 % M a g i c k P o l a r o i d I m a g e %
7941 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7943 % MagickPolaroidImage() simulates a Polaroid picture.
7945 % The format of the MagickPolaroidImage method is:
7947 % MagickBooleanType MagickPolaroidImage(MagickWand *wand,
7948 % const DrawingWand *drawing_wand,const double angle)
7950 % A description of each parameter follows:
7952 % o wand: the magick wand.
7954 % o drawing_wand: the draw wand.
7956 % o angle: Apply the effect along this angle.
7959 WandExport MagickBooleanType MagickPolaroidImage(MagickWand *wand,
7960 const DrawingWand *drawing_wand,const double angle)
7968 assert(wand != (MagickWand *) NULL);
7969 assert(wand->signature == WandSignature);
7970 if (wand->debug != MagickFalse)
7971 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7972 if (wand->images == (Image *) NULL)
7973 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7974 draw_info=PeekDrawingWand(drawing_wand);
7975 if (draw_info == (DrawInfo *) NULL)
7976 return(MagickFalse);
7977 polaroid_image=PolaroidImage(wand->images,draw_info,angle,wand->exception);
7978 if (polaroid_image == (Image *) NULL)
7979 return(MagickFalse);
7980 ReplaceImageInList(&wand->images,polaroid_image);
7985 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7989 % M a g i c k P o s t e r i z e I m a g e %
7993 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7995 % MagickPosterizeImage() reduces the image to a limited number of color level.
7997 % The format of the MagickPosterizeImage method is:
7999 % MagickBooleanType MagickPosterizeImage(MagickWand *wand,
8000 % const unsigned levels,const MagickBooleanType dither)
8002 % A description of each parameter follows:
8004 % o wand: the magick wand.
8006 % o levels: Number of color levels allowed in each channel. Very low values
8007 % (2, 3, or 4) have the most visible effect.
8009 % o dither: Set this integer value to something other than zero to dither
8013 WandExport MagickBooleanType MagickPosterizeImage(MagickWand *wand,
8014 const size_t levels,const MagickBooleanType dither)
8019 assert(wand != (MagickWand *) NULL);
8020 assert(wand->signature == WandSignature);
8021 if (wand->debug != MagickFalse)
8022 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8023 if (wand->images == (Image *) NULL)
8024 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8025 status=PosterizeImage(wand->images,levels,dither);
8026 if (status == MagickFalse)
8027 InheritException(wand->exception,&wand->images->exception);
8032 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8036 % M a g i c k P r e v i e w I m a g e s %
8040 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8042 % MagickPreviewImages() tiles 9 thumbnails of the specified image with an
8043 % image processing operation applied at varying strengths. This helpful
8044 % to quickly pin-point an appropriate parameter for an image processing
8047 % The format of the MagickPreviewImages method is:
8049 % MagickWand *MagickPreviewImages(MagickWand *wand,
8050 % const PreviewType preview)
8052 % A description of each parameter follows:
8054 % o wand: the magick wand.
8056 % o preview: the preview type.
8059 WandExport MagickWand *MagickPreviewImages(MagickWand *wand,
8060 const PreviewType preview)
8065 assert(wand != (MagickWand *) NULL);
8066 assert(wand->signature == WandSignature);
8067 if (wand->debug != MagickFalse)
8068 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8069 if (wand->images == (Image *) NULL)
8070 return((MagickWand *) NULL);
8071 preview_image=PreviewImage(wand->images,preview,wand->exception);
8072 if (preview_image == (Image *) NULL)
8073 return((MagickWand *) NULL);
8074 return(CloneMagickWandFromImages(wand,preview_image));
8078 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8082 % M a g i c k P r e v i o u s I m a g e %
8086 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8088 % MagickPreviousImage() assocates the previous image in an image list with
8091 % The format of the MagickPreviousImage method is:
8093 % MagickBooleanType MagickPreviousImage(MagickWand *wand)
8095 % A description of each parameter follows:
8097 % o wand: the magick wand.
8100 WandExport MagickBooleanType MagickPreviousImage(MagickWand *wand)
8102 assert(wand != (MagickWand *) NULL);
8103 assert(wand->signature == WandSignature);
8104 if (wand->debug != MagickFalse)
8105 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8106 if (wand->images == (Image *) NULL)
8107 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8108 if (wand->pend != MagickFalse)
8110 wand->pend=MagickFalse;
8113 if (GetPreviousImageInList(wand->images) == (Image *) NULL)
8115 wand->pend=MagickTrue;
8116 return(MagickFalse);
8118 wand->images=GetPreviousImageInList(wand->images);
8123 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8127 % M a g i c k Q u a n t i z e I m a g e %
8131 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8133 % MagickQuantizeImage() analyzes the colors within a reference image and
8134 % chooses a fixed number of colors to represent the image. The goal of the
8135 % algorithm is to minimize the color difference between the input and output
8136 % image while minimizing the processing time.
8138 % The format of the MagickQuantizeImage method is:
8140 % MagickBooleanType MagickQuantizeImage(MagickWand *wand,
8141 % const size_t number_colors,const ColorspaceType colorspace,
8142 % const size_t treedepth,const MagickBooleanType dither,
8143 % const MagickBooleanType measure_error)
8145 % A description of each parameter follows:
8147 % o wand: the magick wand.
8149 % o number_colors: the number of colors.
8151 % o colorspace: Perform color reduction in this colorspace, typically
8154 % o treedepth: Normally, this integer value is zero or one. A zero or
8155 % 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
8156 % reference image with the least amount of memory and the fastest
8157 % computational speed. In some cases, such as an image with low color
8158 % dispersion (a few number of colors), a value other than
8159 % Log4(number_colors) is required. To expand the color tree completely,
8162 % o dither: A value other than zero distributes the difference between an
8163 % original image and the corresponding color reduced image to
8164 % neighboring pixels along a Hilbert curve.
8166 % o measure_error: A value other than zero measures the difference between
8167 % the original and quantized images. This difference is the total
8168 % quantization error. The error is computed by summing over all pixels
8169 % in an image the distance squared in RGB space between each reference
8170 % pixel value and its quantized value.
8173 WandExport MagickBooleanType MagickQuantizeImage(MagickWand *wand,
8174 const size_t number_colors,const ColorspaceType colorspace,
8175 const size_t treedepth,const MagickBooleanType dither,
8176 const MagickBooleanType measure_error)
8184 assert(wand != (MagickWand *) NULL);
8185 assert(wand->signature == WandSignature);
8186 if (wand->debug != MagickFalse)
8187 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8188 if (wand->images == (Image *) NULL)
8189 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8190 quantize_info=CloneQuantizeInfo((QuantizeInfo *) NULL);
8191 quantize_info->number_colors=number_colors;
8192 quantize_info->dither=dither;
8193 quantize_info->tree_depth=treedepth;
8194 quantize_info->colorspace=colorspace;
8195 quantize_info->measure_error=measure_error;
8196 status=QuantizeImage(quantize_info,wand->images);
8197 if (status == MagickFalse)
8198 InheritException(wand->exception,&wand->images->exception);
8199 quantize_info=DestroyQuantizeInfo(quantize_info);
8204 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8208 % M a g i c k Q u a n t i z e I m a g e s %
8212 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8214 % MagickQuantizeImages() analyzes the colors within a sequence of images and
8215 % chooses a fixed number of colors to represent the image. The goal of the
8216 % algorithm is to minimize the color difference between the input and output
8217 % image while minimizing the processing time.
8219 % The format of the MagickQuantizeImages method is:
8221 % MagickBooleanType MagickQuantizeImages(MagickWand *wand,
8222 % const size_t number_colors,const ColorspaceType colorspace,
8223 % const size_t treedepth,const MagickBooleanType dither,
8224 % const MagickBooleanType measure_error)
8226 % A description of each parameter follows:
8228 % o wand: the magick wand.
8230 % o number_colors: the number of colors.
8232 % o colorspace: Perform color reduction in this colorspace, typically
8235 % o treedepth: Normally, this integer value is zero or one. A zero or
8236 % 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
8237 % reference image with the least amount of memory and the fastest
8238 % computational speed. In some cases, such as an image with low color
8239 % dispersion (a few number of colors), a value other than
8240 % Log4(number_colors) is required. To expand the color tree completely,
8243 % o dither: A value other than zero distributes the difference between an
8244 % original image and the corresponding color reduced algorithm to
8245 % neighboring pixels along a Hilbert curve.
8247 % o measure_error: A value other than zero measures the difference between
8248 % the original and quantized images. This difference is the total
8249 % quantization error. The error is computed by summing over all pixels
8250 % in an image the distance squared in RGB space between each reference
8251 % pixel value and its quantized value.
8254 WandExport MagickBooleanType MagickQuantizeImages(MagickWand *wand,
8255 const size_t number_colors,const ColorspaceType colorspace,
8256 const size_t treedepth,const MagickBooleanType dither,
8257 const MagickBooleanType measure_error)
8265 assert(wand != (MagickWand *) NULL);
8266 assert(wand->signature == WandSignature);
8267 if (wand->debug != MagickFalse)
8268 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8269 if (wand->images == (Image *) NULL)
8270 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8271 quantize_info=CloneQuantizeInfo((QuantizeInfo *) NULL);
8272 quantize_info->number_colors=number_colors;
8273 quantize_info->dither=dither;
8274 quantize_info->tree_depth=treedepth;
8275 quantize_info->colorspace=colorspace;
8276 quantize_info->measure_error=measure_error;
8277 status=QuantizeImages(quantize_info,wand->images);
8278 if (status == MagickFalse)
8279 InheritException(wand->exception,&wand->images->exception);
8280 quantize_info=DestroyQuantizeInfo(quantize_info);
8285 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8289 % M a g i c k R a d i a l B l u r I m a g e %
8293 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8295 % MagickRadialBlurImage() radial blurs an image.
8297 % The format of the MagickRadialBlurImage method is:
8299 % MagickBooleanType MagickRadialBlurImage(MagickWand *wand,
8300 % const double angle)
8301 % MagickBooleanType MagickRadialBlurImageChannel(MagickWand *wand,
8302 % const ChannelType channel,const double angle)
8304 % A description of each parameter follows:
8306 % o wand: the magick wand.
8308 % o channel: the image channel(s).
8310 % o angle: the angle of the blur in degrees.
8313 WandExport MagickBooleanType MagickRadialBlurImage(MagickWand *wand,
8319 status=MagickRadialBlurImageChannel(wand,DefaultChannels,angle);
8323 WandExport MagickBooleanType MagickRadialBlurImageChannel(MagickWand *wand,
8324 const ChannelType channel,const double angle)
8329 assert(wand != (MagickWand *) NULL);
8330 assert(wand->signature == WandSignature);
8331 if (wand->debug != MagickFalse)
8332 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8333 if (wand->images == (Image *) NULL)
8334 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8335 blur_image=RadialBlurImageChannel(wand->images,channel,angle,
8337 if (blur_image == (Image *) NULL)
8338 return(MagickFalse);
8339 ReplaceImageInList(&wand->images,blur_image);
8344 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8348 % M a g i c k R a i s e I m a g e %
8352 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8354 % MagickRaiseImage() creates a simulated three-dimensional button-like effect
8355 % by lightening and darkening the edges of the image. Members width and
8356 % height of raise_info define the width of the vertical and horizontal
8357 % edge of the effect.
8359 % The format of the MagickRaiseImage method is:
8361 % MagickBooleanType MagickRaiseImage(MagickWand *wand,
8362 % const size_t width,const size_t height,const ssize_t x,
8363 % const ssize_t y,const MagickBooleanType raise)
8365 % A description of each parameter follows:
8367 % o wand: the magick wand.
8369 % o width,height,x,y: Define the dimensions of the area to raise.
8371 % o raise: A value other than zero creates a 3-D raise effect,
8372 % otherwise it has a lowered effect.
8375 WandExport MagickBooleanType MagickRaiseImage(MagickWand *wand,
8376 const size_t width,const size_t height,const ssize_t x,
8377 const ssize_t y,const MagickBooleanType raise)
8385 assert(wand != (MagickWand *) NULL);
8386 assert(wand->signature == WandSignature);
8387 if (wand->debug != MagickFalse)
8388 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8389 if (wand->images == (Image *) NULL)
8390 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8391 raise_info.width=width;
8392 raise_info.height=height;
8395 status=RaiseImage(wand->images,&raise_info,raise);
8396 if (status == MagickFalse)
8397 InheritException(wand->exception,&wand->images->exception);
8402 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8406 % 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 %
8410 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8412 % MagickRandomThresholdImage() changes the value of individual pixels based on
8413 % the intensity of each pixel compared to threshold. The result is a
8414 % high-contrast, two color image.
8416 % The format of the MagickRandomThresholdImage method is:
8418 % MagickBooleanType MagickRandomThresholdImage(MagickWand *wand,
8419 % const double low,const double high)
8420 % MagickBooleanType MagickRandomThresholdImageChannel(MagickWand *wand,
8421 % const ChannelType channel,const double low,const double high)
8423 % A description of each parameter follows:
8425 % o wand: the magick wand.
8427 % o channel: the image channel(s).
8429 % o low,high: Specify the high and low thresholds. These values range from
8430 % 0 to QuantumRange.
8434 WandExport MagickBooleanType MagickRandomThresholdImage(MagickWand *wand,
8435 const double low,const double high)
8440 status=MagickRandomThresholdImageChannel(wand,DefaultChannels,low,high);
8444 WandExport MagickBooleanType MagickRandomThresholdImageChannel(
8445 MagickWand *wand,const ChannelType channel,const double low,
8449 threshold[MaxTextExtent];
8454 assert(wand != (MagickWand *) NULL);
8455 assert(wand->signature == WandSignature);
8456 if (wand->debug != MagickFalse)
8457 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8458 if (wand->images == (Image *) NULL)
8459 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8460 (void) FormatMagickString(threshold,MaxTextExtent,"%gx%g",low,high);
8461 status=RandomThresholdImageChannel(wand->images,channel,threshold,
8463 if (status == MagickFalse)
8464 InheritException(wand->exception,&wand->images->exception);
8469 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8473 % M a g i c k R e a d I m a g e %
8477 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8479 % MagickReadImage() reads an image or image sequence. The images are inserted
8480 % at the current image pointer position. Use MagickSetFirstIterator(),
8481 % MagickSetLastIterator, or MagickSetImageIndex() to specify the current
8482 % image pointer position at the beginning of the image list, the end, or
8483 % anywhere in-between respectively.
8485 % The format of the MagickReadImage method is:
8487 % MagickBooleanType MagickReadImage(MagickWand *wand,const char *filename)
8489 % A description of each parameter follows:
8491 % o wand: the magick wand.
8493 % o filename: the image filename.
8496 WandExport MagickBooleanType MagickReadImage(MagickWand *wand,
8497 const char *filename)
8505 assert(wand != (MagickWand *) NULL);
8506 assert(wand->signature == WandSignature);
8507 if (wand->debug != MagickFalse)
8508 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8509 read_info=CloneImageInfo(wand->image_info);
8510 if (filename != (const char *) NULL)
8511 (void) CopyMagickString(read_info->filename,filename,MaxTextExtent);
8512 images=ReadImage(read_info,wand->exception);
8513 read_info=DestroyImageInfo(read_info);
8514 if (images == (Image *) NULL)
8515 return(MagickFalse);
8516 return(InsertImageInWand(wand,images));
8520 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8524 % M a g i c k R e a d I m a g e B l o b %
8528 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8530 % MagickReadImageBlob() reads an image or image sequence from a blob.
8532 % The format of the MagickReadImageBlob method is:
8534 % MagickBooleanType MagickReadImageBlob(MagickWand *wand,
8535 % const void *blob,const size_t length)
8537 % A description of each parameter follows:
8539 % o wand: the magick wand.
8543 % o length: the blob length.
8546 WandExport MagickBooleanType MagickReadImageBlob(MagickWand *wand,
8547 const void *blob,const size_t length)
8552 assert(wand != (MagickWand *) NULL);
8553 assert(wand->signature == WandSignature);
8554 if (wand->debug != MagickFalse)
8555 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8556 images=BlobToImage(wand->image_info,blob,length,wand->exception);
8557 if (images == (Image *) NULL)
8558 return(MagickFalse);
8559 return(InsertImageInWand(wand,images));
8563 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8567 % M a g i c k R e a d I m a g e F i l e %
8571 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8573 % MagickReadImageFile() reads an image or image sequence from an open file
8576 % The format of the MagickReadImageFile method is:
8578 % MagickBooleanType MagickReadImageFile(MagickWand *wand,FILE *file)
8580 % A description of each parameter follows:
8582 % o wand: the magick wand.
8584 % o file: the file descriptor.
8587 WandExport MagickBooleanType MagickReadImageFile(MagickWand *wand,FILE *file)
8595 assert(wand != (MagickWand *) NULL);
8596 assert(wand->signature == WandSignature);
8597 assert(file != (FILE *) NULL);
8598 if (wand->debug != MagickFalse)
8599 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8600 read_info=CloneImageInfo(wand->image_info);
8601 SetImageInfoFile(read_info,file);
8602 images=ReadImage(read_info,wand->exception);
8603 read_info=DestroyImageInfo(read_info);
8604 if (images == (Image *) NULL)
8605 return(MagickFalse);
8606 return(InsertImageInWand(wand,images));
8610 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8614 % M a g i c k R e d u c e N o i s e I m a g e %
8618 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8620 % MagickReduceNoiseImage() smooths the contours of an image while still
8621 % preserving edge information. The algorithm works by replacing each pixel
8622 % with its neighbor closest in value. A neighbor is defined by radius. Use
8623 % a radius of 0 and ReduceNoise() selects a suitable radius for you.
8625 % The format of the MagickReduceNoiseImage method is:
8627 % MagickBooleanType MagickReduceNoiseImage(MagickWand *wand,
8628 % const double radius)
8630 % A description of each parameter follows:
8632 % o wand: the magick wand.
8634 % o radius: the radius of the pixel neighborhood.
8637 WandExport MagickBooleanType MagickReduceNoiseImage(MagickWand *wand,
8638 const double radius)
8643 assert(wand != (MagickWand *) NULL);
8644 assert(wand->signature == WandSignature);
8645 if (wand->debug != MagickFalse)
8646 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8647 if (wand->images == (Image *) NULL)
8648 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8649 noise_image=ReduceNoiseImage(wand->images,radius,wand->exception);
8650 if (noise_image == (Image *) NULL)
8651 return(MagickFalse);
8652 ReplaceImageInList(&wand->images,noise_image);
8657 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8661 % M a g i c k R e m a p I m a g e %
8665 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8667 % MagickRemapImage() replaces the colors of an image with the closest color
8668 % from a reference image.
8670 % The format of the MagickRemapImage method is:
8672 % MagickBooleanType MagickRemapImage(MagickWand *wand,
8673 % const MagickWand *remap_wand,const DitherMethod method)
8675 % A description of each parameter follows:
8677 % o wand: the magick wand.
8679 % o affinity: the affinity wand.
8681 % o method: choose from these dither methods: NoDitherMethod,
8682 % RiemersmaDitherMethod, or FloydSteinbergDitherMethod.
8685 WandExport MagickBooleanType MagickRemapImage(MagickWand *wand,
8686 const MagickWand *remap_wand,const DitherMethod method)
8694 assert(wand != (MagickWand *) NULL);
8695 assert(wand->signature == WandSignature);
8696 if (wand->debug != MagickFalse)
8697 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8698 if ((wand->images == (Image *) NULL) ||
8699 (remap_wand->images == (Image *) NULL))
8700 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8701 quantize_info=AcquireQuantizeInfo(wand->image_info);
8702 quantize_info->dither_method=method;
8703 if (method == NoDitherMethod)
8704 quantize_info->dither=MagickFalse;
8705 status=RemapImage(quantize_info,wand->images,remap_wand->images);
8706 quantize_info=DestroyQuantizeInfo(quantize_info);
8707 if (status == MagickFalse)
8708 InheritException(wand->exception,&wand->images->exception);
8713 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8717 % M a g i c k R e m o v e I m a g e %
8721 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8723 % MagickRemoveImage() removes an image from the image list.
8725 % The format of the MagickRemoveImage method is:
8727 % MagickBooleanType MagickRemoveImage(MagickWand *wand)
8729 % A description of each parameter follows:
8731 % o wand: the magick wand.
8733 % o insert: the splice wand.
8736 WandExport MagickBooleanType MagickRemoveImage(MagickWand *wand)
8738 assert(wand != (MagickWand *) NULL);
8739 assert(wand->signature == WandSignature);
8740 if (wand->debug != MagickFalse)
8741 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8742 if (wand->images == (Image *) NULL)
8743 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8744 DeleteImageFromList(&wand->images);
8749 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8753 % M a g i c k R e s a m p l e I m a g e %
8757 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8759 % MagickResampleImage() resample image to desired resolution.
8761 % Bessel Blackman Box
8762 % Catrom Cubic Gaussian
8763 % Hanning Hermite Lanczos
8764 % Mitchell Point Quandratic
8767 % Most of the filters are FIR (finite impulse response), however, Bessel,
8768 % Gaussian, and Sinc are IIR (infinite impulse response). Bessel and Sinc
8769 % are windowed (brought down to zero) with the Blackman filter.
8771 % The format of the MagickResampleImage method is:
8773 % MagickBooleanType MagickResampleImage(MagickWand *wand,
8774 % const double x_resolution,const double y_resolution,
8775 % const FilterTypes filter,const double blur)
8777 % A description of each parameter follows:
8779 % o wand: the magick wand.
8781 % o x_resolution: the new image x resolution.
8783 % o y_resolution: the new image y resolution.
8785 % o filter: Image filter to use.
8787 % o blur: the blur factor where > 1 is blurry, < 1 is sharp.
8790 WandExport MagickBooleanType MagickResampleImage(MagickWand *wand,
8791 const double x_resolution,const double y_resolution,const FilterTypes filter,
8797 assert(wand != (MagickWand *) NULL);
8798 assert(wand->signature == WandSignature);
8799 if (wand->debug != MagickFalse)
8800 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8801 if (wand->images == (Image *) NULL)
8802 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8803 resample_image=ResampleImage(wand->images,x_resolution,y_resolution,filter,
8804 blur,wand->exception);
8805 if (resample_image == (Image *) NULL)
8806 return(MagickFalse);
8807 ReplaceImageInList(&wand->images,resample_image);
8812 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8816 % M a g i c k R e s e t I m a g e P a g e %
8820 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8822 % MagickResetImagePage() resets the Wand page canvas and position.
8824 % The format of the MagickResetImagePage method is:
8826 % MagickBooleanType MagickResetImagePage(MagickWand *wand,
8829 % A description of each parameter follows:
8831 % o wand: the magick wand.
8833 % o page: the relative page specification.
8836 WandExport MagickBooleanType MagickResetImagePage(MagickWand *wand,
8839 assert(wand != (MagickWand *) NULL);
8840 assert(wand->signature == WandSignature);
8841 if (wand->debug != MagickFalse)
8842 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8843 if (wand->images == (Image *) NULL)
8844 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8845 if ((page == (char *) NULL) || (*page == '\0'))
8847 (void) ParseAbsoluteGeometry("0x0+0+0",&wand->images->page);
8850 return(ResetImagePage(wand->images,page));
8854 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8858 % M a g i c k R e s i z e I m a g e %
8862 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8864 % MagickResizeImage() scales an image to the desired dimensions with one of
8867 % Bessel Blackman Box
8868 % Catrom Cubic Gaussian
8869 % Hanning Hermite Lanczos
8870 % Mitchell Point Quandratic
8873 % Most of the filters are FIR (finite impulse response), however, Bessel,
8874 % Gaussian, and Sinc are IIR (infinite impulse response). Bessel and Sinc
8875 % are windowed (brought down to zero) with the Blackman filter.
8877 % The format of the MagickResizeImage method is:
8879 % MagickBooleanType MagickResizeImage(MagickWand *wand,
8880 % const size_t columns,const size_t rows,
8881 % const FilterTypes filter,const double blur)
8883 % A description of each parameter follows:
8885 % o wand: the magick wand.
8887 % o columns: the number of columns in the scaled image.
8889 % o rows: the number of rows in the scaled image.
8891 % o filter: Image filter to use.
8893 % o blur: the blur factor where > 1 is blurry, < 1 is sharp.
8896 WandExport MagickBooleanType MagickResizeImage(MagickWand *wand,
8897 const size_t columns,const size_t rows,const FilterTypes filter,
8903 assert(wand != (MagickWand *) NULL);
8904 assert(wand->signature == WandSignature);
8905 if (wand->debug != MagickFalse)
8906 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8907 if (wand->images == (Image *) NULL)
8908 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8909 resize_image=ResizeImage(wand->images,columns,rows,filter,blur,
8911 if (resize_image == (Image *) NULL)
8912 return(MagickFalse);
8913 ReplaceImageInList(&wand->images,resize_image);
8918 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8922 % M a g i c k R o l l I m a g e %
8926 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8928 % MagickRollImage() offsets an image as defined by x and y.
8930 % The format of the MagickRollImage method is:
8932 % MagickBooleanType MagickRollImage(MagickWand *wand,const ssize_t x,
8935 % A description of each parameter follows:
8937 % o wand: the magick wand.
8939 % o x: the x offset.
8941 % o y: the y offset.
8945 WandExport MagickBooleanType MagickRollImage(MagickWand *wand,
8946 const ssize_t x,const ssize_t y)
8951 assert(wand != (MagickWand *) NULL);
8952 assert(wand->signature == WandSignature);
8953 if (wand->debug != MagickFalse)
8954 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8955 if (wand->images == (Image *) NULL)
8956 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8957 roll_image=RollImage(wand->images,x,y,wand->exception);
8958 if (roll_image == (Image *) NULL)
8959 return(MagickFalse);
8960 ReplaceImageInList(&wand->images,roll_image);
8965 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8969 % M a g i c k R o t a t e I m a g e %
8973 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8975 % MagickRotateImage() rotates an image the specified number of degrees. Empty
8976 % triangles left over from rotating the image are filled with the
8979 % The format of the MagickRotateImage method is:
8981 % MagickBooleanType MagickRotateImage(MagickWand *wand,
8982 % const PixelWand *background,const double degrees)
8984 % A description of each parameter follows:
8986 % o wand: the magick wand.
8988 % o background: the background pixel wand.
8990 % o degrees: the number of degrees to rotate the image.
8994 WandExport MagickBooleanType MagickRotateImage(MagickWand *wand,
8995 const PixelWand *background,const double degrees)
9000 assert(wand != (MagickWand *) NULL);
9001 assert(wand->signature == WandSignature);
9002 if (wand->debug != MagickFalse)
9003 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9004 if (wand->images == (Image *) NULL)
9005 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9006 PixelGetQuantumColor(background,&wand->images->background_color);
9007 rotate_image=RotateImage(wand->images,degrees,wand->exception);
9008 if (rotate_image == (Image *) NULL)
9009 return(MagickFalse);
9010 ReplaceImageInList(&wand->images,rotate_image);
9015 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9019 % M a g i c k S a m p l e I m a g e %
9023 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9025 % MagickSampleImage() scales an image to the desired dimensions with pixel
9026 % sampling. Unlike other scaling methods, this method does not introduce
9027 % any additional color into the scaled image.
9029 % The format of the MagickSampleImage method is:
9031 % MagickBooleanType MagickSampleImage(MagickWand *wand,
9032 % const size_t columns,const size_t rows)
9034 % A description of each parameter follows:
9036 % o wand: the magick wand.
9038 % o columns: the number of columns in the scaled image.
9040 % o rows: the number of rows in the scaled image.
9044 WandExport MagickBooleanType MagickSampleImage(MagickWand *wand,
9045 const size_t columns,const size_t rows)
9050 assert(wand != (MagickWand *) NULL);
9051 assert(wand->signature == WandSignature);
9052 if (wand->debug != MagickFalse)
9053 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9054 if (wand->images == (Image *) NULL)
9055 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9056 sample_image=SampleImage(wand->images,columns,rows,wand->exception);
9057 if (sample_image == (Image *) NULL)
9058 return(MagickFalse);
9059 ReplaceImageInList(&wand->images,sample_image);
9064 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9068 % M a g i c k S c a l e I m a g e %
9072 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9074 % MagickScaleImage() scales the size of an image to the given dimensions.
9076 % The format of the MagickScaleImage method is:
9078 % MagickBooleanType MagickScaleImage(MagickWand *wand,
9079 % const size_t columns,const size_t rows)
9081 % A description of each parameter follows:
9083 % o wand: the magick wand.
9085 % o columns: the number of columns in the scaled image.
9087 % o rows: the number of rows in the scaled image.
9091 WandExport MagickBooleanType MagickScaleImage(MagickWand *wand,
9092 const size_t columns,const size_t rows)
9097 assert(wand != (MagickWand *) NULL);
9098 assert(wand->signature == WandSignature);
9099 if (wand->debug != MagickFalse)
9100 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9101 if (wand->images == (Image *) NULL)
9102 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9103 scale_image=ScaleImage(wand->images,columns,rows,wand->exception);
9104 if (scale_image == (Image *) NULL)
9105 return(MagickFalse);
9106 ReplaceImageInList(&wand->images,scale_image);
9111 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9115 % M a g i c k S e g m e n t I m a g e %
9119 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9121 % MagickSegmentImage() segments an image by analyzing the histograms of the
9122 % color components and identifying units that are homogeneous with the fuzzy
9123 % C-means technique.
9125 % The format of the SegmentImage method is:
9127 % MagickBooleanType MagickSegmentImage(MagickWand *wand,
9128 % const ColorspaceType colorspace,const MagickBooleanType verbose,
9129 % const double cluster_threshold,const double smooth_threshold)
9131 % A description of each parameter follows.
9135 % o colorspace: the image colorspace.
9137 % o verbose: Set to MagickTrue to print detailed information about the
9138 % identified classes.
9140 % o cluster_threshold: This represents the minimum number of pixels
9141 % contained in a hexahedra before it can be considered valid (expressed as
9144 % o smooth_threshold: the smoothing threshold eliminates noise in the second
9145 % derivative of the histogram. As the value is increased, you can expect a
9146 % smoother second derivative.
9149 MagickExport MagickBooleanType MagickSegmentImage(MagickWand *wand,
9150 const ColorspaceType colorspace,const MagickBooleanType verbose,
9151 const double cluster_threshold,const double smooth_threshold)
9156 assert(wand != (MagickWand *) NULL);
9157 assert(wand->signature == WandSignature);
9158 if (wand->debug != MagickFalse)
9159 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9160 if (wand->images == (Image *) NULL)
9161 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9162 status=SegmentImage(wand->images,colorspace,verbose,cluster_threshold,
9164 if (status == MagickFalse)
9165 InheritException(wand->exception,&wand->images->exception);
9170 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9174 % M a g i c k S e l e c t i v e B l u r I m a g e %
9178 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9180 % MagickSelectiveBlurImage() selectively blur an image within a contrast
9181 % threshold. It is similar to the unsharpen mask that sharpens everything with
9182 % contrast above a certain threshold.
9184 % The format of the MagickSelectiveBlurImage method is:
9186 % MagickBooleanType MagickSelectiveBlurImage(MagickWand *wand,
9187 % const double radius,const double sigma,const double threshold)
9188 % MagickBooleanType MagickSelectiveBlurImageChannel(MagickWand *wand,
9189 % const ChannelType channel,const double radius,const double sigma,
9190 % const double threshold)
9192 % A description of each parameter follows:
9194 % o wand: the magick wand.
9196 % o channel: the image channel(s).
9198 % o radius: the radius of the gaussian, in pixels, not counting the center
9201 % o sigma: the standard deviation of the gaussian, in pixels.
9203 % o threshold: only pixels within this contrast threshold are included
9204 % in the blur operation.
9208 WandExport MagickBooleanType MagickSelectiveBlurImage(MagickWand *wand,
9209 const double radius,const double sigma,const double threshold)
9214 status=MagickSelectiveBlurImageChannel(wand,DefaultChannels,radius,sigma,
9219 WandExport MagickBooleanType MagickSelectiveBlurImageChannel(MagickWand *wand,
9220 const ChannelType channel,const double radius,const double sigma,
9221 const double threshold)
9226 assert(wand != (MagickWand *) NULL);
9227 assert(wand->signature == WandSignature);
9228 if (wand->debug != MagickFalse)
9229 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9230 if (wand->images == (Image *) NULL)
9231 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9232 blur_image=SelectiveBlurImageChannel(wand->images,channel,radius,sigma,
9233 threshold,wand->exception);
9234 if (blur_image == (Image *) NULL)
9235 return(MagickFalse);
9236 ReplaceImageInList(&wand->images,blur_image);
9241 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9245 % 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 %
9249 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9251 % MagickSeparateImageChannel() separates a channel from the image and returns a
9252 % grayscale image. A channel is a particular color component of each pixel
9255 % The format of the MagickSeparateImageChannel method is:
9257 % MagickBooleanType MagickSeparateImageChannel(MagickWand *wand,
9258 % const ChannelType channel)
9260 % A description of each parameter follows:
9262 % o wand: the magick wand.
9264 % o channel: the image channel(s).
9267 WandExport MagickBooleanType MagickSeparateImageChannel(MagickWand *wand,
9268 const ChannelType channel)
9273 assert(wand != (MagickWand *) NULL);
9274 assert(wand->signature == WandSignature);
9275 if (wand->debug != MagickFalse)
9276 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9277 if (wand->images == (Image *) NULL)
9278 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9279 status=SeparateImageChannel(wand->images,channel);
9280 if (status == MagickFalse)
9281 InheritException(wand->exception,&wand->images->exception);
9286 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9290 % M a g i c k S e p i a T o n e I m a g e %
9294 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9296 % MagickSepiaToneImage() applies a special effect to the image, similar to the
9297 % effect achieved in a photo darkroom by sepia toning. Threshold ranges from
9298 % 0 to QuantumRange and is a measure of the extent of the sepia toning. A
9299 % threshold of 80% is a good starting point for a reasonable tone.
9301 % The format of the MagickSepiaToneImage method is:
9303 % MagickBooleanType MagickSepiaToneImage(MagickWand *wand,
9304 % const double threshold)
9306 % A description of each parameter follows:
9308 % o wand: the magick wand.
9310 % o threshold: Define the extent of the sepia toning.
9313 WandExport MagickBooleanType MagickSepiaToneImage(MagickWand *wand,
9314 const double threshold)
9319 assert(wand != (MagickWand *) NULL);
9320 assert(wand->signature == WandSignature);
9321 if (wand->debug != MagickFalse)
9322 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9323 if (wand->images == (Image *) NULL)
9324 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9325 sepia_image=SepiaToneImage(wand->images,threshold,wand->exception);
9326 if (sepia_image == (Image *) NULL)
9327 return(MagickFalse);
9328 ReplaceImageInList(&wand->images,sepia_image);
9333 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9337 % M a g i c k S e t I m a g e %
9341 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9343 % MagickSetImage() replaces the last image returned by MagickSetImageIndex(),
9344 % MagickNextImage(), MagickPreviousImage() with the images from the specified
9347 % The format of the MagickSetImage method is:
9349 % MagickBooleanType MagickSetImage(MagickWand *wand,
9350 % const MagickWand *set_wand)
9352 % A description of each parameter follows:
9354 % o wand: the magick wand.
9356 % o set_wand: the set_wand wand.
9359 WandExport MagickBooleanType MagickSetImage(MagickWand *wand,
9360 const MagickWand *set_wand)
9365 assert(wand != (MagickWand *) NULL);
9366 assert(wand->signature == WandSignature);
9367 if (wand->debug != MagickFalse)
9368 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9369 assert(set_wand != (MagickWand *) NULL);
9370 assert(set_wand->signature == WandSignature);
9371 if (wand->debug != MagickFalse)
9372 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",set_wand->name);
9373 if (set_wand->images == (Image *) NULL)
9374 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9375 images=CloneImageList(set_wand->images,wand->exception);
9376 if (images == (Image *) NULL)
9377 return(MagickFalse);
9378 ReplaceImageInList(&wand->images,images);
9383 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9387 % 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 %
9391 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9393 % MagickSetImageAlphaChannel() activates, deactivates, resets, or sets the
9396 % The format of the MagickSetImageAlphaChannel method is:
9398 % MagickBooleanType MagickSetImageAlphaChannel(MagickWand *wand,
9399 % const AlphaChannelType alpha_type)
9401 % A description of each parameter follows:
9403 % o wand: the magick wand.
9405 % o alpha_type: the alpha channel type: ActivateAlphaChannel,
9406 % DeactivateAlphaChannel, OpaqueAlphaChannel, or SetAlphaChannel.
9409 WandExport MagickBooleanType MagickSetImageAlphaChannel(MagickWand *wand,
9410 const AlphaChannelType alpha_type)
9412 assert(wand != (MagickWand *) NULL);
9413 assert(wand->signature == WandSignature);
9414 if (wand->debug != MagickFalse)
9415 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9416 if (wand->images == (Image *) NULL)
9417 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9418 return(SetImageAlphaChannel(wand->images,alpha_type));
9422 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9426 % 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 %
9430 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9432 % MagickSetImageBackgroundColor() sets the image background color.
9434 % The format of the MagickSetImageBackgroundColor method is:
9436 % MagickBooleanType MagickSetImageBackgroundColor(MagickWand *wand,
9437 % const PixelWand *background)
9439 % A description of each parameter follows:
9441 % o wand: the magick wand.
9443 % o background: the background pixel wand.
9446 WandExport MagickBooleanType MagickSetImageBackgroundColor(MagickWand *wand,
9447 const PixelWand *background)
9449 assert(wand != (MagickWand *) NULL);
9450 assert(wand->signature == WandSignature);
9451 if (wand->debug != MagickFalse)
9452 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9453 if (wand->images == (Image *) NULL)
9454 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9455 PixelGetQuantumColor(background,&wand->images->background_color);
9460 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9464 % M a g i c k S e t I m a g e B i a s %
9468 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9470 % MagickSetImageBias() sets the image bias for any method that convolves an
9471 % image (e.g. MagickConvolveImage()).
9473 % The format of the MagickSetImageBias method is:
9475 % MagickBooleanType MagickSetImageBias(MagickWand *wand,
9476 % const double bias)
9478 % A description of each parameter follows:
9480 % o wand: the magick wand.
9482 % o bias: the image bias.
9485 WandExport MagickBooleanType MagickSetImageBias(MagickWand *wand,
9488 assert(wand != (MagickWand *) NULL);
9489 assert(wand->signature == WandSignature);
9490 if (wand->debug != MagickFalse)
9491 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9492 if (wand->images == (Image *) NULL)
9493 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9494 wand->images->bias=bias;
9499 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9503 % 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 %
9507 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9509 % MagickSetImageBluePrimary() sets the image chromaticity blue primary point.
9511 % The format of the MagickSetImageBluePrimary method is:
9513 % MagickBooleanType MagickSetImageBluePrimary(MagickWand *wand,
9514 % const double x,const double y)
9516 % A description of each parameter follows:
9518 % o wand: the magick wand.
9520 % o x: the blue primary x-point.
9522 % o y: the blue primary y-point.
9525 WandExport MagickBooleanType MagickSetImageBluePrimary(MagickWand *wand,
9526 const double x,const double y)
9528 assert(wand != (MagickWand *) NULL);
9529 assert(wand->signature == WandSignature);
9530 if (wand->debug != MagickFalse)
9531 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9532 if (wand->images == (Image *) NULL)
9533 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9534 wand->images->chromaticity.blue_primary.x=x;
9535 wand->images->chromaticity.blue_primary.y=y;
9540 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9544 % 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 %
9548 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9550 % MagickSetImageBorderColor() sets the image border color.
9552 % The format of the MagickSetImageBorderColor method is:
9554 % MagickBooleanType MagickSetImageBorderColor(MagickWand *wand,
9555 % const PixelWand *border)
9557 % A description of each parameter follows:
9559 % o wand: the magick wand.
9561 % o border: the border pixel wand.
9564 WandExport MagickBooleanType MagickSetImageBorderColor(MagickWand *wand,
9565 const PixelWand *border)
9567 assert(wand != (MagickWand *) NULL);
9568 assert(wand->signature == WandSignature);
9569 if (wand->debug != MagickFalse)
9570 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9571 if (wand->images == (Image *) NULL)
9572 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9573 PixelGetQuantumColor(border,&wand->images->border_color);
9578 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9582 % 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 %
9586 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9588 % MagickSetImageChannelDepth() sets the depth of a particular image channel.
9590 % The format of the MagickSetImageChannelDepth method is:
9592 % MagickBooleanType MagickSetImageChannelDepth(MagickWand *wand,
9593 % const ChannelType channel,const size_t depth)
9595 % A description of each parameter follows:
9597 % o wand: the magick wand.
9599 % o channel: the image channel(s).
9601 % o depth: the image depth in bits.
9604 WandExport MagickBooleanType MagickSetImageChannelDepth(MagickWand *wand,
9605 const ChannelType channel,const size_t depth)
9607 assert(wand != (MagickWand *) NULL);
9608 assert(wand->signature == WandSignature);
9609 if (wand->debug != MagickFalse)
9610 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9611 if (wand->images == (Image *) NULL)
9612 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9613 return(SetImageChannelDepth(wand->images,channel,depth));
9617 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9621 % M a g i c k S e t I m a g e C l i p M a s k %
9625 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9627 % MagickSetImageClipMask() sets image clip mask.
9629 % The format of the MagickSetImageClipMask method is:
9631 % MagickBooleanType MagickSetImageClipMask(MagickWand *wand,
9632 % const MagickWand *clip_mask)
9634 % A description of each parameter follows:
9636 % o wand: the magick wand.
9638 % o clip_mask: the clip_mask wand.
9641 WandExport MagickBooleanType MagickSetImageClipMask(MagickWand *wand,
9642 const MagickWand *clip_mask)
9644 assert(wand != (MagickWand *) NULL);
9645 assert(wand->signature == WandSignature);
9646 if (wand->debug != MagickFalse)
9647 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9648 assert(clip_mask != (MagickWand *) NULL);
9649 assert(clip_mask->signature == WandSignature);
9650 if (wand->debug != MagickFalse)
9651 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",clip_mask->name);
9652 if (clip_mask->images == (Image *) NULL)
9653 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9654 return(SetImageClipMask(wand->images,clip_mask->images));
9658 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9662 % M a g i c k S e t I m a g e C o l o r %
9666 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9668 % MagickSetImageColor() set the entire wand canvas to the specified color.
9670 % The format of the MagickSetImageColor method is:
9672 % MagickBooleanType MagickSetImageColor(MagickWand *wand,
9673 % const PixelWand *color)
9675 % A description of each parameter follows:
9677 % o wand: the magick wand.
9679 % o background: the image color.
9682 WandExport MagickBooleanType MagickSetImageColor(MagickWand *wand,
9683 const PixelWand *color)
9691 assert(wand != (MagickWand *) NULL);
9692 assert(wand->signature == WandSignature);
9693 if (wand->debug != MagickFalse)
9694 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9695 PixelGetMagickColor(color,&pixel);
9696 status=SetImageColor(wand->images,&pixel);
9697 if (status == MagickFalse)
9698 InheritException(wand->exception,&wand->images->exception);
9703 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9707 % 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 %
9711 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9713 % MagickSetImageColormapColor() sets the color of the specified colormap
9716 % The format of the MagickSetImageColormapColor method is:
9718 % MagickBooleanType MagickSetImageColormapColor(MagickWand *wand,
9719 % const size_t index,const PixelWand *color)
9721 % A description of each parameter follows:
9723 % o wand: the magick wand.
9725 % o index: the offset into the image colormap.
9727 % o color: Return the colormap color in this wand.
9730 WandExport MagickBooleanType MagickSetImageColormapColor(MagickWand *wand,
9731 const size_t index,const PixelWand *color)
9733 assert(wand != (MagickWand *) NULL);
9734 assert(wand->signature == WandSignature);
9735 if (wand->debug != MagickFalse)
9736 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9737 if (wand->images == (Image *) NULL)
9738 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9739 if ((wand->images->colormap == (PixelPacket *) NULL) ||
9740 (index >= wand->images->colors))
9741 ThrowWandException(WandError,"InvalidColormapIndex",wand->name);
9742 PixelGetQuantumColor(color,wand->images->colormap+index);
9743 return(SyncImage(wand->images));
9747 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9751 % M a g i c k S e t I m a g e C o l o r s p a c e %
9755 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9757 % MagickSetImageColorspace() sets the image colorspace.
9759 % The format of the MagickSetImageColorspace method is:
9761 % MagickBooleanType MagickSetImageColorspace(MagickWand *wand,
9762 % const ColorspaceType colorspace)
9764 % A description of each parameter follows:
9766 % o wand: the magick wand.
9768 % o colorspace: the image colorspace: UndefinedColorspace, RGBColorspace,
9769 % GRAYColorspace, TransparentColorspace, OHTAColorspace, XYZColorspace,
9770 % YCbCrColorspace, YCCColorspace, YIQColorspace, YPbPrColorspace,
9771 % YPbPrColorspace, YUVColorspace, CMYKColorspace, sRGBColorspace,
9772 % HSLColorspace, or HWBColorspace.
9775 WandExport MagickBooleanType MagickSetImageColorspace(MagickWand *wand,
9776 const ColorspaceType colorspace)
9778 assert(wand != (MagickWand *) NULL);
9779 assert(wand->signature == WandSignature);
9780 if (wand->debug != MagickFalse)
9781 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9782 if (wand->images == (Image *) NULL)
9783 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9784 return(SetImageColorspace(wand->images,colorspace));
9788 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9792 % M a g i c k S e t I m a g e C o m p o s e %
9796 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9798 % MagickSetImageCompose() sets the image composite operator, useful for
9799 % specifying how to composite the image thumbnail when using the
9800 % MagickMontageImage() method.
9802 % The format of the MagickSetImageCompose method is:
9804 % MagickBooleanType MagickSetImageCompose(MagickWand *wand,
9805 % const CompositeOperator compose)
9807 % A description of each parameter follows:
9809 % o wand: the magick wand.
9811 % o compose: the image composite operator.
9814 WandExport MagickBooleanType MagickSetImageCompose(MagickWand *wand,
9815 const CompositeOperator compose)
9817 assert(wand != (MagickWand *) NULL);
9818 assert(wand->signature == WandSignature);
9819 if (wand->debug != MagickFalse)
9820 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9821 if (wand->images == (Image *) NULL)
9822 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9823 wand->images->compose=compose;
9828 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9832 % 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 %
9836 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9838 % MagickSetImageCompression() sets the image compression.
9840 % The format of the MagickSetImageCompression method is:
9842 % MagickBooleanType MagickSetImageCompression(MagickWand *wand,
9843 % const CompressionType compression)
9845 % A description of each parameter follows:
9847 % o wand: the magick wand.
9849 % o compression: the image compression type.
9852 WandExport MagickBooleanType MagickSetImageCompression(MagickWand *wand,
9853 const CompressionType compression)
9855 assert(wand != (MagickWand *) NULL);
9856 assert(wand->signature == WandSignature);
9857 if (wand->debug != MagickFalse)
9858 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9859 if (wand->images == (Image *) NULL)
9860 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9861 wand->images->compression=compression;
9866 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9870 % 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 %
9874 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9876 % MagickSetImageCompressionQuality() sets the image compression quality.
9878 % The format of the MagickSetImageCompressionQuality method is:
9880 % MagickBooleanType MagickSetImageCompressionQuality(MagickWand *wand,
9881 % const size_t quality)
9883 % A description of each parameter follows:
9885 % o wand: the magick wand.
9887 % o quality: the image compression tlityype.
9890 WandExport MagickBooleanType MagickSetImageCompressionQuality(MagickWand *wand,
9891 const size_t quality)
9893 assert(wand != (MagickWand *) NULL);
9894 assert(wand->signature == WandSignature);
9895 if (wand->debug != MagickFalse)
9896 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9897 if (wand->images == (Image *) NULL)
9898 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9899 wand->images->quality=quality;
9904 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9908 % M a g i c k S e t I m a g e D e l a y %
9912 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9914 % MagickSetImageDelay() sets the image delay.
9916 % The format of the MagickSetImageDelay method is:
9918 % MagickBooleanType MagickSetImageDelay(MagickWand *wand,
9919 % const size_t delay)
9921 % A description of each parameter follows:
9923 % o wand: the magick wand.
9925 % o delay: the image delay in ticks-per-second units.
9928 WandExport MagickBooleanType MagickSetImageDelay(MagickWand *wand,
9931 assert(wand != (MagickWand *) NULL);
9932 assert(wand->signature == WandSignature);
9933 if (wand->debug != MagickFalse)
9934 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9935 if (wand->images == (Image *) NULL)
9936 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9937 wand->images->delay=delay;
9942 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9946 % M a g i c k S e t I m a g e D e p t h %
9950 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9952 % MagickSetImageDepth() sets the image depth.
9954 % The format of the MagickSetImageDepth method is:
9956 % MagickBooleanType MagickSetImageDepth(MagickWand *wand,
9957 % const size_t depth)
9959 % A description of each parameter follows:
9961 % o wand: the magick wand.
9963 % o depth: the image depth in bits: 8, 16, or 32.
9966 WandExport MagickBooleanType MagickSetImageDepth(MagickWand *wand,
9969 assert(wand != (MagickWand *) NULL);
9970 assert(wand->signature == WandSignature);
9971 if (wand->debug != MagickFalse)
9972 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9973 if (wand->images == (Image *) NULL)
9974 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9975 wand->images->depth=depth;
9980 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9984 % M a g i c k S e t I m a g e D i s p o s e %
9988 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9990 % MagickSetImageDispose() sets the image disposal method.
9992 % The format of the MagickSetImageDispose method is:
9994 % MagickBooleanType MagickSetImageDispose(MagickWand *wand,
9995 % const DisposeType dispose)
9997 % A description of each parameter follows:
9999 % o wand: the magick wand.
10001 % o dispose: the image disposeal type.
10004 WandExport MagickBooleanType MagickSetImageDispose(MagickWand *wand,
10005 const DisposeType dispose)
10007 assert(wand != (MagickWand *) NULL);
10008 assert(wand->signature == WandSignature);
10009 if (wand->debug != MagickFalse)
10010 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10011 if (wand->images == (Image *) NULL)
10012 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10013 wand->images->dispose=dispose;
10014 return(MagickTrue);
10018 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10022 % M a g i c k S e t I m a g e E x t e n t %
10026 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10028 % MagickSetImageExtent() sets the image size (i.e. columns & rows).
10030 % The format of the MagickSetImageExtent method is:
10032 % MagickBooleanType MagickSetImageExtent(MagickWand *wand,
10033 % const size_t columns,const unsigned rows)
10035 % A description of each parameter follows:
10037 % o wand: the magick wand.
10039 % o columns: The image width in pixels.
10041 % o rows: The image height in pixels.
10044 WandExport MagickBooleanType MagickSetImageExtent(MagickWand *wand,
10045 const size_t columns,const size_t rows)
10047 assert(wand != (MagickWand *) NULL);
10048 assert(wand->signature == WandSignature);
10049 if (wand->debug != MagickFalse)
10050 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10051 if (wand->images == (Image *) NULL)
10052 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10053 return(SetImageExtent(wand->images,columns,rows));
10057 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10061 % M a g i c k S e t I m a g e F i l e n a m e %
10065 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10067 % MagickSetImageFilename() sets the filename of a particular image in a
10070 % The format of the MagickSetImageFilename method is:
10072 % MagickBooleanType MagickSetImageFilename(MagickWand *wand,
10073 % const char *filename)
10075 % A description of each parameter follows:
10077 % o wand: the magick wand.
10079 % o filename: the image filename.
10082 WandExport MagickBooleanType MagickSetImageFilename(MagickWand *wand,
10083 const char *filename)
10085 assert(wand != (MagickWand *) NULL);
10086 assert(wand->signature == WandSignature);
10087 if (wand->debug != MagickFalse)
10088 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10089 if (wand->images == (Image *) NULL)
10090 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10091 if (filename != (const char *) NULL)
10092 (void) CopyMagickString(wand->images->filename,filename,MaxTextExtent);
10093 return(MagickTrue);
10097 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10101 % M a g i c k S e t I m a g e F o r m a t %
10105 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10107 % MagickSetImageFormat() sets the format of a particular image in a
10110 % The format of the MagickSetImageFormat method is:
10112 % MagickBooleanType MagickSetImageFormat(MagickWand *wand,
10113 % const char *format)
10115 % A description of each parameter follows:
10117 % o wand: the magick wand.
10119 % o format: the image format.
10122 WandExport MagickBooleanType MagickSetImageFormat(MagickWand *wand,
10123 const char *format)
10128 assert(wand != (MagickWand *) NULL);
10129 assert(wand->signature == WandSignature);
10130 if (wand->debug != MagickFalse)
10131 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10132 if (wand->images == (Image *) NULL)
10133 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10134 if ((format == (char *) NULL) || (*format == '\0'))
10136 *wand->images->magick='\0';
10137 return(MagickTrue);
10139 magick_info=GetMagickInfo(format,wand->exception);
10140 if (magick_info == (const MagickInfo *) NULL)
10141 return(MagickFalse);
10142 ClearMagickException(wand->exception);
10143 (void) CopyMagickString(wand->images->magick,format,MaxTextExtent);
10144 return(MagickTrue);
10148 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10152 % M a g i c k S e t I m a g e F u z z %
10156 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10158 % MagickSetImageFuzz() sets the image fuzz.
10160 % The format of the MagickSetImageFuzz method is:
10162 % MagickBooleanType MagickSetImageFuzz(MagickWand *wand,
10163 % const double fuzz)
10165 % A description of each parameter follows:
10167 % o wand: the magick wand.
10169 % o fuzz: the image fuzz.
10172 WandExport MagickBooleanType MagickSetImageFuzz(MagickWand *wand,
10175 assert(wand != (MagickWand *) NULL);
10176 assert(wand->signature == WandSignature);
10177 if (wand->debug != MagickFalse)
10178 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10179 if (wand->images == (Image *) NULL)
10180 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10181 wand->images->fuzz=fuzz;
10182 return(MagickTrue);
10186 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10190 % M a g i c k S e t I m a g e G a m m a %
10194 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10196 % MagickSetImageGamma() sets the image gamma.
10198 % The format of the MagickSetImageGamma method is:
10200 % MagickBooleanType MagickSetImageGamma(MagickWand *wand,
10201 % const double gamma)
10203 % A description of each parameter follows:
10205 % o wand: the magick wand.
10207 % o gamma: the image gamma.
10210 WandExport MagickBooleanType MagickSetImageGamma(MagickWand *wand,
10211 const double gamma)
10213 assert(wand != (MagickWand *) NULL);
10214 assert(wand->signature == WandSignature);
10215 if (wand->debug != MagickFalse)
10216 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10217 if (wand->images == (Image *) NULL)
10218 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10219 wand->images->gamma=gamma;
10220 return(MagickTrue);
10224 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10228 % M a g i c k S e t I m a g e G r a v i t y %
10232 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10234 % MagickSetImageGravity() sets the image gravity type.
10236 % The format of the MagickSetImageGravity method is:
10238 % MagickBooleanType MagickSetImageGravity(MagickWand *wand,
10239 % const GravityType gravity)
10241 % A description of each parameter follows:
10243 % o wand: the magick wand.
10245 % o gravity: the image interlace scheme: NoInterlace, LineInterlace,
10246 % PlaneInterlace, PartitionInterlace.
10249 WandExport MagickBooleanType MagickSetImageGravity(MagickWand *wand,
10250 const GravityType gravity)
10252 assert(wand != (MagickWand *) NULL);
10253 assert(wand->signature == WandSignature);
10254 if (wand->debug != MagickFalse)
10255 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10256 if (wand->images == (Image *) NULL)
10257 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10258 wand->images->gravity=gravity;
10259 return(MagickTrue);
10263 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10267 % 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 %
10271 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10273 % MagickSetImageGreenPrimary() sets the image chromaticity green primary
10276 % The format of the MagickSetImageGreenPrimary method is:
10278 % MagickBooleanType MagickSetImageGreenPrimary(MagickWand *wand,
10279 % const double x,const double y)
10281 % A description of each parameter follows:
10283 % o wand: the magick wand.
10285 % o x: the green primary x-point.
10287 % o y: the green primary y-point.
10291 WandExport MagickBooleanType MagickSetImageGreenPrimary(MagickWand *wand,
10292 const double x,const double y)
10294 assert(wand != (MagickWand *) NULL);
10295 assert(wand->signature == WandSignature);
10296 if (wand->debug != MagickFalse)
10297 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10298 if (wand->images == (Image *) NULL)
10299 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10300 wand->images->chromaticity.green_primary.x=x;
10301 wand->images->chromaticity.green_primary.y=y;
10302 return(MagickTrue);
10306 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10310 % 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 %
10314 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10316 % MagickSetImageInterlaceScheme() sets the image interlace scheme.
10318 % The format of the MagickSetImageInterlaceScheme method is:
10320 % MagickBooleanType MagickSetImageInterlaceScheme(MagickWand *wand,
10321 % const InterlaceType interlace)
10323 % A description of each parameter follows:
10325 % o wand: the magick wand.
10327 % o interlace: the image interlace scheme: NoInterlace, LineInterlace,
10328 % PlaneInterlace, PartitionInterlace.
10331 WandExport MagickBooleanType MagickSetImageInterlaceScheme(MagickWand *wand,
10332 const InterlaceType interlace)
10334 assert(wand != (MagickWand *) NULL);
10335 assert(wand->signature == WandSignature);
10336 if (wand->debug != MagickFalse)
10337 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10338 if (wand->images == (Image *) NULL)
10339 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10340 wand->images->interlace=interlace;
10341 return(MagickTrue);
10345 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10349 % 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 %
10353 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10355 % MagickSetImageInterpolateMethod() sets the image interpolate pixel method.
10357 % The format of the MagickSetImageInterpolateMethod method is:
10359 % MagickBooleanType MagickSetImageInterpolateMethod(MagickWand *wand,
10360 % const InterpolatePixelMethod method)
10362 % A description of each parameter follows:
10364 % o wand: the magick wand.
10366 % o method: the image interpole pixel methods: choose from Undefined,
10367 % Average, Bicubic, Bilinear, Filter, Integer, Mesh, NearestNeighbor.
10370 WandExport MagickBooleanType MagickSetImageInterpolateMethod(MagickWand *wand,
10371 const InterpolatePixelMethod method)
10373 assert(wand != (MagickWand *) NULL);
10374 assert(wand->signature == WandSignature);
10375 if (wand->debug != MagickFalse)
10376 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10377 if (wand->images == (Image *) NULL)
10378 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10379 wand->images->interpolate=method;
10380 return(MagickTrue);
10384 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10388 % M a g i c k S e t I m a g e I t e r a t i o n s %
10392 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10394 % MagickSetImageIterations() sets the image iterations.
10396 % The format of the MagickSetImageIterations method is:
10398 % MagickBooleanType MagickSetImageIterations(MagickWand *wand,
10399 % const size_t iterations)
10401 % A description of each parameter follows:
10403 % o wand: the magick wand.
10405 % o delay: the image delay in 1/100th of a second.
10408 WandExport MagickBooleanType MagickSetImageIterations(MagickWand *wand,
10409 const size_t iterations)
10411 assert(wand != (MagickWand *) NULL);
10412 assert(wand->signature == WandSignature);
10413 if (wand->debug != MagickFalse)
10414 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10415 if (wand->images == (Image *) NULL)
10416 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10417 wand->images->iterations=iterations;
10418 return(MagickTrue);
10422 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10426 % M a g i c k S e t I m a g e M a t t e %
10430 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10432 % MagickSetImageMatte() sets the image matte channel.
10434 % The format of the MagickSetImageMatteColor method is:
10436 % MagickBooleanType MagickSetImageMatteColor(MagickWand *wand,
10437 % const MagickBooleanType *matte)
10439 % A description of each parameter follows:
10441 % o wand: the magick wand.
10443 % o matte: Set to MagickTrue to enable the image matte channel otherwise
10447 WandExport MagickBooleanType MagickSetImageMatte(MagickWand *wand,
10448 const MagickBooleanType matte)
10450 assert(wand != (MagickWand *) NULL);
10451 assert(wand->signature == WandSignature);
10452 if (wand->debug != MagickFalse)
10453 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10454 if (wand->images == (Image *) NULL)
10455 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10456 if ((wand->images->matte == MagickFalse) && (matte != MagickFalse))
10457 (void) SetImageOpacity(wand->images,OpaqueOpacity);
10458 wand->images->matte=matte;
10459 return(MagickTrue);
10463 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10467 % M a g i c k S e t I m a g e M a t t e C o l o r %
10471 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10473 % MagickSetImageMatteColor() sets the image matte color.
10475 % The format of the MagickSetImageMatteColor method is:
10477 % MagickBooleanType MagickSetImageMatteColor(MagickWand *wand,
10478 % const PixelWand *matte)
10480 % A description of each parameter follows:
10482 % o wand: the magick wand.
10484 % o matte: the matte pixel wand.
10487 WandExport MagickBooleanType MagickSetImageMatteColor(MagickWand *wand,
10488 const PixelWand *matte)
10490 assert(wand != (MagickWand *) NULL);
10491 assert(wand->signature == WandSignature);
10492 if (wand->debug != MagickFalse)
10493 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10494 if (wand->images == (Image *) NULL)
10495 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10496 PixelGetQuantumColor(matte,&wand->images->matte_color);
10497 return(MagickTrue);
10501 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10505 % M a g i c k S e t I m a g e O p a c i t y %
10509 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10511 % MagickSetImageOpacity() sets the image to the specified opacity level.
10513 % The format of the MagickSetImageOpacity method is:
10515 % MagickBooleanType MagickSetImageOpacity(MagickWand *wand,
10516 % const double alpha)
10518 % A description of each parameter follows:
10520 % o wand: the magick wand.
10522 % o alpha: the level of transparency: 1.0 is fully opaque and 0.0 is fully
10526 WandExport MagickBooleanType MagickSetImageOpacity(MagickWand *wand,
10527 const double alpha)
10532 assert(wand != (MagickWand *) NULL);
10533 assert(wand->signature == WandSignature);
10534 if (wand->debug != MagickFalse)
10535 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10536 if (wand->images == (Image *) NULL)
10537 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10538 status=SetImageOpacity(wand->images,ClampToQuantum((MagickRealType)
10539 QuantumRange-QuantumRange*alpha));
10540 if (status == MagickFalse)
10541 InheritException(wand->exception,&wand->images->exception);
10546 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10550 % 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 %
10554 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10556 % MagickSetImageOrientation() sets the image orientation.
10558 % The format of the MagickSetImageOrientation method is:
10560 % MagickBooleanType MagickSetImageOrientation(MagickWand *wand,
10561 % const OrientationType orientation)
10563 % A description of each parameter follows:
10565 % o wand: the magick wand.
10567 % o orientation: the image orientation type.
10570 WandExport MagickBooleanType MagickSetImageOrientation(MagickWand *wand,
10571 const OrientationType orientation)
10573 assert(wand != (MagickWand *) NULL);
10574 assert(wand->signature == WandSignature);
10575 if (wand->debug != MagickFalse)
10576 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10577 if (wand->images == (Image *) NULL)
10578 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10579 wand->images->orientation=orientation;
10580 return(MagickTrue);
10584 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10588 % M a g i c k S e t I m a g e P a g e %
10592 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10594 % MagickSetImagePage() sets the page geometry of the image.
10596 % The format of the MagickSetImagePage method is:
10598 % MagickBooleanType MagickSetImagePage(MagickWand *wand,
10599 % const size_t width,const size_t height,const ssize_t x,
10602 % A description of each parameter follows:
10604 % o wand: the magick wand.
10606 % o width: the page width.
10608 % o height: the page height.
10610 % o x: the page x-offset.
10612 % o y: the page y-offset.
10615 WandExport MagickBooleanType MagickSetImagePage(MagickWand *wand,
10616 const size_t width,const size_t height,const ssize_t x,
10619 assert(wand != (MagickWand *) NULL);
10620 assert(wand->signature == WandSignature);
10621 if (wand->debug != MagickFalse)
10622 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10623 if (wand->images == (Image *) NULL)
10624 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10625 wand->images->page.width=width;
10626 wand->images->page.height=height;
10627 wand->images->page.x=x;
10628 wand->images->page.y=y;
10629 return(MagickTrue);
10633 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10637 % 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 %
10641 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10643 % MagickSetImageProgressMonitor() sets the wand image progress monitor to the
10644 % specified method and returns the previous progress monitor if any. The
10645 % progress monitor method looks like this:
10647 % MagickBooleanType MagickProgressMonitor(const char *text,
10648 % const MagickOffsetType offset,const MagickSizeType span,
10649 % void *client_data)
10651 % If the progress monitor returns MagickFalse, the current operation is
10654 % The format of the MagickSetImageProgressMonitor method is:
10656 % MagickProgressMonitor MagickSetImageProgressMonitor(MagickWand *wand
10657 % const MagickProgressMonitor progress_monitor,void *client_data)
10659 % A description of each parameter follows:
10661 % o wand: the magick wand.
10663 % o progress_monitor: Specifies a pointer to a method to monitor progress
10664 % of an image operation.
10666 % o client_data: Specifies a pointer to any client data.
10669 WandExport MagickProgressMonitor MagickSetImageProgressMonitor(MagickWand *wand,
10670 const MagickProgressMonitor progress_monitor,void *client_data)
10672 MagickProgressMonitor
10675 assert(wand != (MagickWand *) NULL);
10676 assert(wand->signature == WandSignature);
10677 if (wand->debug != MagickFalse)
10678 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10679 if (wand->images == (Image *) NULL)
10681 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
10682 "ContainsNoImages","`%s'",wand->name);
10683 return((MagickProgressMonitor) NULL);
10685 previous_monitor=SetImageProgressMonitor(wand->images,
10686 progress_monitor,client_data);
10687 return(previous_monitor);
10691 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10695 % M a g i c k S e t I m a g e R e d P r i m a r y %
10699 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10701 % MagickSetImageRedPrimary() sets the image chromaticity red primary point.
10703 % The format of the MagickSetImageRedPrimary method is:
10705 % MagickBooleanType MagickSetImageRedPrimary(MagickWand *wand,
10706 % const double x,const double y)
10708 % A description of each parameter follows:
10710 % o wand: the magick wand.
10712 % o x: the red primary x-point.
10714 % o y: the red primary y-point.
10717 WandExport MagickBooleanType MagickSetImageRedPrimary(MagickWand *wand,
10718 const double x,const double y)
10720 assert(wand != (MagickWand *) NULL);
10721 assert(wand->signature == WandSignature);
10722 if (wand->debug != MagickFalse)
10723 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10724 if (wand->images == (Image *) NULL)
10725 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10726 wand->images->chromaticity.red_primary.x=x;
10727 wand->images->chromaticity.red_primary.y=y;
10728 return(MagickTrue);
10732 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10736 % 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 %
10740 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10742 % MagickSetImageRenderingIntent() sets the image rendering intent.
10744 % The format of the MagickSetImageRenderingIntent method is:
10746 % MagickBooleanType MagickSetImageRenderingIntent(MagickWand *wand,
10747 % const RenderingIntent rendering_intent)
10749 % A description of each parameter follows:
10751 % o wand: the magick wand.
10753 % o rendering_intent: the image rendering intent: UndefinedIntent,
10754 % SaturationIntent, PerceptualIntent, AbsoluteIntent, or RelativeIntent.
10757 WandExport MagickBooleanType MagickSetImageRenderingIntent(MagickWand *wand,
10758 const RenderingIntent rendering_intent)
10760 assert(wand != (MagickWand *) NULL);
10761 assert(wand->signature == WandSignature);
10762 if (wand->debug != MagickFalse)
10763 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10764 if (wand->images == (Image *) NULL)
10765 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10766 wand->images->rendering_intent=rendering_intent;
10767 return(MagickTrue);
10771 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10775 % M a g i c k S e t I m a g e R e s o l u t i o n %
10779 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10781 % MagickSetImageResolution() sets the image resolution.
10783 % The format of the MagickSetImageResolution method is:
10785 % MagickBooleanType MagickSetImageResolution(MagickWand *wand,
10786 % const double x_resolution,const doubtl y_resolution)
10788 % A description of each parameter follows:
10790 % o wand: the magick wand.
10792 % o x_resolution: the image x resolution.
10794 % o y_resolution: the image y resolution.
10797 WandExport MagickBooleanType MagickSetImageResolution(MagickWand *wand,
10798 const double x_resolution,const double y_resolution)
10800 assert(wand != (MagickWand *) NULL);
10801 assert(wand->signature == WandSignature);
10802 if (wand->debug != MagickFalse)
10803 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10804 if (wand->images == (Image *) NULL)
10805 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10806 wand->images->x_resolution=x_resolution;
10807 wand->images->y_resolution=y_resolution;
10808 return(MagickTrue);
10812 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10816 % M a g i c k S e t I m a g e S c e n e %
10820 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10822 % MagickSetImageScene() sets the image scene.
10824 % The format of the MagickSetImageScene method is:
10826 % MagickBooleanType MagickSetImageScene(MagickWand *wand,
10827 % const size_t scene)
10829 % A description of each parameter follows:
10831 % o wand: the magick wand.
10833 % o delay: the image scene number.
10836 WandExport MagickBooleanType MagickSetImageScene(MagickWand *wand,
10837 const size_t scene)
10839 assert(wand != (MagickWand *) NULL);
10840 assert(wand->signature == WandSignature);
10841 if (wand->debug != MagickFalse)
10842 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10843 if (wand->images == (Image *) NULL)
10844 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10845 wand->images->scene=scene;
10846 return(MagickTrue);
10850 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10854 % 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 %
10858 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10860 % MagickSetImageTicksPerSecond() sets the image ticks-per-second.
10862 % The format of the MagickSetImageTicksPerSecond method is:
10864 % MagickBooleanType MagickSetImageTicksPerSecond(MagickWand *wand,
10865 % const ssize_t ticks_per-second)
10867 % A description of each parameter follows:
10869 % o wand: the magick wand.
10871 % o ticks_per_second: the units to use for the image delay.
10874 WandExport MagickBooleanType MagickSetImageTicksPerSecond(MagickWand *wand,
10875 const ssize_t ticks_per_second)
10877 assert(wand != (MagickWand *) NULL);
10878 assert(wand->signature == WandSignature);
10879 if (wand->debug != MagickFalse)
10880 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10881 if (wand->images == (Image *) NULL)
10882 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10883 wand->images->ticks_per_second=ticks_per_second;
10884 return(MagickTrue);
10888 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10892 % M a g i c k S e t I m a g e T y p e %
10896 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10898 % MagickSetImageType() sets the image type.
10900 % The format of the MagickSetImageType method is:
10902 % MagickBooleanType MagickSetImageType(MagickWand *wand,
10903 % const ImageType image_type)
10905 % A description of each parameter follows:
10907 % o wand: the magick wand.
10909 % o image_type: the image type: UndefinedType, BilevelType, GrayscaleType,
10910 % GrayscaleMatteType, PaletteType, PaletteMatteType, TrueColorType,
10911 % TrueColorMatteType, ColorSeparationType, ColorSeparationMatteType,
10915 WandExport MagickBooleanType MagickSetImageType(MagickWand *wand,
10916 const ImageType image_type)
10918 assert(wand != (MagickWand *) NULL);
10919 assert(wand->signature == WandSignature);
10920 if (wand->debug != MagickFalse)
10921 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10922 if (wand->images == (Image *) NULL)
10923 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10924 return(SetImageType(wand->images,image_type));
10928 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10932 % M a g i c k S e t I m a g e U n i t s %
10936 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10938 % MagickSetImageUnits() sets the image units of resolution.
10940 % The format of the MagickSetImageUnits method is:
10942 % MagickBooleanType MagickSetImageUnits(MagickWand *wand,
10943 % const ResolutionType units)
10945 % A description of each parameter follows:
10947 % o wand: the magick wand.
10949 % o units: the image units of resolution : UndefinedResolution,
10950 % PixelsPerInchResolution, or PixelsPerCentimeterResolution.
10953 WandExport MagickBooleanType MagickSetImageUnits(MagickWand *wand,
10954 const ResolutionType units)
10956 assert(wand != (MagickWand *) NULL);
10957 assert(wand->signature == WandSignature);
10958 if (wand->debug != MagickFalse)
10959 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10960 if (wand->images == (Image *) NULL)
10961 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10962 wand->images->units=units;
10963 return(MagickTrue);
10967 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10971 % 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 %
10975 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10977 % MagickSetImageVirtualPixelMethod() sets the image virtual pixel method.
10979 % The format of the MagickSetImageVirtualPixelMethod method is:
10981 % VirtualPixelMethod MagickSetImageVirtualPixelMethod(MagickWand *wand,
10982 % const VirtualPixelMethod method)
10984 % A description of each parameter follows:
10986 % o wand: the magick wand.
10988 % o method: the image virtual pixel method : UndefinedVirtualPixelMethod,
10989 % ConstantVirtualPixelMethod, EdgeVirtualPixelMethod,
10990 % MirrorVirtualPixelMethod, or TileVirtualPixelMethod.
10993 WandExport VirtualPixelMethod MagickSetImageVirtualPixelMethod(MagickWand *wand,
10994 const VirtualPixelMethod method)
10996 assert(wand != (MagickWand *) NULL);
10997 assert(wand->signature == WandSignature);
10998 if (wand->debug != MagickFalse)
10999 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11000 if (wand->images == (Image *) NULL)
11001 return(UndefinedVirtualPixelMethod);
11002 return(SetImageVirtualPixelMethod(wand->images,method));
11006 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11010 % M a g i c k S e t I m a g e W h i t e P o i n t %
11014 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11016 % MagickSetImageWhitePoint() sets the image chromaticity white point.
11018 % The format of the MagickSetImageWhitePoint method is:
11020 % MagickBooleanType MagickSetImageWhitePoint(MagickWand *wand,
11021 % const double x,const double y)
11023 % A description of each parameter follows:
11025 % o wand: the magick wand.
11027 % o x: the white x-point.
11029 % o y: the white y-point.
11032 WandExport MagickBooleanType MagickSetImageWhitePoint(MagickWand *wand,
11033 const double x,const double y)
11035 assert(wand != (MagickWand *) NULL);
11036 assert(wand->signature == WandSignature);
11037 if (wand->debug != MagickFalse)
11038 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11039 if (wand->images == (Image *) NULL)
11040 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11041 wand->images->chromaticity.white_point.x=x;
11042 wand->images->chromaticity.white_point.y=y;
11043 return(MagickTrue);
11047 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11051 % M a g i c k S h a d e I m a g e C h a n n e l %
11055 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11057 % MagickShadeImage() shines a distant light on an image to create a
11058 % three-dimensional effect. You control the positioning of the light with
11059 % azimuth and elevation; azimuth is measured in degrees off the x axis
11060 % and elevation is measured in pixels above the Z axis.
11062 % The format of the MagickShadeImage method is:
11064 % MagickBooleanType MagickShadeImage(MagickWand *wand,
11065 % const MagickBooleanType gray,const double azimuth,
11066 % const double elevation)
11068 % A description of each parameter follows:
11070 % o wand: the magick wand.
11072 % o gray: A value other than zero shades the intensity of each pixel.
11074 % o azimuth, elevation: Define the light source direction.
11077 WandExport MagickBooleanType MagickShadeImage(MagickWand *wand,
11078 const MagickBooleanType gray,const double asimuth,const double elevation)
11083 assert(wand != (MagickWand *) NULL);
11084 assert(wand->signature == WandSignature);
11085 if (wand->debug != MagickFalse)
11086 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11087 if (wand->images == (Image *) NULL)
11088 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11089 shade_image=ShadeImage(wand->images,gray,asimuth,elevation,wand->exception);
11090 if (shade_image == (Image *) NULL)
11091 return(MagickFalse);
11092 ReplaceImageInList(&wand->images,shade_image);
11093 return(MagickTrue);
11097 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11101 % M a g i c k S h a d o w I m a g e %
11105 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11107 % MagickShadowImage() simulates an image shadow.
11109 % The format of the MagickShadowImage method is:
11111 % MagickBooleanType MagickShadowImage(MagickWand *wand,
11112 % const double opacity,const double sigma,const ssize_t x,const ssize_t y)
11114 % A description of each parameter follows:
11116 % o wand: the magick wand.
11118 % o opacity: percentage transparency.
11120 % o sigma: the standard deviation of the Gaussian, in pixels.
11122 % o x: the shadow x-offset.
11124 % o y: the shadow y-offset.
11127 WandExport MagickBooleanType MagickShadowImage(MagickWand *wand,
11128 const double opacity,const double sigma,const ssize_t x,const ssize_t y)
11133 assert(wand != (MagickWand *) NULL);
11134 assert(wand->signature == WandSignature);
11135 if (wand->debug != MagickFalse)
11136 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11137 if (wand->images == (Image *) NULL)
11138 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11139 shadow_image=ShadowImage(wand->images,opacity,sigma,x,y,wand->exception);
11140 if (shadow_image == (Image *) NULL)
11141 return(MagickFalse);
11142 ReplaceImageInList(&wand->images,shadow_image);
11143 return(MagickTrue);
11147 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11151 % M a g i c k S h a r p e n I m a g e %
11155 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11157 % MagickSharpenImage() sharpens an image. We convolve the image with a
11158 % Gaussian operator of the given radius and standard deviation (sigma).
11159 % For reasonable results, the radius should be larger than sigma. Use a
11160 % radius of 0 and MagickSharpenImage() selects a suitable radius for you.
11162 % The format of the MagickSharpenImage method is:
11164 % MagickBooleanType MagickSharpenImage(MagickWand *wand,
11165 % const double radius,const double sigma)
11166 % MagickBooleanType MagickSharpenImageChannel(MagickWand *wand,
11167 % const ChannelType channel,const double radius,const double sigma)
11169 % A description of each parameter follows:
11171 % o wand: the magick wand.
11173 % o channel: the image channel(s).
11175 % o radius: the radius of the Gaussian, in pixels, not counting the center
11178 % o sigma: the standard deviation of the Gaussian, in pixels.
11182 WandExport MagickBooleanType MagickSharpenImage(MagickWand *wand,
11183 const double radius,const double sigma)
11188 status=MagickSharpenImageChannel(wand,DefaultChannels,radius,sigma);
11192 WandExport MagickBooleanType MagickSharpenImageChannel(MagickWand *wand,
11193 const ChannelType channel,const double radius,const double sigma)
11198 assert(wand != (MagickWand *) NULL);
11199 assert(wand->signature == WandSignature);
11200 if (wand->debug != MagickFalse)
11201 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11202 if (wand->images == (Image *) NULL)
11203 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11204 sharp_image=SharpenImageChannel(wand->images,channel,radius,sigma,
11206 if (sharp_image == (Image *) NULL)
11207 return(MagickFalse);
11208 ReplaceImageInList(&wand->images,sharp_image);
11209 return(MagickTrue);
11213 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11217 % M a g i c k S h a v e I m a g e %
11221 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11223 % MagickShaveImage() shaves pixels from the image edges. It allocates the
11224 % memory necessary for the new Image structure and returns a pointer to the
11227 % The format of the MagickShaveImage method is:
11229 % MagickBooleanType MagickShaveImage(MagickWand *wand,
11230 % const size_t columns,const size_t rows)
11232 % A description of each parameter follows:
11234 % o wand: the magick wand.
11236 % o columns: the number of columns in the scaled image.
11238 % o rows: the number of rows in the scaled image.
11242 WandExport MagickBooleanType MagickShaveImage(MagickWand *wand,
11243 const size_t columns,const size_t rows)
11251 assert(wand != (MagickWand *) NULL);
11252 assert(wand->signature == WandSignature);
11253 if (wand->debug != MagickFalse)
11254 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11255 if (wand->images == (Image *) NULL)
11256 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11257 shave_info.width=columns;
11258 shave_info.height=rows;
11261 shave_image=ShaveImage(wand->images,&shave_info,wand->exception);
11262 if (shave_image == (Image *) NULL)
11263 return(MagickFalse);
11264 ReplaceImageInList(&wand->images,shave_image);
11265 return(MagickTrue);
11269 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11273 % M a g i c k S h e a r I m a g e %
11277 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11279 % MagickShearImage() slides one edge of an image along the X or Y axis,
11280 % creating a parallelogram. An X direction shear slides an edge along the X
11281 % axis, while a Y direction shear slides an edge along the Y axis. The amount
11282 % of the shear is controlled by a shear angle. For X direction shears, x_shear
11283 % is measured relative to the Y axis, and similarly, for Y direction shears
11284 % y_shear is measured relative to the X axis. Empty triangles left over from
11285 % shearing the image are filled with the background color.
11287 % The format of the MagickShearImage method is:
11289 % MagickBooleanType MagickShearImage(MagickWand *wand,
11290 % const PixelWand *background,const double x_shear,onst double y_shear)
11292 % A description of each parameter follows:
11294 % o wand: the magick wand.
11296 % o background: the background pixel wand.
11298 % o x_shear: the number of degrees to shear the image.
11300 % o y_shear: the number of degrees to shear the image.
11303 WandExport MagickBooleanType MagickShearImage(MagickWand *wand,
11304 const PixelWand *background,const double x_shear,const double y_shear)
11309 assert(wand != (MagickWand *) NULL);
11310 assert(wand->signature == WandSignature);
11311 if (wand->debug != MagickFalse)
11312 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11313 if (wand->images == (Image *) NULL)
11314 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11315 PixelGetQuantumColor(background,&wand->images->background_color);
11316 shear_image=ShearImage(wand->images,x_shear,y_shear,wand->exception);
11317 if (shear_image == (Image *) NULL)
11318 return(MagickFalse);
11319 ReplaceImageInList(&wand->images,shear_image);
11320 return(MagickTrue);
11324 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11328 % 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 %
11332 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11334 % MagickSigmoidalContrastImage() adjusts the contrast of an image with a
11335 % non-linear sigmoidal contrast algorithm. Increase the contrast of the
11336 % image using a sigmoidal transfer function without saturating highlights or
11337 % shadows. Contrast indicates how much to increase the contrast (0 is none;
11338 % 3 is typical; 20 is pushing it); mid-point indicates where midtones fall in
11339 % the resultant image (0 is white; 50% is middle-gray; 100% is black). Set
11340 % sharpen to MagickTrue to increase the image contrast otherwise the contrast
11343 % The format of the MagickSigmoidalContrastImage method is:
11345 % MagickBooleanType MagickSigmoidalContrastImage(MagickWand *wand,
11346 % const MagickBooleanType sharpen,const double alpha,const double beta)
11347 % MagickBooleanType MagickSigmoidalContrastImageChannel(MagickWand *wand,
11348 % const ChannelType channel,const MagickBooleanType sharpen,
11349 % const double alpha,const double beta)
11351 % A description of each parameter follows:
11353 % o wand: the magick wand.
11355 % o channel: Identify which channel to level: RedChannel, GreenChannel,
11357 % o sharpen: Increase or decrease image contrast.
11359 % o alpha: strength of the contrast, the larger the number the more
11360 % 'threshold-like' it becomes.
11362 % o beta: midpoint of the function as a color value 0 to QuantumRange.
11366 WandExport MagickBooleanType MagickSigmoidalContrastImage(MagickWand *wand,
11367 const MagickBooleanType sharpen,const double alpha,const double beta)
11372 status=MagickSigmoidalContrastImageChannel(wand,DefaultChannels,sharpen,
11377 WandExport MagickBooleanType MagickSigmoidalContrastImageChannel(
11378 MagickWand *wand,const ChannelType channel,const MagickBooleanType sharpen,
11379 const double alpha,const double beta)
11384 assert(wand != (MagickWand *) NULL);
11385 assert(wand->signature == WandSignature);
11386 if (wand->debug != MagickFalse)
11387 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11388 if (wand->images == (Image *) NULL)
11389 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11390 status=SigmoidalContrastImageChannel(wand->images,channel,sharpen,alpha,beta);
11391 if (status == MagickFalse)
11392 InheritException(wand->exception,&wand->images->exception);
11397 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11401 % M a g i c k S i m i l a r i t y I m a g e %
11405 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11407 % MagickSimilarityImage() compares the reference image of the image and
11408 % returns the best match offset. In addition, it returns a similarity image
11409 % such that an exact match location is completely white and if none of the
11410 % pixels match, black, otherwise some gray level in-between.
11412 % The format of the MagickSimilarityImage method is:
11414 % MagickWand *MagickSimilarityImage(MagickWand *wand,
11415 % const MagickWand *reference,RectangeInfo *offset,double *similarity)
11417 % A description of each parameter follows:
11419 % o wand: the magick wand.
11421 % o reference: the reference wand.
11423 % o offset: the best match offset of the reference image within the image.
11425 % o similarity: the computed similarity between the images.
11428 WandExport MagickWand *MagickSimilarityImage(MagickWand *wand,
11429 const MagickWand *reference,RectangleInfo *offset,double *similarity)
11434 assert(wand != (MagickWand *) NULL);
11435 assert(wand->signature == WandSignature);
11436 if (wand->debug != MagickFalse)
11437 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11438 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
11440 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
11441 "ContainsNoImages","`%s'",wand->name);
11442 return((MagickWand *) NULL);
11444 similarity_image=SimilarityImage(wand->images,reference->images,offset,
11445 similarity,&wand->images->exception);
11446 if (similarity_image == (Image *) NULL)
11447 return((MagickWand *) NULL);
11448 return(CloneMagickWandFromImages(wand,similarity_image));
11452 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11456 % M a g i c k S k e t c h I m a g e %
11460 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11462 % MagickSketchImage() simulates a pencil sketch. We convolve the image with
11463 % a Gaussian operator of the given radius and standard deviation (sigma).
11464 % For reasonable results, radius should be larger than sigma. Use a
11465 % radius of 0 and SketchImage() selects a suitable radius for you.
11466 % Angle gives the angle of the blurring motion.
11468 % The format of the MagickSketchImage method is:
11470 % MagickBooleanType MagickSketchImage(MagickWand *wand,
11471 % const double radius,const double sigma,const double angle)
11473 % A description of each parameter follows:
11475 % o wand: the magick wand.
11477 % o radius: the radius of the Gaussian, in pixels, not counting
11478 % the center pixel.
11480 % o sigma: the standard deviation of the Gaussian, in pixels.
11482 % o angle: Apply the effect along this angle.
11485 WandExport MagickBooleanType MagickSketchImage(MagickWand *wand,
11486 const double radius,const double sigma,const double angle)
11491 assert(wand != (MagickWand *) NULL);
11492 assert(wand->signature == WandSignature);
11493 if (wand->debug != MagickFalse)
11494 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11495 if (wand->images == (Image *) NULL)
11496 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11497 sketch_image=SketchImage(wand->images,radius,sigma,angle,wand->exception);
11498 if (sketch_image == (Image *) NULL)
11499 return(MagickFalse);
11500 ReplaceImageInList(&wand->images,sketch_image);
11501 return(MagickTrue);
11505 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11509 % M a g i c k S m u s h I m a g e s %
11513 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11515 % MagickSmushImages() takes all images from the current image pointer to the
11516 % end of the image list and smushs them to each other top-to-bottom if the
11517 % stack parameter is true, otherwise left-to-right.
11519 % The format of the MagickSmushImages method is:
11521 % MagickWand *MagickSmushImages(MagickWand *wand,
11522 % const MagickBooleanType stack,const ssize_t offset)
11524 % A description of each parameter follows:
11526 % o wand: the magick wand.
11528 % o stack: By default, images are stacked left-to-right. Set stack to
11529 % MagickTrue to stack them top-to-bottom.
11531 % o offset: minimum distance in pixels between images.
11534 WandExport MagickWand *MagickSmushImages(MagickWand *wand,
11535 const MagickBooleanType stack,const ssize_t offset)
11540 assert(wand != (MagickWand *) NULL);
11541 assert(wand->signature == WandSignature);
11542 if (wand->debug != MagickFalse)
11543 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11544 if (wand->images == (Image *) NULL)
11545 return((MagickWand *) NULL);
11546 smush_image=SmushImages(wand->images,stack,offset,wand->exception);
11547 if (smush_image == (Image *) NULL)
11548 return((MagickWand *) NULL);
11549 return(CloneMagickWandFromImages(wand,smush_image));
11553 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11557 % M a g i c k S o l a r i z e I m a g e %
11561 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11563 % MagickSolarizeImage() applies a special effect to the image, similar to the
11564 % effect achieved in a photo darkroom by selectively exposing areas of photo
11565 % sensitive paper to light. Threshold ranges from 0 to QuantumRange and is a
11566 % measure of the extent of the solarization.
11568 % The format of the MagickSolarizeImage method is:
11570 % MagickBooleanType MagickSolarizeImage(MagickWand *wand,
11571 % const double threshold)
11573 % A description of each parameter follows:
11575 % o wand: the magick wand.
11577 % o threshold: Define the extent of the solarization.
11580 WandExport MagickBooleanType MagickSolarizeImage(MagickWand *wand,
11581 const double threshold)
11586 assert(wand != (MagickWand *) NULL);
11587 assert(wand->signature == WandSignature);
11588 if (wand->debug != MagickFalse)
11589 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11590 if (wand->images == (Image *) NULL)
11591 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11592 status=SolarizeImage(wand->images,threshold);
11593 if (status == MagickFalse)
11594 InheritException(wand->exception,&wand->images->exception);
11599 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11603 % M a g i c k S p a r s e C o l o r I m a g e %
11607 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11609 % MagickSparseColorImage(), given a set of coordinates, interpolates the
11610 % colors found at those coordinates, across the whole image, using various
11613 % The format of the MagickSparseColorImage method is:
11615 % MagickBooleanType MagickSparseColorImage(MagickWand *wand,
11616 % const ChannelType channel,const SparseColorMethod method,
11617 % const size_t number_arguments,const double *arguments)
11619 % A description of each parameter follows:
11621 % o image: the image to be sparseed.
11623 % o method: the method of image sparseion.
11625 % ArcSparseColorion will always ignore source image offset, and always
11626 % 'bestfit' the destination image with the top left corner offset
11627 % relative to the polar mapping center.
11629 % Bilinear has no simple inverse mapping so will not allow 'bestfit'
11630 % style of image sparseion.
11632 % Affine, Perspective, and Bilinear, will do least squares fitting of
11633 % the distrotion when more than the minimum number of control point
11634 % pairs are provided.
11636 % Perspective, and Bilinear, will fall back to a Affine sparseion when
11637 % less than 4 control point pairs are provided. While Affine sparseions
11638 % will let you use any number of control point pairs, that is Zero pairs
11639 % is a No-Op (viewport only) distrotion, one pair is a translation and
11640 % two pairs of control points will do a scale-rotate-translate, without
11643 % o number_arguments: the number of arguments given for this sparseion
11646 % o arguments: the arguments for this sparseion method.
11649 WandExport MagickBooleanType MagickSparseColorImage(MagickWand *wand,
11650 const ChannelType channel,const SparseColorMethod method,
11651 const size_t number_arguments,const double *arguments)
11656 assert(wand != (MagickWand *) NULL);
11657 assert(wand->signature == WandSignature);
11658 if (wand->debug != MagickFalse)
11659 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11660 if (wand->images == (Image *) NULL)
11661 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11662 sparse_image=SparseColorImage(wand->images,channel,method,number_arguments,
11663 arguments,wand->exception);
11664 if (sparse_image == (Image *) NULL)
11665 return(MagickFalse);
11666 ReplaceImageInList(&wand->images,sparse_image);
11667 return(MagickTrue);
11671 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11675 % M a g i c k S p l i c e I m a g e %
11679 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11681 % MagickSpliceImage() splices a solid color into the image.
11683 % The format of the MagickSpliceImage method is:
11685 % MagickBooleanType MagickSpliceImage(MagickWand *wand,
11686 % const size_t width,const size_t height,const ssize_t x,
11689 % A description of each parameter follows:
11691 % o wand: the magick wand.
11693 % o width: the region width.
11695 % o height: the region height.
11697 % o x: the region x offset.
11699 % o y: the region y offset.
11702 WandExport MagickBooleanType MagickSpliceImage(MagickWand *wand,
11703 const size_t width,const size_t height,const ssize_t x,
11712 assert(wand != (MagickWand *) NULL);
11713 assert(wand->signature == WandSignature);
11714 if (wand->debug != MagickFalse)
11715 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11716 if (wand->images == (Image *) NULL)
11717 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11718 splice.width=width;
11719 splice.height=height;
11722 splice_image=SpliceImage(wand->images,&splice,wand->exception);
11723 if (splice_image == (Image *) NULL)
11724 return(MagickFalse);
11725 ReplaceImageInList(&wand->images,splice_image);
11726 return(MagickTrue);
11730 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11734 % M a g i c k S p r e a d I m a g e %
11738 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11740 % MagickSpreadImage() is a special effects method that randomly displaces each
11741 % pixel in a block defined by the radius parameter.
11743 % The format of the MagickSpreadImage method is:
11745 % MagickBooleanType MagickSpreadImage(MagickWand *wand,const double radius)
11747 % A description of each parameter follows:
11749 % o wand: the magick wand.
11751 % o radius: Choose a random pixel in a neighborhood of this extent.
11754 WandExport MagickBooleanType MagickSpreadImage(MagickWand *wand,
11755 const double radius)
11760 assert(wand != (MagickWand *) NULL);
11761 assert(wand->signature == WandSignature);
11762 if (wand->debug != MagickFalse)
11763 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11764 if (wand->images == (Image *) NULL)
11765 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11766 spread_image=SpreadImage(wand->images,radius,wand->exception);
11767 if (spread_image == (Image *) NULL)
11768 return(MagickFalse);
11769 ReplaceImageInList(&wand->images,spread_image);
11770 return(MagickTrue);
11774 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11778 % M a g i c k S t e g a n o I m a g e %
11782 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11784 % MagickSteganoImage() hides a digital watermark within the image.
11785 % Recover the hidden watermark later to prove that the authenticity of
11786 % an image. Offset defines the start position within the image to hide
11789 % The format of the MagickSteganoImage method is:
11791 % MagickWand *MagickSteganoImage(MagickWand *wand,
11792 % const MagickWand *watermark_wand,const ssize_t offset)
11794 % A description of each parameter follows:
11796 % o wand: the magick wand.
11798 % o watermark_wand: the watermark wand.
11800 % o offset: Start hiding at this offset into the image.
11803 WandExport MagickWand *MagickSteganoImage(MagickWand *wand,
11804 const MagickWand *watermark_wand,const ssize_t offset)
11809 assert(wand != (MagickWand *) NULL);
11810 assert(wand->signature == WandSignature);
11811 if (wand->debug != MagickFalse)
11812 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11813 if ((wand->images == (Image *) NULL) ||
11814 (watermark_wand->images == (Image *) NULL))
11816 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
11817 "ContainsNoImages","`%s'",wand->name);
11818 return((MagickWand *) NULL);
11820 wand->images->offset=offset;
11821 stegano_image=SteganoImage(wand->images,watermark_wand->images,
11823 if (stegano_image == (Image *) NULL)
11824 return((MagickWand *) NULL);
11825 return(CloneMagickWandFromImages(wand,stegano_image));
11829 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11833 % M a g i c k S t e r e o I m a g e %
11837 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11839 % MagickStereoImage() composites two images and produces a single image that
11840 % is the composite of a left and right image of a stereo pair
11842 % The format of the MagickStereoImage method is:
11844 % MagickWand *MagickStereoImage(MagickWand *wand,
11845 % const MagickWand *offset_wand)
11847 % A description of each parameter follows:
11849 % o wand: the magick wand.
11851 % o offset_wand: Another image wand.
11854 WandExport MagickWand *MagickStereoImage(MagickWand *wand,
11855 const MagickWand *offset_wand)
11860 assert(wand != (MagickWand *) NULL);
11861 assert(wand->signature == WandSignature);
11862 if (wand->debug != MagickFalse)
11863 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11864 if ((wand->images == (Image *) NULL) ||
11865 (offset_wand->images == (Image *) NULL))
11867 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
11868 "ContainsNoImages","`%s'",wand->name);
11869 return((MagickWand *) NULL);
11871 stereo_image=StereoImage(wand->images,offset_wand->images,wand->exception);
11872 if (stereo_image == (Image *) NULL)
11873 return((MagickWand *) NULL);
11874 return(CloneMagickWandFromImages(wand,stereo_image));
11878 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11882 % M a g i c k S t r i p I m a g e %
11886 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11888 % MagickStripImage() strips an image of all profiles and comments.
11890 % The format of the MagickStripImage method is:
11892 % MagickBooleanType MagickStripImage(MagickWand *wand)
11894 % A description of each parameter follows:
11896 % o wand: the magick wand.
11899 WandExport MagickBooleanType MagickStripImage(MagickWand *wand)
11904 assert(wand != (MagickWand *) NULL);
11905 assert(wand->signature == WandSignature);
11906 if (wand->debug != MagickFalse)
11907 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11908 if (wand->images == (Image *) NULL)
11909 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11910 status=StripImage(wand->images);
11911 if (status == MagickFalse)
11912 InheritException(wand->exception,&wand->images->exception);
11917 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11921 % M a g i c k S w i r l I m a g e %
11925 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11927 % MagickSwirlImage() swirls the pixels about the center of the image, where
11928 % degrees indicates the sweep of the arc through which each pixel is moved.
11929 % You get a more dramatic effect as the degrees move from 1 to 360.
11931 % The format of the MagickSwirlImage method is:
11933 % MagickBooleanType MagickSwirlImage(MagickWand *wand,const double degrees)
11935 % A description of each parameter follows:
11937 % o wand: the magick wand.
11939 % o degrees: Define the tightness of the swirling effect.
11942 WandExport MagickBooleanType MagickSwirlImage(MagickWand *wand,
11943 const double degrees)
11948 assert(wand != (MagickWand *) NULL);
11949 assert(wand->signature == WandSignature);
11950 if (wand->debug != MagickFalse)
11951 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11952 if (wand->images == (Image *) NULL)
11953 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11954 swirl_image=SwirlImage(wand->images,degrees,wand->exception);
11955 if (swirl_image == (Image *) NULL)
11956 return(MagickFalse);
11957 ReplaceImageInList(&wand->images,swirl_image);
11958 return(MagickTrue);
11962 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11966 % M a g i c k T e x t u r e I m a g e %
11970 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11972 % MagickTextureImage() repeatedly tiles the texture image across and down the
11975 % The format of the MagickTextureImage method is:
11977 % MagickWand *MagickTextureImage(MagickWand *wand,
11978 % const MagickWand *texture_wand)
11980 % A description of each parameter follows:
11982 % o wand: the magick wand.
11984 % o texture_wand: the texture wand
11987 WandExport MagickWand *MagickTextureImage(MagickWand *wand,
11988 const MagickWand *texture_wand)
11996 assert(wand != (MagickWand *) NULL);
11997 assert(wand->signature == WandSignature);
11998 if (wand->debug != MagickFalse)
11999 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12000 if ((wand->images == (Image *) NULL) ||
12001 (texture_wand->images == (Image *) NULL))
12003 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
12004 "ContainsNoImages","`%s'",wand->name);
12005 return((MagickWand *) NULL);
12007 texture_image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
12008 if (texture_image == (Image *) NULL)
12009 return((MagickWand *) NULL);
12010 status=TextureImage(texture_image,texture_wand->images);
12011 if (status == MagickFalse)
12013 InheritException(wand->exception,&texture_image->exception);
12014 texture_image=DestroyImage(texture_image);
12015 return((MagickWand *) NULL);
12017 return(CloneMagickWandFromImages(wand,texture_image));
12021 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12025 % M a g i c k T h r e s h o l d I m a g e %
12029 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12031 % MagickThresholdImage() changes the value of individual pixels based on
12032 % the intensity of each pixel compared to threshold. The result is a
12033 % high-contrast, two color image.
12035 % The format of the MagickThresholdImage method is:
12037 % MagickBooleanType MagickThresholdImage(MagickWand *wand,
12038 % const double threshold)
12039 % MagickBooleanType MagickThresholdImageChannel(MagickWand *wand,
12040 % const ChannelType channel,const double threshold)
12042 % A description of each parameter follows:
12044 % o wand: the magick wand.
12046 % o channel: the image channel(s).
12048 % o threshold: Define the threshold value.
12051 WandExport MagickBooleanType MagickThresholdImage(MagickWand *wand,
12052 const double threshold)
12057 status=MagickThresholdImageChannel(wand,DefaultChannels,threshold);
12061 WandExport MagickBooleanType MagickThresholdImageChannel(MagickWand *wand,
12062 const ChannelType channel,const double threshold)
12067 assert(wand != (MagickWand *) NULL);
12068 assert(wand->signature == WandSignature);
12069 if (wand->debug != MagickFalse)
12070 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12071 if (wand->images == (Image *) NULL)
12072 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12073 status=BilevelImageChannel(wand->images,channel,threshold);
12074 if (status == MagickFalse)
12075 InheritException(wand->exception,&wand->images->exception);
12080 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12084 % M a g i c k T h u m b n a i l I m a g e %
12088 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12090 % MagickThumbnailImage() changes the size of an image to the given dimensions
12091 % and removes any associated profiles. The goal is to produce small low cost
12092 % thumbnail images suited for display on the Web.
12094 % The format of the MagickThumbnailImage method is:
12096 % MagickBooleanType MagickThumbnailImage(MagickWand *wand,
12097 % const size_t columns,const size_t rows)
12099 % A description of each parameter follows:
12101 % o wand: the magick wand.
12103 % o columns: the number of columns in the scaled image.
12105 % o rows: the number of rows in the scaled image.
12108 WandExport MagickBooleanType MagickThumbnailImage(MagickWand *wand,
12109 const size_t columns,const size_t rows)
12114 assert(wand != (MagickWand *) NULL);
12115 assert(wand->signature == WandSignature);
12116 if (wand->debug != MagickFalse)
12117 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12118 if (wand->images == (Image *) NULL)
12119 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12120 thumbnail_image=ThumbnailImage(wand->images,columns,rows,wand->exception);
12121 if (thumbnail_image == (Image *) NULL)
12122 return(MagickFalse);
12123 ReplaceImageInList(&wand->images,thumbnail_image);
12124 return(MagickTrue);
12128 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12132 % M a g i c k T i n t I m a g e %
12136 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12138 % MagickTintImage() applies a color vector to each pixel in the image. The
12139 % length of the vector is 0 for black and white and at its maximum for the
12140 % midtones. The vector weighting function is
12141 % f(x)=(1-(4.0*((x-0.5)*(x-0.5)))).
12143 % The format of the MagickTintImage method is:
12145 % MagickBooleanType MagickTintImage(MagickWand *wand,
12146 % const PixelWand *tint,const PixelWand *opacity)
12148 % A description of each parameter follows:
12150 % o wand: the magick wand.
12152 % o tint: the tint pixel wand.
12154 % o opacity: the opacity pixel wand.
12157 WandExport MagickBooleanType MagickTintImage(MagickWand *wand,
12158 const PixelWand *tint,const PixelWand *opacity)
12161 percent_opaque[MaxTextExtent];
12169 assert(wand != (MagickWand *) NULL);
12170 assert(wand->signature == WandSignature);
12171 if (wand->debug != MagickFalse)
12172 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12173 if (wand->images == (Image *) NULL)
12174 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12175 (void) FormatMagickString(percent_opaque,MaxTextExtent,
12176 "%g,%g,%g,%g",(double) (100.0*QuantumScale*
12177 PixelGetRedQuantum(opacity)),(double) (100.0*QuantumScale*
12178 PixelGetGreenQuantum(opacity)),(double) (100.0*QuantumScale*
12179 PixelGetBlueQuantum(opacity)),(double) (100.0*QuantumScale*
12180 PixelGetOpacityQuantum(opacity)));
12181 PixelGetQuantumColor(tint,&target);
12182 tint_image=TintImage(wand->images,percent_opaque,target,wand->exception);
12183 if (tint_image == (Image *) NULL)
12184 return(MagickFalse);
12185 ReplaceImageInList(&wand->images,tint_image);
12186 return(MagickTrue);
12190 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12194 % M a g i c k T r a n s f o r m I m a g e %
12198 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12200 % MagickTransformImage() is a convenience method that behaves like
12201 % MagickResizeImage() or MagickCropImage() but accepts scaling and/or cropping
12202 % information as a region geometry specification. If the operation fails,
12203 % a NULL image handle is returned.
12205 % The format of the MagickTransformImage method is:
12207 % MagickWand *MagickTransformImage(MagickWand *wand,const char *crop,
12208 % const char *geometry)
12210 % A description of each parameter follows:
12212 % o wand: the magick wand.
12214 % o crop: A crop geometry string. This geometry defines a subregion of the
12217 % o geometry: An image geometry string. This geometry defines the final
12218 % size of the image.
12221 WandExport MagickWand *MagickTransformImage(MagickWand *wand,
12222 const char *crop,const char *geometry)
12230 assert(wand != (MagickWand *) NULL);
12231 assert(wand->signature == WandSignature);
12232 if (wand->debug != MagickFalse)
12233 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12234 if (wand->images == (Image *) NULL)
12235 return((MagickWand *) NULL);
12236 transform_image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
12237 if (transform_image == (Image *) NULL)
12238 return((MagickWand *) NULL);
12239 status=TransformImage(&transform_image,crop,geometry);
12240 if (status == MagickFalse)
12242 InheritException(wand->exception,&transform_image->exception);
12243 transform_image=DestroyImage(transform_image);
12244 return((MagickWand *) NULL);
12246 return(CloneMagickWandFromImages(wand,transform_image));
12250 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12254 % 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 %
12258 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12260 % MagickTransformImageColorspace() transform the image colorspace.
12262 % The format of the MagickTransformImageColorspace method is:
12264 % MagickBooleanType MagickTransformImageColorspace(MagickWand *wand,
12265 % const ColorspaceType colorspace)
12267 % A description of each parameter follows:
12269 % o wand: the magick wand.
12271 % o colorspace: the image colorspace: UndefinedColorspace, RGBColorspace,
12272 % GRAYColorspace, TransparentColorspace, OHTAColorspace, XYZColorspace,
12273 % YCbCrColorspace, YCCColorspace, YIQColorspace, YPbPrColorspace,
12274 % YPbPrColorspace, YUVColorspace, CMYKColorspace, sRGBColorspace,
12275 % HSLColorspace, or HWBColorspace.
12278 WandExport MagickBooleanType MagickTransformImageColorspace(MagickWand *wand,
12279 const ColorspaceType colorspace)
12281 assert(wand != (MagickWand *) NULL);
12282 assert(wand->signature == WandSignature);
12283 if (wand->debug != MagickFalse)
12284 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12285 if (wand->images == (Image *) NULL)
12286 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12287 return(TransformImageColorspace(wand->images,colorspace));
12291 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12295 % 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 %
12299 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12301 % MagickTransparentPaintImage() changes any pixel that matches color with the
12302 % color defined by fill.
12304 % The format of the MagickTransparentPaintImage method is:
12306 % MagickBooleanType MagickTransparentPaintImage(MagickWand *wand,
12307 % const PixelWand *target,const double alpha,const double fuzz,
12308 % const MagickBooleanType invert)
12310 % A description of each parameter follows:
12312 % o wand: the magick wand.
12314 % o target: Change this target color to specified opacity value within
12317 % o alpha: the level of transparency: 1.0 is fully opaque and 0.0 is fully
12320 % o fuzz: By default target must match a particular pixel color
12321 % exactly. However, in many cases two colors may differ by a small amount.
12322 % The fuzz member of image defines how much tolerance is acceptable to
12323 % consider two colors as the same. For example, set fuzz to 10 and the
12324 % color red at intensities of 100 and 102 respectively are now interpreted
12325 % as the same color for the purposes of the floodfill.
12327 % o invert: paint any pixel that does not match the target color.
12330 WandExport MagickBooleanType MagickTransparentPaintImage(MagickWand *wand,
12331 const PixelWand *target,const double alpha,const double fuzz,
12332 const MagickBooleanType invert)
12340 assert(wand != (MagickWand *) NULL);
12341 assert(wand->signature == WandSignature);
12342 if (wand->debug != MagickFalse)
12343 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12344 if (wand->images == (Image *) NULL)
12345 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12346 PixelGetMagickColor(target,&target_pixel);
12347 wand->images->fuzz=fuzz;
12348 status=TransparentPaintImage(wand->images,&target_pixel,ClampToQuantum(
12349 (MagickRealType) QuantumRange-QuantumRange*alpha),invert);
12350 if (status == MagickFalse)
12351 InheritException(wand->exception,&wand->images->exception);
12356 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12360 % M a g i c k T r a n s p o s e I m a g e %
12364 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12366 % MagickTransposeImage() creates a vertical mirror image by reflecting the
12367 % pixels around the central x-axis while rotating them 90-degrees.
12369 % The format of the MagickTransposeImage method is:
12371 % MagickBooleanType MagickTransposeImage(MagickWand *wand)
12373 % A description of each parameter follows:
12375 % o wand: the magick wand.
12378 WandExport MagickBooleanType MagickTransposeImage(MagickWand *wand)
12383 assert(wand != (MagickWand *) NULL);
12384 assert(wand->signature == WandSignature);
12385 if (wand->debug != MagickFalse)
12386 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12387 if (wand->images == (Image *) NULL)
12388 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12389 transpose_image=TransposeImage(wand->images,wand->exception);
12390 if (transpose_image == (Image *) NULL)
12391 return(MagickFalse);
12392 ReplaceImageInList(&wand->images,transpose_image);
12393 return(MagickTrue);
12397 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12401 % M a g i c k T r a n s v e r s e I m a g e %
12405 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12407 % MagickTransverseImage() creates a horizontal mirror image by reflecting the
12408 % pixels around the central y-axis while rotating them 270-degrees.
12410 % The format of the MagickTransverseImage method is:
12412 % MagickBooleanType MagickTransverseImage(MagickWand *wand)
12414 % A description of each parameter follows:
12416 % o wand: the magick wand.
12419 WandExport MagickBooleanType MagickTransverseImage(MagickWand *wand)
12424 assert(wand != (MagickWand *) NULL);
12425 assert(wand->signature == WandSignature);
12426 if (wand->debug != MagickFalse)
12427 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12428 if (wand->images == (Image *) NULL)
12429 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12430 transverse_image=TransverseImage(wand->images,wand->exception);
12431 if (transverse_image == (Image *) NULL)
12432 return(MagickFalse);
12433 ReplaceImageInList(&wand->images,transverse_image);
12434 return(MagickTrue);
12438 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12442 % M a g i c k T r i m I m a g e %
12446 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12448 % MagickTrimImage() remove edges that are the background color from the image.
12450 % The format of the MagickTrimImage method is:
12452 % MagickBooleanType MagickTrimImage(MagickWand *wand,const double fuzz)
12454 % A description of each parameter follows:
12456 % o wand: the magick wand.
12458 % o fuzz: By default target must match a particular pixel color
12459 % exactly. However, in many cases two colors may differ by a small amount.
12460 % The fuzz member of image defines how much tolerance is acceptable to
12461 % consider two colors as the same. For example, set fuzz to 10 and the
12462 % color red at intensities of 100 and 102 respectively are now interpreted
12463 % as the same color for the purposes of the floodfill.
12466 WandExport MagickBooleanType MagickTrimImage(MagickWand *wand,const double fuzz)
12471 assert(wand != (MagickWand *) NULL);
12472 assert(wand->signature == WandSignature);
12473 if (wand->debug != MagickFalse)
12474 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12475 if (wand->images == (Image *) NULL)
12476 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12477 wand->images->fuzz=fuzz;
12478 trim_image=TrimImage(wand->images,wand->exception);
12479 if (trim_image == (Image *) NULL)
12480 return(MagickFalse);
12481 ReplaceImageInList(&wand->images,trim_image);
12482 return(MagickTrue);
12486 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12490 % M a g i c k U n i q u e I m a g e C o l o r s %
12494 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12496 % MagickUniqueImageColors() discards all but one of any pixel color.
12498 % The format of the MagickUniqueImageColors method is:
12500 % MagickBooleanType MagickUniqueImageColors(MagickWand *wand)
12502 % A description of each parameter follows:
12504 % o wand: the magick wand.
12507 WandExport MagickBooleanType MagickUniqueImageColors(MagickWand *wand)
12512 assert(wand != (MagickWand *) NULL);
12513 assert(wand->signature == WandSignature);
12514 if (wand->debug != MagickFalse)
12515 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12516 if (wand->images == (Image *) NULL)
12517 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12518 unique_image=UniqueImageColors(wand->images,wand->exception);
12519 if (unique_image == (Image *) NULL)
12520 return(MagickFalse);
12521 ReplaceImageInList(&wand->images,unique_image);
12522 return(MagickTrue);
12526 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12530 % M a g i c k U n s h a r p M a s k I m a g e %
12534 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12536 % MagickUnsharpMaskImage() sharpens an image. We convolve the image with a
12537 % Gaussian operator of the given radius and standard deviation (sigma).
12538 % For reasonable results, radius should be larger than sigma. Use a radius
12539 % of 0 and UnsharpMaskImage() selects a suitable radius for you.
12541 % The format of the MagickUnsharpMaskImage method is:
12543 % MagickBooleanType MagickUnsharpMaskImage(MagickWand *wand,
12544 % const double radius,const double sigma,const double amount,
12545 % const double threshold)
12546 % MagickBooleanType MagickUnsharpMaskImageChannel(MagickWand *wand,
12547 % const ChannelType channel,const double radius,const double sigma,
12548 % const double amount,const double threshold)
12550 % A description of each parameter follows:
12552 % o wand: the magick wand.
12554 % o channel: the image channel(s).
12556 % o radius: the radius of the Gaussian, in pixels, not counting the center
12559 % o sigma: the standard deviation of the Gaussian, in pixels.
12561 % o amount: the percentage of the difference between the original and the
12562 % blur image that is added back into the original.
12564 % o threshold: the threshold in pixels needed to apply the diffence amount.
12568 WandExport MagickBooleanType MagickUnsharpMaskImage(MagickWand *wand,
12569 const double radius,const double sigma,const double amount,
12570 const double threshold)
12575 status=MagickUnsharpMaskImageChannel(wand,DefaultChannels,radius,sigma,
12580 WandExport MagickBooleanType MagickUnsharpMaskImageChannel(MagickWand *wand,
12581 const ChannelType channel,const double radius,const double sigma,
12582 const double amount,const double threshold)
12587 assert(wand != (MagickWand *) NULL);
12588 assert(wand->signature == WandSignature);
12589 if (wand->debug != MagickFalse)
12590 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12591 if (wand->images == (Image *) NULL)
12592 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12593 unsharp_image=UnsharpMaskImageChannel(wand->images,channel,radius,sigma,
12594 amount,threshold,wand->exception);
12595 if (unsharp_image == (Image *) NULL)
12596 return(MagickFalse);
12597 ReplaceImageInList(&wand->images,unsharp_image);
12598 return(MagickTrue);
12602 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12606 % M a g i c k V i g n e t t e I m a g e %
12610 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12612 % MagickVignetteImage() softens the edges of the image in vignette style.
12614 % The format of the MagickVignetteImage method is:
12616 % MagickBooleanType MagickVignetteImage(MagickWand *wand,
12617 % const double black_point,const double white_point,const ssize_t x,
12620 % A description of each parameter follows:
12622 % o wand: the magick wand.
12624 % o black_point: the black point.
12626 % o white_point: the white point.
12628 % o x, y: Define the x and y ellipse offset.
12631 WandExport MagickBooleanType MagickVignetteImage(MagickWand *wand,
12632 const double black_point,const double white_point,const ssize_t x,const ssize_t y)
12637 assert(wand != (MagickWand *) NULL);
12638 assert(wand->signature == WandSignature);
12639 if (wand->debug != MagickFalse)
12640 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12641 if (wand->images == (Image *) NULL)
12642 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12643 vignette_image=VignetteImage(wand->images,black_point,white_point,x,y,
12645 if (vignette_image == (Image *) NULL)
12646 return(MagickFalse);
12647 ReplaceImageInList(&wand->images,vignette_image);
12648 return(MagickTrue);
12652 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12656 % M a g i c k W a v e I m a g e %
12660 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12662 % MagickWaveImage() creates a "ripple" effect in the image by shifting
12663 % the pixels vertically along a sine wave whose amplitude and wavelength
12664 % is specified by the given parameters.
12666 % The format of the MagickWaveImage method is:
12668 % MagickBooleanType MagickWaveImage(MagickWand *wand,const double amplitude,
12669 % const double wave_length)
12671 % A description of each parameter follows:
12673 % o wand: the magick wand.
12675 % o amplitude, wave_length: Define the amplitude and wave length of the
12679 WandExport MagickBooleanType MagickWaveImage(MagickWand *wand,
12680 const double amplitude,const double wave_length)
12685 assert(wand != (MagickWand *) NULL);
12686 assert(wand->signature == WandSignature);
12687 if (wand->debug != MagickFalse)
12688 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12689 if (wand->images == (Image *) NULL)
12690 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12691 wave_image=WaveImage(wand->images,amplitude,wave_length,wand->exception);
12692 if (wave_image == (Image *) NULL)
12693 return(MagickFalse);
12694 ReplaceImageInList(&wand->images,wave_image);
12695 return(MagickTrue);
12699 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12703 % 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 %
12707 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12709 % MagickWhiteThresholdImage() is like ThresholdImage() but force all pixels
12710 % above the threshold into white while leaving all pixels below the threshold
12713 % The format of the MagickWhiteThresholdImage method is:
12715 % MagickBooleanType MagickWhiteThresholdImage(MagickWand *wand,
12716 % const PixelWand *threshold)
12718 % A description of each parameter follows:
12720 % o wand: the magick wand.
12722 % o threshold: the pixel wand.
12725 WandExport MagickBooleanType MagickWhiteThresholdImage(MagickWand *wand,
12726 const PixelWand *threshold)
12729 thresholds[MaxTextExtent];
12734 assert(wand != (MagickWand *) NULL);
12735 assert(wand->signature == WandSignature);
12736 if (wand->debug != MagickFalse)
12737 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12738 if (wand->images == (Image *) NULL)
12739 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12740 (void) FormatMagickString(thresholds,MaxTextExtent,
12741 QuantumFormat "," QuantumFormat "," QuantumFormat "," QuantumFormat,
12742 PixelGetRedQuantum(threshold),PixelGetGreenQuantum(threshold),
12743 PixelGetBlueQuantum(threshold),PixelGetOpacityQuantum(threshold));
12744 status=WhiteThresholdImage(wand->images,thresholds);
12745 if (status == MagickFalse)
12746 InheritException(wand->exception,&wand->images->exception);
12751 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12755 % M a g i c k W r i t e I m a g e %
12759 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12761 % MagickWriteImage() writes an image to the specified filename. If the
12762 % filename parameter is NULL, the image is written to the filename set
12763 % by MagickReadImage() or MagickSetImageFilename().
12765 % The format of the MagickWriteImage method is:
12767 % MagickBooleanType MagickWriteImage(MagickWand *wand,
12768 % const char *filename)
12770 % A description of each parameter follows:
12772 % o wand: the magick wand.
12774 % o filename: the image filename.
12778 WandExport MagickBooleanType MagickWriteImage(MagickWand *wand,
12779 const char *filename)
12790 assert(wand != (MagickWand *) NULL);
12791 assert(wand->signature == WandSignature);
12792 if (wand->debug != MagickFalse)
12793 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12794 if (wand->images == (Image *) NULL)
12795 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12796 if (filename != (const char *) NULL)
12797 (void) CopyMagickString(wand->images->filename,filename,MaxTextExtent);
12798 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
12799 if (image == (Image *) NULL)
12800 return(MagickFalse);
12801 write_info=CloneImageInfo(wand->image_info);
12802 write_info->adjoin=MagickTrue;
12803 status=WriteImage(write_info,image);
12804 if (status == MagickFalse)
12805 InheritException(wand->exception,&image->exception);
12806 image=DestroyImage(image);
12807 write_info=DestroyImageInfo(write_info);
12812 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12816 % M a g i c k W r i t e I m a g e F i l e %
12820 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12822 % MagickWriteImageFile() writes an image to an open file descriptor.
12824 % The format of the MagickWriteImageFile method is:
12826 % MagickBooleanType MagickWriteImageFile(MagickWand *wand,FILE *file)
12828 % A description of each parameter follows:
12830 % o wand: the magick wand.
12832 % o file: the file descriptor.
12835 WandExport MagickBooleanType MagickWriteImageFile(MagickWand *wand,FILE *file)
12846 assert(wand != (MagickWand *) NULL);
12847 assert(wand->signature == WandSignature);
12848 assert(file != (FILE *) NULL);
12849 if (wand->debug != MagickFalse)
12850 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12851 if (wand->images == (Image *) NULL)
12852 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12853 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
12854 if (image == (Image *) NULL)
12855 return(MagickFalse);
12856 write_info=CloneImageInfo(wand->image_info);
12857 SetImageInfoFile(write_info,file);
12858 write_info->adjoin=MagickTrue;
12859 status=WriteImage(write_info,image);
12860 write_info=DestroyImageInfo(write_info);
12861 if (status == MagickFalse)
12862 InheritException(wand->exception,&image->exception);
12863 image=DestroyImage(image);
12868 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12872 % M a g i c k W r i t e I m a g e s %
12876 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12878 % MagickWriteImages() writes an image or image sequence.
12880 % The format of the MagickWriteImages method is:
12882 % MagickBooleanType MagickWriteImages(MagickWand *wand,
12883 % const char *filename,const MagickBooleanType adjoin)
12885 % A description of each parameter follows:
12887 % o wand: the magick wand.
12889 % o filename: the image filename.
12891 % o adjoin: join images into a single multi-image file.
12894 WandExport MagickBooleanType MagickWriteImages(MagickWand *wand,
12895 const char *filename,const MagickBooleanType adjoin)
12903 assert(wand != (MagickWand *) NULL);
12904 assert(wand->signature == WandSignature);
12905 if (wand->debug != MagickFalse)
12906 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12907 if (wand->images == (Image *) NULL)
12908 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12909 write_info=CloneImageInfo(wand->image_info);
12910 write_info->adjoin=adjoin;
12911 status=WriteImages(write_info,wand->images,filename,wand->exception);
12912 if (status == MagickFalse)
12913 InheritException(wand->exception,&wand->images->exception);
12914 write_info=DestroyImageInfo(write_info);
12919 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12923 % M a g i c k W r i t e I m a g e s F i l e %
12927 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12929 % MagickWriteImagesFile() writes an image sequence to an open file descriptor.
12931 % The format of the MagickWriteImagesFile method is:
12933 % MagickBooleanType MagickWriteImagesFile(MagickWand *wand,FILE *file)
12935 % A description of each parameter follows:
12937 % o wand: the magick wand.
12939 % o file: the file descriptor.
12942 WandExport MagickBooleanType MagickWriteImagesFile(MagickWand *wand,FILE *file)
12950 assert(wand != (MagickWand *) NULL);
12951 assert(wand->signature == WandSignature);
12952 if (wand->debug != MagickFalse)
12953 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12954 if (wand->images == (Image *) NULL)
12955 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12956 write_info=CloneImageInfo(wand->image_info);
12957 SetImageInfoFile(write_info,file);
12958 write_info->adjoin=MagickTrue;
12959 status=WriteImages(write_info,wand->images,(const char *) NULL,
12961 write_info=DestroyImageInfo(write_info);
12962 if (status == MagickFalse)
12963 InheritException(wand->exception,&wand->images->exception);