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-%lu",
109 MagickWandId,(unsigned long) 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,
2182 % A description of each parameter follows:
2184 % o wand: the magick wand.
2186 % o width: the region width.
2188 % o height: the region height.
2190 % o x: the region x-offset.
2192 % o y: the region y-offset.
2195 WandExport MagickBooleanType MagickCropImage(MagickWand *wand,
2196 const size_t width,const size_t height,const ssize_t x,
2205 assert(wand != (MagickWand *) NULL);
2206 assert(wand->signature == WandSignature);
2207 if (wand->debug != MagickFalse)
2208 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2209 if (wand->images == (Image *) NULL)
2210 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2215 crop_image=CropImage(wand->images,&crop,wand->exception);
2216 if (crop_image == (Image *) NULL)
2217 return(MagickFalse);
2218 ReplaceImageInList(&wand->images,crop_image);
2223 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2227 % M a g i c k C y c l e C o l o r m a p I m a g e %
2231 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2233 % MagickCycleColormapImage() displaces an image's colormap by a given number
2234 % of positions. If you cycle the colormap a number of times you can produce
2235 % a psychodelic effect.
2237 % The format of the MagickCycleColormapImage method is:
2239 % MagickBooleanType MagickCycleColormapImage(MagickWand *wand,
2240 % const ssize_t displace)
2242 % A description of each parameter follows:
2244 % o wand: the magick wand.
2246 % o pixel_wand: the pixel wand.
2249 WandExport MagickBooleanType MagickCycleColormapImage(MagickWand *wand,
2250 const ssize_t displace)
2255 assert(wand != (MagickWand *) NULL);
2256 assert(wand->signature == WandSignature);
2257 if (wand->debug != MagickFalse)
2258 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2259 if (wand->images == (Image *) NULL)
2260 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2261 status=CycleColormapImage(wand->images,displace);
2262 if (status == MagickFalse)
2263 InheritException(wand->exception,&wand->images->exception);
2268 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2272 % M a g i c k C o n s t i t u t e I m a g e %
2276 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2278 % MagickConstituteImage() adds an image to the wand comprised of the pixel
2279 % data you supply. The pixel data must be in scanline order top-to-bottom.
2280 % The data can be char, short int, int, float, or double. Float and double
2281 % require the pixels to be normalized [0..1], otherwise [0..Max], where Max
2282 % is the maximum value the type can accomodate (e.g. 255 for char). For
2283 % example, to create a 640x480 image from unsigned red-green-blue character
2286 % MagickConstituteImage(wand,640,640,"RGB",CharPixel,pixels);
2288 % The format of the MagickConstituteImage method is:
2290 % MagickBooleanType MagickConstituteImage(MagickWand *wand,
2291 % const size_t columns,const size_t rows,const char *map,
2292 % const StorageType storage,void *pixels)
2294 % A description of each parameter follows:
2296 % o wand: the magick wand.
2298 % o columns: width in pixels of the image.
2300 % o rows: height in pixels of the image.
2302 % o map: This string reflects the expected ordering of the pixel array.
2303 % It can be any combination or order of R = red, G = green, B = blue,
2304 % A = alpha (0 is transparent), O = opacity (0 is opaque), C = cyan,
2305 % Y = yellow, M = magenta, K = black, I = intensity (for grayscale),
2308 % o storage: Define the data type of the pixels. Float and double types are
2309 % expected to be normalized [0..1] otherwise [0..QuantumRange]. Choose from
2310 % these types: CharPixel, DoublePixel, FloatPixel, IntegerPixel,
2311 % LongPixel, QuantumPixel, or ShortPixel.
2313 % o pixels: This array of values contain the pixel components as defined by
2314 % map and type. You must preallocate this array where the expected
2315 % length varies depending on the values of width, height, map, and type.
2319 WandExport MagickBooleanType MagickConstituteImage(MagickWand *wand,
2320 const size_t columns,const size_t rows,const char *map,
2321 const StorageType storage,const void *pixels)
2326 assert(wand != (MagickWand *) NULL);
2327 assert(wand->signature == WandSignature);
2328 if (wand->debug != MagickFalse)
2329 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2330 images=ConstituteImage(columns,rows,map,storage,pixels,wand->exception);
2331 if (images == (Image *) NULL)
2332 return(MagickFalse);
2333 return(InsertImageInWand(wand,images));
2337 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2341 % M a g i c k D e c i p h e r I m a g e %
2345 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2347 % MagickDecipherImage() converts cipher pixels to plain pixels.
2349 % The format of the MagickDecipherImage method is:
2351 % MagickBooleanType MagickDecipherImage(MagickWand *wand,
2352 % const char *passphrase)
2354 % A description of each parameter follows:
2356 % o wand: the magick wand.
2358 % o passphrase: the passphrase.
2361 WandExport MagickBooleanType MagickDecipherImage(MagickWand *wand,
2362 const char *passphrase)
2364 assert(wand != (MagickWand *) NULL);
2365 assert(wand->signature == WandSignature);
2366 if (wand->debug != MagickFalse)
2367 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2368 if (wand->images == (Image *) NULL)
2369 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2370 return(DecipherImage(wand->images,passphrase,&wand->images->exception));
2374 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2378 % M a g i c k D e c o n s t r u c t I m a g e s %
2382 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2384 % MagickDeconstructImages() compares each image with the next in a sequence
2385 % and returns the maximum bounding region of any pixel differences it
2388 % The format of the MagickDeconstructImages method is:
2390 % MagickWand *MagickDeconstructImages(MagickWand *wand)
2392 % A description of each parameter follows:
2394 % o wand: the magick wand.
2397 WandExport MagickWand *MagickDeconstructImages(MagickWand *wand)
2402 assert(wand != (MagickWand *) NULL);
2403 assert(wand->signature == WandSignature);
2404 if (wand->debug != MagickFalse)
2405 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2406 if (wand->images == (Image *) NULL)
2407 return((MagickWand *) NULL);
2408 deconstruct_image=DeconstructImages(wand->images,wand->exception);
2409 if (deconstruct_image == (Image *) NULL)
2410 return((MagickWand *) NULL);
2411 return(CloneMagickWandFromImages(wand,deconstruct_image));
2415 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2419 % M a g i c k D e s k e w I m a g e %
2423 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2425 % MagickDeskewImage() removes skew from the image. Skew is an artifact that
2426 % occurs in scanned images because of the camera being misaligned,
2427 % imperfections in the scanning or surface, or simply because the paper was
2428 % not placed completely flat when scanned.
2430 % The format of the MagickDeskewImage method is:
2432 % MagickBooleanType MagickDeskewImage(MagickWand *wand,
2433 % const double threshold)
2435 % A description of each parameter follows:
2437 % o wand: the magick wand.
2439 % o threshold: separate background from foreground.
2442 WandExport MagickBooleanType MagickDeskewImage(MagickWand *wand,
2443 const double threshold)
2448 assert(wand != (MagickWand *) NULL);
2449 assert(wand->signature == WandSignature);
2450 if (wand->debug != MagickFalse)
2451 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2452 if (wand->images == (Image *) NULL)
2453 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2454 sepia_image=DeskewImage(wand->images,threshold,wand->exception);
2455 if (sepia_image == (Image *) NULL)
2456 return(MagickFalse);
2457 ReplaceImageInList(&wand->images,sepia_image);
2462 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2466 % M a g i c k D e s p e c k l e I m a g e %
2470 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2472 % MagickDespeckleImage() reduces the speckle noise in an image while
2473 % perserving the edges of the original image.
2475 % The format of the MagickDespeckleImage method is:
2477 % MagickBooleanType MagickDespeckleImage(MagickWand *wand)
2479 % A description of each parameter follows:
2481 % o wand: the magick wand.
2484 WandExport MagickBooleanType MagickDespeckleImage(MagickWand *wand)
2489 assert(wand != (MagickWand *) NULL);
2490 assert(wand->signature == WandSignature);
2491 if (wand->debug != MagickFalse)
2492 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2493 if (wand->images == (Image *) NULL)
2494 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2495 despeckle_image=DespeckleImage(wand->images,wand->exception);
2496 if (despeckle_image == (Image *) NULL)
2497 return(MagickFalse);
2498 ReplaceImageInList(&wand->images,despeckle_image);
2503 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2507 % M a g i c k D e s t r o y I m a g e %
2511 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2513 % MagickDestroyImage() dereferences an image, deallocating memory associated
2514 % with the image if the reference count becomes zero.
2516 % The format of the MagickDestroyImage method is:
2518 % Image *MagickDestroyImage(Image *image)
2520 % A description of each parameter follows:
2522 % o image: the image.
2525 WandExport Image *MagickDestroyImage(Image *image)
2527 return(DestroyImage(image));
2531 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2535 % M a g i c k D i s p l a y I m a g e %
2539 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2541 % MagickDisplayImage() displays an image.
2543 % The format of the MagickDisplayImage method is:
2545 % MagickBooleanType MagickDisplayImage(MagickWand *wand,
2546 % const char *server_name)
2548 % A description of each parameter follows:
2550 % o wand: the magick wand.
2552 % o server_name: the X server name.
2555 WandExport MagickBooleanType MagickDisplayImage(MagickWand *wand,
2556 const char *server_name)
2564 assert(wand != (MagickWand *) NULL);
2565 assert(wand->signature == WandSignature);
2566 if (wand->debug != MagickFalse)
2567 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2568 if (wand->images == (Image *) NULL)
2569 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2570 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
2571 if (image == (Image *) NULL)
2572 return(MagickFalse);
2573 (void) CloneString(&wand->image_info->server_name,server_name);
2574 status=DisplayImages(wand->image_info,image);
2575 if (status == MagickFalse)
2576 InheritException(wand->exception,&image->exception);
2577 image=DestroyImage(image);
2582 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2586 % M a g i c k D i s p l a y I m a g e s %
2590 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2592 % MagickDisplayImages() displays an image or image sequence.
2594 % The format of the MagickDisplayImages method is:
2596 % MagickBooleanType MagickDisplayImages(MagickWand *wand,
2597 % const char *server_name)
2599 % A description of each parameter follows:
2601 % o wand: the magick wand.
2603 % o server_name: the X server name.
2606 WandExport MagickBooleanType MagickDisplayImages(MagickWand *wand,
2607 const char *server_name)
2612 assert(wand != (MagickWand *) NULL);
2613 assert(wand->signature == WandSignature);
2614 if (wand->debug != MagickFalse)
2615 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2616 (void) CloneString(&wand->image_info->server_name,server_name);
2617 status=DisplayImages(wand->image_info,wand->images);
2618 if (status == MagickFalse)
2619 InheritException(wand->exception,&wand->images->exception);
2624 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2628 % M a g i c k D i s t o r t I m a g e %
2632 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2634 % MagickDistortImage() distorts an image using various distortion methods, by
2635 % mapping color lookups of the source image to a new destination image
2636 % usally of the same size as the source image, unless 'bestfit' is set to
2639 % If 'bestfit' is enabled, and distortion allows it, the destination image is
2640 % adjusted to ensure the whole source 'image' will just fit within the final
2641 % destination image, which will be sized and offset accordingly. Also in
2642 % many cases the virtual offset of the source image will be taken into
2643 % account in the mapping.
2645 % The format of the MagickDistortImage method is:
2647 % MagickBooleanType MagickDistortImage(MagickWand *wand,
2648 % const DistortImageMethod method,const size_t number_arguments,
2649 % const double *arguments,const MagickBooleanType bestfit)
2651 % A description of each parameter follows:
2653 % o image: the image to be distorted.
2655 % o method: the method of image distortion.
2657 % ArcDistortion always ignores the source image offset, and always
2658 % 'bestfit' the destination image with the top left corner offset
2659 % relative to the polar mapping center.
2661 % Bilinear has no simple inverse mapping so it does not allow 'bestfit'
2662 % style of image distortion.
2664 % Affine, Perspective, and Bilinear, do least squares fitting of the
2665 % distortion when more than the minimum number of control point pairs
2668 % Perspective, and Bilinear, falls back to a Affine distortion when less
2669 % that 4 control point pairs are provided. While Affine distortions let
2670 % you use any number of control point pairs, that is Zero pairs is a
2671 % no-Op (viewport only) distrotion, one pair is a translation and two
2672 % pairs of control points do a scale-rotate-translate, without any
2675 % o number_arguments: the number of arguments given for this distortion
2678 % o arguments: the arguments for this distortion method.
2680 % o bestfit: Attempt to resize destination to fit distorted source.
2683 WandExport MagickBooleanType MagickDistortImage(MagickWand *wand,
2684 const DistortImageMethod method,const size_t number_arguments,
2685 const double *arguments,const MagickBooleanType bestfit)
2690 assert(wand != (MagickWand *) NULL);
2691 assert(wand->signature == WandSignature);
2692 if (wand->debug != MagickFalse)
2693 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2694 if (wand->images == (Image *) NULL)
2695 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2696 distort_image=DistortImage(wand->images,method,number_arguments,arguments,
2697 bestfit,wand->exception);
2698 if (distort_image == (Image *) NULL)
2699 return(MagickFalse);
2700 ReplaceImageInList(&wand->images,distort_image);
2705 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2709 % M a g i c k D r a w I m a g e %
2713 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2715 % MagickDrawImage() renders the drawing wand on the current image.
2717 % The format of the MagickDrawImage method is:
2719 % MagickBooleanType MagickDrawImage(MagickWand *wand,
2720 % const DrawingWand *drawing_wand)
2722 % A description of each parameter follows:
2724 % o wand: the magick wand.
2726 % o drawing_wand: the draw wand.
2729 WandExport MagickBooleanType MagickDrawImage(MagickWand *wand,
2730 const DrawingWand *drawing_wand)
2741 assert(wand != (MagickWand *) NULL);
2742 assert(wand->signature == WandSignature);
2743 if (wand->debug != MagickFalse)
2744 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2745 if (wand->images == (Image *) NULL)
2746 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2747 draw_info=PeekDrawingWand(drawing_wand);
2748 if ((draw_info == (DrawInfo *) NULL) ||
2749 (draw_info->primitive == (char *) NULL))
2750 return(MagickFalse);
2751 primitive=AcquireString(draw_info->primitive);
2752 draw_info=DestroyDrawInfo(draw_info);
2753 draw_info=CloneDrawInfo(wand->image_info,(DrawInfo *) NULL);
2754 draw_info->primitive=primitive;
2755 status=DrawImage(wand->images,draw_info);
2756 if (status == MagickFalse)
2757 InheritException(wand->exception,&wand->images->exception);
2758 draw_info=DestroyDrawInfo(draw_info);
2763 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2767 % M a g i c k E d g e I m a g e %
2771 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2773 % MagickEdgeImage() enhance edges within the image with a convolution filter
2774 % of the given radius. Use a radius of 0 and Edge() selects a suitable
2777 % The format of the MagickEdgeImage method is:
2779 % MagickBooleanType MagickEdgeImage(MagickWand *wand,const double radius)
2781 % A description of each parameter follows:
2783 % o wand: the magick wand.
2785 % o radius: the radius of the pixel neighborhood.
2788 WandExport MagickBooleanType MagickEdgeImage(MagickWand *wand,
2789 const double radius)
2794 assert(wand != (MagickWand *) NULL);
2795 assert(wand->signature == WandSignature);
2796 if (wand->debug != MagickFalse)
2797 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2798 if (wand->images == (Image *) NULL)
2799 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2800 edge_image=EdgeImage(wand->images,radius,wand->exception);
2801 if (edge_image == (Image *) NULL)
2802 return(MagickFalse);
2803 ReplaceImageInList(&wand->images,edge_image);
2808 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2812 % M a g i c k E m b o s s I m a g e %
2816 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2818 % MagickEmbossImage() returns a grayscale image with a three-dimensional
2819 % effect. We convolve the image with a Gaussian operator of the given radius
2820 % and standard deviation (sigma). For reasonable results, radius should be
2821 % larger than sigma. Use a radius of 0 and Emboss() selects a suitable
2824 % The format of the MagickEmbossImage method is:
2826 % MagickBooleanType MagickEmbossImage(MagickWand *wand,const double radius,
2827 % const double sigma)
2829 % A description of each parameter follows:
2831 % o wand: the magick wand.
2833 % o radius: the radius of the Gaussian, in pixels, not counting the center
2836 % o sigma: the standard deviation of the Gaussian, in pixels.
2839 WandExport MagickBooleanType MagickEmbossImage(MagickWand *wand,
2840 const double radius,const double sigma)
2845 assert(wand != (MagickWand *) NULL);
2846 assert(wand->signature == WandSignature);
2847 if (wand->debug != MagickFalse)
2848 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2849 if (wand->images == (Image *) NULL)
2850 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2851 emboss_image=EmbossImage(wand->images,radius,sigma,wand->exception);
2852 if (emboss_image == (Image *) NULL)
2853 return(MagickFalse);
2854 ReplaceImageInList(&wand->images,emboss_image);
2859 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2863 % M a g i c k E n c i p h e r I m a g e %
2867 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2869 % MagickEncipherImage() converts plaint pixels to cipher pixels.
2871 % The format of the MagickEncipherImage method is:
2873 % MagickBooleanType MagickEncipherImage(MagickWand *wand,
2874 % const char *passphrase)
2876 % A description of each parameter follows:
2878 % o wand: the magick wand.
2880 % o passphrase: the passphrase.
2883 WandExport MagickBooleanType MagickEncipherImage(MagickWand *wand,
2884 const char *passphrase)
2886 assert(wand != (MagickWand *) NULL);
2887 assert(wand->signature == WandSignature);
2888 if (wand->debug != MagickFalse)
2889 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2890 if (wand->images == (Image *) NULL)
2891 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2892 return(EncipherImage(wand->images,passphrase,&wand->images->exception));
2896 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2900 % M a g i c k E n h a n c e I m a g e %
2904 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2906 % MagickEnhanceImage() applies a digital filter that improves the quality of a
2909 % The format of the MagickEnhanceImage method is:
2911 % MagickBooleanType MagickEnhanceImage(MagickWand *wand)
2913 % A description of each parameter follows:
2915 % o wand: the magick wand.
2918 WandExport MagickBooleanType MagickEnhanceImage(MagickWand *wand)
2923 assert(wand != (MagickWand *) NULL);
2924 assert(wand->signature == WandSignature);
2925 if (wand->debug != MagickFalse)
2926 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2927 if (wand->images == (Image *) NULL)
2928 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2929 enhance_image=EnhanceImage(wand->images,wand->exception);
2930 if (enhance_image == (Image *) NULL)
2931 return(MagickFalse);
2932 ReplaceImageInList(&wand->images,enhance_image);
2937 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2941 % M a g i c k E q u a l i z e I m a g e %
2945 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2947 % MagickEqualizeImage() equalizes the image histogram.
2949 % The format of the MagickEqualizeImage method is:
2951 % MagickBooleanType MagickEqualizeImage(MagickWand *wand)
2952 % MagickBooleanType MagickEqualizeImageChannel(MagickWand *wand,
2953 % const ChannelType channel)
2955 % A description of each parameter follows:
2957 % o wand: the magick wand.
2959 % o channel: the image channel(s).
2963 WandExport MagickBooleanType MagickEqualizeImage(MagickWand *wand)
2968 status=MagickEqualizeImageChannel(wand,DefaultChannels);
2972 WandExport MagickBooleanType MagickEqualizeImageChannel(MagickWand *wand,
2973 const ChannelType channel)
2978 assert(wand != (MagickWand *) NULL);
2979 assert(wand->signature == WandSignature);
2980 if (wand->debug != MagickFalse)
2981 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2982 if (wand->images == (Image *) NULL)
2983 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2984 status=EqualizeImageChannel(wand->images,channel);
2985 if (status == MagickFalse)
2986 InheritException(wand->exception,&wand->images->exception);
2991 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2995 % M a g i c k E v a l u a t e I m a g e %
2999 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3001 % MagickEvaluateImage() applys an arithmetic, relational, or logical
3002 % expression to an image. Use these operators to lighten or darken an image,
3003 % to increase or decrease contrast in an image, or to produce the "negative"
3006 % The format of the MagickEvaluateImage method is:
3008 % MagickBooleanType MagickEvaluateImage(MagickWand *wand,
3009 % const MagickEvaluateOperator operator,const double value)
3010 % MagickBooleanType MagickEvaluateImages(MagickWand *wand,
3011 % const MagickEvaluateOperator operator)
3012 % MagickBooleanType MagickEvaluateImageChannel(MagickWand *wand,
3013 % const ChannelType channel,const MagickEvaluateOperator op,
3014 % const double value)
3016 % A description of each parameter follows:
3018 % o wand: the magick wand.
3020 % o channel: the channel(s).
3022 % o op: A channel operator.
3024 % o value: A value value.
3028 WandExport MagickBooleanType MagickEvaluateImage(MagickWand *wand,
3029 const MagickEvaluateOperator op,const double value)
3034 assert(wand != (MagickWand *) NULL);
3035 assert(wand->signature == WandSignature);
3036 if (wand->debug != MagickFalse)
3037 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3038 if (wand->images == (Image *) NULL)
3039 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3040 status=EvaluateImage(wand->images,op,value,&wand->images->exception);
3041 if (status == MagickFalse)
3042 InheritException(wand->exception,&wand->images->exception);
3046 WandExport MagickWand *MagickEvaluateImages(MagickWand *wand,
3047 const MagickEvaluateOperator op)
3052 assert(wand != (MagickWand *) NULL);
3053 assert(wand->signature == WandSignature);
3054 if (wand->debug != MagickFalse)
3055 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3056 if (wand->images == (Image *) NULL)
3057 return((MagickWand *) NULL);
3058 evaluate_image=EvaluateImages(wand->images,op,wand->exception);
3059 if (evaluate_image == (Image *) NULL)
3060 return((MagickWand *) NULL);
3061 return(CloneMagickWandFromImages(wand,evaluate_image));
3064 WandExport MagickBooleanType MagickEvaluateImageChannel(MagickWand *wand,
3065 const ChannelType channel,const MagickEvaluateOperator op,const double value)
3070 assert(wand != (MagickWand *) NULL);
3071 assert(wand->signature == WandSignature);
3072 if (wand->debug != MagickFalse)
3073 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3074 if (wand->images == (Image *) NULL)
3075 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3076 status=EvaluateImageChannel(wand->images,channel,op,value,
3077 &wand->images->exception);
3082 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3086 % M a g i c k E x p o r t I m a g e P i x e l s %
3090 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3092 % MagickExportImagePixels() extracts pixel data from an image and returns it
3093 % to you. The method returns MagickTrue on success otherwise MagickFalse if
3094 % an error is encountered. The data is returned as char, short int, int,
3095 % ssize_t, float, or double in the order specified by map.
3097 % Suppose you want to extract the first scanline of a 640x480 image as
3098 % character data in red-green-blue order:
3100 % MagickExportImagePixels(wand,0,0,640,1,"RGB",CharPixel,pixels);
3102 % The format of the MagickExportImagePixels method is:
3104 % MagickBooleanType MagickExportImagePixels(MagickWand *wand,
3105 % const ssize_t x,const ssize_t y,const size_t columns,
3106 % const size_t rows,const char *map,const StorageType storage,
3109 % A description of each parameter follows:
3111 % o wand: the magick wand.
3113 % o x, y, columns, rows: These values define the perimeter
3114 % of a region of pixels you want to extract.
3116 % o map: This string reflects the expected ordering of the pixel array.
3117 % It can be any combination or order of R = red, G = green, B = blue,
3118 % A = alpha (0 is transparent), O = opacity (0 is opaque), C = cyan,
3119 % Y = yellow, M = magenta, K = black, I = intensity (for grayscale),
3122 % o storage: Define the data type of the pixels. Float and double types are
3123 % expected to be normalized [0..1] otherwise [0..QuantumRange]. Choose from
3124 % these types: CharPixel, DoublePixel, FloatPixel, IntegerPixel,
3125 % LongPixel, QuantumPixel, or ShortPixel.
3127 % o pixels: This array of values contain the pixel components as defined by
3128 % map and type. You must preallocate this array where the expected
3129 % length varies depending on the values of width, height, map, and type.
3132 WandExport MagickBooleanType MagickExportImagePixels(MagickWand *wand,
3133 const ssize_t x,const ssize_t y,const size_t columns,
3134 const size_t rows,const char *map,const StorageType storage,
3140 assert(wand != (MagickWand *) NULL);
3141 assert(wand->signature == WandSignature);
3142 if (wand->debug != MagickFalse)
3143 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3144 if (wand->images == (Image *) NULL)
3145 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3146 status=ExportImagePixels(wand->images,x,y,columns,rows,map,
3147 storage,pixels,wand->exception);
3148 if (status == MagickFalse)
3149 InheritException(wand->exception,&wand->images->exception);
3154 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3158 % M a g i c k E x t e n t I m a g e %
3162 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3164 % MagickExtentImage() extends the image as defined by the geometry, gravity,
3165 % and wand background color. Set the (x,y) offset of the geometry to move
3166 % the original wand relative to the extended wand.
3168 % The format of the MagickExtentImage method is:
3170 % MagickBooleanType MagickExtentImage(MagickWand *wand,
3171 % const size_t width,const size_t height,const ssize_t x,
3174 % A description of each parameter follows:
3176 % o wand: the magick wand.
3178 % o width: the region width.
3180 % o height: the region height.
3182 % o x: the region x offset.
3184 % o y: the region y offset.
3187 WandExport MagickBooleanType MagickExtentImage(MagickWand *wand,
3188 const size_t width,const size_t height,const ssize_t x,
3197 assert(wand != (MagickWand *) NULL);
3198 assert(wand->signature == WandSignature);
3199 if (wand->debug != MagickFalse)
3200 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3201 if (wand->images == (Image *) NULL)
3202 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3204 extent.height=height;
3207 extent_image=ExtentImage(wand->images,&extent,wand->exception);
3208 if (extent_image == (Image *) NULL)
3209 return(MagickFalse);
3210 ReplaceImageInList(&wand->images,extent_image);
3215 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3219 % M a g i c k F i l t e r I m a g e %
3223 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3225 % MagickFilterImage() applies a custom convolution kernel to the image.
3227 % The format of the MagickFilterImage method is:
3229 % MagickBooleanType MagickFilterImage(MagickWand *wand,
3230 % const KernelInfo *kernel)
3231 % MagickBooleanType MagickFilterImageChannel(MagickWand *wand,
3232 % const ChannelType channel,const KernelInfo *kernel)
3234 % A description of each parameter follows:
3236 % o wand: the magick wand.
3238 % o channel: the image channel(s).
3240 % o kernel: An array of doubles representing the convolution kernel.
3244 WandExport MagickBooleanType MagickFilterImage(MagickWand *wand,
3245 const KernelInfo *kernel)
3250 status=MagickFilterImageChannel(wand,DefaultChannels,kernel);
3254 WandExport MagickBooleanType MagickFilterImageChannel(MagickWand *wand,
3255 const ChannelType channel,const KernelInfo *kernel)
3260 assert(wand != (MagickWand *) NULL);
3261 assert(wand->signature == WandSignature);
3262 if (wand->debug != MagickFalse)
3263 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3264 if (kernel == (const KernelInfo *) NULL)
3265 return(MagickFalse);
3266 if (wand->images == (Image *) NULL)
3267 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3268 filter_image=FilterImageChannel(wand->images,channel,kernel,wand->exception);
3269 if (filter_image == (Image *) NULL)
3270 return(MagickFalse);
3271 ReplaceImageInList(&wand->images,filter_image);
3276 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3280 % M a g i c k F l i p I m a g e %
3284 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3286 % MagickFlipImage() creates a vertical mirror image by reflecting the pixels
3287 % around the central x-axis.
3289 % The format of the MagickFlipImage method is:
3291 % MagickBooleanType MagickFlipImage(MagickWand *wand)
3293 % A description of each parameter follows:
3295 % o wand: the magick wand.
3298 WandExport MagickBooleanType MagickFlipImage(MagickWand *wand)
3303 assert(wand != (MagickWand *) NULL);
3304 assert(wand->signature == WandSignature);
3305 if (wand->debug != MagickFalse)
3306 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3307 if (wand->images == (Image *) NULL)
3308 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3309 flip_image=FlipImage(wand->images,wand->exception);
3310 if (flip_image == (Image *) NULL)
3311 return(MagickFalse);
3312 ReplaceImageInList(&wand->images,flip_image);
3317 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3321 % 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 %
3325 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3327 % MagickFloodfillPaintImage() changes the color value of any pixel that matches
3328 % target and is an immediate neighbor. If the method FillToBorderMethod is
3329 % specified, the color value is changed for any neighbor pixel that does not
3330 % match the bordercolor member of image.
3332 % The format of the MagickFloodfillPaintImage method is:
3334 % MagickBooleanType MagickFloodfillPaintImage(MagickWand *wand,
3335 % const ChannelType channel,const PixelWand *fill,const double fuzz,
3336 % const PixelWand *bordercolor,const ssize_t x,const ssize_t y,
3337 % const MagickBooleanType invert)
3339 % A description of each parameter follows:
3341 % o wand: the magick wand.
3343 % o channel: the channel(s).
3345 % o fill: the floodfill color pixel wand.
3347 % o fuzz: By default target must match a particular pixel color
3348 % exactly. However, in many cases two colors may differ by a small amount.
3349 % The fuzz member of image defines how much tolerance is acceptable to
3350 % consider two colors as the same. For example, set fuzz to 10 and the
3351 % color red at intensities of 100 and 102 respectively are now interpreted
3352 % as the same color for the purposes of the floodfill.
3354 % o bordercolor: the border color pixel wand.
3356 % o x,y: the starting location of the operation.
3358 % o invert: paint any pixel that does not match the target color.
3361 WandExport MagickBooleanType MagickFloodfillPaintImage(MagickWand *wand,
3362 const ChannelType channel,const PixelWand *fill,const double fuzz,
3363 const PixelWand *bordercolor,const ssize_t x,const ssize_t y,
3364 const MagickBooleanType invert)
3375 assert(wand != (MagickWand *) NULL);
3376 assert(wand->signature == WandSignature);
3377 if (wand->debug != MagickFalse)
3378 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3379 if (wand->images == (Image *) NULL)
3380 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3381 draw_info=CloneDrawInfo(wand->image_info,(DrawInfo *) NULL);
3382 PixelGetQuantumColor(fill,&draw_info->fill);
3383 (void) GetOneVirtualMagickPixel(wand->images,x % wand->images->columns,
3384 y % wand->images->rows,&target,wand->exception);
3385 if (bordercolor != (PixelWand *) NULL)
3386 PixelGetMagickColor(bordercolor,&target);
3387 wand->images->fuzz=fuzz;
3388 status=FloodfillPaintImage(wand->images,channel,draw_info,&target,x,y,
3390 if (status == MagickFalse)
3391 InheritException(wand->exception,&wand->images->exception);
3392 draw_info=DestroyDrawInfo(draw_info);
3397 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3401 % M a g i c k F l o p I m a g e %
3405 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3407 % MagickFlopImage() creates a horizontal mirror image by reflecting the pixels
3408 % around the central y-axis.
3410 % The format of the MagickFlopImage method is:
3412 % MagickBooleanType MagickFlopImage(MagickWand *wand)
3414 % A description of each parameter follows:
3416 % o wand: the magick wand.
3419 WandExport MagickBooleanType MagickFlopImage(MagickWand *wand)
3424 assert(wand != (MagickWand *) NULL);
3425 assert(wand->signature == WandSignature);
3426 if (wand->debug != MagickFalse)
3427 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3428 if (wand->images == (Image *) NULL)
3429 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3430 flop_image=FlopImage(wand->images,wand->exception);
3431 if (flop_image == (Image *) NULL)
3432 return(MagickFalse);
3433 ReplaceImageInList(&wand->images,flop_image);
3438 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3442 % 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 %
3446 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3448 % MagickForwardFourierTransformImage() implements the discrete Fourier
3449 % transform (DFT) of the image either as a magnitude / phase or real /
3450 % imaginary image pair.
3452 % The format of the MagickForwardFourierTransformImage method is:
3454 % MagickBooleanType MagickForwardFourierTransformImage(MagickWand *wand,
3455 % const MagickBooleanType magnitude)
3457 % A description of each parameter follows:
3459 % o wand: the magick wand.
3461 % o magnitude: if true, return as magnitude / phase pair otherwise a real /
3462 % imaginary image pair.
3465 WandExport MagickBooleanType MagickForwardFourierTransformImage(
3466 MagickWand *wand,const MagickBooleanType magnitude)
3471 assert(wand != (MagickWand *) NULL);
3472 assert(wand->signature == WandSignature);
3473 if (wand->debug != MagickFalse)
3474 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3475 if (wand->images == (Image *) NULL)
3476 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3477 forward_image=ForwardFourierTransformImage(wand->images,magnitude,
3479 if (forward_image == (Image *) NULL)
3480 return(MagickFalse);
3481 ReplaceImageInList(&wand->images,forward_image);
3486 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3490 % M a g i c k F r a m e I m a g e %
3494 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3496 % MagickFrameImage() adds a simulated three-dimensional border around the
3497 % image. The width and height specify the border width of the vertical and
3498 % horizontal sides of the frame. The inner and outer bevels indicate the
3499 % width of the inner and outer shadows of the frame.
3501 % The format of the MagickFrameImage method is:
3503 % MagickBooleanType MagickFrameImage(MagickWand *wand,
3504 % const PixelWand *matte_color,const size_t width,
3505 % const size_t height,const ssize_t inner_bevel,
3506 % const ssize_t outer_bevel)
3508 % A description of each parameter follows:
3510 % o wand: the magick wand.
3512 % o matte_color: the frame color pixel wand.
3514 % o width: the border width.
3516 % o height: the border height.
3518 % o inner_bevel: the inner bevel width.
3520 % o outer_bevel: the outer bevel width.
3523 WandExport MagickBooleanType MagickFrameImage(MagickWand *wand,
3524 const PixelWand *matte_color,const size_t width,
3525 const size_t height,const ssize_t inner_bevel,const ssize_t outer_bevel)
3533 assert(wand != (MagickWand *) NULL);
3534 assert(wand->signature == WandSignature);
3535 if (wand->debug != MagickFalse)
3536 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3537 if (wand->images == (Image *) NULL)
3538 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3539 (void) ResetMagickMemory(&frame_info,0,sizeof(frame_info));
3540 frame_info.width=wand->images->columns+2*width;
3541 frame_info.height=wand->images->rows+2*height;
3542 frame_info.x=(ssize_t) width;
3543 frame_info.y=(ssize_t) height;
3544 frame_info.inner_bevel=inner_bevel;
3545 frame_info.outer_bevel=outer_bevel;
3546 PixelGetQuantumColor(matte_color,&wand->images->matte_color);
3547 frame_image=FrameImage(wand->images,&frame_info,wand->exception);
3548 if (frame_image == (Image *) NULL)
3549 return(MagickFalse);
3550 ReplaceImageInList(&wand->images,frame_image);
3555 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3559 % M a g i c k F u n c t i o n I m a g e %
3563 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3565 % MagickFunctionImage() applys an arithmetic, relational, or logical
3566 % expression to an image. Use these operators to lighten or darken an image,
3567 % to increase or decrease contrast in an image, or to produce the "negative"
3570 % The format of the MagickFunctionImage method is:
3572 % MagickBooleanType MagickFunctionImage(MagickWand *wand,
3573 % const MagickFunction function,const size_t number_arguments,
3574 % const double *arguments)
3575 % MagickBooleanType MagickFunctionImageChannel(MagickWand *wand,
3576 % const ChannelType channel,const MagickFunction function,
3577 % const size_t number_arguments,const double *arguments)
3579 % A description of each parameter follows:
3581 % o wand: the magick wand.
3583 % o channel: the channel(s).
3585 % o function: the image function.
3587 % o number_arguments: the number of function arguments.
3589 % o arguments: the function arguments.
3593 WandExport MagickBooleanType MagickFunctionImage(MagickWand *wand,
3594 const MagickFunction function,const size_t number_arguments,
3595 const double *arguments)
3600 assert(wand != (MagickWand *) NULL);
3601 assert(wand->signature == WandSignature);
3602 if (wand->debug != MagickFalse)
3603 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3604 if (wand->images == (Image *) NULL)
3605 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3606 status=FunctionImage(wand->images,function,number_arguments,arguments,
3607 &wand->images->exception);
3608 if (status == MagickFalse)
3609 InheritException(wand->exception,&wand->images->exception);
3613 WandExport MagickBooleanType MagickFunctionImageChannel(MagickWand *wand,
3614 const ChannelType channel,const MagickFunction function,
3615 const size_t number_arguments,const double *arguments)
3620 assert(wand != (MagickWand *) NULL);
3621 assert(wand->signature == WandSignature);
3622 if (wand->debug != MagickFalse)
3623 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3624 if (wand->images == (Image *) NULL)
3625 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3626 status=FunctionImageChannel(wand->images,channel,function,number_arguments,
3627 arguments,&wand->images->exception);
3632 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3636 % M a g i c k F x I m a g e %
3640 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3642 % MagickFxImage() evaluate expression for each pixel in the image.
3644 % The format of the MagickFxImage method is:
3646 % MagickWand *MagickFxImage(MagickWand *wand,const char *expression)
3647 % MagickWand *MagickFxImageChannel(MagickWand *wand,
3648 % const ChannelType channel,const char *expression)
3650 % A description of each parameter follows:
3652 % o wand: the magick wand.
3654 % o channel: the image channel(s).
3656 % o expression: the expression.
3660 WandExport MagickWand *MagickFxImage(MagickWand *wand,const char *expression)
3665 fx_wand=MagickFxImageChannel(wand,DefaultChannels,expression);
3669 WandExport MagickWand *MagickFxImageChannel(MagickWand *wand,
3670 const ChannelType channel,const char *expression)
3675 assert(wand != (MagickWand *) NULL);
3676 assert(wand->signature == WandSignature);
3677 if (wand->debug != MagickFalse)
3678 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3679 if (wand->images == (Image *) NULL)
3680 return((MagickWand *) NULL);
3681 fx_image=FxImageChannel(wand->images,channel,expression,wand->exception);
3682 if (fx_image == (Image *) NULL)
3683 return((MagickWand *) NULL);
3684 return(CloneMagickWandFromImages(wand,fx_image));
3688 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3692 % M a g i c k G a m m a I m a g e %
3696 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3698 % MagickGammaImage() gamma-corrects an image. The same image viewed on
3699 % different devices will have perceptual differences in the way the image's
3700 % intensities are represented on the screen. Specify individual gamma levels
3701 % for the red, green, and blue channels, or adjust all three with the gamma
3702 % parameter. Values typically range from 0.8 to 2.3.
3704 % You can also reduce the influence of a particular channel with a gamma
3707 % The format of the MagickGammaImage method is:
3709 % MagickBooleanType MagickGammaImage(MagickWand *wand,const double gamma)
3710 % MagickBooleanType MagickGammaImageChannel(MagickWand *wand,
3711 % const ChannelType channel,const double gamma)
3713 % A description of each parameter follows:
3715 % o wand: the magick wand.
3717 % o channel: the channel.
3719 % o level: Define the level of gamma correction.
3723 WandExport MagickBooleanType MagickGammaImage(MagickWand *wand,
3729 status=MagickGammaImageChannel(wand,DefaultChannels,gamma);
3733 WandExport MagickBooleanType MagickGammaImageChannel(MagickWand *wand,
3734 const ChannelType channel,const double gamma)
3739 assert(wand != (MagickWand *) NULL);
3740 assert(wand->signature == WandSignature);
3741 if (wand->debug != MagickFalse)
3742 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3743 if (wand->images == (Image *) NULL)
3744 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3745 status=GammaImageChannel(wand->images,channel,gamma);
3746 if (status == MagickFalse)
3747 InheritException(wand->exception,&wand->images->exception);
3752 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3756 % M a g i c k G a u s s i a n B l u r I m a g e %
3760 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3762 % MagickGaussianBlurImage() blurs an image. We convolve the image with a
3763 % Gaussian operator of the given radius and standard deviation (sigma).
3764 % For reasonable results, the radius should be larger than sigma. Use a
3765 % radius of 0 and MagickGaussianBlurImage() selects a suitable radius for you.
3767 % The format of the MagickGaussianBlurImage method is:
3769 % MagickBooleanType MagickGaussianBlurImage(MagickWand *wand,
3770 % const double radius,const double sigma)
3771 % MagickBooleanType MagickGaussianBlurImageChannel(MagickWand *wand,
3772 % const ChannelType channel,const double radius,const double sigma)
3774 % A description of each parameter follows:
3776 % o wand: the magick wand.
3778 % o channel: the image channel(s).
3780 % o radius: the radius of the Gaussian, in pixels, not counting the center
3783 % o sigma: the standard deviation of the Gaussian, in pixels.
3787 WandExport MagickBooleanType MagickGaussianBlurImage(MagickWand *wand,
3788 const double radius,const double sigma)
3793 status=MagickGaussianBlurImageChannel(wand,DefaultChannels,radius,sigma);
3797 WandExport MagickBooleanType MagickGaussianBlurImageChannel(MagickWand *wand,
3798 const ChannelType channel,const double radius,const double sigma)
3803 assert(wand != (MagickWand *) NULL);
3804 assert(wand->signature == WandSignature);
3805 if (wand->debug != MagickFalse)
3806 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3807 if (wand->images == (Image *) NULL)
3808 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3809 blur_image=GaussianBlurImageChannel(wand->images,channel,radius,sigma,
3811 if (blur_image == (Image *) NULL)
3812 return(MagickFalse);
3813 ReplaceImageInList(&wand->images,blur_image);
3818 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3822 % M a g i c k G e t I m a g e %
3826 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3828 % MagickGetImage() gets the image at the current image index.
3830 % The format of the MagickGetImage method is:
3832 % MagickWand *MagickGetImage(MagickWand *wand)
3834 % A description of each parameter follows:
3836 % o wand: the magick wand.
3839 WandExport MagickWand *MagickGetImage(MagickWand *wand)
3844 assert(wand != (MagickWand *) NULL);
3845 assert(wand->signature == WandSignature);
3846 if (wand->debug != MagickFalse)
3847 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3848 if (wand->images == (Image *) NULL)
3850 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3851 "ContainsNoImages","`%s'",wand->name);
3852 return((MagickWand *) NULL);
3854 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
3855 if (image == (Image *) NULL)
3856 return((MagickWand *) NULL);
3857 return(CloneMagickWandFromImages(wand,image));
3861 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3865 % 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 %
3869 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3871 % MagickGetImageAlphaChannel() returns MagickFalse if the image alpha channel
3872 % is not activated. That is, the image is RGB rather than RGBA or CMYK rather
3875 % The format of the MagickGetImageAlphaChannel method is:
3877 % size_t MagickGetImageAlphaChannel(MagickWand *wand)
3879 % A description of each parameter follows:
3881 % o wand: the magick wand.
3884 WandExport MagickBooleanType MagickGetImageAlphaChannel(MagickWand *wand)
3886 assert(wand != (MagickWand *) NULL);
3887 assert(wand->signature == WandSignature);
3888 if (wand->debug != MagickFalse)
3889 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3890 if (wand->images == (Image *) NULL)
3891 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3892 return(GetImageAlphaChannel(wand->images));
3896 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3900 % M a g i c k G e t I m a g e C l i p M a s k %
3904 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3906 % MagickGetImageClipMask() gets the image clip mask at the current image index.
3908 % The format of the MagickGetImageClipMask method is:
3910 % MagickWand *MagickGetImageClipMask(MagickWand *wand)
3912 % A description of each parameter follows:
3914 % o wand: the magick wand.
3917 WandExport MagickWand *MagickGetImageClipMask(MagickWand *wand)
3922 assert(wand != (MagickWand *) NULL);
3923 assert(wand->signature == WandSignature);
3924 if (wand->debug != MagickFalse)
3925 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3926 if (wand->images == (Image *) NULL)
3928 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3929 "ContainsNoImages","`%s'",wand->name);
3930 return((MagickWand *) NULL);
3932 image=GetImageClipMask(wand->images,wand->exception);
3933 if (image == (Image *) NULL)
3934 return((MagickWand *) NULL);
3935 return(CloneMagickWandFromImages(wand,image));
3939 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3943 % 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 %
3947 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3949 % MagickGetImageBackgroundColor() returns the image background color.
3951 % The format of the MagickGetImageBackgroundColor method is:
3953 % MagickBooleanType MagickGetImageBackgroundColor(MagickWand *wand,
3954 % PixelWand *background_color)
3956 % A description of each parameter follows:
3958 % o wand: the magick wand.
3960 % o background_color: Return the background color.
3963 WandExport MagickBooleanType MagickGetImageBackgroundColor(MagickWand *wand,
3964 PixelWand *background_color)
3966 assert(wand != (MagickWand *) NULL);
3967 assert(wand->signature == WandSignature);
3968 if (wand->debug != MagickFalse)
3969 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3970 if (wand->images == (Image *) NULL)
3971 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3972 PixelSetQuantumColor(background_color,&wand->images->background_color);
3977 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3981 % M a g i c k G e t I m a g e B l o b %
3985 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3987 % MagickGetImageBlob() implements direct to memory image formats. It
3988 % returns the image as a blob and its length. Use MagickSetFormat() to
3989 % set the format of the returned blob (GIF, JPEG, PNG, etc.).
3991 % Use MagickRelinquishMemory() to free the blob when you are done with it.
3993 % The format of the MagickGetImageBlob method is:
3995 % unsigned char *MagickGetImageBlob(MagickWand *wand,size_t *length)
3997 % A description of each parameter follows:
3999 % o wand: the magick wand.
4001 % o length: the length of the blob.
4004 WandExport unsigned char *MagickGetImageBlob(MagickWand *wand,size_t *length)
4006 assert(wand != (MagickWand *) NULL);
4007 assert(wand->signature == WandSignature);
4008 if (wand->debug != MagickFalse)
4009 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4010 if (wand->images == (Image *) NULL)
4012 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4013 "ContainsNoImages","`%s'",wand->name);
4014 return((unsigned char *) NULL);
4016 return(ImageToBlob(wand->image_info,wand->images,length,wand->exception));
4020 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4024 % M a g i c k G e t I m a g e s B l o b %
4028 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4030 % MagickGetImageBlob() implements direct to memory image formats. It
4031 % returns the image sequence as a blob and its length. The format of the image
4032 % determines the format of the returned blob (GIF, JPEG, PNG, etc.). To
4033 % return a different image format, use MagickSetImageFormat().
4035 % Note, some image formats do not permit multiple images to the same image
4036 % stream (e.g. JPEG). in this instance, just the first image of the
4037 % sequence is returned as a blob.
4039 % The format of the MagickGetImagesBlob method is:
4041 % unsigned char *MagickGetImagesBlob(MagickWand *wand,size_t *length)
4043 % A description of each parameter follows:
4045 % o wand: the magick wand.
4047 % o length: the length of the blob.
4050 WandExport unsigned char *MagickGetImagesBlob(MagickWand *wand,size_t *length)
4055 assert(wand != (MagickWand *) NULL);
4056 assert(wand->signature == WandSignature);
4057 if (wand->debug != MagickFalse)
4058 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4059 if (wand->images == (Image *) NULL)
4061 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4062 "ContainsNoImages","`%s'",wand->name);
4063 return((unsigned char *) NULL);
4065 blob=ImagesToBlob(wand->image_info,GetFirstImageInList(wand->images),length,
4071 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4075 % 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 %
4079 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4081 % MagickGetImageBluePrimary() returns the chromaticy blue primary point for the
4084 % The format of the MagickGetImageBluePrimary method is:
4086 % MagickBooleanType MagickGetImageBluePrimary(MagickWand *wand,double *x,
4089 % A description of each parameter follows:
4091 % o wand: the magick wand.
4093 % o x: the chromaticity blue primary x-point.
4095 % o y: the chromaticity blue primary y-point.
4098 WandExport MagickBooleanType MagickGetImageBluePrimary(MagickWand *wand,
4099 double *x,double *y)
4101 assert(wand != (MagickWand *) NULL);
4102 assert(wand->signature == WandSignature);
4103 if (wand->debug != MagickFalse)
4104 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4105 if (wand->images == (Image *) NULL)
4106 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4107 *x=wand->images->chromaticity.blue_primary.x;
4108 *y=wand->images->chromaticity.blue_primary.y;
4113 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4117 % 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 %
4121 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4123 % MagickGetImageBorderColor() returns the image border color.
4125 % The format of the MagickGetImageBorderColor method is:
4127 % MagickBooleanType MagickGetImageBorderColor(MagickWand *wand,
4128 % PixelWand *border_color)
4130 % A description of each parameter follows:
4132 % o wand: the magick wand.
4134 % o border_color: Return the border color.
4137 WandExport MagickBooleanType MagickGetImageBorderColor(MagickWand *wand,
4138 PixelWand *border_color)
4140 assert(wand != (MagickWand *) NULL);
4141 assert(wand->signature == WandSignature);
4142 if (wand->debug != MagickFalse)
4143 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4144 if (wand->images == (Image *) NULL)
4145 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4146 PixelSetQuantumColor(border_color,&wand->images->border_color);
4151 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4155 % 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 %
4159 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4161 % MagickGetImageChannelDepth() gets the depth for one or more image channels.
4163 % The format of the MagickGetImageChannelDepth method is:
4165 % size_t MagickGetImageChannelDepth(MagickWand *wand,
4166 % const ChannelType channel)
4168 % A description of each parameter follows:
4170 % o wand: the magick wand.
4172 % o channel: the image channel(s).
4175 WandExport size_t MagickGetImageChannelDepth(MagickWand *wand,
4176 const ChannelType channel)
4178 assert(wand != (MagickWand *) NULL);
4179 assert(wand->signature == WandSignature);
4180 if (wand->debug != MagickFalse)
4181 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4182 if (wand->images == (Image *) NULL)
4183 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4184 return(GetImageChannelDepth(wand->images,channel,wand->exception));
4188 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4192 % 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 %
4196 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4198 % MagickGetImageChannelDistortion() compares one or more image channels of an
4199 % image to a reconstructed image and returns the specified distortion metric.
4201 % The format of the MagickGetImageChannelDistortion method is:
4203 % MagickBooleanType MagickGetImageChannelDistortion(MagickWand *wand,
4204 % const MagickWand *reference,const ChannelType channel,
4205 % const MetricType metric,double *distortion)
4207 % A description of each parameter follows:
4209 % o wand: the magick wand.
4211 % o reference: the reference wand.
4213 % o channel: the channel.
4215 % o metric: the metric.
4217 % o distortion: the computed distortion between the images.
4220 WandExport MagickBooleanType MagickGetImageChannelDistortion(MagickWand *wand,
4221 const MagickWand *reference,const ChannelType channel,const MetricType metric,
4227 assert(wand != (MagickWand *) NULL);
4228 assert(wand->signature == WandSignature);
4229 if (wand->debug != MagickFalse)
4230 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4231 assert(reference != (MagickWand *) NULL);
4232 assert(reference->signature == WandSignature);
4233 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
4234 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4235 status=GetImageChannelDistortion(wand->images,reference->images,channel,
4236 metric,distortion,&wand->images->exception);
4241 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4245 % 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 %
4249 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4251 % MagickGetImageChannelDistortions() compares one or more image channels of an
4252 % image to a reconstructed image and returns the specified distortion metrics.
4254 % Use MagickRelinquishMemory() to free the metrics when you are done with them.
4256 % The format of the MagickGetImageChannelDistortion method is:
4258 % double *MagickGetImageChannelDistortion(MagickWand *wand,
4259 % const MagickWand *reference,const MetricType metric)
4261 % A description of each parameter follows:
4263 % o wand: the magick wand.
4265 % o reference: the reference wand.
4267 % o metric: the metric.
4270 WandExport double *MagickGetImageChannelDistortions(MagickWand *wand,
4271 const MagickWand *reference,const MetricType metric)
4274 *channel_distortion;
4276 assert(wand != (MagickWand *) NULL);
4277 assert(wand->signature == WandSignature);
4278 if (wand->debug != MagickFalse)
4279 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4280 assert(reference != (MagickWand *) NULL);
4281 assert(reference->signature == WandSignature);
4282 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
4284 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4285 "ContainsNoImages","`%s'",wand->name);
4286 return((double *) NULL);
4288 channel_distortion=GetImageChannelDistortions(wand->images,reference->images,
4289 metric,&wand->images->exception);
4290 return(channel_distortion);
4294 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4298 % 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 %
4302 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4304 % MagickGetImageChannelFeatures() returns features for each channel in the
4305 % image in each of four directions (horizontal, vertical, left and right
4306 % diagonals) for the specified distance. The features include the angular
4307 % second moment, contrast, correlation, sum of squares: variance, inverse
4308 % difference moment, sum average, sum varience, sum entropy, entropy,
4309 % difference variance, difference entropy, information measures of
4310 % correlation 1, information measures of correlation 2, and maximum
4311 % correlation coefficient. You can access the red channel contrast, for
4312 % example, like this:
4314 % channel_features=MagickGetImageChannelFeatures(wand,1);
4315 % contrast=channel_features[RedChannel].contrast[0];
4317 % Use MagickRelinquishMemory() to free the statistics buffer.
4319 % The format of the MagickGetImageChannelFeatures method is:
4321 % ChannelFeatures *MagickGetImageChannelFeatures(MagickWand *wand,
4322 % const size_t distance)
4324 % A description of each parameter follows:
4326 % o wand: the magick wand.
4328 % o distance: the distance.
4331 WandExport ChannelFeatures *MagickGetImageChannelFeatures(MagickWand *wand,
4332 const size_t distance)
4334 assert(wand != (MagickWand *) NULL);
4335 assert(wand->signature == WandSignature);
4336 if (wand->debug != MagickFalse)
4337 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4338 if (wand->images == (Image *) NULL)
4340 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4341 "ContainsNoImages","`%s'",wand->name);
4342 return((ChannelFeatures *) NULL);
4344 return(GetImageChannelFeatures(wand->images,distance,wand->exception));
4348 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4352 % 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 %
4356 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4358 % MagickGetImageChannelKurtosis() gets the kurtosis and skewness of one or
4359 % more image channels.
4361 % The format of the MagickGetImageChannelKurtosis method is:
4363 % MagickBooleanType MagickGetImageChannelKurtosis(MagickWand *wand,
4364 % const ChannelType channel,double *kurtosis,double *skewness)
4366 % A description of each parameter follows:
4368 % o wand: the magick wand.
4370 % o channel: the image channel(s).
4372 % o kurtosis: The kurtosis for the specified channel(s).
4374 % o skewness: The skewness for the specified channel(s).
4377 WandExport MagickBooleanType MagickGetImageChannelKurtosis(MagickWand *wand,
4378 const ChannelType channel,double *kurtosis,double *skewness)
4383 assert(wand != (MagickWand *) NULL);
4384 assert(wand->signature == WandSignature);
4385 if (wand->debug != MagickFalse)
4386 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4387 if (wand->images == (Image *) NULL)
4388 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4389 status=GetImageChannelKurtosis(wand->images,channel,kurtosis,skewness,
4395 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4399 % 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 %
4403 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4405 % MagickGetImageChannelMean() gets the mean and standard deviation of one or
4406 % more image channels.
4408 % The format of the MagickGetImageChannelMean method is:
4410 % MagickBooleanType MagickGetImageChannelMean(MagickWand *wand,
4411 % const ChannelType channel,double *mean,double *standard_deviation)
4413 % A description of each parameter follows:
4415 % o wand: the magick wand.
4417 % o channel: the image channel(s).
4419 % o mean: The mean pixel value for the specified channel(s).
4421 % o standard_deviation: The standard deviation for the specified channel(s).
4424 WandExport MagickBooleanType MagickGetImageChannelMean(MagickWand *wand,
4425 const ChannelType channel,double *mean,double *standard_deviation)
4430 assert(wand != (MagickWand *) NULL);
4431 assert(wand->signature == WandSignature);
4432 if (wand->debug != MagickFalse)
4433 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4434 if (wand->images == (Image *) NULL)
4435 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4436 status=GetImageChannelMean(wand->images,channel,mean,standard_deviation,
4442 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4446 % 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 %
4450 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4452 % MagickGetImageChannelRange() gets the range for one or more image channels.
4454 % The format of the MagickGetImageChannelRange method is:
4456 % MagickBooleanType MagickGetImageChannelRange(MagickWand *wand,
4457 % const ChannelType channel,double *minima,double *maxima)
4459 % A description of each parameter follows:
4461 % o wand: the magick wand.
4463 % o channel: the image channel(s).
4465 % o minima: The minimum pixel value for the specified channel(s).
4467 % o maxima: The maximum pixel value for the specified channel(s).
4470 WandExport MagickBooleanType MagickGetImageChannelRange(MagickWand *wand,
4471 const ChannelType channel,double *minima,double *maxima)
4476 assert(wand != (MagickWand *) NULL);
4477 assert(wand->signature == WandSignature);
4478 if (wand->debug != MagickFalse)
4479 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4480 if (wand->images == (Image *) NULL)
4481 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4482 status=GetImageChannelRange(wand->images,channel,minima,maxima,
4488 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4492 % 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 %
4496 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4498 % MagickGetImageChannelStatistics() returns statistics for each channel in the
4499 % image. The statistics include the channel depth, its minima and
4500 % maxima, the mean, the standard deviation, the kurtosis and the skewness.
4501 % You can access the red channel mean, for example, like this:
4503 % channel_statistics=MagickGetImageChannelStatistics(wand);
4504 % red_mean=channel_statistics[RedChannel].mean;
4506 % Use MagickRelinquishMemory() to free the statistics buffer.
4508 % The format of the MagickGetImageChannelStatistics method is:
4510 % ChannelStatistics *MagickGetImageChannelStatistics(MagickWand *wand)
4512 % A description of each parameter follows:
4514 % o wand: the magick wand.
4517 WandExport ChannelStatistics *MagickGetImageChannelStatistics(MagickWand *wand)
4519 assert(wand != (MagickWand *) NULL);
4520 assert(wand->signature == WandSignature);
4521 if (wand->debug != MagickFalse)
4522 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4523 if (wand->images == (Image *) NULL)
4525 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4526 "ContainsNoImages","`%s'",wand->name);
4527 return((ChannelStatistics *) NULL);
4529 return(GetImageChannelStatistics(wand->images,wand->exception));
4533 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4537 % 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 %
4541 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4543 % MagickGetImageColormapColor() returns the color of the specified colormap
4546 % The format of the MagickGetImageColormapColor method is:
4548 % MagickBooleanType MagickGetImageColormapColor(MagickWand *wand,
4549 % const size_t index,PixelWand *color)
4551 % A description of each parameter follows:
4553 % o wand: the magick wand.
4555 % o index: the offset into the image colormap.
4557 % o color: Return the colormap color in this wand.
4560 WandExport MagickBooleanType MagickGetImageColormapColor(MagickWand *wand,
4561 const size_t index,PixelWand *color)
4563 assert(wand != (MagickWand *) NULL);
4564 assert(wand->signature == WandSignature);
4565 if (wand->debug != MagickFalse)
4566 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4567 if (wand->images == (Image *) NULL)
4568 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4569 if ((wand->images->colormap == (PixelPacket *) NULL) ||
4570 (index >= wand->images->colors))
4572 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4573 "InvalidColormapIndex","`%s'",wand->name);
4574 return(MagickFalse);
4576 PixelSetQuantumColor(color,wand->images->colormap+index);
4581 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4585 % M a g i c k G e t I m a g e C o l o r s %
4589 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4591 % MagickGetImageColors() gets the number of unique colors in the image.
4593 % The format of the MagickGetImageColors method is:
4595 % size_t MagickGetImageColors(MagickWand *wand)
4597 % A description of each parameter follows:
4599 % o wand: the magick wand.
4602 WandExport size_t MagickGetImageColors(MagickWand *wand)
4604 assert(wand != (MagickWand *) NULL);
4605 assert(wand->signature == WandSignature);
4606 if (wand->debug != MagickFalse)
4607 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4608 if (wand->images == (Image *) NULL)
4610 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4611 "ContainsNoImages","`%s'",wand->name);
4614 return(GetNumberColors(wand->images,(FILE *) NULL,wand->exception));
4618 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4622 % M a g i c k G e t I m a g e C o l o r s p a c e %
4626 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4628 % MagickGetImageColorspace() gets the image colorspace.
4630 % The format of the MagickGetImageColorspace method is:
4632 % ColorspaceType MagickGetImageColorspace(MagickWand *wand)
4634 % A description of each parameter follows:
4636 % o wand: the magick wand.
4639 WandExport ColorspaceType MagickGetImageColorspace(MagickWand *wand)
4641 assert(wand != (MagickWand *) NULL);
4642 assert(wand->signature == WandSignature);
4643 if (wand->debug != MagickFalse)
4644 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4645 if (wand->images == (Image *) NULL)
4647 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4648 "ContainsNoImages","`%s'",wand->name);
4649 return(UndefinedColorspace);
4651 return(wand->images->colorspace);
4655 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4659 % M a g i c k G e t I m a g e C o m p o s e %
4663 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4665 % MagickGetImageCompose() returns the composite operator associated with the
4668 % The format of the MagickGetImageCompose method is:
4670 % CompositeOperator MagickGetImageCompose(MagickWand *wand)
4672 % A description of each parameter follows:
4674 % o wand: the magick wand.
4677 WandExport CompositeOperator MagickGetImageCompose(MagickWand *wand)
4679 assert(wand != (MagickWand *) NULL);
4680 assert(wand->signature == WandSignature);
4681 if (wand->debug != MagickFalse)
4682 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4683 if (wand->images == (Image *) NULL)
4685 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4686 "ContainsNoImages","`%s'",wand->name);
4687 return(UndefinedCompositeOp);
4689 return(wand->images->compose);
4693 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4697 % 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 %
4701 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4703 % MagickGetImageCompression() gets the image compression.
4705 % The format of the MagickGetImageCompression method is:
4707 % CompressionType MagickGetImageCompression(MagickWand *wand)
4709 % A description of each parameter follows:
4711 % o wand: the magick wand.
4714 WandExport CompressionType MagickGetImageCompression(MagickWand *wand)
4716 assert(wand != (MagickWand *) NULL);
4717 assert(wand->signature == WandSignature);
4718 if (wand->debug != MagickFalse)
4719 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4720 if (wand->images == (Image *) NULL)
4722 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4723 "ContainsNoImages","`%s'",wand->name);
4724 return(UndefinedCompression);
4726 return(wand->images->compression);
4730 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4734 % 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 %
4738 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4740 % MagickGetImageCompression() gets the image compression quality.
4742 % The format of the MagickGetImageCompression method is:
4744 % size_t MagickGetImageCompression(MagickWand *wand)
4746 % A description of each parameter follows:
4748 % o wand: the magick wand.
4751 WandExport size_t MagickGetImageCompressionQuality(MagickWand *wand)
4753 assert(wand != (MagickWand *) NULL);
4754 assert(wand->signature == WandSignature);
4755 if (wand->debug != MagickFalse)
4756 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4757 if (wand->images == (Image *) NULL)
4759 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4760 "ContainsNoImages","`%s'",wand->name);
4763 return(wand->images->quality);
4767 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4771 % M a g i c k G e t I m a g e D e l a y %
4775 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4777 % MagickGetImageDelay() gets the image delay.
4779 % The format of the MagickGetImageDelay method is:
4781 % size_t MagickGetImageDelay(MagickWand *wand)
4783 % A description of each parameter follows:
4785 % o wand: the magick wand.
4788 WandExport size_t MagickGetImageDelay(MagickWand *wand)
4790 assert(wand != (MagickWand *) NULL);
4791 assert(wand->signature == WandSignature);
4792 if (wand->debug != MagickFalse)
4793 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4794 if (wand->images == (Image *) NULL)
4795 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4796 return(wand->images->delay);
4800 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4804 % M a g i c k G e t I m a g e D e p t h %
4808 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4810 % MagickGetImageDepth() gets the image depth.
4812 % The format of the MagickGetImageDepth method is:
4814 % size_t MagickGetImageDepth(MagickWand *wand)
4816 % A description of each parameter follows:
4818 % o wand: the magick wand.
4821 WandExport size_t MagickGetImageDepth(MagickWand *wand)
4823 assert(wand != (MagickWand *) NULL);
4824 assert(wand->signature == WandSignature);
4825 if (wand->debug != MagickFalse)
4826 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4827 if (wand->images == (Image *) NULL)
4828 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4829 return(wand->images->depth);
4833 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4837 % M a g i c k G e t I m a g e D i s t o r t i o n %
4841 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4843 % MagickGetImageDistortion() compares an image to a reconstructed image and
4844 % returns the specified distortion metric.
4846 % The format of the MagickGetImageDistortion method is:
4848 % MagickBooleanType MagickGetImageDistortion(MagickWand *wand,
4849 % const MagickWand *reference,const MetricType metric,
4850 % double *distortion)
4852 % A description of each parameter follows:
4854 % o wand: the magick wand.
4856 % o reference: the reference wand.
4858 % o metric: the metric.
4860 % o distortion: the computed distortion between the images.
4863 WandExport MagickBooleanType MagickGetImageDistortion(MagickWand *wand,
4864 const MagickWand *reference,const MetricType metric,double *distortion)
4870 assert(wand != (MagickWand *) NULL);
4871 assert(wand->signature == WandSignature);
4872 if (wand->debug != MagickFalse)
4873 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4874 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
4875 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4876 status=GetImageDistortion(wand->images,reference->images,metric,distortion,
4877 &wand->images->exception);
4882 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4886 % M a g i c k G e t I m a g e D i s p o s e %
4890 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4892 % MagickGetImageDispose() gets the image disposal method.
4894 % The format of the MagickGetImageDispose method is:
4896 % DisposeType MagickGetImageDispose(MagickWand *wand)
4898 % A description of each parameter follows:
4900 % o wand: the magick wand.
4903 WandExport DisposeType MagickGetImageDispose(MagickWand *wand)
4905 assert(wand != (MagickWand *) NULL);
4906 assert(wand->signature == WandSignature);
4907 if (wand->debug != MagickFalse)
4908 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4909 if (wand->images == (Image *) NULL)
4911 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4912 "ContainsNoImages","`%s'",wand->name);
4913 return(UndefinedDispose);
4915 return((DisposeType) wand->images->dispose);
4919 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4923 % M a g i c k G e t I m a g e F i l e n a m e %
4927 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4929 % MagickGetImageFilename() returns the filename of a particular image in a
4932 % The format of the MagickGetImageFilename method is:
4934 % char *MagickGetImageFilename(MagickWand *wand)
4936 % A description of each parameter follows:
4938 % o wand: the magick wand.
4941 WandExport char *MagickGetImageFilename(MagickWand *wand)
4943 assert(wand != (MagickWand *) NULL);
4944 assert(wand->signature == WandSignature);
4945 if (wand->debug != MagickFalse)
4946 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4947 if (wand->images == (Image *) NULL)
4949 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4950 "ContainsNoImages","`%s'",wand->name);
4951 return((char *) NULL);
4953 return(AcquireString(wand->images->filename));
4957 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4961 % M a g i c k G e t I m a g e F o r m a t %
4965 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4967 % MagickGetImageFormat() returns the format of a particular image in a
4970 % The format of the MagickGetImageFormat method is:
4972 % const char MagickGetImageFormat(MagickWand *wand)
4974 % A description of each parameter follows:
4976 % o wand: the magick wand.
4979 WandExport char *MagickGetImageFormat(MagickWand *wand)
4981 assert(wand != (MagickWand *) NULL);
4982 assert(wand->signature == WandSignature);
4983 if (wand->debug != MagickFalse)
4984 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4985 if (wand->images == (Image *) NULL)
4987 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4988 "ContainsNoImages","`%s'",wand->name);
4989 return((char *) NULL);
4991 return(AcquireString(wand->images->magick));
4995 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4999 % M a g i c k G e t I m a g e F u z z %
5003 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5005 % MagickGetImageFuzz() gets the image fuzz.
5007 % The format of the MagickGetImageFuzz method is:
5009 % double MagickGetImageFuzz(MagickWand *wand)
5011 % A description of each parameter follows:
5013 % o wand: the magick wand.
5016 WandExport double MagickGetImageFuzz(MagickWand *wand)
5018 assert(wand != (MagickWand *) NULL);
5019 assert(wand->signature == WandSignature);
5020 if (wand->debug != MagickFalse)
5021 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5022 if (wand->images == (Image *) NULL)
5024 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5025 "ContainsNoImages","`%s'",wand->name);
5028 return(wand->images->fuzz);
5032 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5036 % M a g i c k G e t I m a g e G a m m a %
5040 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5042 % MagickGetImageGamma() gets the image gamma.
5044 % The format of the MagickGetImageGamma method is:
5046 % double MagickGetImageGamma(MagickWand *wand)
5048 % A description of each parameter follows:
5050 % o wand: the magick wand.
5053 WandExport double MagickGetImageGamma(MagickWand *wand)
5055 assert(wand != (MagickWand *) NULL);
5056 assert(wand->signature == WandSignature);
5057 if (wand->debug != MagickFalse)
5058 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5059 if (wand->images == (Image *) NULL)
5061 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5062 "ContainsNoImages","`%s'",wand->name);
5065 return(wand->images->gamma);
5069 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5073 % 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 %
5077 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5079 % MagickGetImageGravity() gets the image gravity.
5081 % The format of the MagickGetImageGravity method is:
5083 % GravityType MagickGetImageGravity(MagickWand *wand)
5085 % A description of each parameter follows:
5087 % o wand: the magick wand.
5090 WandExport GravityType MagickGetImageGravity(MagickWand *wand)
5092 assert(wand != (MagickWand *) NULL);
5093 assert(wand->signature == WandSignature);
5094 if (wand->debug != MagickFalse)
5095 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5096 if (wand->images == (Image *) NULL)
5098 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5099 "ContainsNoImages","`%s'",wand->name);
5100 return(UndefinedGravity);
5102 return(wand->images->gravity);
5106 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5110 % 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 %
5114 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5116 % MagickGetImageGreenPrimary() returns the chromaticy green primary point.
5118 % The format of the MagickGetImageGreenPrimary method is:
5120 % MagickBooleanType MagickGetImageGreenPrimary(MagickWand *wand,double *x,
5123 % A description of each parameter follows:
5125 % o wand: the magick wand.
5127 % o x: the chromaticity green primary x-point.
5129 % o y: the chromaticity green primary y-point.
5132 WandExport MagickBooleanType MagickGetImageGreenPrimary(MagickWand *wand,
5133 double *x,double *y)
5135 assert(wand != (MagickWand *) NULL);
5136 assert(wand->signature == WandSignature);
5137 if (wand->debug != MagickFalse)
5138 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5139 if (wand->images == (Image *) NULL)
5140 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5141 *x=wand->images->chromaticity.green_primary.x;
5142 *y=wand->images->chromaticity.green_primary.y;
5147 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5151 % M a g i c k G e t I m a g e H e i g h t %
5155 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5157 % MagickGetImageHeight() returns the image height.
5159 % The format of the MagickGetImageHeight method is:
5161 % size_t MagickGetImageHeight(MagickWand *wand)
5163 % A description of each parameter follows:
5165 % o wand: the magick wand.
5168 WandExport size_t MagickGetImageHeight(MagickWand *wand)
5170 assert(wand != (MagickWand *) NULL);
5171 assert(wand->signature == WandSignature);
5172 if (wand->debug != MagickFalse)
5173 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5174 if (wand->images == (Image *) NULL)
5175 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5176 return(wand->images->rows);
5180 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5184 % M a g i c k G e t I m a g e H i s t o g r a m %
5188 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5190 % MagickGetImageHistogram() returns the image histogram as an array of
5193 % The format of the MagickGetImageHistogram method is:
5195 % PixelWand **MagickGetImageHistogram(MagickWand *wand,
5196 % size_t *number_colors)
5198 % A description of each parameter follows:
5200 % o wand: the magick wand.
5202 % o number_colors: the number of unique colors in the image and the number
5203 % of pixel wands returned.
5206 WandExport PixelWand **MagickGetImageHistogram(MagickWand *wand,
5207 size_t *number_colors)
5218 assert(wand != (MagickWand *) NULL);
5219 assert(wand->signature == WandSignature);
5220 if (wand->debug != MagickFalse)
5221 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5222 if (wand->images == (Image *) NULL)
5224 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5225 "ContainsNoImages","`%s'",wand->name);
5226 return((PixelWand **) NULL);
5228 histogram=GetImageHistogram(wand->images,number_colors,wand->exception);
5229 if (histogram == (ColorPacket *) NULL)
5230 return((PixelWand **) NULL);
5231 pixel_wands=NewPixelWands(*number_colors);
5232 for (i=0; i < (ssize_t) *number_colors; i++)
5234 PixelSetQuantumColor(pixel_wands[i],&histogram[i].pixel);
5235 PixelSetIndex(pixel_wands[i],histogram[i].index);
5236 PixelSetColorCount(pixel_wands[i],(size_t) histogram[i].count);
5238 histogram=(ColorPacket *) RelinquishMagickMemory(histogram);
5239 return(pixel_wands);
5243 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5247 % 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 %
5251 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5253 % MagickGetImageInterlaceScheme() gets the image interlace scheme.
5255 % The format of the MagickGetImageInterlaceScheme method is:
5257 % InterlaceType MagickGetImageInterlaceScheme(MagickWand *wand)
5259 % A description of each parameter follows:
5261 % o wand: the magick wand.
5264 WandExport InterlaceType MagickGetImageInterlaceScheme(MagickWand *wand)
5266 assert(wand != (MagickWand *) NULL);
5267 assert(wand->signature == WandSignature);
5268 if (wand->debug != MagickFalse)
5269 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5270 if (wand->images == (Image *) NULL)
5272 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5273 "ContainsNoImages","`%s'",wand->name);
5274 return(UndefinedInterlace);
5276 return(wand->images->interlace);
5280 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5284 % 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 %
5288 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5290 % MagickGetImageInterpolateMethod() returns the interpolation method for the
5293 % The format of the MagickGetImageInterpolateMethod method is:
5295 % InterpolatePixelMethod MagickGetImageInterpolateMethod(MagickWand *wand)
5297 % A description of each parameter follows:
5299 % o wand: the magick wand.
5302 WandExport InterpolatePixelMethod MagickGetImageInterpolateMethod(
5305 assert(wand != (MagickWand *) NULL);
5306 assert(wand->signature == WandSignature);
5307 if (wand->debug != MagickFalse)
5308 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5309 if (wand->images == (Image *) NULL)
5311 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5312 "ContainsNoImages","`%s'",wand->name);
5313 return(UndefinedInterpolatePixel);
5315 return(wand->images->interpolate);
5319 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5323 % M a g i c k G e t I m a g e I t e r a t i o n s %
5327 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5329 % MagickGetImageIterations() gets the image iterations.
5331 % The format of the MagickGetImageIterations method is:
5333 % size_t MagickGetImageIterations(MagickWand *wand)
5335 % A description of each parameter follows:
5337 % o wand: the magick wand.
5340 WandExport size_t MagickGetImageIterations(MagickWand *wand)
5342 assert(wand != (MagickWand *) NULL);
5343 assert(wand->signature == WandSignature);
5344 if (wand->debug != MagickFalse)
5345 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5346 if (wand->images == (Image *) NULL)
5347 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5348 return(wand->images->iterations);
5352 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5356 % M a g i c k G e t I m a g e L e n g t h %
5360 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5362 % MagickGetImageLength() returns the image length in bytes.
5364 % The format of the MagickGetImageLength method is:
5366 % MagickBooleanType MagickGetImageLength(MagickWand *wand,
5367 % MagickSizeType *length)
5369 % A description of each parameter follows:
5371 % o wand: the magick wand.
5373 % o length: the image length in bytes.
5376 WandExport MagickBooleanType MagickGetImageLength(MagickWand *wand,
5377 MagickSizeType *length)
5379 assert(wand != (MagickWand *) NULL);
5380 assert(wand->signature == WandSignature);
5381 if (wand->debug != MagickFalse)
5382 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5383 if (wand->images == (Image *) NULL)
5384 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5385 *length=GetBlobSize(wand->images);
5390 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5394 % M a g i c k G e t I m a g e M a t t e C o l o r %
5398 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5400 % MagickGetImageMatteColor() returns the image matte color.
5402 % The format of the MagickGetImageMatteColor method is:
5404 % MagickBooleanType MagickGetImagematteColor(MagickWand *wand,
5405 % PixelWand *matte_color)
5407 % A description of each parameter follows:
5409 % o wand: the magick wand.
5411 % o matte_color: Return the matte color.
5414 WandExport MagickBooleanType MagickGetImageMatteColor(MagickWand *wand,
5415 PixelWand *matte_color)
5417 assert(wand != (MagickWand *) NULL);
5418 assert(wand->signature == WandSignature);
5419 if (wand->debug != MagickFalse)
5420 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5421 if (wand->images == (Image *) NULL)
5422 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5423 PixelSetQuantumColor(matte_color,&wand->images->matte_color);
5428 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5432 % 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 %
5436 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5438 % MagickGetImageOrientation() returns the image orientation.
5440 % The format of the MagickGetImageOrientation method is:
5442 % OrientationType MagickGetImageOrientation(MagickWand *wand)
5444 % A description of each parameter follows:
5446 % o wand: the magick wand.
5449 WandExport OrientationType MagickGetImageOrientation(MagickWand *wand)
5451 assert(wand != (MagickWand *) NULL);
5452 assert(wand->signature == WandSignature);
5453 if (wand->debug != MagickFalse)
5454 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5455 if (wand->images == (Image *) NULL)
5457 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5458 "ContainsNoImages","`%s'",wand->name);
5459 return(UndefinedOrientation);
5461 return(wand->images->orientation);
5465 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5469 % M a g i c k G e t I m a g e P a g e %
5473 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5475 % MagickGetImagePage() returns the page geometry associated with the image.
5477 % The format of the MagickGetImagePage method is:
5479 % MagickBooleanType MagickGetImagePage(MagickWand *wand,
5480 % size_t *width,size_t *height,ssize_t *x,ssize_t *y)
5482 % A description of each parameter follows:
5484 % o wand: the magick wand.
5486 % o width: the page width.
5488 % o height: the page height.
5490 % o x: the page x-offset.
5492 % o y: the page y-offset.
5495 WandExport MagickBooleanType MagickGetImagePage(MagickWand *wand,
5496 size_t *width,size_t *height,ssize_t *x,ssize_t *y)
5498 assert(wand != (const MagickWand *) NULL);
5499 assert(wand->signature == WandSignature);
5500 if (wand->debug != MagickFalse)
5501 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5502 if (wand->images == (Image *) NULL)
5503 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5504 *width=wand->images->page.width;
5505 *height=wand->images->page.height;
5506 *x=wand->images->page.x;
5507 *y=wand->images->page.y;
5512 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5516 % M a g i c k G e t I m a g e P i x e l C o l o r %
5520 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5522 % MagickGetImagePixelColor() returns the color of the specified pixel.
5524 % The format of the MagickGetImagePixelColor method is:
5526 % MagickBooleanType MagickGetImagePixelColor(MagickWand *wand,
5527 % const ssize_t x,const ssize_t y,PixelWand *color)
5529 % A description of each parameter follows:
5531 % o wand: the magick wand.
5533 % o x,y: the pixel offset into the image.
5535 % o color: Return the colormap color in this wand.
5538 WandExport MagickBooleanType MagickGetImagePixelColor(MagickWand *wand,
5539 const ssize_t x,const ssize_t y,PixelWand *color)
5544 register const PixelPacket
5550 assert(wand != (MagickWand *) NULL);
5551 assert(wand->signature == WandSignature);
5552 if (wand->debug != MagickFalse)
5553 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5554 if (wand->images == (Image *) NULL)
5555 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5556 image_view=AcquireCacheView(wand->images);
5557 p=GetCacheViewVirtualPixels(image_view,x,y,1,1,wand->exception);
5558 if (p == (const PixelPacket *) NULL)
5560 image_view=DestroyCacheView(image_view);
5561 return(MagickFalse);
5563 indexes=GetCacheViewAuthenticIndexQueue(image_view);
5564 PixelSetQuantumColor(color,p);
5565 if (GetCacheViewColorspace(image_view) == CMYKColorspace)
5566 PixelSetBlackQuantum(color,*indexes);
5568 if (GetCacheViewStorageClass(image_view) == PseudoClass)
5569 PixelSetIndex(color,*indexes);
5570 image_view=DestroyCacheView(image_view);
5575 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5579 + M a g i c k G e t I m a g e R a n g e %
5583 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5585 % MagickGetImageRange() gets the pixel range for the image.
5587 % The format of the MagickGetImageRange method is:
5589 % MagickBooleanType MagickGetImageRange(MagickWand *wand,double *minima,
5592 % A description of each parameter follows:
5594 % o wand: the magick wand.
5596 % o minima: The minimum pixel value for the specified channel(s).
5598 % o maxima: The maximum pixel value for the specified channel(s).
5601 WandExport MagickBooleanType MagickGetImageRange(MagickWand *wand,
5602 double *minima,double *maxima)
5607 assert(wand != (MagickWand *) NULL);
5608 assert(wand->signature == WandSignature);
5609 if (wand->debug != MagickFalse)
5610 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5611 if (wand->images == (Image *) NULL)
5612 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5613 status=GetImageRange(wand->images,minima,maxima,wand->exception);
5618 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5622 % M a g i c k G e t I m a g e R e d P r i m a r y %
5626 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5628 % MagickGetImageRedPrimary() returns the chromaticy red primary point.
5630 % The format of the MagickGetImageRedPrimary method is:
5632 % MagickBooleanType MagickGetImageRedPrimary(MagickWand *wand,double *x,
5635 % A description of each parameter follows:
5637 % o wand: the magick wand.
5639 % o x: the chromaticity red primary x-point.
5641 % o y: the chromaticity red primary y-point.
5644 WandExport MagickBooleanType MagickGetImageRedPrimary(MagickWand *wand,
5645 double *x,double *y)
5647 assert(wand != (MagickWand *) NULL);
5648 assert(wand->signature == WandSignature);
5649 if (wand->debug != MagickFalse)
5650 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5651 if (wand->images == (Image *) NULL)
5652 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5653 *x=wand->images->chromaticity.red_primary.x;
5654 *y=wand->images->chromaticity.red_primary.y;
5659 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5663 % M a g i c k G e t I m a g e R e g i o n %
5667 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5669 % MagickGetImageRegion() extracts a region of the image and returns it as a
5672 % The format of the MagickGetImageRegion method is:
5674 % MagickWand *MagickGetImageRegion(MagickWand *wand,
5675 % const size_t width,const size_t height,const ssize_t x,
5678 % A description of each parameter follows:
5680 % o wand: the magick wand.
5682 % o width: the region width.
5684 % o height: the region height.
5686 % o x: the region x offset.
5688 % o y: the region y offset.
5691 WandExport MagickWand *MagickGetImageRegion(MagickWand *wand,
5692 const size_t width,const size_t height,const ssize_t x,
5701 assert(wand != (MagickWand *) NULL);
5702 assert(wand->signature == WandSignature);
5703 if (wand->debug != MagickFalse)
5704 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5705 if (wand->images == (Image *) NULL)
5706 return((MagickWand *) NULL);
5708 region.height=height;
5711 region_image=CropImage(wand->images,®ion,wand->exception);
5712 if (region_image == (Image *) NULL)
5713 return((MagickWand *) NULL);
5714 return(CloneMagickWandFromImages(wand,region_image));
5718 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5722 % 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 %
5726 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5728 % MagickGetImageRenderingIntent() gets the image rendering intent.
5730 % The format of the MagickGetImageRenderingIntent method is:
5732 % RenderingIntent MagickGetImageRenderingIntent(MagickWand *wand)
5734 % A description of each parameter follows:
5736 % o wand: the magick wand.
5739 WandExport RenderingIntent MagickGetImageRenderingIntent(MagickWand *wand)
5741 assert(wand != (MagickWand *) NULL);
5742 assert(wand->signature == WandSignature);
5743 if (wand->debug != MagickFalse)
5744 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5745 if (wand->images == (Image *) NULL)
5747 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5748 "ContainsNoImages","`%s'",wand->name);
5749 return(UndefinedIntent);
5751 return((RenderingIntent) wand->images->rendering_intent);
5755 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5759 % M a g i c k G e t I m a g e R e s o l u t i o n %
5763 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5765 % MagickGetImageResolution() gets the image X and Y resolution.
5767 % The format of the MagickGetImageResolution method is:
5769 % MagickBooleanType MagickGetImageResolution(MagickWand *wand,double *x,
5772 % A description of each parameter follows:
5774 % o wand: the magick wand.
5776 % o x: the image x-resolution.
5778 % o y: the image y-resolution.
5781 WandExport MagickBooleanType MagickGetImageResolution(MagickWand *wand,
5782 double *x,double *y)
5784 assert(wand != (MagickWand *) NULL);
5785 assert(wand->signature == WandSignature);
5786 if (wand->debug != MagickFalse)
5787 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5788 if (wand->images == (Image *) NULL)
5789 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5790 *x=wand->images->x_resolution;
5791 *y=wand->images->y_resolution;
5796 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5800 % M a g i c k G e t I m a g e S c e n e %
5804 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5806 % MagickGetImageScene() gets the image scene.
5808 % The format of the MagickGetImageScene method is:
5810 % size_t MagickGetImageScene(MagickWand *wand)
5812 % A description of each parameter follows:
5814 % o wand: the magick wand.
5817 WandExport size_t MagickGetImageScene(MagickWand *wand)
5819 assert(wand != (MagickWand *) NULL);
5820 assert(wand->signature == WandSignature);
5821 if (wand->debug != MagickFalse)
5822 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5823 if (wand->images == (Image *) NULL)
5824 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5825 return(wand->images->scene);
5829 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5833 % M a g i c k G e t I m a g e S i g n a t u r e %
5837 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5839 % MagickGetImageSignature() generates an SHA-256 message digest for the image
5842 % The format of the MagickGetImageSignature method is:
5844 % const char MagickGetImageSignature(MagickWand *wand)
5846 % A description of each parameter follows:
5848 % o wand: the magick wand.
5851 WandExport char *MagickGetImageSignature(MagickWand *wand)
5859 assert(wand != (MagickWand *) NULL);
5860 assert(wand->signature == WandSignature);
5861 if (wand->debug != MagickFalse)
5862 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5863 if (wand->images == (Image *) NULL)
5865 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5866 "ContainsNoImages","`%s'",wand->name);
5867 return((char *) NULL);
5869 status=SignatureImage(wand->images);
5870 if (status == MagickFalse)
5871 InheritException(wand->exception,&wand->images->exception);
5872 value=GetImageProperty(wand->images,"signature");
5873 if (value != (const char *) NULL)
5874 return(AcquireString(value));
5875 InheritException(wand->exception,&wand->images->exception);
5876 return((char *) NULL);
5880 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5884 % 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 %
5888 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5890 % MagickGetImageTicksPerSecond() gets the image ticks-per-second.
5892 % The format of the MagickGetImageTicksPerSecond method is:
5894 % size_t MagickGetImageTicksPerSecond(MagickWand *wand)
5896 % A description of each parameter follows:
5898 % o wand: the magick wand.
5901 WandExport size_t MagickGetImageTicksPerSecond(MagickWand *wand)
5903 assert(wand != (MagickWand *) NULL);
5904 assert(wand->signature == WandSignature);
5905 if (wand->debug != MagickFalse)
5906 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5907 if (wand->images == (Image *) NULL)
5908 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5909 return((size_t) wand->images->ticks_per_second);
5913 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5917 % M a g i c k G e t I m a g e T y p e %
5921 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5923 % MagickGetImageType() gets the potential image type:
5925 % Bilevel Grayscale GrayscaleMatte
5926 % Palette PaletteMatte TrueColor
5927 % TrueColorMatte ColorSeparation ColorSeparationMatte
5929 % To ensure the image type matches its potential, use MagickSetImageType():
5931 % (void) MagickSetImageType(wand,MagickGetImageType(wand));
5933 % The format of the MagickGetImageType method is:
5935 % ImageType MagickGetImageType(MagickWand *wand)
5937 % A description of each parameter follows:
5939 % o wand: the magick wand.
5942 WandExport ImageType MagickGetImageType(MagickWand *wand)
5944 assert(wand != (MagickWand *) NULL);
5945 assert(wand->signature == WandSignature);
5946 if (wand->debug != MagickFalse)
5947 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5948 if (wand->images == (Image *) NULL)
5950 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5951 "ContainsNoImages","`%s'",wand->name);
5952 return(UndefinedType);
5954 return(GetImageType(wand->images,wand->exception));
5958 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5962 % M a g i c k G e t I m a g e U n i t s %
5966 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5968 % MagickGetImageUnits() gets the image units of resolution.
5970 % The format of the MagickGetImageUnits method is:
5972 % ResolutionType MagickGetImageUnits(MagickWand *wand)
5974 % A description of each parameter follows:
5976 % o wand: the magick wand.
5979 WandExport ResolutionType MagickGetImageUnits(MagickWand *wand)
5981 assert(wand != (MagickWand *) NULL);
5982 assert(wand->signature == WandSignature);
5983 if (wand->debug != MagickFalse)
5984 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5985 if (wand->images == (Image *) NULL)
5987 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5988 "ContainsNoImages","`%s'",wand->name);
5989 return(UndefinedResolution);
5991 return(wand->images->units);
5995 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5999 % 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 %
6003 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6005 % MagickGetImageVirtualPixelMethod() returns the virtual pixel method for the
6008 % The format of the MagickGetImageVirtualPixelMethod method is:
6010 % VirtualPixelMethod MagickGetImageVirtualPixelMethod(MagickWand *wand)
6012 % A description of each parameter follows:
6014 % o wand: the magick wand.
6017 WandExport VirtualPixelMethod MagickGetImageVirtualPixelMethod(MagickWand *wand)
6019 assert(wand != (MagickWand *) NULL);
6020 assert(wand->signature == WandSignature);
6021 if (wand->debug != MagickFalse)
6022 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6023 if (wand->images == (Image *) NULL)
6025 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
6026 "ContainsNoImages","`%s'",wand->name);
6027 return(UndefinedVirtualPixelMethod);
6029 return(GetImageVirtualPixelMethod(wand->images));
6033 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6037 % M a g i c k G e t I m a g e W h i t e P o i n t %
6041 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6043 % MagickGetImageWhitePoint() returns the chromaticy white point.
6045 % The format of the MagickGetImageWhitePoint method is:
6047 % MagickBooleanType MagickGetImageWhitePoint(MagickWand *wand,double *x,
6050 % A description of each parameter follows:
6052 % o wand: the magick wand.
6054 % o x: the chromaticity white x-point.
6056 % o y: the chromaticity white y-point.
6059 WandExport MagickBooleanType MagickGetImageWhitePoint(MagickWand *wand,
6060 double *x,double *y)
6062 assert(wand != (MagickWand *) NULL);
6063 assert(wand->signature == WandSignature);
6064 if (wand->debug != MagickFalse)
6065 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6066 if (wand->images == (Image *) NULL)
6067 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6068 *x=wand->images->chromaticity.white_point.x;
6069 *y=wand->images->chromaticity.white_point.y;
6074 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6078 % M a g i c k G e t I m a g e W i d t h %
6082 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6084 % MagickGetImageWidth() returns the image width.
6086 % The format of the MagickGetImageWidth method is:
6088 % size_t MagickGetImageWidth(MagickWand *wand)
6090 % A description of each parameter follows:
6092 % o wand: the magick wand.
6095 WandExport size_t MagickGetImageWidth(MagickWand *wand)
6097 assert(wand != (MagickWand *) NULL);
6098 assert(wand->signature == WandSignature);
6099 if (wand->debug != MagickFalse)
6100 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6101 if (wand->images == (Image *) NULL)
6102 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6103 return(wand->images->columns);
6107 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6111 % M a g i c k G e t N u m b e r I m a g e s %
6115 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6117 % MagickGetNumberImages() returns the number of images associated with a
6120 % The format of the MagickGetNumberImages method is:
6122 % size_t MagickGetNumberImages(MagickWand *wand)
6124 % A description of each parameter follows:
6126 % o wand: the magick wand.
6129 WandExport size_t MagickGetNumberImages(MagickWand *wand)
6131 assert(wand != (MagickWand *) NULL);
6132 assert(wand->signature == WandSignature);
6133 if (wand->debug != MagickFalse)
6134 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6135 return(GetImageListLength(wand->images));
6139 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6143 % 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 %
6147 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6149 % MagickGetImageTotalInkDensity() gets the image total ink density.
6151 % The format of the MagickGetImageTotalInkDensity method is:
6153 % double MagickGetImageTotalInkDensity(MagickWand *wand)
6155 % A description of each parameter follows:
6157 % o wand: the magick wand.
6160 WandExport double MagickGetImageTotalInkDensity(MagickWand *wand)
6162 assert(wand != (MagickWand *) NULL);
6163 assert(wand->signature == WandSignature);
6164 if (wand->debug != MagickFalse)
6165 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6166 if (wand->images == (Image *) NULL)
6168 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
6169 "ContainsNoImages","`%s'",wand->name);
6172 return(GetImageTotalInkDensity(wand->images));
6176 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6180 % M a g i c k H a l d C l u t I m a g e %
6184 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6186 % MagickHaldClutImage() replaces colors in the image from a Hald color lookup
6187 % table. A Hald color lookup table is a 3-dimensional color cube mapped to 2
6188 % dimensions. Create it with the HALD coder. You can apply any color
6189 % transformation to the Hald image and then use this method to apply the
6190 % transform to the image.
6192 % The format of the MagickHaldClutImage method is:
6194 % MagickBooleanType MagickHaldClutImage(MagickWand *wand,
6195 % const MagickWand *hald_wand)
6196 % MagickBooleanType MagickHaldClutImageChannel(MagickWand *wand,
6197 % const ChannelType channel,const MagickWand *hald_wand)
6199 % A description of each parameter follows:
6201 % o wand: the magick wand.
6203 % o hald_image: the hald CLUT image.
6207 WandExport MagickBooleanType MagickHaldClutImage(MagickWand *wand,
6208 const MagickWand *hald_wand)
6213 status=MagickHaldClutImageChannel(wand,DefaultChannels,hald_wand);
6217 WandExport MagickBooleanType MagickHaldClutImageChannel(MagickWand *wand,
6218 const ChannelType channel,const MagickWand *hald_wand)
6223 assert(wand != (MagickWand *) NULL);
6224 assert(wand->signature == WandSignature);
6225 if (wand->debug != MagickFalse)
6226 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6227 if ((wand->images == (Image *) NULL) || (hald_wand->images == (Image *) NULL))
6228 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6229 status=HaldClutImageChannel(wand->images,channel,hald_wand->images);
6230 if (status == MagickFalse)
6231 InheritException(wand->exception,&wand->images->exception);
6236 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6240 % M a g i c k H a s N e x t I m a g e %
6244 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6246 % MagickHasNextImage() returns MagickTrue if the wand has more images when
6247 % traversing the list in the forward direction
6249 % The format of the MagickHasNextImage method is:
6251 % MagickBooleanType MagickHasNextImage(MagickWand *wand)
6253 % A description of each parameter follows:
6255 % o wand: the magick wand.
6258 WandExport MagickBooleanType MagickHasNextImage(MagickWand *wand)
6260 assert(wand != (MagickWand *) NULL);
6261 assert(wand->signature == WandSignature);
6262 if (wand->debug != MagickFalse)
6263 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6264 if (wand->images == (Image *) NULL)
6265 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6266 if (GetNextImageInList(wand->images) == (Image *) NULL)
6267 return(MagickFalse);
6272 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6276 % M a g i c k H a s P r e v i o u s I m a g e %
6280 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6282 % MagickHasPreviousImage() returns MagickTrue if the wand has more images when
6283 % traversing the list in the reverse direction
6285 % The format of the MagickHasPreviousImage method is:
6287 % MagickBooleanType MagickHasPreviousImage(MagickWand *wand)
6289 % A description of each parameter follows:
6291 % o wand: the magick wand.
6294 WandExport MagickBooleanType MagickHasPreviousImage(MagickWand *wand)
6296 assert(wand != (MagickWand *) NULL);
6297 assert(wand->signature == WandSignature);
6298 if (wand->debug != MagickFalse)
6299 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6300 if (wand->images == (Image *) NULL)
6301 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6302 if (GetPreviousImageInList(wand->images) == (Image *) NULL)
6303 return(MagickFalse);
6308 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6312 % M a g i c k I d e n t i f y I m a g e %
6316 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6318 % MagickIdentifyImage() identifies an image by printing its attributes to the
6319 % file. Attributes include the image width, height, size, and others.
6321 % The format of the MagickIdentifyImage method is:
6323 % const char *MagickIdentifyImage(MagickWand *wand)
6325 % A description of each parameter follows:
6327 % o wand: the magick wand.
6330 WandExport char *MagickIdentifyImage(MagickWand *wand)
6334 filename[MaxTextExtent];
6342 assert(wand != (MagickWand *) NULL);
6343 assert(wand->signature == WandSignature);
6344 if (wand->debug != MagickFalse)
6345 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6346 if (wand->images == (Image *) NULL)
6348 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
6349 "ContainsNoImages","`%s'",wand->name);
6350 return((char *) NULL);
6352 description=(char *) NULL;
6353 unique_file=AcquireUniqueFileResource(filename);
6355 if (unique_file != -1)
6356 file=fdopen(unique_file,"wb");
6357 if ((unique_file == -1) || (file == (FILE *) NULL))
6359 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
6360 "UnableToCreateTemporaryFile","`%s'",wand->name);
6361 return((char *) NULL);
6363 (void) IdentifyImage(wand->images,file,MagickTrue);
6364 (void) fclose(file);
6365 description=FileToString(filename,~0,wand->exception);
6366 (void) RelinquishUniqueFileResource(filename);
6367 return(description);
6371 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6375 % M a g i c k I m p l o d e I m a g e %
6379 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6381 % MagickImplodeImage() creates a new image that is a copy of an existing
6382 % one with the image pixels "implode" by the specified percentage. It
6383 % allocates the memory necessary for the new Image structure and returns a
6384 % pointer to the new image.
6386 % The format of the MagickImplodeImage method is:
6388 % MagickBooleanType MagickImplodeImage(MagickWand *wand,
6389 % const double radius)
6391 % A description of each parameter follows:
6393 % o wand: the magick wand.
6395 % o amount: Define the extent of the implosion.
6398 WandExport MagickBooleanType MagickImplodeImage(MagickWand *wand,
6399 const double amount)
6404 assert(wand != (MagickWand *) NULL);
6405 assert(wand->signature == WandSignature);
6406 if (wand->debug != MagickFalse)
6407 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6408 if (wand->images == (Image *) NULL)
6409 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6410 implode_image=ImplodeImage(wand->images,amount,wand->exception);
6411 if (implode_image == (Image *) NULL)
6412 return(MagickFalse);
6413 ReplaceImageInList(&wand->images,implode_image);
6418 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6422 % M a g i c k I m p o r t I m a g e P i x e l s %
6426 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6428 % MagickImportImagePixels() accepts pixel datand stores it in the image at the
6429 % location you specify. The method returns MagickFalse on success otherwise
6430 % MagickTrue if an error is encountered. The pixel data can be either char,
6431 % short int, int, ssize_t, float, or double in the order specified by map.
6433 % Suppose your want to upload the first scanline of a 640x480 image from
6434 % character data in red-green-blue order:
6436 % MagickImportImagePixels(wand,0,0,640,1,"RGB",CharPixel,pixels);
6438 % The format of the MagickImportImagePixels method is:
6440 % MagickBooleanType MagickImportImagePixels(MagickWand *wand,
6441 % const ssize_t x,const ssize_t y,const size_t columns,
6442 % const size_t rows,const char *map,const StorageType storage,
6443 % const void *pixels)
6445 % A description of each parameter follows:
6447 % o wand: the magick wand.
6449 % o x, y, columns, rows: These values define the perimeter of a region
6450 % of pixels you want to define.
6452 % o map: This string reflects the expected ordering of the pixel array.
6453 % It can be any combination or order of R = red, G = green, B = blue,
6454 % A = alpha (0 is transparent), O = opacity (0 is opaque), C = cyan,
6455 % Y = yellow, M = magenta, K = black, I = intensity (for grayscale),
6458 % o storage: Define the data type of the pixels. Float and double types are
6459 % expected to be normalized [0..1] otherwise [0..QuantumRange]. Choose from
6460 % these types: CharPixel, ShortPixel, IntegerPixel, LongPixel, FloatPixel,
6463 % o pixels: This array of values contain the pixel components as defined by
6464 % map and type. You must preallocate this array where the expected
6465 % length varies depending on the values of width, height, map, and type.
6468 WandExport MagickBooleanType MagickImportImagePixels(MagickWand *wand,
6469 const ssize_t x,const ssize_t y,const size_t columns,
6470 const size_t rows,const char *map,const StorageType storage,
6476 assert(wand != (MagickWand *) NULL);
6477 assert(wand->signature == WandSignature);
6478 if (wand->debug != MagickFalse)
6479 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6480 if (wand->images == (Image *) NULL)
6481 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6482 status=ImportImagePixels(wand->images,x,y,columns,rows,map,storage,pixels);
6483 if (status == MagickFalse)
6484 InheritException(wand->exception,&wand->images->exception);
6489 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6493 % 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 %
6497 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6499 % MagickInverseFourierTransformImage() implements the inverse discrete
6500 % Fourier transform (DFT) of the image either as a magnitude / phase or real /
6501 % imaginary image pair.
6503 % The format of the MagickInverseFourierTransformImage method is:
6505 % MagickBooleanType MagickInverseFourierTransformImage(
6506 % MagickWand *magnitude_wand,MagickWand *phase_wand,
6507 % const MagickBooleanType magnitude)
6509 % A description of each parameter follows:
6511 % o magnitude_wand: the magnitude or real wand.
6513 % o phase_wand: the phase or imaginary wand.
6515 % o magnitude: if true, return as magnitude / phase pair otherwise a real /
6516 % imaginary image pair.
6519 WandExport MagickBooleanType MagickInverseFourierTransformImage(
6520 MagickWand *magnitude_wand,MagickWand *phase_wand,
6521 const MagickBooleanType magnitude)
6529 assert(magnitude_wand != (MagickWand *) NULL);
6530 assert(magnitude_wand->signature == WandSignature);
6531 if (magnitude_wand->debug != MagickFalse)
6532 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",
6533 magnitude_wand->name);
6534 wand=magnitude_wand;
6535 if (magnitude_wand->images == (Image *) NULL)
6536 ThrowWandException(WandError,"ContainsNoImages",
6537 magnitude_wand->name);
6538 assert(phase_wand != (MagickWand *) NULL);
6539 assert(phase_wand->signature == WandSignature);
6540 inverse_image=InverseFourierTransformImage(magnitude_wand->images,
6541 phase_wand->images,magnitude,wand->exception);
6542 if (inverse_image == (Image *) NULL)
6543 return(MagickFalse);
6544 ReplaceImageInList(&wand->images,inverse_image);
6549 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6553 % M a g i c k L a b e l I m a g e %
6557 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6559 % MagickLabelImage() adds a label to your image.
6561 % The format of the MagickLabelImage method is:
6563 % MagickBooleanType MagickLabelImage(MagickWand *wand,const char *label)
6565 % A description of each parameter follows:
6567 % o wand: the magick wand.
6569 % o label: the image label.
6572 WandExport MagickBooleanType MagickLabelImage(MagickWand *wand,
6578 assert(wand != (MagickWand *) NULL);
6579 assert(wand->signature == WandSignature);
6580 if (wand->debug != MagickFalse)
6581 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6582 if (wand->images == (Image *) NULL)
6583 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6584 status=SetImageProperty(wand->images,"label",label);
6585 if (status == MagickFalse)
6586 InheritException(wand->exception,&wand->images->exception);
6591 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6595 % M a g i c k L e v e l I m a g e %
6599 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6601 % MagickLevelImage() adjusts the levels of an image by scaling the colors
6602 % falling between specified white and black points to the full available
6603 % quantum range. The parameters provided represent the black, mid, and white
6604 % points. The black point specifies the darkest color in the image. Colors
6605 % darker than the black point are set to zero. Mid point specifies a gamma
6606 % correction to apply to the image. White point specifies the lightest color
6607 % in the image. Colors brighter than the white point are set to the maximum
6610 % The format of the MagickLevelImage method is:
6612 % MagickBooleanType MagickLevelImage(MagickWand *wand,
6613 % const double black_point,const double gamma,const double white_point)
6614 % MagickBooleanType MagickLevelImageChannel(MagickWand *wand,
6615 % const ChannelType channel,const double black_point,const double gamma,
6616 % const double white_point)
6618 % A description of each parameter follows:
6620 % o wand: the magick wand.
6622 % o channel: Identify which channel to level: RedChannel, GreenChannel,
6624 % o black_point: the black point.
6626 % o gamma: the gamma.
6628 % o white_point: the white point.
6632 WandExport MagickBooleanType MagickLevelImage(MagickWand *wand,
6633 const double black_point,const double gamma,const double white_point)
6638 status=MagickLevelImageChannel(wand,DefaultChannels,black_point,gamma,
6643 WandExport MagickBooleanType MagickLevelImageChannel(MagickWand *wand,
6644 const ChannelType channel,const double black_point,const double gamma,
6645 const double white_point)
6650 assert(wand != (MagickWand *) NULL);
6651 assert(wand->signature == WandSignature);
6652 if (wand->debug != MagickFalse)
6653 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6654 if (wand->images == (Image *) NULL)
6655 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6656 status=LevelImageChannel(wand->images,channel,black_point,white_point,gamma);
6657 if (status == MagickFalse)
6658 InheritException(wand->exception,&wand->images->exception);
6663 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6667 % M a g i c k L i n e a r S t r e t c h I m a g e %
6671 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6673 % MagickLinearStretchImage() stretches with saturation the image intensity.
6675 % You can also reduce the influence of a particular channel with a gamma
6678 % The format of the MagickLinearStretchImage method is:
6680 % MagickBooleanType MagickLinearStretchImage(MagickWand *wand,
6681 % const double black_point,const double white_point)
6683 % A description of each parameter follows:
6685 % o wand: the magick wand.
6687 % o black_point: the black point.
6689 % o white_point: the white point.
6692 WandExport MagickBooleanType MagickLinearStretchImage(MagickWand *wand,
6693 const double black_point,const double white_point)
6698 assert(wand != (MagickWand *) NULL);
6699 assert(wand->signature == WandSignature);
6700 if (wand->debug != MagickFalse)
6701 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6702 if (wand->images == (Image *) NULL)
6703 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6704 status=LinearStretchImage(wand->images,black_point,white_point);
6705 if (status == MagickFalse)
6706 InheritException(wand->exception,&wand->images->exception);
6711 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6715 % M a g i c k L i q u i d R e s c a l e I m a g e %
6719 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6721 % MagickLiquidRescaleImage() rescales image with seam carving.
6723 % MagickBooleanType MagickLiquidRescaleImage(MagickWand *wand,
6724 % const size_t columns,const size_t rows,
6725 % const double delta_x,const double rigidity)
6727 % A description of each parameter follows:
6729 % o wand: the magick wand.
6731 % o columns: the number of columns in the scaled image.
6733 % o rows: the number of rows in the scaled image.
6735 % o delta_x: maximum seam transversal step (0 means straight seams).
6737 % o rigidity: introduce a bias for non-straight seams (typically 0).
6740 WandExport MagickBooleanType MagickLiquidRescaleImage(MagickWand *wand,
6741 const size_t columns,const size_t rows,const double delta_x,
6742 const double rigidity)
6747 assert(wand != (MagickWand *) NULL);
6748 assert(wand->signature == WandSignature);
6749 if (wand->debug != MagickFalse)
6750 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6751 if (wand->images == (Image *) NULL)
6752 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6753 rescale_image=LiquidRescaleImage(wand->images,columns,rows,delta_x,
6754 rigidity,wand->exception);
6755 if (rescale_image == (Image *) NULL)
6756 return(MagickFalse);
6757 ReplaceImageInList(&wand->images,rescale_image);
6762 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6766 % M a g i c k M a g n i f y I m a g e %
6770 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6772 % MagickMagnifyImage() is a convenience method that scales an image
6773 % proportionally to twice its original size.
6775 % The format of the MagickMagnifyImage method is:
6777 % MagickBooleanType MagickMagnifyImage(MagickWand *wand)
6779 % A description of each parameter follows:
6781 % o wand: the magick wand.
6784 WandExport MagickBooleanType MagickMagnifyImage(MagickWand *wand)
6789 assert(wand != (MagickWand *) NULL);
6790 assert(wand->signature == WandSignature);
6791 if (wand->debug != MagickFalse)
6792 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6793 if (wand->images == (Image *) NULL)
6794 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6795 magnify_image=MagnifyImage(wand->images,wand->exception);
6796 if (magnify_image == (Image *) NULL)
6797 return(MagickFalse);
6798 ReplaceImageInList(&wand->images,magnify_image);
6803 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6807 % M a g i c k M e d i a n F i l t e r I m a g e %
6811 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6813 % MagickMedianFilterImage() applies a digital filter that improves the quality
6814 % of a noisy image. Each pixel is replaced by the median in a set of
6815 % neighboring pixels as defined by radius.
6817 % The format of the MagickMedianFilterImage method is:
6819 % MagickBooleanType MagickMedianFilterImage(MagickWand *wand,
6820 % const double radius)
6822 % A description of each parameter follows:
6824 % o wand: the magick wand.
6826 % o radius: the radius of the pixel neighborhood.
6829 WandExport MagickBooleanType MagickMedianFilterImage(MagickWand *wand,
6830 const double radius)
6835 assert(wand != (MagickWand *) NULL);
6836 assert(wand->signature == WandSignature);
6837 if (wand->debug != MagickFalse)
6838 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6839 if (wand->images == (Image *) NULL)
6840 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6841 median_image=MedianFilterImage(wand->images,radius,wand->exception);
6842 if (median_image == (Image *) NULL)
6843 return(MagickFalse);
6844 ReplaceImageInList(&wand->images,median_image);
6849 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6853 % M a g i c k M e r g e I m a g e L a y e r s %
6857 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6859 % MagickMergeImageLayers() composes all the image layers from the current given
6860 % image onward to produce a single image of the merged layers.
6862 % The inital canvas's size depends on the given ImageLayerMethod, and is
6863 % initialized using the first images background color. The images
6864 % are then compositied onto that image in sequence using the given
6865 % composition that has been assigned to each individual image.
6867 % The format of the MagickMergeImageLayers method is:
6869 % MagickWand *MagickMergeImageLayers(MagickWand *wand,
6870 % const ImageLayerMethod method)
6872 % A description of each parameter follows:
6874 % o wand: the magick wand.
6876 % o method: the method of selecting the size of the initial canvas.
6878 % MergeLayer: Merge all layers onto a canvas just large enough
6879 % to hold all the actual images. The virtual canvas of the
6880 % first image is preserved but otherwise ignored.
6882 % FlattenLayer: Use the virtual canvas size of first image.
6883 % Images which fall outside this canvas is clipped.
6884 % This can be used to 'fill out' a given virtual canvas.
6886 % MosaicLayer: Start with the virtual canvas of the first image,
6887 % enlarging left and right edges to contain all images.
6888 % Images with negative offsets will be clipped.
6891 WandExport MagickWand *MagickMergeImageLayers(MagickWand *wand,
6892 const ImageLayerMethod method)
6897 assert(wand != (MagickWand *) NULL);
6898 assert(wand->signature == WandSignature);
6899 if (wand->debug != MagickFalse)
6900 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6901 if (wand->images == (Image *) NULL)
6902 return((MagickWand *) NULL);
6903 mosaic_image=MergeImageLayers(wand->images,method,wand->exception);
6904 if (mosaic_image == (Image *) NULL)
6905 return((MagickWand *) NULL);
6906 return(CloneMagickWandFromImages(wand,mosaic_image));
6910 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6914 % M a g i c k M i n i f y I m a g e %
6918 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6920 % MagickMinifyImage() is a convenience method that scales an image
6921 % proportionally to one-half its original size
6923 % The format of the MagickMinifyImage method is:
6925 % MagickBooleanType MagickMinifyImage(MagickWand *wand)
6927 % A description of each parameter follows:
6929 % o wand: the magick wand.
6932 WandExport MagickBooleanType MagickMinifyImage(MagickWand *wand)
6937 assert(wand != (MagickWand *) NULL);
6938 assert(wand->signature == WandSignature);
6939 if (wand->debug != MagickFalse)
6940 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6941 if (wand->images == (Image *) NULL)
6942 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6943 minify_image=MinifyImage(wand->images,wand->exception);
6944 if (minify_image == (Image *) NULL)
6945 return(MagickFalse);
6946 ReplaceImageInList(&wand->images,minify_image);
6951 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6955 % M a g i c k M o d u l a t e I m a g e %
6959 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6961 % MagickModulateImage() lets you control the brightness, saturation, and hue
6962 % of an image. Hue is the percentage of absolute rotation from the current
6963 % position. For example 50 results in a counter-clockwise rotation of 90
6964 % degrees, 150 results in a clockwise rotation of 90 degrees, with 0 and 200
6965 % both resulting in a rotation of 180 degrees.
6967 % To increase the color brightness by 20% and decrease the color saturation by
6968 % 10% and leave the hue unchanged, use: 120,90,100.
6970 % The format of the MagickModulateImage method is:
6972 % MagickBooleanType MagickModulateImage(MagickWand *wand,
6973 % const double brightness,const double saturation,const double hue)
6975 % A description of each parameter follows:
6977 % o wand: the magick wand.
6979 % o brightness: the percent change in brighness.
6981 % o saturation: the percent change in saturation.
6983 % o hue: the percent change in hue.
6986 WandExport MagickBooleanType MagickModulateImage(MagickWand *wand,
6987 const double brightness,const double saturation,const double hue)
6990 modulate[MaxTextExtent];
6995 assert(wand != (MagickWand *) NULL);
6996 assert(wand->signature == WandSignature);
6997 if (wand->debug != MagickFalse)
6998 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6999 if (wand->images == (Image *) NULL)
7000 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7001 (void) FormatMagickString(modulate,MaxTextExtent,"%g,%g,%g",
7002 brightness,saturation,hue);
7003 status=ModulateImage(wand->images,modulate);
7004 if (status == MagickFalse)
7005 InheritException(wand->exception,&wand->images->exception);
7010 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7014 % M a g i c k M o n t a g e I m a g e %
7018 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7020 % MagickMontageImage() creates a composite image by combining several
7021 % separate images. The images are tiled on the composite image with the name
7022 % of the image optionally appearing just below the individual tile.
7024 % The format of the MagickMontageImage method is:
7026 % MagickWand *MagickMontageImage(MagickWand *wand,
7027 % const DrawingWand drawing_wand,const char *tile_geometry,
7028 % const char *thumbnail_geometry,const MontageMode mode,
7029 % const char *frame)
7031 % A description of each parameter follows:
7033 % o wand: the magick wand.
7035 % o drawing_wand: the drawing wand. The font name, size, and color are
7036 % obtained from this wand.
7038 % o tile_geometry: the number of tiles per row and page (e.g. 6x4+0+0).
7040 % o thumbnail_geometry: Preferred image size and border size of each
7041 % thumbnail (e.g. 120x120+4+3>).
7043 % o mode: Thumbnail framing mode: Frame, Unframe, or Concatenate.
7045 % o frame: Surround the image with an ornamental border (e.g. 15x15+3+3).
7046 % The frame color is that of the thumbnail's matte color.
7049 WandExport MagickWand *MagickMontageImage(MagickWand *wand,
7050 const DrawingWand *drawing_wand,const char *tile_geometry,
7051 const char *thumbnail_geometry,const MontageMode mode,const char *frame)
7065 assert(wand != (MagickWand *) NULL);
7066 assert(wand->signature == WandSignature);
7067 if (wand->debug != MagickFalse)
7068 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7069 if (wand->images == (Image *) NULL)
7070 return((MagickWand *) NULL);
7071 montage_info=CloneMontageInfo(wand->image_info,(MontageInfo *) NULL);
7076 (void) CloneString(&montage_info->frame,"15x15+3+3");
7077 montage_info->shadow=MagickTrue;
7082 montage_info->frame=(char *) NULL;
7083 montage_info->shadow=MagickFalse;
7084 montage_info->border_width=0;
7087 case ConcatenateMode:
7089 montage_info->frame=(char *) NULL;
7090 montage_info->shadow=MagickFalse;
7091 (void) CloneString(&montage_info->geometry,"+0+0");
7092 montage_info->border_width=0;
7098 font=DrawGetFont(drawing_wand);
7099 if (font != (char *) NULL)
7100 (void) CloneString(&montage_info->font,font);
7101 if (frame != (char *) NULL)
7102 (void) CloneString(&montage_info->frame,frame);
7103 montage_info->pointsize=DrawGetFontSize(drawing_wand);
7104 pixel_wand=NewPixelWand();
7105 DrawGetFillColor(drawing_wand,pixel_wand);
7106 PixelGetQuantumColor(pixel_wand,&montage_info->fill);
7107 DrawGetStrokeColor(drawing_wand,pixel_wand);
7108 PixelGetQuantumColor(pixel_wand,&montage_info->stroke);
7109 pixel_wand=DestroyPixelWand(pixel_wand);
7110 if (thumbnail_geometry != (char *) NULL)
7111 (void) CloneString(&montage_info->geometry,thumbnail_geometry);
7112 if (tile_geometry != (char *) NULL)
7113 (void) CloneString(&montage_info->tile,tile_geometry);
7114 montage_image=MontageImageList(wand->image_info,montage_info,wand->images,
7116 montage_info=DestroyMontageInfo(montage_info);
7117 if (montage_image == (Image *) NULL)
7118 return((MagickWand *) NULL);
7119 return(CloneMagickWandFromImages(wand,montage_image));
7123 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7127 % M a g i c k M o r p h I m a g e s %
7131 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7133 % MagickMorphImages() method morphs a set of images. Both the image pixels
7134 % and size are linearly interpolated to give the appearance of a
7135 % meta-morphosis from one image to the next.
7137 % The format of the MagickMorphImages method is:
7139 % MagickWand *MagickMorphImages(MagickWand *wand,
7140 % const size_t number_frames)
7142 % A description of each parameter follows:
7144 % o wand: the magick wand.
7146 % o number_frames: the number of in-between images to generate.
7149 WandExport MagickWand *MagickMorphImages(MagickWand *wand,
7150 const size_t number_frames)
7155 assert(wand != (MagickWand *) NULL);
7156 assert(wand->signature == WandSignature);
7157 if (wand->debug != MagickFalse)
7158 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7159 if (wand->images == (Image *) NULL)
7160 return((MagickWand *) NULL);
7161 morph_image=MorphImages(wand->images,number_frames,wand->exception);
7162 if (morph_image == (Image *) NULL)
7163 return((MagickWand *) NULL);
7164 return(CloneMagickWandFromImages(wand,morph_image));
7168 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7172 % M a g i c k M o r p h o l o g y I m a g e %
7176 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7178 % MagickMorphologyImage() applies a user supplied kernel to the image
7179 % according to the given mophology method.
7181 % The format of the MagickMorphologyImage method is:
7183 % MagickBooleanType MagickMorphologyImage(MagickWand *wand,
7184 % MorphologyMethod method,const ssize_t iterations,KernelInfo *kernel)
7185 % MagickBooleanType MagickMorphologyImageChannel(MagickWand *wand,
7186 % ChannelType channel,MorphologyMethod method,const ssize_t iterations,
7187 % KernelInfo *kernel)
7189 % A description of each parameter follows:
7191 % o wand: the magick wand.
7193 % o channel: the image channel(s).
7195 % o method: the morphology method to be applied.
7197 % o iterations: apply the operation this many times (or no change).
7198 % A value of -1 means loop until no change found. How this is applied
7199 % may depend on the morphology method. Typically this is a value of 1.
7201 % o kernel: An array of doubles representing the morphology kernel.
7205 WandExport MagickBooleanType MagickMorphologyImage(MagickWand *wand,
7206 MorphologyMethod method,const ssize_t iterations,KernelInfo *kernel)
7211 status=MagickMorphologyImageChannel(wand,DefaultChannels,method,iterations,
7216 WandExport MagickBooleanType MagickMorphologyImageChannel(MagickWand *wand,
7217 const ChannelType channel,MorphologyMethod method,const ssize_t iterations,
7223 assert(wand != (MagickWand *) NULL);
7224 assert(wand->signature == WandSignature);
7225 if (wand->debug != MagickFalse)
7226 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7227 if (kernel == (const KernelInfo *) NULL)
7228 return(MagickFalse);
7229 if (wand->images == (Image *) NULL)
7230 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7231 morphology_image=MorphologyImageChannel(wand->images,channel,method,
7232 iterations,kernel,wand->exception);
7233 if (morphology_image == (Image *) NULL)
7234 return(MagickFalse);
7235 ReplaceImageInList(&wand->images,morphology_image);
7240 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7244 % M a g i c k M o t i o n B l u r I m a g e %
7248 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7250 % MagickMotionBlurImage() simulates motion blur. We convolve the image with a
7251 % Gaussian operator of the given radius and standard deviation (sigma).
7252 % For reasonable results, radius should be larger than sigma. Use a
7253 % radius of 0 and MotionBlurImage() selects a suitable radius for you.
7254 % Angle gives the angle of the blurring motion.
7256 % The format of the MagickMotionBlurImage method is:
7258 % MagickBooleanType MagickMotionBlurImage(MagickWand *wand,
7259 % const double radius,const double sigma,const double angle)
7260 % MagickBooleanType MagickMotionBlurImageChannel(MagickWand *wand,
7261 % const ChannelType channel,const double radius,const double sigma,
7262 % const double angle)
7264 % A description of each parameter follows:
7266 % o wand: the magick wand.
7268 % o channel: the image channel(s).
7270 % o radius: the radius of the Gaussian, in pixels, not counting
7273 % o sigma: the standard deviation of the Gaussian, in pixels.
7275 % o angle: Apply the effect along this angle.
7279 WandExport MagickBooleanType MagickMotionBlurImage(MagickWand *wand,
7280 const double radius,const double sigma,const double angle)
7285 status=MagickMotionBlurImageChannel(wand,DefaultChannels,radius,sigma,angle);
7289 WandExport MagickBooleanType MagickMotionBlurImageChannel(MagickWand *wand,
7290 const ChannelType channel,const double radius,const double sigma,
7296 assert(wand != (MagickWand *) NULL);
7297 assert(wand->signature == WandSignature);
7298 if (wand->debug != MagickFalse)
7299 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7300 if (wand->images == (Image *) NULL)
7301 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7302 blur_image=MotionBlurImageChannel(wand->images,channel,radius,sigma,angle,
7304 if (blur_image == (Image *) NULL)
7305 return(MagickFalse);
7306 ReplaceImageInList(&wand->images,blur_image);
7311 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7315 % M a g i c k N e g a t e I m a g e %
7319 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7321 % MagickNegateImage() negates the colors in the reference image. The
7322 % Grayscale option means that only grayscale values within the image are
7325 % You can also reduce the influence of a particular channel with a gamma
7328 % The format of the MagickNegateImage method is:
7330 % MagickBooleanType MagickNegateImage(MagickWand *wand,
7331 % const MagickBooleanType gray)
7332 % MagickBooleanType MagickNegateImage(MagickWand *wand,
7333 % const ChannelType channel,const MagickBooleanType gray)
7335 % A description of each parameter follows:
7337 % o wand: the magick wand.
7339 % o channel: the image channel(s).
7341 % o gray: If MagickTrue, only negate grayscale pixels within the image.
7345 WandExport MagickBooleanType MagickNegateImage(MagickWand *wand,
7346 const MagickBooleanType gray)
7351 status=MagickNegateImageChannel(wand,DefaultChannels,gray);
7355 WandExport MagickBooleanType MagickNegateImageChannel(MagickWand *wand,
7356 const ChannelType channel,const MagickBooleanType gray)
7361 assert(wand != (MagickWand *) NULL);
7362 assert(wand->signature == WandSignature);
7363 if (wand->debug != MagickFalse)
7364 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7365 if (wand->images == (Image *) NULL)
7366 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7367 status=NegateImageChannel(wand->images,channel,gray);
7368 if (status == MagickFalse)
7369 InheritException(wand->exception,&wand->images->exception);
7374 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7378 % M a g i c k N e w I m a g e %
7382 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7384 % MagickNewImage() adds a blank image canvas of the specified size and
7385 % background color to the wand.
7387 % The format of the MagickNewImage method is:
7389 % MagickBooleanType MagickNewImage(MagickWand *wand,
7390 % const size_t columns,const size_t rows,
7391 % const PixelWand *background)
7393 % A description of each parameter follows:
7395 % o wand: the magick wand.
7397 % o width: the image width.
7399 % o height: the image height.
7401 % o background: the image color.
7404 WandExport MagickBooleanType MagickNewImage(MagickWand *wand,
7405 const size_t width,const size_t height,
7406 const PixelWand *background)
7414 assert(wand != (MagickWand *) NULL);
7415 assert(wand->signature == WandSignature);
7416 if (wand->debug != MagickFalse)
7417 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7418 PixelGetMagickColor(background,&pixel);
7419 images=NewMagickImage(wand->image_info,width,height,&pixel);
7420 if (images == (Image *) NULL)
7421 return(MagickFalse);
7422 if (images->exception.severity != UndefinedException)
7423 InheritException(wand->exception,&images->exception);
7424 return(InsertImageInWand(wand,images));
7428 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7432 % M a g i c k N e x t I m a g e %
7436 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7438 % MagickNextImage() associates the next image in the image list with a magick
7441 % The format of the MagickNextImage method is:
7443 % MagickBooleanType MagickNextImage(MagickWand *wand)
7445 % A description of each parameter follows:
7447 % o wand: the magick wand.
7450 WandExport MagickBooleanType MagickNextImage(MagickWand *wand)
7452 assert(wand != (MagickWand *) NULL);
7453 assert(wand->signature == WandSignature);
7454 if (wand->debug != MagickFalse)
7455 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7456 if (wand->images == (Image *) NULL)
7457 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7458 if (wand->pend != MagickFalse)
7460 wand->pend=MagickFalse;
7463 if (GetNextImageInList(wand->images) == (Image *) NULL)
7465 wand->pend=MagickTrue;
7466 return(MagickFalse);
7468 wand->images=GetNextImageInList(wand->images);
7473 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7477 % M a g i c k N o r m a l i z e I m a g e %
7481 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7483 % MagickNormalizeImage() enhances the contrast of a color image by adjusting
7484 % the pixels color to span the entire range of colors available
7486 % You can also reduce the influence of a particular channel with a gamma
7489 % The format of the MagickNormalizeImage method is:
7491 % MagickBooleanType MagickNormalizeImage(MagickWand *wand)
7492 % MagickBooleanType MagickNormalizeImageChannel(MagickWand *wand,
7493 % const ChannelType channel)
7495 % A description of each parameter follows:
7497 % o wand: the magick wand.
7499 % o channel: the image channel(s).
7503 WandExport MagickBooleanType MagickNormalizeImage(MagickWand *wand)
7508 status=MagickNormalizeImageChannel(wand,DefaultChannels);
7512 WandExport MagickBooleanType MagickNormalizeImageChannel(MagickWand *wand,
7513 const ChannelType channel)
7518 assert(wand != (MagickWand *) NULL);
7519 assert(wand->signature == WandSignature);
7520 if (wand->debug != MagickFalse)
7521 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7522 if (wand->images == (Image *) NULL)
7523 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7524 status=NormalizeImageChannel(wand->images,channel);
7525 if (status == MagickFalse)
7526 InheritException(wand->exception,&wand->images->exception);
7531 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7535 % M a g i c k O i l P a i n t I m a g e %
7539 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7541 % MagickOilPaintImage() applies a special effect filter that simulates an oil
7542 % painting. Each pixel is replaced by the most frequent color occurring
7543 % in a circular region defined by radius.
7545 % The format of the MagickOilPaintImage method is:
7547 % MagickBooleanType MagickOilPaintImage(MagickWand *wand,
7548 % const double radius)
7550 % A description of each parameter follows:
7552 % o wand: the magick wand.
7554 % o radius: the radius of the circular neighborhood.
7557 WandExport MagickBooleanType MagickOilPaintImage(MagickWand *wand,
7558 const double radius)
7563 assert(wand != (MagickWand *) NULL);
7564 assert(wand->signature == WandSignature);
7565 if (wand->debug != MagickFalse)
7566 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7567 if (wand->images == (Image *) NULL)
7568 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7569 paint_image=OilPaintImage(wand->images,radius,wand->exception);
7570 if (paint_image == (Image *) NULL)
7571 return(MagickFalse);
7572 ReplaceImageInList(&wand->images,paint_image);
7577 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7581 % M a g i c k O p a q u e P a i n t I m a g e %
7585 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7587 % MagickOpaquePaintImage() changes any pixel that matches color with the color
7590 % The format of the MagickOpaquePaintImage method is:
7592 % MagickBooleanType MagickOpaquePaintImage(MagickWand *wand,
7593 % const PixelWand *target,const PixelWand *fill,const double fuzz,
7594 % const MagickBooleanType invert)
7595 % MagickBooleanType MagickOpaquePaintImageChannel(MagickWand *wand,
7596 % const ChannelType channel,const PixelWand *target,
7597 % const PixelWand *fill,const double fuzz,const MagickBooleanType invert)
7599 % A description of each parameter follows:
7601 % o wand: the magick wand.
7603 % o channel: the channel(s).
7605 % o target: Change this target color to the fill color within the image.
7607 % o fill: the fill pixel wand.
7609 % o fuzz: By default target must match a particular pixel color
7610 % exactly. However, in many cases two colors may differ by a small amount.
7611 % The fuzz member of image defines how much tolerance is acceptable to
7612 % consider two colors as the same. For example, set fuzz to 10 and the
7613 % color red at intensities of 100 and 102 respectively are now interpreted
7614 % as the same color for the purposes of the floodfill.
7616 % o invert: paint any pixel that does not match the target color.
7620 WandExport MagickBooleanType MagickOpaquePaintImage(MagickWand *wand,
7621 const PixelWand *target,const PixelWand *fill,const double fuzz,
7622 const MagickBooleanType invert)
7627 status=MagickOpaquePaintImageChannel(wand,DefaultChannels,target,fill,fuzz,
7632 WandExport MagickBooleanType MagickOpaquePaintImageChannel(MagickWand *wand,
7633 const ChannelType channel,const PixelWand *target,const PixelWand *fill,
7634 const double fuzz,const MagickBooleanType invert)
7643 assert(wand != (MagickWand *) NULL);
7644 assert(wand->signature == WandSignature);
7645 if (wand->debug != MagickFalse)
7646 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7647 if (wand->images == (Image *) NULL)
7648 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7649 PixelGetMagickColor(target,&target_pixel);
7650 PixelGetMagickColor(fill,&fill_pixel);
7651 wand->images->fuzz=fuzz;
7652 status=OpaquePaintImageChannel(wand->images,channel,&target_pixel,
7653 &fill_pixel,invert);
7654 if (status == MagickFalse)
7655 InheritException(wand->exception,&wand->images->exception);
7660 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7664 % 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 %
7668 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7670 % MagickOptimizeImageLayers() compares each image the GIF disposed forms of the
7671 % previous image in the sequence. From this it attempts to select the
7672 % smallest cropped image to replace each frame, while preserving the results
7675 % The format of the MagickOptimizeImageLayers method is:
7677 % MagickWand *MagickOptimizeImageLayers(MagickWand *wand)
7679 % A description of each parameter follows:
7681 % o wand: the magick wand.
7684 WandExport MagickWand *MagickOptimizeImageLayers(MagickWand *wand)
7689 assert(wand != (MagickWand *) NULL);
7690 assert(wand->signature == WandSignature);
7691 if (wand->debug != MagickFalse)
7692 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7693 if (wand->images == (Image *) NULL)
7694 return((MagickWand *) NULL);
7695 optimize_image=OptimizeImageLayers(wand->images,wand->exception);
7696 if (optimize_image == (Image *) NULL)
7697 return((MagickWand *) NULL);
7698 return(CloneMagickWandFromImages(wand,optimize_image));
7702 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7706 % 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 %
7710 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7712 % MagickOrderedPosterizeImage() performs an ordered dither based on a number
7713 % of pre-defined dithering threshold maps, but over multiple intensity levels,
7714 % which can be different for different channels, according to the input
7717 % The format of the MagickOrderedPosterizeImage method is:
7719 % MagickBooleanType MagickOrderedPosterizeImage(MagickWand *wand,
7720 % const char *threshold_map)
7721 % MagickBooleanType MagickOrderedPosterizeImageChannel(MagickWand *wand,
7722 % const ChannelType channel,const char *threshold_map)
7724 % A description of each parameter follows:
7726 % o image: the image.
7728 % o channel: the channel or channels to be thresholded.
7730 % o threshold_map: A string containing the name of the threshold dither
7731 % map to use, followed by zero or more numbers representing the number of
7732 % color levels tho dither between.
7734 % Any level number less than 2 is equivelent to 2, and means only binary
7735 % dithering will be applied to each color channel.
7737 % No numbers also means a 2 level (bitmap) dither will be applied to all
7738 % channels, while a single number is the number of levels applied to each
7739 % channel in sequence. More numbers will be applied in turn to each of
7740 % the color channels.
7742 % For example: "o3x3,6" generates a 6 level posterization of the image
7743 % with a ordered 3x3 diffused pixel dither being applied between each
7744 % level. While checker,8,8,4 will produce a 332 colormaped image with
7745 % only a single checkerboard hash pattern (50% grey) between each color
7746 % level, to basically double the number of color levels with a bare
7747 % minimim of dithering.
7751 WandExport MagickBooleanType MagickOrderedPosterizeImage(MagickWand *wand,
7752 const char *threshold_map)
7757 status=MagickOrderedPosterizeImageChannel(wand,DefaultChannels,threshold_map);
7761 WandExport MagickBooleanType MagickOrderedPosterizeImageChannel(
7762 MagickWand *wand,const ChannelType channel,const char *threshold_map)
7767 assert(wand != (MagickWand *) NULL);
7768 assert(wand->signature == WandSignature);
7769 if (wand->debug != MagickFalse)
7770 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7771 if (wand->images == (Image *) NULL)
7772 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7773 status=OrderedPosterizeImageChannel(wand->images,channel,threshold_map,
7779 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7783 % M a g i c k P i n g I m a g e %
7787 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7789 % MagickPingImage() is like MagickReadImage() except the only valid
7790 % information returned is the image width, height, size, and format. It
7791 % is designed to efficiently obtain this information from a file without
7792 % reading the entire image sequence into memory.
7794 % The format of the MagickPingImage method is:
7796 % MagickBooleanType MagickPingImage(MagickWand *wand,const char *filename)
7798 % A description of each parameter follows:
7800 % o wand: the magick wand.
7802 % o filename: the image filename.
7805 WandExport MagickBooleanType MagickPingImage(MagickWand *wand,
7806 const char *filename)
7814 assert(wand != (MagickWand *) NULL);
7815 assert(wand->signature == WandSignature);
7816 if (wand->debug != MagickFalse)
7817 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7818 ping_info=CloneImageInfo(wand->image_info);
7819 if (filename != (const char *) NULL)
7820 (void) CopyMagickString(ping_info->filename,filename,MaxTextExtent);
7821 images=PingImage(ping_info,wand->exception);
7822 ping_info=DestroyImageInfo(ping_info);
7823 if (images == (Image *) NULL)
7824 return(MagickFalse);
7825 return(InsertImageInWand(wand,images));
7829 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7833 % M a g i c k P i n g I m a g e B l o b %
7837 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7839 % MagickPingImageBlob() pings an image or image sequence from a blob.
7841 % The format of the MagickPingImageBlob method is:
7843 % MagickBooleanType MagickPingImageBlob(MagickWand *wand,
7844 % const void *blob,const size_t length)
7846 % A description of each parameter follows:
7848 % o wand: the magick wand.
7852 % o length: the blob length.
7855 WandExport MagickBooleanType MagickPingImageBlob(MagickWand *wand,
7856 const void *blob,const size_t length)
7864 assert(wand != (MagickWand *) NULL);
7865 assert(wand->signature == WandSignature);
7866 if (wand->debug != MagickFalse)
7867 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7868 read_info=CloneImageInfo(wand->image_info);
7869 SetImageInfoBlob(read_info,blob,length);
7870 images=PingImage(read_info,wand->exception);
7871 read_info=DestroyImageInfo(read_info);
7872 if (images == (Image *) NULL)
7873 return(MagickFalse);
7874 return(InsertImageInWand(wand,images));
7878 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7882 % M a g i c k P i n g I m a g e F i l e %
7886 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7888 % MagickPingImageFile() pings an image or image sequence from an open file
7891 % The format of the MagickPingImageFile method is:
7893 % MagickBooleanType MagickPingImageFile(MagickWand *wand,FILE *file)
7895 % A description of each parameter follows:
7897 % o wand: the magick wand.
7899 % o file: the file descriptor.
7902 WandExport MagickBooleanType MagickPingImageFile(MagickWand *wand,FILE *file)
7910 assert(wand != (MagickWand *) NULL);
7911 assert(wand->signature == WandSignature);
7912 assert(file != (FILE *) NULL);
7913 if (wand->debug != MagickFalse)
7914 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7915 read_info=CloneImageInfo(wand->image_info);
7916 SetImageInfoFile(read_info,file);
7917 images=PingImage(read_info,wand->exception);
7918 read_info=DestroyImageInfo(read_info);
7919 if (images == (Image *) NULL)
7920 return(MagickFalse);
7921 return(InsertImageInWand(wand,images));
7925 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7929 % M a g i c k P o l a r o i d I m a g e %
7933 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7935 % MagickPolaroidImage() simulates a Polaroid picture.
7937 % The format of the MagickPolaroidImage method is:
7939 % MagickBooleanType MagickPolaroidImage(MagickWand *wand,
7940 % const DrawingWand *drawing_wand,const double angle)
7942 % A description of each parameter follows:
7944 % o wand: the magick wand.
7946 % o drawing_wand: the draw wand.
7948 % o angle: Apply the effect along this angle.
7951 WandExport MagickBooleanType MagickPolaroidImage(MagickWand *wand,
7952 const DrawingWand *drawing_wand,const double angle)
7960 assert(wand != (MagickWand *) NULL);
7961 assert(wand->signature == WandSignature);
7962 if (wand->debug != MagickFalse)
7963 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7964 if (wand->images == (Image *) NULL)
7965 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7966 draw_info=PeekDrawingWand(drawing_wand);
7967 if (draw_info == (DrawInfo *) NULL)
7968 return(MagickFalse);
7969 polaroid_image=PolaroidImage(wand->images,draw_info,angle,wand->exception);
7970 if (polaroid_image == (Image *) NULL)
7971 return(MagickFalse);
7972 ReplaceImageInList(&wand->images,polaroid_image);
7977 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7981 % M a g i c k P o s t e r i z e I m a g e %
7985 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7987 % MagickPosterizeImage() reduces the image to a limited number of color level.
7989 % The format of the MagickPosterizeImage method is:
7991 % MagickBooleanType MagickPosterizeImage(MagickWand *wand,
7992 % const unsigned levels,const MagickBooleanType dither)
7994 % A description of each parameter follows:
7996 % o wand: the magick wand.
7998 % o levels: Number of color levels allowed in each channel. Very low values
7999 % (2, 3, or 4) have the most visible effect.
8001 % o dither: Set this integer value to something other than zero to dither
8005 WandExport MagickBooleanType MagickPosterizeImage(MagickWand *wand,
8006 const size_t levels,const MagickBooleanType dither)
8011 assert(wand != (MagickWand *) NULL);
8012 assert(wand->signature == WandSignature);
8013 if (wand->debug != MagickFalse)
8014 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8015 if (wand->images == (Image *) NULL)
8016 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8017 status=PosterizeImage(wand->images,levels,dither);
8018 if (status == MagickFalse)
8019 InheritException(wand->exception,&wand->images->exception);
8024 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8028 % M a g i c k P r e v i e w I m a g e s %
8032 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8034 % MagickPreviewImages() tiles 9 thumbnails of the specified image with an
8035 % image processing operation applied at varying strengths. This helpful
8036 % to quickly pin-point an appropriate parameter for an image processing
8039 % The format of the MagickPreviewImages method is:
8041 % MagickWand *MagickPreviewImages(MagickWand *wand,
8042 % const PreviewType preview)
8044 % A description of each parameter follows:
8046 % o wand: the magick wand.
8048 % o preview: the preview type.
8051 WandExport MagickWand *MagickPreviewImages(MagickWand *wand,
8052 const PreviewType preview)
8057 assert(wand != (MagickWand *) NULL);
8058 assert(wand->signature == WandSignature);
8059 if (wand->debug != MagickFalse)
8060 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8061 if (wand->images == (Image *) NULL)
8062 return((MagickWand *) NULL);
8063 preview_image=PreviewImage(wand->images,preview,wand->exception);
8064 if (preview_image == (Image *) NULL)
8065 return((MagickWand *) NULL);
8066 return(CloneMagickWandFromImages(wand,preview_image));
8070 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8074 % M a g i c k P r e v i o u s I m a g e %
8078 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8080 % MagickPreviousImage() assocates the previous image in an image list with
8083 % The format of the MagickPreviousImage method is:
8085 % MagickBooleanType MagickPreviousImage(MagickWand *wand)
8087 % A description of each parameter follows:
8089 % o wand: the magick wand.
8092 WandExport MagickBooleanType MagickPreviousImage(MagickWand *wand)
8094 assert(wand != (MagickWand *) NULL);
8095 assert(wand->signature == WandSignature);
8096 if (wand->debug != MagickFalse)
8097 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8098 if (wand->images == (Image *) NULL)
8099 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8100 if (wand->pend != MagickFalse)
8102 wand->pend=MagickFalse;
8105 if (GetPreviousImageInList(wand->images) == (Image *) NULL)
8107 wand->pend=MagickTrue;
8108 return(MagickFalse);
8110 wand->images=GetPreviousImageInList(wand->images);
8115 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8119 % M a g i c k Q u a n t i z e I m a g e %
8123 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8125 % MagickQuantizeImage() analyzes the colors within a reference image and
8126 % chooses a fixed number of colors to represent the image. The goal of the
8127 % algorithm is to minimize the color difference between the input and output
8128 % image while minimizing the processing time.
8130 % The format of the MagickQuantizeImage method is:
8132 % MagickBooleanType MagickQuantizeImage(MagickWand *wand,
8133 % const size_t number_colors,const ColorspaceType colorspace,
8134 % const size_t treedepth,const MagickBooleanType dither,
8135 % const MagickBooleanType measure_error)
8137 % A description of each parameter follows:
8139 % o wand: the magick wand.
8141 % o number_colors: the number of colors.
8143 % o colorspace: Perform color reduction in this colorspace, typically
8146 % o treedepth: Normally, this integer value is zero or one. A zero or
8147 % 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
8148 % reference image with the least amount of memory and the fastest
8149 % computational speed. In some cases, such as an image with low color
8150 % dispersion (a few number of colors), a value other than
8151 % Log4(number_colors) is required. To expand the color tree completely,
8154 % o dither: A value other than zero distributes the difference between an
8155 % original image and the corresponding color reduced image to
8156 % neighboring pixels along a Hilbert curve.
8158 % o measure_error: A value other than zero measures the difference between
8159 % the original and quantized images. This difference is the total
8160 % quantization error. The error is computed by summing over all pixels
8161 % in an image the distance squared in RGB space between each reference
8162 % pixel value and its quantized value.
8165 WandExport MagickBooleanType MagickQuantizeImage(MagickWand *wand,
8166 const size_t number_colors,const ColorspaceType colorspace,
8167 const size_t treedepth,const MagickBooleanType dither,
8168 const MagickBooleanType measure_error)
8176 assert(wand != (MagickWand *) NULL);
8177 assert(wand->signature == WandSignature);
8178 if (wand->debug != MagickFalse)
8179 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8180 if (wand->images == (Image *) NULL)
8181 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8182 quantize_info=CloneQuantizeInfo((QuantizeInfo *) NULL);
8183 quantize_info->number_colors=number_colors;
8184 quantize_info->dither=dither;
8185 quantize_info->tree_depth=treedepth;
8186 quantize_info->colorspace=colorspace;
8187 quantize_info->measure_error=measure_error;
8188 status=QuantizeImage(quantize_info,wand->images);
8189 if (status == MagickFalse)
8190 InheritException(wand->exception,&wand->images->exception);
8191 quantize_info=DestroyQuantizeInfo(quantize_info);
8196 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8200 % M a g i c k Q u a n t i z e I m a g e s %
8204 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8206 % MagickQuantizeImages() analyzes the colors within a sequence of images and
8207 % chooses a fixed number of colors to represent the image. The goal of the
8208 % algorithm is to minimize the color difference between the input and output
8209 % image while minimizing the processing time.
8211 % The format of the MagickQuantizeImages method is:
8213 % MagickBooleanType MagickQuantizeImages(MagickWand *wand,
8214 % const size_t number_colors,const ColorspaceType colorspace,
8215 % const size_t treedepth,const MagickBooleanType dither,
8216 % const MagickBooleanType measure_error)
8218 % A description of each parameter follows:
8220 % o wand: the magick wand.
8222 % o number_colors: the number of colors.
8224 % o colorspace: Perform color reduction in this colorspace, typically
8227 % o treedepth: Normally, this integer value is zero or one. A zero or
8228 % 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
8229 % reference image with the least amount of memory and the fastest
8230 % computational speed. In some cases, such as an image with low color
8231 % dispersion (a few number of colors), a value other than
8232 % Log4(number_colors) is required. To expand the color tree completely,
8235 % o dither: A value other than zero distributes the difference between an
8236 % original image and the corresponding color reduced algorithm to
8237 % neighboring pixels along a Hilbert curve.
8239 % o measure_error: A value other than zero measures the difference between
8240 % the original and quantized images. This difference is the total
8241 % quantization error. The error is computed by summing over all pixels
8242 % in an image the distance squared in RGB space between each reference
8243 % pixel value and its quantized value.
8246 WandExport MagickBooleanType MagickQuantizeImages(MagickWand *wand,
8247 const size_t number_colors,const ColorspaceType colorspace,
8248 const size_t treedepth,const MagickBooleanType dither,
8249 const MagickBooleanType measure_error)
8257 assert(wand != (MagickWand *) NULL);
8258 assert(wand->signature == WandSignature);
8259 if (wand->debug != MagickFalse)
8260 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8261 if (wand->images == (Image *) NULL)
8262 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8263 quantize_info=CloneQuantizeInfo((QuantizeInfo *) NULL);
8264 quantize_info->number_colors=number_colors;
8265 quantize_info->dither=dither;
8266 quantize_info->tree_depth=treedepth;
8267 quantize_info->colorspace=colorspace;
8268 quantize_info->measure_error=measure_error;
8269 status=QuantizeImages(quantize_info,wand->images);
8270 if (status == MagickFalse)
8271 InheritException(wand->exception,&wand->images->exception);
8272 quantize_info=DestroyQuantizeInfo(quantize_info);
8277 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8281 % M a g i c k R a d i a l B l u r I m a g e %
8285 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8287 % MagickRadialBlurImage() radial blurs an image.
8289 % The format of the MagickRadialBlurImage method is:
8291 % MagickBooleanType MagickRadialBlurImage(MagickWand *wand,
8292 % const double angle)
8293 % MagickBooleanType MagickRadialBlurImageChannel(MagickWand *wand,
8294 % const ChannelType channel,const double angle)
8296 % A description of each parameter follows:
8298 % o wand: the magick wand.
8300 % o channel: the image channel(s).
8302 % o angle: the angle of the blur in degrees.
8305 WandExport MagickBooleanType MagickRadialBlurImage(MagickWand *wand,
8311 status=MagickRadialBlurImageChannel(wand,DefaultChannels,angle);
8315 WandExport MagickBooleanType MagickRadialBlurImageChannel(MagickWand *wand,
8316 const ChannelType channel,const double angle)
8321 assert(wand != (MagickWand *) NULL);
8322 assert(wand->signature == WandSignature);
8323 if (wand->debug != MagickFalse)
8324 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8325 if (wand->images == (Image *) NULL)
8326 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8327 blur_image=RadialBlurImageChannel(wand->images,channel,angle,
8329 if (blur_image == (Image *) NULL)
8330 return(MagickFalse);
8331 ReplaceImageInList(&wand->images,blur_image);
8336 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8340 % M a g i c k R a i s e I m a g e %
8344 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8346 % MagickRaiseImage() creates a simulated three-dimensional button-like effect
8347 % by lightening and darkening the edges of the image. Members width and
8348 % height of raise_info define the width of the vertical and horizontal
8349 % edge of the effect.
8351 % The format of the MagickRaiseImage method is:
8353 % MagickBooleanType MagickRaiseImage(MagickWand *wand,
8354 % const size_t width,const size_t height,const ssize_t x,
8355 % const ssize_t y,const MagickBooleanType raise)
8357 % A description of each parameter follows:
8359 % o wand: the magick wand.
8361 % o width,height,x,y: Define the dimensions of the area to raise.
8363 % o raise: A value other than zero creates a 3-D raise effect,
8364 % otherwise it has a lowered effect.
8367 WandExport MagickBooleanType MagickRaiseImage(MagickWand *wand,
8368 const size_t width,const size_t height,const ssize_t x,
8369 const ssize_t y,const MagickBooleanType raise)
8377 assert(wand != (MagickWand *) NULL);
8378 assert(wand->signature == WandSignature);
8379 if (wand->debug != MagickFalse)
8380 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8381 if (wand->images == (Image *) NULL)
8382 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8383 raise_info.width=width;
8384 raise_info.height=height;
8387 status=RaiseImage(wand->images,&raise_info,raise);
8388 if (status == MagickFalse)
8389 InheritException(wand->exception,&wand->images->exception);
8394 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8398 % 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 %
8402 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8404 % MagickRandomThresholdImage() changes the value of individual pixels based on
8405 % the intensity of each pixel compared to threshold. The result is a
8406 % high-contrast, two color image.
8408 % The format of the MagickRandomThresholdImage method is:
8410 % MagickBooleanType MagickRandomThresholdImage(MagickWand *wand,
8411 % const double low,const double high)
8412 % MagickBooleanType MagickRandomThresholdImageChannel(MagickWand *wand,
8413 % const ChannelType channel,const double low,const double high)
8415 % A description of each parameter follows:
8417 % o wand: the magick wand.
8419 % o channel: the image channel(s).
8421 % o low,high: Specify the high and low thresholds. These values range from
8422 % 0 to QuantumRange.
8426 WandExport MagickBooleanType MagickRandomThresholdImage(MagickWand *wand,
8427 const double low,const double high)
8432 status=MagickRandomThresholdImageChannel(wand,DefaultChannels,low,high);
8436 WandExport MagickBooleanType MagickRandomThresholdImageChannel(
8437 MagickWand *wand,const ChannelType channel,const double low,
8441 threshold[MaxTextExtent];
8446 assert(wand != (MagickWand *) NULL);
8447 assert(wand->signature == WandSignature);
8448 if (wand->debug != MagickFalse)
8449 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8450 if (wand->images == (Image *) NULL)
8451 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8452 (void) FormatMagickString(threshold,MaxTextExtent,"%gx%g",low,high);
8453 status=RandomThresholdImageChannel(wand->images,channel,threshold,
8455 if (status == MagickFalse)
8456 InheritException(wand->exception,&wand->images->exception);
8461 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8465 % M a g i c k R e a d I m a g e %
8469 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8471 % MagickReadImage() reads an image or image sequence. The images are inserted
8472 % at the current image pointer position. Use MagickSetFirstIterator(),
8473 % MagickSetLastIterator, or MagickSetImageIndex() to specify the current
8474 % image pointer position at the beginning of the image list, the end, or
8475 % anywhere in-between respectively.
8477 % The format of the MagickReadImage method is:
8479 % MagickBooleanType MagickReadImage(MagickWand *wand,const char *filename)
8481 % A description of each parameter follows:
8483 % o wand: the magick wand.
8485 % o filename: the image filename.
8488 WandExport MagickBooleanType MagickReadImage(MagickWand *wand,
8489 const char *filename)
8497 assert(wand != (MagickWand *) NULL);
8498 assert(wand->signature == WandSignature);
8499 if (wand->debug != MagickFalse)
8500 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8501 read_info=CloneImageInfo(wand->image_info);
8502 if (filename != (const char *) NULL)
8503 (void) CopyMagickString(read_info->filename,filename,MaxTextExtent);
8504 images=ReadImage(read_info,wand->exception);
8505 read_info=DestroyImageInfo(read_info);
8506 if (images == (Image *) NULL)
8507 return(MagickFalse);
8508 return(InsertImageInWand(wand,images));
8512 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8516 % M a g i c k R e a d I m a g e B l o b %
8520 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8522 % MagickReadImageBlob() reads an image or image sequence from a blob.
8524 % The format of the MagickReadImageBlob method is:
8526 % MagickBooleanType MagickReadImageBlob(MagickWand *wand,
8527 % const void *blob,const size_t length)
8529 % A description of each parameter follows:
8531 % o wand: the magick wand.
8535 % o length: the blob length.
8538 WandExport MagickBooleanType MagickReadImageBlob(MagickWand *wand,
8539 const void *blob,const size_t length)
8544 assert(wand != (MagickWand *) NULL);
8545 assert(wand->signature == WandSignature);
8546 if (wand->debug != MagickFalse)
8547 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8548 images=BlobToImage(wand->image_info,blob,length,wand->exception);
8549 if (images == (Image *) NULL)
8550 return(MagickFalse);
8551 return(InsertImageInWand(wand,images));
8555 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8559 % M a g i c k R e a d I m a g e F i l e %
8563 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8565 % MagickReadImageFile() reads an image or image sequence from an open file
8568 % The format of the MagickReadImageFile method is:
8570 % MagickBooleanType MagickReadImageFile(MagickWand *wand,FILE *file)
8572 % A description of each parameter follows:
8574 % o wand: the magick wand.
8576 % o file: the file descriptor.
8579 WandExport MagickBooleanType MagickReadImageFile(MagickWand *wand,FILE *file)
8587 assert(wand != (MagickWand *) NULL);
8588 assert(wand->signature == WandSignature);
8589 assert(file != (FILE *) NULL);
8590 if (wand->debug != MagickFalse)
8591 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8592 read_info=CloneImageInfo(wand->image_info);
8593 SetImageInfoFile(read_info,file);
8594 images=ReadImage(read_info,wand->exception);
8595 read_info=DestroyImageInfo(read_info);
8596 if (images == (Image *) NULL)
8597 return(MagickFalse);
8598 return(InsertImageInWand(wand,images));
8602 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8606 % M a g i c k R e d u c e N o i s e I m a g e %
8610 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8612 % MagickReduceNoiseImage() smooths the contours of an image while still
8613 % preserving edge information. The algorithm works by replacing each pixel
8614 % with its neighbor closest in value. A neighbor is defined by radius. Use
8615 % a radius of 0 and ReduceNoise() selects a suitable radius for you.
8617 % The format of the MagickReduceNoiseImage method is:
8619 % MagickBooleanType MagickReduceNoiseImage(MagickWand *wand,
8620 % const double radius)
8622 % A description of each parameter follows:
8624 % o wand: the magick wand.
8626 % o radius: the radius of the pixel neighborhood.
8629 WandExport MagickBooleanType MagickReduceNoiseImage(MagickWand *wand,
8630 const double radius)
8635 assert(wand != (MagickWand *) NULL);
8636 assert(wand->signature == WandSignature);
8637 if (wand->debug != MagickFalse)
8638 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8639 if (wand->images == (Image *) NULL)
8640 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8641 noise_image=ReduceNoiseImage(wand->images,radius,wand->exception);
8642 if (noise_image == (Image *) NULL)
8643 return(MagickFalse);
8644 ReplaceImageInList(&wand->images,noise_image);
8649 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8653 % M a g i c k R e m a p I m a g e %
8657 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8659 % MagickRemapImage() replaces the colors of an image with the closest color
8660 % from a reference image.
8662 % The format of the MagickRemapImage method is:
8664 % MagickBooleanType MagickRemapImage(MagickWand *wand,
8665 % const MagickWand *remap_wand,const DitherMethod method)
8667 % A description of each parameter follows:
8669 % o wand: the magick wand.
8671 % o affinity: the affinity wand.
8673 % o method: choose from these dither methods: NoDitherMethod,
8674 % RiemersmaDitherMethod, or FloydSteinbergDitherMethod.
8677 WandExport MagickBooleanType MagickRemapImage(MagickWand *wand,
8678 const MagickWand *remap_wand,const DitherMethod method)
8686 assert(wand != (MagickWand *) NULL);
8687 assert(wand->signature == WandSignature);
8688 if (wand->debug != MagickFalse)
8689 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8690 if ((wand->images == (Image *) NULL) ||
8691 (remap_wand->images == (Image *) NULL))
8692 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8693 quantize_info=AcquireQuantizeInfo(wand->image_info);
8694 quantize_info->dither_method=method;
8695 if (method == NoDitherMethod)
8696 quantize_info->dither=MagickFalse;
8697 status=RemapImage(quantize_info,wand->images,remap_wand->images);
8698 quantize_info=DestroyQuantizeInfo(quantize_info);
8699 if (status == MagickFalse)
8700 InheritException(wand->exception,&wand->images->exception);
8705 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8709 % M a g i c k R e m o v e I m a g e %
8713 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8715 % MagickRemoveImage() removes an image from the image list.
8717 % The format of the MagickRemoveImage method is:
8719 % MagickBooleanType MagickRemoveImage(MagickWand *wand)
8721 % A description of each parameter follows:
8723 % o wand: the magick wand.
8725 % o insert: the splice wand.
8728 WandExport MagickBooleanType MagickRemoveImage(MagickWand *wand)
8730 assert(wand != (MagickWand *) NULL);
8731 assert(wand->signature == WandSignature);
8732 if (wand->debug != MagickFalse)
8733 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8734 if (wand->images == (Image *) NULL)
8735 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8736 DeleteImageFromList(&wand->images);
8741 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8745 % M a g i c k R e s a m p l e I m a g e %
8749 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8751 % MagickResampleImage() resample image to desired resolution.
8753 % Bessel Blackman Box
8754 % Catrom Cubic Gaussian
8755 % Hanning Hermite Lanczos
8756 % Mitchell Point Quandratic
8759 % Most of the filters are FIR (finite impulse response), however, Bessel,
8760 % Gaussian, and Sinc are IIR (infinite impulse response). Bessel and Sinc
8761 % are windowed (brought down to zero) with the Blackman filter.
8763 % The format of the MagickResampleImage method is:
8765 % MagickBooleanType MagickResampleImage(MagickWand *wand,
8766 % const double x_resolution,const double y_resolution,
8767 % const FilterTypes filter,const double blur)
8769 % A description of each parameter follows:
8771 % o wand: the magick wand.
8773 % o x_resolution: the new image x resolution.
8775 % o y_resolution: the new image y resolution.
8777 % o filter: Image filter to use.
8779 % o blur: the blur factor where > 1 is blurry, < 1 is sharp.
8782 WandExport MagickBooleanType MagickResampleImage(MagickWand *wand,
8783 const double x_resolution,const double y_resolution,const FilterTypes filter,
8789 assert(wand != (MagickWand *) NULL);
8790 assert(wand->signature == WandSignature);
8791 if (wand->debug != MagickFalse)
8792 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8793 if (wand->images == (Image *) NULL)
8794 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8795 resample_image=ResampleImage(wand->images,x_resolution,y_resolution,filter,
8796 blur,wand->exception);
8797 if (resample_image == (Image *) NULL)
8798 return(MagickFalse);
8799 ReplaceImageInList(&wand->images,resample_image);
8804 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8808 % M a g i c k R e s e t I m a g e P a g e %
8812 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8814 % MagickResetImagePage() resets the Wand page canvas and position.
8816 % The format of the MagickResetImagePage method is:
8818 % MagickBooleanType MagickResetImagePage(MagickWand *wand,
8821 % A description of each parameter follows:
8823 % o wand: the magick wand.
8825 % o page: the relative page specification.
8828 WandExport MagickBooleanType MagickResetImagePage(MagickWand *wand,
8831 assert(wand != (MagickWand *) NULL);
8832 assert(wand->signature == WandSignature);
8833 if (wand->debug != MagickFalse)
8834 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8835 if (wand->images == (Image *) NULL)
8836 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8837 if ((page == (char *) NULL) || (*page == '\0'))
8839 (void) ParseAbsoluteGeometry("0x0+0+0",&wand->images->page);
8842 return(ResetImagePage(wand->images,page));
8846 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8850 % M a g i c k R e s i z e I m a g e %
8854 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8856 % MagickResizeImage() scales an image to the desired dimensions with one of
8859 % Bessel Blackman Box
8860 % Catrom Cubic Gaussian
8861 % Hanning Hermite Lanczos
8862 % Mitchell Point Quandratic
8865 % Most of the filters are FIR (finite impulse response), however, Bessel,
8866 % Gaussian, and Sinc are IIR (infinite impulse response). Bessel and Sinc
8867 % are windowed (brought down to zero) with the Blackman filter.
8869 % The format of the MagickResizeImage method is:
8871 % MagickBooleanType MagickResizeImage(MagickWand *wand,
8872 % const size_t columns,const size_t rows,
8873 % const FilterTypes filter,const double blur)
8875 % A description of each parameter follows:
8877 % o wand: the magick wand.
8879 % o columns: the number of columns in the scaled image.
8881 % o rows: the number of rows in the scaled image.
8883 % o filter: Image filter to use.
8885 % o blur: the blur factor where > 1 is blurry, < 1 is sharp.
8888 WandExport MagickBooleanType MagickResizeImage(MagickWand *wand,
8889 const size_t columns,const size_t rows,const FilterTypes filter,
8895 assert(wand != (MagickWand *) NULL);
8896 assert(wand->signature == WandSignature);
8897 if (wand->debug != MagickFalse)
8898 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8899 if (wand->images == (Image *) NULL)
8900 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8901 resize_image=ResizeImage(wand->images,columns,rows,filter,blur,
8903 if (resize_image == (Image *) NULL)
8904 return(MagickFalse);
8905 ReplaceImageInList(&wand->images,resize_image);
8910 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8914 % M a g i c k R o l l I m a g e %
8918 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8920 % MagickRollImage() offsets an image as defined by x and y.
8922 % The format of the MagickRollImage method is:
8924 % MagickBooleanType MagickRollImage(MagickWand *wand,const ssize_t x,
8927 % A description of each parameter follows:
8929 % o wand: the magick wand.
8931 % o x: the x offset.
8933 % o y: the y offset.
8937 WandExport MagickBooleanType MagickRollImage(MagickWand *wand,
8938 const ssize_t x,const ssize_t y)
8943 assert(wand != (MagickWand *) NULL);
8944 assert(wand->signature == WandSignature);
8945 if (wand->debug != MagickFalse)
8946 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8947 if (wand->images == (Image *) NULL)
8948 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8949 roll_image=RollImage(wand->images,x,y,wand->exception);
8950 if (roll_image == (Image *) NULL)
8951 return(MagickFalse);
8952 ReplaceImageInList(&wand->images,roll_image);
8957 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8961 % M a g i c k R o t a t e I m a g e %
8965 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8967 % MagickRotateImage() rotates an image the specified number of degrees. Empty
8968 % triangles left over from rotating the image are filled with the
8971 % The format of the MagickRotateImage method is:
8973 % MagickBooleanType MagickRotateImage(MagickWand *wand,
8974 % const PixelWand *background,const double degrees)
8976 % A description of each parameter follows:
8978 % o wand: the magick wand.
8980 % o background: the background pixel wand.
8982 % o degrees: the number of degrees to rotate the image.
8986 WandExport MagickBooleanType MagickRotateImage(MagickWand *wand,
8987 const PixelWand *background,const double degrees)
8992 assert(wand != (MagickWand *) NULL);
8993 assert(wand->signature == WandSignature);
8994 if (wand->debug != MagickFalse)
8995 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8996 if (wand->images == (Image *) NULL)
8997 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8998 PixelGetQuantumColor(background,&wand->images->background_color);
8999 rotate_image=RotateImage(wand->images,degrees,wand->exception);
9000 if (rotate_image == (Image *) NULL)
9001 return(MagickFalse);
9002 ReplaceImageInList(&wand->images,rotate_image);
9007 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9011 % M a g i c k S a m p l e I m a g e %
9015 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9017 % MagickSampleImage() scales an image to the desired dimensions with pixel
9018 % sampling. Unlike other scaling methods, this method does not introduce
9019 % any additional color into the scaled image.
9021 % The format of the MagickSampleImage method is:
9023 % MagickBooleanType MagickSampleImage(MagickWand *wand,
9024 % const size_t columns,const size_t rows)
9026 % A description of each parameter follows:
9028 % o wand: the magick wand.
9030 % o columns: the number of columns in the scaled image.
9032 % o rows: the number of rows in the scaled image.
9036 WandExport MagickBooleanType MagickSampleImage(MagickWand *wand,
9037 const size_t columns,const size_t rows)
9042 assert(wand != (MagickWand *) NULL);
9043 assert(wand->signature == WandSignature);
9044 if (wand->debug != MagickFalse)
9045 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9046 if (wand->images == (Image *) NULL)
9047 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9048 sample_image=SampleImage(wand->images,columns,rows,wand->exception);
9049 if (sample_image == (Image *) NULL)
9050 return(MagickFalse);
9051 ReplaceImageInList(&wand->images,sample_image);
9056 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9060 % M a g i c k S c a l e I m a g e %
9064 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9066 % MagickScaleImage() scales the size of an image to the given dimensions.
9068 % The format of the MagickScaleImage method is:
9070 % MagickBooleanType MagickScaleImage(MagickWand *wand,
9071 % const size_t columns,const size_t rows)
9073 % A description of each parameter follows:
9075 % o wand: the magick wand.
9077 % o columns: the number of columns in the scaled image.
9079 % o rows: the number of rows in the scaled image.
9083 WandExport MagickBooleanType MagickScaleImage(MagickWand *wand,
9084 const size_t columns,const size_t rows)
9089 assert(wand != (MagickWand *) NULL);
9090 assert(wand->signature == WandSignature);
9091 if (wand->debug != MagickFalse)
9092 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9093 if (wand->images == (Image *) NULL)
9094 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9095 scale_image=ScaleImage(wand->images,columns,rows,wand->exception);
9096 if (scale_image == (Image *) NULL)
9097 return(MagickFalse);
9098 ReplaceImageInList(&wand->images,scale_image);
9103 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9107 % M a g i c k S e g m e n t I m a g e %
9111 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9113 % MagickSegmentImage() segments an image by analyzing the histograms of the
9114 % color components and identifying units that are homogeneous with the fuzzy
9115 % C-means technique.
9117 % The format of the SegmentImage method is:
9119 % MagickBooleanType MagickSegmentImage(MagickWand *wand,
9120 % const ColorspaceType colorspace,const MagickBooleanType verbose,
9121 % const double cluster_threshold,const double smooth_threshold)
9123 % A description of each parameter follows.
9127 % o colorspace: the image colorspace.
9129 % o verbose: Set to MagickTrue to print detailed information about the
9130 % identified classes.
9132 % o cluster_threshold: This represents the minimum number of pixels
9133 % contained in a hexahedra before it can be considered valid (expressed as
9136 % o smooth_threshold: the smoothing threshold eliminates noise in the second
9137 % derivative of the histogram. As the value is increased, you can expect a
9138 % smoother second derivative.
9141 MagickExport MagickBooleanType MagickSegmentImage(MagickWand *wand,
9142 const ColorspaceType colorspace,const MagickBooleanType verbose,
9143 const double cluster_threshold,const double smooth_threshold)
9148 assert(wand != (MagickWand *) NULL);
9149 assert(wand->signature == WandSignature);
9150 if (wand->debug != MagickFalse)
9151 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9152 if (wand->images == (Image *) NULL)
9153 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9154 status=SegmentImage(wand->images,colorspace,verbose,cluster_threshold,
9156 if (status == MagickFalse)
9157 InheritException(wand->exception,&wand->images->exception);
9162 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9166 % M a g i c k S e l e c t i v e B l u r I m a g e %
9170 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9172 % MagickSelectiveBlurImage() selectively blur an image within a contrast
9173 % threshold. It is similar to the unsharpen mask that sharpens everything with
9174 % contrast above a certain threshold.
9176 % The format of the MagickSelectiveBlurImage method is:
9178 % MagickBooleanType MagickSelectiveBlurImage(MagickWand *wand,
9179 % const double radius,const double sigma,const double threshold)
9180 % MagickBooleanType MagickSelectiveBlurImageChannel(MagickWand *wand,
9181 % const ChannelType channel,const double radius,const double sigma,
9182 % const double threshold)
9184 % A description of each parameter follows:
9186 % o wand: the magick wand.
9188 % o channel: the image channel(s).
9190 % o radius: the radius of the gaussian, in pixels, not counting the center
9193 % o sigma: the standard deviation of the gaussian, in pixels.
9195 % o threshold: only pixels within this contrast threshold are included
9196 % in the blur operation.
9200 WandExport MagickBooleanType MagickSelectiveBlurImage(MagickWand *wand,
9201 const double radius,const double sigma,const double threshold)
9206 status=MagickSelectiveBlurImageChannel(wand,DefaultChannels,radius,sigma,
9211 WandExport MagickBooleanType MagickSelectiveBlurImageChannel(MagickWand *wand,
9212 const ChannelType channel,const double radius,const double sigma,
9213 const double threshold)
9218 assert(wand != (MagickWand *) NULL);
9219 assert(wand->signature == WandSignature);
9220 if (wand->debug != MagickFalse)
9221 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9222 if (wand->images == (Image *) NULL)
9223 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9224 blur_image=SelectiveBlurImageChannel(wand->images,channel,radius,sigma,
9225 threshold,wand->exception);
9226 if (blur_image == (Image *) NULL)
9227 return(MagickFalse);
9228 ReplaceImageInList(&wand->images,blur_image);
9233 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9237 % 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 %
9241 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9243 % MagickSeparateImageChannel() separates a channel from the image and returns a
9244 % grayscale image. A channel is a particular color component of each pixel
9247 % The format of the MagickSeparateImageChannel method is:
9249 % MagickBooleanType MagickSeparateImageChannel(MagickWand *wand,
9250 % const ChannelType channel)
9252 % A description of each parameter follows:
9254 % o wand: the magick wand.
9256 % o channel: the image channel(s).
9259 WandExport MagickBooleanType MagickSeparateImageChannel(MagickWand *wand,
9260 const ChannelType channel)
9265 assert(wand != (MagickWand *) NULL);
9266 assert(wand->signature == WandSignature);
9267 if (wand->debug != MagickFalse)
9268 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9269 if (wand->images == (Image *) NULL)
9270 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9271 status=SeparateImageChannel(wand->images,channel);
9272 if (status == MagickFalse)
9273 InheritException(wand->exception,&wand->images->exception);
9278 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9282 % M a g i c k S e p i a T o n e I m a g e %
9286 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9288 % MagickSepiaToneImage() applies a special effect to the image, similar to the
9289 % effect achieved in a photo darkroom by sepia toning. Threshold ranges from
9290 % 0 to QuantumRange and is a measure of the extent of the sepia toning. A
9291 % threshold of 80% is a good starting point for a reasonable tone.
9293 % The format of the MagickSepiaToneImage method is:
9295 % MagickBooleanType MagickSepiaToneImage(MagickWand *wand,
9296 % const double threshold)
9298 % A description of each parameter follows:
9300 % o wand: the magick wand.
9302 % o threshold: Define the extent of the sepia toning.
9305 WandExport MagickBooleanType MagickSepiaToneImage(MagickWand *wand,
9306 const double threshold)
9311 assert(wand != (MagickWand *) NULL);
9312 assert(wand->signature == WandSignature);
9313 if (wand->debug != MagickFalse)
9314 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9315 if (wand->images == (Image *) NULL)
9316 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9317 sepia_image=SepiaToneImage(wand->images,threshold,wand->exception);
9318 if (sepia_image == (Image *) NULL)
9319 return(MagickFalse);
9320 ReplaceImageInList(&wand->images,sepia_image);
9325 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9329 % M a g i c k S e t I m a g e %
9333 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9335 % MagickSetImage() replaces the last image returned by MagickSetImageIndex(),
9336 % MagickNextImage(), MagickPreviousImage() with the images from the specified
9339 % The format of the MagickSetImage method is:
9341 % MagickBooleanType MagickSetImage(MagickWand *wand,
9342 % const MagickWand *set_wand)
9344 % A description of each parameter follows:
9346 % o wand: the magick wand.
9348 % o set_wand: the set_wand wand.
9351 WandExport MagickBooleanType MagickSetImage(MagickWand *wand,
9352 const MagickWand *set_wand)
9357 assert(wand != (MagickWand *) NULL);
9358 assert(wand->signature == WandSignature);
9359 if (wand->debug != MagickFalse)
9360 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9361 assert(set_wand != (MagickWand *) NULL);
9362 assert(set_wand->signature == WandSignature);
9363 if (wand->debug != MagickFalse)
9364 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",set_wand->name);
9365 if (set_wand->images == (Image *) NULL)
9366 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9367 images=CloneImageList(set_wand->images,wand->exception);
9368 if (images == (Image *) NULL)
9369 return(MagickFalse);
9370 ReplaceImageInList(&wand->images,images);
9375 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9379 % 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 %
9383 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9385 % MagickSetImageAlphaChannel() activates, deactivates, resets, or sets the
9388 % The format of the MagickSetImageAlphaChannel method is:
9390 % MagickBooleanType MagickSetImageAlphaChannel(MagickWand *wand,
9391 % const AlphaChannelType alpha_type)
9393 % A description of each parameter follows:
9395 % o wand: the magick wand.
9397 % o alpha_type: the alpha channel type: ActivateAlphaChannel,
9398 % DeactivateAlphaChannel, OpaqueAlphaChannel, or SetAlphaChannel.
9401 WandExport MagickBooleanType MagickSetImageAlphaChannel(MagickWand *wand,
9402 const AlphaChannelType alpha_type)
9404 assert(wand != (MagickWand *) NULL);
9405 assert(wand->signature == WandSignature);
9406 if (wand->debug != MagickFalse)
9407 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9408 if (wand->images == (Image *) NULL)
9409 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9410 return(SetImageAlphaChannel(wand->images,alpha_type));
9414 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9418 % 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 %
9422 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9424 % MagickSetImageBackgroundColor() sets the image background color.
9426 % The format of the MagickSetImageBackgroundColor method is:
9428 % MagickBooleanType MagickSetImageBackgroundColor(MagickWand *wand,
9429 % const PixelWand *background)
9431 % A description of each parameter follows:
9433 % o wand: the magick wand.
9435 % o background: the background pixel wand.
9438 WandExport MagickBooleanType MagickSetImageBackgroundColor(MagickWand *wand,
9439 const PixelWand *background)
9441 assert(wand != (MagickWand *) NULL);
9442 assert(wand->signature == WandSignature);
9443 if (wand->debug != MagickFalse)
9444 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9445 if (wand->images == (Image *) NULL)
9446 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9447 PixelGetQuantumColor(background,&wand->images->background_color);
9452 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9456 % M a g i c k S e t I m a g e B i a s %
9460 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9462 % MagickSetImageBias() sets the image bias for any method that convolves an
9463 % image (e.g. MagickConvolveImage()).
9465 % The format of the MagickSetImageBias method is:
9467 % MagickBooleanType MagickSetImageBias(MagickWand *wand,
9468 % const double bias)
9470 % A description of each parameter follows:
9472 % o wand: the magick wand.
9474 % o bias: the image bias.
9477 WandExport MagickBooleanType MagickSetImageBias(MagickWand *wand,
9480 assert(wand != (MagickWand *) NULL);
9481 assert(wand->signature == WandSignature);
9482 if (wand->debug != MagickFalse)
9483 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9484 if (wand->images == (Image *) NULL)
9485 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9486 wand->images->bias=bias;
9491 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9495 % 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 %
9499 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9501 % MagickSetImageBluePrimary() sets the image chromaticity blue primary point.
9503 % The format of the MagickSetImageBluePrimary method is:
9505 % MagickBooleanType MagickSetImageBluePrimary(MagickWand *wand,
9506 % const double x,const double y)
9508 % A description of each parameter follows:
9510 % o wand: the magick wand.
9512 % o x: the blue primary x-point.
9514 % o y: the blue primary y-point.
9517 WandExport MagickBooleanType MagickSetImageBluePrimary(MagickWand *wand,
9518 const double x,const double y)
9520 assert(wand != (MagickWand *) NULL);
9521 assert(wand->signature == WandSignature);
9522 if (wand->debug != MagickFalse)
9523 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9524 if (wand->images == (Image *) NULL)
9525 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9526 wand->images->chromaticity.blue_primary.x=x;
9527 wand->images->chromaticity.blue_primary.y=y;
9532 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9536 % 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 %
9540 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9542 % MagickSetImageBorderColor() sets the image border color.
9544 % The format of the MagickSetImageBorderColor method is:
9546 % MagickBooleanType MagickSetImageBorderColor(MagickWand *wand,
9547 % const PixelWand *border)
9549 % A description of each parameter follows:
9551 % o wand: the magick wand.
9553 % o border: the border pixel wand.
9556 WandExport MagickBooleanType MagickSetImageBorderColor(MagickWand *wand,
9557 const PixelWand *border)
9559 assert(wand != (MagickWand *) NULL);
9560 assert(wand->signature == WandSignature);
9561 if (wand->debug != MagickFalse)
9562 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9563 if (wand->images == (Image *) NULL)
9564 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9565 PixelGetQuantumColor(border,&wand->images->border_color);
9570 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9574 % 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 %
9578 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9580 % MagickSetImageChannelDepth() sets the depth of a particular image channel.
9582 % The format of the MagickSetImageChannelDepth method is:
9584 % MagickBooleanType MagickSetImageChannelDepth(MagickWand *wand,
9585 % const ChannelType channel,const size_t depth)
9587 % A description of each parameter follows:
9589 % o wand: the magick wand.
9591 % o channel: the image channel(s).
9593 % o depth: the image depth in bits.
9596 WandExport MagickBooleanType MagickSetImageChannelDepth(MagickWand *wand,
9597 const ChannelType channel,const size_t depth)
9599 assert(wand != (MagickWand *) NULL);
9600 assert(wand->signature == WandSignature);
9601 if (wand->debug != MagickFalse)
9602 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9603 if (wand->images == (Image *) NULL)
9604 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9605 return(SetImageChannelDepth(wand->images,channel,depth));
9609 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9613 % M a g i c k S e t I m a g e C l i p M a s k %
9617 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9619 % MagickSetImageClipMask() sets image clip mask.
9621 % The format of the MagickSetImageClipMask method is:
9623 % MagickBooleanType MagickSetImageClipMask(MagickWand *wand,
9624 % const MagickWand *clip_mask)
9626 % A description of each parameter follows:
9628 % o wand: the magick wand.
9630 % o clip_mask: the clip_mask wand.
9633 WandExport MagickBooleanType MagickSetImageClipMask(MagickWand *wand,
9634 const MagickWand *clip_mask)
9636 assert(wand != (MagickWand *) NULL);
9637 assert(wand->signature == WandSignature);
9638 if (wand->debug != MagickFalse)
9639 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9640 assert(clip_mask != (MagickWand *) NULL);
9641 assert(clip_mask->signature == WandSignature);
9642 if (wand->debug != MagickFalse)
9643 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",clip_mask->name);
9644 if (clip_mask->images == (Image *) NULL)
9645 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9646 return(SetImageClipMask(wand->images,clip_mask->images));
9650 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9654 % M a g i c k S e t I m a g e C o l o r %
9658 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9660 % MagickSetImageColor() set the entire wand canvas to the specified color.
9662 % The format of the MagickSetImageColor method is:
9664 % MagickBooleanType MagickSetImageColor(MagickWand *wand,
9665 % const PixelWand *color)
9667 % A description of each parameter follows:
9669 % o wand: the magick wand.
9671 % o background: the image color.
9674 WandExport MagickBooleanType MagickSetImageColor(MagickWand *wand,
9675 const PixelWand *color)
9683 assert(wand != (MagickWand *) NULL);
9684 assert(wand->signature == WandSignature);
9685 if (wand->debug != MagickFalse)
9686 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9687 PixelGetMagickColor(color,&pixel);
9688 status=SetImageColor(wand->images,&pixel);
9689 if (status == MagickFalse)
9690 InheritException(wand->exception,&wand->images->exception);
9695 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9699 % 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 %
9703 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9705 % MagickSetImageColormapColor() sets the color of the specified colormap
9708 % The format of the MagickSetImageColormapColor method is:
9710 % MagickBooleanType MagickSetImageColormapColor(MagickWand *wand,
9711 % const size_t index,const PixelWand *color)
9713 % A description of each parameter follows:
9715 % o wand: the magick wand.
9717 % o index: the offset into the image colormap.
9719 % o color: Return the colormap color in this wand.
9722 WandExport MagickBooleanType MagickSetImageColormapColor(MagickWand *wand,
9723 const size_t index,const PixelWand *color)
9725 assert(wand != (MagickWand *) NULL);
9726 assert(wand->signature == WandSignature);
9727 if (wand->debug != MagickFalse)
9728 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9729 if (wand->images == (Image *) NULL)
9730 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9731 if ((wand->images->colormap == (PixelPacket *) NULL) ||
9732 (index >= wand->images->colors))
9733 ThrowWandException(WandError,"InvalidColormapIndex",wand->name);
9734 PixelGetQuantumColor(color,wand->images->colormap+index);
9735 return(SyncImage(wand->images));
9739 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9743 % M a g i c k S e t I m a g e C o l o r s p a c e %
9747 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9749 % MagickSetImageColorspace() sets the image colorspace.
9751 % The format of the MagickSetImageColorspace method is:
9753 % MagickBooleanType MagickSetImageColorspace(MagickWand *wand,
9754 % const ColorspaceType colorspace)
9756 % A description of each parameter follows:
9758 % o wand: the magick wand.
9760 % o colorspace: the image colorspace: UndefinedColorspace, RGBColorspace,
9761 % GRAYColorspace, TransparentColorspace, OHTAColorspace, XYZColorspace,
9762 % YCbCrColorspace, YCCColorspace, YIQColorspace, YPbPrColorspace,
9763 % YPbPrColorspace, YUVColorspace, CMYKColorspace, sRGBColorspace,
9764 % HSLColorspace, or HWBColorspace.
9767 WandExport MagickBooleanType MagickSetImageColorspace(MagickWand *wand,
9768 const ColorspaceType colorspace)
9770 assert(wand != (MagickWand *) NULL);
9771 assert(wand->signature == WandSignature);
9772 if (wand->debug != MagickFalse)
9773 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9774 if (wand->images == (Image *) NULL)
9775 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9776 return(SetImageColorspace(wand->images,colorspace));
9780 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9784 % M a g i c k S e t I m a g e C o m p o s e %
9788 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9790 % MagickSetImageCompose() sets the image composite operator, useful for
9791 % specifying how to composite the image thumbnail when using the
9792 % MagickMontageImage() method.
9794 % The format of the MagickSetImageCompose method is:
9796 % MagickBooleanType MagickSetImageCompose(MagickWand *wand,
9797 % const CompositeOperator compose)
9799 % A description of each parameter follows:
9801 % o wand: the magick wand.
9803 % o compose: the image composite operator.
9806 WandExport MagickBooleanType MagickSetImageCompose(MagickWand *wand,
9807 const CompositeOperator compose)
9809 assert(wand != (MagickWand *) NULL);
9810 assert(wand->signature == WandSignature);
9811 if (wand->debug != MagickFalse)
9812 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9813 if (wand->images == (Image *) NULL)
9814 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9815 wand->images->compose=compose;
9820 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9824 % 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 %
9828 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9830 % MagickSetImageCompression() sets the image compression.
9832 % The format of the MagickSetImageCompression method is:
9834 % MagickBooleanType MagickSetImageCompression(MagickWand *wand,
9835 % const CompressionType compression)
9837 % A description of each parameter follows:
9839 % o wand: the magick wand.
9841 % o compression: the image compression type.
9844 WandExport MagickBooleanType MagickSetImageCompression(MagickWand *wand,
9845 const CompressionType compression)
9847 assert(wand != (MagickWand *) NULL);
9848 assert(wand->signature == WandSignature);
9849 if (wand->debug != MagickFalse)
9850 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9851 if (wand->images == (Image *) NULL)
9852 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9853 wand->images->compression=compression;
9858 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9862 % 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 %
9866 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9868 % MagickSetImageCompressionQuality() sets the image compression quality.
9870 % The format of the MagickSetImageCompressionQuality method is:
9872 % MagickBooleanType MagickSetImageCompressionQuality(MagickWand *wand,
9873 % const size_t quality)
9875 % A description of each parameter follows:
9877 % o wand: the magick wand.
9879 % o quality: the image compression tlityype.
9882 WandExport MagickBooleanType MagickSetImageCompressionQuality(MagickWand *wand,
9883 const size_t quality)
9885 assert(wand != (MagickWand *) NULL);
9886 assert(wand->signature == WandSignature);
9887 if (wand->debug != MagickFalse)
9888 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9889 if (wand->images == (Image *) NULL)
9890 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9891 wand->images->quality=quality;
9896 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9900 % M a g i c k S e t I m a g e D e l a y %
9904 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9906 % MagickSetImageDelay() sets the image delay.
9908 % The format of the MagickSetImageDelay method is:
9910 % MagickBooleanType MagickSetImageDelay(MagickWand *wand,
9911 % const size_t delay)
9913 % A description of each parameter follows:
9915 % o wand: the magick wand.
9917 % o delay: the image delay in ticks-per-second units.
9920 WandExport MagickBooleanType MagickSetImageDelay(MagickWand *wand,
9923 assert(wand != (MagickWand *) NULL);
9924 assert(wand->signature == WandSignature);
9925 if (wand->debug != MagickFalse)
9926 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9927 if (wand->images == (Image *) NULL)
9928 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9929 wand->images->delay=delay;
9934 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9938 % M a g i c k S e t I m a g e D e p t h %
9942 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9944 % MagickSetImageDepth() sets the image depth.
9946 % The format of the MagickSetImageDepth method is:
9948 % MagickBooleanType MagickSetImageDepth(MagickWand *wand,
9949 % const size_t depth)
9951 % A description of each parameter follows:
9953 % o wand: the magick wand.
9955 % o depth: the image depth in bits: 8, 16, or 32.
9958 WandExport MagickBooleanType MagickSetImageDepth(MagickWand *wand,
9961 assert(wand != (MagickWand *) NULL);
9962 assert(wand->signature == WandSignature);
9963 if (wand->debug != MagickFalse)
9964 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9965 if (wand->images == (Image *) NULL)
9966 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9967 wand->images->depth=depth;
9972 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9976 % M a g i c k S e t I m a g e D i s p o s e %
9980 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9982 % MagickSetImageDispose() sets the image disposal method.
9984 % The format of the MagickSetImageDispose method is:
9986 % MagickBooleanType MagickSetImageDispose(MagickWand *wand,
9987 % const DisposeType dispose)
9989 % A description of each parameter follows:
9991 % o wand: the magick wand.
9993 % o dispose: the image disposeal type.
9996 WandExport MagickBooleanType MagickSetImageDispose(MagickWand *wand,
9997 const DisposeType dispose)
9999 assert(wand != (MagickWand *) NULL);
10000 assert(wand->signature == WandSignature);
10001 if (wand->debug != MagickFalse)
10002 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10003 if (wand->images == (Image *) NULL)
10004 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10005 wand->images->dispose=dispose;
10006 return(MagickTrue);
10010 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10014 % M a g i c k S e t I m a g e E x t e n t %
10018 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10020 % MagickSetImageExtent() sets the image size (i.e. columns & rows).
10022 % The format of the MagickSetImageExtent method is:
10024 % MagickBooleanType MagickSetImageExtent(MagickWand *wand,
10025 % const size_t columns,const unsigned rows)
10027 % A description of each parameter follows:
10029 % o wand: the magick wand.
10031 % o columns: The image width in pixels.
10033 % o rows: The image height in pixels.
10036 WandExport MagickBooleanType MagickSetImageExtent(MagickWand *wand,
10037 const size_t columns,const size_t rows)
10039 assert(wand != (MagickWand *) NULL);
10040 assert(wand->signature == WandSignature);
10041 if (wand->debug != MagickFalse)
10042 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10043 if (wand->images == (Image *) NULL)
10044 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10045 return(SetImageExtent(wand->images,columns,rows));
10049 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10053 % M a g i c k S e t I m a g e F i l e n a m e %
10057 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10059 % MagickSetImageFilename() sets the filename of a particular image in a
10062 % The format of the MagickSetImageFilename method is:
10064 % MagickBooleanType MagickSetImageFilename(MagickWand *wand,
10065 % const char *filename)
10067 % A description of each parameter follows:
10069 % o wand: the magick wand.
10071 % o filename: the image filename.
10074 WandExport MagickBooleanType MagickSetImageFilename(MagickWand *wand,
10075 const char *filename)
10077 assert(wand != (MagickWand *) NULL);
10078 assert(wand->signature == WandSignature);
10079 if (wand->debug != MagickFalse)
10080 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10081 if (wand->images == (Image *) NULL)
10082 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10083 if (filename != (const char *) NULL)
10084 (void) CopyMagickString(wand->images->filename,filename,MaxTextExtent);
10085 return(MagickTrue);
10089 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10093 % M a g i c k S e t I m a g e F o r m a t %
10097 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10099 % MagickSetImageFormat() sets the format of a particular image in a
10102 % The format of the MagickSetImageFormat method is:
10104 % MagickBooleanType MagickSetImageFormat(MagickWand *wand,
10105 % const char *format)
10107 % A description of each parameter follows:
10109 % o wand: the magick wand.
10111 % o format: the image format.
10114 WandExport MagickBooleanType MagickSetImageFormat(MagickWand *wand,
10115 const char *format)
10120 assert(wand != (MagickWand *) NULL);
10121 assert(wand->signature == WandSignature);
10122 if (wand->debug != MagickFalse)
10123 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10124 if (wand->images == (Image *) NULL)
10125 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10126 if ((format == (char *) NULL) || (*format == '\0'))
10128 *wand->images->magick='\0';
10129 return(MagickTrue);
10131 magick_info=GetMagickInfo(format,wand->exception);
10132 if (magick_info == (const MagickInfo *) NULL)
10133 return(MagickFalse);
10134 ClearMagickException(wand->exception);
10135 (void) CopyMagickString(wand->images->magick,format,MaxTextExtent);
10136 return(MagickTrue);
10140 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10144 % M a g i c k S e t I m a g e F u z z %
10148 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10150 % MagickSetImageFuzz() sets the image fuzz.
10152 % The format of the MagickSetImageFuzz method is:
10154 % MagickBooleanType MagickSetImageFuzz(MagickWand *wand,
10155 % const double fuzz)
10157 % A description of each parameter follows:
10159 % o wand: the magick wand.
10161 % o fuzz: the image fuzz.
10164 WandExport MagickBooleanType MagickSetImageFuzz(MagickWand *wand,
10167 assert(wand != (MagickWand *) NULL);
10168 assert(wand->signature == WandSignature);
10169 if (wand->debug != MagickFalse)
10170 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10171 if (wand->images == (Image *) NULL)
10172 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10173 wand->images->fuzz=fuzz;
10174 return(MagickTrue);
10178 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10182 % M a g i c k S e t I m a g e G a m m a %
10186 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10188 % MagickSetImageGamma() sets the image gamma.
10190 % The format of the MagickSetImageGamma method is:
10192 % MagickBooleanType MagickSetImageGamma(MagickWand *wand,
10193 % const double gamma)
10195 % A description of each parameter follows:
10197 % o wand: the magick wand.
10199 % o gamma: the image gamma.
10202 WandExport MagickBooleanType MagickSetImageGamma(MagickWand *wand,
10203 const double gamma)
10205 assert(wand != (MagickWand *) NULL);
10206 assert(wand->signature == WandSignature);
10207 if (wand->debug != MagickFalse)
10208 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10209 if (wand->images == (Image *) NULL)
10210 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10211 wand->images->gamma=gamma;
10212 return(MagickTrue);
10216 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10220 % M a g i c k S e t I m a g e G r a v i t y %
10224 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10226 % MagickSetImageGravity() sets the image gravity type.
10228 % The format of the MagickSetImageGravity method is:
10230 % MagickBooleanType MagickSetImageGravity(MagickWand *wand,
10231 % const GravityType gravity)
10233 % A description of each parameter follows:
10235 % o wand: the magick wand.
10237 % o gravity: the image interlace scheme: NoInterlace, LineInterlace,
10238 % PlaneInterlace, PartitionInterlace.
10241 WandExport MagickBooleanType MagickSetImageGravity(MagickWand *wand,
10242 const GravityType gravity)
10244 assert(wand != (MagickWand *) NULL);
10245 assert(wand->signature == WandSignature);
10246 if (wand->debug != MagickFalse)
10247 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10248 if (wand->images == (Image *) NULL)
10249 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10250 wand->images->gravity=gravity;
10251 return(MagickTrue);
10255 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10259 % 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 %
10263 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10265 % MagickSetImageGreenPrimary() sets the image chromaticity green primary
10268 % The format of the MagickSetImageGreenPrimary method is:
10270 % MagickBooleanType MagickSetImageGreenPrimary(MagickWand *wand,
10271 % const double x,const double y)
10273 % A description of each parameter follows:
10275 % o wand: the magick wand.
10277 % o x: the green primary x-point.
10279 % o y: the green primary y-point.
10283 WandExport MagickBooleanType MagickSetImageGreenPrimary(MagickWand *wand,
10284 const double x,const double y)
10286 assert(wand != (MagickWand *) NULL);
10287 assert(wand->signature == WandSignature);
10288 if (wand->debug != MagickFalse)
10289 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10290 if (wand->images == (Image *) NULL)
10291 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10292 wand->images->chromaticity.green_primary.x=x;
10293 wand->images->chromaticity.green_primary.y=y;
10294 return(MagickTrue);
10298 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10302 % 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 %
10306 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10308 % MagickSetImageInterlaceScheme() sets the image interlace scheme.
10310 % The format of the MagickSetImageInterlaceScheme method is:
10312 % MagickBooleanType MagickSetImageInterlaceScheme(MagickWand *wand,
10313 % const InterlaceType interlace)
10315 % A description of each parameter follows:
10317 % o wand: the magick wand.
10319 % o interlace: the image interlace scheme: NoInterlace, LineInterlace,
10320 % PlaneInterlace, PartitionInterlace.
10323 WandExport MagickBooleanType MagickSetImageInterlaceScheme(MagickWand *wand,
10324 const InterlaceType interlace)
10326 assert(wand != (MagickWand *) NULL);
10327 assert(wand->signature == WandSignature);
10328 if (wand->debug != MagickFalse)
10329 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10330 if (wand->images == (Image *) NULL)
10331 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10332 wand->images->interlace=interlace;
10333 return(MagickTrue);
10337 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10341 % 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 %
10345 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10347 % MagickSetImageInterpolateMethod() sets the image interpolate pixel method.
10349 % The format of the MagickSetImageInterpolateMethod method is:
10351 % MagickBooleanType MagickSetImageInterpolateMethod(MagickWand *wand,
10352 % const InterpolatePixelMethod method)
10354 % A description of each parameter follows:
10356 % o wand: the magick wand.
10358 % o method: the image interpole pixel methods: choose from Undefined,
10359 % Average, Bicubic, Bilinear, Filter, Integer, Mesh, NearestNeighbor.
10362 WandExport MagickBooleanType MagickSetImageInterpolateMethod(MagickWand *wand,
10363 const InterpolatePixelMethod method)
10365 assert(wand != (MagickWand *) NULL);
10366 assert(wand->signature == WandSignature);
10367 if (wand->debug != MagickFalse)
10368 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10369 if (wand->images == (Image *) NULL)
10370 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10371 wand->images->interpolate=method;
10372 return(MagickTrue);
10376 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10380 % M a g i c k S e t I m a g e I t e r a t i o n s %
10384 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10386 % MagickSetImageIterations() sets the image iterations.
10388 % The format of the MagickSetImageIterations method is:
10390 % MagickBooleanType MagickSetImageIterations(MagickWand *wand,
10391 % const size_t iterations)
10393 % A description of each parameter follows:
10395 % o wand: the magick wand.
10397 % o delay: the image delay in 1/100th of a second.
10400 WandExport MagickBooleanType MagickSetImageIterations(MagickWand *wand,
10401 const size_t iterations)
10403 assert(wand != (MagickWand *) NULL);
10404 assert(wand->signature == WandSignature);
10405 if (wand->debug != MagickFalse)
10406 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10407 if (wand->images == (Image *) NULL)
10408 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10409 wand->images->iterations=iterations;
10410 return(MagickTrue);
10414 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10418 % M a g i c k S e t I m a g e M a t t e %
10422 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10424 % MagickSetImageMatte() sets the image matte channel.
10426 % The format of the MagickSetImageMatteColor method is:
10428 % MagickBooleanType MagickSetImageMatteColor(MagickWand *wand,
10429 % const MagickBooleanType *matte)
10431 % A description of each parameter follows:
10433 % o wand: the magick wand.
10435 % o matte: Set to MagickTrue to enable the image matte channel otherwise
10439 WandExport MagickBooleanType MagickSetImageMatte(MagickWand *wand,
10440 const MagickBooleanType matte)
10442 assert(wand != (MagickWand *) NULL);
10443 assert(wand->signature == WandSignature);
10444 if (wand->debug != MagickFalse)
10445 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10446 if (wand->images == (Image *) NULL)
10447 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10448 if ((wand->images->matte == MagickFalse) && (matte != MagickFalse))
10449 (void) SetImageOpacity(wand->images,OpaqueOpacity);
10450 wand->images->matte=matte;
10451 return(MagickTrue);
10455 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10459 % M a g i c k S e t I m a g e M a t t e C o l o r %
10463 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10465 % MagickSetImageMatteColor() sets the image matte color.
10467 % The format of the MagickSetImageMatteColor method is:
10469 % MagickBooleanType MagickSetImageMatteColor(MagickWand *wand,
10470 % const PixelWand *matte)
10472 % A description of each parameter follows:
10474 % o wand: the magick wand.
10476 % o matte: the matte pixel wand.
10479 WandExport MagickBooleanType MagickSetImageMatteColor(MagickWand *wand,
10480 const PixelWand *matte)
10482 assert(wand != (MagickWand *) NULL);
10483 assert(wand->signature == WandSignature);
10484 if (wand->debug != MagickFalse)
10485 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10486 if (wand->images == (Image *) NULL)
10487 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10488 PixelGetQuantumColor(matte,&wand->images->matte_color);
10489 return(MagickTrue);
10493 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10497 % M a g i c k S e t I m a g e O p a c i t y %
10501 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10503 % MagickSetImageOpacity() sets the image to the specified opacity level.
10505 % The format of the MagickSetImageOpacity method is:
10507 % MagickBooleanType MagickSetImageOpacity(MagickWand *wand,
10508 % const double alpha)
10510 % A description of each parameter follows:
10512 % o wand: the magick wand.
10514 % o alpha: the level of transparency: 1.0 is fully opaque and 0.0 is fully
10518 WandExport MagickBooleanType MagickSetImageOpacity(MagickWand *wand,
10519 const double alpha)
10524 assert(wand != (MagickWand *) NULL);
10525 assert(wand->signature == WandSignature);
10526 if (wand->debug != MagickFalse)
10527 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10528 if (wand->images == (Image *) NULL)
10529 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10530 status=SetImageOpacity(wand->images,ClampToQuantum((MagickRealType)
10531 QuantumRange-QuantumRange*alpha));
10532 if (status == MagickFalse)
10533 InheritException(wand->exception,&wand->images->exception);
10538 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10542 % 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 %
10546 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10548 % MagickSetImageOrientation() sets the image orientation.
10550 % The format of the MagickSetImageOrientation method is:
10552 % MagickBooleanType MagickSetImageOrientation(MagickWand *wand,
10553 % const OrientationType orientation)
10555 % A description of each parameter follows:
10557 % o wand: the magick wand.
10559 % o orientation: the image orientation type.
10562 WandExport MagickBooleanType MagickSetImageOrientation(MagickWand *wand,
10563 const OrientationType orientation)
10565 assert(wand != (MagickWand *) NULL);
10566 assert(wand->signature == WandSignature);
10567 if (wand->debug != MagickFalse)
10568 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10569 if (wand->images == (Image *) NULL)
10570 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10571 wand->images->orientation=orientation;
10572 return(MagickTrue);
10576 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10580 % M a g i c k S e t I m a g e P a g e %
10584 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10586 % MagickSetImagePage() sets the page geometry of the image.
10588 % The format of the MagickSetImagePage method is:
10590 % MagickBooleanType MagickSetImagePage(MagickWand *wand,
10591 % const size_t width,const size_t height,const ssize_t x,
10594 % A description of each parameter follows:
10596 % o wand: the magick wand.
10598 % o width: the page width.
10600 % o height: the page height.
10602 % o x: the page x-offset.
10604 % o y: the page y-offset.
10607 WandExport MagickBooleanType MagickSetImagePage(MagickWand *wand,
10608 const size_t width,const size_t height,const ssize_t x,
10611 assert(wand != (MagickWand *) NULL);
10612 assert(wand->signature == WandSignature);
10613 if (wand->debug != MagickFalse)
10614 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10615 if (wand->images == (Image *) NULL)
10616 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10617 wand->images->page.width=width;
10618 wand->images->page.height=height;
10619 wand->images->page.x=x;
10620 wand->images->page.y=y;
10621 return(MagickTrue);
10625 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10629 % 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 %
10633 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10635 % MagickSetImageProgressMonitor() sets the wand image progress monitor to the
10636 % specified method and returns the previous progress monitor if any. The
10637 % progress monitor method looks like this:
10639 % MagickBooleanType MagickProgressMonitor(const char *text,
10640 % const MagickOffsetType offset,const MagickSizeType span,
10641 % void *client_data)
10643 % If the progress monitor returns MagickFalse, the current operation is
10646 % The format of the MagickSetImageProgressMonitor method is:
10648 % MagickProgressMonitor MagickSetImageProgressMonitor(MagickWand *wand
10649 % const MagickProgressMonitor progress_monitor,void *client_data)
10651 % A description of each parameter follows:
10653 % o wand: the magick wand.
10655 % o progress_monitor: Specifies a pointer to a method to monitor progress
10656 % of an image operation.
10658 % o client_data: Specifies a pointer to any client data.
10661 WandExport MagickProgressMonitor MagickSetImageProgressMonitor(MagickWand *wand,
10662 const MagickProgressMonitor progress_monitor,void *client_data)
10664 MagickProgressMonitor
10667 assert(wand != (MagickWand *) NULL);
10668 assert(wand->signature == WandSignature);
10669 if (wand->debug != MagickFalse)
10670 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10671 if (wand->images == (Image *) NULL)
10673 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
10674 "ContainsNoImages","`%s'",wand->name);
10675 return((MagickProgressMonitor) NULL);
10677 previous_monitor=SetImageProgressMonitor(wand->images,
10678 progress_monitor,client_data);
10679 return(previous_monitor);
10683 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10687 % M a g i c k S e t I m a g e R e d P r i m a r y %
10691 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10693 % MagickSetImageRedPrimary() sets the image chromaticity red primary point.
10695 % The format of the MagickSetImageRedPrimary method is:
10697 % MagickBooleanType MagickSetImageRedPrimary(MagickWand *wand,
10698 % const double x,const double y)
10700 % A description of each parameter follows:
10702 % o wand: the magick wand.
10704 % o x: the red primary x-point.
10706 % o y: the red primary y-point.
10709 WandExport MagickBooleanType MagickSetImageRedPrimary(MagickWand *wand,
10710 const double x,const double y)
10712 assert(wand != (MagickWand *) NULL);
10713 assert(wand->signature == WandSignature);
10714 if (wand->debug != MagickFalse)
10715 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10716 if (wand->images == (Image *) NULL)
10717 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10718 wand->images->chromaticity.red_primary.x=x;
10719 wand->images->chromaticity.red_primary.y=y;
10720 return(MagickTrue);
10724 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10728 % 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 %
10732 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10734 % MagickSetImageRenderingIntent() sets the image rendering intent.
10736 % The format of the MagickSetImageRenderingIntent method is:
10738 % MagickBooleanType MagickSetImageRenderingIntent(MagickWand *wand,
10739 % const RenderingIntent rendering_intent)
10741 % A description of each parameter follows:
10743 % o wand: the magick wand.
10745 % o rendering_intent: the image rendering intent: UndefinedIntent,
10746 % SaturationIntent, PerceptualIntent, AbsoluteIntent, or RelativeIntent.
10749 WandExport MagickBooleanType MagickSetImageRenderingIntent(MagickWand *wand,
10750 const RenderingIntent rendering_intent)
10752 assert(wand != (MagickWand *) NULL);
10753 assert(wand->signature == WandSignature);
10754 if (wand->debug != MagickFalse)
10755 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10756 if (wand->images == (Image *) NULL)
10757 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10758 wand->images->rendering_intent=rendering_intent;
10759 return(MagickTrue);
10763 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10767 % M a g i c k S e t I m a g e R e s o l u t i o n %
10771 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10773 % MagickSetImageResolution() sets the image resolution.
10775 % The format of the MagickSetImageResolution method is:
10777 % MagickBooleanType MagickSetImageResolution(MagickWand *wand,
10778 % const double x_resolution,const doubtl y_resolution)
10780 % A description of each parameter follows:
10782 % o wand: the magick wand.
10784 % o x_resolution: the image x resolution.
10786 % o y_resolution: the image y resolution.
10789 WandExport MagickBooleanType MagickSetImageResolution(MagickWand *wand,
10790 const double x_resolution,const double y_resolution)
10792 assert(wand != (MagickWand *) NULL);
10793 assert(wand->signature == WandSignature);
10794 if (wand->debug != MagickFalse)
10795 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10796 if (wand->images == (Image *) NULL)
10797 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10798 wand->images->x_resolution=x_resolution;
10799 wand->images->y_resolution=y_resolution;
10800 return(MagickTrue);
10804 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10808 % M a g i c k S e t I m a g e S c e n e %
10812 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10814 % MagickSetImageScene() sets the image scene.
10816 % The format of the MagickSetImageScene method is:
10818 % MagickBooleanType MagickSetImageScene(MagickWand *wand,
10819 % const size_t scene)
10821 % A description of each parameter follows:
10823 % o wand: the magick wand.
10825 % o delay: the image scene number.
10828 WandExport MagickBooleanType MagickSetImageScene(MagickWand *wand,
10829 const size_t scene)
10831 assert(wand != (MagickWand *) NULL);
10832 assert(wand->signature == WandSignature);
10833 if (wand->debug != MagickFalse)
10834 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10835 if (wand->images == (Image *) NULL)
10836 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10837 wand->images->scene=scene;
10838 return(MagickTrue);
10842 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10846 % 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 %
10850 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10852 % MagickSetImageTicksPerSecond() sets the image ticks-per-second.
10854 % The format of the MagickSetImageTicksPerSecond method is:
10856 % MagickBooleanType MagickSetImageTicksPerSecond(MagickWand *wand,
10857 % const ssize_t ticks_per-second)
10859 % A description of each parameter follows:
10861 % o wand: the magick wand.
10863 % o ticks_per_second: the units to use for the image delay.
10866 WandExport MagickBooleanType MagickSetImageTicksPerSecond(MagickWand *wand,
10867 const ssize_t ticks_per_second)
10869 assert(wand != (MagickWand *) NULL);
10870 assert(wand->signature == WandSignature);
10871 if (wand->debug != MagickFalse)
10872 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10873 if (wand->images == (Image *) NULL)
10874 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10875 wand->images->ticks_per_second=ticks_per_second;
10876 return(MagickTrue);
10880 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10884 % M a g i c k S e t I m a g e T y p e %
10888 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10890 % MagickSetImageType() sets the image type.
10892 % The format of the MagickSetImageType method is:
10894 % MagickBooleanType MagickSetImageType(MagickWand *wand,
10895 % const ImageType image_type)
10897 % A description of each parameter follows:
10899 % o wand: the magick wand.
10901 % o image_type: the image type: UndefinedType, BilevelType, GrayscaleType,
10902 % GrayscaleMatteType, PaletteType, PaletteMatteType, TrueColorType,
10903 % TrueColorMatteType, ColorSeparationType, ColorSeparationMatteType,
10907 WandExport MagickBooleanType MagickSetImageType(MagickWand *wand,
10908 const ImageType image_type)
10910 assert(wand != (MagickWand *) NULL);
10911 assert(wand->signature == WandSignature);
10912 if (wand->debug != MagickFalse)
10913 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10914 if (wand->images == (Image *) NULL)
10915 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10916 return(SetImageType(wand->images,image_type));
10920 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10924 % M a g i c k S e t I m a g e U n i t s %
10928 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10930 % MagickSetImageUnits() sets the image units of resolution.
10932 % The format of the MagickSetImageUnits method is:
10934 % MagickBooleanType MagickSetImageUnits(MagickWand *wand,
10935 % const ResolutionType units)
10937 % A description of each parameter follows:
10939 % o wand: the magick wand.
10941 % o units: the image units of resolution : UndefinedResolution,
10942 % PixelsPerInchResolution, or PixelsPerCentimeterResolution.
10945 WandExport MagickBooleanType MagickSetImageUnits(MagickWand *wand,
10946 const ResolutionType units)
10948 assert(wand != (MagickWand *) NULL);
10949 assert(wand->signature == WandSignature);
10950 if (wand->debug != MagickFalse)
10951 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10952 if (wand->images == (Image *) NULL)
10953 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10954 wand->images->units=units;
10955 return(MagickTrue);
10959 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10963 % 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 %
10967 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10969 % MagickSetImageVirtualPixelMethod() sets the image virtual pixel method.
10971 % The format of the MagickSetImageVirtualPixelMethod method is:
10973 % VirtualPixelMethod MagickSetImageVirtualPixelMethod(MagickWand *wand,
10974 % const VirtualPixelMethod method)
10976 % A description of each parameter follows:
10978 % o wand: the magick wand.
10980 % o method: the image virtual pixel method : UndefinedVirtualPixelMethod,
10981 % ConstantVirtualPixelMethod, EdgeVirtualPixelMethod,
10982 % MirrorVirtualPixelMethod, or TileVirtualPixelMethod.
10985 WandExport VirtualPixelMethod MagickSetImageVirtualPixelMethod(MagickWand *wand,
10986 const VirtualPixelMethod method)
10988 assert(wand != (MagickWand *) NULL);
10989 assert(wand->signature == WandSignature);
10990 if (wand->debug != MagickFalse)
10991 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10992 if (wand->images == (Image *) NULL)
10993 return(UndefinedVirtualPixelMethod);
10994 return(SetImageVirtualPixelMethod(wand->images,method));
10998 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11002 % M a g i c k S e t I m a g e W h i t e P o i n t %
11006 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11008 % MagickSetImageWhitePoint() sets the image chromaticity white point.
11010 % The format of the MagickSetImageWhitePoint method is:
11012 % MagickBooleanType MagickSetImageWhitePoint(MagickWand *wand,
11013 % const double x,const double y)
11015 % A description of each parameter follows:
11017 % o wand: the magick wand.
11019 % o x: the white x-point.
11021 % o y: the white y-point.
11024 WandExport MagickBooleanType MagickSetImageWhitePoint(MagickWand *wand,
11025 const double x,const double y)
11027 assert(wand != (MagickWand *) NULL);
11028 assert(wand->signature == WandSignature);
11029 if (wand->debug != MagickFalse)
11030 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11031 if (wand->images == (Image *) NULL)
11032 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11033 wand->images->chromaticity.white_point.x=x;
11034 wand->images->chromaticity.white_point.y=y;
11035 return(MagickTrue);
11039 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11043 % M a g i c k S h a d e I m a g e C h a n n e l %
11047 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11049 % MagickShadeImage() shines a distant light on an image to create a
11050 % three-dimensional effect. You control the positioning of the light with
11051 % azimuth and elevation; azimuth is measured in degrees off the x axis
11052 % and elevation is measured in pixels above the Z axis.
11054 % The format of the MagickShadeImage method is:
11056 % MagickBooleanType MagickShadeImage(MagickWand *wand,
11057 % const MagickBooleanType gray,const double azimuth,
11058 % const double elevation)
11060 % A description of each parameter follows:
11062 % o wand: the magick wand.
11064 % o gray: A value other than zero shades the intensity of each pixel.
11066 % o azimuth, elevation: Define the light source direction.
11069 WandExport MagickBooleanType MagickShadeImage(MagickWand *wand,
11070 const MagickBooleanType gray,const double asimuth,const double elevation)
11075 assert(wand != (MagickWand *) NULL);
11076 assert(wand->signature == WandSignature);
11077 if (wand->debug != MagickFalse)
11078 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11079 if (wand->images == (Image *) NULL)
11080 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11081 shade_image=ShadeImage(wand->images,gray,asimuth,elevation,wand->exception);
11082 if (shade_image == (Image *) NULL)
11083 return(MagickFalse);
11084 ReplaceImageInList(&wand->images,shade_image);
11085 return(MagickTrue);
11089 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11093 % M a g i c k S h a d o w I m a g e %
11097 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11099 % MagickShadowImage() simulates an image shadow.
11101 % The format of the MagickShadowImage method is:
11103 % MagickBooleanType MagickShadowImage(MagickWand *wand,
11104 % const double opacity,const double sigma,const ssize_t x,const ssize_t y)
11106 % A description of each parameter follows:
11108 % o wand: the magick wand.
11110 % o opacity: percentage transparency.
11112 % o sigma: the standard deviation of the Gaussian, in pixels.
11114 % o x: the shadow x-offset.
11116 % o y: the shadow y-offset.
11119 WandExport MagickBooleanType MagickShadowImage(MagickWand *wand,
11120 const double opacity,const double sigma,const ssize_t x,const ssize_t y)
11125 assert(wand != (MagickWand *) NULL);
11126 assert(wand->signature == WandSignature);
11127 if (wand->debug != MagickFalse)
11128 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11129 if (wand->images == (Image *) NULL)
11130 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11131 shadow_image=ShadowImage(wand->images,opacity,sigma,x,y,wand->exception);
11132 if (shadow_image == (Image *) NULL)
11133 return(MagickFalse);
11134 ReplaceImageInList(&wand->images,shadow_image);
11135 return(MagickTrue);
11139 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11143 % M a g i c k S h a r p e n I m a g e %
11147 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11149 % MagickSharpenImage() sharpens an image. We convolve the image with a
11150 % Gaussian operator of the given radius and standard deviation (sigma).
11151 % For reasonable results, the radius should be larger than sigma. Use a
11152 % radius of 0 and MagickSharpenImage() selects a suitable radius for you.
11154 % The format of the MagickSharpenImage method is:
11156 % MagickBooleanType MagickSharpenImage(MagickWand *wand,
11157 % const double radius,const double sigma)
11158 % MagickBooleanType MagickSharpenImageChannel(MagickWand *wand,
11159 % const ChannelType channel,const double radius,const double sigma)
11161 % A description of each parameter follows:
11163 % o wand: the magick wand.
11165 % o channel: the image channel(s).
11167 % o radius: the radius of the Gaussian, in pixels, not counting the center
11170 % o sigma: the standard deviation of the Gaussian, in pixels.
11174 WandExport MagickBooleanType MagickSharpenImage(MagickWand *wand,
11175 const double radius,const double sigma)
11180 status=MagickSharpenImageChannel(wand,DefaultChannels,radius,sigma);
11184 WandExport MagickBooleanType MagickSharpenImageChannel(MagickWand *wand,
11185 const ChannelType channel,const double radius,const double sigma)
11190 assert(wand != (MagickWand *) NULL);
11191 assert(wand->signature == WandSignature);
11192 if (wand->debug != MagickFalse)
11193 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11194 if (wand->images == (Image *) NULL)
11195 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11196 sharp_image=SharpenImageChannel(wand->images,channel,radius,sigma,
11198 if (sharp_image == (Image *) NULL)
11199 return(MagickFalse);
11200 ReplaceImageInList(&wand->images,sharp_image);
11201 return(MagickTrue);
11205 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11209 % M a g i c k S h a v e I m a g e %
11213 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11215 % MagickShaveImage() shaves pixels from the image edges. It allocates the
11216 % memory necessary for the new Image structure and returns a pointer to the
11219 % The format of the MagickShaveImage method is:
11221 % MagickBooleanType MagickShaveImage(MagickWand *wand,
11222 % const size_t columns,const size_t rows)
11224 % A description of each parameter follows:
11226 % o wand: the magick wand.
11228 % o columns: the number of columns in the scaled image.
11230 % o rows: the number of rows in the scaled image.
11234 WandExport MagickBooleanType MagickShaveImage(MagickWand *wand,
11235 const size_t columns,const size_t rows)
11243 assert(wand != (MagickWand *) NULL);
11244 assert(wand->signature == WandSignature);
11245 if (wand->debug != MagickFalse)
11246 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11247 if (wand->images == (Image *) NULL)
11248 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11249 shave_info.width=columns;
11250 shave_info.height=rows;
11253 shave_image=ShaveImage(wand->images,&shave_info,wand->exception);
11254 if (shave_image == (Image *) NULL)
11255 return(MagickFalse);
11256 ReplaceImageInList(&wand->images,shave_image);
11257 return(MagickTrue);
11261 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11265 % M a g i c k S h e a r I m a g e %
11269 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11271 % MagickShearImage() slides one edge of an image along the X or Y axis,
11272 % creating a parallelogram. An X direction shear slides an edge along the X
11273 % axis, while a Y direction shear slides an edge along the Y axis. The amount
11274 % of the shear is controlled by a shear angle. For X direction shears, x_shear
11275 % is measured relative to the Y axis, and similarly, for Y direction shears
11276 % y_shear is measured relative to the X axis. Empty triangles left over from
11277 % shearing the image are filled with the background color.
11279 % The format of the MagickShearImage method is:
11281 % MagickBooleanType MagickShearImage(MagickWand *wand,
11282 % const PixelWand *background,const double x_shear,onst double y_shear)
11284 % A description of each parameter follows:
11286 % o wand: the magick wand.
11288 % o background: the background pixel wand.
11290 % o x_shear: the number of degrees to shear the image.
11292 % o y_shear: the number of degrees to shear the image.
11295 WandExport MagickBooleanType MagickShearImage(MagickWand *wand,
11296 const PixelWand *background,const double x_shear,const double y_shear)
11301 assert(wand != (MagickWand *) NULL);
11302 assert(wand->signature == WandSignature);
11303 if (wand->debug != MagickFalse)
11304 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11305 if (wand->images == (Image *) NULL)
11306 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11307 PixelGetQuantumColor(background,&wand->images->background_color);
11308 shear_image=ShearImage(wand->images,x_shear,y_shear,wand->exception);
11309 if (shear_image == (Image *) NULL)
11310 return(MagickFalse);
11311 ReplaceImageInList(&wand->images,shear_image);
11312 return(MagickTrue);
11316 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11320 % 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 %
11324 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11326 % MagickSigmoidalContrastImage() adjusts the contrast of an image with a
11327 % non-linear sigmoidal contrast algorithm. Increase the contrast of the
11328 % image using a sigmoidal transfer function without saturating highlights or
11329 % shadows. Contrast indicates how much to increase the contrast (0 is none;
11330 % 3 is typical; 20 is pushing it); mid-point indicates where midtones fall in
11331 % the resultant image (0 is white; 50% is middle-gray; 100% is black). Set
11332 % sharpen to MagickTrue to increase the image contrast otherwise the contrast
11335 % The format of the MagickSigmoidalContrastImage method is:
11337 % MagickBooleanType MagickSigmoidalContrastImage(MagickWand *wand,
11338 % const MagickBooleanType sharpen,const double alpha,const double beta)
11339 % MagickBooleanType MagickSigmoidalContrastImageChannel(MagickWand *wand,
11340 % const ChannelType channel,const MagickBooleanType sharpen,
11341 % const double alpha,const double beta)
11343 % A description of each parameter follows:
11345 % o wand: the magick wand.
11347 % o channel: Identify which channel to level: RedChannel, GreenChannel,
11349 % o sharpen: Increase or decrease image contrast.
11351 % o alpha: control the "shoulder" of the contast curve.
11353 % o beta: control the "toe" of the contast curve.
11357 WandExport MagickBooleanType MagickSigmoidalContrastImage(MagickWand *wand,
11358 const MagickBooleanType sharpen,const double alpha,const double beta)
11363 status=MagickSigmoidalContrastImageChannel(wand,DefaultChannels,sharpen,
11368 WandExport MagickBooleanType MagickSigmoidalContrastImageChannel(
11369 MagickWand *wand,const ChannelType channel,const MagickBooleanType sharpen,
11370 const double alpha,const double beta)
11375 assert(wand != (MagickWand *) NULL);
11376 assert(wand->signature == WandSignature);
11377 if (wand->debug != MagickFalse)
11378 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11379 if (wand->images == (Image *) NULL)
11380 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11381 status=SigmoidalContrastImageChannel(wand->images,channel,sharpen,alpha,beta);
11382 if (status == MagickFalse)
11383 InheritException(wand->exception,&wand->images->exception);
11388 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11392 % M a g i c k S i m i l a r i t y I m a g e %
11396 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11398 % MagickSimilarityImage() compares the reference image of the image and
11399 % returns the best match offset. In addition, it returns a similarity image
11400 % such that an exact match location is completely white and if none of the
11401 % pixels match, black, otherwise some gray level in-between.
11403 % The format of the MagickSimilarityImage method is:
11405 % MagickWand *MagickSimilarityImage(MagickWand *wand,
11406 % const MagickWand *reference,RectangeInfo *offset,double *similarity)
11408 % A description of each parameter follows:
11410 % o wand: the magick wand.
11412 % o reference: the reference wand.
11414 % o offset: the best match offset of the reference image within the image.
11416 % o similarity: the computed similarity between the images.
11419 WandExport MagickWand *MagickSimilarityImage(MagickWand *wand,
11420 const MagickWand *reference,RectangleInfo *offset,double *similarity)
11425 assert(wand != (MagickWand *) NULL);
11426 assert(wand->signature == WandSignature);
11427 if (wand->debug != MagickFalse)
11428 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11429 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
11431 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
11432 "ContainsNoImages","`%s'",wand->name);
11433 return((MagickWand *) NULL);
11435 similarity_image=SimilarityImage(wand->images,reference->images,offset,
11436 similarity,&wand->images->exception);
11437 if (similarity_image == (Image *) NULL)
11438 return((MagickWand *) NULL);
11439 return(CloneMagickWandFromImages(wand,similarity_image));
11443 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11447 % M a g i c k S k e t c h I m a g e %
11451 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11453 % MagickSketchImage() simulates a pencil sketch. We convolve the image with
11454 % a Gaussian operator of the given radius and standard deviation (sigma).
11455 % For reasonable results, radius should be larger than sigma. Use a
11456 % radius of 0 and SketchImage() selects a suitable radius for you.
11457 % Angle gives the angle of the blurring motion.
11459 % The format of the MagickSketchImage method is:
11461 % MagickBooleanType MagickSketchImage(MagickWand *wand,
11462 % const double radius,const double sigma,const double angle)
11464 % A description of each parameter follows:
11466 % o wand: the magick wand.
11468 % o radius: the radius of the Gaussian, in pixels, not counting
11469 % the center pixel.
11471 % o sigma: the standard deviation of the Gaussian, in pixels.
11473 % o angle: Apply the effect along this angle.
11476 WandExport MagickBooleanType MagickSketchImage(MagickWand *wand,
11477 const double radius,const double sigma,const double angle)
11482 assert(wand != (MagickWand *) NULL);
11483 assert(wand->signature == WandSignature);
11484 if (wand->debug != MagickFalse)
11485 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11486 if (wand->images == (Image *) NULL)
11487 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11488 sketch_image=SketchImage(wand->images,radius,sigma,angle,wand->exception);
11489 if (sketch_image == (Image *) NULL)
11490 return(MagickFalse);
11491 ReplaceImageInList(&wand->images,sketch_image);
11492 return(MagickTrue);
11496 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11500 % M a g i c k S o l a r i z e I m a g e %
11504 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11506 % MagickSolarizeImage() applies a special effect to the image, similar to the
11507 % effect achieved in a photo darkroom by selectively exposing areas of photo
11508 % sensitive paper to light. Threshold ranges from 0 to QuantumRange and is a
11509 % measure of the extent of the solarization.
11511 % The format of the MagickSolarizeImage method is:
11513 % MagickBooleanType MagickSolarizeImage(MagickWand *wand,
11514 % const double threshold)
11516 % A description of each parameter follows:
11518 % o wand: the magick wand.
11520 % o threshold: Define the extent of the solarization.
11523 WandExport MagickBooleanType MagickSolarizeImage(MagickWand *wand,
11524 const double threshold)
11529 assert(wand != (MagickWand *) NULL);
11530 assert(wand->signature == WandSignature);
11531 if (wand->debug != MagickFalse)
11532 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11533 if (wand->images == (Image *) NULL)
11534 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11535 status=SolarizeImage(wand->images,threshold);
11536 if (status == MagickFalse)
11537 InheritException(wand->exception,&wand->images->exception);
11542 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11546 % M a g i c k S p a r s e C o l o r I m a g e %
11550 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11552 % MagickSparseColorImage(), given a set of coordinates, interpolates the
11553 % colors found at those coordinates, across the whole image, using various
11556 % The format of the MagickSparseColorImage method is:
11558 % MagickBooleanType MagickSparseColorImage(MagickWand *wand,
11559 % const ChannelType channel,const SparseColorMethod method,
11560 % const size_t number_arguments,const double *arguments)
11562 % A description of each parameter follows:
11564 % o image: the image to be sparseed.
11566 % o method: the method of image sparseion.
11568 % ArcSparseColorion will always ignore source image offset, and always
11569 % 'bestfit' the destination image with the top left corner offset
11570 % relative to the polar mapping center.
11572 % Bilinear has no simple inverse mapping so will not allow 'bestfit'
11573 % style of image sparseion.
11575 % Affine, Perspective, and Bilinear, will do least squares fitting of
11576 % the distrotion when more than the minimum number of control point
11577 % pairs are provided.
11579 % Perspective, and Bilinear, will fall back to a Affine sparseion when
11580 % less than 4 control point pairs are provided. While Affine sparseions
11581 % will let you use any number of control point pairs, that is Zero pairs
11582 % is a No-Op (viewport only) distrotion, one pair is a translation and
11583 % two pairs of control points will do a scale-rotate-translate, without
11586 % o number_arguments: the number of arguments given for this sparseion
11589 % o arguments: the arguments for this sparseion method.
11592 WandExport MagickBooleanType MagickSparseColorImage(MagickWand *wand,
11593 const ChannelType channel,const SparseColorMethod method,
11594 const size_t number_arguments,const double *arguments)
11599 assert(wand != (MagickWand *) NULL);
11600 assert(wand->signature == WandSignature);
11601 if (wand->debug != MagickFalse)
11602 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11603 if (wand->images == (Image *) NULL)
11604 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11605 sparse_image=SparseColorImage(wand->images,channel,method,number_arguments,
11606 arguments,wand->exception);
11607 if (sparse_image == (Image *) NULL)
11608 return(MagickFalse);
11609 ReplaceImageInList(&wand->images,sparse_image);
11610 return(MagickTrue);
11614 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11618 % M a g i c k S p l i c e I m a g e %
11622 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11624 % MagickSpliceImage() splices a solid color into the image.
11626 % The format of the MagickSpliceImage method is:
11628 % MagickBooleanType MagickSpliceImage(MagickWand *wand,
11629 % const size_t width,const size_t height,const ssize_t x,
11632 % A description of each parameter follows:
11634 % o wand: the magick wand.
11636 % o width: the region width.
11638 % o height: the region height.
11640 % o x: the region x offset.
11642 % o y: the region y offset.
11645 WandExport MagickBooleanType MagickSpliceImage(MagickWand *wand,
11646 const size_t width,const size_t height,const ssize_t x,
11655 assert(wand != (MagickWand *) NULL);
11656 assert(wand->signature == WandSignature);
11657 if (wand->debug != MagickFalse)
11658 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11659 if (wand->images == (Image *) NULL)
11660 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11661 splice.width=width;
11662 splice.height=height;
11665 splice_image=SpliceImage(wand->images,&splice,wand->exception);
11666 if (splice_image == (Image *) NULL)
11667 return(MagickFalse);
11668 ReplaceImageInList(&wand->images,splice_image);
11669 return(MagickTrue);
11673 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11677 % M a g i c k S p r e a d I m a g e %
11681 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11683 % MagickSpreadImage() is a special effects method that randomly displaces each
11684 % pixel in a block defined by the radius parameter.
11686 % The format of the MagickSpreadImage method is:
11688 % MagickBooleanType MagickSpreadImage(MagickWand *wand,const double radius)
11690 % A description of each parameter follows:
11692 % o wand: the magick wand.
11694 % o radius: Choose a random pixel in a neighborhood of this extent.
11697 WandExport MagickBooleanType MagickSpreadImage(MagickWand *wand,
11698 const double radius)
11703 assert(wand != (MagickWand *) NULL);
11704 assert(wand->signature == WandSignature);
11705 if (wand->debug != MagickFalse)
11706 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11707 if (wand->images == (Image *) NULL)
11708 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11709 spread_image=SpreadImage(wand->images,radius,wand->exception);
11710 if (spread_image == (Image *) NULL)
11711 return(MagickFalse);
11712 ReplaceImageInList(&wand->images,spread_image);
11713 return(MagickTrue);
11717 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11721 % M a g i c k S t e g a n o I m a g e %
11725 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11727 % MagickSteganoImage() hides a digital watermark within the image.
11728 % Recover the hidden watermark later to prove that the authenticity of
11729 % an image. Offset defines the start position within the image to hide
11732 % The format of the MagickSteganoImage method is:
11734 % MagickWand *MagickSteganoImage(MagickWand *wand,
11735 % const MagickWand *watermark_wand,const ssize_t offset)
11737 % A description of each parameter follows:
11739 % o wand: the magick wand.
11741 % o watermark_wand: the watermark wand.
11743 % o offset: Start hiding at this offset into the image.
11746 WandExport MagickWand *MagickSteganoImage(MagickWand *wand,
11747 const MagickWand *watermark_wand,const ssize_t offset)
11752 assert(wand != (MagickWand *) NULL);
11753 assert(wand->signature == WandSignature);
11754 if (wand->debug != MagickFalse)
11755 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11756 if ((wand->images == (Image *) NULL) ||
11757 (watermark_wand->images == (Image *) NULL))
11759 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
11760 "ContainsNoImages","`%s'",wand->name);
11761 return((MagickWand *) NULL);
11763 wand->images->offset=offset;
11764 stegano_image=SteganoImage(wand->images,watermark_wand->images,
11766 if (stegano_image == (Image *) NULL)
11767 return((MagickWand *) NULL);
11768 return(CloneMagickWandFromImages(wand,stegano_image));
11772 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11776 % M a g i c k S t e r e o I m a g e %
11780 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11782 % MagickStereoImage() composites two images and produces a single image that
11783 % is the composite of a left and right image of a stereo pair
11785 % The format of the MagickStereoImage method is:
11787 % MagickWand *MagickStereoImage(MagickWand *wand,
11788 % const MagickWand *offset_wand)
11790 % A description of each parameter follows:
11792 % o wand: the magick wand.
11794 % o offset_wand: Another image wand.
11797 WandExport MagickWand *MagickStereoImage(MagickWand *wand,
11798 const MagickWand *offset_wand)
11803 assert(wand != (MagickWand *) NULL);
11804 assert(wand->signature == WandSignature);
11805 if (wand->debug != MagickFalse)
11806 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11807 if ((wand->images == (Image *) NULL) ||
11808 (offset_wand->images == (Image *) NULL))
11810 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
11811 "ContainsNoImages","`%s'",wand->name);
11812 return((MagickWand *) NULL);
11814 stereo_image=StereoImage(wand->images,offset_wand->images,wand->exception);
11815 if (stereo_image == (Image *) NULL)
11816 return((MagickWand *) NULL);
11817 return(CloneMagickWandFromImages(wand,stereo_image));
11821 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11825 % M a g i c k S t r i p I m a g e %
11829 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11831 % MagickStripImage() strips an image of all profiles and comments.
11833 % The format of the MagickStripImage method is:
11835 % MagickBooleanType MagickStripImage(MagickWand *wand)
11837 % A description of each parameter follows:
11839 % o wand: the magick wand.
11842 WandExport MagickBooleanType MagickStripImage(MagickWand *wand)
11847 assert(wand != (MagickWand *) NULL);
11848 assert(wand->signature == WandSignature);
11849 if (wand->debug != MagickFalse)
11850 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11851 if (wand->images == (Image *) NULL)
11852 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11853 status=StripImage(wand->images);
11854 if (status == MagickFalse)
11855 InheritException(wand->exception,&wand->images->exception);
11860 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11864 % M a g i c k S w i r l I m a g e %
11868 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11870 % MagickSwirlImage() swirls the pixels about the center of the image, where
11871 % degrees indicates the sweep of the arc through which each pixel is moved.
11872 % You get a more dramatic effect as the degrees move from 1 to 360.
11874 % The format of the MagickSwirlImage method is:
11876 % MagickBooleanType MagickSwirlImage(MagickWand *wand,const double degrees)
11878 % A description of each parameter follows:
11880 % o wand: the magick wand.
11882 % o degrees: Define the tightness of the swirling effect.
11885 WandExport MagickBooleanType MagickSwirlImage(MagickWand *wand,
11886 const double degrees)
11891 assert(wand != (MagickWand *) NULL);
11892 assert(wand->signature == WandSignature);
11893 if (wand->debug != MagickFalse)
11894 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11895 if (wand->images == (Image *) NULL)
11896 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11897 swirl_image=SwirlImage(wand->images,degrees,wand->exception);
11898 if (swirl_image == (Image *) NULL)
11899 return(MagickFalse);
11900 ReplaceImageInList(&wand->images,swirl_image);
11901 return(MagickTrue);
11905 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11909 % M a g i c k T e x t u r e I m a g e %
11913 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11915 % MagickTextureImage() repeatedly tiles the texture image across and down the
11918 % The format of the MagickTextureImage method is:
11920 % MagickWand *MagickTextureImage(MagickWand *wand,
11921 % const MagickWand *texture_wand)
11923 % A description of each parameter follows:
11925 % o wand: the magick wand.
11927 % o texture_wand: the texture wand
11930 WandExport MagickWand *MagickTextureImage(MagickWand *wand,
11931 const MagickWand *texture_wand)
11939 assert(wand != (MagickWand *) NULL);
11940 assert(wand->signature == WandSignature);
11941 if (wand->debug != MagickFalse)
11942 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11943 if ((wand->images == (Image *) NULL) ||
11944 (texture_wand->images == (Image *) NULL))
11946 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
11947 "ContainsNoImages","`%s'",wand->name);
11948 return((MagickWand *) NULL);
11950 texture_image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
11951 if (texture_image == (Image *) NULL)
11952 return((MagickWand *) NULL);
11953 status=TextureImage(texture_image,texture_wand->images);
11954 if (status == MagickFalse)
11956 InheritException(wand->exception,&texture_image->exception);
11957 texture_image=DestroyImage(texture_image);
11958 return((MagickWand *) NULL);
11960 return(CloneMagickWandFromImages(wand,texture_image));
11964 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11968 % M a g i c k T h r e s h o l d I m a g e %
11972 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11974 % MagickThresholdImage() changes the value of individual pixels based on
11975 % the intensity of each pixel compared to threshold. The result is a
11976 % high-contrast, two color image.
11978 % The format of the MagickThresholdImage method is:
11980 % MagickBooleanType MagickThresholdImage(MagickWand *wand,
11981 % const double threshold)
11982 % MagickBooleanType MagickThresholdImageChannel(MagickWand *wand,
11983 % const ChannelType channel,const double threshold)
11985 % A description of each parameter follows:
11987 % o wand: the magick wand.
11989 % o channel: the image channel(s).
11991 % o threshold: Define the threshold value.
11994 WandExport MagickBooleanType MagickThresholdImage(MagickWand *wand,
11995 const double threshold)
12000 status=MagickThresholdImageChannel(wand,DefaultChannels,threshold);
12004 WandExport MagickBooleanType MagickThresholdImageChannel(MagickWand *wand,
12005 const ChannelType channel,const double threshold)
12010 assert(wand != (MagickWand *) NULL);
12011 assert(wand->signature == WandSignature);
12012 if (wand->debug != MagickFalse)
12013 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12014 if (wand->images == (Image *) NULL)
12015 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12016 status=BilevelImageChannel(wand->images,channel,threshold);
12017 if (status == MagickFalse)
12018 InheritException(wand->exception,&wand->images->exception);
12023 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12027 % M a g i c k T h u m b n a i l I m a g e %
12031 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12033 % MagickThumbnailImage() changes the size of an image to the given dimensions
12034 % and removes any associated profiles. The goal is to produce small low cost
12035 % thumbnail images suited for display on the Web.
12037 % The format of the MagickThumbnailImage method is:
12039 % MagickBooleanType MagickThumbnailImage(MagickWand *wand,
12040 % const size_t columns,const size_t rows)
12042 % A description of each parameter follows:
12044 % o wand: the magick wand.
12046 % o columns: the number of columns in the scaled image.
12048 % o rows: the number of rows in the scaled image.
12051 WandExport MagickBooleanType MagickThumbnailImage(MagickWand *wand,
12052 const size_t columns,const size_t rows)
12057 assert(wand != (MagickWand *) NULL);
12058 assert(wand->signature == WandSignature);
12059 if (wand->debug != MagickFalse)
12060 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12061 if (wand->images == (Image *) NULL)
12062 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12063 thumbnail_image=ThumbnailImage(wand->images,columns,rows,wand->exception);
12064 if (thumbnail_image == (Image *) NULL)
12065 return(MagickFalse);
12066 ReplaceImageInList(&wand->images,thumbnail_image);
12067 return(MagickTrue);
12071 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12075 % M a g i c k T i n t I m a g e %
12079 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12081 % MagickTintImage() applies a color vector to each pixel in the image. The
12082 % length of the vector is 0 for black and white and at its maximum for the
12083 % midtones. The vector weighting function is
12084 % f(x)=(1-(4.0*((x-0.5)*(x-0.5)))).
12086 % The format of the MagickTintImage method is:
12088 % MagickBooleanType MagickTintImage(MagickWand *wand,
12089 % const PixelWand *tint,const PixelWand *opacity)
12091 % A description of each parameter follows:
12093 % o wand: the magick wand.
12095 % o tint: the tint pixel wand.
12097 % o opacity: the opacity pixel wand.
12100 WandExport MagickBooleanType MagickTintImage(MagickWand *wand,
12101 const PixelWand *tint,const PixelWand *opacity)
12104 percent_opaque[MaxTextExtent];
12112 assert(wand != (MagickWand *) NULL);
12113 assert(wand->signature == WandSignature);
12114 if (wand->debug != MagickFalse)
12115 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12116 if (wand->images == (Image *) NULL)
12117 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12118 (void) FormatMagickString(percent_opaque,MaxTextExtent,
12119 "%g,%g,%g,%g",(double) (100.0*QuantumScale*
12120 PixelGetRedQuantum(opacity)),(double) (100.0*QuantumScale*
12121 PixelGetGreenQuantum(opacity)),(double) (100.0*QuantumScale*
12122 PixelGetBlueQuantum(opacity)),(double) (100.0*QuantumScale*
12123 PixelGetOpacityQuantum(opacity)));
12124 PixelGetQuantumColor(tint,&target);
12125 tint_image=TintImage(wand->images,percent_opaque,target,wand->exception);
12126 if (tint_image == (Image *) NULL)
12127 return(MagickFalse);
12128 ReplaceImageInList(&wand->images,tint_image);
12129 return(MagickTrue);
12133 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12137 % M a g i c k T r a n s f o r m I m a g e %
12141 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12143 % MagickTransformImage() is a convenience method that behaves like
12144 % MagickResizeImage() or MagickCropImage() but accepts scaling and/or cropping
12145 % information as a region geometry specification. If the operation fails,
12146 % a NULL image handle is returned.
12148 % The format of the MagickTransformImage method is:
12150 % MagickWand *MagickTransformImage(MagickWand *wand,const char *crop,
12151 % const char *geometry)
12153 % A description of each parameter follows:
12155 % o wand: the magick wand.
12157 % o crop: A crop geometry string. This geometry defines a subregion of the
12160 % o geometry: An image geometry string. This geometry defines the final
12161 % size of the image.
12164 WandExport MagickWand *MagickTransformImage(MagickWand *wand,
12165 const char *crop,const char *geometry)
12173 assert(wand != (MagickWand *) NULL);
12174 assert(wand->signature == WandSignature);
12175 if (wand->debug != MagickFalse)
12176 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12177 if (wand->images == (Image *) NULL)
12178 return((MagickWand *) NULL);
12179 transform_image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
12180 if (transform_image == (Image *) NULL)
12181 return((MagickWand *) NULL);
12182 status=TransformImage(&transform_image,crop,geometry);
12183 if (status == MagickFalse)
12185 InheritException(wand->exception,&transform_image->exception);
12186 transform_image=DestroyImage(transform_image);
12187 return((MagickWand *) NULL);
12189 return(CloneMagickWandFromImages(wand,transform_image));
12193 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12197 % 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 %
12201 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12203 % MagickTransformImageColorspace() transform the image colorspace.
12205 % The format of the MagickTransformImageColorspace method is:
12207 % MagickBooleanType MagickTransformImageColorspace(MagickWand *wand,
12208 % const ColorspaceType colorspace)
12210 % A description of each parameter follows:
12212 % o wand: the magick wand.
12214 % o colorspace: the image colorspace: UndefinedColorspace, RGBColorspace,
12215 % GRAYColorspace, TransparentColorspace, OHTAColorspace, XYZColorspace,
12216 % YCbCrColorspace, YCCColorspace, YIQColorspace, YPbPrColorspace,
12217 % YPbPrColorspace, YUVColorspace, CMYKColorspace, sRGBColorspace,
12218 % HSLColorspace, or HWBColorspace.
12221 WandExport MagickBooleanType MagickTransformImageColorspace(MagickWand *wand,
12222 const ColorspaceType colorspace)
12224 assert(wand != (MagickWand *) NULL);
12225 assert(wand->signature == WandSignature);
12226 if (wand->debug != MagickFalse)
12227 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12228 if (wand->images == (Image *) NULL)
12229 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12230 return(TransformImageColorspace(wand->images,colorspace));
12234 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12238 % 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 %
12242 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12244 % MagickTransparentPaintImage() changes any pixel that matches color with the
12245 % color defined by fill.
12247 % The format of the MagickTransparentPaintImage method is:
12249 % MagickBooleanType MagickTransparentPaintImage(MagickWand *wand,
12250 % const PixelWand *target,const double alpha,const double fuzz,
12251 % const MagickBooleanType invert)
12253 % A description of each parameter follows:
12255 % o wand: the magick wand.
12257 % o target: Change this target color to specified opacity value within
12260 % o alpha: the level of transparency: 1.0 is fully opaque and 0.0 is fully
12263 % o fuzz: By default target must match a particular pixel color
12264 % exactly. However, in many cases two colors may differ by a small amount.
12265 % The fuzz member of image defines how much tolerance is acceptable to
12266 % consider two colors as the same. For example, set fuzz to 10 and the
12267 % color red at intensities of 100 and 102 respectively are now interpreted
12268 % as the same color for the purposes of the floodfill.
12270 % o invert: paint any pixel that does not match the target color.
12273 WandExport MagickBooleanType MagickTransparentPaintImage(MagickWand *wand,
12274 const PixelWand *target,const double alpha,const double fuzz,
12275 const MagickBooleanType invert)
12283 assert(wand != (MagickWand *) NULL);
12284 assert(wand->signature == WandSignature);
12285 if (wand->debug != MagickFalse)
12286 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12287 if (wand->images == (Image *) NULL)
12288 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12289 PixelGetMagickColor(target,&target_pixel);
12290 wand->images->fuzz=fuzz;
12291 status=TransparentPaintImage(wand->images,&target_pixel,ClampToQuantum(
12292 (MagickRealType) QuantumRange-QuantumRange*alpha),invert);
12293 if (status == MagickFalse)
12294 InheritException(wand->exception,&wand->images->exception);
12299 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12303 % M a g i c k T r a n s p o s e I m a g e %
12307 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12309 % MagickTransposeImage() creates a vertical mirror image by reflecting the
12310 % pixels around the central x-axis while rotating them 90-degrees.
12312 % The format of the MagickTransposeImage method is:
12314 % MagickBooleanType MagickTransposeImage(MagickWand *wand)
12316 % A description of each parameter follows:
12318 % o wand: the magick wand.
12321 WandExport MagickBooleanType MagickTransposeImage(MagickWand *wand)
12326 assert(wand != (MagickWand *) NULL);
12327 assert(wand->signature == WandSignature);
12328 if (wand->debug != MagickFalse)
12329 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12330 if (wand->images == (Image *) NULL)
12331 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12332 transpose_image=TransposeImage(wand->images,wand->exception);
12333 if (transpose_image == (Image *) NULL)
12334 return(MagickFalse);
12335 ReplaceImageInList(&wand->images,transpose_image);
12336 return(MagickTrue);
12340 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12344 % M a g i c k T r a n s v e r s e I m a g e %
12348 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12350 % MagickTransverseImage() creates a horizontal mirror image by reflecting the
12351 % pixels around the central y-axis while rotating them 270-degrees.
12353 % The format of the MagickTransverseImage method is:
12355 % MagickBooleanType MagickTransverseImage(MagickWand *wand)
12357 % A description of each parameter follows:
12359 % o wand: the magick wand.
12362 WandExport MagickBooleanType MagickTransverseImage(MagickWand *wand)
12367 assert(wand != (MagickWand *) NULL);
12368 assert(wand->signature == WandSignature);
12369 if (wand->debug != MagickFalse)
12370 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12371 if (wand->images == (Image *) NULL)
12372 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12373 transverse_image=TransverseImage(wand->images,wand->exception);
12374 if (transverse_image == (Image *) NULL)
12375 return(MagickFalse);
12376 ReplaceImageInList(&wand->images,transverse_image);
12377 return(MagickTrue);
12381 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12385 % M a g i c k T r i m I m a g e %
12389 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12391 % MagickTrimImage() remove edges that are the background color from the image.
12393 % The format of the MagickTrimImage method is:
12395 % MagickBooleanType MagickTrimImage(MagickWand *wand,const double fuzz)
12397 % A description of each parameter follows:
12399 % o wand: the magick wand.
12401 % o fuzz: By default target must match a particular pixel color
12402 % exactly. However, in many cases two colors may differ by a small amount.
12403 % The fuzz member of image defines how much tolerance is acceptable to
12404 % consider two colors as the same. For example, set fuzz to 10 and the
12405 % color red at intensities of 100 and 102 respectively are now interpreted
12406 % as the same color for the purposes of the floodfill.
12409 WandExport MagickBooleanType MagickTrimImage(MagickWand *wand,const double fuzz)
12414 assert(wand != (MagickWand *) NULL);
12415 assert(wand->signature == WandSignature);
12416 if (wand->debug != MagickFalse)
12417 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12418 if (wand->images == (Image *) NULL)
12419 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12420 wand->images->fuzz=fuzz;
12421 trim_image=TrimImage(wand->images,wand->exception);
12422 if (trim_image == (Image *) NULL)
12423 return(MagickFalse);
12424 ReplaceImageInList(&wand->images,trim_image);
12425 return(MagickTrue);
12429 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12433 % M a g i c k U n i q u e I m a g e C o l o r s %
12437 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12439 % MagickUniqueImageColors() discards all but one of any pixel color.
12441 % The format of the MagickUniqueImageColors method is:
12443 % MagickBooleanType MagickUniqueImageColors(MagickWand *wand)
12445 % A description of each parameter follows:
12447 % o wand: the magick wand.
12450 WandExport MagickBooleanType MagickUniqueImageColors(MagickWand *wand)
12455 assert(wand != (MagickWand *) NULL);
12456 assert(wand->signature == WandSignature);
12457 if (wand->debug != MagickFalse)
12458 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12459 if (wand->images == (Image *) NULL)
12460 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12461 unique_image=UniqueImageColors(wand->images,wand->exception);
12462 if (unique_image == (Image *) NULL)
12463 return(MagickFalse);
12464 ReplaceImageInList(&wand->images,unique_image);
12465 return(MagickTrue);
12469 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12473 % M a g i c k U n s h a r p M a s k I m a g e %
12477 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12479 % MagickUnsharpMaskImage() sharpens an image. We convolve the image with a
12480 % Gaussian operator of the given radius and standard deviation (sigma).
12481 % For reasonable results, radius should be larger than sigma. Use a radius
12482 % of 0 and UnsharpMaskImage() selects a suitable radius for you.
12484 % The format of the MagickUnsharpMaskImage method is:
12486 % MagickBooleanType MagickUnsharpMaskImage(MagickWand *wand,
12487 % const double radius,const double sigma,const double amount,
12488 % const double threshold)
12489 % MagickBooleanType MagickUnsharpMaskImageChannel(MagickWand *wand,
12490 % const ChannelType channel,const double radius,const double sigma,
12491 % const double amount,const double threshold)
12493 % A description of each parameter follows:
12495 % o wand: the magick wand.
12497 % o channel: the image channel(s).
12499 % o radius: the radius of the Gaussian, in pixels, not counting the center
12502 % o sigma: the standard deviation of the Gaussian, in pixels.
12504 % o amount: the percentage of the difference between the original and the
12505 % blur image that is added back into the original.
12507 % o threshold: the threshold in pixels needed to apply the diffence amount.
12511 WandExport MagickBooleanType MagickUnsharpMaskImage(MagickWand *wand,
12512 const double radius,const double sigma,const double amount,
12513 const double threshold)
12518 status=MagickUnsharpMaskImageChannel(wand,DefaultChannels,radius,sigma,
12523 WandExport MagickBooleanType MagickUnsharpMaskImageChannel(MagickWand *wand,
12524 const ChannelType channel,const double radius,const double sigma,
12525 const double amount,const double threshold)
12530 assert(wand != (MagickWand *) NULL);
12531 assert(wand->signature == WandSignature);
12532 if (wand->debug != MagickFalse)
12533 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12534 if (wand->images == (Image *) NULL)
12535 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12536 unsharp_image=UnsharpMaskImageChannel(wand->images,channel,radius,sigma,
12537 amount,threshold,wand->exception);
12538 if (unsharp_image == (Image *) NULL)
12539 return(MagickFalse);
12540 ReplaceImageInList(&wand->images,unsharp_image);
12541 return(MagickTrue);
12545 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12549 % M a g i c k V i g n e t t e I m a g e %
12553 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12555 % MagickVignetteImage() softens the edges of the image in vignette style.
12557 % The format of the MagickVignetteImage method is:
12559 % MagickBooleanType MagickVignetteImage(MagickWand *wand,
12560 % const double black_point,const double white_point,const ssize_t x,
12563 % A description of each parameter follows:
12565 % o wand: the magick wand.
12567 % o black_point: the black point.
12569 % o white_point: the white point.
12571 % o x, y: Define the x and y ellipse offset.
12574 WandExport MagickBooleanType MagickVignetteImage(MagickWand *wand,
12575 const double black_point,const double white_point,const ssize_t x,const ssize_t y)
12580 assert(wand != (MagickWand *) NULL);
12581 assert(wand->signature == WandSignature);
12582 if (wand->debug != MagickFalse)
12583 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12584 if (wand->images == (Image *) NULL)
12585 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12586 vignette_image=VignetteImage(wand->images,black_point,white_point,x,y,
12588 if (vignette_image == (Image *) NULL)
12589 return(MagickFalse);
12590 ReplaceImageInList(&wand->images,vignette_image);
12591 return(MagickTrue);
12595 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12599 % M a g i c k W a v e I m a g e %
12603 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12605 % MagickWaveImage() creates a "ripple" effect in the image by shifting
12606 % the pixels vertically along a sine wave whose amplitude and wavelength
12607 % is specified by the given parameters.
12609 % The format of the MagickWaveImage method is:
12611 % MagickBooleanType MagickWaveImage(MagickWand *wand,const double amplitude,
12612 % const double wave_length)
12614 % A description of each parameter follows:
12616 % o wand: the magick wand.
12618 % o amplitude, wave_length: Define the amplitude and wave length of the
12622 WandExport MagickBooleanType MagickWaveImage(MagickWand *wand,
12623 const double amplitude,const double wave_length)
12628 assert(wand != (MagickWand *) NULL);
12629 assert(wand->signature == WandSignature);
12630 if (wand->debug != MagickFalse)
12631 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12632 if (wand->images == (Image *) NULL)
12633 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12634 wave_image=WaveImage(wand->images,amplitude,wave_length,wand->exception);
12635 if (wave_image == (Image *) NULL)
12636 return(MagickFalse);
12637 ReplaceImageInList(&wand->images,wave_image);
12638 return(MagickTrue);
12642 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12646 % 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 %
12650 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12652 % MagickWhiteThresholdImage() is like ThresholdImage() but force all pixels
12653 % above the threshold into white while leaving all pixels below the threshold
12656 % The format of the MagickWhiteThresholdImage method is:
12658 % MagickBooleanType MagickWhiteThresholdImage(MagickWand *wand,
12659 % const PixelWand *threshold)
12661 % A description of each parameter follows:
12663 % o wand: the magick wand.
12665 % o threshold: the pixel wand.
12668 WandExport MagickBooleanType MagickWhiteThresholdImage(MagickWand *wand,
12669 const PixelWand *threshold)
12672 thresholds[MaxTextExtent];
12677 assert(wand != (MagickWand *) NULL);
12678 assert(wand->signature == WandSignature);
12679 if (wand->debug != MagickFalse)
12680 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12681 if (wand->images == (Image *) NULL)
12682 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12683 (void) FormatMagickString(thresholds,MaxTextExtent,
12684 QuantumFormat "," QuantumFormat "," QuantumFormat "," QuantumFormat,
12685 PixelGetRedQuantum(threshold),PixelGetGreenQuantum(threshold),
12686 PixelGetBlueQuantum(threshold),PixelGetOpacityQuantum(threshold));
12687 status=WhiteThresholdImage(wand->images,thresholds);
12688 if (status == MagickFalse)
12689 InheritException(wand->exception,&wand->images->exception);
12694 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12698 % M a g i c k W r i t e I m a g e %
12702 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12704 % MagickWriteImage() writes an image to the specified filename. If the
12705 % filename parameter is NULL, the image is written to the filename set
12706 % by MagickReadImage() or MagickSetImageFilename().
12708 % The format of the MagickWriteImage method is:
12710 % MagickBooleanType MagickWriteImage(MagickWand *wand,
12711 % const char *filename)
12713 % A description of each parameter follows:
12715 % o wand: the magick wand.
12717 % o filename: the image filename.
12721 WandExport MagickBooleanType MagickWriteImage(MagickWand *wand,
12722 const char *filename)
12733 assert(wand != (MagickWand *) NULL);
12734 assert(wand->signature == WandSignature);
12735 if (wand->debug != MagickFalse)
12736 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12737 if (wand->images == (Image *) NULL)
12738 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12739 if (filename != (const char *) NULL)
12740 (void) CopyMagickString(wand->images->filename,filename,MaxTextExtent);
12741 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
12742 if (image == (Image *) NULL)
12743 return(MagickFalse);
12744 write_info=CloneImageInfo(wand->image_info);
12745 write_info->adjoin=MagickTrue;
12746 status=WriteImage(write_info,image);
12747 if (status == MagickFalse)
12748 InheritException(wand->exception,&image->exception);
12749 image=DestroyImage(image);
12750 write_info=DestroyImageInfo(write_info);
12755 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12759 % M a g i c k W r i t e I m a g e F i l e %
12763 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12765 % MagickWriteImageFile() writes an image to an open file descriptor.
12767 % The format of the MagickWriteImageFile method is:
12769 % MagickBooleanType MagickWriteImageFile(MagickWand *wand,FILE *file)
12771 % A description of each parameter follows:
12773 % o wand: the magick wand.
12775 % o file: the file descriptor.
12778 WandExport MagickBooleanType MagickWriteImageFile(MagickWand *wand,FILE *file)
12789 assert(wand != (MagickWand *) NULL);
12790 assert(wand->signature == WandSignature);
12791 assert(file != (FILE *) NULL);
12792 if (wand->debug != MagickFalse)
12793 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12794 if (wand->images == (Image *) NULL)
12795 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12796 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
12797 if (image == (Image *) NULL)
12798 return(MagickFalse);
12799 write_info=CloneImageInfo(wand->image_info);
12800 SetImageInfoFile(write_info,file);
12801 write_info->adjoin=MagickTrue;
12802 status=WriteImage(write_info,image);
12803 write_info=DestroyImageInfo(write_info);
12804 if (status == MagickFalse)
12805 InheritException(wand->exception,&image->exception);
12806 image=DestroyImage(image);
12811 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12815 % M a g i c k W r i t e I m a g e s %
12819 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12821 % MagickWriteImages() writes an image or image sequence.
12823 % The format of the MagickWriteImages method is:
12825 % MagickBooleanType MagickWriteImages(MagickWand *wand,
12826 % const char *filename,const MagickBooleanType adjoin)
12828 % A description of each parameter follows:
12830 % o wand: the magick wand.
12832 % o filename: the image filename.
12834 % o adjoin: join images into a single multi-image file.
12837 WandExport MagickBooleanType MagickWriteImages(MagickWand *wand,
12838 const char *filename,const MagickBooleanType adjoin)
12846 assert(wand != (MagickWand *) NULL);
12847 assert(wand->signature == WandSignature);
12848 if (wand->debug != MagickFalse)
12849 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12850 if (wand->images == (Image *) NULL)
12851 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12852 write_info=CloneImageInfo(wand->image_info);
12853 write_info->adjoin=adjoin;
12854 status=WriteImages(write_info,wand->images,filename,wand->exception);
12855 if (status == MagickFalse)
12856 InheritException(wand->exception,&wand->images->exception);
12857 write_info=DestroyImageInfo(write_info);
12862 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12866 % M a g i c k W r i t e I m a g e s F i l e %
12870 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12872 % MagickWriteImagesFile() writes an image sequence to an open file descriptor.
12874 % The format of the MagickWriteImagesFile method is:
12876 % MagickBooleanType MagickWriteImagesFile(MagickWand *wand,FILE *file)
12878 % A description of each parameter follows:
12880 % o wand: the magick wand.
12882 % o file: the file descriptor.
12885 WandExport MagickBooleanType MagickWriteImagesFile(MagickWand *wand,FILE *file)
12893 assert(wand != (MagickWand *) NULL);
12894 assert(wand->signature == WandSignature);
12895 if (wand->debug != MagickFalse)
12896 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12897 if (wand->images == (Image *) NULL)
12898 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12899 write_info=CloneImageInfo(wand->image_info);
12900 SetImageInfoFile(write_info,file);
12901 write_info->adjoin=MagickTrue;
12902 status=WriteImages(write_info,wand->images,(const char *) NULL,
12904 write_info=DestroyImageInfo(write_info);
12905 if (status == MagickFalse)
12906 InheritException(wand->exception,&wand->images->exception);