2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6 % M M AAA GGGG IIIII CCCC K K %
7 % MM MM A A G I C K K %
8 % M M M AAAAA G GGG I C KKK %
9 % M M A A G G I C K K %
10 % M M A A GGGG IIIII CCCC K K %
12 % IIIII M M AAA GGGG EEEEE %
14 % I M M M AAAAA G GG EEE %
16 % IIIII M M A A GGGG EEEEE %
19 % MagickWand Image Methods %
26 % Copyright 1999-2010 ImageMagick Studio LLC, a non-profit organization %
27 % dedicated to making software imaging solutions freely available. %
29 % You may not use this file except in compliance with the License. You may %
30 % obtain a copy of the License at %
32 % http://www.imagemagick.org/script/license.php %
34 % Unless required by applicable law or agreed to in writing, software %
35 % distributed under the License is distributed on an "AS IS" BASIS, %
36 % WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. %
37 % See the License for the specific language governing permissions and %
38 % limitations under the License. %
40 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
49 #include "wand/studio.h"
50 #include "wand/MagickWand.h"
51 #include "wand/magick-wand-private.h"
52 #include "wand/wand.h"
53 #include "wand/pixel-wand-private.h"
58 #define ThrowWandException(severity,tag,context) \
60 (void) ThrowMagickException(wand->exception,GetMagickModule(),severity, \
61 tag,"`%s'",context); \
62 return(MagickFalse); \
64 #define MagickWandId "MagickWand"
67 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
71 + C l o n e M a g i c k W a n d F r o m I m a g e s %
75 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
77 % CloneMagickWandFromImages() clones the magick wand and inserts a new image
80 % The format of the CloneMagickWandFromImages method is:
82 % MagickWand *CloneMagickWandFromImages(const MagickWand *wand,
85 % A description of each parameter follows:
87 % o wand: the magick wand.
89 % o images: replace the image list with these image(s).
92 static MagickWand *CloneMagickWandFromImages(const MagickWand *wand,
98 assert(wand != (MagickWand *) NULL);
99 assert(wand->signature == WandSignature);
100 if (wand->debug != MagickFalse)
101 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
102 clone_wand=(MagickWand *) AcquireAlignedMemory(1,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 InsertImageInList(&sentinel,images);
447 wand->images=GetFirstImageInList(images);
451 WandExport MagickBooleanType MagickAddImage(MagickWand *wand,
452 const MagickWand *add_wand)
457 assert(wand != (MagickWand *) NULL);
458 assert(wand->signature == WandSignature);
459 if (wand->debug != MagickFalse)
460 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
461 assert(add_wand != (MagickWand *) NULL);
462 assert(add_wand->signature == WandSignature);
463 if (add_wand->images == (Image *) NULL)
464 ThrowWandException(WandError,"ContainsNoImages",add_wand->name);
465 images=CloneImageList(add_wand->images,wand->exception);
466 if (images == (Image *) NULL)
468 return(InsertImageInWand(wand,images));
472 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
476 % M a g i c k A d d N o i s e I m a g e %
480 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
482 % MagickAddNoiseImage() adds random noise to the image.
484 % The format of the MagickAddNoiseImage method is:
486 % MagickBooleanType MagickAddNoiseImage(MagickWand *wand,
487 % const NoiseType noise_type)
488 % MagickBooleanType MagickAddNoiseImageChannel(MagickWand *wand,
489 % const ChannelType channel,const NoiseType noise_type)
491 % A description of each parameter follows:
493 % o wand: the magick wand.
495 % o channel: the image channel(s).
497 % o noise_type: The type of noise: Uniform, Gaussian, Multiplicative,
498 % Impulse, Laplacian, or Poisson.
502 WandExport MagickBooleanType MagickAddNoiseImage(MagickWand *wand,
503 const NoiseType noise_type)
508 status=MagickAddNoiseImageChannel(wand,DefaultChannels,noise_type);
512 WandExport MagickBooleanType MagickAddNoiseImageChannel(MagickWand *wand,
513 const ChannelType channel,const NoiseType noise_type)
518 assert(wand != (MagickWand *) NULL);
519 assert(wand->signature == WandSignature);
520 if (wand->debug != MagickFalse)
521 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
522 if (wand->images == (Image *) NULL)
523 ThrowWandException(WandError,"ContainsNoImages",wand->name);
524 noise_image=AddNoiseImageChannel(wand->images,channel,noise_type,
526 if (noise_image == (Image *) NULL)
528 ReplaceImageInList(&wand->images,noise_image);
533 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
537 % 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 %
541 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
543 % MagickAffineTransformImage() transforms an image as dictated by the affine
544 % matrix of the drawing wand.
546 % The format of the MagickAffineTransformImage method is:
548 % MagickBooleanType MagickAffineTransformImage(MagickWand *wand,
549 % const DrawingWand *drawing_wand)
551 % A description of each parameter follows:
553 % o wand: the magick wand.
555 % o drawing_wand: the draw wand.
558 WandExport MagickBooleanType MagickAffineTransformImage(MagickWand *wand,
559 const DrawingWand *drawing_wand)
567 assert(wand != (MagickWand *) NULL);
568 assert(wand->signature == WandSignature);
569 if (wand->debug != MagickFalse)
570 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
571 if (wand->images == (Image *) NULL)
572 ThrowWandException(WandError,"ContainsNoImages",wand->name);
573 draw_info=PeekDrawingWand(drawing_wand);
574 if (draw_info == (DrawInfo *) NULL)
576 affine_image=AffineTransformImage(wand->images,&draw_info->affine,
578 draw_info=DestroyDrawInfo(draw_info);
579 if (affine_image == (Image *) NULL)
581 ReplaceImageInList(&wand->images,affine_image);
586 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
590 % M a g i c k A n n o t a t e I m a g e %
594 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
596 % MagickAnnotateImage() annotates an image with text.
598 % The format of the MagickAnnotateImage method is:
600 % MagickBooleanType MagickAnnotateImage(MagickWand *wand,
601 % const DrawingWand *drawing_wand,const double x,const double y,
602 % const double angle,const char *text)
604 % A description of each parameter follows:
606 % o wand: the magick wand.
608 % o drawing_wand: the draw wand.
610 % o x: x ordinate to left of text
612 % o y: y ordinate to text baseline
614 % o angle: rotate text relative to this angle.
616 % o text: text to draw
619 WandExport MagickBooleanType MagickAnnotateImage(MagickWand *wand,
620 const DrawingWand *drawing_wand,const double x,const double y,
621 const double angle,const char *text)
624 geometry[MaxTextExtent];
632 assert(wand != (MagickWand *) NULL);
633 assert(wand->signature == WandSignature);
634 if (wand->debug != MagickFalse)
635 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
636 if (wand->images == (Image *) NULL)
637 ThrowWandException(WandError,"ContainsNoImages",wand->name);
638 draw_info=PeekDrawingWand(drawing_wand);
639 if (draw_info == (DrawInfo *) NULL)
641 (void) CloneString(&draw_info->text,text);
642 (void) FormatMagickString(geometry,MaxTextExtent,"%+g%+g",x,y);
643 draw_info->affine.sx=cos(DegreesToRadians(fmod(angle,360.0)));
644 draw_info->affine.rx=sin(DegreesToRadians(fmod(angle,360.0)));
645 draw_info->affine.ry=(-sin(DegreesToRadians(fmod(angle,360.0))));
646 draw_info->affine.sy=cos(DegreesToRadians(fmod(angle,360.0)));
647 (void) CloneString(&draw_info->geometry,geometry);
648 status=AnnotateImage(wand->images,draw_info);
649 draw_info=DestroyDrawInfo(draw_info);
650 if (status == MagickFalse)
651 InheritException(wand->exception,&wand->images->exception);
656 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
660 % M a g i c k A n i m a t e I m a g e s %
664 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
666 % MagickAnimateImages() animates an image or image sequence.
668 % The format of the MagickAnimateImages method is:
670 % MagickBooleanType MagickAnimateImages(MagickWand *wand,
671 % const char *server_name)
673 % A description of each parameter follows:
675 % o wand: the magick wand.
677 % o server_name: the X server name.
680 WandExport MagickBooleanType MagickAnimateImages(MagickWand *wand,
681 const char *server_name)
686 assert(wand != (MagickWand *) NULL);
687 assert(wand->signature == WandSignature);
688 if (wand->debug != MagickFalse)
689 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
690 (void) CloneString(&wand->image_info->server_name,server_name);
691 status=AnimateImages(wand->image_info,wand->images);
692 if (status == MagickFalse)
693 InheritException(wand->exception,&wand->images->exception);
698 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
702 % M a g i c k A p p e n d I m a g e s %
706 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
708 % MagickAppendImages() append a set of images.
710 % The format of the MagickAppendImages method is:
712 % MagickWand *MagickAppendImages(MagickWand *wand,
713 % const MagickBooleanType stack)
715 % A description of each parameter follows:
717 % o wand: the magick wand.
719 % o stack: By default, images are stacked left-to-right. Set stack to
720 % MagickTrue to stack them top-to-bottom.
723 WandExport MagickWand *MagickAppendImages(MagickWand *wand,
724 const MagickBooleanType stack)
729 assert(wand != (MagickWand *) NULL);
730 assert(wand->signature == WandSignature);
731 if (wand->debug != MagickFalse)
732 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
733 if (wand->images == (Image *) NULL)
734 return((MagickWand *) NULL);
735 append_image=AppendImages(wand->images,stack,wand->exception);
736 if (append_image == (Image *) NULL)
737 return((MagickWand *) NULL);
738 return(CloneMagickWandFromImages(wand,append_image));
742 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
746 % M a g i c k A u t o G a m m a I m a g e %
750 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
752 % MagickAutoGammaImage() extracts the 'mean' from the image and adjust the
753 % image to try make set its gamma appropriatally.
755 % The format of the MagickAutoGammaImage method is:
757 % MagickBooleanType MagickAutoGammaImage(MagickWand *wand)
758 % MagickBooleanType MagickAutoGammaImageChannel(MagickWand *wand,
759 % const ChannelType channel)
761 % A description of each parameter follows:
763 % o wand: the magick wand.
765 % o channel: the image channel(s).
768 WandExport MagickBooleanType MagickAutoGammaImage(MagickWand *wand)
773 status=MagickAutoGammaImageChannel(wand,DefaultChannels);
777 WandExport MagickBooleanType MagickAutoGammaImageChannel(MagickWand *wand,
778 const ChannelType channel)
783 assert(wand != (MagickWand *) NULL);
784 assert(wand->signature == WandSignature);
785 if (wand->debug != MagickFalse)
786 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
787 if (wand->images == (Image *) NULL)
788 ThrowWandException(WandError,"ContainsNoImages",wand->name);
789 status=AutoGammaImageChannel(wand->images,channel);
790 if (status == MagickFalse)
791 InheritException(wand->exception,&wand->images->exception);
796 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
800 % M a g i c k A u t o L e v e l I m a g e %
804 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
806 % MagickAutoLevelImage() adjusts the levels of a particular image channel by
807 % scaling the minimum and maximum values to the full quantum range.
809 % The format of the MagickAutoLevelImage method is:
811 % MagickBooleanType MagickAutoLevelImage(MagickWand *wand)
812 % MagickBooleanType MagickAutoLevelImageChannel(MagickWand *wand,
813 % const ChannelType channel)
815 % A description of each parameter follows:
817 % o wand: the magick wand.
819 % o channel: the image channel(s).
822 WandExport MagickBooleanType MagickAutoLevelImage(MagickWand *wand)
827 status=MagickAutoLevelImageChannel(wand,DefaultChannels);
831 WandExport MagickBooleanType MagickAutoLevelImageChannel(MagickWand *wand,
832 const ChannelType channel)
837 assert(wand != (MagickWand *) NULL);
838 assert(wand->signature == WandSignature);
839 if (wand->debug != MagickFalse)
840 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
841 if (wand->images == (Image *) NULL)
842 ThrowWandException(WandError,"ContainsNoImages",wand->name);
843 status=AutoLevelImageChannel(wand->images,channel);
844 if (status == MagickFalse)
845 InheritException(wand->exception,&wand->images->exception);
850 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
854 % 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 %
858 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
860 % MagickBlackThresholdImage() is like MagickThresholdImage() but forces all
861 % pixels below the threshold into black while leaving all pixels above the
862 % threshold unchanged.
864 % The format of the MagickBlackThresholdImage method is:
866 % MagickBooleanType MagickBlackThresholdImage(MagickWand *wand,
867 % const PixelWand *threshold)
869 % A description of each parameter follows:
871 % o wand: the magick wand.
873 % o threshold: the pixel wand.
876 WandExport MagickBooleanType MagickBlackThresholdImage(MagickWand *wand,
877 const PixelWand *threshold)
880 thresholds[MaxTextExtent];
885 assert(wand != (MagickWand *) NULL);
886 assert(wand->signature == WandSignature);
887 if (wand->debug != MagickFalse)
888 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
889 if (wand->images == (Image *) NULL)
890 ThrowWandException(WandError,"ContainsNoImages",wand->name);
891 (void) FormatMagickString(thresholds,MaxTextExtent,
892 QuantumFormat "," QuantumFormat "," QuantumFormat "," QuantumFormat,
893 PixelGetRedQuantum(threshold),PixelGetGreenQuantum(threshold),
894 PixelGetBlueQuantum(threshold),PixelGetOpacityQuantum(threshold));
895 status=BlackThresholdImage(wand->images,thresholds);
896 if (status == MagickFalse)
897 InheritException(wand->exception,&wand->images->exception);
902 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
906 % M a g i c k B l u e S h i f t I m a g e %
910 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
912 % MagickBlueShiftImage() mutes the colors of the image to simulate a scene at
913 % nighttime in the moonlight.
915 % The format of the MagickBlueShiftImage method is:
917 % MagickBooleanType MagickBlueShiftImage(MagickWand *wand,
918 % const double factor)
920 % A description of each parameter follows:
922 % o wand: the magick wand.
924 % o factor: the blue shift factor (default 1.5)
927 WandExport MagickBooleanType MagickBlueShiftImage(MagickWand *wand,
933 assert(wand != (MagickWand *) NULL);
934 assert(wand->signature == WandSignature);
935 if (wand->debug != MagickFalse)
936 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
937 if (wand->images == (Image *) NULL)
938 ThrowWandException(WandError,"ContainsNoImages",wand->name);
939 shift_image=BlueShiftImage(wand->images,factor,wand->exception);
940 if (shift_image == (Image *) NULL)
942 ReplaceImageInList(&wand->images,shift_image);
947 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
951 % M a g i c k B l u r I m a g e %
955 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
957 % MagickBlurImage() blurs an image. We convolve the image with a
958 % gaussian operator of the given radius and standard deviation (sigma).
959 % For reasonable results, the radius should be larger than sigma. Use a
960 % radius of 0 and BlurImage() selects a suitable radius for you.
962 % The format of the MagickBlurImage method is:
964 % MagickBooleanType MagickBlurImage(MagickWand *wand,const double radius,
965 % const double sigma)
966 % MagickBooleanType MagickBlurImageChannel(MagickWand *wand,
967 % const ChannelType channel,const double radius,const double sigma)
969 % A description of each parameter follows:
971 % o wand: the magick wand.
973 % o channel: the image channel(s).
975 % o radius: the radius of the , in pixels, not counting the center
978 % o sigma: the standard deviation of the , in pixels.
982 WandExport MagickBooleanType MagickBlurImage(MagickWand *wand,
983 const double radius,const double sigma)
988 status=MagickBlurImageChannel(wand,DefaultChannels,radius,sigma);
992 WandExport MagickBooleanType MagickBlurImageChannel(MagickWand *wand,
993 const ChannelType channel,const double radius,const double sigma)
998 assert(wand != (MagickWand *) NULL);
999 assert(wand->signature == WandSignature);
1000 if (wand->debug != MagickFalse)
1001 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1002 if (wand->images == (Image *) NULL)
1003 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1004 blur_image=BlurImageChannel(wand->images,channel,radius,sigma,
1006 if (blur_image == (Image *) NULL)
1007 return(MagickFalse);
1008 ReplaceImageInList(&wand->images,blur_image);
1013 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1017 % M a g i c k B o r d e r I m a g e %
1021 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1023 % MagickBorderImage() surrounds the image with a border of the color defined
1024 % by the bordercolor pixel wand.
1026 % The format of the MagickBorderImage method is:
1028 % MagickBooleanType MagickBorderImage(MagickWand *wand,
1029 % const PixelWand *bordercolor,const size_t width,
1030 % const size_t height)
1032 % A description of each parameter follows:
1034 % o wand: the magick wand.
1036 % o bordercolor: the border color pixel wand.
1038 % o width: the border width.
1040 % o height: the border height.
1043 WandExport MagickBooleanType MagickBorderImage(MagickWand *wand,
1044 const PixelWand *bordercolor,const size_t width,
1045 const size_t height)
1053 assert(wand != (MagickWand *) NULL);
1054 assert(wand->signature == WandSignature);
1055 if (wand->debug != MagickFalse)
1056 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1057 if (wand->images == (Image *) NULL)
1058 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1059 border_info.width=width;
1060 border_info.height=height;
1063 PixelGetQuantumColor(bordercolor,&wand->images->border_color);
1064 border_image=BorderImage(wand->images,&border_info,wand->exception);
1065 if (border_image == (Image *) NULL)
1066 return(MagickFalse);
1067 ReplaceImageInList(&wand->images,border_image);
1072 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1076 % 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 %
1080 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1082 % Use MagickBrightnessContrastImage() to change the brightness and/or contrast
1083 % of an image. It converts the brightness and contrast parameters into slope
1084 % and intercept and calls a polynomical function to apply to the image.
1087 % The format of the MagickBrightnessContrastImage method is:
1089 % MagickBooleanType MagickBrightnessContrastImage(MagickWand *wand,
1090 % const double brightness,const double contrast)
1091 % MagickBooleanType MagickBrightnessContrastImageChannel(MagickWand *wand,
1092 % const ChannelType channel,const double brightness,
1093 % const double contrast)
1095 % A description of each parameter follows:
1097 % o wand: the magick wand.
1099 % o channel: the image channel(s).
1101 % o brightness: the brightness percent (-100 .. 100).
1103 % o contrast: the contrast percent (-100 .. 100).
1107 WandExport MagickBooleanType MagickBrightnessContrastImage(MagickWand *wand,
1108 const double brightness,const double contrast)
1113 status=MagickBrightnessContrastImageChannel(wand,DefaultChannels,brightness,
1118 WandExport MagickBooleanType MagickBrightnessContrastImageChannel(
1119 MagickWand *wand,const ChannelType channel,const double brightness,
1120 const double contrast)
1125 assert(wand != (MagickWand *) NULL);
1126 assert(wand->signature == WandSignature);
1127 if (wand->debug != MagickFalse)
1128 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1129 if (wand->images == (Image *) NULL)
1130 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1131 status=BrightnessContrastImageChannel(wand->images,channel,brightness,
1133 if (status == MagickFalse)
1134 InheritException(wand->exception,&wand->images->exception);
1139 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1143 % M a g i c k C h a r c o a l I m a g e %
1147 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1149 % MagickCharcoalImage() simulates a charcoal drawing.
1151 % The format of the MagickCharcoalImage method is:
1153 % MagickBooleanType MagickCharcoalImage(MagickWand *wand,
1154 % const double radius,const double sigma)
1156 % A description of each parameter follows:
1158 % o wand: the magick wand.
1160 % o radius: the radius of the Gaussian, in pixels, not counting the center
1163 % o sigma: the standard deviation of the Gaussian, in pixels.
1166 WandExport MagickBooleanType MagickCharcoalImage(MagickWand *wand,
1167 const double radius,const double sigma)
1172 assert(wand != (MagickWand *) NULL);
1173 assert(wand->signature == WandSignature);
1174 if (wand->debug != MagickFalse)
1175 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1176 if (wand->images == (Image *) NULL)
1177 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1178 charcoal_image=CharcoalImage(wand->images,radius,sigma,wand->exception);
1179 if (charcoal_image == (Image *) NULL)
1180 return(MagickFalse);
1181 ReplaceImageInList(&wand->images,charcoal_image);
1186 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1190 % M a g i c k C h o p I m a g e %
1194 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1196 % MagickChopImage() removes a region of an image and collapses the image to
1197 % occupy the removed portion
1199 % The format of the MagickChopImage method is:
1201 % MagickBooleanType MagickChopImage(MagickWand *wand,
1202 % const size_t width,const size_t height,const ssize_t x,
1205 % A description of each parameter follows:
1207 % o wand: the magick wand.
1209 % o width: the region width.
1211 % o height: the region height.
1213 % o x: the region x offset.
1215 % o y: the region y offset.
1219 WandExport MagickBooleanType MagickChopImage(MagickWand *wand,
1220 const size_t width,const size_t height,const ssize_t x,
1229 assert(wand != (MagickWand *) NULL);
1230 assert(wand->signature == WandSignature);
1231 if (wand->debug != MagickFalse)
1232 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1233 if (wand->images == (Image *) NULL)
1234 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1239 chop_image=ChopImage(wand->images,&chop,wand->exception);
1240 if (chop_image == (Image *) NULL)
1241 return(MagickFalse);
1242 ReplaceImageInList(&wand->images,chop_image);
1247 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1251 % M a g i c k C l a m p I m a g e %
1255 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1257 % MagickClampImage() restricts the color range from 0 to the quantum depth.
1259 % The format of the MagickClampImage method is:
1261 % MagickBooleanType MagickClampImage(MagickWand *wand)
1262 % MagickBooleanType MagickClampImageChannel(MagickWand *wand,
1263 % const ChannelType channel)
1265 % A description of each parameter follows:
1267 % o wand: the magick wand.
1269 % o channel: the channel.
1273 WandExport MagickBooleanType MagickClampImage(MagickWand *wand)
1278 status=MagickClampImageChannel(wand,DefaultChannels);
1282 WandExport MagickBooleanType MagickClampImageChannel(MagickWand *wand,
1283 const ChannelType channel)
1288 assert(wand != (MagickWand *) NULL);
1289 assert(wand->signature == WandSignature);
1290 if (wand->debug != MagickFalse)
1291 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1292 if (wand->images == (Image *) NULL)
1293 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1294 status=ClampImageChannel(wand->images,channel);
1295 if (status == MagickFalse)
1296 InheritException(wand->exception,&wand->images->exception);
1301 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1305 % M a g i c k C l i p I m a g e %
1309 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1311 % MagickClipImage() clips along the first path from the 8BIM profile, if
1314 % The format of the MagickClipImage method is:
1316 % MagickBooleanType MagickClipImage(MagickWand *wand)
1318 % A description of each parameter follows:
1320 % o wand: the magick wand.
1323 WandExport MagickBooleanType MagickClipImage(MagickWand *wand)
1328 assert(wand != (MagickWand *) NULL);
1329 assert(wand->signature == WandSignature);
1330 if (wand->debug != MagickFalse)
1331 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1332 if (wand->images == (Image *) NULL)
1333 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1334 status=ClipImage(wand->images);
1335 if (status == MagickFalse)
1336 InheritException(wand->exception,&wand->images->exception);
1341 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1345 % M a g i c k C l i p I m a g e P a t h %
1349 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1351 % MagickClipImagePath() clips along the named paths from the 8BIM profile, if
1352 % present. Later operations take effect inside the path. Id may be a number
1353 % if preceded with #, to work on a numbered path, e.g., "#1" to use the first
1356 % The format of the MagickClipImagePath method is:
1358 % MagickBooleanType MagickClipImagePath(MagickWand *wand,
1359 % const char *pathname,const MagickBooleanType inside)
1361 % A description of each parameter follows:
1363 % o wand: the magick wand.
1365 % o pathname: name of clipping path resource. If name is preceded by #, use
1366 % clipping path numbered by name.
1368 % o inside: if non-zero, later operations take effect inside clipping path.
1369 % Otherwise later operations take effect outside clipping path.
1372 WandExport MagickBooleanType MagickClipImagePath(MagickWand *wand,
1373 const char *pathname,const MagickBooleanType inside)
1378 assert(wand != (MagickWand *) NULL);
1379 assert(wand->signature == WandSignature);
1380 if (wand->debug != MagickFalse)
1381 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1382 if (wand->images == (Image *) NULL)
1383 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1384 status=ClipImagePath(wand->images,pathname,inside);
1385 if (status == MagickFalse)
1386 InheritException(wand->exception,&wand->images->exception);
1391 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1395 % M a g i c k C l u t I m a g e %
1399 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1401 % MagickClutImage() replaces colors in the image from a color lookup table.
1403 % The format of the MagickClutImage method is:
1405 % MagickBooleanType MagickClutImage(MagickWand *wand,
1406 % const MagickWand *clut_wand)
1407 % MagickBooleanType MagickClutImageChannel(MagickWand *wand,
1408 % const ChannelType channel,const MagickWand *clut_wand)
1410 % A description of each parameter follows:
1412 % o wand: the magick wand.
1414 % o clut_image: the clut image.
1418 WandExport MagickBooleanType MagickClutImage(MagickWand *wand,
1419 const MagickWand *clut_wand)
1424 status=MagickClutImageChannel(wand,DefaultChannels,clut_wand);
1428 WandExport MagickBooleanType MagickClutImageChannel(MagickWand *wand,
1429 const ChannelType channel,const MagickWand *clut_wand)
1434 assert(wand != (MagickWand *) NULL);
1435 assert(wand->signature == WandSignature);
1436 if (wand->debug != MagickFalse)
1437 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1438 if ((wand->images == (Image *) NULL) || (clut_wand->images == (Image *) NULL))
1439 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1440 status=ClutImageChannel(wand->images,channel,clut_wand->images);
1441 if (status == MagickFalse)
1442 InheritException(wand->exception,&wand->images->exception);
1447 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1451 % M a g i c k C o a l e s c e I m a g e s %
1455 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1457 % MagickCoalesceImages() composites a set of images while respecting any page
1458 % offsets and disposal methods. GIF, MIFF, and MNG animation sequences
1459 % typically start with an image background and each subsequent image
1460 % varies in size and offset. MagickCoalesceImages() returns a new sequence
1461 % where each image in the sequence is the same size as the first and
1462 % composited with the next image in the sequence.
1464 % The format of the MagickCoalesceImages method is:
1466 % MagickWand *MagickCoalesceImages(MagickWand *wand)
1468 % A description of each parameter follows:
1470 % o wand: the magick wand.
1473 WandExport MagickWand *MagickCoalesceImages(MagickWand *wand)
1478 assert(wand != (MagickWand *) NULL);
1479 assert(wand->signature == WandSignature);
1480 if (wand->debug != MagickFalse)
1481 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1482 if (wand->images == (Image *) NULL)
1483 return((MagickWand *) NULL);
1484 coalesce_image=CoalesceImages(wand->images,wand->exception);
1485 if (coalesce_image == (Image *) NULL)
1486 return((MagickWand *) NULL);
1487 return(CloneMagickWandFromImages(wand,coalesce_image));
1491 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1495 % M a g i c k C o l o r D e c i s i o n I m a g e %
1499 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1501 % MagickColorDecisionListImage() accepts a lightweight Color Correction
1502 % Collection (CCC) file which solely contains one or more color corrections
1503 % and applies the color correction to the image. Here is a sample CCC file:
1505 % <ColorCorrectionCollection xmlns="urn:ASC:CDL:v1.2">
1506 % <ColorCorrection id="cc03345">
1508 % <Slope> 0.9 1.2 0.5 </Slope>
1509 % <Offset> 0.4 -0.5 0.6 </Offset>
1510 % <Power> 1.0 0.8 1.5 </Power>
1513 % <Saturation> 0.85 </Saturation>
1515 % </ColorCorrection>
1516 % </ColorCorrectionCollection>
1518 % which includes the offset, slope, and power for each of the RGB channels
1519 % as well as the saturation.
1521 % The format of the MagickColorDecisionListImage method is:
1523 % MagickBooleanType MagickColorDecisionListImage(MagickWand *wand,
1524 % const double gamma)
1526 % A description of each parameter follows:
1528 % o wand: the magick wand.
1530 % o color_correction_collection: the color correction collection in XML.
1533 WandExport MagickBooleanType MagickColorDecisionListImage(MagickWand *wand,
1534 const char *color_correction_collection)
1539 assert(wand != (MagickWand *) NULL);
1540 assert(wand->signature == WandSignature);
1541 if (wand->debug != MagickFalse)
1542 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1543 if (wand->images == (Image *) NULL)
1544 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1545 status=ColorDecisionListImage(wand->images,color_correction_collection);
1546 if (status == MagickFalse)
1547 InheritException(wand->exception,&wand->images->exception);
1552 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1556 % M a g i c k C o l o r i z e I m a g e %
1560 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1562 % MagickColorizeImage() blends the fill color with each pixel in the image.
1564 % The format of the MagickColorizeImage method is:
1566 % MagickBooleanType MagickColorizeImage(MagickWand *wand,
1567 % const PixelWand *colorize,const PixelWand *opacity)
1569 % A description of each parameter follows:
1571 % o wand: the magick wand.
1573 % o colorize: the colorize pixel wand.
1575 % o opacity: the opacity pixel wand.
1578 WandExport MagickBooleanType MagickColorizeImage(MagickWand *wand,
1579 const PixelWand *colorize,const PixelWand *opacity)
1582 percent_opaque[MaxTextExtent];
1590 assert(wand != (MagickWand *) NULL);
1591 assert(wand->signature == WandSignature);
1592 if (wand->debug != MagickFalse)
1593 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1594 if (wand->images == (Image *) NULL)
1595 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1596 (void) FormatMagickString(percent_opaque,MaxTextExtent,
1597 "%g,%g,%g,%g",(double) (100.0*QuantumScale*
1598 PixelGetRedQuantum(opacity)),(double) (100.0*QuantumScale*
1599 PixelGetGreenQuantum(opacity)),(double) (100.0*QuantumScale*
1600 PixelGetBlueQuantum(opacity)),(double) (100.0*QuantumScale*
1601 PixelGetOpacityQuantum(opacity)));
1602 PixelGetQuantumColor(colorize,&target);
1603 colorize_image=ColorizeImage(wand->images,percent_opaque,target,
1605 if (colorize_image == (Image *) NULL)
1606 return(MagickFalse);
1607 ReplaceImageInList(&wand->images,colorize_image);
1612 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1616 % M a g i c k C o l o r M a t r i x I m a g e %
1620 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1622 % MagickColorMatrixImage() apply color transformation to an image. The method
1623 % permits saturation changes, hue rotation, luminance to alpha, and various
1624 % other effects. Although variable-sized transformation matrices can be used,
1625 % typically one uses a 5x5 matrix for an RGBA image and a 6x6 for CMYKA
1626 % (or RGBA with offsets). The matrix is similar to those used by Adobe Flash
1627 % except offsets are in column 6 rather than 5 (in support of CMYKA images)
1628 % and offsets are normalized (divide Flash offset by 255).
1630 % The format of the MagickColorMatrixImage method is:
1632 % MagickBooleanType MagickColorMatrixImage(MagickWand *wand,
1633 % const KernelInfo *color_matrix)
1635 % A description of each parameter follows:
1637 % o wand: the magick wand.
1639 % o color_matrix: the color matrix.
1642 WandExport MagickBooleanType MagickColorMatrixImage(MagickWand *wand,
1643 const KernelInfo *color_matrix)
1648 assert(wand != (MagickWand *) NULL);
1649 assert(wand->signature == WandSignature);
1650 if (wand->debug != MagickFalse)
1651 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1652 if (color_matrix == (const KernelInfo *) NULL)
1653 return(MagickFalse);
1654 if (wand->images == (Image *) NULL)
1655 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1656 color_image=ColorMatrixImage(wand->images,color_matrix,wand->exception);
1657 if (color_image == (Image *) NULL)
1658 return(MagickFalse);
1659 ReplaceImageInList(&wand->images,color_image);
1664 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1668 % M a g i c k C o m b i n e I m a g e s %
1672 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1674 % MagickCombineImages() combines one or more images into a single image. The
1675 % grayscale value of the pixels of each image in the sequence is assigned in
1676 % order to the specified hannels of the combined image. The typical
1677 % ordering would be image 1 => Red, 2 => Green, 3 => Blue, etc.
1679 % The format of the MagickCombineImages method is:
1681 % MagickWand *MagickCombineImages(MagickWand *wand,
1682 % const ChannelType channel)
1684 % A description of each parameter follows:
1686 % o wand: the magick wand.
1688 % o channel: the channel.
1691 WandExport MagickWand *MagickCombineImages(MagickWand *wand,
1692 const ChannelType channel)
1697 assert(wand != (MagickWand *) NULL);
1698 assert(wand->signature == WandSignature);
1699 if (wand->debug != MagickFalse)
1700 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1701 if (wand->images == (Image *) NULL)
1702 return((MagickWand *) NULL);
1703 combine_image=CombineImages(wand->images,channel,wand->exception);
1704 if (combine_image == (Image *) NULL)
1705 return((MagickWand *) NULL);
1706 return(CloneMagickWandFromImages(wand,combine_image));
1710 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1714 % M a g i c k C o m m e n t I m a g e %
1718 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1720 % MagickCommentImage() adds a comment to your image.
1722 % The format of the MagickCommentImage method is:
1724 % MagickBooleanType MagickCommentImage(MagickWand *wand,
1725 % const char *comment)
1727 % A description of each parameter follows:
1729 % o wand: the magick wand.
1731 % o comment: the image comment.
1734 WandExport MagickBooleanType MagickCommentImage(MagickWand *wand,
1735 const char *comment)
1740 assert(wand != (MagickWand *) NULL);
1741 assert(wand->signature == WandSignature);
1742 if (wand->debug != MagickFalse)
1743 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1744 if (wand->images == (Image *) NULL)
1745 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1746 status=SetImageProperty(wand->images,"comment",comment);
1747 if (status == MagickFalse)
1748 InheritException(wand->exception,&wand->images->exception);
1753 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1757 % 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 %
1761 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1763 % MagickCompareImageChannels() compares one or more image channels of an image
1764 % to a reconstructed image and returns the difference image.
1766 % The format of the MagickCompareImageChannels method is:
1768 % MagickWand *MagickCompareImageChannels(MagickWand *wand,
1769 % const MagickWand *reference,const ChannelType channel,
1770 % const MetricType metric,double *distortion)
1772 % A description of each parameter follows:
1774 % o wand: the magick wand.
1776 % o reference: the reference wand.
1778 % o channel: the channel.
1780 % o metric: the metric.
1782 % o distortion: the computed distortion between the images.
1785 WandExport MagickWand *MagickCompareImageChannels(MagickWand *wand,
1786 const MagickWand *reference,const ChannelType channel,const MetricType metric,
1792 assert(wand != (MagickWand *) NULL);
1793 assert(wand->signature == WandSignature);
1794 if (wand->debug != MagickFalse)
1795 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1796 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
1798 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
1799 "ContainsNoImages","`%s'",wand->name);
1800 return((MagickWand *) NULL);
1802 compare_image=CompareImageChannels(wand->images,reference->images,channel,
1803 metric,distortion,&wand->images->exception);
1804 if (compare_image == (Image *) NULL)
1805 return((MagickWand *) NULL);
1806 return(CloneMagickWandFromImages(wand,compare_image));
1810 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1814 % M a g i c k C o m p a r e I m a g e L a y e r s %
1818 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1820 % MagickCompareImageLayers() compares each image with the next in a sequence
1821 % and returns the maximum bounding region of any pixel differences it
1824 % The format of the MagickCompareImageLayers method is:
1826 % MagickWand *MagickCompareImageLayers(MagickWand *wand,
1827 % const ImageLayerMethod method)
1829 % A description of each parameter follows:
1831 % o wand: the magick wand.
1833 % o method: the compare method.
1836 WandExport MagickWand *MagickCompareImageLayers(MagickWand *wand,
1837 const ImageLayerMethod method)
1842 assert(wand != (MagickWand *) NULL);
1843 assert(wand->signature == WandSignature);
1844 if (wand->debug != MagickFalse)
1845 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1846 if (wand->images == (Image *) NULL)
1847 return((MagickWand *) NULL);
1848 layers_image=CompareImageLayers(wand->images,method,wand->exception);
1849 if (layers_image == (Image *) NULL)
1850 return((MagickWand *) NULL);
1851 return(CloneMagickWandFromImages(wand,layers_image));
1855 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1859 % M a g i c k C o m p a r e I m a g e s %
1863 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1865 % MagickCompareImages() compares an image to a reconstructed image and returns
1866 % the specified difference image.
1868 % The format of the MagickCompareImages method is:
1870 % MagickWand *MagickCompareImages(MagickWand *wand,
1871 % const MagickWand *reference,const MetricType metric,
1872 % double *distortion)
1874 % A description of each parameter follows:
1876 % o wand: the magick wand.
1878 % o reference: the reference wand.
1880 % o metric: the metric.
1882 % o distortion: the computed distortion between the images.
1885 WandExport MagickWand *MagickCompareImages(MagickWand *wand,
1886 const MagickWand *reference,const MetricType metric,double *distortion)
1892 assert(wand != (MagickWand *) NULL);
1893 assert(wand->signature == WandSignature);
1894 if (wand->debug != MagickFalse)
1895 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1896 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
1898 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
1899 "ContainsNoImages","`%s'",wand->name);
1900 return((MagickWand *) NULL);
1902 compare_image=CompareImages(wand->images,reference->images,metric,distortion,
1903 &wand->images->exception);
1904 if (compare_image == (Image *) NULL)
1905 return((MagickWand *) NULL);
1906 return(CloneMagickWandFromImages(wand,compare_image));
1910 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1914 % M a g i c k C o m p o s i t e I m a g e %
1918 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1920 % MagickCompositeImage() composite one image onto another at the specified
1923 % The format of the MagickCompositeImage method is:
1925 % MagickBooleanType MagickCompositeImage(MagickWand *wand,
1926 % const MagickWand *composite_wand,const CompositeOperator compose,
1927 % const ssize_t x,const ssize_t y)
1928 % MagickBooleanType MagickCompositeImageChannel(MagickWand *wand,
1929 % const ChannelType channel,const MagickWand *composite_wand,
1930 % const CompositeOperator compose,const ssize_t x,const ssize_t y)
1932 % A description of each parameter follows:
1934 % o wand: the magick wand.
1936 % o composite_image: the composite image.
1938 % o compose: This operator affects how the composite is applied to the
1939 % image. The default is Over. Choose from these operators:
1941 % OverCompositeOp InCompositeOp OutCompositeOp
1942 % AtopCompositeOp XorCompositeOp PlusCompositeOp
1943 % MinusCompositeOp AddCompositeOp SubtractCompositeOp
1944 % DifferenceCompositeOp BumpmapCompositeOp CopyCompositeOp
1945 % DisplaceCompositeOp
1947 % o x: the column offset of the composited image.
1949 % o y: the row offset of the composited image.
1953 WandExport MagickBooleanType MagickCompositeImage(MagickWand *wand,
1954 const MagickWand *composite_wand,const CompositeOperator compose,const ssize_t x,
1960 status=MagickCompositeImageChannel(wand,DefaultChannels,composite_wand,
1965 WandExport MagickBooleanType MagickCompositeImageChannel(MagickWand *wand,
1966 const ChannelType channel,const MagickWand *composite_wand,
1967 const CompositeOperator compose,const ssize_t x,const ssize_t y)
1972 assert(wand != (MagickWand *) NULL);
1973 assert(wand->signature == WandSignature);
1974 if (wand->debug != MagickFalse)
1975 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1976 if ((wand->images == (Image *) NULL) ||
1977 (composite_wand->images == (Image *) NULL))
1978 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1979 status=CompositeImageChannel(wand->images,channel,compose,
1980 composite_wand->images,x,y);
1981 if (status == MagickFalse)
1982 InheritException(wand->exception,&wand->images->exception);
1987 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1991 % M a g i c k C o n t r a s t I m a g e %
1995 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1997 % MagickContrastImage() enhances the intensity differences between the lighter
1998 % and darker elements of the image. Set sharpen to a value other than 0 to
1999 % increase the image contrast otherwise the contrast is reduced.
2001 % The format of the MagickContrastImage method is:
2003 % MagickBooleanType MagickContrastImage(MagickWand *wand,
2004 % const MagickBooleanType sharpen)
2006 % A description of each parameter follows:
2008 % o wand: the magick wand.
2010 % o sharpen: Increase or decrease image contrast.
2014 WandExport MagickBooleanType MagickContrastImage(MagickWand *wand,
2015 const MagickBooleanType sharpen)
2020 assert(wand != (MagickWand *) NULL);
2021 assert(wand->signature == WandSignature);
2022 if (wand->debug != MagickFalse)
2023 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2024 if (wand->images == (Image *) NULL)
2025 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2026 status=ContrastImage(wand->images,sharpen);
2027 if (status == MagickFalse)
2028 InheritException(wand->exception,&wand->images->exception);
2033 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2037 % 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 %
2041 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2043 % MagickContrastStretchImage() enhances the contrast of a color image by
2044 % adjusting the pixels color to span the entire range of colors available.
2045 % You can also reduce the influence of a particular channel with a gamma
2048 % The format of the MagickContrastStretchImage method is:
2050 % MagickBooleanType MagickContrastStretchImage(MagickWand *wand,
2051 % const double black_point,const double white_point)
2052 % MagickBooleanType MagickContrastStretchImageChannel(MagickWand *wand,
2053 % const ChannelType channel,const double black_point,
2054 % const double white_point)
2056 % A description of each parameter follows:
2058 % o wand: the magick wand.
2060 % o channel: the image channel(s).
2062 % o black_point: the black point.
2064 % o white_point: the white point.
2068 WandExport MagickBooleanType MagickContrastStretchImage(MagickWand *wand,
2069 const double black_point,const double white_point)
2074 status=MagickContrastStretchImageChannel(wand,DefaultChannels,black_point,
2079 WandExport MagickBooleanType MagickContrastStretchImageChannel(MagickWand *wand,
2080 const ChannelType channel,const double black_point,const double white_point)
2085 assert(wand != (MagickWand *) NULL);
2086 assert(wand->signature == WandSignature);
2087 if (wand->debug != MagickFalse)
2088 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2089 if (wand->images == (Image *) NULL)
2090 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2091 status=ContrastStretchImageChannel(wand->images,channel,black_point,
2093 if (status == MagickFalse)
2094 InheritException(wand->exception,&wand->images->exception);
2099 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2103 % M a g i c k C o n v o l v e I m a g e %
2107 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2109 % MagickConvolveImage() applies a custom convolution kernel to the image.
2111 % The format of the MagickConvolveImage method is:
2113 % MagickBooleanType MagickConvolveImage(MagickWand *wand,
2114 % const size_t order,const double *kernel)
2115 % MagickBooleanType MagickConvolveImageChannel(MagickWand *wand,
2116 % const ChannelType channel,const size_t order,
2117 % const double *kernel)
2119 % A description of each parameter follows:
2121 % o wand: the magick wand.
2123 % o channel: the image channel(s).
2125 % o order: the number of columns and rows in the filter kernel.
2127 % o kernel: An array of doubles representing the convolution kernel.
2131 WandExport MagickBooleanType MagickConvolveImage(MagickWand *wand,
2132 const size_t order,const double *kernel)
2137 status=MagickConvolveImageChannel(wand,DefaultChannels,order,kernel);
2141 WandExport MagickBooleanType MagickConvolveImageChannel(MagickWand *wand,
2142 const ChannelType channel,const size_t order,const double *kernel)
2147 assert(wand != (MagickWand *) NULL);
2148 assert(wand->signature == WandSignature);
2149 if (wand->debug != MagickFalse)
2150 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2151 if (kernel == (const double *) NULL)
2152 return(MagickFalse);
2153 if (wand->images == (Image *) NULL)
2154 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2155 convolve_image=ConvolveImageChannel(wand->images,channel,order,kernel,
2157 if (convolve_image == (Image *) NULL)
2158 return(MagickFalse);
2159 ReplaceImageInList(&wand->images,convolve_image);
2164 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2168 % M a g i c k C r o p I m a g e %
2172 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2174 % MagickCropImage() extracts a region of the image.
2176 % The format of the MagickCropImage method is:
2178 % MagickBooleanType MagickCropImage(MagickWand *wand,
2179 % const size_t width,const size_t height,const ssize_t x,const ssize_t y)
2181 % A description of each parameter follows:
2183 % o wand: the magick wand.
2185 % o width: the region width.
2187 % o height: the region height.
2189 % o x: the region x-offset.
2191 % o y: the region y-offset.
2194 WandExport MagickBooleanType MagickCropImage(MagickWand *wand,
2195 const size_t width,const size_t height,const ssize_t x,const ssize_t y)
2203 assert(wand != (MagickWand *) NULL);
2204 assert(wand->signature == WandSignature);
2205 if (wand->debug != MagickFalse)
2206 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2207 if (wand->images == (Image *) NULL)
2208 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2213 crop_image=CropImage(wand->images,&crop,wand->exception);
2214 if (crop_image == (Image *) NULL)
2215 return(MagickFalse);
2216 ReplaceImageInList(&wand->images,crop_image);
2221 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2225 % M a g i c k C y c l e C o l o r m a p I m a g e %
2229 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2231 % MagickCycleColormapImage() displaces an image's colormap by a given number
2232 % of positions. If you cycle the colormap a number of times you can produce
2233 % a psychodelic effect.
2235 % The format of the MagickCycleColormapImage method is:
2237 % MagickBooleanType MagickCycleColormapImage(MagickWand *wand,
2238 % const ssize_t displace)
2240 % A description of each parameter follows:
2242 % o wand: the magick wand.
2244 % o pixel_wand: the pixel wand.
2247 WandExport MagickBooleanType MagickCycleColormapImage(MagickWand *wand,
2248 const ssize_t displace)
2253 assert(wand != (MagickWand *) NULL);
2254 assert(wand->signature == WandSignature);
2255 if (wand->debug != MagickFalse)
2256 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2257 if (wand->images == (Image *) NULL)
2258 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2259 status=CycleColormapImage(wand->images,displace);
2260 if (status == MagickFalse)
2261 InheritException(wand->exception,&wand->images->exception);
2266 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2270 % M a g i c k C o n s t i t u t e I m a g e %
2274 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2276 % MagickConstituteImage() adds an image to the wand comprised of the pixel
2277 % data you supply. The pixel data must be in scanline order top-to-bottom.
2278 % The data can be char, short int, int, float, or double. Float and double
2279 % require the pixels to be normalized [0..1], otherwise [0..Max], where Max
2280 % is the maximum value the type can accomodate (e.g. 255 for char). For
2281 % example, to create a 640x480 image from unsigned red-green-blue character
2284 % MagickConstituteImage(wand,640,640,"RGB",CharPixel,pixels);
2286 % The format of the MagickConstituteImage method is:
2288 % MagickBooleanType MagickConstituteImage(MagickWand *wand,
2289 % const size_t columns,const size_t rows,const char *map,
2290 % const StorageType storage,void *pixels)
2292 % A description of each parameter follows:
2294 % o wand: the magick wand.
2296 % o columns: width in pixels of the image.
2298 % o rows: height in pixels of the image.
2300 % o map: This string reflects the expected ordering of the pixel array.
2301 % It can be any combination or order of R = red, G = green, B = blue,
2302 % A = alpha (0 is transparent), O = opacity (0 is opaque), C = cyan,
2303 % Y = yellow, M = magenta, K = black, I = intensity (for grayscale),
2306 % o storage: Define the data type of the pixels. Float and double types are
2307 % expected to be normalized [0..1] otherwise [0..QuantumRange]. Choose from
2308 % these types: CharPixel, DoublePixel, FloatPixel, IntegerPixel,
2309 % LongPixel, QuantumPixel, or ShortPixel.
2311 % o pixels: This array of values contain the pixel components as defined by
2312 % map and type. You must preallocate this array where the expected
2313 % length varies depending on the values of width, height, map, and type.
2317 WandExport MagickBooleanType MagickConstituteImage(MagickWand *wand,
2318 const size_t columns,const size_t rows,const char *map,
2319 const StorageType storage,const void *pixels)
2324 assert(wand != (MagickWand *) NULL);
2325 assert(wand->signature == WandSignature);
2326 if (wand->debug != MagickFalse)
2327 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2328 images=ConstituteImage(columns,rows,map,storage,pixels,wand->exception);
2329 if (images == (Image *) NULL)
2330 return(MagickFalse);
2331 return(InsertImageInWand(wand,images));
2335 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2339 % M a g i c k D e c i p h e r I m a g e %
2343 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2345 % MagickDecipherImage() converts cipher pixels to plain pixels.
2347 % The format of the MagickDecipherImage method is:
2349 % MagickBooleanType MagickDecipherImage(MagickWand *wand,
2350 % const char *passphrase)
2352 % A description of each parameter follows:
2354 % o wand: the magick wand.
2356 % o passphrase: the passphrase.
2359 WandExport MagickBooleanType MagickDecipherImage(MagickWand *wand,
2360 const char *passphrase)
2362 assert(wand != (MagickWand *) NULL);
2363 assert(wand->signature == WandSignature);
2364 if (wand->debug != MagickFalse)
2365 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2366 if (wand->images == (Image *) NULL)
2367 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2368 return(DecipherImage(wand->images,passphrase,&wand->images->exception));
2372 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2376 % M a g i c k D e c o n s t r u c t I m a g e s %
2380 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2382 % MagickDeconstructImages() compares each image with the next in a sequence
2383 % and returns the maximum bounding region of any pixel differences it
2386 % The format of the MagickDeconstructImages method is:
2388 % MagickWand *MagickDeconstructImages(MagickWand *wand)
2390 % A description of each parameter follows:
2392 % o wand: the magick wand.
2395 WandExport MagickWand *MagickDeconstructImages(MagickWand *wand)
2400 assert(wand != (MagickWand *) NULL);
2401 assert(wand->signature == WandSignature);
2402 if (wand->debug != MagickFalse)
2403 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2404 if (wand->images == (Image *) NULL)
2405 return((MagickWand *) NULL);
2406 deconstruct_image=DeconstructImages(wand->images,wand->exception);
2407 if (deconstruct_image == (Image *) NULL)
2408 return((MagickWand *) NULL);
2409 return(CloneMagickWandFromImages(wand,deconstruct_image));
2413 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2417 % M a g i c k D e s k e w I m a g e %
2421 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2423 % MagickDeskewImage() removes skew from the image. Skew is an artifact that
2424 % occurs in scanned images because of the camera being misaligned,
2425 % imperfections in the scanning or surface, or simply because the paper was
2426 % not placed completely flat when scanned.
2428 % The format of the MagickDeskewImage method is:
2430 % MagickBooleanType MagickDeskewImage(MagickWand *wand,
2431 % const double threshold)
2433 % A description of each parameter follows:
2435 % o wand: the magick wand.
2437 % o threshold: separate background from foreground.
2440 WandExport MagickBooleanType MagickDeskewImage(MagickWand *wand,
2441 const double threshold)
2446 assert(wand != (MagickWand *) NULL);
2447 assert(wand->signature == WandSignature);
2448 if (wand->debug != MagickFalse)
2449 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2450 if (wand->images == (Image *) NULL)
2451 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2452 sepia_image=DeskewImage(wand->images,threshold,wand->exception);
2453 if (sepia_image == (Image *) NULL)
2454 return(MagickFalse);
2455 ReplaceImageInList(&wand->images,sepia_image);
2460 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2464 % M a g i c k D e s p e c k l e I m a g e %
2468 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2470 % MagickDespeckleImage() reduces the speckle noise in an image while
2471 % perserving the edges of the original image.
2473 % The format of the MagickDespeckleImage method is:
2475 % MagickBooleanType MagickDespeckleImage(MagickWand *wand)
2477 % A description of each parameter follows:
2479 % o wand: the magick wand.
2482 WandExport MagickBooleanType MagickDespeckleImage(MagickWand *wand)
2487 assert(wand != (MagickWand *) NULL);
2488 assert(wand->signature == WandSignature);
2489 if (wand->debug != MagickFalse)
2490 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2491 if (wand->images == (Image *) NULL)
2492 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2493 despeckle_image=DespeckleImage(wand->images,wand->exception);
2494 if (despeckle_image == (Image *) NULL)
2495 return(MagickFalse);
2496 ReplaceImageInList(&wand->images,despeckle_image);
2501 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2505 % M a g i c k D e s t r o y I m a g e %
2509 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2511 % MagickDestroyImage() dereferences an image, deallocating memory associated
2512 % with the image if the reference count becomes zero.
2514 % The format of the MagickDestroyImage method is:
2516 % Image *MagickDestroyImage(Image *image)
2518 % A description of each parameter follows:
2520 % o image: the image.
2523 WandExport Image *MagickDestroyImage(Image *image)
2525 return(DestroyImage(image));
2529 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2533 % M a g i c k D i s p l a y I m a g e %
2537 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2539 % MagickDisplayImage() displays an image.
2541 % The format of the MagickDisplayImage method is:
2543 % MagickBooleanType MagickDisplayImage(MagickWand *wand,
2544 % const char *server_name)
2546 % A description of each parameter follows:
2548 % o wand: the magick wand.
2550 % o server_name: the X server name.
2553 WandExport MagickBooleanType MagickDisplayImage(MagickWand *wand,
2554 const char *server_name)
2562 assert(wand != (MagickWand *) NULL);
2563 assert(wand->signature == WandSignature);
2564 if (wand->debug != MagickFalse)
2565 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2566 if (wand->images == (Image *) NULL)
2567 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2568 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
2569 if (image == (Image *) NULL)
2570 return(MagickFalse);
2571 (void) CloneString(&wand->image_info->server_name,server_name);
2572 status=DisplayImages(wand->image_info,image);
2573 if (status == MagickFalse)
2574 InheritException(wand->exception,&image->exception);
2575 image=DestroyImage(image);
2580 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2584 % M a g i c k D i s p l a y I m a g e s %
2588 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2590 % MagickDisplayImages() displays an image or image sequence.
2592 % The format of the MagickDisplayImages method is:
2594 % MagickBooleanType MagickDisplayImages(MagickWand *wand,
2595 % const char *server_name)
2597 % A description of each parameter follows:
2599 % o wand: the magick wand.
2601 % o server_name: the X server name.
2604 WandExport MagickBooleanType MagickDisplayImages(MagickWand *wand,
2605 const char *server_name)
2610 assert(wand != (MagickWand *) NULL);
2611 assert(wand->signature == WandSignature);
2612 if (wand->debug != MagickFalse)
2613 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2614 (void) CloneString(&wand->image_info->server_name,server_name);
2615 status=DisplayImages(wand->image_info,wand->images);
2616 if (status == MagickFalse)
2617 InheritException(wand->exception,&wand->images->exception);
2622 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2626 % M a g i c k D i s t o r t I m a g e %
2630 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2632 % MagickDistortImage() distorts an image using various distortion methods, by
2633 % mapping color lookups of the source image to a new destination image
2634 % usally of the same size as the source image, unless 'bestfit' is set to
2637 % If 'bestfit' is enabled, and distortion allows it, the destination image is
2638 % adjusted to ensure the whole source 'image' will just fit within the final
2639 % destination image, which will be sized and offset accordingly. Also in
2640 % many cases the virtual offset of the source image will be taken into
2641 % account in the mapping.
2643 % The format of the MagickDistortImage method is:
2645 % MagickBooleanType MagickDistortImage(MagickWand *wand,
2646 % const DistortImageMethod method,const size_t number_arguments,
2647 % const double *arguments,const MagickBooleanType bestfit)
2649 % A description of each parameter follows:
2651 % o image: the image to be distorted.
2653 % o method: the method of image distortion.
2655 % ArcDistortion always ignores the source image offset, and always
2656 % 'bestfit' the destination image with the top left corner offset
2657 % relative to the polar mapping center.
2659 % Bilinear has no simple inverse mapping so it does not allow 'bestfit'
2660 % style of image distortion.
2662 % Affine, Perspective, and Bilinear, do least squares fitting of the
2663 % distortion when more than the minimum number of control point pairs
2666 % Perspective, and Bilinear, falls back to a Affine distortion when less
2667 % that 4 control point pairs are provided. While Affine distortions let
2668 % you use any number of control point pairs, that is Zero pairs is a
2669 % no-Op (viewport only) distrotion, one pair is a translation and two
2670 % pairs of control points do a scale-rotate-translate, without any
2673 % o number_arguments: the number of arguments given for this distortion
2676 % o arguments: the arguments for this distortion method.
2678 % o bestfit: Attempt to resize destination to fit distorted source.
2681 WandExport MagickBooleanType MagickDistortImage(MagickWand *wand,
2682 const DistortImageMethod method,const size_t number_arguments,
2683 const double *arguments,const MagickBooleanType bestfit)
2688 assert(wand != (MagickWand *) NULL);
2689 assert(wand->signature == WandSignature);
2690 if (wand->debug != MagickFalse)
2691 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2692 if (wand->images == (Image *) NULL)
2693 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2694 distort_image=DistortImage(wand->images,method,number_arguments,arguments,
2695 bestfit,wand->exception);
2696 if (distort_image == (Image *) NULL)
2697 return(MagickFalse);
2698 ReplaceImageInList(&wand->images,distort_image);
2703 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2707 % M a g i c k D r a w I m a g e %
2711 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2713 % MagickDrawImage() renders the drawing wand on the current image.
2715 % The format of the MagickDrawImage method is:
2717 % MagickBooleanType MagickDrawImage(MagickWand *wand,
2718 % const DrawingWand *drawing_wand)
2720 % A description of each parameter follows:
2722 % o wand: the magick wand.
2724 % o drawing_wand: the draw wand.
2727 WandExport MagickBooleanType MagickDrawImage(MagickWand *wand,
2728 const DrawingWand *drawing_wand)
2739 assert(wand != (MagickWand *) NULL);
2740 assert(wand->signature == WandSignature);
2741 if (wand->debug != MagickFalse)
2742 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2743 if (wand->images == (Image *) NULL)
2744 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2745 draw_info=PeekDrawingWand(drawing_wand);
2746 if ((draw_info == (DrawInfo *) NULL) ||
2747 (draw_info->primitive == (char *) NULL))
2748 return(MagickFalse);
2749 primitive=AcquireString(draw_info->primitive);
2750 draw_info=DestroyDrawInfo(draw_info);
2751 draw_info=CloneDrawInfo(wand->image_info,(DrawInfo *) NULL);
2752 draw_info->primitive=primitive;
2753 status=DrawImage(wand->images,draw_info);
2754 if (status == MagickFalse)
2755 InheritException(wand->exception,&wand->images->exception);
2756 draw_info=DestroyDrawInfo(draw_info);
2761 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2765 % M a g i c k E d g e I m a g e %
2769 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2771 % MagickEdgeImage() enhance edges within the image with a convolution filter
2772 % of the given radius. Use a radius of 0 and Edge() selects a suitable
2775 % The format of the MagickEdgeImage method is:
2777 % MagickBooleanType MagickEdgeImage(MagickWand *wand,const double radius)
2779 % A description of each parameter follows:
2781 % o wand: the magick wand.
2783 % o radius: the radius of the pixel neighborhood.
2786 WandExport MagickBooleanType MagickEdgeImage(MagickWand *wand,
2787 const double radius)
2792 assert(wand != (MagickWand *) NULL);
2793 assert(wand->signature == WandSignature);
2794 if (wand->debug != MagickFalse)
2795 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2796 if (wand->images == (Image *) NULL)
2797 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2798 edge_image=EdgeImage(wand->images,radius,wand->exception);
2799 if (edge_image == (Image *) NULL)
2800 return(MagickFalse);
2801 ReplaceImageInList(&wand->images,edge_image);
2806 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2810 % M a g i c k E m b o s s I m a g e %
2814 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2816 % MagickEmbossImage() returns a grayscale image with a three-dimensional
2817 % effect. We convolve the image with a Gaussian operator of the given radius
2818 % and standard deviation (sigma). For reasonable results, radius should be
2819 % larger than sigma. Use a radius of 0 and Emboss() selects a suitable
2822 % The format of the MagickEmbossImage method is:
2824 % MagickBooleanType MagickEmbossImage(MagickWand *wand,const double radius,
2825 % const double sigma)
2827 % A description of each parameter follows:
2829 % o wand: the magick wand.
2831 % o radius: the radius of the Gaussian, in pixels, not counting the center
2834 % o sigma: the standard deviation of the Gaussian, in pixels.
2837 WandExport MagickBooleanType MagickEmbossImage(MagickWand *wand,
2838 const double radius,const double sigma)
2843 assert(wand != (MagickWand *) NULL);
2844 assert(wand->signature == WandSignature);
2845 if (wand->debug != MagickFalse)
2846 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2847 if (wand->images == (Image *) NULL)
2848 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2849 emboss_image=EmbossImage(wand->images,radius,sigma,wand->exception);
2850 if (emboss_image == (Image *) NULL)
2851 return(MagickFalse);
2852 ReplaceImageInList(&wand->images,emboss_image);
2857 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2861 % M a g i c k E n c i p h e r I m a g e %
2865 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2867 % MagickEncipherImage() converts plaint pixels to cipher pixels.
2869 % The format of the MagickEncipherImage method is:
2871 % MagickBooleanType MagickEncipherImage(MagickWand *wand,
2872 % const char *passphrase)
2874 % A description of each parameter follows:
2876 % o wand: the magick wand.
2878 % o passphrase: the passphrase.
2881 WandExport MagickBooleanType MagickEncipherImage(MagickWand *wand,
2882 const char *passphrase)
2884 assert(wand != (MagickWand *) NULL);
2885 assert(wand->signature == WandSignature);
2886 if (wand->debug != MagickFalse)
2887 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2888 if (wand->images == (Image *) NULL)
2889 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2890 return(EncipherImage(wand->images,passphrase,&wand->images->exception));
2894 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2898 % M a g i c k E n h a n c e I m a g e %
2902 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2904 % MagickEnhanceImage() applies a digital filter that improves the quality of a
2907 % The format of the MagickEnhanceImage method is:
2909 % MagickBooleanType MagickEnhanceImage(MagickWand *wand)
2911 % A description of each parameter follows:
2913 % o wand: the magick wand.
2916 WandExport MagickBooleanType MagickEnhanceImage(MagickWand *wand)
2921 assert(wand != (MagickWand *) NULL);
2922 assert(wand->signature == WandSignature);
2923 if (wand->debug != MagickFalse)
2924 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2925 if (wand->images == (Image *) NULL)
2926 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2927 enhance_image=EnhanceImage(wand->images,wand->exception);
2928 if (enhance_image == (Image *) NULL)
2929 return(MagickFalse);
2930 ReplaceImageInList(&wand->images,enhance_image);
2935 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2939 % M a g i c k E q u a l i z e I m a g e %
2943 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2945 % MagickEqualizeImage() equalizes the image histogram.
2947 % The format of the MagickEqualizeImage method is:
2949 % MagickBooleanType MagickEqualizeImage(MagickWand *wand)
2950 % MagickBooleanType MagickEqualizeImageChannel(MagickWand *wand,
2951 % const ChannelType channel)
2953 % A description of each parameter follows:
2955 % o wand: the magick wand.
2957 % o channel: the image channel(s).
2961 WandExport MagickBooleanType MagickEqualizeImage(MagickWand *wand)
2966 status=MagickEqualizeImageChannel(wand,DefaultChannels);
2970 WandExport MagickBooleanType MagickEqualizeImageChannel(MagickWand *wand,
2971 const ChannelType channel)
2976 assert(wand != (MagickWand *) NULL);
2977 assert(wand->signature == WandSignature);
2978 if (wand->debug != MagickFalse)
2979 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2980 if (wand->images == (Image *) NULL)
2981 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2982 status=EqualizeImageChannel(wand->images,channel);
2983 if (status == MagickFalse)
2984 InheritException(wand->exception,&wand->images->exception);
2989 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2993 % M a g i c k E v a l u a t e I m a g e %
2997 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2999 % MagickEvaluateImage() applys an arithmetic, relational, or logical
3000 % expression to an image. Use these operators to lighten or darken an image,
3001 % to increase or decrease contrast in an image, or to produce the "negative"
3004 % The format of the MagickEvaluateImage method is:
3006 % MagickBooleanType MagickEvaluateImage(MagickWand *wand,
3007 % const MagickEvaluateOperator operator,const double value)
3008 % MagickBooleanType MagickEvaluateImages(MagickWand *wand,
3009 % const MagickEvaluateOperator operator)
3010 % MagickBooleanType MagickEvaluateImageChannel(MagickWand *wand,
3011 % const ChannelType channel,const MagickEvaluateOperator op,
3012 % const double value)
3014 % A description of each parameter follows:
3016 % o wand: the magick wand.
3018 % o channel: the channel(s).
3020 % o op: A channel operator.
3022 % o value: A value value.
3026 WandExport MagickBooleanType MagickEvaluateImage(MagickWand *wand,
3027 const MagickEvaluateOperator op,const double value)
3032 assert(wand != (MagickWand *) NULL);
3033 assert(wand->signature == WandSignature);
3034 if (wand->debug != MagickFalse)
3035 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3036 if (wand->images == (Image *) NULL)
3037 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3038 status=EvaluateImage(wand->images,op,value,&wand->images->exception);
3039 if (status == MagickFalse)
3040 InheritException(wand->exception,&wand->images->exception);
3044 WandExport MagickWand *MagickEvaluateImages(MagickWand *wand,
3045 const MagickEvaluateOperator op)
3050 assert(wand != (MagickWand *) NULL);
3051 assert(wand->signature == WandSignature);
3052 if (wand->debug != MagickFalse)
3053 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3054 if (wand->images == (Image *) NULL)
3055 return((MagickWand *) NULL);
3056 evaluate_image=EvaluateImages(wand->images,op,wand->exception);
3057 if (evaluate_image == (Image *) NULL)
3058 return((MagickWand *) NULL);
3059 return(CloneMagickWandFromImages(wand,evaluate_image));
3062 WandExport MagickBooleanType MagickEvaluateImageChannel(MagickWand *wand,
3063 const ChannelType channel,const MagickEvaluateOperator op,const double value)
3068 assert(wand != (MagickWand *) NULL);
3069 assert(wand->signature == WandSignature);
3070 if (wand->debug != MagickFalse)
3071 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3072 if (wand->images == (Image *) NULL)
3073 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3074 status=EvaluateImageChannel(wand->images,channel,op,value,
3075 &wand->images->exception);
3080 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3084 % M a g i c k E x p o r t I m a g e P i x e l s %
3088 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3090 % MagickExportImagePixels() extracts pixel data from an image and returns it
3091 % to you. The method returns MagickTrue on success otherwise MagickFalse if
3092 % an error is encountered. The data is returned as char, short int, int,
3093 % ssize_t, float, or double in the order specified by map.
3095 % Suppose you want to extract the first scanline of a 640x480 image as
3096 % character data in red-green-blue order:
3098 % MagickExportImagePixels(wand,0,0,640,1,"RGB",CharPixel,pixels);
3100 % The format of the MagickExportImagePixels method is:
3102 % MagickBooleanType MagickExportImagePixels(MagickWand *wand,
3103 % const ssize_t x,const ssize_t y,const size_t columns,
3104 % const size_t rows,const char *map,const StorageType storage,
3107 % A description of each parameter follows:
3109 % o wand: the magick wand.
3111 % o x, y, columns, rows: These values define the perimeter
3112 % of a region of pixels you want to extract.
3114 % o map: This string reflects the expected ordering of the pixel array.
3115 % It can be any combination or order of R = red, G = green, B = blue,
3116 % A = alpha (0 is transparent), O = opacity (0 is opaque), C = cyan,
3117 % Y = yellow, M = magenta, K = black, I = intensity (for grayscale),
3120 % o storage: Define the data type of the pixels. Float and double types are
3121 % expected to be normalized [0..1] otherwise [0..QuantumRange]. Choose from
3122 % these types: CharPixel, DoublePixel, FloatPixel, IntegerPixel,
3123 % LongPixel, QuantumPixel, or ShortPixel.
3125 % o pixels: This array of values contain the pixel components as defined by
3126 % map and type. You must preallocate this array where the expected
3127 % length varies depending on the values of width, height, map, and type.
3130 WandExport MagickBooleanType MagickExportImagePixels(MagickWand *wand,
3131 const ssize_t x,const ssize_t y,const size_t columns,
3132 const size_t rows,const char *map,const StorageType storage,
3138 assert(wand != (MagickWand *) NULL);
3139 assert(wand->signature == WandSignature);
3140 if (wand->debug != MagickFalse)
3141 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3142 if (wand->images == (Image *) NULL)
3143 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3144 status=ExportImagePixels(wand->images,x,y,columns,rows,map,
3145 storage,pixels,wand->exception);
3146 if (status == MagickFalse)
3147 InheritException(wand->exception,&wand->images->exception);
3152 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3156 % M a g i c k E x t e n t I m a g e %
3160 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3162 % MagickExtentImage() extends the image as defined by the geometry, gravity,
3163 % and wand background color. Set the (x,y) offset of the geometry to move
3164 % the original wand relative to the extended wand.
3166 % The format of the MagickExtentImage method is:
3168 % MagickBooleanType MagickExtentImage(MagickWand *wand,
3169 % const size_t width,const size_t height,const ssize_t x,
3172 % A description of each parameter follows:
3174 % o wand: the magick wand.
3176 % o width: the region width.
3178 % o height: the region height.
3180 % o x: the region x offset.
3182 % o y: the region y offset.
3185 WandExport MagickBooleanType MagickExtentImage(MagickWand *wand,
3186 const size_t width,const size_t height,const ssize_t x,
3195 assert(wand != (MagickWand *) NULL);
3196 assert(wand->signature == WandSignature);
3197 if (wand->debug != MagickFalse)
3198 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3199 if (wand->images == (Image *) NULL)
3200 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3202 extent.height=height;
3205 extent_image=ExtentImage(wand->images,&extent,wand->exception);
3206 if (extent_image == (Image *) NULL)
3207 return(MagickFalse);
3208 ReplaceImageInList(&wand->images,extent_image);
3213 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3217 % M a g i c k F i l t e r I m a g e %
3221 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3223 % MagickFilterImage() applies a custom convolution kernel to the image.
3225 % The format of the MagickFilterImage method is:
3227 % MagickBooleanType MagickFilterImage(MagickWand *wand,
3228 % const KernelInfo *kernel)
3229 % MagickBooleanType MagickFilterImageChannel(MagickWand *wand,
3230 % const ChannelType channel,const KernelInfo *kernel)
3232 % A description of each parameter follows:
3234 % o wand: the magick wand.
3236 % o channel: the image channel(s).
3238 % o kernel: An array of doubles representing the convolution kernel.
3242 WandExport MagickBooleanType MagickFilterImage(MagickWand *wand,
3243 const KernelInfo *kernel)
3248 status=MagickFilterImageChannel(wand,DefaultChannels,kernel);
3252 WandExport MagickBooleanType MagickFilterImageChannel(MagickWand *wand,
3253 const ChannelType channel,const KernelInfo *kernel)
3258 assert(wand != (MagickWand *) NULL);
3259 assert(wand->signature == WandSignature);
3260 if (wand->debug != MagickFalse)
3261 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3262 if (kernel == (const KernelInfo *) NULL)
3263 return(MagickFalse);
3264 if (wand->images == (Image *) NULL)
3265 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3266 filter_image=FilterImageChannel(wand->images,channel,kernel,wand->exception);
3267 if (filter_image == (Image *) NULL)
3268 return(MagickFalse);
3269 ReplaceImageInList(&wand->images,filter_image);
3274 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3278 % M a g i c k F l i p I m a g e %
3282 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3284 % MagickFlipImage() creates a vertical mirror image by reflecting the pixels
3285 % around the central x-axis.
3287 % The format of the MagickFlipImage method is:
3289 % MagickBooleanType MagickFlipImage(MagickWand *wand)
3291 % A description of each parameter follows:
3293 % o wand: the magick wand.
3296 WandExport MagickBooleanType MagickFlipImage(MagickWand *wand)
3301 assert(wand != (MagickWand *) NULL);
3302 assert(wand->signature == WandSignature);
3303 if (wand->debug != MagickFalse)
3304 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3305 if (wand->images == (Image *) NULL)
3306 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3307 flip_image=FlipImage(wand->images,wand->exception);
3308 if (flip_image == (Image *) NULL)
3309 return(MagickFalse);
3310 ReplaceImageInList(&wand->images,flip_image);
3315 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3319 % 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 %
3323 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3325 % MagickFloodfillPaintImage() changes the color value of any pixel that matches
3326 % target and is an immediate neighbor. If the method FillToBorderMethod is
3327 % specified, the color value is changed for any neighbor pixel that does not
3328 % match the bordercolor member of image.
3330 % The format of the MagickFloodfillPaintImage method is:
3332 % MagickBooleanType MagickFloodfillPaintImage(MagickWand *wand,
3333 % const ChannelType channel,const PixelWand *fill,const double fuzz,
3334 % const PixelWand *bordercolor,const ssize_t x,const ssize_t y,
3335 % const MagickBooleanType invert)
3337 % A description of each parameter follows:
3339 % o wand: the magick wand.
3341 % o channel: the channel(s).
3343 % o fill: the floodfill color pixel wand.
3345 % o fuzz: By default target must match a particular pixel color
3346 % exactly. However, in many cases two colors may differ by a small amount.
3347 % The fuzz member of image defines how much tolerance is acceptable to
3348 % consider two colors as the same. For example, set fuzz to 10 and the
3349 % color red at intensities of 100 and 102 respectively are now interpreted
3350 % as the same color for the purposes of the floodfill.
3352 % o bordercolor: the border color pixel wand.
3354 % o x,y: the starting location of the operation.
3356 % o invert: paint any pixel that does not match the target color.
3359 WandExport MagickBooleanType MagickFloodfillPaintImage(MagickWand *wand,
3360 const ChannelType channel,const PixelWand *fill,const double fuzz,
3361 const PixelWand *bordercolor,const ssize_t x,const ssize_t y,
3362 const MagickBooleanType invert)
3373 assert(wand != (MagickWand *) NULL);
3374 assert(wand->signature == WandSignature);
3375 if (wand->debug != MagickFalse)
3376 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3377 if (wand->images == (Image *) NULL)
3378 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3379 draw_info=CloneDrawInfo(wand->image_info,(DrawInfo *) NULL);
3380 PixelGetQuantumColor(fill,&draw_info->fill);
3381 (void) GetOneVirtualMagickPixel(wand->images,x % wand->images->columns,
3382 y % wand->images->rows,&target,wand->exception);
3383 if (bordercolor != (PixelWand *) NULL)
3384 PixelGetMagickColor(bordercolor,&target);
3385 wand->images->fuzz=fuzz;
3386 status=FloodfillPaintImage(wand->images,channel,draw_info,&target,x,y,
3388 if (status == MagickFalse)
3389 InheritException(wand->exception,&wand->images->exception);
3390 draw_info=DestroyDrawInfo(draw_info);
3395 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3399 % M a g i c k F l o p I m a g e %
3403 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3405 % MagickFlopImage() creates a horizontal mirror image by reflecting the pixels
3406 % around the central y-axis.
3408 % The format of the MagickFlopImage method is:
3410 % MagickBooleanType MagickFlopImage(MagickWand *wand)
3412 % A description of each parameter follows:
3414 % o wand: the magick wand.
3417 WandExport MagickBooleanType MagickFlopImage(MagickWand *wand)
3422 assert(wand != (MagickWand *) NULL);
3423 assert(wand->signature == WandSignature);
3424 if (wand->debug != MagickFalse)
3425 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3426 if (wand->images == (Image *) NULL)
3427 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3428 flop_image=FlopImage(wand->images,wand->exception);
3429 if (flop_image == (Image *) NULL)
3430 return(MagickFalse);
3431 ReplaceImageInList(&wand->images,flop_image);
3436 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3440 % 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 %
3444 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3446 % MagickForwardFourierTransformImage() implements the discrete Fourier
3447 % transform (DFT) of the image either as a magnitude / phase or real /
3448 % imaginary image pair.
3450 % The format of the MagickForwardFourierTransformImage method is:
3452 % MagickBooleanType MagickForwardFourierTransformImage(MagickWand *wand,
3453 % const MagickBooleanType magnitude)
3455 % A description of each parameter follows:
3457 % o wand: the magick wand.
3459 % o magnitude: if true, return as magnitude / phase pair otherwise a real /
3460 % imaginary image pair.
3463 WandExport MagickBooleanType MagickForwardFourierTransformImage(
3464 MagickWand *wand,const MagickBooleanType magnitude)
3469 assert(wand != (MagickWand *) NULL);
3470 assert(wand->signature == WandSignature);
3471 if (wand->debug != MagickFalse)
3472 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3473 if (wand->images == (Image *) NULL)
3474 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3475 forward_image=ForwardFourierTransformImage(wand->images,magnitude,
3477 if (forward_image == (Image *) NULL)
3478 return(MagickFalse);
3479 ReplaceImageInList(&wand->images,forward_image);
3484 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3488 % M a g i c k F r a m e I m a g e %
3492 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3494 % MagickFrameImage() adds a simulated three-dimensional border around the
3495 % image. The width and height specify the border width of the vertical and
3496 % horizontal sides of the frame. The inner and outer bevels indicate the
3497 % width of the inner and outer shadows of the frame.
3499 % The format of the MagickFrameImage method is:
3501 % MagickBooleanType MagickFrameImage(MagickWand *wand,
3502 % const PixelWand *matte_color,const size_t width,
3503 % const size_t height,const ssize_t inner_bevel,
3504 % const ssize_t outer_bevel)
3506 % A description of each parameter follows:
3508 % o wand: the magick wand.
3510 % o matte_color: the frame color pixel wand.
3512 % o width: the border width.
3514 % o height: the border height.
3516 % o inner_bevel: the inner bevel width.
3518 % o outer_bevel: the outer bevel width.
3521 WandExport MagickBooleanType MagickFrameImage(MagickWand *wand,
3522 const PixelWand *matte_color,const size_t width,
3523 const size_t height,const ssize_t inner_bevel,const ssize_t outer_bevel)
3531 assert(wand != (MagickWand *) NULL);
3532 assert(wand->signature == WandSignature);
3533 if (wand->debug != MagickFalse)
3534 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3535 if (wand->images == (Image *) NULL)
3536 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3537 (void) ResetMagickMemory(&frame_info,0,sizeof(frame_info));
3538 frame_info.width=wand->images->columns+2*width;
3539 frame_info.height=wand->images->rows+2*height;
3540 frame_info.x=(ssize_t) width;
3541 frame_info.y=(ssize_t) height;
3542 frame_info.inner_bevel=inner_bevel;
3543 frame_info.outer_bevel=outer_bevel;
3544 PixelGetQuantumColor(matte_color,&wand->images->matte_color);
3545 frame_image=FrameImage(wand->images,&frame_info,wand->exception);
3546 if (frame_image == (Image *) NULL)
3547 return(MagickFalse);
3548 ReplaceImageInList(&wand->images,frame_image);
3553 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3557 % M a g i c k F u n c t i o n I m a g e %
3561 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3563 % MagickFunctionImage() applys an arithmetic, relational, or logical
3564 % expression to an image. Use these operators to lighten or darken an image,
3565 % to increase or decrease contrast in an image, or to produce the "negative"
3568 % The format of the MagickFunctionImage method is:
3570 % MagickBooleanType MagickFunctionImage(MagickWand *wand,
3571 % const MagickFunction function,const size_t number_arguments,
3572 % const double *arguments)
3573 % MagickBooleanType MagickFunctionImageChannel(MagickWand *wand,
3574 % const ChannelType channel,const MagickFunction function,
3575 % const size_t number_arguments,const double *arguments)
3577 % A description of each parameter follows:
3579 % o wand: the magick wand.
3581 % o channel: the channel(s).
3583 % o function: the image function.
3585 % o number_arguments: the number of function arguments.
3587 % o arguments: the function arguments.
3591 WandExport MagickBooleanType MagickFunctionImage(MagickWand *wand,
3592 const MagickFunction function,const size_t number_arguments,
3593 const double *arguments)
3598 assert(wand != (MagickWand *) NULL);
3599 assert(wand->signature == WandSignature);
3600 if (wand->debug != MagickFalse)
3601 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3602 if (wand->images == (Image *) NULL)
3603 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3604 status=FunctionImage(wand->images,function,number_arguments,arguments,
3605 &wand->images->exception);
3606 if (status == MagickFalse)
3607 InheritException(wand->exception,&wand->images->exception);
3611 WandExport MagickBooleanType MagickFunctionImageChannel(MagickWand *wand,
3612 const ChannelType channel,const MagickFunction function,
3613 const size_t number_arguments,const double *arguments)
3618 assert(wand != (MagickWand *) NULL);
3619 assert(wand->signature == WandSignature);
3620 if (wand->debug != MagickFalse)
3621 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3622 if (wand->images == (Image *) NULL)
3623 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3624 status=FunctionImageChannel(wand->images,channel,function,number_arguments,
3625 arguments,&wand->images->exception);
3630 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3634 % M a g i c k F x I m a g e %
3638 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3640 % MagickFxImage() evaluate expression for each pixel in the image.
3642 % The format of the MagickFxImage method is:
3644 % MagickWand *MagickFxImage(MagickWand *wand,const char *expression)
3645 % MagickWand *MagickFxImageChannel(MagickWand *wand,
3646 % const ChannelType channel,const char *expression)
3648 % A description of each parameter follows:
3650 % o wand: the magick wand.
3652 % o channel: the image channel(s).
3654 % o expression: the expression.
3658 WandExport MagickWand *MagickFxImage(MagickWand *wand,const char *expression)
3663 fx_wand=MagickFxImageChannel(wand,DefaultChannels,expression);
3667 WandExport MagickWand *MagickFxImageChannel(MagickWand *wand,
3668 const ChannelType channel,const char *expression)
3673 assert(wand != (MagickWand *) NULL);
3674 assert(wand->signature == WandSignature);
3675 if (wand->debug != MagickFalse)
3676 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3677 if (wand->images == (Image *) NULL)
3678 return((MagickWand *) NULL);
3679 fx_image=FxImageChannel(wand->images,channel,expression,wand->exception);
3680 if (fx_image == (Image *) NULL)
3681 return((MagickWand *) NULL);
3682 return(CloneMagickWandFromImages(wand,fx_image));
3686 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3690 % M a g i c k G a m m a I m a g e %
3694 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3696 % MagickGammaImage() gamma-corrects an image. The same image viewed on
3697 % different devices will have perceptual differences in the way the image's
3698 % intensities are represented on the screen. Specify individual gamma levels
3699 % for the red, green, and blue channels, or adjust all three with the gamma
3700 % parameter. Values typically range from 0.8 to 2.3.
3702 % You can also reduce the influence of a particular channel with a gamma
3705 % The format of the MagickGammaImage method is:
3707 % MagickBooleanType MagickGammaImage(MagickWand *wand,const double gamma)
3708 % MagickBooleanType MagickGammaImageChannel(MagickWand *wand,
3709 % const ChannelType channel,const double gamma)
3711 % A description of each parameter follows:
3713 % o wand: the magick wand.
3715 % o channel: the channel.
3717 % o level: Define the level of gamma correction.
3721 WandExport MagickBooleanType MagickGammaImage(MagickWand *wand,
3727 status=MagickGammaImageChannel(wand,DefaultChannels,gamma);
3731 WandExport MagickBooleanType MagickGammaImageChannel(MagickWand *wand,
3732 const ChannelType channel,const double gamma)
3737 assert(wand != (MagickWand *) NULL);
3738 assert(wand->signature == WandSignature);
3739 if (wand->debug != MagickFalse)
3740 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3741 if (wand->images == (Image *) NULL)
3742 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3743 status=GammaImageChannel(wand->images,channel,gamma);
3744 if (status == MagickFalse)
3745 InheritException(wand->exception,&wand->images->exception);
3750 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3754 % M a g i c k G a u s s i a n B l u r I m a g e %
3758 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3760 % MagickGaussianBlurImage() blurs an image. We convolve the image with a
3761 % Gaussian operator of the given radius and standard deviation (sigma).
3762 % For reasonable results, the radius should be larger than sigma. Use a
3763 % radius of 0 and MagickGaussianBlurImage() selects a suitable radius for you.
3765 % The format of the MagickGaussianBlurImage method is:
3767 % MagickBooleanType MagickGaussianBlurImage(MagickWand *wand,
3768 % const double radius,const double sigma)
3769 % MagickBooleanType MagickGaussianBlurImageChannel(MagickWand *wand,
3770 % const ChannelType channel,const double radius,const double sigma)
3772 % A description of each parameter follows:
3774 % o wand: the magick wand.
3776 % o channel: the image channel(s).
3778 % o radius: the radius of the Gaussian, in pixels, not counting the center
3781 % o sigma: the standard deviation of the Gaussian, in pixels.
3785 WandExport MagickBooleanType MagickGaussianBlurImage(MagickWand *wand,
3786 const double radius,const double sigma)
3791 status=MagickGaussianBlurImageChannel(wand,DefaultChannels,radius,sigma);
3795 WandExport MagickBooleanType MagickGaussianBlurImageChannel(MagickWand *wand,
3796 const ChannelType channel,const double radius,const double sigma)
3801 assert(wand != (MagickWand *) NULL);
3802 assert(wand->signature == WandSignature);
3803 if (wand->debug != MagickFalse)
3804 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3805 if (wand->images == (Image *) NULL)
3806 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3807 blur_image=GaussianBlurImageChannel(wand->images,channel,radius,sigma,
3809 if (blur_image == (Image *) NULL)
3810 return(MagickFalse);
3811 ReplaceImageInList(&wand->images,blur_image);
3816 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3820 % M a g i c k G e t I m a g e %
3824 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3826 % MagickGetImage() gets the image at the current image index.
3828 % The format of the MagickGetImage method is:
3830 % MagickWand *MagickGetImage(MagickWand *wand)
3832 % A description of each parameter follows:
3834 % o wand: the magick wand.
3837 WandExport MagickWand *MagickGetImage(MagickWand *wand)
3842 assert(wand != (MagickWand *) NULL);
3843 assert(wand->signature == WandSignature);
3844 if (wand->debug != MagickFalse)
3845 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3846 if (wand->images == (Image *) NULL)
3848 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3849 "ContainsNoImages","`%s'",wand->name);
3850 return((MagickWand *) NULL);
3852 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
3853 if (image == (Image *) NULL)
3854 return((MagickWand *) NULL);
3855 return(CloneMagickWandFromImages(wand,image));
3859 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3863 % 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 %
3867 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3869 % MagickGetImageAlphaChannel() returns MagickFalse if the image alpha channel
3870 % is not activated. That is, the image is RGB rather than RGBA or CMYK rather
3873 % The format of the MagickGetImageAlphaChannel method is:
3875 % size_t MagickGetImageAlphaChannel(MagickWand *wand)
3877 % A description of each parameter follows:
3879 % o wand: the magick wand.
3882 WandExport MagickBooleanType MagickGetImageAlphaChannel(MagickWand *wand)
3884 assert(wand != (MagickWand *) NULL);
3885 assert(wand->signature == WandSignature);
3886 if (wand->debug != MagickFalse)
3887 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3888 if (wand->images == (Image *) NULL)
3889 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3890 return(GetImageAlphaChannel(wand->images));
3894 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3898 % M a g i c k G e t I m a g e C l i p M a s k %
3902 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3904 % MagickGetImageClipMask() gets the image clip mask at the current image index.
3906 % The format of the MagickGetImageClipMask method is:
3908 % MagickWand *MagickGetImageClipMask(MagickWand *wand)
3910 % A description of each parameter follows:
3912 % o wand: the magick wand.
3915 WandExport MagickWand *MagickGetImageClipMask(MagickWand *wand)
3920 assert(wand != (MagickWand *) NULL);
3921 assert(wand->signature == WandSignature);
3922 if (wand->debug != MagickFalse)
3923 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3924 if (wand->images == (Image *) NULL)
3926 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3927 "ContainsNoImages","`%s'",wand->name);
3928 return((MagickWand *) NULL);
3930 image=GetImageClipMask(wand->images,wand->exception);
3931 if (image == (Image *) NULL)
3932 return((MagickWand *) NULL);
3933 return(CloneMagickWandFromImages(wand,image));
3937 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3941 % 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 %
3945 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3947 % MagickGetImageBackgroundColor() returns the image background color.
3949 % The format of the MagickGetImageBackgroundColor method is:
3951 % MagickBooleanType MagickGetImageBackgroundColor(MagickWand *wand,
3952 % PixelWand *background_color)
3954 % A description of each parameter follows:
3956 % o wand: the magick wand.
3958 % o background_color: Return the background color.
3961 WandExport MagickBooleanType MagickGetImageBackgroundColor(MagickWand *wand,
3962 PixelWand *background_color)
3964 assert(wand != (MagickWand *) NULL);
3965 assert(wand->signature == WandSignature);
3966 if (wand->debug != MagickFalse)
3967 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3968 if (wand->images == (Image *) NULL)
3969 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3970 PixelSetQuantumColor(background_color,&wand->images->background_color);
3975 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3979 % M a g i c k G e t I m a g e B l o b %
3983 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3985 % MagickGetImageBlob() implements direct to memory image formats. It
3986 % returns the image as a blob and its length. Use MagickSetFormat() to
3987 % set the format of the returned blob (GIF, JPEG, PNG, etc.).
3989 % Use MagickRelinquishMemory() to free the blob when you are done with it.
3991 % The format of the MagickGetImageBlob method is:
3993 % unsigned char *MagickGetImageBlob(MagickWand *wand,size_t *length)
3995 % A description of each parameter follows:
3997 % o wand: the magick wand.
3999 % o length: the length of the blob.
4002 WandExport unsigned char *MagickGetImageBlob(MagickWand *wand,size_t *length)
4004 assert(wand != (MagickWand *) NULL);
4005 assert(wand->signature == WandSignature);
4006 if (wand->debug != MagickFalse)
4007 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4008 if (wand->images == (Image *) NULL)
4010 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4011 "ContainsNoImages","`%s'",wand->name);
4012 return((unsigned char *) NULL);
4014 return(ImageToBlob(wand->image_info,wand->images,length,wand->exception));
4018 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4022 % M a g i c k G e t I m a g e s B l o b %
4026 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4028 % MagickGetImageBlob() implements direct to memory image formats. It
4029 % returns the image sequence as a blob and its length. The format of the image
4030 % determines the format of the returned blob (GIF, JPEG, PNG, etc.). To
4031 % return a different image format, use MagickSetImageFormat().
4033 % Note, some image formats do not permit multiple images to the same image
4034 % stream (e.g. JPEG). in this instance, just the first image of the
4035 % sequence is returned as a blob.
4037 % The format of the MagickGetImagesBlob method is:
4039 % unsigned char *MagickGetImagesBlob(MagickWand *wand,size_t *length)
4041 % A description of each parameter follows:
4043 % o wand: the magick wand.
4045 % o length: the length of the blob.
4048 WandExport unsigned char *MagickGetImagesBlob(MagickWand *wand,size_t *length)
4053 assert(wand != (MagickWand *) NULL);
4054 assert(wand->signature == WandSignature);
4055 if (wand->debug != MagickFalse)
4056 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4057 if (wand->images == (Image *) NULL)
4059 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4060 "ContainsNoImages","`%s'",wand->name);
4061 return((unsigned char *) NULL);
4063 blob=ImagesToBlob(wand->image_info,GetFirstImageInList(wand->images),length,
4069 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4073 % 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 %
4077 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4079 % MagickGetImageBluePrimary() returns the chromaticy blue primary point for the
4082 % The format of the MagickGetImageBluePrimary method is:
4084 % MagickBooleanType MagickGetImageBluePrimary(MagickWand *wand,double *x,
4087 % A description of each parameter follows:
4089 % o wand: the magick wand.
4091 % o x: the chromaticity blue primary x-point.
4093 % o y: the chromaticity blue primary y-point.
4096 WandExport MagickBooleanType MagickGetImageBluePrimary(MagickWand *wand,
4097 double *x,double *y)
4099 assert(wand != (MagickWand *) NULL);
4100 assert(wand->signature == WandSignature);
4101 if (wand->debug != MagickFalse)
4102 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4103 if (wand->images == (Image *) NULL)
4104 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4105 *x=wand->images->chromaticity.blue_primary.x;
4106 *y=wand->images->chromaticity.blue_primary.y;
4111 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4115 % 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 %
4119 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4121 % MagickGetImageBorderColor() returns the image border color.
4123 % The format of the MagickGetImageBorderColor method is:
4125 % MagickBooleanType MagickGetImageBorderColor(MagickWand *wand,
4126 % PixelWand *border_color)
4128 % A description of each parameter follows:
4130 % o wand: the magick wand.
4132 % o border_color: Return the border color.
4135 WandExport MagickBooleanType MagickGetImageBorderColor(MagickWand *wand,
4136 PixelWand *border_color)
4138 assert(wand != (MagickWand *) NULL);
4139 assert(wand->signature == WandSignature);
4140 if (wand->debug != MagickFalse)
4141 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4142 if (wand->images == (Image *) NULL)
4143 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4144 PixelSetQuantumColor(border_color,&wand->images->border_color);
4149 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4153 % 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 %
4157 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4159 % MagickGetImageChannelDepth() gets the depth for one or more image channels.
4161 % The format of the MagickGetImageChannelDepth method is:
4163 % size_t MagickGetImageChannelDepth(MagickWand *wand,
4164 % const ChannelType channel)
4166 % A description of each parameter follows:
4168 % o wand: the magick wand.
4170 % o channel: the image channel(s).
4173 WandExport size_t MagickGetImageChannelDepth(MagickWand *wand,
4174 const ChannelType channel)
4176 assert(wand != (MagickWand *) NULL);
4177 assert(wand->signature == WandSignature);
4178 if (wand->debug != MagickFalse)
4179 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4180 if (wand->images == (Image *) NULL)
4181 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4182 return(GetImageChannelDepth(wand->images,channel,wand->exception));
4186 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4190 % 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 %
4194 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4196 % MagickGetImageChannelDistortion() compares one or more image channels of an
4197 % image to a reconstructed image and returns the specified distortion metric.
4199 % The format of the MagickGetImageChannelDistortion method is:
4201 % MagickBooleanType MagickGetImageChannelDistortion(MagickWand *wand,
4202 % const MagickWand *reference,const ChannelType channel,
4203 % const MetricType metric,double *distortion)
4205 % A description of each parameter follows:
4207 % o wand: the magick wand.
4209 % o reference: the reference wand.
4211 % o channel: the channel.
4213 % o metric: the metric.
4215 % o distortion: the computed distortion between the images.
4218 WandExport MagickBooleanType MagickGetImageChannelDistortion(MagickWand *wand,
4219 const MagickWand *reference,const ChannelType channel,const MetricType metric,
4225 assert(wand != (MagickWand *) NULL);
4226 assert(wand->signature == WandSignature);
4227 if (wand->debug != MagickFalse)
4228 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4229 assert(reference != (MagickWand *) NULL);
4230 assert(reference->signature == WandSignature);
4231 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
4232 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4233 status=GetImageChannelDistortion(wand->images,reference->images,channel,
4234 metric,distortion,&wand->images->exception);
4239 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4243 % 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 %
4247 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4249 % MagickGetImageChannelDistortions() compares one or more image channels of an
4250 % image to a reconstructed image and returns the specified distortion metrics.
4252 % Use MagickRelinquishMemory() to free the metrics when you are done with them.
4254 % The format of the MagickGetImageChannelDistortion method is:
4256 % double *MagickGetImageChannelDistortion(MagickWand *wand,
4257 % const MagickWand *reference,const MetricType metric)
4259 % A description of each parameter follows:
4261 % o wand: the magick wand.
4263 % o reference: the reference wand.
4265 % o metric: the metric.
4268 WandExport double *MagickGetImageChannelDistortions(MagickWand *wand,
4269 const MagickWand *reference,const MetricType metric)
4272 *channel_distortion;
4274 assert(wand != (MagickWand *) NULL);
4275 assert(wand->signature == WandSignature);
4276 if (wand->debug != MagickFalse)
4277 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4278 assert(reference != (MagickWand *) NULL);
4279 assert(reference->signature == WandSignature);
4280 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
4282 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4283 "ContainsNoImages","`%s'",wand->name);
4284 return((double *) NULL);
4286 channel_distortion=GetImageChannelDistortions(wand->images,reference->images,
4287 metric,&wand->images->exception);
4288 return(channel_distortion);
4292 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4296 % 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 %
4300 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4302 % MagickGetImageChannelFeatures() returns features for each channel in the
4303 % image in each of four directions (horizontal, vertical, left and right
4304 % diagonals) for the specified distance. The features include the angular
4305 % second moment, contrast, correlation, sum of squares: variance, inverse
4306 % difference moment, sum average, sum varience, sum entropy, entropy,
4307 % difference variance, difference entropy, information measures of
4308 % correlation 1, information measures of correlation 2, and maximum
4309 % correlation coefficient. You can access the red channel contrast, for
4310 % example, like this:
4312 % channel_features=MagickGetImageChannelFeatures(wand,1);
4313 % contrast=channel_features[RedChannel].contrast[0];
4315 % Use MagickRelinquishMemory() to free the statistics buffer.
4317 % The format of the MagickGetImageChannelFeatures method is:
4319 % ChannelFeatures *MagickGetImageChannelFeatures(MagickWand *wand,
4320 % const size_t distance)
4322 % A description of each parameter follows:
4324 % o wand: the magick wand.
4326 % o distance: the distance.
4329 WandExport ChannelFeatures *MagickGetImageChannelFeatures(MagickWand *wand,
4330 const size_t distance)
4332 assert(wand != (MagickWand *) NULL);
4333 assert(wand->signature == WandSignature);
4334 if (wand->debug != MagickFalse)
4335 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4336 if (wand->images == (Image *) NULL)
4338 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4339 "ContainsNoImages","`%s'",wand->name);
4340 return((ChannelFeatures *) NULL);
4342 return(GetImageChannelFeatures(wand->images,distance,wand->exception));
4346 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4350 % 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 %
4354 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4356 % MagickGetImageChannelKurtosis() gets the kurtosis and skewness of one or
4357 % more image channels.
4359 % The format of the MagickGetImageChannelKurtosis method is:
4361 % MagickBooleanType MagickGetImageChannelKurtosis(MagickWand *wand,
4362 % const ChannelType channel,double *kurtosis,double *skewness)
4364 % A description of each parameter follows:
4366 % o wand: the magick wand.
4368 % o channel: the image channel(s).
4370 % o kurtosis: The kurtosis for the specified channel(s).
4372 % o skewness: The skewness for the specified channel(s).
4375 WandExport MagickBooleanType MagickGetImageChannelKurtosis(MagickWand *wand,
4376 const ChannelType channel,double *kurtosis,double *skewness)
4381 assert(wand != (MagickWand *) NULL);
4382 assert(wand->signature == WandSignature);
4383 if (wand->debug != MagickFalse)
4384 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4385 if (wand->images == (Image *) NULL)
4386 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4387 status=GetImageChannelKurtosis(wand->images,channel,kurtosis,skewness,
4393 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4397 % 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 %
4401 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4403 % MagickGetImageChannelMean() gets the mean and standard deviation of one or
4404 % more image channels.
4406 % The format of the MagickGetImageChannelMean method is:
4408 % MagickBooleanType MagickGetImageChannelMean(MagickWand *wand,
4409 % const ChannelType channel,double *mean,double *standard_deviation)
4411 % A description of each parameter follows:
4413 % o wand: the magick wand.
4415 % o channel: the image channel(s).
4417 % o mean: The mean pixel value for the specified channel(s).
4419 % o standard_deviation: The standard deviation for the specified channel(s).
4422 WandExport MagickBooleanType MagickGetImageChannelMean(MagickWand *wand,
4423 const ChannelType channel,double *mean,double *standard_deviation)
4428 assert(wand != (MagickWand *) NULL);
4429 assert(wand->signature == WandSignature);
4430 if (wand->debug != MagickFalse)
4431 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4432 if (wand->images == (Image *) NULL)
4433 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4434 status=GetImageChannelMean(wand->images,channel,mean,standard_deviation,
4440 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4444 % 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 %
4448 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4450 % MagickGetImageChannelRange() gets the range for one or more image channels.
4452 % The format of the MagickGetImageChannelRange method is:
4454 % MagickBooleanType MagickGetImageChannelRange(MagickWand *wand,
4455 % const ChannelType channel,double *minima,double *maxima)
4457 % A description of each parameter follows:
4459 % o wand: the magick wand.
4461 % o channel: the image channel(s).
4463 % o minima: The minimum pixel value for the specified channel(s).
4465 % o maxima: The maximum pixel value for the specified channel(s).
4468 WandExport MagickBooleanType MagickGetImageChannelRange(MagickWand *wand,
4469 const ChannelType channel,double *minima,double *maxima)
4474 assert(wand != (MagickWand *) NULL);
4475 assert(wand->signature == WandSignature);
4476 if (wand->debug != MagickFalse)
4477 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4478 if (wand->images == (Image *) NULL)
4479 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4480 status=GetImageChannelRange(wand->images,channel,minima,maxima,
4486 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4490 % 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 %
4494 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4496 % MagickGetImageChannelStatistics() returns statistics for each channel in the
4497 % image. The statistics include the channel depth, its minima and
4498 % maxima, the mean, the standard deviation, the kurtosis and the skewness.
4499 % You can access the red channel mean, for example, like this:
4501 % channel_statistics=MagickGetImageChannelStatistics(wand);
4502 % red_mean=channel_statistics[RedChannel].mean;
4504 % Use MagickRelinquishMemory() to free the statistics buffer.
4506 % The format of the MagickGetImageChannelStatistics method is:
4508 % ChannelStatistics *MagickGetImageChannelStatistics(MagickWand *wand)
4510 % A description of each parameter follows:
4512 % o wand: the magick wand.
4515 WandExport ChannelStatistics *MagickGetImageChannelStatistics(MagickWand *wand)
4517 assert(wand != (MagickWand *) NULL);
4518 assert(wand->signature == WandSignature);
4519 if (wand->debug != MagickFalse)
4520 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4521 if (wand->images == (Image *) NULL)
4523 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4524 "ContainsNoImages","`%s'",wand->name);
4525 return((ChannelStatistics *) NULL);
4527 return(GetImageChannelStatistics(wand->images,wand->exception));
4531 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4535 % 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 %
4539 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4541 % MagickGetImageColormapColor() returns the color of the specified colormap
4544 % The format of the MagickGetImageColormapColor method is:
4546 % MagickBooleanType MagickGetImageColormapColor(MagickWand *wand,
4547 % const size_t index,PixelWand *color)
4549 % A description of each parameter follows:
4551 % o wand: the magick wand.
4553 % o index: the offset into the image colormap.
4555 % o color: Return the colormap color in this wand.
4558 WandExport MagickBooleanType MagickGetImageColormapColor(MagickWand *wand,
4559 const size_t index,PixelWand *color)
4561 assert(wand != (MagickWand *) NULL);
4562 assert(wand->signature == WandSignature);
4563 if (wand->debug != MagickFalse)
4564 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4565 if (wand->images == (Image *) NULL)
4566 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4567 if ((wand->images->colormap == (PixelPacket *) NULL) ||
4568 (index >= wand->images->colors))
4570 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4571 "InvalidColormapIndex","`%s'",wand->name);
4572 return(MagickFalse);
4574 PixelSetQuantumColor(color,wand->images->colormap+index);
4579 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4583 % M a g i c k G e t I m a g e C o l o r s %
4587 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4589 % MagickGetImageColors() gets the number of unique colors in the image.
4591 % The format of the MagickGetImageColors method is:
4593 % size_t MagickGetImageColors(MagickWand *wand)
4595 % A description of each parameter follows:
4597 % o wand: the magick wand.
4600 WandExport size_t MagickGetImageColors(MagickWand *wand)
4602 assert(wand != (MagickWand *) NULL);
4603 assert(wand->signature == WandSignature);
4604 if (wand->debug != MagickFalse)
4605 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4606 if (wand->images == (Image *) NULL)
4608 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4609 "ContainsNoImages","`%s'",wand->name);
4612 return(GetNumberColors(wand->images,(FILE *) NULL,wand->exception));
4616 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4620 % M a g i c k G e t I m a g e C o l o r s p a c e %
4624 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4626 % MagickGetImageColorspace() gets the image colorspace.
4628 % The format of the MagickGetImageColorspace method is:
4630 % ColorspaceType MagickGetImageColorspace(MagickWand *wand)
4632 % A description of each parameter follows:
4634 % o wand: the magick wand.
4637 WandExport ColorspaceType MagickGetImageColorspace(MagickWand *wand)
4639 assert(wand != (MagickWand *) NULL);
4640 assert(wand->signature == WandSignature);
4641 if (wand->debug != MagickFalse)
4642 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4643 if (wand->images == (Image *) NULL)
4645 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4646 "ContainsNoImages","`%s'",wand->name);
4647 return(UndefinedColorspace);
4649 return(wand->images->colorspace);
4653 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4657 % M a g i c k G e t I m a g e C o m p o s e %
4661 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4663 % MagickGetImageCompose() returns the composite operator associated with the
4666 % The format of the MagickGetImageCompose method is:
4668 % CompositeOperator MagickGetImageCompose(MagickWand *wand)
4670 % A description of each parameter follows:
4672 % o wand: the magick wand.
4675 WandExport CompositeOperator MagickGetImageCompose(MagickWand *wand)
4677 assert(wand != (MagickWand *) NULL);
4678 assert(wand->signature == WandSignature);
4679 if (wand->debug != MagickFalse)
4680 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4681 if (wand->images == (Image *) NULL)
4683 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4684 "ContainsNoImages","`%s'",wand->name);
4685 return(UndefinedCompositeOp);
4687 return(wand->images->compose);
4691 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4695 % 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 %
4699 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4701 % MagickGetImageCompression() gets the image compression.
4703 % The format of the MagickGetImageCompression method is:
4705 % CompressionType MagickGetImageCompression(MagickWand *wand)
4707 % A description of each parameter follows:
4709 % o wand: the magick wand.
4712 WandExport CompressionType MagickGetImageCompression(MagickWand *wand)
4714 assert(wand != (MagickWand *) NULL);
4715 assert(wand->signature == WandSignature);
4716 if (wand->debug != MagickFalse)
4717 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4718 if (wand->images == (Image *) NULL)
4720 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4721 "ContainsNoImages","`%s'",wand->name);
4722 return(UndefinedCompression);
4724 return(wand->images->compression);
4728 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4732 % 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 %
4736 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4738 % MagickGetImageCompression() gets the image compression quality.
4740 % The format of the MagickGetImageCompression method is:
4742 % size_t MagickGetImageCompression(MagickWand *wand)
4744 % A description of each parameter follows:
4746 % o wand: the magick wand.
4749 WandExport size_t MagickGetImageCompressionQuality(MagickWand *wand)
4751 assert(wand != (MagickWand *) NULL);
4752 assert(wand->signature == WandSignature);
4753 if (wand->debug != MagickFalse)
4754 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4755 if (wand->images == (Image *) NULL)
4757 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4758 "ContainsNoImages","`%s'",wand->name);
4761 return(wand->images->quality);
4765 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4769 % M a g i c k G e t I m a g e D e l a y %
4773 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4775 % MagickGetImageDelay() gets the image delay.
4777 % The format of the MagickGetImageDelay method is:
4779 % size_t MagickGetImageDelay(MagickWand *wand)
4781 % A description of each parameter follows:
4783 % o wand: the magick wand.
4786 WandExport size_t MagickGetImageDelay(MagickWand *wand)
4788 assert(wand != (MagickWand *) NULL);
4789 assert(wand->signature == WandSignature);
4790 if (wand->debug != MagickFalse)
4791 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4792 if (wand->images == (Image *) NULL)
4793 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4794 return(wand->images->delay);
4798 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4802 % M a g i c k G e t I m a g e D e p t h %
4806 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4808 % MagickGetImageDepth() gets the image depth.
4810 % The format of the MagickGetImageDepth method is:
4812 % size_t MagickGetImageDepth(MagickWand *wand)
4814 % A description of each parameter follows:
4816 % o wand: the magick wand.
4819 WandExport size_t MagickGetImageDepth(MagickWand *wand)
4821 assert(wand != (MagickWand *) NULL);
4822 assert(wand->signature == WandSignature);
4823 if (wand->debug != MagickFalse)
4824 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4825 if (wand->images == (Image *) NULL)
4826 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4827 return(wand->images->depth);
4831 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4835 % M a g i c k G e t I m a g e D i s t o r t i o n %
4839 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4841 % MagickGetImageDistortion() compares an image to a reconstructed image and
4842 % returns the specified distortion metric.
4844 % The format of the MagickGetImageDistortion method is:
4846 % MagickBooleanType MagickGetImageDistortion(MagickWand *wand,
4847 % const MagickWand *reference,const MetricType metric,
4848 % double *distortion)
4850 % A description of each parameter follows:
4852 % o wand: the magick wand.
4854 % o reference: the reference wand.
4856 % o metric: the metric.
4858 % o distortion: the computed distortion between the images.
4861 WandExport MagickBooleanType MagickGetImageDistortion(MagickWand *wand,
4862 const MagickWand *reference,const MetricType metric,double *distortion)
4868 assert(wand != (MagickWand *) NULL);
4869 assert(wand->signature == WandSignature);
4870 if (wand->debug != MagickFalse)
4871 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4872 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
4873 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4874 status=GetImageDistortion(wand->images,reference->images,metric,distortion,
4875 &wand->images->exception);
4880 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4884 % M a g i c k G e t I m a g e D i s p o s e %
4888 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4890 % MagickGetImageDispose() gets the image disposal method.
4892 % The format of the MagickGetImageDispose method is:
4894 % DisposeType MagickGetImageDispose(MagickWand *wand)
4896 % A description of each parameter follows:
4898 % o wand: the magick wand.
4901 WandExport DisposeType MagickGetImageDispose(MagickWand *wand)
4903 assert(wand != (MagickWand *) NULL);
4904 assert(wand->signature == WandSignature);
4905 if (wand->debug != MagickFalse)
4906 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4907 if (wand->images == (Image *) NULL)
4909 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4910 "ContainsNoImages","`%s'",wand->name);
4911 return(UndefinedDispose);
4913 return((DisposeType) wand->images->dispose);
4917 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4921 % M a g i c k G e t I m a g e F i l e n a m e %
4925 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4927 % MagickGetImageFilename() returns the filename of a particular image in a
4930 % The format of the MagickGetImageFilename method is:
4932 % char *MagickGetImageFilename(MagickWand *wand)
4934 % A description of each parameter follows:
4936 % o wand: the magick wand.
4939 WandExport char *MagickGetImageFilename(MagickWand *wand)
4941 assert(wand != (MagickWand *) NULL);
4942 assert(wand->signature == WandSignature);
4943 if (wand->debug != MagickFalse)
4944 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4945 if (wand->images == (Image *) NULL)
4947 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4948 "ContainsNoImages","`%s'",wand->name);
4949 return((char *) NULL);
4951 return(AcquireString(wand->images->filename));
4955 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4959 % M a g i c k G e t I m a g e F o r m a t %
4963 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4965 % MagickGetImageFormat() returns the format of a particular image in a
4968 % The format of the MagickGetImageFormat method is:
4970 % const char MagickGetImageFormat(MagickWand *wand)
4972 % A description of each parameter follows:
4974 % o wand: the magick wand.
4977 WandExport char *MagickGetImageFormat(MagickWand *wand)
4979 assert(wand != (MagickWand *) NULL);
4980 assert(wand->signature == WandSignature);
4981 if (wand->debug != MagickFalse)
4982 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4983 if (wand->images == (Image *) NULL)
4985 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4986 "ContainsNoImages","`%s'",wand->name);
4987 return((char *) NULL);
4989 return(AcquireString(wand->images->magick));
4993 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4997 % M a g i c k G e t I m a g e F u z z %
5001 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5003 % MagickGetImageFuzz() gets the image fuzz.
5005 % The format of the MagickGetImageFuzz method is:
5007 % double MagickGetImageFuzz(MagickWand *wand)
5009 % A description of each parameter follows:
5011 % o wand: the magick wand.
5014 WandExport double MagickGetImageFuzz(MagickWand *wand)
5016 assert(wand != (MagickWand *) NULL);
5017 assert(wand->signature == WandSignature);
5018 if (wand->debug != MagickFalse)
5019 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5020 if (wand->images == (Image *) NULL)
5022 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5023 "ContainsNoImages","`%s'",wand->name);
5026 return(wand->images->fuzz);
5030 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5034 % M a g i c k G e t I m a g e G a m m a %
5038 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5040 % MagickGetImageGamma() gets the image gamma.
5042 % The format of the MagickGetImageGamma method is:
5044 % double MagickGetImageGamma(MagickWand *wand)
5046 % A description of each parameter follows:
5048 % o wand: the magick wand.
5051 WandExport double MagickGetImageGamma(MagickWand *wand)
5053 assert(wand != (MagickWand *) NULL);
5054 assert(wand->signature == WandSignature);
5055 if (wand->debug != MagickFalse)
5056 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5057 if (wand->images == (Image *) NULL)
5059 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5060 "ContainsNoImages","`%s'",wand->name);
5063 return(wand->images->gamma);
5067 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5071 % 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 %
5075 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5077 % MagickGetImageGravity() gets the image gravity.
5079 % The format of the MagickGetImageGravity method is:
5081 % GravityType MagickGetImageGravity(MagickWand *wand)
5083 % A description of each parameter follows:
5085 % o wand: the magick wand.
5088 WandExport GravityType MagickGetImageGravity(MagickWand *wand)
5090 assert(wand != (MagickWand *) NULL);
5091 assert(wand->signature == WandSignature);
5092 if (wand->debug != MagickFalse)
5093 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5094 if (wand->images == (Image *) NULL)
5096 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5097 "ContainsNoImages","`%s'",wand->name);
5098 return(UndefinedGravity);
5100 return(wand->images->gravity);
5104 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5108 % 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 %
5112 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5114 % MagickGetImageGreenPrimary() returns the chromaticy green primary point.
5116 % The format of the MagickGetImageGreenPrimary method is:
5118 % MagickBooleanType MagickGetImageGreenPrimary(MagickWand *wand,double *x,
5121 % A description of each parameter follows:
5123 % o wand: the magick wand.
5125 % o x: the chromaticity green primary x-point.
5127 % o y: the chromaticity green primary y-point.
5130 WandExport MagickBooleanType MagickGetImageGreenPrimary(MagickWand *wand,
5131 double *x,double *y)
5133 assert(wand != (MagickWand *) NULL);
5134 assert(wand->signature == WandSignature);
5135 if (wand->debug != MagickFalse)
5136 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5137 if (wand->images == (Image *) NULL)
5138 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5139 *x=wand->images->chromaticity.green_primary.x;
5140 *y=wand->images->chromaticity.green_primary.y;
5145 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5149 % M a g i c k G e t I m a g e H e i g h t %
5153 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5155 % MagickGetImageHeight() returns the image height.
5157 % The format of the MagickGetImageHeight method is:
5159 % size_t MagickGetImageHeight(MagickWand *wand)
5161 % A description of each parameter follows:
5163 % o wand: the magick wand.
5166 WandExport size_t MagickGetImageHeight(MagickWand *wand)
5168 assert(wand != (MagickWand *) NULL);
5169 assert(wand->signature == WandSignature);
5170 if (wand->debug != MagickFalse)
5171 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5172 if (wand->images == (Image *) NULL)
5173 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5174 return(wand->images->rows);
5178 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5182 % M a g i c k G e t I m a g e H i s t o g r a m %
5186 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5188 % MagickGetImageHistogram() returns the image histogram as an array of
5191 % The format of the MagickGetImageHistogram method is:
5193 % PixelWand **MagickGetImageHistogram(MagickWand *wand,
5194 % size_t *number_colors)
5196 % A description of each parameter follows:
5198 % o wand: the magick wand.
5200 % o number_colors: the number of unique colors in the image and the number
5201 % of pixel wands returned.
5204 WandExport PixelWand **MagickGetImageHistogram(MagickWand *wand,
5205 size_t *number_colors)
5216 assert(wand != (MagickWand *) NULL);
5217 assert(wand->signature == WandSignature);
5218 if (wand->debug != MagickFalse)
5219 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5220 if (wand->images == (Image *) NULL)
5222 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5223 "ContainsNoImages","`%s'",wand->name);
5224 return((PixelWand **) NULL);
5226 histogram=GetImageHistogram(wand->images,number_colors,wand->exception);
5227 if (histogram == (ColorPacket *) NULL)
5228 return((PixelWand **) NULL);
5229 pixel_wands=NewPixelWands(*number_colors);
5230 for (i=0; i < (ssize_t) *number_colors; i++)
5232 PixelSetQuantumColor(pixel_wands[i],&histogram[i].pixel);
5233 PixelSetIndex(pixel_wands[i],histogram[i].index);
5234 PixelSetColorCount(pixel_wands[i],(size_t) histogram[i].count);
5236 histogram=(ColorPacket *) RelinquishMagickMemory(histogram);
5237 return(pixel_wands);
5241 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5245 % 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 %
5249 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5251 % MagickGetImageInterlaceScheme() gets the image interlace scheme.
5253 % The format of the MagickGetImageInterlaceScheme method is:
5255 % InterlaceType MagickGetImageInterlaceScheme(MagickWand *wand)
5257 % A description of each parameter follows:
5259 % o wand: the magick wand.
5262 WandExport InterlaceType MagickGetImageInterlaceScheme(MagickWand *wand)
5264 assert(wand != (MagickWand *) NULL);
5265 assert(wand->signature == WandSignature);
5266 if (wand->debug != MagickFalse)
5267 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5268 if (wand->images == (Image *) NULL)
5270 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5271 "ContainsNoImages","`%s'",wand->name);
5272 return(UndefinedInterlace);
5274 return(wand->images->interlace);
5278 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5282 % 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 %
5286 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5288 % MagickGetImageInterpolateMethod() returns the interpolation method for the
5291 % The format of the MagickGetImageInterpolateMethod method is:
5293 % InterpolatePixelMethod MagickGetImageInterpolateMethod(MagickWand *wand)
5295 % A description of each parameter follows:
5297 % o wand: the magick wand.
5300 WandExport InterpolatePixelMethod MagickGetImageInterpolateMethod(
5303 assert(wand != (MagickWand *) NULL);
5304 assert(wand->signature == WandSignature);
5305 if (wand->debug != MagickFalse)
5306 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5307 if (wand->images == (Image *) NULL)
5309 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5310 "ContainsNoImages","`%s'",wand->name);
5311 return(UndefinedInterpolatePixel);
5313 return(wand->images->interpolate);
5317 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5321 % M a g i c k G e t I m a g e I t e r a t i o n s %
5325 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5327 % MagickGetImageIterations() gets the image iterations.
5329 % The format of the MagickGetImageIterations method is:
5331 % size_t MagickGetImageIterations(MagickWand *wand)
5333 % A description of each parameter follows:
5335 % o wand: the magick wand.
5338 WandExport size_t MagickGetImageIterations(MagickWand *wand)
5340 assert(wand != (MagickWand *) NULL);
5341 assert(wand->signature == WandSignature);
5342 if (wand->debug != MagickFalse)
5343 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5344 if (wand->images == (Image *) NULL)
5345 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5346 return(wand->images->iterations);
5350 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5354 % M a g i c k G e t I m a g e L e n g t h %
5358 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5360 % MagickGetImageLength() returns the image length in bytes.
5362 % The format of the MagickGetImageLength method is:
5364 % MagickBooleanType MagickGetImageLength(MagickWand *wand,
5365 % MagickSizeType *length)
5367 % A description of each parameter follows:
5369 % o wand: the magick wand.
5371 % o length: the image length in bytes.
5374 WandExport MagickBooleanType MagickGetImageLength(MagickWand *wand,
5375 MagickSizeType *length)
5377 assert(wand != (MagickWand *) NULL);
5378 assert(wand->signature == WandSignature);
5379 if (wand->debug != MagickFalse)
5380 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5381 if (wand->images == (Image *) NULL)
5382 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5383 *length=GetBlobSize(wand->images);
5388 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5392 % M a g i c k G e t I m a g e M a t t e C o l o r %
5396 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5398 % MagickGetImageMatteColor() returns the image matte color.
5400 % The format of the MagickGetImageMatteColor method is:
5402 % MagickBooleanType MagickGetImagematteColor(MagickWand *wand,
5403 % PixelWand *matte_color)
5405 % A description of each parameter follows:
5407 % o wand: the magick wand.
5409 % o matte_color: Return the matte color.
5412 WandExport MagickBooleanType MagickGetImageMatteColor(MagickWand *wand,
5413 PixelWand *matte_color)
5415 assert(wand != (MagickWand *) NULL);
5416 assert(wand->signature == WandSignature);
5417 if (wand->debug != MagickFalse)
5418 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5419 if (wand->images == (Image *) NULL)
5420 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5421 PixelSetQuantumColor(matte_color,&wand->images->matte_color);
5426 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5430 % 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 %
5434 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5436 % MagickGetImageOrientation() returns the image orientation.
5438 % The format of the MagickGetImageOrientation method is:
5440 % OrientationType MagickGetImageOrientation(MagickWand *wand)
5442 % A description of each parameter follows:
5444 % o wand: the magick wand.
5447 WandExport OrientationType MagickGetImageOrientation(MagickWand *wand)
5449 assert(wand != (MagickWand *) NULL);
5450 assert(wand->signature == WandSignature);
5451 if (wand->debug != MagickFalse)
5452 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5453 if (wand->images == (Image *) NULL)
5455 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5456 "ContainsNoImages","`%s'",wand->name);
5457 return(UndefinedOrientation);
5459 return(wand->images->orientation);
5463 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5467 % M a g i c k G e t I m a g e P a g e %
5471 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5473 % MagickGetImagePage() returns the page geometry associated with the image.
5475 % The format of the MagickGetImagePage method is:
5477 % MagickBooleanType MagickGetImagePage(MagickWand *wand,
5478 % size_t *width,size_t *height,ssize_t *x,ssize_t *y)
5480 % A description of each parameter follows:
5482 % o wand: the magick wand.
5484 % o width: the page width.
5486 % o height: the page height.
5488 % o x: the page x-offset.
5490 % o y: the page y-offset.
5493 WandExport MagickBooleanType MagickGetImagePage(MagickWand *wand,
5494 size_t *width,size_t *height,ssize_t *x,ssize_t *y)
5496 assert(wand != (const MagickWand *) NULL);
5497 assert(wand->signature == WandSignature);
5498 if (wand->debug != MagickFalse)
5499 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5500 if (wand->images == (Image *) NULL)
5501 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5502 *width=wand->images->page.width;
5503 *height=wand->images->page.height;
5504 *x=wand->images->page.x;
5505 *y=wand->images->page.y;
5510 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5514 % M a g i c k G e t I m a g e P i x e l C o l o r %
5518 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5520 % MagickGetImagePixelColor() returns the color of the specified pixel.
5522 % The format of the MagickGetImagePixelColor method is:
5524 % MagickBooleanType MagickGetImagePixelColor(MagickWand *wand,
5525 % const ssize_t x,const ssize_t y,PixelWand *color)
5527 % A description of each parameter follows:
5529 % o wand: the magick wand.
5531 % o x,y: the pixel offset into the image.
5533 % o color: Return the colormap color in this wand.
5536 WandExport MagickBooleanType MagickGetImagePixelColor(MagickWand *wand,
5537 const ssize_t x,const ssize_t y,PixelWand *color)
5542 register const PixelPacket
5548 assert(wand != (MagickWand *) NULL);
5549 assert(wand->signature == WandSignature);
5550 if (wand->debug != MagickFalse)
5551 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5552 if (wand->images == (Image *) NULL)
5553 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5554 image_view=AcquireCacheView(wand->images);
5555 p=GetCacheViewVirtualPixels(image_view,x,y,1,1,wand->exception);
5556 if (p == (const PixelPacket *) NULL)
5558 image_view=DestroyCacheView(image_view);
5559 return(MagickFalse);
5561 indexes=GetCacheViewAuthenticIndexQueue(image_view);
5562 PixelSetQuantumColor(color,p);
5563 if (GetCacheViewColorspace(image_view) == CMYKColorspace)
5564 PixelSetBlackQuantum(color,*indexes);
5566 if (GetCacheViewStorageClass(image_view) == PseudoClass)
5567 PixelSetIndex(color,*indexes);
5568 image_view=DestroyCacheView(image_view);
5573 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5577 + M a g i c k G e t I m a g e R a n g e %
5581 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5583 % MagickGetImageRange() gets the pixel range for the image.
5585 % The format of the MagickGetImageRange method is:
5587 % MagickBooleanType MagickGetImageRange(MagickWand *wand,double *minima,
5590 % A description of each parameter follows:
5592 % o wand: the magick wand.
5594 % o minima: The minimum pixel value for the specified channel(s).
5596 % o maxima: The maximum pixel value for the specified channel(s).
5599 WandExport MagickBooleanType MagickGetImageRange(MagickWand *wand,
5600 double *minima,double *maxima)
5605 assert(wand != (MagickWand *) NULL);
5606 assert(wand->signature == WandSignature);
5607 if (wand->debug != MagickFalse)
5608 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5609 if (wand->images == (Image *) NULL)
5610 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5611 status=GetImageRange(wand->images,minima,maxima,wand->exception);
5616 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5620 % M a g i c k G e t I m a g e R e d P r i m a r y %
5624 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5626 % MagickGetImageRedPrimary() returns the chromaticy red primary point.
5628 % The format of the MagickGetImageRedPrimary method is:
5630 % MagickBooleanType MagickGetImageRedPrimary(MagickWand *wand,double *x,
5633 % A description of each parameter follows:
5635 % o wand: the magick wand.
5637 % o x: the chromaticity red primary x-point.
5639 % o y: the chromaticity red primary y-point.
5642 WandExport MagickBooleanType MagickGetImageRedPrimary(MagickWand *wand,
5643 double *x,double *y)
5645 assert(wand != (MagickWand *) NULL);
5646 assert(wand->signature == WandSignature);
5647 if (wand->debug != MagickFalse)
5648 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5649 if (wand->images == (Image *) NULL)
5650 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5651 *x=wand->images->chromaticity.red_primary.x;
5652 *y=wand->images->chromaticity.red_primary.y;
5657 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5661 % M a g i c k G e t I m a g e R e g i o n %
5665 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5667 % MagickGetImageRegion() extracts a region of the image and returns it as a
5670 % The format of the MagickGetImageRegion method is:
5672 % MagickWand *MagickGetImageRegion(MagickWand *wand,
5673 % const size_t width,const size_t height,const ssize_t x,
5676 % A description of each parameter follows:
5678 % o wand: the magick wand.
5680 % o width: the region width.
5682 % o height: the region height.
5684 % o x: the region x offset.
5686 % o y: the region y offset.
5689 WandExport MagickWand *MagickGetImageRegion(MagickWand *wand,
5690 const size_t width,const size_t height,const ssize_t x,
5699 assert(wand != (MagickWand *) NULL);
5700 assert(wand->signature == WandSignature);
5701 if (wand->debug != MagickFalse)
5702 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5703 if (wand->images == (Image *) NULL)
5704 return((MagickWand *) NULL);
5706 region.height=height;
5709 region_image=CropImage(wand->images,®ion,wand->exception);
5710 if (region_image == (Image *) NULL)
5711 return((MagickWand *) NULL);
5712 return(CloneMagickWandFromImages(wand,region_image));
5716 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5720 % 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 %
5724 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5726 % MagickGetImageRenderingIntent() gets the image rendering intent.
5728 % The format of the MagickGetImageRenderingIntent method is:
5730 % RenderingIntent MagickGetImageRenderingIntent(MagickWand *wand)
5732 % A description of each parameter follows:
5734 % o wand: the magick wand.
5737 WandExport RenderingIntent MagickGetImageRenderingIntent(MagickWand *wand)
5739 assert(wand != (MagickWand *) NULL);
5740 assert(wand->signature == WandSignature);
5741 if (wand->debug != MagickFalse)
5742 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5743 if (wand->images == (Image *) NULL)
5745 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5746 "ContainsNoImages","`%s'",wand->name);
5747 return(UndefinedIntent);
5749 return((RenderingIntent) wand->images->rendering_intent);
5753 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5757 % M a g i c k G e t I m a g e R e s o l u t i o n %
5761 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5763 % MagickGetImageResolution() gets the image X and Y resolution.
5765 % The format of the MagickGetImageResolution method is:
5767 % MagickBooleanType MagickGetImageResolution(MagickWand *wand,double *x,
5770 % A description of each parameter follows:
5772 % o wand: the magick wand.
5774 % o x: the image x-resolution.
5776 % o y: the image y-resolution.
5779 WandExport MagickBooleanType MagickGetImageResolution(MagickWand *wand,
5780 double *x,double *y)
5782 assert(wand != (MagickWand *) NULL);
5783 assert(wand->signature == WandSignature);
5784 if (wand->debug != MagickFalse)
5785 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5786 if (wand->images == (Image *) NULL)
5787 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5788 *x=wand->images->x_resolution;
5789 *y=wand->images->y_resolution;
5794 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5798 % M a g i c k G e t I m a g e S c e n e %
5802 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5804 % MagickGetImageScene() gets the image scene.
5806 % The format of the MagickGetImageScene method is:
5808 % size_t MagickGetImageScene(MagickWand *wand)
5810 % A description of each parameter follows:
5812 % o wand: the magick wand.
5815 WandExport size_t MagickGetImageScene(MagickWand *wand)
5817 assert(wand != (MagickWand *) NULL);
5818 assert(wand->signature == WandSignature);
5819 if (wand->debug != MagickFalse)
5820 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5821 if (wand->images == (Image *) NULL)
5822 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5823 return(wand->images->scene);
5827 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5831 % M a g i c k G e t I m a g e S i g n a t u r e %
5835 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5837 % MagickGetImageSignature() generates an SHA-256 message digest for the image
5840 % The format of the MagickGetImageSignature method is:
5842 % const char MagickGetImageSignature(MagickWand *wand)
5844 % A description of each parameter follows:
5846 % o wand: the magick wand.
5849 WandExport char *MagickGetImageSignature(MagickWand *wand)
5857 assert(wand != (MagickWand *) NULL);
5858 assert(wand->signature == WandSignature);
5859 if (wand->debug != MagickFalse)
5860 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5861 if (wand->images == (Image *) NULL)
5863 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5864 "ContainsNoImages","`%s'",wand->name);
5865 return((char *) NULL);
5867 status=SignatureImage(wand->images);
5868 if (status == MagickFalse)
5869 InheritException(wand->exception,&wand->images->exception);
5870 value=GetImageProperty(wand->images,"signature");
5871 if (value != (const char *) NULL)
5872 return(AcquireString(value));
5873 InheritException(wand->exception,&wand->images->exception);
5874 return((char *) NULL);
5878 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5882 % 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 %
5886 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5888 % MagickGetImageTicksPerSecond() gets the image ticks-per-second.
5890 % The format of the MagickGetImageTicksPerSecond method is:
5892 % size_t MagickGetImageTicksPerSecond(MagickWand *wand)
5894 % A description of each parameter follows:
5896 % o wand: the magick wand.
5899 WandExport size_t MagickGetImageTicksPerSecond(MagickWand *wand)
5901 assert(wand != (MagickWand *) NULL);
5902 assert(wand->signature == WandSignature);
5903 if (wand->debug != MagickFalse)
5904 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5905 if (wand->images == (Image *) NULL)
5906 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5907 return((size_t) wand->images->ticks_per_second);
5911 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5915 % M a g i c k G e t I m a g e T y p e %
5919 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5921 % MagickGetImageType() gets the potential image type:
5923 % Bilevel Grayscale GrayscaleMatte
5924 % Palette PaletteMatte TrueColor
5925 % TrueColorMatte ColorSeparation ColorSeparationMatte
5927 % To ensure the image type matches its potential, use MagickSetImageType():
5929 % (void) MagickSetImageType(wand,MagickGetImageType(wand));
5931 % The format of the MagickGetImageType method is:
5933 % ImageType MagickGetImageType(MagickWand *wand)
5935 % A description of each parameter follows:
5937 % o wand: the magick wand.
5940 WandExport ImageType MagickGetImageType(MagickWand *wand)
5942 assert(wand != (MagickWand *) NULL);
5943 assert(wand->signature == WandSignature);
5944 if (wand->debug != MagickFalse)
5945 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5946 if (wand->images == (Image *) NULL)
5948 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5949 "ContainsNoImages","`%s'",wand->name);
5950 return(UndefinedType);
5952 return(GetImageType(wand->images,wand->exception));
5956 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5960 % M a g i c k G e t I m a g e U n i t s %
5964 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5966 % MagickGetImageUnits() gets the image units of resolution.
5968 % The format of the MagickGetImageUnits method is:
5970 % ResolutionType MagickGetImageUnits(MagickWand *wand)
5972 % A description of each parameter follows:
5974 % o wand: the magick wand.
5977 WandExport ResolutionType MagickGetImageUnits(MagickWand *wand)
5979 assert(wand != (MagickWand *) NULL);
5980 assert(wand->signature == WandSignature);
5981 if (wand->debug != MagickFalse)
5982 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5983 if (wand->images == (Image *) NULL)
5985 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5986 "ContainsNoImages","`%s'",wand->name);
5987 return(UndefinedResolution);
5989 return(wand->images->units);
5993 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5997 % 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 %
6001 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6003 % MagickGetImageVirtualPixelMethod() returns the virtual pixel method for the
6006 % The format of the MagickGetImageVirtualPixelMethod method is:
6008 % VirtualPixelMethod MagickGetImageVirtualPixelMethod(MagickWand *wand)
6010 % A description of each parameter follows:
6012 % o wand: the magick wand.
6015 WandExport VirtualPixelMethod MagickGetImageVirtualPixelMethod(MagickWand *wand)
6017 assert(wand != (MagickWand *) NULL);
6018 assert(wand->signature == WandSignature);
6019 if (wand->debug != MagickFalse)
6020 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6021 if (wand->images == (Image *) NULL)
6023 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
6024 "ContainsNoImages","`%s'",wand->name);
6025 return(UndefinedVirtualPixelMethod);
6027 return(GetImageVirtualPixelMethod(wand->images));
6031 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6035 % M a g i c k G e t I m a g e W h i t e P o i n t %
6039 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6041 % MagickGetImageWhitePoint() returns the chromaticy white point.
6043 % The format of the MagickGetImageWhitePoint method is:
6045 % MagickBooleanType MagickGetImageWhitePoint(MagickWand *wand,double *x,
6048 % A description of each parameter follows:
6050 % o wand: the magick wand.
6052 % o x: the chromaticity white x-point.
6054 % o y: the chromaticity white y-point.
6057 WandExport MagickBooleanType MagickGetImageWhitePoint(MagickWand *wand,
6058 double *x,double *y)
6060 assert(wand != (MagickWand *) NULL);
6061 assert(wand->signature == WandSignature);
6062 if (wand->debug != MagickFalse)
6063 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6064 if (wand->images == (Image *) NULL)
6065 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6066 *x=wand->images->chromaticity.white_point.x;
6067 *y=wand->images->chromaticity.white_point.y;
6072 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6076 % M a g i c k G e t I m a g e W i d t h %
6080 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6082 % MagickGetImageWidth() returns the image width.
6084 % The format of the MagickGetImageWidth method is:
6086 % size_t MagickGetImageWidth(MagickWand *wand)
6088 % A description of each parameter follows:
6090 % o wand: the magick wand.
6093 WandExport size_t MagickGetImageWidth(MagickWand *wand)
6095 assert(wand != (MagickWand *) NULL);
6096 assert(wand->signature == WandSignature);
6097 if (wand->debug != MagickFalse)
6098 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6099 if (wand->images == (Image *) NULL)
6100 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6101 return(wand->images->columns);
6105 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6109 % M a g i c k G e t N u m b e r I m a g e s %
6113 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6115 % MagickGetNumberImages() returns the number of images associated with a
6118 % The format of the MagickGetNumberImages method is:
6120 % size_t MagickGetNumberImages(MagickWand *wand)
6122 % A description of each parameter follows:
6124 % o wand: the magick wand.
6127 WandExport size_t MagickGetNumberImages(MagickWand *wand)
6129 assert(wand != (MagickWand *) NULL);
6130 assert(wand->signature == WandSignature);
6131 if (wand->debug != MagickFalse)
6132 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6133 return(GetImageListLength(wand->images));
6137 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6141 % 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 %
6145 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6147 % MagickGetImageTotalInkDensity() gets the image total ink density.
6149 % The format of the MagickGetImageTotalInkDensity method is:
6151 % double MagickGetImageTotalInkDensity(MagickWand *wand)
6153 % A description of each parameter follows:
6155 % o wand: the magick wand.
6158 WandExport double MagickGetImageTotalInkDensity(MagickWand *wand)
6160 assert(wand != (MagickWand *) NULL);
6161 assert(wand->signature == WandSignature);
6162 if (wand->debug != MagickFalse)
6163 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6164 if (wand->images == (Image *) NULL)
6166 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
6167 "ContainsNoImages","`%s'",wand->name);
6170 return(GetImageTotalInkDensity(wand->images));
6174 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6178 % M a g i c k H a l d C l u t I m a g e %
6182 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6184 % MagickHaldClutImage() replaces colors in the image from a Hald color lookup
6185 % table. A Hald color lookup table is a 3-dimensional color cube mapped to 2
6186 % dimensions. Create it with the HALD coder. You can apply any color
6187 % transformation to the Hald image and then use this method to apply the
6188 % transform to the image.
6190 % The format of the MagickHaldClutImage method is:
6192 % MagickBooleanType MagickHaldClutImage(MagickWand *wand,
6193 % const MagickWand *hald_wand)
6194 % MagickBooleanType MagickHaldClutImageChannel(MagickWand *wand,
6195 % const ChannelType channel,const MagickWand *hald_wand)
6197 % A description of each parameter follows:
6199 % o wand: the magick wand.
6201 % o hald_image: the hald CLUT image.
6205 WandExport MagickBooleanType MagickHaldClutImage(MagickWand *wand,
6206 const MagickWand *hald_wand)
6211 status=MagickHaldClutImageChannel(wand,DefaultChannels,hald_wand);
6215 WandExport MagickBooleanType MagickHaldClutImageChannel(MagickWand *wand,
6216 const ChannelType channel,const MagickWand *hald_wand)
6221 assert(wand != (MagickWand *) NULL);
6222 assert(wand->signature == WandSignature);
6223 if (wand->debug != MagickFalse)
6224 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6225 if ((wand->images == (Image *) NULL) || (hald_wand->images == (Image *) NULL))
6226 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6227 status=HaldClutImageChannel(wand->images,channel,hald_wand->images);
6228 if (status == MagickFalse)
6229 InheritException(wand->exception,&wand->images->exception);
6234 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6238 % M a g i c k H a s N e x t I m a g e %
6242 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6244 % MagickHasNextImage() returns MagickTrue if the wand has more images when
6245 % traversing the list in the forward direction
6247 % The format of the MagickHasNextImage method is:
6249 % MagickBooleanType MagickHasNextImage(MagickWand *wand)
6251 % A description of each parameter follows:
6253 % o wand: the magick wand.
6256 WandExport MagickBooleanType MagickHasNextImage(MagickWand *wand)
6258 assert(wand != (MagickWand *) NULL);
6259 assert(wand->signature == WandSignature);
6260 if (wand->debug != MagickFalse)
6261 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6262 if (wand->images == (Image *) NULL)
6263 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6264 if (GetNextImageInList(wand->images) == (Image *) NULL)
6265 return(MagickFalse);
6270 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6274 % M a g i c k H a s P r e v i o u s I m a g e %
6278 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6280 % MagickHasPreviousImage() returns MagickTrue if the wand has more images when
6281 % traversing the list in the reverse direction
6283 % The format of the MagickHasPreviousImage method is:
6285 % MagickBooleanType MagickHasPreviousImage(MagickWand *wand)
6287 % A description of each parameter follows:
6289 % o wand: the magick wand.
6292 WandExport MagickBooleanType MagickHasPreviousImage(MagickWand *wand)
6294 assert(wand != (MagickWand *) NULL);
6295 assert(wand->signature == WandSignature);
6296 if (wand->debug != MagickFalse)
6297 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6298 if (wand->images == (Image *) NULL)
6299 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6300 if (GetPreviousImageInList(wand->images) == (Image *) NULL)
6301 return(MagickFalse);
6306 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6310 % M a g i c k I d e n t i f y I m a g e %
6314 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6316 % MagickIdentifyImage() identifies an image by printing its attributes to the
6317 % file. Attributes include the image width, height, size, and others.
6319 % The format of the MagickIdentifyImage method is:
6321 % const char *MagickIdentifyImage(MagickWand *wand)
6323 % A description of each parameter follows:
6325 % o wand: the magick wand.
6328 WandExport char *MagickIdentifyImage(MagickWand *wand)
6332 filename[MaxTextExtent];
6340 assert(wand != (MagickWand *) NULL);
6341 assert(wand->signature == WandSignature);
6342 if (wand->debug != MagickFalse)
6343 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6344 if (wand->images == (Image *) NULL)
6346 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
6347 "ContainsNoImages","`%s'",wand->name);
6348 return((char *) NULL);
6350 description=(char *) NULL;
6351 unique_file=AcquireUniqueFileResource(filename);
6353 if (unique_file != -1)
6354 file=fdopen(unique_file,"wb");
6355 if ((unique_file == -1) || (file == (FILE *) NULL))
6357 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
6358 "UnableToCreateTemporaryFile","`%s'",wand->name);
6359 return((char *) NULL);
6361 (void) IdentifyImage(wand->images,file,MagickTrue);
6362 (void) fclose(file);
6363 description=FileToString(filename,~0,wand->exception);
6364 (void) RelinquishUniqueFileResource(filename);
6365 return(description);
6369 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6373 % M a g i c k I m p l o d e I m a g e %
6377 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6379 % MagickImplodeImage() creates a new image that is a copy of an existing
6380 % one with the image pixels "implode" by the specified percentage. It
6381 % allocates the memory necessary for the new Image structure and returns a
6382 % pointer to the new image.
6384 % The format of the MagickImplodeImage method is:
6386 % MagickBooleanType MagickImplodeImage(MagickWand *wand,
6387 % const double radius)
6389 % A description of each parameter follows:
6391 % o wand: the magick wand.
6393 % o amount: Define the extent of the implosion.
6396 WandExport MagickBooleanType MagickImplodeImage(MagickWand *wand,
6397 const double amount)
6402 assert(wand != (MagickWand *) NULL);
6403 assert(wand->signature == WandSignature);
6404 if (wand->debug != MagickFalse)
6405 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6406 if (wand->images == (Image *) NULL)
6407 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6408 implode_image=ImplodeImage(wand->images,amount,wand->exception);
6409 if (implode_image == (Image *) NULL)
6410 return(MagickFalse);
6411 ReplaceImageInList(&wand->images,implode_image);
6416 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6420 % M a g i c k I m p o r t I m a g e P i x e l s %
6424 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6426 % MagickImportImagePixels() accepts pixel datand stores it in the image at the
6427 % location you specify. The method returns MagickFalse on success otherwise
6428 % MagickTrue if an error is encountered. The pixel data can be either char,
6429 % short int, int, ssize_t, float, or double in the order specified by map.
6431 % Suppose your want to upload the first scanline of a 640x480 image from
6432 % character data in red-green-blue order:
6434 % MagickImportImagePixels(wand,0,0,640,1,"RGB",CharPixel,pixels);
6436 % The format of the MagickImportImagePixels method is:
6438 % MagickBooleanType MagickImportImagePixels(MagickWand *wand,
6439 % const ssize_t x,const ssize_t y,const size_t columns,
6440 % const size_t rows,const char *map,const StorageType storage,
6441 % const void *pixels)
6443 % A description of each parameter follows:
6445 % o wand: the magick wand.
6447 % o x, y, columns, rows: These values define the perimeter of a region
6448 % of pixels you want to define.
6450 % o map: This string reflects the expected ordering of the pixel array.
6451 % It can be any combination or order of R = red, G = green, B = blue,
6452 % A = alpha (0 is transparent), O = opacity (0 is opaque), C = cyan,
6453 % Y = yellow, M = magenta, K = black, I = intensity (for grayscale),
6456 % o storage: Define the data type of the pixels. Float and double types are
6457 % expected to be normalized [0..1] otherwise [0..QuantumRange]. Choose from
6458 % these types: CharPixel, ShortPixel, IntegerPixel, LongPixel, FloatPixel,
6461 % o pixels: This array of values contain the pixel components as defined by
6462 % map and type. You must preallocate this array where the expected
6463 % length varies depending on the values of width, height, map, and type.
6466 WandExport MagickBooleanType MagickImportImagePixels(MagickWand *wand,
6467 const ssize_t x,const ssize_t y,const size_t columns,
6468 const size_t rows,const char *map,const StorageType storage,
6474 assert(wand != (MagickWand *) NULL);
6475 assert(wand->signature == WandSignature);
6476 if (wand->debug != MagickFalse)
6477 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6478 if (wand->images == (Image *) NULL)
6479 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6480 status=ImportImagePixels(wand->images,x,y,columns,rows,map,storage,pixels);
6481 if (status == MagickFalse)
6482 InheritException(wand->exception,&wand->images->exception);
6487 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6491 % 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 %
6495 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6497 % MagickInverseFourierTransformImage() implements the inverse discrete
6498 % Fourier transform (DFT) of the image either as a magnitude / phase or real /
6499 % imaginary image pair.
6501 % The format of the MagickInverseFourierTransformImage method is:
6503 % MagickBooleanType MagickInverseFourierTransformImage(
6504 % MagickWand *magnitude_wand,MagickWand *phase_wand,
6505 % const MagickBooleanType magnitude)
6507 % A description of each parameter follows:
6509 % o magnitude_wand: the magnitude or real wand.
6511 % o phase_wand: the phase or imaginary wand.
6513 % o magnitude: if true, return as magnitude / phase pair otherwise a real /
6514 % imaginary image pair.
6517 WandExport MagickBooleanType MagickInverseFourierTransformImage(
6518 MagickWand *magnitude_wand,MagickWand *phase_wand,
6519 const MagickBooleanType magnitude)
6527 assert(magnitude_wand != (MagickWand *) NULL);
6528 assert(magnitude_wand->signature == WandSignature);
6529 if (magnitude_wand->debug != MagickFalse)
6530 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",
6531 magnitude_wand->name);
6532 wand=magnitude_wand;
6533 if (magnitude_wand->images == (Image *) NULL)
6534 ThrowWandException(WandError,"ContainsNoImages",
6535 magnitude_wand->name);
6536 assert(phase_wand != (MagickWand *) NULL);
6537 assert(phase_wand->signature == WandSignature);
6538 inverse_image=InverseFourierTransformImage(magnitude_wand->images,
6539 phase_wand->images,magnitude,wand->exception);
6540 if (inverse_image == (Image *) NULL)
6541 return(MagickFalse);
6542 ReplaceImageInList(&wand->images,inverse_image);
6547 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6551 % M a g i c k L a b e l I m a g e %
6555 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6557 % MagickLabelImage() adds a label to your image.
6559 % The format of the MagickLabelImage method is:
6561 % MagickBooleanType MagickLabelImage(MagickWand *wand,const char *label)
6563 % A description of each parameter follows:
6565 % o wand: the magick wand.
6567 % o label: the image label.
6570 WandExport MagickBooleanType MagickLabelImage(MagickWand *wand,
6576 assert(wand != (MagickWand *) NULL);
6577 assert(wand->signature == WandSignature);
6578 if (wand->debug != MagickFalse)
6579 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6580 if (wand->images == (Image *) NULL)
6581 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6582 status=SetImageProperty(wand->images,"label",label);
6583 if (status == MagickFalse)
6584 InheritException(wand->exception,&wand->images->exception);
6589 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6593 % M a g i c k L e v e l I m a g e %
6597 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6599 % MagickLevelImage() adjusts the levels of an image by scaling the colors
6600 % falling between specified white and black points to the full available
6601 % quantum range. The parameters provided represent the black, mid, and white
6602 % points. The black point specifies the darkest color in the image. Colors
6603 % darker than the black point are set to zero. Mid point specifies a gamma
6604 % correction to apply to the image. White point specifies the lightest color
6605 % in the image. Colors brighter than the white point are set to the maximum
6608 % The format of the MagickLevelImage method is:
6610 % MagickBooleanType MagickLevelImage(MagickWand *wand,
6611 % const double black_point,const double gamma,const double white_point)
6612 % MagickBooleanType MagickLevelImageChannel(MagickWand *wand,
6613 % const ChannelType channel,const double black_point,const double gamma,
6614 % const double white_point)
6616 % A description of each parameter follows:
6618 % o wand: the magick wand.
6620 % o channel: Identify which channel to level: RedChannel, GreenChannel,
6622 % o black_point: the black point.
6624 % o gamma: the gamma.
6626 % o white_point: the white point.
6630 WandExport MagickBooleanType MagickLevelImage(MagickWand *wand,
6631 const double black_point,const double gamma,const double white_point)
6636 status=MagickLevelImageChannel(wand,DefaultChannels,black_point,gamma,
6641 WandExport MagickBooleanType MagickLevelImageChannel(MagickWand *wand,
6642 const ChannelType channel,const double black_point,const double gamma,
6643 const double white_point)
6648 assert(wand != (MagickWand *) NULL);
6649 assert(wand->signature == WandSignature);
6650 if (wand->debug != MagickFalse)
6651 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6652 if (wand->images == (Image *) NULL)
6653 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6654 status=LevelImageChannel(wand->images,channel,black_point,white_point,gamma);
6655 if (status == MagickFalse)
6656 InheritException(wand->exception,&wand->images->exception);
6661 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6665 % M a g i c k L i n e a r S t r e t c h I m a g e %
6669 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6671 % MagickLinearStretchImage() stretches with saturation the image intensity.
6673 % You can also reduce the influence of a particular channel with a gamma
6676 % The format of the MagickLinearStretchImage method is:
6678 % MagickBooleanType MagickLinearStretchImage(MagickWand *wand,
6679 % const double black_point,const double white_point)
6681 % A description of each parameter follows:
6683 % o wand: the magick wand.
6685 % o black_point: the black point.
6687 % o white_point: the white point.
6690 WandExport MagickBooleanType MagickLinearStretchImage(MagickWand *wand,
6691 const double black_point,const double white_point)
6696 assert(wand != (MagickWand *) NULL);
6697 assert(wand->signature == WandSignature);
6698 if (wand->debug != MagickFalse)
6699 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6700 if (wand->images == (Image *) NULL)
6701 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6702 status=LinearStretchImage(wand->images,black_point,white_point);
6703 if (status == MagickFalse)
6704 InheritException(wand->exception,&wand->images->exception);
6709 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6713 % M a g i c k L i q u i d R e s c a l e I m a g e %
6717 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6719 % MagickLiquidRescaleImage() rescales image with seam carving.
6721 % MagickBooleanType MagickLiquidRescaleImage(MagickWand *wand,
6722 % const size_t columns,const size_t rows,
6723 % const double delta_x,const double rigidity)
6725 % A description of each parameter follows:
6727 % o wand: the magick wand.
6729 % o columns: the number of columns in the scaled image.
6731 % o rows: the number of rows in the scaled image.
6733 % o delta_x: maximum seam transversal step (0 means straight seams).
6735 % o rigidity: introduce a bias for non-straight seams (typically 0).
6738 WandExport MagickBooleanType MagickLiquidRescaleImage(MagickWand *wand,
6739 const size_t columns,const size_t rows,const double delta_x,
6740 const double rigidity)
6745 assert(wand != (MagickWand *) NULL);
6746 assert(wand->signature == WandSignature);
6747 if (wand->debug != MagickFalse)
6748 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6749 if (wand->images == (Image *) NULL)
6750 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6751 rescale_image=LiquidRescaleImage(wand->images,columns,rows,delta_x,
6752 rigidity,wand->exception);
6753 if (rescale_image == (Image *) NULL)
6754 return(MagickFalse);
6755 ReplaceImageInList(&wand->images,rescale_image);
6760 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6764 % M a g i c k M a g n i f y I m a g e %
6768 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6770 % MagickMagnifyImage() is a convenience method that scales an image
6771 % proportionally to twice its original size.
6773 % The format of the MagickMagnifyImage method is:
6775 % MagickBooleanType MagickMagnifyImage(MagickWand *wand)
6777 % A description of each parameter follows:
6779 % o wand: the magick wand.
6782 WandExport MagickBooleanType MagickMagnifyImage(MagickWand *wand)
6787 assert(wand != (MagickWand *) NULL);
6788 assert(wand->signature == WandSignature);
6789 if (wand->debug != MagickFalse)
6790 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6791 if (wand->images == (Image *) NULL)
6792 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6793 magnify_image=MagnifyImage(wand->images,wand->exception);
6794 if (magnify_image == (Image *) NULL)
6795 return(MagickFalse);
6796 ReplaceImageInList(&wand->images,magnify_image);
6801 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6805 % M a g i c k M e d i a n F i l t e r I m a g e %
6809 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6811 % MagickMedianFilterImage() applies a digital filter that improves the quality
6812 % of a noisy image. Each pixel is replaced by the median in a set of
6813 % neighboring pixels as defined by radius.
6815 % The format of the MagickMedianFilterImage method is:
6817 % MagickBooleanType MagickMedianFilterImage(MagickWand *wand,
6818 % const double radius)
6820 % A description of each parameter follows:
6822 % o wand: the magick wand.
6824 % o radius: the radius of the pixel neighborhood.
6827 WandExport MagickBooleanType MagickMedianFilterImage(MagickWand *wand,
6828 const double radius)
6833 assert(wand != (MagickWand *) NULL);
6834 assert(wand->signature == WandSignature);
6835 if (wand->debug != MagickFalse)
6836 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6837 if (wand->images == (Image *) NULL)
6838 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6839 median_image=MedianFilterImage(wand->images,radius,wand->exception);
6840 if (median_image == (Image *) NULL)
6841 return(MagickFalse);
6842 ReplaceImageInList(&wand->images,median_image);
6847 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6851 % M a g i c k M e r g e I m a g e L a y e r s %
6855 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6857 % MagickMergeImageLayers() composes all the image layers from the current given
6858 % image onward to produce a single image of the merged layers.
6860 % The inital canvas's size depends on the given ImageLayerMethod, and is
6861 % initialized using the first images background color. The images
6862 % are then compositied onto that image in sequence using the given
6863 % composition that has been assigned to each individual image.
6865 % The format of the MagickMergeImageLayers method is:
6867 % MagickWand *MagickMergeImageLayers(MagickWand *wand,
6868 % const ImageLayerMethod method)
6870 % A description of each parameter follows:
6872 % o wand: the magick wand.
6874 % o method: the method of selecting the size of the initial canvas.
6876 % MergeLayer: Merge all layers onto a canvas just large enough
6877 % to hold all the actual images. The virtual canvas of the
6878 % first image is preserved but otherwise ignored.
6880 % FlattenLayer: Use the virtual canvas size of first image.
6881 % Images which fall outside this canvas is clipped.
6882 % This can be used to 'fill out' a given virtual canvas.
6884 % MosaicLayer: Start with the virtual canvas of the first image,
6885 % enlarging left and right edges to contain all images.
6886 % Images with negative offsets will be clipped.
6889 WandExport MagickWand *MagickMergeImageLayers(MagickWand *wand,
6890 const ImageLayerMethod method)
6895 assert(wand != (MagickWand *) NULL);
6896 assert(wand->signature == WandSignature);
6897 if (wand->debug != MagickFalse)
6898 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6899 if (wand->images == (Image *) NULL)
6900 return((MagickWand *) NULL);
6901 mosaic_image=MergeImageLayers(wand->images,method,wand->exception);
6902 if (mosaic_image == (Image *) NULL)
6903 return((MagickWand *) NULL);
6904 return(CloneMagickWandFromImages(wand,mosaic_image));
6908 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6912 % M a g i c k M i n i f y I m a g e %
6916 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6918 % MagickMinifyImage() is a convenience method that scales an image
6919 % proportionally to one-half its original size
6921 % The format of the MagickMinifyImage method is:
6923 % MagickBooleanType MagickMinifyImage(MagickWand *wand)
6925 % A description of each parameter follows:
6927 % o wand: the magick wand.
6930 WandExport MagickBooleanType MagickMinifyImage(MagickWand *wand)
6935 assert(wand != (MagickWand *) NULL);
6936 assert(wand->signature == WandSignature);
6937 if (wand->debug != MagickFalse)
6938 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6939 if (wand->images == (Image *) NULL)
6940 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6941 minify_image=MinifyImage(wand->images,wand->exception);
6942 if (minify_image == (Image *) NULL)
6943 return(MagickFalse);
6944 ReplaceImageInList(&wand->images,minify_image);
6949 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6953 % M a g i c k M o d u l a t e I m a g e %
6957 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6959 % MagickModulateImage() lets you control the brightness, saturation, and hue
6960 % of an image. Hue is the percentage of absolute rotation from the current
6961 % position. For example 50 results in a counter-clockwise rotation of 90
6962 % degrees, 150 results in a clockwise rotation of 90 degrees, with 0 and 200
6963 % both resulting in a rotation of 180 degrees.
6965 % To increase the color brightness by 20% and decrease the color saturation by
6966 % 10% and leave the hue unchanged, use: 120,90,100.
6968 % The format of the MagickModulateImage method is:
6970 % MagickBooleanType MagickModulateImage(MagickWand *wand,
6971 % const double brightness,const double saturation,const double hue)
6973 % A description of each parameter follows:
6975 % o wand: the magick wand.
6977 % o brightness: the percent change in brighness.
6979 % o saturation: the percent change in saturation.
6981 % o hue: the percent change in hue.
6984 WandExport MagickBooleanType MagickModulateImage(MagickWand *wand,
6985 const double brightness,const double saturation,const double hue)
6988 modulate[MaxTextExtent];
6993 assert(wand != (MagickWand *) NULL);
6994 assert(wand->signature == WandSignature);
6995 if (wand->debug != MagickFalse)
6996 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6997 if (wand->images == (Image *) NULL)
6998 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6999 (void) FormatMagickString(modulate,MaxTextExtent,"%g,%g,%g",
7000 brightness,saturation,hue);
7001 status=ModulateImage(wand->images,modulate);
7002 if (status == MagickFalse)
7003 InheritException(wand->exception,&wand->images->exception);
7008 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7012 % M a g i c k M o n t a g e I m a g e %
7016 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7018 % MagickMontageImage() creates a composite image by combining several
7019 % separate images. The images are tiled on the composite image with the name
7020 % of the image optionally appearing just below the individual tile.
7022 % The format of the MagickMontageImage method is:
7024 % MagickWand *MagickMontageImage(MagickWand *wand,
7025 % const DrawingWand drawing_wand,const char *tile_geometry,
7026 % const char *thumbnail_geometry,const MontageMode mode,
7027 % const char *frame)
7029 % A description of each parameter follows:
7031 % o wand: the magick wand.
7033 % o drawing_wand: the drawing wand. The font name, size, and color are
7034 % obtained from this wand.
7036 % o tile_geometry: the number of tiles per row and page (e.g. 6x4+0+0).
7038 % o thumbnail_geometry: Preferred image size and border size of each
7039 % thumbnail (e.g. 120x120+4+3>).
7041 % o mode: Thumbnail framing mode: Frame, Unframe, or Concatenate.
7043 % o frame: Surround the image with an ornamental border (e.g. 15x15+3+3).
7044 % The frame color is that of the thumbnail's matte color.
7047 WandExport MagickWand *MagickMontageImage(MagickWand *wand,
7048 const DrawingWand *drawing_wand,const char *tile_geometry,
7049 const char *thumbnail_geometry,const MontageMode mode,const char *frame)
7063 assert(wand != (MagickWand *) NULL);
7064 assert(wand->signature == WandSignature);
7065 if (wand->debug != MagickFalse)
7066 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7067 if (wand->images == (Image *) NULL)
7068 return((MagickWand *) NULL);
7069 montage_info=CloneMontageInfo(wand->image_info,(MontageInfo *) NULL);
7074 (void) CloneString(&montage_info->frame,"15x15+3+3");
7075 montage_info->shadow=MagickTrue;
7080 montage_info->frame=(char *) NULL;
7081 montage_info->shadow=MagickFalse;
7082 montage_info->border_width=0;
7085 case ConcatenateMode:
7087 montage_info->frame=(char *) NULL;
7088 montage_info->shadow=MagickFalse;
7089 (void) CloneString(&montage_info->geometry,"+0+0");
7090 montage_info->border_width=0;
7096 font=DrawGetFont(drawing_wand);
7097 if (font != (char *) NULL)
7098 (void) CloneString(&montage_info->font,font);
7099 if (frame != (char *) NULL)
7100 (void) CloneString(&montage_info->frame,frame);
7101 montage_info->pointsize=DrawGetFontSize(drawing_wand);
7102 pixel_wand=NewPixelWand();
7103 DrawGetFillColor(drawing_wand,pixel_wand);
7104 PixelGetQuantumColor(pixel_wand,&montage_info->fill);
7105 DrawGetStrokeColor(drawing_wand,pixel_wand);
7106 PixelGetQuantumColor(pixel_wand,&montage_info->stroke);
7107 pixel_wand=DestroyPixelWand(pixel_wand);
7108 if (thumbnail_geometry != (char *) NULL)
7109 (void) CloneString(&montage_info->geometry,thumbnail_geometry);
7110 if (tile_geometry != (char *) NULL)
7111 (void) CloneString(&montage_info->tile,tile_geometry);
7112 montage_image=MontageImageList(wand->image_info,montage_info,wand->images,
7114 montage_info=DestroyMontageInfo(montage_info);
7115 if (montage_image == (Image *) NULL)
7116 return((MagickWand *) NULL);
7117 return(CloneMagickWandFromImages(wand,montage_image));
7121 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7125 % M a g i c k M o r p h I m a g e s %
7129 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7131 % MagickMorphImages() method morphs a set of images. Both the image pixels
7132 % and size are linearly interpolated to give the appearance of a
7133 % meta-morphosis from one image to the next.
7135 % The format of the MagickMorphImages method is:
7137 % MagickWand *MagickMorphImages(MagickWand *wand,
7138 % const size_t number_frames)
7140 % A description of each parameter follows:
7142 % o wand: the magick wand.
7144 % o number_frames: the number of in-between images to generate.
7147 WandExport MagickWand *MagickMorphImages(MagickWand *wand,
7148 const size_t number_frames)
7153 assert(wand != (MagickWand *) NULL);
7154 assert(wand->signature == WandSignature);
7155 if (wand->debug != MagickFalse)
7156 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7157 if (wand->images == (Image *) NULL)
7158 return((MagickWand *) NULL);
7159 morph_image=MorphImages(wand->images,number_frames,wand->exception);
7160 if (morph_image == (Image *) NULL)
7161 return((MagickWand *) NULL);
7162 return(CloneMagickWandFromImages(wand,morph_image));
7166 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7170 % M a g i c k M o r p h o l o g y I m a g e %
7174 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7176 % MagickMorphologyImage() applies a user supplied kernel to the image
7177 % according to the given mophology method.
7179 % The format of the MagickMorphologyImage method is:
7181 % MagickBooleanType MagickMorphologyImage(MagickWand *wand,
7182 % MorphologyMethod method,const ssize_t iterations,KernelInfo *kernel)
7183 % MagickBooleanType MagickMorphologyImageChannel(MagickWand *wand,
7184 % ChannelType channel,MorphologyMethod method,const ssize_t iterations,
7185 % KernelInfo *kernel)
7187 % A description of each parameter follows:
7189 % o wand: the magick wand.
7191 % o channel: the image channel(s).
7193 % o method: the morphology method to be applied.
7195 % o iterations: apply the operation this many times (or no change).
7196 % A value of -1 means loop until no change found. How this is applied
7197 % may depend on the morphology method. Typically this is a value of 1.
7199 % o kernel: An array of doubles representing the morphology kernel.
7203 WandExport MagickBooleanType MagickMorphologyImage(MagickWand *wand,
7204 MorphologyMethod method,const ssize_t iterations,KernelInfo *kernel)
7209 status=MagickMorphologyImageChannel(wand,DefaultChannels,method,iterations,
7214 WandExport MagickBooleanType MagickMorphologyImageChannel(MagickWand *wand,
7215 const ChannelType channel,MorphologyMethod method,const ssize_t iterations,
7221 assert(wand != (MagickWand *) NULL);
7222 assert(wand->signature == WandSignature);
7223 if (wand->debug != MagickFalse)
7224 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7225 if (kernel == (const KernelInfo *) NULL)
7226 return(MagickFalse);
7227 if (wand->images == (Image *) NULL)
7228 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7229 morphology_image=MorphologyImageChannel(wand->images,channel,method,
7230 iterations,kernel,wand->exception);
7231 if (morphology_image == (Image *) NULL)
7232 return(MagickFalse);
7233 ReplaceImageInList(&wand->images,morphology_image);
7238 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7242 % M a g i c k M o t i o n B l u r I m a g e %
7246 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7248 % MagickMotionBlurImage() simulates motion blur. We convolve the image with a
7249 % Gaussian operator of the given radius and standard deviation (sigma).
7250 % For reasonable results, radius should be larger than sigma. Use a
7251 % radius of 0 and MotionBlurImage() selects a suitable radius for you.
7252 % Angle gives the angle of the blurring motion.
7254 % The format of the MagickMotionBlurImage method is:
7256 % MagickBooleanType MagickMotionBlurImage(MagickWand *wand,
7257 % const double radius,const double sigma,const double angle)
7258 % MagickBooleanType MagickMotionBlurImageChannel(MagickWand *wand,
7259 % const ChannelType channel,const double radius,const double sigma,
7260 % const double angle)
7262 % A description of each parameter follows:
7264 % o wand: the magick wand.
7266 % o channel: the image channel(s).
7268 % o radius: the radius of the Gaussian, in pixels, not counting
7271 % o sigma: the standard deviation of the Gaussian, in pixels.
7273 % o angle: Apply the effect along this angle.
7277 WandExport MagickBooleanType MagickMotionBlurImage(MagickWand *wand,
7278 const double radius,const double sigma,const double angle)
7283 status=MagickMotionBlurImageChannel(wand,DefaultChannels,radius,sigma,angle);
7287 WandExport MagickBooleanType MagickMotionBlurImageChannel(MagickWand *wand,
7288 const ChannelType channel,const double radius,const double sigma,
7294 assert(wand != (MagickWand *) NULL);
7295 assert(wand->signature == WandSignature);
7296 if (wand->debug != MagickFalse)
7297 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7298 if (wand->images == (Image *) NULL)
7299 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7300 blur_image=MotionBlurImageChannel(wand->images,channel,radius,sigma,angle,
7302 if (blur_image == (Image *) NULL)
7303 return(MagickFalse);
7304 ReplaceImageInList(&wand->images,blur_image);
7309 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7313 % M a g i c k N e g a t e I m a g e %
7317 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7319 % MagickNegateImage() negates the colors in the reference image. The
7320 % Grayscale option means that only grayscale values within the image are
7323 % You can also reduce the influence of a particular channel with a gamma
7326 % The format of the MagickNegateImage method is:
7328 % MagickBooleanType MagickNegateImage(MagickWand *wand,
7329 % const MagickBooleanType gray)
7330 % MagickBooleanType MagickNegateImage(MagickWand *wand,
7331 % const ChannelType channel,const MagickBooleanType gray)
7333 % A description of each parameter follows:
7335 % o wand: the magick wand.
7337 % o channel: the image channel(s).
7339 % o gray: If MagickTrue, only negate grayscale pixels within the image.
7343 WandExport MagickBooleanType MagickNegateImage(MagickWand *wand,
7344 const MagickBooleanType gray)
7349 status=MagickNegateImageChannel(wand,DefaultChannels,gray);
7353 WandExport MagickBooleanType MagickNegateImageChannel(MagickWand *wand,
7354 const ChannelType channel,const MagickBooleanType gray)
7359 assert(wand != (MagickWand *) NULL);
7360 assert(wand->signature == WandSignature);
7361 if (wand->debug != MagickFalse)
7362 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7363 if (wand->images == (Image *) NULL)
7364 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7365 status=NegateImageChannel(wand->images,channel,gray);
7366 if (status == MagickFalse)
7367 InheritException(wand->exception,&wand->images->exception);
7372 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7376 % M a g i c k N e w I m a g e %
7380 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7382 % MagickNewImage() adds a blank image canvas of the specified size and
7383 % background color to the wand.
7385 % The format of the MagickNewImage method is:
7387 % MagickBooleanType MagickNewImage(MagickWand *wand,
7388 % const size_t columns,const size_t rows,
7389 % const PixelWand *background)
7391 % A description of each parameter follows:
7393 % o wand: the magick wand.
7395 % o width: the image width.
7397 % o height: the image height.
7399 % o background: the image color.
7402 WandExport MagickBooleanType MagickNewImage(MagickWand *wand,
7403 const size_t width,const size_t height,
7404 const PixelWand *background)
7412 assert(wand != (MagickWand *) NULL);
7413 assert(wand->signature == WandSignature);
7414 if (wand->debug != MagickFalse)
7415 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7416 PixelGetMagickColor(background,&pixel);
7417 images=NewMagickImage(wand->image_info,width,height,&pixel);
7418 if (images == (Image *) NULL)
7419 return(MagickFalse);
7420 if (images->exception.severity != UndefinedException)
7421 InheritException(wand->exception,&images->exception);
7422 return(InsertImageInWand(wand,images));
7426 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7430 % M a g i c k N e x t I m a g e %
7434 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7436 % MagickNextImage() associates the next image in the image list with a magick
7439 % The format of the MagickNextImage method is:
7441 % MagickBooleanType MagickNextImage(MagickWand *wand)
7443 % A description of each parameter follows:
7445 % o wand: the magick wand.
7448 WandExport MagickBooleanType MagickNextImage(MagickWand *wand)
7450 assert(wand != (MagickWand *) NULL);
7451 assert(wand->signature == WandSignature);
7452 if (wand->debug != MagickFalse)
7453 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7454 if (wand->images == (Image *) NULL)
7455 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7456 if (wand->pend != MagickFalse)
7458 wand->pend=MagickFalse;
7461 if (GetNextImageInList(wand->images) == (Image *) NULL)
7463 wand->pend=MagickTrue;
7464 return(MagickFalse);
7466 wand->images=GetNextImageInList(wand->images);
7471 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7475 % M a g i c k N o r m a l i z e I m a g e %
7479 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7481 % MagickNormalizeImage() enhances the contrast of a color image by adjusting
7482 % the pixels color to span the entire range of colors available
7484 % You can also reduce the influence of a particular channel with a gamma
7487 % The format of the MagickNormalizeImage method is:
7489 % MagickBooleanType MagickNormalizeImage(MagickWand *wand)
7490 % MagickBooleanType MagickNormalizeImageChannel(MagickWand *wand,
7491 % const ChannelType channel)
7493 % A description of each parameter follows:
7495 % o wand: the magick wand.
7497 % o channel: the image channel(s).
7501 WandExport MagickBooleanType MagickNormalizeImage(MagickWand *wand)
7506 status=MagickNormalizeImageChannel(wand,DefaultChannels);
7510 WandExport MagickBooleanType MagickNormalizeImageChannel(MagickWand *wand,
7511 const ChannelType channel)
7516 assert(wand != (MagickWand *) NULL);
7517 assert(wand->signature == WandSignature);
7518 if (wand->debug != MagickFalse)
7519 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7520 if (wand->images == (Image *) NULL)
7521 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7522 status=NormalizeImageChannel(wand->images,channel);
7523 if (status == MagickFalse)
7524 InheritException(wand->exception,&wand->images->exception);
7529 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7533 % M a g i c k O i l P a i n t I m a g e %
7537 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7539 % MagickOilPaintImage() applies a special effect filter that simulates an oil
7540 % painting. Each pixel is replaced by the most frequent color occurring
7541 % in a circular region defined by radius.
7543 % The format of the MagickOilPaintImage method is:
7545 % MagickBooleanType MagickOilPaintImage(MagickWand *wand,
7546 % const double radius)
7548 % A description of each parameter follows:
7550 % o wand: the magick wand.
7552 % o radius: the radius of the circular neighborhood.
7555 WandExport MagickBooleanType MagickOilPaintImage(MagickWand *wand,
7556 const double radius)
7561 assert(wand != (MagickWand *) NULL);
7562 assert(wand->signature == WandSignature);
7563 if (wand->debug != MagickFalse)
7564 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7565 if (wand->images == (Image *) NULL)
7566 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7567 paint_image=OilPaintImage(wand->images,radius,wand->exception);
7568 if (paint_image == (Image *) NULL)
7569 return(MagickFalse);
7570 ReplaceImageInList(&wand->images,paint_image);
7575 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7579 % M a g i c k O p a q u e P a i n t I m a g e %
7583 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7585 % MagickOpaquePaintImage() changes any pixel that matches color with the color
7588 % The format of the MagickOpaquePaintImage method is:
7590 % MagickBooleanType MagickOpaquePaintImage(MagickWand *wand,
7591 % const PixelWand *target,const PixelWand *fill,const double fuzz,
7592 % const MagickBooleanType invert)
7593 % MagickBooleanType MagickOpaquePaintImageChannel(MagickWand *wand,
7594 % const ChannelType channel,const PixelWand *target,
7595 % const PixelWand *fill,const double fuzz,const MagickBooleanType invert)
7597 % A description of each parameter follows:
7599 % o wand: the magick wand.
7601 % o channel: the channel(s).
7603 % o target: Change this target color to the fill color within the image.
7605 % o fill: the fill pixel wand.
7607 % o fuzz: By default target must match a particular pixel color
7608 % exactly. However, in many cases two colors may differ by a small amount.
7609 % The fuzz member of image defines how much tolerance is acceptable to
7610 % consider two colors as the same. For example, set fuzz to 10 and the
7611 % color red at intensities of 100 and 102 respectively are now interpreted
7612 % as the same color for the purposes of the floodfill.
7614 % o invert: paint any pixel that does not match the target color.
7618 WandExport MagickBooleanType MagickOpaquePaintImage(MagickWand *wand,
7619 const PixelWand *target,const PixelWand *fill,const double fuzz,
7620 const MagickBooleanType invert)
7625 status=MagickOpaquePaintImageChannel(wand,DefaultChannels,target,fill,fuzz,
7630 WandExport MagickBooleanType MagickOpaquePaintImageChannel(MagickWand *wand,
7631 const ChannelType channel,const PixelWand *target,const PixelWand *fill,
7632 const double fuzz,const MagickBooleanType invert)
7641 assert(wand != (MagickWand *) NULL);
7642 assert(wand->signature == WandSignature);
7643 if (wand->debug != MagickFalse)
7644 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7645 if (wand->images == (Image *) NULL)
7646 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7647 PixelGetMagickColor(target,&target_pixel);
7648 PixelGetMagickColor(fill,&fill_pixel);
7649 wand->images->fuzz=fuzz;
7650 status=OpaquePaintImageChannel(wand->images,channel,&target_pixel,
7651 &fill_pixel,invert);
7652 if (status == MagickFalse)
7653 InheritException(wand->exception,&wand->images->exception);
7658 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7662 % 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 %
7666 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7668 % MagickOptimizeImageLayers() compares each image the GIF disposed forms of the
7669 % previous image in the sequence. From this it attempts to select the
7670 % smallest cropped image to replace each frame, while preserving the results
7673 % The format of the MagickOptimizeImageLayers method is:
7675 % MagickWand *MagickOptimizeImageLayers(MagickWand *wand)
7677 % A description of each parameter follows:
7679 % o wand: the magick wand.
7682 WandExport MagickWand *MagickOptimizeImageLayers(MagickWand *wand)
7687 assert(wand != (MagickWand *) NULL);
7688 assert(wand->signature == WandSignature);
7689 if (wand->debug != MagickFalse)
7690 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7691 if (wand->images == (Image *) NULL)
7692 return((MagickWand *) NULL);
7693 optimize_image=OptimizeImageLayers(wand->images,wand->exception);
7694 if (optimize_image == (Image *) NULL)
7695 return((MagickWand *) NULL);
7696 return(CloneMagickWandFromImages(wand,optimize_image));
7700 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7704 % 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 %
7708 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7710 % MagickOrderedPosterizeImage() performs an ordered dither based on a number
7711 % of pre-defined dithering threshold maps, but over multiple intensity levels,
7712 % which can be different for different channels, according to the input
7715 % The format of the MagickOrderedPosterizeImage method is:
7717 % MagickBooleanType MagickOrderedPosterizeImage(MagickWand *wand,
7718 % const char *threshold_map)
7719 % MagickBooleanType MagickOrderedPosterizeImageChannel(MagickWand *wand,
7720 % const ChannelType channel,const char *threshold_map)
7722 % A description of each parameter follows:
7724 % o image: the image.
7726 % o channel: the channel or channels to be thresholded.
7728 % o threshold_map: A string containing the name of the threshold dither
7729 % map to use, followed by zero or more numbers representing the number of
7730 % color levels tho dither between.
7732 % Any level number less than 2 is equivelent to 2, and means only binary
7733 % dithering will be applied to each color channel.
7735 % No numbers also means a 2 level (bitmap) dither will be applied to all
7736 % channels, while a single number is the number of levels applied to each
7737 % channel in sequence. More numbers will be applied in turn to each of
7738 % the color channels.
7740 % For example: "o3x3,6" generates a 6 level posterization of the image
7741 % with a ordered 3x3 diffused pixel dither being applied between each
7742 % level. While checker,8,8,4 will produce a 332 colormaped image with
7743 % only a single checkerboard hash pattern (50% grey) between each color
7744 % level, to basically double the number of color levels with a bare
7745 % minimim of dithering.
7749 WandExport MagickBooleanType MagickOrderedPosterizeImage(MagickWand *wand,
7750 const char *threshold_map)
7755 status=MagickOrderedPosterizeImageChannel(wand,DefaultChannels,threshold_map);
7759 WandExport MagickBooleanType MagickOrderedPosterizeImageChannel(
7760 MagickWand *wand,const ChannelType channel,const char *threshold_map)
7765 assert(wand != (MagickWand *) NULL);
7766 assert(wand->signature == WandSignature);
7767 if (wand->debug != MagickFalse)
7768 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7769 if (wand->images == (Image *) NULL)
7770 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7771 status=OrderedPosterizeImageChannel(wand->images,channel,threshold_map,
7777 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7781 % M a g i c k P i n g I m a g e %
7785 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7787 % MagickPingImage() is like MagickReadImage() except the only valid
7788 % information returned is the image width, height, size, and format. It
7789 % is designed to efficiently obtain this information from a file without
7790 % reading the entire image sequence into memory.
7792 % The format of the MagickPingImage method is:
7794 % MagickBooleanType MagickPingImage(MagickWand *wand,const char *filename)
7796 % A description of each parameter follows:
7798 % o wand: the magick wand.
7800 % o filename: the image filename.
7803 WandExport MagickBooleanType MagickPingImage(MagickWand *wand,
7804 const char *filename)
7812 assert(wand != (MagickWand *) NULL);
7813 assert(wand->signature == WandSignature);
7814 if (wand->debug != MagickFalse)
7815 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7816 ping_info=CloneImageInfo(wand->image_info);
7817 if (filename != (const char *) NULL)
7818 (void) CopyMagickString(ping_info->filename,filename,MaxTextExtent);
7819 images=PingImage(ping_info,wand->exception);
7820 ping_info=DestroyImageInfo(ping_info);
7821 if (images == (Image *) NULL)
7822 return(MagickFalse);
7823 return(InsertImageInWand(wand,images));
7827 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7831 % M a g i c k P i n g I m a g e B l o b %
7835 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7837 % MagickPingImageBlob() pings an image or image sequence from a blob.
7839 % The format of the MagickPingImageBlob method is:
7841 % MagickBooleanType MagickPingImageBlob(MagickWand *wand,
7842 % const void *blob,const size_t length)
7844 % A description of each parameter follows:
7846 % o wand: the magick wand.
7850 % o length: the blob length.
7853 WandExport MagickBooleanType MagickPingImageBlob(MagickWand *wand,
7854 const void *blob,const size_t length)
7862 assert(wand != (MagickWand *) NULL);
7863 assert(wand->signature == WandSignature);
7864 if (wand->debug != MagickFalse)
7865 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7866 read_info=CloneImageInfo(wand->image_info);
7867 SetImageInfoBlob(read_info,blob,length);
7868 images=PingImage(read_info,wand->exception);
7869 read_info=DestroyImageInfo(read_info);
7870 if (images == (Image *) NULL)
7871 return(MagickFalse);
7872 return(InsertImageInWand(wand,images));
7876 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7880 % M a g i c k P i n g I m a g e F i l e %
7884 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7886 % MagickPingImageFile() pings an image or image sequence from an open file
7889 % The format of the MagickPingImageFile method is:
7891 % MagickBooleanType MagickPingImageFile(MagickWand *wand,FILE *file)
7893 % A description of each parameter follows:
7895 % o wand: the magick wand.
7897 % o file: the file descriptor.
7900 WandExport MagickBooleanType MagickPingImageFile(MagickWand *wand,FILE *file)
7908 assert(wand != (MagickWand *) NULL);
7909 assert(wand->signature == WandSignature);
7910 assert(file != (FILE *) NULL);
7911 if (wand->debug != MagickFalse)
7912 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7913 read_info=CloneImageInfo(wand->image_info);
7914 SetImageInfoFile(read_info,file);
7915 images=PingImage(read_info,wand->exception);
7916 read_info=DestroyImageInfo(read_info);
7917 if (images == (Image *) NULL)
7918 return(MagickFalse);
7919 return(InsertImageInWand(wand,images));
7923 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7927 % M a g i c k P o l a r o i d I m a g e %
7931 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7933 % MagickPolaroidImage() simulates a Polaroid picture.
7935 % The format of the MagickPolaroidImage method is:
7937 % MagickBooleanType MagickPolaroidImage(MagickWand *wand,
7938 % const DrawingWand *drawing_wand,const double angle)
7940 % A description of each parameter follows:
7942 % o wand: the magick wand.
7944 % o drawing_wand: the draw wand.
7946 % o angle: Apply the effect along this angle.
7949 WandExport MagickBooleanType MagickPolaroidImage(MagickWand *wand,
7950 const DrawingWand *drawing_wand,const double angle)
7958 assert(wand != (MagickWand *) NULL);
7959 assert(wand->signature == WandSignature);
7960 if (wand->debug != MagickFalse)
7961 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7962 if (wand->images == (Image *) NULL)
7963 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7964 draw_info=PeekDrawingWand(drawing_wand);
7965 if (draw_info == (DrawInfo *) NULL)
7966 return(MagickFalse);
7967 polaroid_image=PolaroidImage(wand->images,draw_info,angle,wand->exception);
7968 if (polaroid_image == (Image *) NULL)
7969 return(MagickFalse);
7970 ReplaceImageInList(&wand->images,polaroid_image);
7975 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7979 % M a g i c k P o s t e r i z e I m a g e %
7983 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7985 % MagickPosterizeImage() reduces the image to a limited number of color level.
7987 % The format of the MagickPosterizeImage method is:
7989 % MagickBooleanType MagickPosterizeImage(MagickWand *wand,
7990 % const unsigned levels,const MagickBooleanType dither)
7992 % A description of each parameter follows:
7994 % o wand: the magick wand.
7996 % o levels: Number of color levels allowed in each channel. Very low values
7997 % (2, 3, or 4) have the most visible effect.
7999 % o dither: Set this integer value to something other than zero to dither
8003 WandExport MagickBooleanType MagickPosterizeImage(MagickWand *wand,
8004 const size_t levels,const MagickBooleanType dither)
8009 assert(wand != (MagickWand *) NULL);
8010 assert(wand->signature == WandSignature);
8011 if (wand->debug != MagickFalse)
8012 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8013 if (wand->images == (Image *) NULL)
8014 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8015 status=PosterizeImage(wand->images,levels,dither);
8016 if (status == MagickFalse)
8017 InheritException(wand->exception,&wand->images->exception);
8022 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8026 % M a g i c k P r e v i e w I m a g e s %
8030 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8032 % MagickPreviewImages() tiles 9 thumbnails of the specified image with an
8033 % image processing operation applied at varying strengths. This helpful
8034 % to quickly pin-point an appropriate parameter for an image processing
8037 % The format of the MagickPreviewImages method is:
8039 % MagickWand *MagickPreviewImages(MagickWand *wand,
8040 % const PreviewType preview)
8042 % A description of each parameter follows:
8044 % o wand: the magick wand.
8046 % o preview: the preview type.
8049 WandExport MagickWand *MagickPreviewImages(MagickWand *wand,
8050 const PreviewType preview)
8055 assert(wand != (MagickWand *) NULL);
8056 assert(wand->signature == WandSignature);
8057 if (wand->debug != MagickFalse)
8058 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8059 if (wand->images == (Image *) NULL)
8060 return((MagickWand *) NULL);
8061 preview_image=PreviewImage(wand->images,preview,wand->exception);
8062 if (preview_image == (Image *) NULL)
8063 return((MagickWand *) NULL);
8064 return(CloneMagickWandFromImages(wand,preview_image));
8068 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8072 % M a g i c k P r e v i o u s I m a g e %
8076 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8078 % MagickPreviousImage() assocates the previous image in an image list with
8081 % The format of the MagickPreviousImage method is:
8083 % MagickBooleanType MagickPreviousImage(MagickWand *wand)
8085 % A description of each parameter follows:
8087 % o wand: the magick wand.
8090 WandExport MagickBooleanType MagickPreviousImage(MagickWand *wand)
8092 assert(wand != (MagickWand *) NULL);
8093 assert(wand->signature == WandSignature);
8094 if (wand->debug != MagickFalse)
8095 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8096 if (wand->images == (Image *) NULL)
8097 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8098 if (wand->pend != MagickFalse)
8100 wand->pend=MagickFalse;
8103 if (GetPreviousImageInList(wand->images) == (Image *) NULL)
8105 wand->pend=MagickTrue;
8106 return(MagickFalse);
8108 wand->images=GetPreviousImageInList(wand->images);
8113 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8117 % M a g i c k Q u a n t i z e I m a g e %
8121 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8123 % MagickQuantizeImage() analyzes the colors within a reference image and
8124 % chooses a fixed number of colors to represent the image. The goal of the
8125 % algorithm is to minimize the color difference between the input and output
8126 % image while minimizing the processing time.
8128 % The format of the MagickQuantizeImage method is:
8130 % MagickBooleanType MagickQuantizeImage(MagickWand *wand,
8131 % const size_t number_colors,const ColorspaceType colorspace,
8132 % const size_t treedepth,const MagickBooleanType dither,
8133 % const MagickBooleanType measure_error)
8135 % A description of each parameter follows:
8137 % o wand: the magick wand.
8139 % o number_colors: the number of colors.
8141 % o colorspace: Perform color reduction in this colorspace, typically
8144 % o treedepth: Normally, this integer value is zero or one. A zero or
8145 % 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
8146 % reference image with the least amount of memory and the fastest
8147 % computational speed. In some cases, such as an image with low color
8148 % dispersion (a few number of colors), a value other than
8149 % Log4(number_colors) is required. To expand the color tree completely,
8152 % o dither: A value other than zero distributes the difference between an
8153 % original image and the corresponding color reduced image to
8154 % neighboring pixels along a Hilbert curve.
8156 % o measure_error: A value other than zero measures the difference between
8157 % the original and quantized images. This difference is the total
8158 % quantization error. The error is computed by summing over all pixels
8159 % in an image the distance squared in RGB space between each reference
8160 % pixel value and its quantized value.
8163 WandExport MagickBooleanType MagickQuantizeImage(MagickWand *wand,
8164 const size_t number_colors,const ColorspaceType colorspace,
8165 const size_t treedepth,const MagickBooleanType dither,
8166 const MagickBooleanType measure_error)
8174 assert(wand != (MagickWand *) NULL);
8175 assert(wand->signature == WandSignature);
8176 if (wand->debug != MagickFalse)
8177 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8178 if (wand->images == (Image *) NULL)
8179 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8180 quantize_info=CloneQuantizeInfo((QuantizeInfo *) NULL);
8181 quantize_info->number_colors=number_colors;
8182 quantize_info->dither=dither;
8183 quantize_info->tree_depth=treedepth;
8184 quantize_info->colorspace=colorspace;
8185 quantize_info->measure_error=measure_error;
8186 status=QuantizeImage(quantize_info,wand->images);
8187 if (status == MagickFalse)
8188 InheritException(wand->exception,&wand->images->exception);
8189 quantize_info=DestroyQuantizeInfo(quantize_info);
8194 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8198 % M a g i c k Q u a n t i z e I m a g e s %
8202 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8204 % MagickQuantizeImages() analyzes the colors within a sequence of images and
8205 % chooses a fixed number of colors to represent the image. The goal of the
8206 % algorithm is to minimize the color difference between the input and output
8207 % image while minimizing the processing time.
8209 % The format of the MagickQuantizeImages method is:
8211 % MagickBooleanType MagickQuantizeImages(MagickWand *wand,
8212 % const size_t number_colors,const ColorspaceType colorspace,
8213 % const size_t treedepth,const MagickBooleanType dither,
8214 % const MagickBooleanType measure_error)
8216 % A description of each parameter follows:
8218 % o wand: the magick wand.
8220 % o number_colors: the number of colors.
8222 % o colorspace: Perform color reduction in this colorspace, typically
8225 % o treedepth: Normally, this integer value is zero or one. A zero or
8226 % 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
8227 % reference image with the least amount of memory and the fastest
8228 % computational speed. In some cases, such as an image with low color
8229 % dispersion (a few number of colors), a value other than
8230 % Log4(number_colors) is required. To expand the color tree completely,
8233 % o dither: A value other than zero distributes the difference between an
8234 % original image and the corresponding color reduced algorithm to
8235 % neighboring pixels along a Hilbert curve.
8237 % o measure_error: A value other than zero measures the difference between
8238 % the original and quantized images. This difference is the total
8239 % quantization error. The error is computed by summing over all pixels
8240 % in an image the distance squared in RGB space between each reference
8241 % pixel value and its quantized value.
8244 WandExport MagickBooleanType MagickQuantizeImages(MagickWand *wand,
8245 const size_t number_colors,const ColorspaceType colorspace,
8246 const size_t treedepth,const MagickBooleanType dither,
8247 const MagickBooleanType measure_error)
8255 assert(wand != (MagickWand *) NULL);
8256 assert(wand->signature == WandSignature);
8257 if (wand->debug != MagickFalse)
8258 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8259 if (wand->images == (Image *) NULL)
8260 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8261 quantize_info=CloneQuantizeInfo((QuantizeInfo *) NULL);
8262 quantize_info->number_colors=number_colors;
8263 quantize_info->dither=dither;
8264 quantize_info->tree_depth=treedepth;
8265 quantize_info->colorspace=colorspace;
8266 quantize_info->measure_error=measure_error;
8267 status=QuantizeImages(quantize_info,wand->images);
8268 if (status == MagickFalse)
8269 InheritException(wand->exception,&wand->images->exception);
8270 quantize_info=DestroyQuantizeInfo(quantize_info);
8275 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8279 % M a g i c k R a d i a l B l u r I m a g e %
8283 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8285 % MagickRadialBlurImage() radial blurs an image.
8287 % The format of the MagickRadialBlurImage method is:
8289 % MagickBooleanType MagickRadialBlurImage(MagickWand *wand,
8290 % const double angle)
8291 % MagickBooleanType MagickRadialBlurImageChannel(MagickWand *wand,
8292 % const ChannelType channel,const double angle)
8294 % A description of each parameter follows:
8296 % o wand: the magick wand.
8298 % o channel: the image channel(s).
8300 % o angle: the angle of the blur in degrees.
8303 WandExport MagickBooleanType MagickRadialBlurImage(MagickWand *wand,
8309 status=MagickRadialBlurImageChannel(wand,DefaultChannels,angle);
8313 WandExport MagickBooleanType MagickRadialBlurImageChannel(MagickWand *wand,
8314 const ChannelType channel,const double angle)
8319 assert(wand != (MagickWand *) NULL);
8320 assert(wand->signature == WandSignature);
8321 if (wand->debug != MagickFalse)
8322 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8323 if (wand->images == (Image *) NULL)
8324 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8325 blur_image=RadialBlurImageChannel(wand->images,channel,angle,
8327 if (blur_image == (Image *) NULL)
8328 return(MagickFalse);
8329 ReplaceImageInList(&wand->images,blur_image);
8334 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8338 % M a g i c k R a i s e I m a g e %
8342 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8344 % MagickRaiseImage() creates a simulated three-dimensional button-like effect
8345 % by lightening and darkening the edges of the image. Members width and
8346 % height of raise_info define the width of the vertical and horizontal
8347 % edge of the effect.
8349 % The format of the MagickRaiseImage method is:
8351 % MagickBooleanType MagickRaiseImage(MagickWand *wand,
8352 % const size_t width,const size_t height,const ssize_t x,
8353 % const ssize_t y,const MagickBooleanType raise)
8355 % A description of each parameter follows:
8357 % o wand: the magick wand.
8359 % o width,height,x,y: Define the dimensions of the area to raise.
8361 % o raise: A value other than zero creates a 3-D raise effect,
8362 % otherwise it has a lowered effect.
8365 WandExport MagickBooleanType MagickRaiseImage(MagickWand *wand,
8366 const size_t width,const size_t height,const ssize_t x,
8367 const ssize_t y,const MagickBooleanType raise)
8375 assert(wand != (MagickWand *) NULL);
8376 assert(wand->signature == WandSignature);
8377 if (wand->debug != MagickFalse)
8378 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8379 if (wand->images == (Image *) NULL)
8380 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8381 raise_info.width=width;
8382 raise_info.height=height;
8385 status=RaiseImage(wand->images,&raise_info,raise);
8386 if (status == MagickFalse)
8387 InheritException(wand->exception,&wand->images->exception);
8392 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8396 % 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 %
8400 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8402 % MagickRandomThresholdImage() changes the value of individual pixels based on
8403 % the intensity of each pixel compared to threshold. The result is a
8404 % high-contrast, two color image.
8406 % The format of the MagickRandomThresholdImage method is:
8408 % MagickBooleanType MagickRandomThresholdImage(MagickWand *wand,
8409 % const double low,const double high)
8410 % MagickBooleanType MagickRandomThresholdImageChannel(MagickWand *wand,
8411 % const ChannelType channel,const double low,const double high)
8413 % A description of each parameter follows:
8415 % o wand: the magick wand.
8417 % o channel: the image channel(s).
8419 % o low,high: Specify the high and low thresholds. These values range from
8420 % 0 to QuantumRange.
8424 WandExport MagickBooleanType MagickRandomThresholdImage(MagickWand *wand,
8425 const double low,const double high)
8430 status=MagickRandomThresholdImageChannel(wand,DefaultChannels,low,high);
8434 WandExport MagickBooleanType MagickRandomThresholdImageChannel(
8435 MagickWand *wand,const ChannelType channel,const double low,
8439 threshold[MaxTextExtent];
8444 assert(wand != (MagickWand *) NULL);
8445 assert(wand->signature == WandSignature);
8446 if (wand->debug != MagickFalse)
8447 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8448 if (wand->images == (Image *) NULL)
8449 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8450 (void) FormatMagickString(threshold,MaxTextExtent,"%gx%g",low,high);
8451 status=RandomThresholdImageChannel(wand->images,channel,threshold,
8453 if (status == MagickFalse)
8454 InheritException(wand->exception,&wand->images->exception);
8459 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8463 % M a g i c k R e a d I m a g e %
8467 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8469 % MagickReadImage() reads an image or image sequence. The images are inserted
8470 % at the current image pointer position. Use MagickSetFirstIterator(),
8471 % MagickSetLastIterator, or MagickSetImageIndex() to specify the current
8472 % image pointer position at the beginning of the image list, the end, or
8473 % anywhere in-between respectively.
8475 % The format of the MagickReadImage method is:
8477 % MagickBooleanType MagickReadImage(MagickWand *wand,const char *filename)
8479 % A description of each parameter follows:
8481 % o wand: the magick wand.
8483 % o filename: the image filename.
8486 WandExport MagickBooleanType MagickReadImage(MagickWand *wand,
8487 const char *filename)
8495 assert(wand != (MagickWand *) NULL);
8496 assert(wand->signature == WandSignature);
8497 if (wand->debug != MagickFalse)
8498 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8499 read_info=CloneImageInfo(wand->image_info);
8500 if (filename != (const char *) NULL)
8501 (void) CopyMagickString(read_info->filename,filename,MaxTextExtent);
8502 images=ReadImage(read_info,wand->exception);
8503 read_info=DestroyImageInfo(read_info);
8504 if (images == (Image *) NULL)
8505 return(MagickFalse);
8506 return(InsertImageInWand(wand,images));
8510 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8514 % M a g i c k R e a d I m a g e B l o b %
8518 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8520 % MagickReadImageBlob() reads an image or image sequence from a blob.
8522 % The format of the MagickReadImageBlob method is:
8524 % MagickBooleanType MagickReadImageBlob(MagickWand *wand,
8525 % const void *blob,const size_t length)
8527 % A description of each parameter follows:
8529 % o wand: the magick wand.
8533 % o length: the blob length.
8536 WandExport MagickBooleanType MagickReadImageBlob(MagickWand *wand,
8537 const void *blob,const size_t length)
8542 assert(wand != (MagickWand *) NULL);
8543 assert(wand->signature == WandSignature);
8544 if (wand->debug != MagickFalse)
8545 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8546 images=BlobToImage(wand->image_info,blob,length,wand->exception);
8547 if (images == (Image *) NULL)
8548 return(MagickFalse);
8549 return(InsertImageInWand(wand,images));
8553 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8557 % M a g i c k R e a d I m a g e F i l e %
8561 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8563 % MagickReadImageFile() reads an image or image sequence from an open file
8566 % The format of the MagickReadImageFile method is:
8568 % MagickBooleanType MagickReadImageFile(MagickWand *wand,FILE *file)
8570 % A description of each parameter follows:
8572 % o wand: the magick wand.
8574 % o file: the file descriptor.
8577 WandExport MagickBooleanType MagickReadImageFile(MagickWand *wand,FILE *file)
8585 assert(wand != (MagickWand *) NULL);
8586 assert(wand->signature == WandSignature);
8587 assert(file != (FILE *) NULL);
8588 if (wand->debug != MagickFalse)
8589 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8590 read_info=CloneImageInfo(wand->image_info);
8591 SetImageInfoFile(read_info,file);
8592 images=ReadImage(read_info,wand->exception);
8593 read_info=DestroyImageInfo(read_info);
8594 if (images == (Image *) NULL)
8595 return(MagickFalse);
8596 return(InsertImageInWand(wand,images));
8600 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8604 % M a g i c k R e d u c e N o i s e I m a g e %
8608 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8610 % MagickReduceNoiseImage() smooths the contours of an image while still
8611 % preserving edge information. The algorithm works by replacing each pixel
8612 % with its neighbor closest in value. A neighbor is defined by radius. Use
8613 % a radius of 0 and ReduceNoise() selects a suitable radius for you.
8615 % The format of the MagickReduceNoiseImage method is:
8617 % MagickBooleanType MagickReduceNoiseImage(MagickWand *wand,
8618 % const double radius)
8620 % A description of each parameter follows:
8622 % o wand: the magick wand.
8624 % o radius: the radius of the pixel neighborhood.
8627 WandExport MagickBooleanType MagickReduceNoiseImage(MagickWand *wand,
8628 const double radius)
8633 assert(wand != (MagickWand *) NULL);
8634 assert(wand->signature == WandSignature);
8635 if (wand->debug != MagickFalse)
8636 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8637 if (wand->images == (Image *) NULL)
8638 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8639 noise_image=ReduceNoiseImage(wand->images,radius,wand->exception);
8640 if (noise_image == (Image *) NULL)
8641 return(MagickFalse);
8642 ReplaceImageInList(&wand->images,noise_image);
8647 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8651 % M a g i c k R e m a p I m a g e %
8655 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8657 % MagickRemapImage() replaces the colors of an image with the closest color
8658 % from a reference image.
8660 % The format of the MagickRemapImage method is:
8662 % MagickBooleanType MagickRemapImage(MagickWand *wand,
8663 % const MagickWand *remap_wand,const DitherMethod method)
8665 % A description of each parameter follows:
8667 % o wand: the magick wand.
8669 % o affinity: the affinity wand.
8671 % o method: choose from these dither methods: NoDitherMethod,
8672 % RiemersmaDitherMethod, or FloydSteinbergDitherMethod.
8675 WandExport MagickBooleanType MagickRemapImage(MagickWand *wand,
8676 const MagickWand *remap_wand,const DitherMethod method)
8684 assert(wand != (MagickWand *) NULL);
8685 assert(wand->signature == WandSignature);
8686 if (wand->debug != MagickFalse)
8687 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8688 if ((wand->images == (Image *) NULL) ||
8689 (remap_wand->images == (Image *) NULL))
8690 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8691 quantize_info=AcquireQuantizeInfo(wand->image_info);
8692 quantize_info->dither_method=method;
8693 if (method == NoDitherMethod)
8694 quantize_info->dither=MagickFalse;
8695 status=RemapImage(quantize_info,wand->images,remap_wand->images);
8696 quantize_info=DestroyQuantizeInfo(quantize_info);
8697 if (status == MagickFalse)
8698 InheritException(wand->exception,&wand->images->exception);
8703 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8707 % M a g i c k R e m o v e I m a g e %
8711 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8713 % MagickRemoveImage() removes an image from the image list.
8715 % The format of the MagickRemoveImage method is:
8717 % MagickBooleanType MagickRemoveImage(MagickWand *wand)
8719 % A description of each parameter follows:
8721 % o wand: the magick wand.
8723 % o insert: the splice wand.
8726 WandExport MagickBooleanType MagickRemoveImage(MagickWand *wand)
8728 assert(wand != (MagickWand *) NULL);
8729 assert(wand->signature == WandSignature);
8730 if (wand->debug != MagickFalse)
8731 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8732 if (wand->images == (Image *) NULL)
8733 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8734 DeleteImageFromList(&wand->images);
8739 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8743 % M a g i c k R e s a m p l e I m a g e %
8747 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8749 % MagickResampleImage() resample image to desired resolution.
8751 % Bessel Blackman Box
8752 % Catrom Cubic Gaussian
8753 % Hanning Hermite Lanczos
8754 % Mitchell Point Quandratic
8757 % Most of the filters are FIR (finite impulse response), however, Bessel,
8758 % Gaussian, and Sinc are IIR (infinite impulse response). Bessel and Sinc
8759 % are windowed (brought down to zero) with the Blackman filter.
8761 % The format of the MagickResampleImage method is:
8763 % MagickBooleanType MagickResampleImage(MagickWand *wand,
8764 % const double x_resolution,const double y_resolution,
8765 % const FilterTypes filter,const double blur)
8767 % A description of each parameter follows:
8769 % o wand: the magick wand.
8771 % o x_resolution: the new image x resolution.
8773 % o y_resolution: the new image y resolution.
8775 % o filter: Image filter to use.
8777 % o blur: the blur factor where > 1 is blurry, < 1 is sharp.
8780 WandExport MagickBooleanType MagickResampleImage(MagickWand *wand,
8781 const double x_resolution,const double y_resolution,const FilterTypes filter,
8787 assert(wand != (MagickWand *) NULL);
8788 assert(wand->signature == WandSignature);
8789 if (wand->debug != MagickFalse)
8790 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8791 if (wand->images == (Image *) NULL)
8792 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8793 resample_image=ResampleImage(wand->images,x_resolution,y_resolution,filter,
8794 blur,wand->exception);
8795 if (resample_image == (Image *) NULL)
8796 return(MagickFalse);
8797 ReplaceImageInList(&wand->images,resample_image);
8802 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8806 % M a g i c k R e s e t I m a g e P a g e %
8810 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8812 % MagickResetImagePage() resets the Wand page canvas and position.
8814 % The format of the MagickResetImagePage method is:
8816 % MagickBooleanType MagickResetImagePage(MagickWand *wand,
8819 % A description of each parameter follows:
8821 % o wand: the magick wand.
8823 % o page: the relative page specification.
8826 WandExport MagickBooleanType MagickResetImagePage(MagickWand *wand,
8829 assert(wand != (MagickWand *) NULL);
8830 assert(wand->signature == WandSignature);
8831 if (wand->debug != MagickFalse)
8832 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8833 if (wand->images == (Image *) NULL)
8834 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8835 if ((page == (char *) NULL) || (*page == '\0'))
8837 (void) ParseAbsoluteGeometry("0x0+0+0",&wand->images->page);
8840 return(ResetImagePage(wand->images,page));
8844 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8848 % M a g i c k R e s i z e I m a g e %
8852 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8854 % MagickResizeImage() scales an image to the desired dimensions with one of
8857 % Bessel Blackman Box
8858 % Catrom Cubic Gaussian
8859 % Hanning Hermite Lanczos
8860 % Mitchell Point Quandratic
8863 % Most of the filters are FIR (finite impulse response), however, Bessel,
8864 % Gaussian, and Sinc are IIR (infinite impulse response). Bessel and Sinc
8865 % are windowed (brought down to zero) with the Blackman filter.
8867 % The format of the MagickResizeImage method is:
8869 % MagickBooleanType MagickResizeImage(MagickWand *wand,
8870 % const size_t columns,const size_t rows,
8871 % const FilterTypes filter,const double blur)
8873 % A description of each parameter follows:
8875 % o wand: the magick wand.
8877 % o columns: the number of columns in the scaled image.
8879 % o rows: the number of rows in the scaled image.
8881 % o filter: Image filter to use.
8883 % o blur: the blur factor where > 1 is blurry, < 1 is sharp.
8886 WandExport MagickBooleanType MagickResizeImage(MagickWand *wand,
8887 const size_t columns,const size_t rows,const FilterTypes filter,
8893 assert(wand != (MagickWand *) NULL);
8894 assert(wand->signature == WandSignature);
8895 if (wand->debug != MagickFalse)
8896 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8897 if (wand->images == (Image *) NULL)
8898 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8899 resize_image=ResizeImage(wand->images,columns,rows,filter,blur,
8901 if (resize_image == (Image *) NULL)
8902 return(MagickFalse);
8903 ReplaceImageInList(&wand->images,resize_image);
8908 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8912 % M a g i c k R o l l I m a g e %
8916 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8918 % MagickRollImage() offsets an image as defined by x and y.
8920 % The format of the MagickRollImage method is:
8922 % MagickBooleanType MagickRollImage(MagickWand *wand,const ssize_t x,
8925 % A description of each parameter follows:
8927 % o wand: the magick wand.
8929 % o x: the x offset.
8931 % o y: the y offset.
8935 WandExport MagickBooleanType MagickRollImage(MagickWand *wand,
8936 const ssize_t x,const ssize_t y)
8941 assert(wand != (MagickWand *) NULL);
8942 assert(wand->signature == WandSignature);
8943 if (wand->debug != MagickFalse)
8944 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8945 if (wand->images == (Image *) NULL)
8946 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8947 roll_image=RollImage(wand->images,x,y,wand->exception);
8948 if (roll_image == (Image *) NULL)
8949 return(MagickFalse);
8950 ReplaceImageInList(&wand->images,roll_image);
8955 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8959 % M a g i c k R o t a t e I m a g e %
8963 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8965 % MagickRotateImage() rotates an image the specified number of degrees. Empty
8966 % triangles left over from rotating the image are filled with the
8969 % The format of the MagickRotateImage method is:
8971 % MagickBooleanType MagickRotateImage(MagickWand *wand,
8972 % const PixelWand *background,const double degrees)
8974 % A description of each parameter follows:
8976 % o wand: the magick wand.
8978 % o background: the background pixel wand.
8980 % o degrees: the number of degrees to rotate the image.
8984 WandExport MagickBooleanType MagickRotateImage(MagickWand *wand,
8985 const PixelWand *background,const double degrees)
8990 assert(wand != (MagickWand *) NULL);
8991 assert(wand->signature == WandSignature);
8992 if (wand->debug != MagickFalse)
8993 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8994 if (wand->images == (Image *) NULL)
8995 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8996 PixelGetQuantumColor(background,&wand->images->background_color);
8997 rotate_image=RotateImage(wand->images,degrees,wand->exception);
8998 if (rotate_image == (Image *) NULL)
8999 return(MagickFalse);
9000 ReplaceImageInList(&wand->images,rotate_image);
9005 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9009 % M a g i c k S a m p l e I m a g e %
9013 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9015 % MagickSampleImage() scales an image to the desired dimensions with pixel
9016 % sampling. Unlike other scaling methods, this method does not introduce
9017 % any additional color into the scaled image.
9019 % The format of the MagickSampleImage method is:
9021 % MagickBooleanType MagickSampleImage(MagickWand *wand,
9022 % const size_t columns,const size_t rows)
9024 % A description of each parameter follows:
9026 % o wand: the magick wand.
9028 % o columns: the number of columns in the scaled image.
9030 % o rows: the number of rows in the scaled image.
9034 WandExport MagickBooleanType MagickSampleImage(MagickWand *wand,
9035 const size_t columns,const size_t rows)
9040 assert(wand != (MagickWand *) NULL);
9041 assert(wand->signature == WandSignature);
9042 if (wand->debug != MagickFalse)
9043 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9044 if (wand->images == (Image *) NULL)
9045 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9046 sample_image=SampleImage(wand->images,columns,rows,wand->exception);
9047 if (sample_image == (Image *) NULL)
9048 return(MagickFalse);
9049 ReplaceImageInList(&wand->images,sample_image);
9054 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9058 % M a g i c k S c a l e I m a g e %
9062 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9064 % MagickScaleImage() scales the size of an image to the given dimensions.
9066 % The format of the MagickScaleImage method is:
9068 % MagickBooleanType MagickScaleImage(MagickWand *wand,
9069 % const size_t columns,const size_t rows)
9071 % A description of each parameter follows:
9073 % o wand: the magick wand.
9075 % o columns: the number of columns in the scaled image.
9077 % o rows: the number of rows in the scaled image.
9081 WandExport MagickBooleanType MagickScaleImage(MagickWand *wand,
9082 const size_t columns,const size_t rows)
9087 assert(wand != (MagickWand *) NULL);
9088 assert(wand->signature == WandSignature);
9089 if (wand->debug != MagickFalse)
9090 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9091 if (wand->images == (Image *) NULL)
9092 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9093 scale_image=ScaleImage(wand->images,columns,rows,wand->exception);
9094 if (scale_image == (Image *) NULL)
9095 return(MagickFalse);
9096 ReplaceImageInList(&wand->images,scale_image);
9101 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9105 % M a g i c k S e g m e n t I m a g e %
9109 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9111 % MagickSegmentImage() segments an image by analyzing the histograms of the
9112 % color components and identifying units that are homogeneous with the fuzzy
9113 % C-means technique.
9115 % The format of the SegmentImage method is:
9117 % MagickBooleanType MagickSegmentImage(MagickWand *wand,
9118 % const ColorspaceType colorspace,const MagickBooleanType verbose,
9119 % const double cluster_threshold,const double smooth_threshold)
9121 % A description of each parameter follows.
9125 % o colorspace: the image colorspace.
9127 % o verbose: Set to MagickTrue to print detailed information about the
9128 % identified classes.
9130 % o cluster_threshold: This represents the minimum number of pixels
9131 % contained in a hexahedra before it can be considered valid (expressed as
9134 % o smooth_threshold: the smoothing threshold eliminates noise in the second
9135 % derivative of the histogram. As the value is increased, you can expect a
9136 % smoother second derivative.
9139 MagickExport MagickBooleanType MagickSegmentImage(MagickWand *wand,
9140 const ColorspaceType colorspace,const MagickBooleanType verbose,
9141 const double cluster_threshold,const double smooth_threshold)
9146 assert(wand != (MagickWand *) NULL);
9147 assert(wand->signature == WandSignature);
9148 if (wand->debug != MagickFalse)
9149 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9150 if (wand->images == (Image *) NULL)
9151 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9152 status=SegmentImage(wand->images,colorspace,verbose,cluster_threshold,
9154 if (status == MagickFalse)
9155 InheritException(wand->exception,&wand->images->exception);
9160 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9164 % M a g i c k S e l e c t i v e B l u r I m a g e %
9168 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9170 % MagickSelectiveBlurImage() selectively blur an image within a contrast
9171 % threshold. It is similar to the unsharpen mask that sharpens everything with
9172 % contrast above a certain threshold.
9174 % The format of the MagickSelectiveBlurImage method is:
9176 % MagickBooleanType MagickSelectiveBlurImage(MagickWand *wand,
9177 % const double radius,const double sigma,const double threshold)
9178 % MagickBooleanType MagickSelectiveBlurImageChannel(MagickWand *wand,
9179 % const ChannelType channel,const double radius,const double sigma,
9180 % const double threshold)
9182 % A description of each parameter follows:
9184 % o wand: the magick wand.
9186 % o channel: the image channel(s).
9188 % o radius: the radius of the gaussian, in pixels, not counting the center
9191 % o sigma: the standard deviation of the gaussian, in pixels.
9193 % o threshold: only pixels within this contrast threshold are included
9194 % in the blur operation.
9198 WandExport MagickBooleanType MagickSelectiveBlurImage(MagickWand *wand,
9199 const double radius,const double sigma,const double threshold)
9204 status=MagickSelectiveBlurImageChannel(wand,DefaultChannels,radius,sigma,
9209 WandExport MagickBooleanType MagickSelectiveBlurImageChannel(MagickWand *wand,
9210 const ChannelType channel,const double radius,const double sigma,
9211 const double threshold)
9216 assert(wand != (MagickWand *) NULL);
9217 assert(wand->signature == WandSignature);
9218 if (wand->debug != MagickFalse)
9219 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9220 if (wand->images == (Image *) NULL)
9221 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9222 blur_image=SelectiveBlurImageChannel(wand->images,channel,radius,sigma,
9223 threshold,wand->exception);
9224 if (blur_image == (Image *) NULL)
9225 return(MagickFalse);
9226 ReplaceImageInList(&wand->images,blur_image);
9231 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9235 % 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 %
9239 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9241 % MagickSeparateImageChannel() separates a channel from the image and returns a
9242 % grayscale image. A channel is a particular color component of each pixel
9245 % The format of the MagickSeparateImageChannel method is:
9247 % MagickBooleanType MagickSeparateImageChannel(MagickWand *wand,
9248 % const ChannelType channel)
9250 % A description of each parameter follows:
9252 % o wand: the magick wand.
9254 % o channel: the image channel(s).
9257 WandExport MagickBooleanType MagickSeparateImageChannel(MagickWand *wand,
9258 const ChannelType channel)
9263 assert(wand != (MagickWand *) NULL);
9264 assert(wand->signature == WandSignature);
9265 if (wand->debug != MagickFalse)
9266 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9267 if (wand->images == (Image *) NULL)
9268 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9269 status=SeparateImageChannel(wand->images,channel);
9270 if (status == MagickFalse)
9271 InheritException(wand->exception,&wand->images->exception);
9276 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9280 % M a g i c k S e p i a T o n e I m a g e %
9284 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9286 % MagickSepiaToneImage() applies a special effect to the image, similar to the
9287 % effect achieved in a photo darkroom by sepia toning. Threshold ranges from
9288 % 0 to QuantumRange and is a measure of the extent of the sepia toning. A
9289 % threshold of 80% is a good starting point for a reasonable tone.
9291 % The format of the MagickSepiaToneImage method is:
9293 % MagickBooleanType MagickSepiaToneImage(MagickWand *wand,
9294 % const double threshold)
9296 % A description of each parameter follows:
9298 % o wand: the magick wand.
9300 % o threshold: Define the extent of the sepia toning.
9303 WandExport MagickBooleanType MagickSepiaToneImage(MagickWand *wand,
9304 const double threshold)
9309 assert(wand != (MagickWand *) NULL);
9310 assert(wand->signature == WandSignature);
9311 if (wand->debug != MagickFalse)
9312 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9313 if (wand->images == (Image *) NULL)
9314 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9315 sepia_image=SepiaToneImage(wand->images,threshold,wand->exception);
9316 if (sepia_image == (Image *) NULL)
9317 return(MagickFalse);
9318 ReplaceImageInList(&wand->images,sepia_image);
9323 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9327 % M a g i c k S e t I m a g e %
9331 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9333 % MagickSetImage() replaces the last image returned by MagickSetImageIndex(),
9334 % MagickNextImage(), MagickPreviousImage() with the images from the specified
9337 % The format of the MagickSetImage method is:
9339 % MagickBooleanType MagickSetImage(MagickWand *wand,
9340 % const MagickWand *set_wand)
9342 % A description of each parameter follows:
9344 % o wand: the magick wand.
9346 % o set_wand: the set_wand wand.
9349 WandExport MagickBooleanType MagickSetImage(MagickWand *wand,
9350 const MagickWand *set_wand)
9355 assert(wand != (MagickWand *) NULL);
9356 assert(wand->signature == WandSignature);
9357 if (wand->debug != MagickFalse)
9358 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9359 assert(set_wand != (MagickWand *) NULL);
9360 assert(set_wand->signature == WandSignature);
9361 if (wand->debug != MagickFalse)
9362 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",set_wand->name);
9363 if (set_wand->images == (Image *) NULL)
9364 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9365 images=CloneImageList(set_wand->images,wand->exception);
9366 if (images == (Image *) NULL)
9367 return(MagickFalse);
9368 ReplaceImageInList(&wand->images,images);
9373 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9377 % 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 %
9381 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9383 % MagickSetImageAlphaChannel() activates, deactivates, resets, or sets the
9386 % The format of the MagickSetImageAlphaChannel method is:
9388 % MagickBooleanType MagickSetImageAlphaChannel(MagickWand *wand,
9389 % const AlphaChannelType alpha_type)
9391 % A description of each parameter follows:
9393 % o wand: the magick wand.
9395 % o alpha_type: the alpha channel type: ActivateAlphaChannel,
9396 % DeactivateAlphaChannel, OpaqueAlphaChannel, or SetAlphaChannel.
9399 WandExport MagickBooleanType MagickSetImageAlphaChannel(MagickWand *wand,
9400 const AlphaChannelType alpha_type)
9402 assert(wand != (MagickWand *) NULL);
9403 assert(wand->signature == WandSignature);
9404 if (wand->debug != MagickFalse)
9405 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9406 if (wand->images == (Image *) NULL)
9407 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9408 return(SetImageAlphaChannel(wand->images,alpha_type));
9412 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9416 % 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 %
9420 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9422 % MagickSetImageBackgroundColor() sets the image background color.
9424 % The format of the MagickSetImageBackgroundColor method is:
9426 % MagickBooleanType MagickSetImageBackgroundColor(MagickWand *wand,
9427 % const PixelWand *background)
9429 % A description of each parameter follows:
9431 % o wand: the magick wand.
9433 % o background: the background pixel wand.
9436 WandExport MagickBooleanType MagickSetImageBackgroundColor(MagickWand *wand,
9437 const PixelWand *background)
9439 assert(wand != (MagickWand *) NULL);
9440 assert(wand->signature == WandSignature);
9441 if (wand->debug != MagickFalse)
9442 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9443 if (wand->images == (Image *) NULL)
9444 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9445 PixelGetQuantumColor(background,&wand->images->background_color);
9450 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9454 % M a g i c k S e t I m a g e B i a s %
9458 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9460 % MagickSetImageBias() sets the image bias for any method that convolves an
9461 % image (e.g. MagickConvolveImage()).
9463 % The format of the MagickSetImageBias method is:
9465 % MagickBooleanType MagickSetImageBias(MagickWand *wand,
9466 % const double bias)
9468 % A description of each parameter follows:
9470 % o wand: the magick wand.
9472 % o bias: the image bias.
9475 WandExport MagickBooleanType MagickSetImageBias(MagickWand *wand,
9478 assert(wand != (MagickWand *) NULL);
9479 assert(wand->signature == WandSignature);
9480 if (wand->debug != MagickFalse)
9481 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9482 if (wand->images == (Image *) NULL)
9483 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9484 wand->images->bias=bias;
9489 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9493 % 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 %
9497 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9499 % MagickSetImageBluePrimary() sets the image chromaticity blue primary point.
9501 % The format of the MagickSetImageBluePrimary method is:
9503 % MagickBooleanType MagickSetImageBluePrimary(MagickWand *wand,
9504 % const double x,const double y)
9506 % A description of each parameter follows:
9508 % o wand: the magick wand.
9510 % o x: the blue primary x-point.
9512 % o y: the blue primary y-point.
9515 WandExport MagickBooleanType MagickSetImageBluePrimary(MagickWand *wand,
9516 const double x,const double y)
9518 assert(wand != (MagickWand *) NULL);
9519 assert(wand->signature == WandSignature);
9520 if (wand->debug != MagickFalse)
9521 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9522 if (wand->images == (Image *) NULL)
9523 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9524 wand->images->chromaticity.blue_primary.x=x;
9525 wand->images->chromaticity.blue_primary.y=y;
9530 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9534 % 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 %
9538 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9540 % MagickSetImageBorderColor() sets the image border color.
9542 % The format of the MagickSetImageBorderColor method is:
9544 % MagickBooleanType MagickSetImageBorderColor(MagickWand *wand,
9545 % const PixelWand *border)
9547 % A description of each parameter follows:
9549 % o wand: the magick wand.
9551 % o border: the border pixel wand.
9554 WandExport MagickBooleanType MagickSetImageBorderColor(MagickWand *wand,
9555 const PixelWand *border)
9557 assert(wand != (MagickWand *) NULL);
9558 assert(wand->signature == WandSignature);
9559 if (wand->debug != MagickFalse)
9560 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9561 if (wand->images == (Image *) NULL)
9562 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9563 PixelGetQuantumColor(border,&wand->images->border_color);
9568 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9572 % 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 %
9576 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9578 % MagickSetImageChannelDepth() sets the depth of a particular image channel.
9580 % The format of the MagickSetImageChannelDepth method is:
9582 % MagickBooleanType MagickSetImageChannelDepth(MagickWand *wand,
9583 % const ChannelType channel,const size_t depth)
9585 % A description of each parameter follows:
9587 % o wand: the magick wand.
9589 % o channel: the image channel(s).
9591 % o depth: the image depth in bits.
9594 WandExport MagickBooleanType MagickSetImageChannelDepth(MagickWand *wand,
9595 const ChannelType channel,const size_t depth)
9597 assert(wand != (MagickWand *) NULL);
9598 assert(wand->signature == WandSignature);
9599 if (wand->debug != MagickFalse)
9600 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9601 if (wand->images == (Image *) NULL)
9602 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9603 return(SetImageChannelDepth(wand->images,channel,depth));
9607 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9611 % M a g i c k S e t I m a g e C l i p M a s k %
9615 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9617 % MagickSetImageClipMask() sets image clip mask.
9619 % The format of the MagickSetImageClipMask method is:
9621 % MagickBooleanType MagickSetImageClipMask(MagickWand *wand,
9622 % const MagickWand *clip_mask)
9624 % A description of each parameter follows:
9626 % o wand: the magick wand.
9628 % o clip_mask: the clip_mask wand.
9631 WandExport MagickBooleanType MagickSetImageClipMask(MagickWand *wand,
9632 const MagickWand *clip_mask)
9634 assert(wand != (MagickWand *) NULL);
9635 assert(wand->signature == WandSignature);
9636 if (wand->debug != MagickFalse)
9637 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9638 assert(clip_mask != (MagickWand *) NULL);
9639 assert(clip_mask->signature == WandSignature);
9640 if (wand->debug != MagickFalse)
9641 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",clip_mask->name);
9642 if (clip_mask->images == (Image *) NULL)
9643 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9644 return(SetImageClipMask(wand->images,clip_mask->images));
9648 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9652 % M a g i c k S e t I m a g e C o l o r %
9656 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9658 % MagickSetImageColor() set the entire wand canvas to the specified color.
9660 % The format of the MagickSetImageColor method is:
9662 % MagickBooleanType MagickSetImageColor(MagickWand *wand,
9663 % const PixelWand *color)
9665 % A description of each parameter follows:
9667 % o wand: the magick wand.
9669 % o background: the image color.
9672 WandExport MagickBooleanType MagickSetImageColor(MagickWand *wand,
9673 const PixelWand *color)
9681 assert(wand != (MagickWand *) NULL);
9682 assert(wand->signature == WandSignature);
9683 if (wand->debug != MagickFalse)
9684 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9685 PixelGetMagickColor(color,&pixel);
9686 status=SetImageColor(wand->images,&pixel);
9687 if (status == MagickFalse)
9688 InheritException(wand->exception,&wand->images->exception);
9693 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9697 % 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 %
9701 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9703 % MagickSetImageColormapColor() sets the color of the specified colormap
9706 % The format of the MagickSetImageColormapColor method is:
9708 % MagickBooleanType MagickSetImageColormapColor(MagickWand *wand,
9709 % const size_t index,const PixelWand *color)
9711 % A description of each parameter follows:
9713 % o wand: the magick wand.
9715 % o index: the offset into the image colormap.
9717 % o color: Return the colormap color in this wand.
9720 WandExport MagickBooleanType MagickSetImageColormapColor(MagickWand *wand,
9721 const size_t index,const PixelWand *color)
9723 assert(wand != (MagickWand *) NULL);
9724 assert(wand->signature == WandSignature);
9725 if (wand->debug != MagickFalse)
9726 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9727 if (wand->images == (Image *) NULL)
9728 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9729 if ((wand->images->colormap == (PixelPacket *) NULL) ||
9730 (index >= wand->images->colors))
9731 ThrowWandException(WandError,"InvalidColormapIndex",wand->name);
9732 PixelGetQuantumColor(color,wand->images->colormap+index);
9733 return(SyncImage(wand->images));
9737 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9741 % M a g i c k S e t I m a g e C o l o r s p a c e %
9745 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9747 % MagickSetImageColorspace() sets the image colorspace.
9749 % The format of the MagickSetImageColorspace method is:
9751 % MagickBooleanType MagickSetImageColorspace(MagickWand *wand,
9752 % const ColorspaceType colorspace)
9754 % A description of each parameter follows:
9756 % o wand: the magick wand.
9758 % o colorspace: the image colorspace: UndefinedColorspace, RGBColorspace,
9759 % GRAYColorspace, TransparentColorspace, OHTAColorspace, XYZColorspace,
9760 % YCbCrColorspace, YCCColorspace, YIQColorspace, YPbPrColorspace,
9761 % YPbPrColorspace, YUVColorspace, CMYKColorspace, sRGBColorspace,
9762 % HSLColorspace, or HWBColorspace.
9765 WandExport MagickBooleanType MagickSetImageColorspace(MagickWand *wand,
9766 const ColorspaceType colorspace)
9768 assert(wand != (MagickWand *) NULL);
9769 assert(wand->signature == WandSignature);
9770 if (wand->debug != MagickFalse)
9771 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9772 if (wand->images == (Image *) NULL)
9773 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9774 return(SetImageColorspace(wand->images,colorspace));
9778 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9782 % M a g i c k S e t I m a g e C o m p o s e %
9786 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9788 % MagickSetImageCompose() sets the image composite operator, useful for
9789 % specifying how to composite the image thumbnail when using the
9790 % MagickMontageImage() method.
9792 % The format of the MagickSetImageCompose method is:
9794 % MagickBooleanType MagickSetImageCompose(MagickWand *wand,
9795 % const CompositeOperator compose)
9797 % A description of each parameter follows:
9799 % o wand: the magick wand.
9801 % o compose: the image composite operator.
9804 WandExport MagickBooleanType MagickSetImageCompose(MagickWand *wand,
9805 const CompositeOperator compose)
9807 assert(wand != (MagickWand *) NULL);
9808 assert(wand->signature == WandSignature);
9809 if (wand->debug != MagickFalse)
9810 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9811 if (wand->images == (Image *) NULL)
9812 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9813 wand->images->compose=compose;
9818 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9822 % 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 %
9826 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9828 % MagickSetImageCompression() sets the image compression.
9830 % The format of the MagickSetImageCompression method is:
9832 % MagickBooleanType MagickSetImageCompression(MagickWand *wand,
9833 % const CompressionType compression)
9835 % A description of each parameter follows:
9837 % o wand: the magick wand.
9839 % o compression: the image compression type.
9842 WandExport MagickBooleanType MagickSetImageCompression(MagickWand *wand,
9843 const CompressionType compression)
9845 assert(wand != (MagickWand *) NULL);
9846 assert(wand->signature == WandSignature);
9847 if (wand->debug != MagickFalse)
9848 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9849 if (wand->images == (Image *) NULL)
9850 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9851 wand->images->compression=compression;
9856 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9860 % 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 %
9864 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9866 % MagickSetImageCompressionQuality() sets the image compression quality.
9868 % The format of the MagickSetImageCompressionQuality method is:
9870 % MagickBooleanType MagickSetImageCompressionQuality(MagickWand *wand,
9871 % const size_t quality)
9873 % A description of each parameter follows:
9875 % o wand: the magick wand.
9877 % o quality: the image compression tlityype.
9880 WandExport MagickBooleanType MagickSetImageCompressionQuality(MagickWand *wand,
9881 const size_t quality)
9883 assert(wand != (MagickWand *) NULL);
9884 assert(wand->signature == WandSignature);
9885 if (wand->debug != MagickFalse)
9886 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9887 if (wand->images == (Image *) NULL)
9888 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9889 wand->images->quality=quality;
9894 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9898 % M a g i c k S e t I m a g e D e l a y %
9902 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9904 % MagickSetImageDelay() sets the image delay.
9906 % The format of the MagickSetImageDelay method is:
9908 % MagickBooleanType MagickSetImageDelay(MagickWand *wand,
9909 % const size_t delay)
9911 % A description of each parameter follows:
9913 % o wand: the magick wand.
9915 % o delay: the image delay in ticks-per-second units.
9918 WandExport MagickBooleanType MagickSetImageDelay(MagickWand *wand,
9921 assert(wand != (MagickWand *) NULL);
9922 assert(wand->signature == WandSignature);
9923 if (wand->debug != MagickFalse)
9924 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9925 if (wand->images == (Image *) NULL)
9926 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9927 wand->images->delay=delay;
9932 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9936 % M a g i c k S e t I m a g e D e p t h %
9940 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9942 % MagickSetImageDepth() sets the image depth.
9944 % The format of the MagickSetImageDepth method is:
9946 % MagickBooleanType MagickSetImageDepth(MagickWand *wand,
9947 % const size_t depth)
9949 % A description of each parameter follows:
9951 % o wand: the magick wand.
9953 % o depth: the image depth in bits: 8, 16, or 32.
9956 WandExport MagickBooleanType MagickSetImageDepth(MagickWand *wand,
9959 assert(wand != (MagickWand *) NULL);
9960 assert(wand->signature == WandSignature);
9961 if (wand->debug != MagickFalse)
9962 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9963 if (wand->images == (Image *) NULL)
9964 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9965 wand->images->depth=depth;
9970 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9974 % M a g i c k S e t I m a g e D i s p o s e %
9978 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9980 % MagickSetImageDispose() sets the image disposal method.
9982 % The format of the MagickSetImageDispose method is:
9984 % MagickBooleanType MagickSetImageDispose(MagickWand *wand,
9985 % const DisposeType dispose)
9987 % A description of each parameter follows:
9989 % o wand: the magick wand.
9991 % o dispose: the image disposeal type.
9994 WandExport MagickBooleanType MagickSetImageDispose(MagickWand *wand,
9995 const DisposeType dispose)
9997 assert(wand != (MagickWand *) NULL);
9998 assert(wand->signature == WandSignature);
9999 if (wand->debug != MagickFalse)
10000 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10001 if (wand->images == (Image *) NULL)
10002 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10003 wand->images->dispose=dispose;
10004 return(MagickTrue);
10008 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10012 % M a g i c k S e t I m a g e E x t e n t %
10016 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10018 % MagickSetImageExtent() sets the image size (i.e. columns & rows).
10020 % The format of the MagickSetImageExtent method is:
10022 % MagickBooleanType MagickSetImageExtent(MagickWand *wand,
10023 % const size_t columns,const unsigned rows)
10025 % A description of each parameter follows:
10027 % o wand: the magick wand.
10029 % o columns: The image width in pixels.
10031 % o rows: The image height in pixels.
10034 WandExport MagickBooleanType MagickSetImageExtent(MagickWand *wand,
10035 const size_t columns,const size_t rows)
10037 assert(wand != (MagickWand *) NULL);
10038 assert(wand->signature == WandSignature);
10039 if (wand->debug != MagickFalse)
10040 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10041 if (wand->images == (Image *) NULL)
10042 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10043 return(SetImageExtent(wand->images,columns,rows));
10047 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10051 % M a g i c k S e t I m a g e F i l e n a m e %
10055 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10057 % MagickSetImageFilename() sets the filename of a particular image in a
10060 % The format of the MagickSetImageFilename method is:
10062 % MagickBooleanType MagickSetImageFilename(MagickWand *wand,
10063 % const char *filename)
10065 % A description of each parameter follows:
10067 % o wand: the magick wand.
10069 % o filename: the image filename.
10072 WandExport MagickBooleanType MagickSetImageFilename(MagickWand *wand,
10073 const char *filename)
10075 assert(wand != (MagickWand *) NULL);
10076 assert(wand->signature == WandSignature);
10077 if (wand->debug != MagickFalse)
10078 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10079 if (wand->images == (Image *) NULL)
10080 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10081 if (filename != (const char *) NULL)
10082 (void) CopyMagickString(wand->images->filename,filename,MaxTextExtent);
10083 return(MagickTrue);
10087 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10091 % M a g i c k S e t I m a g e F o r m a t %
10095 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10097 % MagickSetImageFormat() sets the format of a particular image in a
10100 % The format of the MagickSetImageFormat method is:
10102 % MagickBooleanType MagickSetImageFormat(MagickWand *wand,
10103 % const char *format)
10105 % A description of each parameter follows:
10107 % o wand: the magick wand.
10109 % o format: the image format.
10112 WandExport MagickBooleanType MagickSetImageFormat(MagickWand *wand,
10113 const char *format)
10118 assert(wand != (MagickWand *) NULL);
10119 assert(wand->signature == WandSignature);
10120 if (wand->debug != MagickFalse)
10121 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10122 if (wand->images == (Image *) NULL)
10123 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10124 if ((format == (char *) NULL) || (*format == '\0'))
10126 *wand->images->magick='\0';
10127 return(MagickTrue);
10129 magick_info=GetMagickInfo(format,wand->exception);
10130 if (magick_info == (const MagickInfo *) NULL)
10131 return(MagickFalse);
10132 ClearMagickException(wand->exception);
10133 (void) CopyMagickString(wand->images->magick,format,MaxTextExtent);
10134 return(MagickTrue);
10138 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10142 % M a g i c k S e t I m a g e F u z z %
10146 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10148 % MagickSetImageFuzz() sets the image fuzz.
10150 % The format of the MagickSetImageFuzz method is:
10152 % MagickBooleanType MagickSetImageFuzz(MagickWand *wand,
10153 % const double fuzz)
10155 % A description of each parameter follows:
10157 % o wand: the magick wand.
10159 % o fuzz: the image fuzz.
10162 WandExport MagickBooleanType MagickSetImageFuzz(MagickWand *wand,
10165 assert(wand != (MagickWand *) NULL);
10166 assert(wand->signature == WandSignature);
10167 if (wand->debug != MagickFalse)
10168 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10169 if (wand->images == (Image *) NULL)
10170 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10171 wand->images->fuzz=fuzz;
10172 return(MagickTrue);
10176 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10180 % M a g i c k S e t I m a g e G a m m a %
10184 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10186 % MagickSetImageGamma() sets the image gamma.
10188 % The format of the MagickSetImageGamma method is:
10190 % MagickBooleanType MagickSetImageGamma(MagickWand *wand,
10191 % const double gamma)
10193 % A description of each parameter follows:
10195 % o wand: the magick wand.
10197 % o gamma: the image gamma.
10200 WandExport MagickBooleanType MagickSetImageGamma(MagickWand *wand,
10201 const double gamma)
10203 assert(wand != (MagickWand *) NULL);
10204 assert(wand->signature == WandSignature);
10205 if (wand->debug != MagickFalse)
10206 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10207 if (wand->images == (Image *) NULL)
10208 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10209 wand->images->gamma=gamma;
10210 return(MagickTrue);
10214 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10218 % M a g i c k S e t I m a g e G r a v i t y %
10222 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10224 % MagickSetImageGravity() sets the image gravity type.
10226 % The format of the MagickSetImageGravity method is:
10228 % MagickBooleanType MagickSetImageGravity(MagickWand *wand,
10229 % const GravityType gravity)
10231 % A description of each parameter follows:
10233 % o wand: the magick wand.
10235 % o gravity: the image interlace scheme: NoInterlace, LineInterlace,
10236 % PlaneInterlace, PartitionInterlace.
10239 WandExport MagickBooleanType MagickSetImageGravity(MagickWand *wand,
10240 const GravityType gravity)
10242 assert(wand != (MagickWand *) NULL);
10243 assert(wand->signature == WandSignature);
10244 if (wand->debug != MagickFalse)
10245 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10246 if (wand->images == (Image *) NULL)
10247 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10248 wand->images->gravity=gravity;
10249 return(MagickTrue);
10253 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10257 % 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 %
10261 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10263 % MagickSetImageGreenPrimary() sets the image chromaticity green primary
10266 % The format of the MagickSetImageGreenPrimary method is:
10268 % MagickBooleanType MagickSetImageGreenPrimary(MagickWand *wand,
10269 % const double x,const double y)
10271 % A description of each parameter follows:
10273 % o wand: the magick wand.
10275 % o x: the green primary x-point.
10277 % o y: the green primary y-point.
10281 WandExport MagickBooleanType MagickSetImageGreenPrimary(MagickWand *wand,
10282 const double x,const double y)
10284 assert(wand != (MagickWand *) NULL);
10285 assert(wand->signature == WandSignature);
10286 if (wand->debug != MagickFalse)
10287 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10288 if (wand->images == (Image *) NULL)
10289 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10290 wand->images->chromaticity.green_primary.x=x;
10291 wand->images->chromaticity.green_primary.y=y;
10292 return(MagickTrue);
10296 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10300 % 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 %
10304 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10306 % MagickSetImageInterlaceScheme() sets the image interlace scheme.
10308 % The format of the MagickSetImageInterlaceScheme method is:
10310 % MagickBooleanType MagickSetImageInterlaceScheme(MagickWand *wand,
10311 % const InterlaceType interlace)
10313 % A description of each parameter follows:
10315 % o wand: the magick wand.
10317 % o interlace: the image interlace scheme: NoInterlace, LineInterlace,
10318 % PlaneInterlace, PartitionInterlace.
10321 WandExport MagickBooleanType MagickSetImageInterlaceScheme(MagickWand *wand,
10322 const InterlaceType interlace)
10324 assert(wand != (MagickWand *) NULL);
10325 assert(wand->signature == WandSignature);
10326 if (wand->debug != MagickFalse)
10327 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10328 if (wand->images == (Image *) NULL)
10329 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10330 wand->images->interlace=interlace;
10331 return(MagickTrue);
10335 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10339 % 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 %
10343 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10345 % MagickSetImageInterpolateMethod() sets the image interpolate pixel method.
10347 % The format of the MagickSetImageInterpolateMethod method is:
10349 % MagickBooleanType MagickSetImageInterpolateMethod(MagickWand *wand,
10350 % const InterpolatePixelMethod method)
10352 % A description of each parameter follows:
10354 % o wand: the magick wand.
10356 % o method: the image interpole pixel methods: choose from Undefined,
10357 % Average, Bicubic, Bilinear, Filter, Integer, Mesh, NearestNeighbor.
10360 WandExport MagickBooleanType MagickSetImageInterpolateMethod(MagickWand *wand,
10361 const InterpolatePixelMethod method)
10363 assert(wand != (MagickWand *) NULL);
10364 assert(wand->signature == WandSignature);
10365 if (wand->debug != MagickFalse)
10366 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10367 if (wand->images == (Image *) NULL)
10368 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10369 wand->images->interpolate=method;
10370 return(MagickTrue);
10374 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10378 % M a g i c k S e t I m a g e I t e r a t i o n s %
10382 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10384 % MagickSetImageIterations() sets the image iterations.
10386 % The format of the MagickSetImageIterations method is:
10388 % MagickBooleanType MagickSetImageIterations(MagickWand *wand,
10389 % const size_t iterations)
10391 % A description of each parameter follows:
10393 % o wand: the magick wand.
10395 % o delay: the image delay in 1/100th of a second.
10398 WandExport MagickBooleanType MagickSetImageIterations(MagickWand *wand,
10399 const size_t iterations)
10401 assert(wand != (MagickWand *) NULL);
10402 assert(wand->signature == WandSignature);
10403 if (wand->debug != MagickFalse)
10404 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10405 if (wand->images == (Image *) NULL)
10406 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10407 wand->images->iterations=iterations;
10408 return(MagickTrue);
10412 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10416 % M a g i c k S e t I m a g e M a t t e %
10420 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10422 % MagickSetImageMatte() sets the image matte channel.
10424 % The format of the MagickSetImageMatteColor method is:
10426 % MagickBooleanType MagickSetImageMatteColor(MagickWand *wand,
10427 % const MagickBooleanType *matte)
10429 % A description of each parameter follows:
10431 % o wand: the magick wand.
10433 % o matte: Set to MagickTrue to enable the image matte channel otherwise
10437 WandExport MagickBooleanType MagickSetImageMatte(MagickWand *wand,
10438 const MagickBooleanType matte)
10440 assert(wand != (MagickWand *) NULL);
10441 assert(wand->signature == WandSignature);
10442 if (wand->debug != MagickFalse)
10443 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10444 if (wand->images == (Image *) NULL)
10445 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10446 if ((wand->images->matte == MagickFalse) && (matte != MagickFalse))
10447 (void) SetImageOpacity(wand->images,OpaqueOpacity);
10448 wand->images->matte=matte;
10449 return(MagickTrue);
10453 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10457 % M a g i c k S e t I m a g e M a t t e C o l o r %
10461 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10463 % MagickSetImageMatteColor() sets the image matte color.
10465 % The format of the MagickSetImageMatteColor method is:
10467 % MagickBooleanType MagickSetImageMatteColor(MagickWand *wand,
10468 % const PixelWand *matte)
10470 % A description of each parameter follows:
10472 % o wand: the magick wand.
10474 % o matte: the matte pixel wand.
10477 WandExport MagickBooleanType MagickSetImageMatteColor(MagickWand *wand,
10478 const PixelWand *matte)
10480 assert(wand != (MagickWand *) NULL);
10481 assert(wand->signature == WandSignature);
10482 if (wand->debug != MagickFalse)
10483 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10484 if (wand->images == (Image *) NULL)
10485 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10486 PixelGetQuantumColor(matte,&wand->images->matte_color);
10487 return(MagickTrue);
10491 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10495 % M a g i c k S e t I m a g e O p a c i t y %
10499 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10501 % MagickSetImageOpacity() sets the image to the specified opacity level.
10503 % The format of the MagickSetImageOpacity method is:
10505 % MagickBooleanType MagickSetImageOpacity(MagickWand *wand,
10506 % const double alpha)
10508 % A description of each parameter follows:
10510 % o wand: the magick wand.
10512 % o alpha: the level of transparency: 1.0 is fully opaque and 0.0 is fully
10516 WandExport MagickBooleanType MagickSetImageOpacity(MagickWand *wand,
10517 const double alpha)
10522 assert(wand != (MagickWand *) NULL);
10523 assert(wand->signature == WandSignature);
10524 if (wand->debug != MagickFalse)
10525 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10526 if (wand->images == (Image *) NULL)
10527 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10528 status=SetImageOpacity(wand->images,ClampToQuantum((MagickRealType)
10529 QuantumRange-QuantumRange*alpha));
10530 if (status == MagickFalse)
10531 InheritException(wand->exception,&wand->images->exception);
10536 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10540 % 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 %
10544 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10546 % MagickSetImageOrientation() sets the image orientation.
10548 % The format of the MagickSetImageOrientation method is:
10550 % MagickBooleanType MagickSetImageOrientation(MagickWand *wand,
10551 % const OrientationType orientation)
10553 % A description of each parameter follows:
10555 % o wand: the magick wand.
10557 % o orientation: the image orientation type.
10560 WandExport MagickBooleanType MagickSetImageOrientation(MagickWand *wand,
10561 const OrientationType orientation)
10563 assert(wand != (MagickWand *) NULL);
10564 assert(wand->signature == WandSignature);
10565 if (wand->debug != MagickFalse)
10566 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10567 if (wand->images == (Image *) NULL)
10568 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10569 wand->images->orientation=orientation;
10570 return(MagickTrue);
10574 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10578 % M a g i c k S e t I m a g e P a g e %
10582 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10584 % MagickSetImagePage() sets the page geometry of the image.
10586 % The format of the MagickSetImagePage method is:
10588 % MagickBooleanType MagickSetImagePage(MagickWand *wand,
10589 % const size_t width,const size_t height,const ssize_t x,
10592 % A description of each parameter follows:
10594 % o wand: the magick wand.
10596 % o width: the page width.
10598 % o height: the page height.
10600 % o x: the page x-offset.
10602 % o y: the page y-offset.
10605 WandExport MagickBooleanType MagickSetImagePage(MagickWand *wand,
10606 const size_t width,const size_t height,const ssize_t x,
10609 assert(wand != (MagickWand *) NULL);
10610 assert(wand->signature == WandSignature);
10611 if (wand->debug != MagickFalse)
10612 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10613 if (wand->images == (Image *) NULL)
10614 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10615 wand->images->page.width=width;
10616 wand->images->page.height=height;
10617 wand->images->page.x=x;
10618 wand->images->page.y=y;
10619 return(MagickTrue);
10623 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10627 % 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 %
10631 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10633 % MagickSetImageProgressMonitor() sets the wand image progress monitor to the
10634 % specified method and returns the previous progress monitor if any. The
10635 % progress monitor method looks like this:
10637 % MagickBooleanType MagickProgressMonitor(const char *text,
10638 % const MagickOffsetType offset,const MagickSizeType span,
10639 % void *client_data)
10641 % If the progress monitor returns MagickFalse, the current operation is
10644 % The format of the MagickSetImageProgressMonitor method is:
10646 % MagickProgressMonitor MagickSetImageProgressMonitor(MagickWand *wand
10647 % const MagickProgressMonitor progress_monitor,void *client_data)
10649 % A description of each parameter follows:
10651 % o wand: the magick wand.
10653 % o progress_monitor: Specifies a pointer to a method to monitor progress
10654 % of an image operation.
10656 % o client_data: Specifies a pointer to any client data.
10659 WandExport MagickProgressMonitor MagickSetImageProgressMonitor(MagickWand *wand,
10660 const MagickProgressMonitor progress_monitor,void *client_data)
10662 MagickProgressMonitor
10665 assert(wand != (MagickWand *) NULL);
10666 assert(wand->signature == WandSignature);
10667 if (wand->debug != MagickFalse)
10668 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10669 if (wand->images == (Image *) NULL)
10671 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
10672 "ContainsNoImages","`%s'",wand->name);
10673 return((MagickProgressMonitor) NULL);
10675 previous_monitor=SetImageProgressMonitor(wand->images,
10676 progress_monitor,client_data);
10677 return(previous_monitor);
10681 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10685 % M a g i c k S e t I m a g e R e d P r i m a r y %
10689 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10691 % MagickSetImageRedPrimary() sets the image chromaticity red primary point.
10693 % The format of the MagickSetImageRedPrimary method is:
10695 % MagickBooleanType MagickSetImageRedPrimary(MagickWand *wand,
10696 % const double x,const double y)
10698 % A description of each parameter follows:
10700 % o wand: the magick wand.
10702 % o x: the red primary x-point.
10704 % o y: the red primary y-point.
10707 WandExport MagickBooleanType MagickSetImageRedPrimary(MagickWand *wand,
10708 const double x,const double y)
10710 assert(wand != (MagickWand *) NULL);
10711 assert(wand->signature == WandSignature);
10712 if (wand->debug != MagickFalse)
10713 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10714 if (wand->images == (Image *) NULL)
10715 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10716 wand->images->chromaticity.red_primary.x=x;
10717 wand->images->chromaticity.red_primary.y=y;
10718 return(MagickTrue);
10722 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10726 % 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 %
10730 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10732 % MagickSetImageRenderingIntent() sets the image rendering intent.
10734 % The format of the MagickSetImageRenderingIntent method is:
10736 % MagickBooleanType MagickSetImageRenderingIntent(MagickWand *wand,
10737 % const RenderingIntent rendering_intent)
10739 % A description of each parameter follows:
10741 % o wand: the magick wand.
10743 % o rendering_intent: the image rendering intent: UndefinedIntent,
10744 % SaturationIntent, PerceptualIntent, AbsoluteIntent, or RelativeIntent.
10747 WandExport MagickBooleanType MagickSetImageRenderingIntent(MagickWand *wand,
10748 const RenderingIntent rendering_intent)
10750 assert(wand != (MagickWand *) NULL);
10751 assert(wand->signature == WandSignature);
10752 if (wand->debug != MagickFalse)
10753 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10754 if (wand->images == (Image *) NULL)
10755 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10756 wand->images->rendering_intent=rendering_intent;
10757 return(MagickTrue);
10761 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10765 % M a g i c k S e t I m a g e R e s o l u t i o n %
10769 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10771 % MagickSetImageResolution() sets the image resolution.
10773 % The format of the MagickSetImageResolution method is:
10775 % MagickBooleanType MagickSetImageResolution(MagickWand *wand,
10776 % const double x_resolution,const doubtl y_resolution)
10778 % A description of each parameter follows:
10780 % o wand: the magick wand.
10782 % o x_resolution: the image x resolution.
10784 % o y_resolution: the image y resolution.
10787 WandExport MagickBooleanType MagickSetImageResolution(MagickWand *wand,
10788 const double x_resolution,const double y_resolution)
10790 assert(wand != (MagickWand *) NULL);
10791 assert(wand->signature == WandSignature);
10792 if (wand->debug != MagickFalse)
10793 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10794 if (wand->images == (Image *) NULL)
10795 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10796 wand->images->x_resolution=x_resolution;
10797 wand->images->y_resolution=y_resolution;
10798 return(MagickTrue);
10802 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10806 % M a g i c k S e t I m a g e S c e n e %
10810 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10812 % MagickSetImageScene() sets the image scene.
10814 % The format of the MagickSetImageScene method is:
10816 % MagickBooleanType MagickSetImageScene(MagickWand *wand,
10817 % const size_t scene)
10819 % A description of each parameter follows:
10821 % o wand: the magick wand.
10823 % o delay: the image scene number.
10826 WandExport MagickBooleanType MagickSetImageScene(MagickWand *wand,
10827 const size_t scene)
10829 assert(wand != (MagickWand *) NULL);
10830 assert(wand->signature == WandSignature);
10831 if (wand->debug != MagickFalse)
10832 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10833 if (wand->images == (Image *) NULL)
10834 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10835 wand->images->scene=scene;
10836 return(MagickTrue);
10840 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10844 % 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 %
10848 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10850 % MagickSetImageTicksPerSecond() sets the image ticks-per-second.
10852 % The format of the MagickSetImageTicksPerSecond method is:
10854 % MagickBooleanType MagickSetImageTicksPerSecond(MagickWand *wand,
10855 % const ssize_t ticks_per-second)
10857 % A description of each parameter follows:
10859 % o wand: the magick wand.
10861 % o ticks_per_second: the units to use for the image delay.
10864 WandExport MagickBooleanType MagickSetImageTicksPerSecond(MagickWand *wand,
10865 const ssize_t ticks_per_second)
10867 assert(wand != (MagickWand *) NULL);
10868 assert(wand->signature == WandSignature);
10869 if (wand->debug != MagickFalse)
10870 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10871 if (wand->images == (Image *) NULL)
10872 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10873 wand->images->ticks_per_second=ticks_per_second;
10874 return(MagickTrue);
10878 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10882 % M a g i c k S e t I m a g e T y p e %
10886 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10888 % MagickSetImageType() sets the image type.
10890 % The format of the MagickSetImageType method is:
10892 % MagickBooleanType MagickSetImageType(MagickWand *wand,
10893 % const ImageType image_type)
10895 % A description of each parameter follows:
10897 % o wand: the magick wand.
10899 % o image_type: the image type: UndefinedType, BilevelType, GrayscaleType,
10900 % GrayscaleMatteType, PaletteType, PaletteMatteType, TrueColorType,
10901 % TrueColorMatteType, ColorSeparationType, ColorSeparationMatteType,
10905 WandExport MagickBooleanType MagickSetImageType(MagickWand *wand,
10906 const ImageType image_type)
10908 assert(wand != (MagickWand *) NULL);
10909 assert(wand->signature == WandSignature);
10910 if (wand->debug != MagickFalse)
10911 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10912 if (wand->images == (Image *) NULL)
10913 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10914 return(SetImageType(wand->images,image_type));
10918 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10922 % M a g i c k S e t I m a g e U n i t s %
10926 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10928 % MagickSetImageUnits() sets the image units of resolution.
10930 % The format of the MagickSetImageUnits method is:
10932 % MagickBooleanType MagickSetImageUnits(MagickWand *wand,
10933 % const ResolutionType units)
10935 % A description of each parameter follows:
10937 % o wand: the magick wand.
10939 % o units: the image units of resolution : UndefinedResolution,
10940 % PixelsPerInchResolution, or PixelsPerCentimeterResolution.
10943 WandExport MagickBooleanType MagickSetImageUnits(MagickWand *wand,
10944 const ResolutionType units)
10946 assert(wand != (MagickWand *) NULL);
10947 assert(wand->signature == WandSignature);
10948 if (wand->debug != MagickFalse)
10949 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10950 if (wand->images == (Image *) NULL)
10951 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10952 wand->images->units=units;
10953 return(MagickTrue);
10957 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10961 % 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 %
10965 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10967 % MagickSetImageVirtualPixelMethod() sets the image virtual pixel method.
10969 % The format of the MagickSetImageVirtualPixelMethod method is:
10971 % VirtualPixelMethod MagickSetImageVirtualPixelMethod(MagickWand *wand,
10972 % const VirtualPixelMethod method)
10974 % A description of each parameter follows:
10976 % o wand: the magick wand.
10978 % o method: the image virtual pixel method : UndefinedVirtualPixelMethod,
10979 % ConstantVirtualPixelMethod, EdgeVirtualPixelMethod,
10980 % MirrorVirtualPixelMethod, or TileVirtualPixelMethod.
10983 WandExport VirtualPixelMethod MagickSetImageVirtualPixelMethod(MagickWand *wand,
10984 const VirtualPixelMethod method)
10986 assert(wand != (MagickWand *) NULL);
10987 assert(wand->signature == WandSignature);
10988 if (wand->debug != MagickFalse)
10989 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10990 if (wand->images == (Image *) NULL)
10991 return(UndefinedVirtualPixelMethod);
10992 return(SetImageVirtualPixelMethod(wand->images,method));
10996 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11000 % M a g i c k S e t I m a g e W h i t e P o i n t %
11004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11006 % MagickSetImageWhitePoint() sets the image chromaticity white point.
11008 % The format of the MagickSetImageWhitePoint method is:
11010 % MagickBooleanType MagickSetImageWhitePoint(MagickWand *wand,
11011 % const double x,const double y)
11013 % A description of each parameter follows:
11015 % o wand: the magick wand.
11017 % o x: the white x-point.
11019 % o y: the white y-point.
11022 WandExport MagickBooleanType MagickSetImageWhitePoint(MagickWand *wand,
11023 const double x,const double y)
11025 assert(wand != (MagickWand *) NULL);
11026 assert(wand->signature == WandSignature);
11027 if (wand->debug != MagickFalse)
11028 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11029 if (wand->images == (Image *) NULL)
11030 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11031 wand->images->chromaticity.white_point.x=x;
11032 wand->images->chromaticity.white_point.y=y;
11033 return(MagickTrue);
11037 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11041 % M a g i c k S h a d e I m a g e C h a n n e l %
11045 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11047 % MagickShadeImage() shines a distant light on an image to create a
11048 % three-dimensional effect. You control the positioning of the light with
11049 % azimuth and elevation; azimuth is measured in degrees off the x axis
11050 % and elevation is measured in pixels above the Z axis.
11052 % The format of the MagickShadeImage method is:
11054 % MagickBooleanType MagickShadeImage(MagickWand *wand,
11055 % const MagickBooleanType gray,const double azimuth,
11056 % const double elevation)
11058 % A description of each parameter follows:
11060 % o wand: the magick wand.
11062 % o gray: A value other than zero shades the intensity of each pixel.
11064 % o azimuth, elevation: Define the light source direction.
11067 WandExport MagickBooleanType MagickShadeImage(MagickWand *wand,
11068 const MagickBooleanType gray,const double asimuth,const double elevation)
11073 assert(wand != (MagickWand *) NULL);
11074 assert(wand->signature == WandSignature);
11075 if (wand->debug != MagickFalse)
11076 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11077 if (wand->images == (Image *) NULL)
11078 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11079 shade_image=ShadeImage(wand->images,gray,asimuth,elevation,wand->exception);
11080 if (shade_image == (Image *) NULL)
11081 return(MagickFalse);
11082 ReplaceImageInList(&wand->images,shade_image);
11083 return(MagickTrue);
11087 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11091 % M a g i c k S h a d o w I m a g e %
11095 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11097 % MagickShadowImage() simulates an image shadow.
11099 % The format of the MagickShadowImage method is:
11101 % MagickBooleanType MagickShadowImage(MagickWand *wand,
11102 % const double opacity,const double sigma,const ssize_t x,const ssize_t y)
11104 % A description of each parameter follows:
11106 % o wand: the magick wand.
11108 % o opacity: percentage transparency.
11110 % o sigma: the standard deviation of the Gaussian, in pixels.
11112 % o x: the shadow x-offset.
11114 % o y: the shadow y-offset.
11117 WandExport MagickBooleanType MagickShadowImage(MagickWand *wand,
11118 const double opacity,const double sigma,const ssize_t x,const ssize_t y)
11123 assert(wand != (MagickWand *) NULL);
11124 assert(wand->signature == WandSignature);
11125 if (wand->debug != MagickFalse)
11126 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11127 if (wand->images == (Image *) NULL)
11128 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11129 shadow_image=ShadowImage(wand->images,opacity,sigma,x,y,wand->exception);
11130 if (shadow_image == (Image *) NULL)
11131 return(MagickFalse);
11132 ReplaceImageInList(&wand->images,shadow_image);
11133 return(MagickTrue);
11137 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11141 % M a g i c k S h a r p e n I m a g e %
11145 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11147 % MagickSharpenImage() sharpens an image. We convolve the image with a
11148 % Gaussian operator of the given radius and standard deviation (sigma).
11149 % For reasonable results, the radius should be larger than sigma. Use a
11150 % radius of 0 and MagickSharpenImage() selects a suitable radius for you.
11152 % The format of the MagickSharpenImage method is:
11154 % MagickBooleanType MagickSharpenImage(MagickWand *wand,
11155 % const double radius,const double sigma)
11156 % MagickBooleanType MagickSharpenImageChannel(MagickWand *wand,
11157 % const ChannelType channel,const double radius,const double sigma)
11159 % A description of each parameter follows:
11161 % o wand: the magick wand.
11163 % o channel: the image channel(s).
11165 % o radius: the radius of the Gaussian, in pixels, not counting the center
11168 % o sigma: the standard deviation of the Gaussian, in pixels.
11172 WandExport MagickBooleanType MagickSharpenImage(MagickWand *wand,
11173 const double radius,const double sigma)
11178 status=MagickSharpenImageChannel(wand,DefaultChannels,radius,sigma);
11182 WandExport MagickBooleanType MagickSharpenImageChannel(MagickWand *wand,
11183 const ChannelType channel,const double radius,const double sigma)
11188 assert(wand != (MagickWand *) NULL);
11189 assert(wand->signature == WandSignature);
11190 if (wand->debug != MagickFalse)
11191 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11192 if (wand->images == (Image *) NULL)
11193 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11194 sharp_image=SharpenImageChannel(wand->images,channel,radius,sigma,
11196 if (sharp_image == (Image *) NULL)
11197 return(MagickFalse);
11198 ReplaceImageInList(&wand->images,sharp_image);
11199 return(MagickTrue);
11203 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11207 % M a g i c k S h a v e I m a g e %
11211 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11213 % MagickShaveImage() shaves pixels from the image edges. It allocates the
11214 % memory necessary for the new Image structure and returns a pointer to the
11217 % The format of the MagickShaveImage method is:
11219 % MagickBooleanType MagickShaveImage(MagickWand *wand,
11220 % const size_t columns,const size_t rows)
11222 % A description of each parameter follows:
11224 % o wand: the magick wand.
11226 % o columns: the number of columns in the scaled image.
11228 % o rows: the number of rows in the scaled image.
11232 WandExport MagickBooleanType MagickShaveImage(MagickWand *wand,
11233 const size_t columns,const size_t rows)
11241 assert(wand != (MagickWand *) NULL);
11242 assert(wand->signature == WandSignature);
11243 if (wand->debug != MagickFalse)
11244 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11245 if (wand->images == (Image *) NULL)
11246 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11247 shave_info.width=columns;
11248 shave_info.height=rows;
11251 shave_image=ShaveImage(wand->images,&shave_info,wand->exception);
11252 if (shave_image == (Image *) NULL)
11253 return(MagickFalse);
11254 ReplaceImageInList(&wand->images,shave_image);
11255 return(MagickTrue);
11259 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11263 % M a g i c k S h e a r I m a g e %
11267 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11269 % MagickShearImage() slides one edge of an image along the X or Y axis,
11270 % creating a parallelogram. An X direction shear slides an edge along the X
11271 % axis, while a Y direction shear slides an edge along the Y axis. The amount
11272 % of the shear is controlled by a shear angle. For X direction shears, x_shear
11273 % is measured relative to the Y axis, and similarly, for Y direction shears
11274 % y_shear is measured relative to the X axis. Empty triangles left over from
11275 % shearing the image are filled with the background color.
11277 % The format of the MagickShearImage method is:
11279 % MagickBooleanType MagickShearImage(MagickWand *wand,
11280 % const PixelWand *background,const double x_shear,onst double y_shear)
11282 % A description of each parameter follows:
11284 % o wand: the magick wand.
11286 % o background: the background pixel wand.
11288 % o x_shear: the number of degrees to shear the image.
11290 % o y_shear: the number of degrees to shear the image.
11293 WandExport MagickBooleanType MagickShearImage(MagickWand *wand,
11294 const PixelWand *background,const double x_shear,const double y_shear)
11299 assert(wand != (MagickWand *) NULL);
11300 assert(wand->signature == WandSignature);
11301 if (wand->debug != MagickFalse)
11302 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11303 if (wand->images == (Image *) NULL)
11304 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11305 PixelGetQuantumColor(background,&wand->images->background_color);
11306 shear_image=ShearImage(wand->images,x_shear,y_shear,wand->exception);
11307 if (shear_image == (Image *) NULL)
11308 return(MagickFalse);
11309 ReplaceImageInList(&wand->images,shear_image);
11310 return(MagickTrue);
11314 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11318 % 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 %
11322 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11324 % MagickSigmoidalContrastImage() adjusts the contrast of an image with a
11325 % non-linear sigmoidal contrast algorithm. Increase the contrast of the
11326 % image using a sigmoidal transfer function without saturating highlights or
11327 % shadows. Contrast indicates how much to increase the contrast (0 is none;
11328 % 3 is typical; 20 is pushing it); mid-point indicates where midtones fall in
11329 % the resultant image (0 is white; 50% is middle-gray; 100% is black). Set
11330 % sharpen to MagickTrue to increase the image contrast otherwise the contrast
11333 % The format of the MagickSigmoidalContrastImage method is:
11335 % MagickBooleanType MagickSigmoidalContrastImage(MagickWand *wand,
11336 % const MagickBooleanType sharpen,const double alpha,const double beta)
11337 % MagickBooleanType MagickSigmoidalContrastImageChannel(MagickWand *wand,
11338 % const ChannelType channel,const MagickBooleanType sharpen,
11339 % const double alpha,const double beta)
11341 % A description of each parameter follows:
11343 % o wand: the magick wand.
11345 % o channel: Identify which channel to level: RedChannel, GreenChannel,
11347 % o sharpen: Increase or decrease image contrast.
11349 % o alpha: control the "shoulder" of the contast curve.
11351 % o beta: control the "toe" of the contast curve.
11355 WandExport MagickBooleanType MagickSigmoidalContrastImage(MagickWand *wand,
11356 const MagickBooleanType sharpen,const double alpha,const double beta)
11361 status=MagickSigmoidalContrastImageChannel(wand,DefaultChannels,sharpen,
11366 WandExport MagickBooleanType MagickSigmoidalContrastImageChannel(
11367 MagickWand *wand,const ChannelType channel,const MagickBooleanType sharpen,
11368 const double alpha,const double beta)
11373 assert(wand != (MagickWand *) NULL);
11374 assert(wand->signature == WandSignature);
11375 if (wand->debug != MagickFalse)
11376 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11377 if (wand->images == (Image *) NULL)
11378 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11379 status=SigmoidalContrastImageChannel(wand->images,channel,sharpen,alpha,beta);
11380 if (status == MagickFalse)
11381 InheritException(wand->exception,&wand->images->exception);
11386 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11390 % M a g i c k S i m i l a r i t y I m a g e %
11394 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11396 % MagickSimilarityImage() compares the reference image of the image and
11397 % returns the best match offset. In addition, it returns a similarity image
11398 % such that an exact match location is completely white and if none of the
11399 % pixels match, black, otherwise some gray level in-between.
11401 % The format of the MagickSimilarityImage method is:
11403 % MagickWand *MagickSimilarityImage(MagickWand *wand,
11404 % const MagickWand *reference,RectangeInfo *offset,double *similarity)
11406 % A description of each parameter follows:
11408 % o wand: the magick wand.
11410 % o reference: the reference wand.
11412 % o offset: the best match offset of the reference image within the image.
11414 % o similarity: the computed similarity between the images.
11417 WandExport MagickWand *MagickSimilarityImage(MagickWand *wand,
11418 const MagickWand *reference,RectangleInfo *offset,double *similarity)
11423 assert(wand != (MagickWand *) NULL);
11424 assert(wand->signature == WandSignature);
11425 if (wand->debug != MagickFalse)
11426 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11427 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
11429 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
11430 "ContainsNoImages","`%s'",wand->name);
11431 return((MagickWand *) NULL);
11433 similarity_image=SimilarityImage(wand->images,reference->images,offset,
11434 similarity,&wand->images->exception);
11435 if (similarity_image == (Image *) NULL)
11436 return((MagickWand *) NULL);
11437 return(CloneMagickWandFromImages(wand,similarity_image));
11441 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11445 % M a g i c k S k e t c h I m a g e %
11449 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11451 % MagickSketchImage() simulates a pencil sketch. We convolve the image with
11452 % a Gaussian operator of the given radius and standard deviation (sigma).
11453 % For reasonable results, radius should be larger than sigma. Use a
11454 % radius of 0 and SketchImage() selects a suitable radius for you.
11455 % Angle gives the angle of the blurring motion.
11457 % The format of the MagickSketchImage method is:
11459 % MagickBooleanType MagickSketchImage(MagickWand *wand,
11460 % const double radius,const double sigma,const double angle)
11462 % A description of each parameter follows:
11464 % o wand: the magick wand.
11466 % o radius: the radius of the Gaussian, in pixels, not counting
11467 % the center pixel.
11469 % o sigma: the standard deviation of the Gaussian, in pixels.
11471 % o angle: Apply the effect along this angle.
11474 WandExport MagickBooleanType MagickSketchImage(MagickWand *wand,
11475 const double radius,const double sigma,const double angle)
11480 assert(wand != (MagickWand *) NULL);
11481 assert(wand->signature == WandSignature);
11482 if (wand->debug != MagickFalse)
11483 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11484 if (wand->images == (Image *) NULL)
11485 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11486 sketch_image=SketchImage(wand->images,radius,sigma,angle,wand->exception);
11487 if (sketch_image == (Image *) NULL)
11488 return(MagickFalse);
11489 ReplaceImageInList(&wand->images,sketch_image);
11490 return(MagickTrue);
11494 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11498 % M a g i c k S o l a r i z e I m a g e %
11502 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11504 % MagickSolarizeImage() applies a special effect to the image, similar to the
11505 % effect achieved in a photo darkroom by selectively exposing areas of photo
11506 % sensitive paper to light. Threshold ranges from 0 to QuantumRange and is a
11507 % measure of the extent of the solarization.
11509 % The format of the MagickSolarizeImage method is:
11511 % MagickBooleanType MagickSolarizeImage(MagickWand *wand,
11512 % const double threshold)
11514 % A description of each parameter follows:
11516 % o wand: the magick wand.
11518 % o threshold: Define the extent of the solarization.
11521 WandExport MagickBooleanType MagickSolarizeImage(MagickWand *wand,
11522 const double threshold)
11527 assert(wand != (MagickWand *) NULL);
11528 assert(wand->signature == WandSignature);
11529 if (wand->debug != MagickFalse)
11530 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11531 if (wand->images == (Image *) NULL)
11532 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11533 status=SolarizeImage(wand->images,threshold);
11534 if (status == MagickFalse)
11535 InheritException(wand->exception,&wand->images->exception);
11540 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11544 % M a g i c k S p a r s e C o l o r I m a g e %
11548 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11550 % MagickSparseColorImage(), given a set of coordinates, interpolates the
11551 % colors found at those coordinates, across the whole image, using various
11554 % The format of the MagickSparseColorImage method is:
11556 % MagickBooleanType MagickSparseColorImage(MagickWand *wand,
11557 % const ChannelType channel,const SparseColorMethod method,
11558 % const size_t number_arguments,const double *arguments)
11560 % A description of each parameter follows:
11562 % o image: the image to be sparseed.
11564 % o method: the method of image sparseion.
11566 % ArcSparseColorion will always ignore source image offset, and always
11567 % 'bestfit' the destination image with the top left corner offset
11568 % relative to the polar mapping center.
11570 % Bilinear has no simple inverse mapping so will not allow 'bestfit'
11571 % style of image sparseion.
11573 % Affine, Perspective, and Bilinear, will do least squares fitting of
11574 % the distrotion when more than the minimum number of control point
11575 % pairs are provided.
11577 % Perspective, and Bilinear, will fall back to a Affine sparseion when
11578 % less than 4 control point pairs are provided. While Affine sparseions
11579 % will let you use any number of control point pairs, that is Zero pairs
11580 % is a No-Op (viewport only) distrotion, one pair is a translation and
11581 % two pairs of control points will do a scale-rotate-translate, without
11584 % o number_arguments: the number of arguments given for this sparseion
11587 % o arguments: the arguments for this sparseion method.
11590 WandExport MagickBooleanType MagickSparseColorImage(MagickWand *wand,
11591 const ChannelType channel,const SparseColorMethod method,
11592 const size_t number_arguments,const double *arguments)
11597 assert(wand != (MagickWand *) NULL);
11598 assert(wand->signature == WandSignature);
11599 if (wand->debug != MagickFalse)
11600 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11601 if (wand->images == (Image *) NULL)
11602 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11603 sparse_image=SparseColorImage(wand->images,channel,method,number_arguments,
11604 arguments,wand->exception);
11605 if (sparse_image == (Image *) NULL)
11606 return(MagickFalse);
11607 ReplaceImageInList(&wand->images,sparse_image);
11608 return(MagickTrue);
11612 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11616 % M a g i c k S p l i c e I m a g e %
11620 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11622 % MagickSpliceImage() splices a solid color into the image.
11624 % The format of the MagickSpliceImage method is:
11626 % MagickBooleanType MagickSpliceImage(MagickWand *wand,
11627 % const size_t width,const size_t height,const ssize_t x,
11630 % A description of each parameter follows:
11632 % o wand: the magick wand.
11634 % o width: the region width.
11636 % o height: the region height.
11638 % o x: the region x offset.
11640 % o y: the region y offset.
11643 WandExport MagickBooleanType MagickSpliceImage(MagickWand *wand,
11644 const size_t width,const size_t height,const ssize_t x,
11653 assert(wand != (MagickWand *) NULL);
11654 assert(wand->signature == WandSignature);
11655 if (wand->debug != MagickFalse)
11656 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11657 if (wand->images == (Image *) NULL)
11658 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11659 splice.width=width;
11660 splice.height=height;
11663 splice_image=SpliceImage(wand->images,&splice,wand->exception);
11664 if (splice_image == (Image *) NULL)
11665 return(MagickFalse);
11666 ReplaceImageInList(&wand->images,splice_image);
11667 return(MagickTrue);
11671 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11675 % M a g i c k S p r e a d I m a g e %
11679 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11681 % MagickSpreadImage() is a special effects method that randomly displaces each
11682 % pixel in a block defined by the radius parameter.
11684 % The format of the MagickSpreadImage method is:
11686 % MagickBooleanType MagickSpreadImage(MagickWand *wand,const double radius)
11688 % A description of each parameter follows:
11690 % o wand: the magick wand.
11692 % o radius: Choose a random pixel in a neighborhood of this extent.
11695 WandExport MagickBooleanType MagickSpreadImage(MagickWand *wand,
11696 const double radius)
11701 assert(wand != (MagickWand *) NULL);
11702 assert(wand->signature == WandSignature);
11703 if (wand->debug != MagickFalse)
11704 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11705 if (wand->images == (Image *) NULL)
11706 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11707 spread_image=SpreadImage(wand->images,radius,wand->exception);
11708 if (spread_image == (Image *) NULL)
11709 return(MagickFalse);
11710 ReplaceImageInList(&wand->images,spread_image);
11711 return(MagickTrue);
11715 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11719 % M a g i c k S t e g a n o I m a g e %
11723 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11725 % MagickSteganoImage() hides a digital watermark within the image.
11726 % Recover the hidden watermark later to prove that the authenticity of
11727 % an image. Offset defines the start position within the image to hide
11730 % The format of the MagickSteganoImage method is:
11732 % MagickWand *MagickSteganoImage(MagickWand *wand,
11733 % const MagickWand *watermark_wand,const ssize_t offset)
11735 % A description of each parameter follows:
11737 % o wand: the magick wand.
11739 % o watermark_wand: the watermark wand.
11741 % o offset: Start hiding at this offset into the image.
11744 WandExport MagickWand *MagickSteganoImage(MagickWand *wand,
11745 const MagickWand *watermark_wand,const ssize_t offset)
11750 assert(wand != (MagickWand *) NULL);
11751 assert(wand->signature == WandSignature);
11752 if (wand->debug != MagickFalse)
11753 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11754 if ((wand->images == (Image *) NULL) ||
11755 (watermark_wand->images == (Image *) NULL))
11757 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
11758 "ContainsNoImages","`%s'",wand->name);
11759 return((MagickWand *) NULL);
11761 wand->images->offset=offset;
11762 stegano_image=SteganoImage(wand->images,watermark_wand->images,
11764 if (stegano_image == (Image *) NULL)
11765 return((MagickWand *) NULL);
11766 return(CloneMagickWandFromImages(wand,stegano_image));
11770 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11774 % M a g i c k S t e r e o I m a g e %
11778 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11780 % MagickStereoImage() composites two images and produces a single image that
11781 % is the composite of a left and right image of a stereo pair
11783 % The format of the MagickStereoImage method is:
11785 % MagickWand *MagickStereoImage(MagickWand *wand,
11786 % const MagickWand *offset_wand)
11788 % A description of each parameter follows:
11790 % o wand: the magick wand.
11792 % o offset_wand: Another image wand.
11795 WandExport MagickWand *MagickStereoImage(MagickWand *wand,
11796 const MagickWand *offset_wand)
11801 assert(wand != (MagickWand *) NULL);
11802 assert(wand->signature == WandSignature);
11803 if (wand->debug != MagickFalse)
11804 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11805 if ((wand->images == (Image *) NULL) ||
11806 (offset_wand->images == (Image *) NULL))
11808 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
11809 "ContainsNoImages","`%s'",wand->name);
11810 return((MagickWand *) NULL);
11812 stereo_image=StereoImage(wand->images,offset_wand->images,wand->exception);
11813 if (stereo_image == (Image *) NULL)
11814 return((MagickWand *) NULL);
11815 return(CloneMagickWandFromImages(wand,stereo_image));
11819 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11823 % M a g i c k S t r i p I m a g e %
11827 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11829 % MagickStripImage() strips an image of all profiles and comments.
11831 % The format of the MagickStripImage method is:
11833 % MagickBooleanType MagickStripImage(MagickWand *wand)
11835 % A description of each parameter follows:
11837 % o wand: the magick wand.
11840 WandExport MagickBooleanType MagickStripImage(MagickWand *wand)
11845 assert(wand != (MagickWand *) NULL);
11846 assert(wand->signature == WandSignature);
11847 if (wand->debug != MagickFalse)
11848 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11849 if (wand->images == (Image *) NULL)
11850 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11851 status=StripImage(wand->images);
11852 if (status == MagickFalse)
11853 InheritException(wand->exception,&wand->images->exception);
11858 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11862 % M a g i c k S w i r l I m a g e %
11866 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11868 % MagickSwirlImage() swirls the pixels about the center of the image, where
11869 % degrees indicates the sweep of the arc through which each pixel is moved.
11870 % You get a more dramatic effect as the degrees move from 1 to 360.
11872 % The format of the MagickSwirlImage method is:
11874 % MagickBooleanType MagickSwirlImage(MagickWand *wand,const double degrees)
11876 % A description of each parameter follows:
11878 % o wand: the magick wand.
11880 % o degrees: Define the tightness of the swirling effect.
11883 WandExport MagickBooleanType MagickSwirlImage(MagickWand *wand,
11884 const double degrees)
11889 assert(wand != (MagickWand *) NULL);
11890 assert(wand->signature == WandSignature);
11891 if (wand->debug != MagickFalse)
11892 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11893 if (wand->images == (Image *) NULL)
11894 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11895 swirl_image=SwirlImage(wand->images,degrees,wand->exception);
11896 if (swirl_image == (Image *) NULL)
11897 return(MagickFalse);
11898 ReplaceImageInList(&wand->images,swirl_image);
11899 return(MagickTrue);
11903 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11907 % M a g i c k T e x t u r e I m a g e %
11911 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11913 % MagickTextureImage() repeatedly tiles the texture image across and down the
11916 % The format of the MagickTextureImage method is:
11918 % MagickWand *MagickTextureImage(MagickWand *wand,
11919 % const MagickWand *texture_wand)
11921 % A description of each parameter follows:
11923 % o wand: the magick wand.
11925 % o texture_wand: the texture wand
11928 WandExport MagickWand *MagickTextureImage(MagickWand *wand,
11929 const MagickWand *texture_wand)
11937 assert(wand != (MagickWand *) NULL);
11938 assert(wand->signature == WandSignature);
11939 if (wand->debug != MagickFalse)
11940 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11941 if ((wand->images == (Image *) NULL) ||
11942 (texture_wand->images == (Image *) NULL))
11944 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
11945 "ContainsNoImages","`%s'",wand->name);
11946 return((MagickWand *) NULL);
11948 texture_image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
11949 if (texture_image == (Image *) NULL)
11950 return((MagickWand *) NULL);
11951 status=TextureImage(texture_image,texture_wand->images);
11952 if (status == MagickFalse)
11954 InheritException(wand->exception,&texture_image->exception);
11955 texture_image=DestroyImage(texture_image);
11956 return((MagickWand *) NULL);
11958 return(CloneMagickWandFromImages(wand,texture_image));
11962 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11966 % M a g i c k T h r e s h o l d I m a g e %
11970 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11972 % MagickThresholdImage() changes the value of individual pixels based on
11973 % the intensity of each pixel compared to threshold. The result is a
11974 % high-contrast, two color image.
11976 % The format of the MagickThresholdImage method is:
11978 % MagickBooleanType MagickThresholdImage(MagickWand *wand,
11979 % const double threshold)
11980 % MagickBooleanType MagickThresholdImageChannel(MagickWand *wand,
11981 % const ChannelType channel,const double threshold)
11983 % A description of each parameter follows:
11985 % o wand: the magick wand.
11987 % o channel: the image channel(s).
11989 % o threshold: Define the threshold value.
11992 WandExport MagickBooleanType MagickThresholdImage(MagickWand *wand,
11993 const double threshold)
11998 status=MagickThresholdImageChannel(wand,DefaultChannels,threshold);
12002 WandExport MagickBooleanType MagickThresholdImageChannel(MagickWand *wand,
12003 const ChannelType channel,const double threshold)
12008 assert(wand != (MagickWand *) NULL);
12009 assert(wand->signature == WandSignature);
12010 if (wand->debug != MagickFalse)
12011 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12012 if (wand->images == (Image *) NULL)
12013 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12014 status=BilevelImageChannel(wand->images,channel,threshold);
12015 if (status == MagickFalse)
12016 InheritException(wand->exception,&wand->images->exception);
12021 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12025 % M a g i c k T h u m b n a i l I m a g e %
12029 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12031 % MagickThumbnailImage() changes the size of an image to the given dimensions
12032 % and removes any associated profiles. The goal is to produce small low cost
12033 % thumbnail images suited for display on the Web.
12035 % The format of the MagickThumbnailImage method is:
12037 % MagickBooleanType MagickThumbnailImage(MagickWand *wand,
12038 % const size_t columns,const size_t rows)
12040 % A description of each parameter follows:
12042 % o wand: the magick wand.
12044 % o columns: the number of columns in the scaled image.
12046 % o rows: the number of rows in the scaled image.
12049 WandExport MagickBooleanType MagickThumbnailImage(MagickWand *wand,
12050 const size_t columns,const size_t rows)
12055 assert(wand != (MagickWand *) NULL);
12056 assert(wand->signature == WandSignature);
12057 if (wand->debug != MagickFalse)
12058 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12059 if (wand->images == (Image *) NULL)
12060 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12061 thumbnail_image=ThumbnailImage(wand->images,columns,rows,wand->exception);
12062 if (thumbnail_image == (Image *) NULL)
12063 return(MagickFalse);
12064 ReplaceImageInList(&wand->images,thumbnail_image);
12065 return(MagickTrue);
12069 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12073 % M a g i c k T i n t I m a g e %
12077 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12079 % MagickTintImage() applies a color vector to each pixel in the image. The
12080 % length of the vector is 0 for black and white and at its maximum for the
12081 % midtones. The vector weighting function is
12082 % f(x)=(1-(4.0*((x-0.5)*(x-0.5)))).
12084 % The format of the MagickTintImage method is:
12086 % MagickBooleanType MagickTintImage(MagickWand *wand,
12087 % const PixelWand *tint,const PixelWand *opacity)
12089 % A description of each parameter follows:
12091 % o wand: the magick wand.
12093 % o tint: the tint pixel wand.
12095 % o opacity: the opacity pixel wand.
12098 WandExport MagickBooleanType MagickTintImage(MagickWand *wand,
12099 const PixelWand *tint,const PixelWand *opacity)
12102 percent_opaque[MaxTextExtent];
12110 assert(wand != (MagickWand *) NULL);
12111 assert(wand->signature == WandSignature);
12112 if (wand->debug != MagickFalse)
12113 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12114 if (wand->images == (Image *) NULL)
12115 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12116 (void) FormatMagickString(percent_opaque,MaxTextExtent,
12117 "%g,%g,%g,%g",(double) (100.0*QuantumScale*
12118 PixelGetRedQuantum(opacity)),(double) (100.0*QuantumScale*
12119 PixelGetGreenQuantum(opacity)),(double) (100.0*QuantumScale*
12120 PixelGetBlueQuantum(opacity)),(double) (100.0*QuantumScale*
12121 PixelGetOpacityQuantum(opacity)));
12122 PixelGetQuantumColor(tint,&target);
12123 tint_image=TintImage(wand->images,percent_opaque,target,wand->exception);
12124 if (tint_image == (Image *) NULL)
12125 return(MagickFalse);
12126 ReplaceImageInList(&wand->images,tint_image);
12127 return(MagickTrue);
12131 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12135 % M a g i c k T r a n s f o r m I m a g e %
12139 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12141 % MagickTransformImage() is a convenience method that behaves like
12142 % MagickResizeImage() or MagickCropImage() but accepts scaling and/or cropping
12143 % information as a region geometry specification. If the operation fails,
12144 % a NULL image handle is returned.
12146 % The format of the MagickTransformImage method is:
12148 % MagickWand *MagickTransformImage(MagickWand *wand,const char *crop,
12149 % const char *geometry)
12151 % A description of each parameter follows:
12153 % o wand: the magick wand.
12155 % o crop: A crop geometry string. This geometry defines a subregion of the
12158 % o geometry: An image geometry string. This geometry defines the final
12159 % size of the image.
12162 WandExport MagickWand *MagickTransformImage(MagickWand *wand,
12163 const char *crop,const char *geometry)
12171 assert(wand != (MagickWand *) NULL);
12172 assert(wand->signature == WandSignature);
12173 if (wand->debug != MagickFalse)
12174 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12175 if (wand->images == (Image *) NULL)
12176 return((MagickWand *) NULL);
12177 transform_image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
12178 if (transform_image == (Image *) NULL)
12179 return((MagickWand *) NULL);
12180 status=TransformImage(&transform_image,crop,geometry);
12181 if (status == MagickFalse)
12183 InheritException(wand->exception,&transform_image->exception);
12184 transform_image=DestroyImage(transform_image);
12185 return((MagickWand *) NULL);
12187 return(CloneMagickWandFromImages(wand,transform_image));
12191 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12195 % 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 %
12199 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12201 % MagickTransformImageColorspace() transform the image colorspace.
12203 % The format of the MagickTransformImageColorspace method is:
12205 % MagickBooleanType MagickTransformImageColorspace(MagickWand *wand,
12206 % const ColorspaceType colorspace)
12208 % A description of each parameter follows:
12210 % o wand: the magick wand.
12212 % o colorspace: the image colorspace: UndefinedColorspace, RGBColorspace,
12213 % GRAYColorspace, TransparentColorspace, OHTAColorspace, XYZColorspace,
12214 % YCbCrColorspace, YCCColorspace, YIQColorspace, YPbPrColorspace,
12215 % YPbPrColorspace, YUVColorspace, CMYKColorspace, sRGBColorspace,
12216 % HSLColorspace, or HWBColorspace.
12219 WandExport MagickBooleanType MagickTransformImageColorspace(MagickWand *wand,
12220 const ColorspaceType colorspace)
12222 assert(wand != (MagickWand *) NULL);
12223 assert(wand->signature == WandSignature);
12224 if (wand->debug != MagickFalse)
12225 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12226 if (wand->images == (Image *) NULL)
12227 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12228 return(TransformImageColorspace(wand->images,colorspace));
12232 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12236 % 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 %
12240 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12242 % MagickTransparentPaintImage() changes any pixel that matches color with the
12243 % color defined by fill.
12245 % The format of the MagickTransparentPaintImage method is:
12247 % MagickBooleanType MagickTransparentPaintImage(MagickWand *wand,
12248 % const PixelWand *target,const double alpha,const double fuzz,
12249 % const MagickBooleanType invert)
12251 % A description of each parameter follows:
12253 % o wand: the magick wand.
12255 % o target: Change this target color to specified opacity value within
12258 % o alpha: the level of transparency: 1.0 is fully opaque and 0.0 is fully
12261 % o fuzz: By default target must match a particular pixel color
12262 % exactly. However, in many cases two colors may differ by a small amount.
12263 % The fuzz member of image defines how much tolerance is acceptable to
12264 % consider two colors as the same. For example, set fuzz to 10 and the
12265 % color red at intensities of 100 and 102 respectively are now interpreted
12266 % as the same color for the purposes of the floodfill.
12268 % o invert: paint any pixel that does not match the target color.
12271 WandExport MagickBooleanType MagickTransparentPaintImage(MagickWand *wand,
12272 const PixelWand *target,const double alpha,const double fuzz,
12273 const MagickBooleanType invert)
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 PixelGetMagickColor(target,&target_pixel);
12288 wand->images->fuzz=fuzz;
12289 status=TransparentPaintImage(wand->images,&target_pixel,ClampToQuantum(
12290 (MagickRealType) QuantumRange-QuantumRange*alpha),invert);
12291 if (status == MagickFalse)
12292 InheritException(wand->exception,&wand->images->exception);
12297 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12301 % M a g i c k T r a n s p o s e I m a g e %
12305 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12307 % MagickTransposeImage() creates a vertical mirror image by reflecting the
12308 % pixels around the central x-axis while rotating them 90-degrees.
12310 % The format of the MagickTransposeImage method is:
12312 % MagickBooleanType MagickTransposeImage(MagickWand *wand)
12314 % A description of each parameter follows:
12316 % o wand: the magick wand.
12319 WandExport MagickBooleanType MagickTransposeImage(MagickWand *wand)
12324 assert(wand != (MagickWand *) NULL);
12325 assert(wand->signature == WandSignature);
12326 if (wand->debug != MagickFalse)
12327 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12328 if (wand->images == (Image *) NULL)
12329 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12330 transpose_image=TransposeImage(wand->images,wand->exception);
12331 if (transpose_image == (Image *) NULL)
12332 return(MagickFalse);
12333 ReplaceImageInList(&wand->images,transpose_image);
12334 return(MagickTrue);
12338 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12342 % M a g i c k T r a n s v e r s e I m a g e %
12346 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12348 % MagickTransverseImage() creates a horizontal mirror image by reflecting the
12349 % pixels around the central y-axis while rotating them 270-degrees.
12351 % The format of the MagickTransverseImage method is:
12353 % MagickBooleanType MagickTransverseImage(MagickWand *wand)
12355 % A description of each parameter follows:
12357 % o wand: the magick wand.
12360 WandExport MagickBooleanType MagickTransverseImage(MagickWand *wand)
12365 assert(wand != (MagickWand *) NULL);
12366 assert(wand->signature == WandSignature);
12367 if (wand->debug != MagickFalse)
12368 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12369 if (wand->images == (Image *) NULL)
12370 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12371 transverse_image=TransverseImage(wand->images,wand->exception);
12372 if (transverse_image == (Image *) NULL)
12373 return(MagickFalse);
12374 ReplaceImageInList(&wand->images,transverse_image);
12375 return(MagickTrue);
12379 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12383 % M a g i c k T r i m I m a g e %
12387 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12389 % MagickTrimImage() remove edges that are the background color from the image.
12391 % The format of the MagickTrimImage method is:
12393 % MagickBooleanType MagickTrimImage(MagickWand *wand,const double fuzz)
12395 % A description of each parameter follows:
12397 % o wand: the magick wand.
12399 % o fuzz: By default target must match a particular pixel color
12400 % exactly. However, in many cases two colors may differ by a small amount.
12401 % The fuzz member of image defines how much tolerance is acceptable to
12402 % consider two colors as the same. For example, set fuzz to 10 and the
12403 % color red at intensities of 100 and 102 respectively are now interpreted
12404 % as the same color for the purposes of the floodfill.
12407 WandExport MagickBooleanType MagickTrimImage(MagickWand *wand,const double fuzz)
12412 assert(wand != (MagickWand *) NULL);
12413 assert(wand->signature == WandSignature);
12414 if (wand->debug != MagickFalse)
12415 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12416 if (wand->images == (Image *) NULL)
12417 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12418 wand->images->fuzz=fuzz;
12419 trim_image=TrimImage(wand->images,wand->exception);
12420 if (trim_image == (Image *) NULL)
12421 return(MagickFalse);
12422 ReplaceImageInList(&wand->images,trim_image);
12423 return(MagickTrue);
12427 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12431 % M a g i c k U n i q u e I m a g e C o l o r s %
12435 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12437 % MagickUniqueImageColors() discards all but one of any pixel color.
12439 % The format of the MagickUniqueImageColors method is:
12441 % MagickBooleanType MagickUniqueImageColors(MagickWand *wand)
12443 % A description of each parameter follows:
12445 % o wand: the magick wand.
12448 WandExport MagickBooleanType MagickUniqueImageColors(MagickWand *wand)
12453 assert(wand != (MagickWand *) NULL);
12454 assert(wand->signature == WandSignature);
12455 if (wand->debug != MagickFalse)
12456 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12457 if (wand->images == (Image *) NULL)
12458 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12459 unique_image=UniqueImageColors(wand->images,wand->exception);
12460 if (unique_image == (Image *) NULL)
12461 return(MagickFalse);
12462 ReplaceImageInList(&wand->images,unique_image);
12463 return(MagickTrue);
12467 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12471 % M a g i c k U n s h a r p M a s k I m a g e %
12475 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12477 % MagickUnsharpMaskImage() sharpens an image. We convolve the image with a
12478 % Gaussian operator of the given radius and standard deviation (sigma).
12479 % For reasonable results, radius should be larger than sigma. Use a radius
12480 % of 0 and UnsharpMaskImage() selects a suitable radius for you.
12482 % The format of the MagickUnsharpMaskImage method is:
12484 % MagickBooleanType MagickUnsharpMaskImage(MagickWand *wand,
12485 % const double radius,const double sigma,const double amount,
12486 % const double threshold)
12487 % MagickBooleanType MagickUnsharpMaskImageChannel(MagickWand *wand,
12488 % const ChannelType channel,const double radius,const double sigma,
12489 % const double amount,const double threshold)
12491 % A description of each parameter follows:
12493 % o wand: the magick wand.
12495 % o channel: the image channel(s).
12497 % o radius: the radius of the Gaussian, in pixels, not counting the center
12500 % o sigma: the standard deviation of the Gaussian, in pixels.
12502 % o amount: the percentage of the difference between the original and the
12503 % blur image that is added back into the original.
12505 % o threshold: the threshold in pixels needed to apply the diffence amount.
12509 WandExport MagickBooleanType MagickUnsharpMaskImage(MagickWand *wand,
12510 const double radius,const double sigma,const double amount,
12511 const double threshold)
12516 status=MagickUnsharpMaskImageChannel(wand,DefaultChannels,radius,sigma,
12521 WandExport MagickBooleanType MagickUnsharpMaskImageChannel(MagickWand *wand,
12522 const ChannelType channel,const double radius,const double sigma,
12523 const double amount,const double threshold)
12528 assert(wand != (MagickWand *) NULL);
12529 assert(wand->signature == WandSignature);
12530 if (wand->debug != MagickFalse)
12531 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12532 if (wand->images == (Image *) NULL)
12533 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12534 unsharp_image=UnsharpMaskImageChannel(wand->images,channel,radius,sigma,
12535 amount,threshold,wand->exception);
12536 if (unsharp_image == (Image *) NULL)
12537 return(MagickFalse);
12538 ReplaceImageInList(&wand->images,unsharp_image);
12539 return(MagickTrue);
12543 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12547 % M a g i c k V i g n e t t e I m a g e %
12551 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12553 % MagickVignetteImage() softens the edges of the image in vignette style.
12555 % The format of the MagickVignetteImage method is:
12557 % MagickBooleanType MagickVignetteImage(MagickWand *wand,
12558 % const double black_point,const double white_point,const ssize_t x,
12561 % A description of each parameter follows:
12563 % o wand: the magick wand.
12565 % o black_point: the black point.
12567 % o white_point: the white point.
12569 % o x, y: Define the x and y ellipse offset.
12572 WandExport MagickBooleanType MagickVignetteImage(MagickWand *wand,
12573 const double black_point,const double white_point,const ssize_t x,const ssize_t y)
12578 assert(wand != (MagickWand *) NULL);
12579 assert(wand->signature == WandSignature);
12580 if (wand->debug != MagickFalse)
12581 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12582 if (wand->images == (Image *) NULL)
12583 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12584 vignette_image=VignetteImage(wand->images,black_point,white_point,x,y,
12586 if (vignette_image == (Image *) NULL)
12587 return(MagickFalse);
12588 ReplaceImageInList(&wand->images,vignette_image);
12589 return(MagickTrue);
12593 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12597 % M a g i c k W a v e I m a g e %
12601 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12603 % MagickWaveImage() creates a "ripple" effect in the image by shifting
12604 % the pixels vertically along a sine wave whose amplitude and wavelength
12605 % is specified by the given parameters.
12607 % The format of the MagickWaveImage method is:
12609 % MagickBooleanType MagickWaveImage(MagickWand *wand,const double amplitude,
12610 % const double wave_length)
12612 % A description of each parameter follows:
12614 % o wand: the magick wand.
12616 % o amplitude, wave_length: Define the amplitude and wave length of the
12620 WandExport MagickBooleanType MagickWaveImage(MagickWand *wand,
12621 const double amplitude,const double wave_length)
12626 assert(wand != (MagickWand *) NULL);
12627 assert(wand->signature == WandSignature);
12628 if (wand->debug != MagickFalse)
12629 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12630 if (wand->images == (Image *) NULL)
12631 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12632 wave_image=WaveImage(wand->images,amplitude,wave_length,wand->exception);
12633 if (wave_image == (Image *) NULL)
12634 return(MagickFalse);
12635 ReplaceImageInList(&wand->images,wave_image);
12636 return(MagickTrue);
12640 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12644 % 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 %
12648 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12650 % MagickWhiteThresholdImage() is like ThresholdImage() but force all pixels
12651 % above the threshold into white while leaving all pixels below the threshold
12654 % The format of the MagickWhiteThresholdImage method is:
12656 % MagickBooleanType MagickWhiteThresholdImage(MagickWand *wand,
12657 % const PixelWand *threshold)
12659 % A description of each parameter follows:
12661 % o wand: the magick wand.
12663 % o threshold: the pixel wand.
12666 WandExport MagickBooleanType MagickWhiteThresholdImage(MagickWand *wand,
12667 const PixelWand *threshold)
12670 thresholds[MaxTextExtent];
12675 assert(wand != (MagickWand *) NULL);
12676 assert(wand->signature == WandSignature);
12677 if (wand->debug != MagickFalse)
12678 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12679 if (wand->images == (Image *) NULL)
12680 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12681 (void) FormatMagickString(thresholds,MaxTextExtent,
12682 QuantumFormat "," QuantumFormat "," QuantumFormat "," QuantumFormat,
12683 PixelGetRedQuantum(threshold),PixelGetGreenQuantum(threshold),
12684 PixelGetBlueQuantum(threshold),PixelGetOpacityQuantum(threshold));
12685 status=WhiteThresholdImage(wand->images,thresholds);
12686 if (status == MagickFalse)
12687 InheritException(wand->exception,&wand->images->exception);
12692 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12696 % M a g i c k W r i t e I m a g e %
12700 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12702 % MagickWriteImage() writes an image to the specified filename. If the
12703 % filename parameter is NULL, the image is written to the filename set
12704 % by MagickReadImage() or MagickSetImageFilename().
12706 % The format of the MagickWriteImage method is:
12708 % MagickBooleanType MagickWriteImage(MagickWand *wand,
12709 % const char *filename)
12711 % A description of each parameter follows:
12713 % o wand: the magick wand.
12715 % o filename: the image filename.
12719 WandExport MagickBooleanType MagickWriteImage(MagickWand *wand,
12720 const char *filename)
12731 assert(wand != (MagickWand *) NULL);
12732 assert(wand->signature == WandSignature);
12733 if (wand->debug != MagickFalse)
12734 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12735 if (wand->images == (Image *) NULL)
12736 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12737 if (filename != (const char *) NULL)
12738 (void) CopyMagickString(wand->images->filename,filename,MaxTextExtent);
12739 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
12740 if (image == (Image *) NULL)
12741 return(MagickFalse);
12742 write_info=CloneImageInfo(wand->image_info);
12743 write_info->adjoin=MagickTrue;
12744 status=WriteImage(write_info,image);
12745 if (status == MagickFalse)
12746 InheritException(wand->exception,&image->exception);
12747 image=DestroyImage(image);
12748 write_info=DestroyImageInfo(write_info);
12753 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12757 % M a g i c k W r i t e I m a g e F i l e %
12761 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12763 % MagickWriteImageFile() writes an image to an open file descriptor.
12765 % The format of the MagickWriteImageFile method is:
12767 % MagickBooleanType MagickWriteImageFile(MagickWand *wand,FILE *file)
12769 % A description of each parameter follows:
12771 % o wand: the magick wand.
12773 % o file: the file descriptor.
12776 WandExport MagickBooleanType MagickWriteImageFile(MagickWand *wand,FILE *file)
12787 assert(wand != (MagickWand *) NULL);
12788 assert(wand->signature == WandSignature);
12789 assert(file != (FILE *) NULL);
12790 if (wand->debug != MagickFalse)
12791 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12792 if (wand->images == (Image *) NULL)
12793 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12794 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
12795 if (image == (Image *) NULL)
12796 return(MagickFalse);
12797 write_info=CloneImageInfo(wand->image_info);
12798 SetImageInfoFile(write_info,file);
12799 write_info->adjoin=MagickTrue;
12800 status=WriteImage(write_info,image);
12801 write_info=DestroyImageInfo(write_info);
12802 if (status == MagickFalse)
12803 InheritException(wand->exception,&image->exception);
12804 image=DestroyImage(image);
12809 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12813 % M a g i c k W r i t e I m a g e s %
12817 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12819 % MagickWriteImages() writes an image or image sequence.
12821 % The format of the MagickWriteImages method is:
12823 % MagickBooleanType MagickWriteImages(MagickWand *wand,
12824 % const char *filename,const MagickBooleanType adjoin)
12826 % A description of each parameter follows:
12828 % o wand: the magick wand.
12830 % o filename: the image filename.
12832 % o adjoin: join images into a single multi-image file.
12835 WandExport MagickBooleanType MagickWriteImages(MagickWand *wand,
12836 const char *filename,const MagickBooleanType adjoin)
12844 assert(wand != (MagickWand *) NULL);
12845 assert(wand->signature == WandSignature);
12846 if (wand->debug != MagickFalse)
12847 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12848 if (wand->images == (Image *) NULL)
12849 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12850 write_info=CloneImageInfo(wand->image_info);
12851 write_info->adjoin=adjoin;
12852 status=WriteImages(write_info,wand->images,filename,wand->exception);
12853 if (status == MagickFalse)
12854 InheritException(wand->exception,&wand->images->exception);
12855 write_info=DestroyImageInfo(write_info);
12860 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12864 % M a g i c k W r i t e I m a g e s F i l e %
12868 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12870 % MagickWriteImagesFile() writes an image sequence to an open file descriptor.
12872 % The format of the MagickWriteImagesFile method is:
12874 % MagickBooleanType MagickWriteImagesFile(MagickWand *wand,FILE *file)
12876 % A description of each parameter follows:
12878 % o wand: the magick wand.
12880 % o file: the file descriptor.
12883 WandExport MagickBooleanType MagickWriteImagesFile(MagickWand *wand,FILE *file)
12891 assert(wand != (MagickWand *) NULL);
12892 assert(wand->signature == WandSignature);
12893 if (wand->debug != MagickFalse)
12894 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12895 if (wand->images == (Image *) NULL)
12896 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12897 write_info=CloneImageInfo(wand->image_info);
12898 SetImageInfoFile(write_info,file);
12899 write_info->adjoin=MagickTrue;
12900 status=WriteImages(write_info,wand->images,(const char *) NULL,
12902 write_info=DestroyImageInfo(write_info);
12903 if (status == MagickFalse)
12904 InheritException(wand->exception,&wand->images->exception);