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-2009 ImageMagick Studio LLC, a non-profit organization %
27 % dedicated to making software imaging solutions freely available. %
29 % You may not use this file except in compliance with the License. You may %
30 % obtain a copy of the License at %
32 % http://www.imagemagick.org/script/license.php %
34 % Unless required by applicable law or agreed to in writing, software %
35 % distributed under the License is distributed on an "AS IS" BASIS, %
36 % WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. %
37 % See the License for the specific language governing permissions and %
38 % limitations under the License. %
40 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
49 #include "wand/studio.h"
50 #include "wand/MagickWand.h"
51 #include "wand/magick-wand-private.h"
52 #include "wand/wand.h"
53 #include "wand/pixel-wand-private.h"
58 #define ThrowWandException(severity,tag,context) \
60 (void) ThrowMagickException(wand->exception,GetMagickModule(),severity, \
61 tag,"`%s'",context); \
62 return(MagickFalse); \
64 #define MagickWandId "MagickWand"
67 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
71 + C l o n e M a g i c k W a n d F r o m I m a g e s %
75 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
77 % CloneMagickWandFromImages() clones the magick wand and inserts a new image
80 % The format of the CloneMagickWandFromImages method is:
82 % MagickWand *CloneMagickWandFromImages(const MagickWand *wand,
85 % A description of each parameter follows:
87 % o wand: the magick wand.
89 % o images: replace the image list with these image(s).
92 static MagickWand *CloneMagickWandFromImages(const MagickWand *wand,
98 assert(wand != (MagickWand *) NULL);
99 assert(wand->signature == WandSignature);
100 if (wand->debug != MagickFalse)
101 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
102 clone_wand=(MagickWand *) AcquireMagickMemory(sizeof(*clone_wand));
103 if (clone_wand == (MagickWand *) NULL)
104 ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed",
106 (void) ResetMagickMemory(clone_wand,0,sizeof(*clone_wand));
107 clone_wand->id=AcquireWandId();
108 (void) FormatMagickString(clone_wand->name,MaxTextExtent,"%s-%lu",
109 MagickWandId,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 unsigned long columns,const unsigned long 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 unsigned long columns,const unsigned long 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 unsigned long width,const unsigned long height,const long 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 unsigned long width,const unsigned long height,const long 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 A v e r a g e I m a g e s %
858 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
860 % MagickAverageImages() average a set of images.
862 % The format of the MagickAverageImages method is:
864 % MagickWand *MagickAverageImages(MagickWand *wand)
866 % A description of each parameter follows:
868 % o wand: the magick wand.
871 WandExport MagickWand *MagickAverageImages(MagickWand *wand)
876 assert(wand != (MagickWand *) NULL);
877 assert(wand->signature == WandSignature);
878 if (wand->debug != MagickFalse)
879 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
880 if (wand->images == (Image *) NULL)
881 return((MagickWand *) NULL);
882 average_image=AverageImages(wand->images,wand->exception);
883 if (average_image == (Image *) NULL)
884 return((MagickWand *) NULL);
885 return(CloneMagickWandFromImages(wand,average_image));
889 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
893 % 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 %
897 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
899 % MagickBlackThresholdImage() is like MagickThresholdImage() but forces all
900 % pixels below the threshold into black while leaving all pixels above the
901 % threshold unchanged.
903 % The format of the MagickBlackThresholdImage method is:
905 % MagickBooleanType MagickBlackThresholdImage(MagickWand *wand,
906 % const PixelWand *threshold)
908 % A description of each parameter follows:
910 % o wand: the magick wand.
912 % o threshold: the pixel wand.
915 WandExport MagickBooleanType MagickBlackThresholdImage(MagickWand *wand,
916 const PixelWand *threshold)
919 thresholds[MaxTextExtent];
924 assert(wand != (MagickWand *) NULL);
925 assert(wand->signature == WandSignature);
926 if (wand->debug != MagickFalse)
927 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
928 if (wand->images == (Image *) NULL)
929 ThrowWandException(WandError,"ContainsNoImages",wand->name);
930 (void) FormatMagickString(thresholds,MaxTextExtent,
931 QuantumFormat "," QuantumFormat "," QuantumFormat "," QuantumFormat,
932 PixelGetRedQuantum(threshold),PixelGetGreenQuantum(threshold),
933 PixelGetBlueQuantum(threshold),PixelGetOpacityQuantum(threshold));
934 status=BlackThresholdImage(wand->images,thresholds);
935 if (status == MagickFalse)
936 InheritException(wand->exception,&wand->images->exception);
941 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
945 % M a g i c k B l u e S h i f t I m a g e %
949 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
951 % MagickBlueShiftImage() mutes the colors of the image to simulate a scene at
952 % nighttime in the moonlight.
954 % The format of the MagickBlueShiftImage method is:
956 % MagickBooleanType MagickBlueShiftImage(MagickWand *wand,
957 % const double factor)
959 % A description of each parameter follows:
961 % o wand: the magick wand.
963 % o factor: the blue shift factor (default 1.5)
966 WandExport MagickBooleanType MagickBlueShiftImage(MagickWand *wand,
972 assert(wand != (MagickWand *) NULL);
973 assert(wand->signature == WandSignature);
974 if (wand->debug != MagickFalse)
975 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
976 if (wand->images == (Image *) NULL)
977 ThrowWandException(WandError,"ContainsNoImages",wand->name);
978 shift_image=BlueShiftImage(wand->images,factor,wand->exception);
979 if (shift_image == (Image *) NULL)
981 ReplaceImageInList(&wand->images,shift_image);
986 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
990 % M a g i c k B l u r I m a g e %
994 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
996 % MagickBlurImage() blurs an image. We convolve the image with a
997 % gaussian operator of the given radius and standard deviation (sigma).
998 % For reasonable results, the radius should be larger than sigma. Use a
999 % radius of 0 and BlurImage() selects a suitable radius for you.
1001 % The format of the MagickBlurImage method is:
1003 % MagickBooleanType MagickBlurImage(MagickWand *wand,const double radius,
1004 % const double sigma)
1005 % MagickBooleanType MagickBlurImageChannel(MagickWand *wand,
1006 % const ChannelType channel,const double radius,const double sigma)
1008 % A description of each parameter follows:
1010 % o wand: the magick wand.
1012 % o channel: the image channel(s).
1014 % o radius: the radius of the , in pixels, not counting the center
1017 % o sigma: the standard deviation of the , in pixels.
1021 WandExport MagickBooleanType MagickBlurImage(MagickWand *wand,
1022 const double radius,const double sigma)
1027 status=MagickBlurImageChannel(wand,DefaultChannels,radius,sigma);
1031 WandExport MagickBooleanType MagickBlurImageChannel(MagickWand *wand,
1032 const ChannelType channel,const double radius,const double sigma)
1037 assert(wand != (MagickWand *) NULL);
1038 assert(wand->signature == WandSignature);
1039 if (wand->debug != MagickFalse)
1040 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1041 if (wand->images == (Image *) NULL)
1042 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1043 blur_image=BlurImageChannel(wand->images,channel,radius,sigma,
1045 if (blur_image == (Image *) NULL)
1046 return(MagickFalse);
1047 ReplaceImageInList(&wand->images,blur_image);
1052 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1056 % M a g i c k B o r d e r I m a g e %
1060 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1062 % MagickBorderImage() surrounds the image with a border of the color defined
1063 % by the bordercolor pixel wand.
1065 % The format of the MagickBorderImage method is:
1067 % MagickBooleanType MagickBorderImage(MagickWand *wand,
1068 % const PixelWand *bordercolor,const unsigned long width,
1069 % const unsigned long height)
1071 % A description of each parameter follows:
1073 % o wand: the magick wand.
1075 % o bordercolor: the border color pixel wand.
1077 % o width: the border width.
1079 % o height: the border height.
1082 WandExport MagickBooleanType MagickBorderImage(MagickWand *wand,
1083 const PixelWand *bordercolor,const unsigned long width,
1084 const unsigned long height)
1092 assert(wand != (MagickWand *) NULL);
1093 assert(wand->signature == WandSignature);
1094 if (wand->debug != MagickFalse)
1095 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1096 if (wand->images == (Image *) NULL)
1097 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1098 border_info.width=width;
1099 border_info.height=height;
1102 PixelGetQuantumColor(bordercolor,&wand->images->border_color);
1103 border_image=BorderImage(wand->images,&border_info,wand->exception);
1104 if (border_image == (Image *) NULL)
1105 return(MagickFalse);
1106 ReplaceImageInList(&wand->images,border_image);
1111 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1115 % M a g i c k C h a r c o a l I m a g e %
1119 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1121 % MagickCharcoalImage() simulates a charcoal drawing.
1123 % The format of the MagickCharcoalImage method is:
1125 % MagickBooleanType MagickCharcoalImage(MagickWand *wand,
1126 % const double radius,const double sigma)
1128 % A description of each parameter follows:
1130 % o wand: the magick wand.
1132 % o radius: the radius of the Gaussian, in pixels, not counting the center
1135 % o sigma: the standard deviation of the Gaussian, in pixels.
1138 WandExport MagickBooleanType MagickCharcoalImage(MagickWand *wand,
1139 const double radius,const double sigma)
1144 assert(wand != (MagickWand *) NULL);
1145 assert(wand->signature == WandSignature);
1146 if (wand->debug != MagickFalse)
1147 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1148 if (wand->images == (Image *) NULL)
1149 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1150 charcoal_image=CharcoalImage(wand->images,radius,sigma,wand->exception);
1151 if (charcoal_image == (Image *) NULL)
1152 return(MagickFalse);
1153 ReplaceImageInList(&wand->images,charcoal_image);
1158 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1162 % M a g i c k C h o p I m a g e %
1166 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1168 % MagickChopImage() removes a region of an image and collapses the image to
1169 % occupy the removed portion
1171 % The format of the MagickChopImage method is:
1173 % MagickBooleanType MagickChopImage(MagickWand *wand,
1174 % const unsigned long width,const unsigned long height,const long x,
1177 % A description of each parameter follows:
1179 % o wand: the magick wand.
1181 % o width: the region width.
1183 % o height: the region height.
1185 % o x: the region x offset.
1187 % o y: the region y offset.
1191 WandExport MagickBooleanType MagickChopImage(MagickWand *wand,
1192 const unsigned long width,const unsigned long height,const long x,
1201 assert(wand != (MagickWand *) NULL);
1202 assert(wand->signature == WandSignature);
1203 if (wand->debug != MagickFalse)
1204 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1205 if (wand->images == (Image *) NULL)
1206 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1211 chop_image=ChopImage(wand->images,&chop,wand->exception);
1212 if (chop_image == (Image *) NULL)
1213 return(MagickFalse);
1214 ReplaceImageInList(&wand->images,chop_image);
1219 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1223 % M a g i c k C l a m p I m a g e %
1227 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1229 % MagickClampImage() restricts the color range from 0 to the quantum depth.
1231 % The format of the MagickClampImage method is:
1233 % MagickBooleanType MagickClampImage(MagickWand *wand)
1234 % MagickBooleanType MagickClampImageChannel(MagickWand *wand,
1235 % const ChannelType channel)
1237 % A description of each parameter follows:
1239 % o wand: the magick wand.
1241 % o channel: the channel.
1245 WandExport MagickBooleanType MagickClampImage(MagickWand *wand)
1250 status=MagickClampImageChannel(wand,DefaultChannels);
1254 WandExport MagickBooleanType MagickClampImageChannel(MagickWand *wand,
1255 const ChannelType channel)
1260 assert(wand != (MagickWand *) NULL);
1261 assert(wand->signature == WandSignature);
1262 if (wand->debug != MagickFalse)
1263 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1264 if (wand->images == (Image *) NULL)
1265 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1266 status=ClampImageChannel(wand->images,channel);
1267 if (status == MagickFalse)
1268 InheritException(wand->exception,&wand->images->exception);
1273 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1277 % M a g i c k C l i p I m a g e %
1281 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1283 % MagickClipImage() clips along the first path from the 8BIM profile, if
1286 % The format of the MagickClipImage method is:
1288 % MagickBooleanType MagickClipImage(MagickWand *wand)
1290 % A description of each parameter follows:
1292 % o wand: the magick wand.
1295 WandExport MagickBooleanType MagickClipImage(MagickWand *wand)
1300 assert(wand != (MagickWand *) NULL);
1301 assert(wand->signature == WandSignature);
1302 if (wand->debug != MagickFalse)
1303 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1304 if (wand->images == (Image *) NULL)
1305 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1306 status=ClipImage(wand->images);
1307 if (status == MagickFalse)
1308 InheritException(wand->exception,&wand->images->exception);
1313 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1317 % M a g i c k C l i p I m a g e P a t h %
1321 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1323 % MagickClipImagePath() clips along the named paths from the 8BIM profile, if
1324 % present. Later operations take effect inside the path. Id may be a number
1325 % if preceded with #, to work on a numbered path, e.g., "#1" to use the first
1328 % The format of the MagickClipImagePath method is:
1330 % MagickBooleanType MagickClipImagePath(MagickWand *wand,
1331 % const char *pathname,const MagickBooleanType inside)
1333 % A description of each parameter follows:
1335 % o wand: the magick wand.
1337 % o pathname: name of clipping path resource. If name is preceded by #, use
1338 % clipping path numbered by name.
1340 % o inside: if non-zero, later operations take effect inside clipping path.
1341 % Otherwise later operations take effect outside clipping path.
1344 WandExport MagickBooleanType MagickClipImagePath(MagickWand *wand,
1345 const char *pathname,const MagickBooleanType inside)
1350 assert(wand != (MagickWand *) NULL);
1351 assert(wand->signature == WandSignature);
1352 if (wand->debug != MagickFalse)
1353 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1354 if (wand->images == (Image *) NULL)
1355 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1356 status=ClipImagePath(wand->images,pathname,inside);
1357 if (status == MagickFalse)
1358 InheritException(wand->exception,&wand->images->exception);
1363 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1367 % M a g i c k C l u t I m a g e %
1371 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1373 % MagickClutImage() replaces colors in the image from a color lookup table.
1375 % The format of the MagickClutImage method is:
1377 % MagickBooleanType MagickClutImage(MagickWand *wand,
1378 % const MagickWand *clut_wand)
1379 % MagickBooleanType MagickClutImageChannel(MagickWand *wand,
1380 % const ChannelType channel,const MagickWand *clut_wand)
1382 % A description of each parameter follows:
1384 % o wand: the magick wand.
1386 % o clut_image: the clut image.
1390 WandExport MagickBooleanType MagickClutImage(MagickWand *wand,
1391 const MagickWand *clut_wand)
1396 status=MagickClutImageChannel(wand,DefaultChannels,clut_wand);
1400 WandExport MagickBooleanType MagickClutImageChannel(MagickWand *wand,
1401 const ChannelType channel,const MagickWand *clut_wand)
1406 assert(wand != (MagickWand *) NULL);
1407 assert(wand->signature == WandSignature);
1408 if (wand->debug != MagickFalse)
1409 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1410 if ((wand->images == (Image *) NULL) || (clut_wand->images == (Image *) NULL))
1411 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1412 status=ClutImageChannel(wand->images,channel,clut_wand->images);
1413 if (status == MagickFalse)
1414 InheritException(wand->exception,&wand->images->exception);
1419 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1423 % M a g i c k C o a l e s c e I m a g e s %
1427 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1429 % MagickCoalesceImages() composites a set of images while respecting any page
1430 % offsets and disposal methods. GIF, MIFF, and MNG animation sequences
1431 % typically start with an image background and each subsequent image
1432 % varies in size and offset. MagickCoalesceImages() returns a new sequence
1433 % where each image in the sequence is the same size as the first and
1434 % composited with the next image in the sequence.
1436 % The format of the MagickCoalesceImages method is:
1438 % MagickWand *MagickCoalesceImages(MagickWand *wand)
1440 % A description of each parameter follows:
1442 % o wand: the magick wand.
1445 WandExport MagickWand *MagickCoalesceImages(MagickWand *wand)
1450 assert(wand != (MagickWand *) NULL);
1451 assert(wand->signature == WandSignature);
1452 if (wand->debug != MagickFalse)
1453 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1454 if (wand->images == (Image *) NULL)
1455 return((MagickWand *) NULL);
1456 coalesce_image=CoalesceImages(wand->images,wand->exception);
1457 if (coalesce_image == (Image *) NULL)
1458 return((MagickWand *) NULL);
1459 return(CloneMagickWandFromImages(wand,coalesce_image));
1463 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1467 % M a g i c k C o l o r D e c i s i o n I m a g e %
1471 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1473 % MagickColorDecisionListImage() accepts a lightweight Color Correction
1474 % Collection (CCC) file which solely contains one or more color corrections
1475 % and applies the color correction to the image. Here is a sample CCC file:
1477 % <ColorCorrectionCollection xmlns="urn:ASC:CDL:v1.2">
1478 % <ColorCorrection id="cc03345">
1480 % <Slope> 0.9 1.2 0.5 </Slope>
1481 % <Offset> 0.4 -0.5 0.6 </Offset>
1482 % <Power> 1.0 0.8 1.5 </Power>
1485 % <Saturation> 0.85 </Saturation>
1487 % </ColorCorrection>
1488 % </ColorCorrectionCollection>
1490 % which includes the offset, slope, and power for each of the RGB channels
1491 % as well as the saturation.
1493 % The format of the MagickColorDecisionListImage method is:
1495 % MagickBooleanType MagickColorDecisionListImage(MagickWand *wand,
1496 % const double gamma)
1498 % A description of each parameter follows:
1500 % o wand: the magick wand.
1502 % o color_correction_collection: the color correction collection in XML.
1505 WandExport MagickBooleanType MagickColorDecisionListImage(MagickWand *wand,
1506 const char *color_correction_collection)
1511 assert(wand != (MagickWand *) NULL);
1512 assert(wand->signature == WandSignature);
1513 if (wand->debug != MagickFalse)
1514 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1515 if (wand->images == (Image *) NULL)
1516 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1517 status=ColorDecisionListImage(wand->images,color_correction_collection);
1518 if (status == MagickFalse)
1519 InheritException(wand->exception,&wand->images->exception);
1524 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1528 % M a g i c k C o l o r i z e I m a g e %
1532 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1534 % MagickColorizeImage() blends the fill color with each pixel in the image.
1536 % The format of the MagickColorizeImage method is:
1538 % MagickBooleanType MagickColorizeImage(MagickWand *wand,
1539 % const PixelWand *colorize,const PixelWand *opacity)
1541 % A description of each parameter follows:
1543 % o wand: the magick wand.
1545 % o colorize: the colorize pixel wand.
1547 % o opacity: the opacity pixel wand.
1550 WandExport MagickBooleanType MagickColorizeImage(MagickWand *wand,
1551 const PixelWand *colorize,const PixelWand *opacity)
1554 percent_opaque[MaxTextExtent];
1562 assert(wand != (MagickWand *) NULL);
1563 assert(wand->signature == WandSignature);
1564 if (wand->debug != MagickFalse)
1565 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1566 if (wand->images == (Image *) NULL)
1567 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1568 (void) FormatMagickString(percent_opaque,MaxTextExtent,"%g,%g,%g,%g",
1569 (double) (100.0*QuantumScale*PixelGetRedQuantum(opacity)),
1570 (double) (100.0*QuantumScale*PixelGetGreenQuantum(opacity)),
1571 (double) (100.0*QuantumScale*PixelGetBlueQuantum(opacity)),
1572 (double) (100.0*QuantumScale*PixelGetOpacityQuantum(opacity)));
1573 PixelGetQuantumColor(colorize,&target);
1574 colorize_image=ColorizeImage(wand->images,percent_opaque,target,
1576 if (colorize_image == (Image *) NULL)
1577 return(MagickFalse);
1578 ReplaceImageInList(&wand->images,colorize_image);
1583 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1587 % M a g i c k C o m b i n e I m a g e s %
1591 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1593 % MagickCombineImages() combines one or more images into a single image. The
1594 % grayscale value of the pixels of each image in the sequence is assigned in
1595 % order to the specified hannels of the combined image. The typical
1596 % ordering would be image 1 => Red, 2 => Green, 3 => Blue, etc.
1598 % The format of the MagickCombineImages method is:
1600 % MagickWand *MagickCombineImages(MagickWand *wand,
1601 % const ChannelType channel)
1603 % A description of each parameter follows:
1605 % o wand: the magick wand.
1607 % o channel: the channel.
1610 WandExport MagickWand *MagickCombineImages(MagickWand *wand,
1611 const ChannelType channel)
1616 assert(wand != (MagickWand *) NULL);
1617 assert(wand->signature == WandSignature);
1618 if (wand->debug != MagickFalse)
1619 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1620 if (wand->images == (Image *) NULL)
1621 return((MagickWand *) NULL);
1622 combine_image=CombineImages(wand->images,channel,wand->exception);
1623 if (combine_image == (Image *) NULL)
1624 return((MagickWand *) NULL);
1625 return(CloneMagickWandFromImages(wand,combine_image));
1629 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1633 % M a g i c k C o m m e n t I m a g e %
1637 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1639 % MagickCommentImage() adds a comment to your image.
1641 % The format of the MagickCommentImage method is:
1643 % MagickBooleanType MagickCommentImage(MagickWand *wand,
1644 % const char *comment)
1646 % A description of each parameter follows:
1648 % o wand: the magick wand.
1650 % o comment: the image comment.
1653 WandExport MagickBooleanType MagickCommentImage(MagickWand *wand,
1654 const char *comment)
1659 assert(wand != (MagickWand *) NULL);
1660 assert(wand->signature == WandSignature);
1661 if (wand->debug != MagickFalse)
1662 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1663 if (wand->images == (Image *) NULL)
1664 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1665 status=SetImageProperty(wand->images,"comment",comment);
1666 if (status == MagickFalse)
1667 InheritException(wand->exception,&wand->images->exception);
1672 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1676 % 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 %
1680 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1682 % MagickCompareImageChannels() compares one or more image channels of an image
1683 % to a reconstructed image and returns the difference image.
1685 % The format of the MagickCompareImageChannels method is:
1687 % MagickWand *MagickCompareImageChannels(MagickWand *wand,
1688 % const MagickWand *reference,const ChannelType channel,
1689 % const MetricType metric,double *distortion)
1691 % A description of each parameter follows:
1693 % o wand: the magick wand.
1695 % o reference: the reference wand.
1697 % o channel: the channel.
1699 % o metric: the metric.
1701 % o distortion: the computed distortion between the images.
1704 WandExport MagickWand *MagickCompareImageChannels(MagickWand *wand,
1705 const MagickWand *reference,const ChannelType channel,const MetricType metric,
1711 assert(wand != (MagickWand *) NULL);
1712 assert(wand->signature == WandSignature);
1713 if (wand->debug != MagickFalse)
1714 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1715 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
1717 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
1718 "ContainsNoImages","`%s'",wand->name);
1719 return((MagickWand *) NULL);
1721 compare_image=CompareImageChannels(wand->images,reference->images,channel,
1722 metric,distortion,&wand->images->exception);
1723 if (compare_image == (Image *) NULL)
1724 return((MagickWand *) NULL);
1725 return(CloneMagickWandFromImages(wand,compare_image));
1729 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1733 % M a g i c k C o m p a r e I m a g e L a y e r s %
1737 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1739 % MagickCompareImageLayers() compares each image with the next in a sequence
1740 % and returns the maximum bounding region of any pixel differences it
1743 % The format of the MagickCompareImageLayers method is:
1745 % MagickWand *MagickCompareImageLayers(MagickWand *wand,
1746 % const ImageLayerMethod method)
1748 % A description of each parameter follows:
1750 % o wand: the magick wand.
1752 % o method: the compare method.
1755 WandExport MagickWand *MagickCompareImageLayers(MagickWand *wand,
1756 const ImageLayerMethod method)
1761 assert(wand != (MagickWand *) NULL);
1762 assert(wand->signature == WandSignature);
1763 if (wand->debug != MagickFalse)
1764 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1765 if (wand->images == (Image *) NULL)
1766 return((MagickWand *) NULL);
1767 layers_image=CompareImageLayers(wand->images,method,wand->exception);
1768 if (layers_image == (Image *) NULL)
1769 return((MagickWand *) NULL);
1770 return(CloneMagickWandFromImages(wand,layers_image));
1774 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1778 % M a g i c k C o m p a r e I m a g e s %
1782 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1784 % MagickCompareImages() compares an image to a reconstructed image and returns
1785 % the specified difference image.
1787 % The format of the MagickCompareImages method is:
1789 % MagickWand *MagickCompareImages(MagickWand *wand,
1790 % const MagickWand *reference,const MetricType metric,
1791 % double *distortion)
1793 % A description of each parameter follows:
1795 % o wand: the magick wand.
1797 % o reference: the reference wand.
1799 % o metric: the metric.
1801 % o distortion: the computed distortion between the images.
1804 WandExport MagickWand *MagickCompareImages(MagickWand *wand,
1805 const MagickWand *reference,const MetricType metric,double *distortion)
1811 assert(wand != (MagickWand *) NULL);
1812 assert(wand->signature == WandSignature);
1813 if (wand->debug != MagickFalse)
1814 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1815 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
1817 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
1818 "ContainsNoImages","`%s'",wand->name);
1819 return((MagickWand *) NULL);
1821 compare_image=CompareImages(wand->images,reference->images,metric,distortion,
1822 &wand->images->exception);
1823 if (compare_image == (Image *) NULL)
1824 return((MagickWand *) NULL);
1825 return(CloneMagickWandFromImages(wand,compare_image));
1829 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1833 % M a g i c k C o m p o s i t e I m a g e %
1837 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1839 % MagickCompositeImage() composite one image onto another at the specified
1842 % The format of the MagickCompositeImage method is:
1844 % MagickBooleanType MagickCompositeImage(MagickWand *wand,
1845 % const MagickWand *composite_wand,const CompositeOperator compose,
1846 % const long x,const long y)
1847 % MagickBooleanType MagickCompositeImageChannel(MagickWand *wand,
1848 % const ChannelType channel,const MagickWand *composite_wand,
1849 % const CompositeOperator compose,const long x,const long y)
1851 % A description of each parameter follows:
1853 % o wand: the magick wand.
1855 % o composite_image: the composite image.
1857 % o compose: This operator affects how the composite is applied to the
1858 % image. The default is Over. Choose from these operators:
1860 % OverCompositeOp InCompositeOp OutCompositeOp
1861 % AtopCompositeOp XorCompositeOp PlusCompositeOp
1862 % MinusCompositeOp AddCompositeOp SubtractCompositeOp
1863 % DifferenceCompositeOp BumpmapCompositeOp CopyCompositeOp
1864 % DisplaceCompositeOp
1866 % o x: the column offset of the composited image.
1868 % o y: the row offset of the composited image.
1872 WandExport MagickBooleanType MagickCompositeImage(MagickWand *wand,
1873 const MagickWand *composite_wand,const CompositeOperator compose,const long x,
1879 status=MagickCompositeImageChannel(wand,DefaultChannels,composite_wand,
1884 WandExport MagickBooleanType MagickCompositeImageChannel(MagickWand *wand,
1885 const ChannelType channel,const MagickWand *composite_wand,
1886 const CompositeOperator compose,const long x,const long y)
1891 assert(wand != (MagickWand *) NULL);
1892 assert(wand->signature == WandSignature);
1893 if (wand->debug != MagickFalse)
1894 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1895 if ((wand->images == (Image *) NULL) ||
1896 (composite_wand->images == (Image *) NULL))
1897 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1898 status=CompositeImageChannel(wand->images,channel,compose,
1899 composite_wand->images,x,y);
1900 if (status == MagickFalse)
1901 InheritException(wand->exception,&wand->images->exception);
1906 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1910 % M a g i c k C o n t r a s t I m a g e %
1914 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1916 % MagickContrastImage() enhances the intensity differences between the lighter
1917 % and darker elements of the image. Set sharpen to a value other than 0 to
1918 % increase the image contrast otherwise the contrast is reduced.
1920 % The format of the MagickContrastImage method is:
1922 % MagickBooleanType MagickContrastImage(MagickWand *wand,
1923 % const MagickBooleanType sharpen)
1925 % A description of each parameter follows:
1927 % o wand: the magick wand.
1929 % o sharpen: Increase or decrease image contrast.
1933 WandExport MagickBooleanType MagickContrastImage(MagickWand *wand,
1934 const MagickBooleanType sharpen)
1939 assert(wand != (MagickWand *) NULL);
1940 assert(wand->signature == WandSignature);
1941 if (wand->debug != MagickFalse)
1942 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1943 if (wand->images == (Image *) NULL)
1944 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1945 status=ContrastImage(wand->images,sharpen);
1946 if (status == MagickFalse)
1947 InheritException(wand->exception,&wand->images->exception);
1952 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1956 % 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 %
1960 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1962 % MagickContrastStretchImage() enhances the contrast of a color image by
1963 % adjusting the pixels color to span the entire range of colors available.
1964 % You can also reduce the influence of a particular channel with a gamma
1967 % The format of the MagickContrastStretchImage method is:
1969 % MagickBooleanType MagickContrastStretchImage(MagickWand *wand,
1970 % const double black_point,const double white_point)
1971 % MagickBooleanType MagickContrastStretchImageChannel(MagickWand *wand,
1972 % const ChannelType channel,const double black_point,
1973 % const double white_point)
1975 % A description of each parameter follows:
1977 % o wand: the magick wand.
1979 % o channel: the image channel(s).
1981 % o black_point: the black point.
1983 % o white_point: the white point.
1987 WandExport MagickBooleanType MagickContrastStretchImage(MagickWand *wand,
1988 const double black_point,const double white_point)
1993 status=MagickContrastStretchImageChannel(wand,DefaultChannels,black_point,
1998 WandExport MagickBooleanType MagickContrastStretchImageChannel(MagickWand *wand,
1999 const ChannelType channel,const double black_point,const double white_point)
2004 assert(wand != (MagickWand *) NULL);
2005 assert(wand->signature == WandSignature);
2006 if (wand->debug != MagickFalse)
2007 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2008 if (wand->images == (Image *) NULL)
2009 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2010 status=ContrastStretchImageChannel(wand->images,channel,black_point,
2012 if (status == MagickFalse)
2013 InheritException(wand->exception,&wand->images->exception);
2018 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2022 % M a g i c k C o n v o l v e I m a g e %
2026 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2028 % MagickConvolveImage() applies a custom convolution kernel to the image.
2030 % The format of the MagickConvolveImage method is:
2032 % MagickBooleanType MagickConvolveImage(MagickWand *wand,
2033 % const unsigned long order,const double *kernel)
2034 % MagickBooleanType MagickConvolveImageChannel(MagickWand *wand,
2035 % const ChannelType channel,const unsigned long order,
2036 % const double *kernel)
2038 % A description of each parameter follows:
2040 % o wand: the magick wand.
2042 % o channel: the image channel(s).
2044 % o order: the number of columns and rows in the filter kernel.
2046 % o kernel: An array of doubles representing the convolution kernel.
2050 WandExport MagickBooleanType MagickConvolveImage(MagickWand *wand,
2051 const unsigned long order,const double *kernel)
2056 status=MagickConvolveImageChannel(wand,DefaultChannels,order,kernel);
2060 WandExport MagickBooleanType MagickConvolveImageChannel(MagickWand *wand,
2061 const ChannelType channel,const unsigned long order,const double *kernel)
2066 assert(wand != (MagickWand *) NULL);
2067 assert(wand->signature == WandSignature);
2068 if (wand->debug != MagickFalse)
2069 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2070 if (kernel == (const double *) NULL)
2071 return(MagickFalse);
2072 if (wand->images == (Image *) NULL)
2073 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2074 convolve_image=ConvolveImageChannel(wand->images,channel,order,kernel,
2076 if (convolve_image == (Image *) NULL)
2077 return(MagickFalse);
2078 ReplaceImageInList(&wand->images,convolve_image);
2083 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2087 % M a g i c k C r o p I m a g e %
2091 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2093 % MagickCropImage() extracts a region of the image.
2095 % The format of the MagickCropImage method is:
2097 % MagickBooleanType MagickCropImage(MagickWand *wand,
2098 % const unsigned long width,const unsigned long height,const long x,
2101 % A description of each parameter follows:
2103 % o wand: the magick wand.
2105 % o width: the region width.
2107 % o height: the region height.
2109 % o x: the region x-offset.
2111 % o y: the region y-offset.
2114 WandExport MagickBooleanType MagickCropImage(MagickWand *wand,
2115 const unsigned long width,const unsigned long height,const long x,
2124 assert(wand != (MagickWand *) NULL);
2125 assert(wand->signature == WandSignature);
2126 if (wand->debug != MagickFalse)
2127 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2128 if (wand->images == (Image *) NULL)
2129 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2134 crop_image=CropImage(wand->images,&crop,wand->exception);
2135 if (crop_image == (Image *) NULL)
2136 return(MagickFalse);
2137 ReplaceImageInList(&wand->images,crop_image);
2142 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2146 % M a g i c k C y c l e C o l o r m a p I m a g e %
2150 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2152 % MagickCycleColormapImage() displaces an image's colormap by a given number
2153 % of positions. If you cycle the colormap a number of times you can produce
2154 % a psychodelic effect.
2156 % The format of the MagickCycleColormapImage method is:
2158 % MagickBooleanType MagickCycleColormapImage(MagickWand *wand,
2159 % const long displace)
2161 % A description of each parameter follows:
2163 % o wand: the magick wand.
2165 % o pixel_wand: the pixel wand.
2168 WandExport MagickBooleanType MagickCycleColormapImage(MagickWand *wand,
2169 const long displace)
2174 assert(wand != (MagickWand *) NULL);
2175 assert(wand->signature == WandSignature);
2176 if (wand->debug != MagickFalse)
2177 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2178 if (wand->images == (Image *) NULL)
2179 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2180 status=CycleColormapImage(wand->images,displace);
2181 if (status == MagickFalse)
2182 InheritException(wand->exception,&wand->images->exception);
2187 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2191 % M a g i c k C o n s t i t u t e I m a g e %
2195 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2197 % MagickConstituteImage() adds an image to the wand comprised of the pixel
2198 % data you supply. The pixel data must be in scanline order top-to-bottom.
2199 % The data can be char, short int, int, float, or double. Float and double
2200 % require the pixels to be normalized [0..1], otherwise [0..Max], where Max
2201 % is the maximum value the type can accomodate (e.g. 255 for char). For
2202 % example, to create a 640x480 image from unsigned red-green-blue character
2205 % MagickConstituteImage(wand,640,640,"RGB",CharPixel,pixels);
2207 % The format of the MagickConstituteImage method is:
2209 % MagickBooleanType MagickConstituteImage(MagickWand *wand,
2210 % const unsigned long columns,const unsigned long rows,const char *map,
2211 % const StorageType storage,void *pixels)
2213 % A description of each parameter follows:
2215 % o wand: the magick wand.
2217 % o columns: width in pixels of the image.
2219 % o rows: height in pixels of the image.
2221 % o map: This string reflects the expected ordering of the pixel array.
2222 % It can be any combination or order of R = red, G = green, B = blue,
2223 % A = alpha (0 is transparent), O = opacity (0 is opaque), C = cyan,
2224 % Y = yellow, M = magenta, K = black, I = intensity (for grayscale),
2227 % o storage: Define the data type of the pixels. Float and double types are
2228 % expected to be normalized [0..1] otherwise [0..QuantumRange]. Choose from
2229 % these types: CharPixel, DoublePixel, FloatPixel, IntegerPixel,
2230 % LongPixel, QuantumPixel, or ShortPixel.
2232 % o pixels: This array of values contain the pixel components as defined by
2233 % map and type. You must preallocate this array where the expected
2234 % length varies depending on the values of width, height, map, and type.
2238 WandExport MagickBooleanType MagickConstituteImage(MagickWand *wand,
2239 const unsigned long columns,const unsigned long rows,const char *map,
2240 const StorageType storage,const void *pixels)
2245 assert(wand != (MagickWand *) NULL);
2246 assert(wand->signature == WandSignature);
2247 if (wand->debug != MagickFalse)
2248 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2249 images=ConstituteImage(columns,rows,map,storage,pixels,wand->exception);
2250 if (images == (Image *) NULL)
2251 return(MagickFalse);
2252 return(InsertImageInWand(wand,images));
2256 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2260 % M a g i c k D e c i p h e r I m a g e %
2264 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2266 % MagickDecipherImage() converts cipher pixels to plain pixels.
2268 % The format of the MagickDecipherImage method is:
2270 % MagickBooleanType MagickDecipherImage(MagickWand *wand,
2271 % const char *passphrase)
2273 % A description of each parameter follows:
2275 % o wand: the magick wand.
2277 % o passphrase: the passphrase.
2280 WandExport MagickBooleanType MagickDecipherImage(MagickWand *wand,
2281 const char *passphrase)
2283 assert(wand != (MagickWand *) NULL);
2284 assert(wand->signature == WandSignature);
2285 if (wand->debug != MagickFalse)
2286 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2287 if (wand->images == (Image *) NULL)
2288 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2289 return(DecipherImage(wand->images,passphrase,&wand->images->exception));
2293 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2297 % M a g i c k D e c o n s t r u c t I m a g e s %
2301 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2303 % MagickDeconstructImages() compares each image with the next in a sequence
2304 % and returns the maximum bounding region of any pixel differences it
2307 % The format of the MagickDeconstructImages method is:
2309 % MagickWand *MagickDeconstructImages(MagickWand *wand)
2311 % A description of each parameter follows:
2313 % o wand: the magick wand.
2316 WandExport MagickWand *MagickDeconstructImages(MagickWand *wand)
2321 assert(wand != (MagickWand *) NULL);
2322 assert(wand->signature == WandSignature);
2323 if (wand->debug != MagickFalse)
2324 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2325 if (wand->images == (Image *) NULL)
2326 return((MagickWand *) NULL);
2327 deconstruct_image=DeconstructImages(wand->images,wand->exception);
2328 if (deconstruct_image == (Image *) NULL)
2329 return((MagickWand *) NULL);
2330 return(CloneMagickWandFromImages(wand,deconstruct_image));
2334 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2338 % M a g i c k D e s k e w I m a g e %
2342 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2344 % MagickDeskewImage() removes skew from the image. Skew is an artifact that
2345 % occurs in scanned images because of the camera being misaligned,
2346 % imperfections in the scanning or surface, or simply because the paper was
2347 % not placed completely flat when scanned.
2349 % The format of the MagickDeskewImage method is:
2351 % MagickBooleanType MagickDeskewImage(MagickWand *wand,
2352 % const double threshold)
2354 % A description of each parameter follows:
2356 % o wand: the magick wand.
2358 % o threshold: separate background from foreground.
2361 WandExport MagickBooleanType MagickDeskewImage(MagickWand *wand,
2362 const double threshold)
2367 assert(wand != (MagickWand *) NULL);
2368 assert(wand->signature == WandSignature);
2369 if (wand->debug != MagickFalse)
2370 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2371 if (wand->images == (Image *) NULL)
2372 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2373 sepia_image=DeskewImage(wand->images,threshold,wand->exception);
2374 if (sepia_image == (Image *) NULL)
2375 return(MagickFalse);
2376 ReplaceImageInList(&wand->images,sepia_image);
2381 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2385 % M a g i c k D e s p e c k l e I m a g e %
2389 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2391 % MagickDespeckleImage() reduces the speckle noise in an image while
2392 % perserving the edges of the original image.
2394 % The format of the MagickDespeckleImage method is:
2396 % MagickBooleanType MagickDespeckleImage(MagickWand *wand)
2398 % A description of each parameter follows:
2400 % o wand: the magick wand.
2403 WandExport MagickBooleanType MagickDespeckleImage(MagickWand *wand)
2408 assert(wand != (MagickWand *) NULL);
2409 assert(wand->signature == WandSignature);
2410 if (wand->debug != MagickFalse)
2411 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2412 if (wand->images == (Image *) NULL)
2413 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2414 despeckle_image=DespeckleImage(wand->images,wand->exception);
2415 if (despeckle_image == (Image *) NULL)
2416 return(MagickFalse);
2417 ReplaceImageInList(&wand->images,despeckle_image);
2422 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2426 % M a g i c k D e s t r o y I m a g e %
2430 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2432 % MagickDestroyImage() dereferences an image, deallocating memory associated
2433 % with the image if the reference count becomes zero.
2435 % The format of the MagickDestroyImage method is:
2437 % Image *MagickDestroyImage(Image *image)
2439 % A description of each parameter follows:
2441 % o image: the image.
2444 WandExport Image *MagickDestroyImage(Image *image)
2446 return(DestroyImage(image));
2450 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2454 % M a g i c k D i s p l a y I m a g e %
2458 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2460 % MagickDisplayImage() displays an image.
2462 % The format of the MagickDisplayImage method is:
2464 % MagickBooleanType MagickDisplayImage(MagickWand *wand,
2465 % const char *server_name)
2467 % A description of each parameter follows:
2469 % o wand: the magick wand.
2471 % o server_name: the X server name.
2474 WandExport MagickBooleanType MagickDisplayImage(MagickWand *wand,
2475 const char *server_name)
2483 assert(wand != (MagickWand *) NULL);
2484 assert(wand->signature == WandSignature);
2485 if (wand->debug != MagickFalse)
2486 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2487 if (wand->images == (Image *) NULL)
2488 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2489 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
2490 if (image == (Image *) NULL)
2491 return(MagickFalse);
2492 (void) CloneString(&wand->image_info->server_name,server_name);
2493 status=DisplayImages(wand->image_info,image);
2494 if (status == MagickFalse)
2495 InheritException(wand->exception,&image->exception);
2496 image=DestroyImage(image);
2501 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2505 % M a g i c k D i s p l a y I m a g e s %
2509 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2511 % MagickDisplayImages() displays an image or image sequence.
2513 % The format of the MagickDisplayImages method is:
2515 % MagickBooleanType MagickDisplayImages(MagickWand *wand,
2516 % const char *server_name)
2518 % A description of each parameter follows:
2520 % o wand: the magick wand.
2522 % o server_name: the X server name.
2525 WandExport MagickBooleanType MagickDisplayImages(MagickWand *wand,
2526 const char *server_name)
2531 assert(wand != (MagickWand *) NULL);
2532 assert(wand->signature == WandSignature);
2533 if (wand->debug != MagickFalse)
2534 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2535 (void) CloneString(&wand->image_info->server_name,server_name);
2536 status=DisplayImages(wand->image_info,wand->images);
2537 if (status == MagickFalse)
2538 InheritException(wand->exception,&wand->images->exception);
2543 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2547 % M a g i c k D i s t o r t I m a g e %
2551 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2553 % MagickDistortImage() distorts an image using various distortion methods, by
2554 % mapping color lookups of the source image to a new destination image
2555 % usally of the same size as the source image, unless 'bestfit' is set to
2558 % If 'bestfit' is enabled, and distortion allows it, the destination image is
2559 % adjusted to ensure the whole source 'image' will just fit within the final
2560 % destination image, which will be sized and offset accordingly. Also in
2561 % many cases the virtual offset of the source image will be taken into
2562 % account in the mapping.
2564 % The format of the MagickDistortImage method is:
2566 % MagickBooleanType MagickDistortImage(MagickWand *wand,
2567 % const DistortImageMethod method,const unsigned long number_arguments,
2568 % const double *arguments,const MagickBooleanType bestfit)
2570 % A description of each parameter follows:
2572 % o image: the image to be distorted.
2574 % o method: the method of image distortion.
2576 % ArcDistortion always ignores the source image offset, and always
2577 % 'bestfit' the destination image with the top left corner offset
2578 % relative to the polar mapping center.
2580 % Bilinear has no simple inverse mapping so it does not allow 'bestfit'
2581 % style of image distortion.
2583 % Affine, Perspective, and Bilinear, do least squares fitting of the
2584 % distortion when more than the minimum number of control point pairs
2587 % Perspective, and Bilinear, falls back to a Affine distortion when less
2588 % that 4 control point pairs are provided. While Affine distortions let
2589 % you use any number of control point pairs, that is Zero pairs is a
2590 % no-Op (viewport only) distrotion, one pair is a translation and two
2591 % pairs of control points do a scale-rotate-translate, without any
2594 % o number_arguments: the number of arguments given for this distortion
2597 % o arguments: the arguments for this distortion method.
2599 % o bestfit: Attempt to resize destination to fit distorted source.
2602 WandExport MagickBooleanType MagickDistortImage(MagickWand *wand,
2603 const DistortImageMethod method,const unsigned long number_arguments,
2604 const double *arguments,const MagickBooleanType bestfit)
2609 assert(wand != (MagickWand *) NULL);
2610 assert(wand->signature == WandSignature);
2611 if (wand->debug != MagickFalse)
2612 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2613 if (wand->images == (Image *) NULL)
2614 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2615 distort_image=DistortImage(wand->images,method,number_arguments,arguments,
2616 bestfit,wand->exception);
2617 if (distort_image == (Image *) NULL)
2618 return(MagickFalse);
2619 ReplaceImageInList(&wand->images,distort_image);
2624 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2628 % M a g i c k D r a w I m a g e %
2632 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2634 % MagickDrawImage() renders the drawing wand on the current image.
2636 % The format of the MagickDrawImage method is:
2638 % MagickBooleanType MagickDrawImage(MagickWand *wand,
2639 % const DrawingWand *drawing_wand)
2641 % A description of each parameter follows:
2643 % o wand: the magick wand.
2645 % o drawing_wand: the draw wand.
2648 WandExport MagickBooleanType MagickDrawImage(MagickWand *wand,
2649 const DrawingWand *drawing_wand)
2660 assert(wand != (MagickWand *) NULL);
2661 assert(wand->signature == WandSignature);
2662 if (wand->debug != MagickFalse)
2663 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2664 if (wand->images == (Image *) NULL)
2665 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2666 draw_info=PeekDrawingWand(drawing_wand);
2667 if ((draw_info == (DrawInfo *) NULL) ||
2668 (draw_info->primitive == (char *) NULL))
2669 return(MagickFalse);
2670 primitive=AcquireString(draw_info->primitive);
2671 draw_info=DestroyDrawInfo(draw_info);
2672 draw_info=CloneDrawInfo(wand->image_info,(DrawInfo *) NULL);
2673 draw_info->primitive=primitive;
2674 status=DrawImage(wand->images,draw_info);
2675 if (status == MagickFalse)
2676 InheritException(wand->exception,&wand->images->exception);
2677 draw_info=DestroyDrawInfo(draw_info);
2682 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2686 % M a g i c k E d g e I m a g e %
2690 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2692 % MagickEdgeImage() enhance edges within the image with a convolution filter
2693 % of the given radius. Use a radius of 0 and Edge() selects a suitable
2696 % The format of the MagickEdgeImage method is:
2698 % MagickBooleanType MagickEdgeImage(MagickWand *wand,const double radius)
2700 % A description of each parameter follows:
2702 % o wand: the magick wand.
2704 % o radius: the radius of the pixel neighborhood.
2707 WandExport MagickBooleanType MagickEdgeImage(MagickWand *wand,
2708 const double radius)
2713 assert(wand != (MagickWand *) NULL);
2714 assert(wand->signature == WandSignature);
2715 if (wand->debug != MagickFalse)
2716 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2717 if (wand->images == (Image *) NULL)
2718 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2719 edge_image=EdgeImage(wand->images,radius,wand->exception);
2720 if (edge_image == (Image *) NULL)
2721 return(MagickFalse);
2722 ReplaceImageInList(&wand->images,edge_image);
2727 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2731 % M a g i c k E m b o s s I m a g e %
2735 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2737 % MagickEmbossImage() returns a grayscale image with a three-dimensional
2738 % effect. We convolve the image with a Gaussian operator of the given radius
2739 % and standard deviation (sigma). For reasonable results, radius should be
2740 % larger than sigma. Use a radius of 0 and Emboss() selects a suitable
2743 % The format of the MagickEmbossImage method is:
2745 % MagickBooleanType MagickEmbossImage(MagickWand *wand,const double radius,
2746 % const double sigma)
2748 % A description of each parameter follows:
2750 % o wand: the magick wand.
2752 % o radius: the radius of the Gaussian, in pixels, not counting the center
2755 % o sigma: the standard deviation of the Gaussian, in pixels.
2758 WandExport MagickBooleanType MagickEmbossImage(MagickWand *wand,
2759 const double radius,const double sigma)
2764 assert(wand != (MagickWand *) NULL);
2765 assert(wand->signature == WandSignature);
2766 if (wand->debug != MagickFalse)
2767 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2768 if (wand->images == (Image *) NULL)
2769 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2770 emboss_image=EmbossImage(wand->images,radius,sigma,wand->exception);
2771 if (emboss_image == (Image *) NULL)
2772 return(MagickFalse);
2773 ReplaceImageInList(&wand->images,emboss_image);
2778 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2782 % M a g i c k E n c i p h e r I m a g e %
2786 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2788 % MagickEncipherImage() converts plaint pixels to cipher pixels.
2790 % The format of the MagickEncipherImage method is:
2792 % MagickBooleanType MagickEncipherImage(MagickWand *wand,
2793 % const char *passphrase)
2795 % A description of each parameter follows:
2797 % o wand: the magick wand.
2799 % o passphrase: the passphrase.
2802 WandExport MagickBooleanType MagickEncipherImage(MagickWand *wand,
2803 const char *passphrase)
2805 assert(wand != (MagickWand *) NULL);
2806 assert(wand->signature == WandSignature);
2807 if (wand->debug != MagickFalse)
2808 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2809 if (wand->images == (Image *) NULL)
2810 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2811 return(EncipherImage(wand->images,passphrase,&wand->images->exception));
2815 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2819 % M a g i c k E n h a n c e I m a g e %
2823 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2825 % MagickEnhanceImage() applies a digital filter that improves the quality of a
2828 % The format of the MagickEnhanceImage method is:
2830 % MagickBooleanType MagickEnhanceImage(MagickWand *wand)
2832 % A description of each parameter follows:
2834 % o wand: the magick wand.
2837 WandExport MagickBooleanType MagickEnhanceImage(MagickWand *wand)
2842 assert(wand != (MagickWand *) NULL);
2843 assert(wand->signature == WandSignature);
2844 if (wand->debug != MagickFalse)
2845 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2846 if (wand->images == (Image *) NULL)
2847 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2848 enhance_image=EnhanceImage(wand->images,wand->exception);
2849 if (enhance_image == (Image *) NULL)
2850 return(MagickFalse);
2851 ReplaceImageInList(&wand->images,enhance_image);
2856 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2860 % M a g i c k E q u a l i z e I m a g e %
2864 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2866 % MagickEqualizeImage() equalizes the image histogram.
2868 % The format of the MagickEqualizeImage method is:
2870 % MagickBooleanType MagickEqualizeImage(MagickWand *wand)
2871 % MagickBooleanType MagickEqualizeImageChannel(MagickWand *wand,
2872 % const ChannelType channel)
2874 % A description of each parameter follows:
2876 % o wand: the magick wand.
2878 % o channel: the image channel(s).
2882 WandExport MagickBooleanType MagickEqualizeImage(MagickWand *wand)
2887 status=MagickEqualizeImageChannel(wand,DefaultChannels);
2891 WandExport MagickBooleanType MagickEqualizeImageChannel(MagickWand *wand,
2892 const ChannelType channel)
2897 assert(wand != (MagickWand *) NULL);
2898 assert(wand->signature == WandSignature);
2899 if (wand->debug != MagickFalse)
2900 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2901 if (wand->images == (Image *) NULL)
2902 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2903 status=EqualizeImageChannel(wand->images,channel);
2904 if (status == MagickFalse)
2905 InheritException(wand->exception,&wand->images->exception);
2910 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2914 % M a g i c k E v a l u a t e I m a g e %
2918 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2920 % MagickEvaluateImage() applys an arithmetic, relational, or logical
2921 % expression to an image. Use these operators to lighten or darken an image,
2922 % to increase or decrease contrast in an image, or to produce the "negative"
2925 % The format of the MagickEvaluateImage method is:
2927 % MagickBooleanType MagickEvaluateImage(MagickWand *wand,
2928 % const MagickEvaluateOperator operator,const double value)
2929 % MagickBooleanType MagickEvaluateImageChannel(MagickWand *wand,
2930 % const ChannelType channel,const MagickEvaluateOperator op,
2931 % const double value)
2933 % A description of each parameter follows:
2935 % o wand: the magick wand.
2937 % o channel: the channel(s).
2939 % o op: A channel operator.
2941 % o value: A value value.
2945 WandExport MagickBooleanType MagickEvaluateImage(MagickWand *wand,
2946 const MagickEvaluateOperator op,const double value)
2951 assert(wand != (MagickWand *) NULL);
2952 assert(wand->signature == WandSignature);
2953 if (wand->debug != MagickFalse)
2954 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2955 if (wand->images == (Image *) NULL)
2956 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2957 status=EvaluateImage(wand->images,op,value,&wand->images->exception);
2958 if (status == MagickFalse)
2959 InheritException(wand->exception,&wand->images->exception);
2963 WandExport MagickBooleanType MagickEvaluateImageChannel(MagickWand *wand,
2964 const ChannelType channel,const MagickEvaluateOperator op,const double value)
2969 assert(wand != (MagickWand *) NULL);
2970 assert(wand->signature == WandSignature);
2971 if (wand->debug != MagickFalse)
2972 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2973 if (wand->images == (Image *) NULL)
2974 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2975 status=EvaluateImageChannel(wand->images,channel,op,value,
2976 &wand->images->exception);
2981 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2985 % M a g i c k E x p o r t I m a g e P i x e l s %
2989 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2991 % MagickExportImagePixels() extracts pixel data from an image and returns it
2992 % to you. The method returns MagickTrue on success otherwise MagickFalse if
2993 % an error is encountered. The data is returned as char, short int, int,
2994 % long, float, or double in the order specified by map.
2996 % Suppose you want to extract the first scanline of a 640x480 image as
2997 % character data in red-green-blue order:
2999 % MagickExportImagePixels(wand,0,0,640,1,"RGB",CharPixel,pixels);
3001 % The format of the MagickExportImagePixels method is:
3003 % MagickBooleanType MagickExportImagePixels(MagickWand *wand,
3004 % const long x,const long y,const unsigned long columns,
3005 % const unsigned long rows,const char *map,const StorageType storage,
3008 % A description of each parameter follows:
3010 % o wand: the magick wand.
3012 % o x, y, columns, rows: These values define the perimeter
3013 % of a region of pixels you want to extract.
3015 % o map: This string reflects the expected ordering of the pixel array.
3016 % It can be any combination or order of R = red, G = green, B = blue,
3017 % A = alpha (0 is transparent), O = opacity (0 is opaque), C = cyan,
3018 % Y = yellow, M = magenta, K = black, I = intensity (for grayscale),
3021 % o storage: Define the data type of the pixels. Float and double types are
3022 % expected to be normalized [0..1] otherwise [0..QuantumRange]. Choose from
3023 % these types: CharPixel, DoublePixel, FloatPixel, IntegerPixel,
3024 % LongPixel, QuantumPixel, or ShortPixel.
3026 % o pixels: This array of values contain the pixel components as defined by
3027 % map and type. You must preallocate this array where the expected
3028 % length varies depending on the values of width, height, map, and type.
3031 WandExport MagickBooleanType MagickExportImagePixels(MagickWand *wand,
3032 const long x,const long y,const unsigned long columns,
3033 const unsigned long rows,const char *map,const StorageType storage,
3039 assert(wand != (MagickWand *) NULL);
3040 assert(wand->signature == WandSignature);
3041 if (wand->debug != MagickFalse)
3042 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3043 if (wand->images == (Image *) NULL)
3044 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3045 status=ExportImagePixels(wand->images,x,y,columns,rows,map,
3046 storage,pixels,wand->exception);
3047 if (status == MagickFalse)
3048 InheritException(wand->exception,&wand->images->exception);
3053 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3057 % M a g i c k E x t e n t I m a g e %
3061 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3063 % MagickExtentImage() extends the image as defined by the geometry, gravity,
3064 % and wand background color. Set the (x,y) offset of the geometry to move
3065 % the original wand relative to the extended wand.
3067 % The format of the MagickExtentImage method is:
3069 % MagickBooleanType MagickExtentImage(MagickWand *wand,
3070 % const unsigned long width,const unsigned long height,const long x,
3073 % A description of each parameter follows:
3075 % o wand: the magick wand.
3077 % o width: the region width.
3079 % o height: the region height.
3081 % o x: the region x offset.
3083 % o y: the region y offset.
3086 WandExport MagickBooleanType MagickExtentImage(MagickWand *wand,
3087 const unsigned long width,const unsigned long height,const long x,
3096 assert(wand != (MagickWand *) NULL);
3097 assert(wand->signature == WandSignature);
3098 if (wand->debug != MagickFalse)
3099 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3100 if (wand->images == (Image *) NULL)
3101 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3103 extent.height=height;
3106 extent_image=ExtentImage(wand->images,&extent,wand->exception);
3107 if (extent_image == (Image *) NULL)
3108 return(MagickFalse);
3109 ReplaceImageInList(&wand->images,extent_image);
3114 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3118 % M a g i c k F l i p I m a g e %
3122 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3124 % MagickFlipImage() creates a vertical mirror image by reflecting the pixels
3125 % around the central x-axis.
3127 % The format of the MagickFlipImage method is:
3129 % MagickBooleanType MagickFlipImage(MagickWand *wand)
3131 % A description of each parameter follows:
3133 % o wand: the magick wand.
3136 WandExport MagickBooleanType MagickFlipImage(MagickWand *wand)
3141 assert(wand != (MagickWand *) NULL);
3142 assert(wand->signature == WandSignature);
3143 if (wand->debug != MagickFalse)
3144 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3145 if (wand->images == (Image *) NULL)
3146 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3147 flip_image=FlipImage(wand->images,wand->exception);
3148 if (flip_image == (Image *) NULL)
3149 return(MagickFalse);
3150 ReplaceImageInList(&wand->images,flip_image);
3155 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3159 % 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 %
3163 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3165 % MagickFloodfillPaintImage() changes the color value of any pixel that matches
3166 % target and is an immediate neighbor. If the method FillToBorderMethod is
3167 % specified, the color value is changed for any neighbor pixel that does not
3168 % match the bordercolor member of image.
3170 % The format of the MagickFloodfillPaintImage method is:
3172 % MagickBooleanType MagickFloodfillPaintImage(MagickWand *wand,
3173 % const ChannelType channel,const PixelWand *fill,const double fuzz,
3174 % const PixelWand *bordercolor,const long x,const long y,
3175 % const MagickBooleanType invert)
3177 % A description of each parameter follows:
3179 % o wand: the magick wand.
3181 % o channel: the channel(s).
3183 % o fill: the floodfill color pixel wand.
3185 % o fuzz: By default target must match a particular pixel color
3186 % exactly. However, in many cases two colors may differ by a small amount.
3187 % The fuzz member of image defines how much tolerance is acceptable to
3188 % consider two colors as the same. For example, set fuzz to 10 and the
3189 % color red at intensities of 100 and 102 respectively are now interpreted
3190 % as the same color for the purposes of the floodfill.
3192 % o bordercolor: the border color pixel wand.
3194 % o x,y: the starting location of the operation.
3196 % o invert: paint any pixel that does not match the target color.
3199 WandExport MagickBooleanType MagickFloodfillPaintImage(MagickWand *wand,
3200 const ChannelType channel,const PixelWand *fill,const double fuzz,
3201 const PixelWand *bordercolor,const long x,const long y,
3202 const MagickBooleanType invert)
3213 assert(wand != (MagickWand *) NULL);
3214 assert(wand->signature == WandSignature);
3215 if (wand->debug != MagickFalse)
3216 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3217 if (wand->images == (Image *) NULL)
3218 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3219 draw_info=CloneDrawInfo(wand->image_info,(DrawInfo *) NULL);
3220 PixelGetQuantumColor(fill,&draw_info->fill);
3221 (void) GetOneVirtualMagickPixel(wand->images,x % wand->images->columns,
3222 y % wand->images->rows,&target,wand->exception);
3223 if (bordercolor != (PixelWand *) NULL)
3224 PixelGetMagickColor(bordercolor,&target);
3225 wand->images->fuzz=fuzz;
3226 status=FloodfillPaintImage(wand->images,channel,draw_info,&target,x,y,
3228 if (status == MagickFalse)
3229 InheritException(wand->exception,&wand->images->exception);
3230 draw_info=DestroyDrawInfo(draw_info);
3235 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3239 % M a g i c k F l o p I m a g e %
3243 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3245 % MagickFlopImage() creates a horizontal mirror image by reflecting the pixels
3246 % around the central y-axis.
3248 % The format of the MagickFlopImage method is:
3250 % MagickBooleanType MagickFlopImage(MagickWand *wand)
3252 % A description of each parameter follows:
3254 % o wand: the magick wand.
3257 WandExport MagickBooleanType MagickFlopImage(MagickWand *wand)
3262 assert(wand != (MagickWand *) NULL);
3263 assert(wand->signature == WandSignature);
3264 if (wand->debug != MagickFalse)
3265 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3266 if (wand->images == (Image *) NULL)
3267 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3268 flop_image=FlopImage(wand->images,wand->exception);
3269 if (flop_image == (Image *) NULL)
3270 return(MagickFalse);
3271 ReplaceImageInList(&wand->images,flop_image);
3276 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3280 % 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 %
3284 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3286 % MagickForwardFourierTransformImage() implements the discrete Fourier
3287 % transform (DFT) of the image either as a magnitude / phase or real /
3288 % imaginary image pair.
3290 % The format of the MagickForwardFourierTransformImage method is:
3292 % MagickBooleanType MagickForwardFourierTransformImage(MagickWand *wand,
3293 % const MagickBooleanType magnitude)
3295 % A description of each parameter follows:
3297 % o wand: the magick wand.
3299 % o magnitude: if true, return as magnitude / phase pair otherwise a real /
3300 % imaginary image pair.
3303 WandExport MagickBooleanType MagickForwardFourierTransformImage(
3304 MagickWand *wand,const MagickBooleanType magnitude)
3309 assert(wand != (MagickWand *) NULL);
3310 assert(wand->signature == WandSignature);
3311 if (wand->debug != MagickFalse)
3312 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3313 if (wand->images == (Image *) NULL)
3314 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3315 forward_image=ForwardFourierTransformImage(wand->images,magnitude,
3317 if (forward_image == (Image *) NULL)
3318 return(MagickFalse);
3319 ReplaceImageInList(&wand->images,forward_image);
3324 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3328 % M a g i c k F r a m e I m a g e %
3332 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3334 % MagickFrameImage() adds a simulated three-dimensional border around the
3335 % image. The width and height specify the border width of the vertical and
3336 % horizontal sides of the frame. The inner and outer bevels indicate the
3337 % width of the inner and outer shadows of the frame.
3339 % The format of the MagickFrameImage method is:
3341 % MagickBooleanType MagickFrameImage(MagickWand *wand,
3342 % const PixelWand *matte_color,const unsigned long width,
3343 % const unsigned long height,const long inner_bevel,
3344 % const long outer_bevel)
3346 % A description of each parameter follows:
3348 % o wand: the magick wand.
3350 % o matte_color: the frame color pixel wand.
3352 % o width: the border width.
3354 % o height: the border height.
3356 % o inner_bevel: the inner bevel width.
3358 % o outer_bevel: the outer bevel width.
3361 WandExport MagickBooleanType MagickFrameImage(MagickWand *wand,
3362 const PixelWand *matte_color,const unsigned long width,
3363 const unsigned long height,const long inner_bevel,const long outer_bevel)
3371 assert(wand != (MagickWand *) NULL);
3372 assert(wand->signature == WandSignature);
3373 if (wand->debug != MagickFalse)
3374 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3375 if (wand->images == (Image *) NULL)
3376 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3377 (void) ResetMagickMemory(&frame_info,0,sizeof(frame_info));
3378 frame_info.width=wand->images->columns+2*width;
3379 frame_info.height=wand->images->rows+2*height;
3380 frame_info.x=(long) width;
3381 frame_info.y=(long) height;
3382 frame_info.inner_bevel=inner_bevel;
3383 frame_info.outer_bevel=outer_bevel;
3384 PixelGetQuantumColor(matte_color,&wand->images->matte_color);
3385 frame_image=FrameImage(wand->images,&frame_info,wand->exception);
3386 if (frame_image == (Image *) NULL)
3387 return(MagickFalse);
3388 ReplaceImageInList(&wand->images,frame_image);
3393 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3397 % M a g i c k F u n c t i o n I m a g e %
3401 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3403 % MagickFunctionImage() applys an arithmetic, relational, or logical
3404 % expression to an image. Use these operators to lighten or darken an image,
3405 % to increase or decrease contrast in an image, or to produce the "negative"
3408 % The format of the MagickFunctionImage method is:
3410 % MagickBooleanType MagickFunctionImage(MagickWand *wand,
3411 % const MagickFunction function,const unsigned long number_arguments,
3412 % const double *arguments)
3413 % MagickBooleanType MagickFunctionImageChannel(MagickWand *wand,
3414 % const ChannelType channel,const MagickFunction function,
3415 % const unsigned long number_arguments,const double *arguments)
3417 % A description of each parameter follows:
3419 % o wand: the magick wand.
3421 % o channel: the channel(s).
3423 % o function: the image function.
3425 % o number_arguments: the number of function arguments.
3427 % o arguments: the function arguments.
3431 WandExport MagickBooleanType MagickFunctionImage(MagickWand *wand,
3432 const MagickFunction function,const unsigned long number_arguments,
3433 const double *arguments)
3438 assert(wand != (MagickWand *) NULL);
3439 assert(wand->signature == WandSignature);
3440 if (wand->debug != MagickFalse)
3441 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3442 if (wand->images == (Image *) NULL)
3443 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3444 status=FunctionImage(wand->images,function,number_arguments,arguments,
3445 &wand->images->exception);
3446 if (status == MagickFalse)
3447 InheritException(wand->exception,&wand->images->exception);
3451 WandExport MagickBooleanType MagickFunctionImageChannel(MagickWand *wand,
3452 const ChannelType channel,const MagickFunction function,
3453 const unsigned long number_arguments,const double *arguments)
3458 assert(wand != (MagickWand *) NULL);
3459 assert(wand->signature == WandSignature);
3460 if (wand->debug != MagickFalse)
3461 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3462 if (wand->images == (Image *) NULL)
3463 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3464 status=FunctionImageChannel(wand->images,channel,function,number_arguments,
3465 arguments,&wand->images->exception);
3470 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3474 % M a g i c k F x I m a g e %
3478 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3480 % MagickFxImage() evaluate expression for each pixel in the image.
3482 % The format of the MagickFxImage method is:
3484 % MagickWand *MagickFxImage(MagickWand *wand,const char *expression)
3485 % MagickWand *MagickFxImageChannel(MagickWand *wand,
3486 % const ChannelType channel,const char *expression)
3488 % A description of each parameter follows:
3490 % o wand: the magick wand.
3492 % o channel: the image channel(s).
3494 % o expression: the expression.
3498 WandExport MagickWand *MagickFxImage(MagickWand *wand,const char *expression)
3503 fx_wand=MagickFxImageChannel(wand,DefaultChannels,expression);
3507 WandExport MagickWand *MagickFxImageChannel(MagickWand *wand,
3508 const ChannelType channel,const char *expression)
3513 assert(wand != (MagickWand *) NULL);
3514 assert(wand->signature == WandSignature);
3515 if (wand->debug != MagickFalse)
3516 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3517 if (wand->images == (Image *) NULL)
3518 return((MagickWand *) NULL);
3519 fx_image=FxImageChannel(wand->images,channel,expression,wand->exception);
3520 if (fx_image == (Image *) NULL)
3521 return((MagickWand *) NULL);
3522 return(CloneMagickWandFromImages(wand,fx_image));
3526 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3530 % M a g i c k G a m m a I m a g e %
3534 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3536 % MagickGammaImage() gamma-corrects an image. The same image viewed on
3537 % different devices will have perceptual differences in the way the image's
3538 % intensities are represented on the screen. Specify individual gamma levels
3539 % for the red, green, and blue channels, or adjust all three with the gamma
3540 % parameter. Values typically range from 0.8 to 2.3.
3542 % You can also reduce the influence of a particular channel with a gamma
3545 % The format of the MagickGammaImage method is:
3547 % MagickBooleanType MagickGammaImage(MagickWand *wand,const double gamma)
3548 % MagickBooleanType MagickGammaImageChannel(MagickWand *wand,
3549 % const ChannelType channel,const double gamma)
3551 % A description of each parameter follows:
3553 % o wand: the magick wand.
3555 % o channel: the channel.
3557 % o level: Define the level of gamma correction.
3561 WandExport MagickBooleanType MagickGammaImage(MagickWand *wand,
3567 status=MagickGammaImageChannel(wand,DefaultChannels,gamma);
3571 WandExport MagickBooleanType MagickGammaImageChannel(MagickWand *wand,
3572 const ChannelType channel,const double gamma)
3577 assert(wand != (MagickWand *) NULL);
3578 assert(wand->signature == WandSignature);
3579 if (wand->debug != MagickFalse)
3580 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3581 if (wand->images == (Image *) NULL)
3582 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3583 status=GammaImageChannel(wand->images,channel,gamma);
3584 if (status == MagickFalse)
3585 InheritException(wand->exception,&wand->images->exception);
3590 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3594 % M a g i c k G a u s s i a n B l u r I m a g e %
3598 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3600 % MagickGaussianBlurImage() blurs an image. We convolve the image with a
3601 % Gaussian operator of the given radius and standard deviation (sigma).
3602 % For reasonable results, the radius should be larger than sigma. Use a
3603 % radius of 0 and MagickGaussianBlurImage() selects a suitable radius for you.
3605 % The format of the MagickGaussianBlurImage method is:
3607 % MagickBooleanType MagickGaussianBlurImage(MagickWand *wand,
3608 % const double radius,const double sigma)
3609 % MagickBooleanType MagickGaussianBlurImageChannel(MagickWand *wand,
3610 % const ChannelType channel,const double radius,const double sigma)
3612 % A description of each parameter follows:
3614 % o wand: the magick wand.
3616 % o channel: the image channel(s).
3618 % o radius: the radius of the Gaussian, in pixels, not counting the center
3621 % o sigma: the standard deviation of the Gaussian, in pixels.
3625 WandExport MagickBooleanType MagickGaussianBlurImage(MagickWand *wand,
3626 const double radius,const double sigma)
3631 status=MagickGaussianBlurImageChannel(wand,DefaultChannels,radius,sigma);
3635 WandExport MagickBooleanType MagickGaussianBlurImageChannel(MagickWand *wand,
3636 const ChannelType channel,const double radius,const double sigma)
3641 assert(wand != (MagickWand *) NULL);
3642 assert(wand->signature == WandSignature);
3643 if (wand->debug != MagickFalse)
3644 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3645 if (wand->images == (Image *) NULL)
3646 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3647 blur_image=GaussianBlurImageChannel(wand->images,channel,radius,sigma,
3649 if (blur_image == (Image *) NULL)
3650 return(MagickFalse);
3651 ReplaceImageInList(&wand->images,blur_image);
3656 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3660 % M a g i c k G e t I m a g e %
3664 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3666 % MagickGetImage() gets the image at the current image index.
3668 % The format of the MagickGetImage method is:
3670 % MagickWand *MagickGetImage(MagickWand *wand)
3672 % A description of each parameter follows:
3674 % o wand: the magick wand.
3677 WandExport MagickWand *MagickGetImage(MagickWand *wand)
3682 assert(wand != (MagickWand *) NULL);
3683 assert(wand->signature == WandSignature);
3684 if (wand->debug != MagickFalse)
3685 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3686 if (wand->images == (Image *) NULL)
3688 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3689 "ContainsNoImages","`%s'",wand->name);
3690 return((MagickWand *) NULL);
3692 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
3693 if (image == (Image *) NULL)
3694 return((MagickWand *) NULL);
3695 return(CloneMagickWandFromImages(wand,image));
3699 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3703 % 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 %
3707 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3709 % MagickGetImageAlphaChannel() returns MagickFalse if the image alpha channel
3710 % is not activated. That is, the image is RGB rather than RGBA or CMYK rather
3713 % The format of the MagickGetImageAlphaChannel method is:
3715 % unsigned long MagickGetImageAlphaChannel(MagickWand *wand)
3717 % A description of each parameter follows:
3719 % o wand: the magick wand.
3722 WandExport MagickBooleanType MagickGetImageAlphaChannel(MagickWand *wand)
3724 assert(wand != (MagickWand *) NULL);
3725 assert(wand->signature == WandSignature);
3726 if (wand->debug != MagickFalse)
3727 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3728 if (wand->images == (Image *) NULL)
3729 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3730 return(GetImageAlphaChannel(wand->images));
3734 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3738 % M a g i c k G e t I m a g e C l i p M a s k %
3742 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3744 % MagickGetImageClipMask() gets the image clip mask at the current image index.
3746 % The format of the MagickGetImageClipMask method is:
3748 % MagickWand *MagickGetImageClipMask(MagickWand *wand)
3750 % A description of each parameter follows:
3752 % o wand: the magick wand.
3755 WandExport MagickWand *MagickGetImageClipMask(MagickWand *wand)
3760 assert(wand != (MagickWand *) NULL);
3761 assert(wand->signature == WandSignature);
3762 if (wand->debug != MagickFalse)
3763 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3764 if (wand->images == (Image *) NULL)
3766 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3767 "ContainsNoImages","`%s'",wand->name);
3768 return((MagickWand *) NULL);
3770 image=GetImageClipMask(wand->images,wand->exception);
3771 if (image == (Image *) NULL)
3772 return((MagickWand *) NULL);
3773 return(CloneMagickWandFromImages(wand,image));
3777 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3781 % 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 %
3785 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3787 % MagickGetImageBackgroundColor() returns the image background color.
3789 % The format of the MagickGetImageBackgroundColor method is:
3791 % MagickBooleanType MagickGetImageBackgroundColor(MagickWand *wand,
3792 % PixelWand *background_color)
3794 % A description of each parameter follows:
3796 % o wand: the magick wand.
3798 % o background_color: Return the background color.
3801 WandExport MagickBooleanType MagickGetImageBackgroundColor(MagickWand *wand,
3802 PixelWand *background_color)
3804 assert(wand != (MagickWand *) NULL);
3805 assert(wand->signature == WandSignature);
3806 if (wand->debug != MagickFalse)
3807 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3808 if (wand->images == (Image *) NULL)
3809 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3810 PixelSetQuantumColor(background_color,&wand->images->background_color);
3815 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3819 % M a g i c k G e t I m a g e B l o b %
3823 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3825 % MagickGetImageBlob() implements direct to memory image formats. It
3826 % returns the image as a blob and its length. Use MagickSetFormat() to
3827 % set the format of the returned blob (GIF, JPEG, PNG, etc.).
3829 % Use MagickRelinquishMemory() to free the blob when you are done with it.
3831 % The format of the MagickGetImageBlob method is:
3833 % unsigned char *MagickGetImageBlob(MagickWand *wand,size_t *length)
3835 % A description of each parameter follows:
3837 % o wand: the magick wand.
3839 % o length: the length of the blob.
3842 WandExport unsigned char *MagickGetImageBlob(MagickWand *wand,size_t *length)
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((unsigned char *) NULL);
3854 return(ImageToBlob(wand->image_info,wand->images,length,wand->exception));
3858 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3862 % M a g i c k G e t I m a g e s B l o b %
3866 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3868 % MagickGetImageBlob() implements direct to memory image formats. It
3869 % returns the image sequence as a blob and its length. The format of the image
3870 % determines the format of the returned blob (GIF, JPEG, PNG, etc.). To
3871 % return a different image format, use MagickSetImageFormat().
3873 % Note, some image formats do not permit multiple images to the same image
3874 % stream (e.g. JPEG). in this instance, just the first image of the
3875 % sequence is returned as a blob.
3877 % The format of the MagickGetImagesBlob method is:
3879 % unsigned char *MagickGetImagesBlob(MagickWand *wand,size_t *length)
3881 % A description of each parameter follows:
3883 % o wand: the magick wand.
3885 % o length: the length of the blob.
3888 WandExport unsigned char *MagickGetImagesBlob(MagickWand *wand,size_t *length)
3893 assert(wand != (MagickWand *) NULL);
3894 assert(wand->signature == WandSignature);
3895 if (wand->debug != MagickFalse)
3896 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3897 if (wand->images == (Image *) NULL)
3899 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3900 "ContainsNoImages","`%s'",wand->name);
3901 return((unsigned char *) NULL);
3903 blob=ImagesToBlob(wand->image_info,GetFirstImageInList(wand->images),length,
3909 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3913 % 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 %
3917 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3919 % MagickGetImageBluePrimary() returns the chromaticy blue primary point for the
3922 % The format of the MagickGetImageBluePrimary method is:
3924 % MagickBooleanType MagickGetImageBluePrimary(MagickWand *wand,double *x,
3927 % A description of each parameter follows:
3929 % o wand: the magick wand.
3931 % o x: the chromaticity blue primary x-point.
3933 % o y: the chromaticity blue primary y-point.
3936 WandExport MagickBooleanType MagickGetImageBluePrimary(MagickWand *wand,
3937 double *x,double *y)
3939 assert(wand != (MagickWand *) NULL);
3940 assert(wand->signature == WandSignature);
3941 if (wand->debug != MagickFalse)
3942 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3943 if (wand->images == (Image *) NULL)
3944 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3945 *x=wand->images->chromaticity.blue_primary.x;
3946 *y=wand->images->chromaticity.blue_primary.y;
3951 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3955 % 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 %
3959 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3961 % MagickGetImageBorderColor() returns the image border color.
3963 % The format of the MagickGetImageBorderColor method is:
3965 % MagickBooleanType MagickGetImageBorderColor(MagickWand *wand,
3966 % PixelWand *border_color)
3968 % A description of each parameter follows:
3970 % o wand: the magick wand.
3972 % o border_color: Return the border color.
3975 WandExport MagickBooleanType MagickGetImageBorderColor(MagickWand *wand,
3976 PixelWand *border_color)
3978 assert(wand != (MagickWand *) NULL);
3979 assert(wand->signature == WandSignature);
3980 if (wand->debug != MagickFalse)
3981 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3982 if (wand->images == (Image *) NULL)
3983 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3984 PixelSetQuantumColor(border_color,&wand->images->border_color);
3989 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3993 % 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 %
3997 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3999 % MagickGetImageChannelDepth() gets the depth for one or more image channels.
4001 % The format of the MagickGetImageChannelDepth method is:
4003 % unsigned long MagickGetImageChannelDepth(MagickWand *wand,
4004 % const ChannelType channel)
4006 % A description of each parameter follows:
4008 % o wand: the magick wand.
4010 % o channel: the image channel(s).
4013 WandExport unsigned long MagickGetImageChannelDepth(MagickWand *wand,
4014 const ChannelType channel)
4016 assert(wand != (MagickWand *) NULL);
4017 assert(wand->signature == WandSignature);
4018 if (wand->debug != MagickFalse)
4019 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4020 if (wand->images == (Image *) NULL)
4021 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4022 return(GetImageChannelDepth(wand->images,channel,wand->exception));
4026 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4030 % 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 %
4034 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4036 % MagickGetImageChannelDistortion() compares one or more image channels of an
4037 % image to a reconstructed image and returns the specified distortion metric.
4039 % The format of the MagickGetImageChannelDistortion method is:
4041 % MagickBooleanType MagickGetImageChannelDistortion(MagickWand *wand,
4042 % const MagickWand *reference,const ChannelType channel,
4043 % const MetricType metric,double *distortion)
4045 % A description of each parameter follows:
4047 % o wand: the magick wand.
4049 % o reference: the reference wand.
4051 % o channel: the channel.
4053 % o metric: the metric.
4055 % o distortion: the computed distortion between the images.
4058 WandExport MagickBooleanType MagickGetImageChannelDistortion(MagickWand *wand,
4059 const MagickWand *reference,const ChannelType channel,const MetricType metric,
4065 assert(wand != (MagickWand *) NULL);
4066 assert(wand->signature == WandSignature);
4067 if (wand->debug != MagickFalse)
4068 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4069 assert(reference != (MagickWand *) NULL);
4070 assert(reference->signature == WandSignature);
4071 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
4072 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4073 status=GetImageChannelDistortion(wand->images,reference->images,channel,
4074 metric,distortion,&wand->images->exception);
4079 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4083 % 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 %
4087 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4089 % MagickGetImageChannelDistortions() compares one or more image channels of an
4090 % image to a reconstructed image and returns the specified distortion metrics.
4092 % Use MagickRelinquishMemory() to free the metrics when you are done with them.
4094 % The format of the MagickGetImageChannelDistortion method is:
4096 % double *MagickGetImageChannelDistortion(MagickWand *wand,
4097 % const MagickWand *reference,const MetricType metric)
4099 % A description of each parameter follows:
4101 % o wand: the magick wand.
4103 % o reference: the reference wand.
4105 % o metric: the metric.
4108 WandExport double *MagickGetImageChannelDistortions(MagickWand *wand,
4109 const MagickWand *reference,const MetricType metric)
4112 *channel_distortion;
4114 assert(wand != (MagickWand *) NULL);
4115 assert(wand->signature == WandSignature);
4116 if (wand->debug != MagickFalse)
4117 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4118 assert(reference != (MagickWand *) NULL);
4119 assert(reference->signature == WandSignature);
4120 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
4122 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4123 "ContainsNoImages","`%s'",wand->name);
4124 return((double *) NULL);
4126 channel_distortion=GetImageChannelDistortions(wand->images,reference->images,
4127 metric,&wand->images->exception);
4128 return(channel_distortion);
4132 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4136 % 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 %
4140 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4142 % MagickGetImageChannelMean() gets the mean and standard deviation of one or
4143 % more image channels.
4145 % The format of the MagickGetImageChannelMean method is:
4147 % MagickBooleanType MagickGetImageChannelMean(MagickWand *wand,
4148 % const ChannelType channel,double *mean,double *standard_deviation)
4150 % A description of each parameter follows:
4152 % o wand: the magick wand.
4154 % o channel: the image channel(s).
4156 % o mean: The mean pixel value for the specified channel(s).
4158 % o standard_deviation: The standard deviation for the specified channel(s).
4161 WandExport MagickBooleanType MagickGetImageChannelMean(MagickWand *wand,
4162 const ChannelType channel,double *mean,double *standard_deviation)
4167 assert(wand != (MagickWand *) NULL);
4168 assert(wand->signature == WandSignature);
4169 if (wand->debug != MagickFalse)
4170 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4171 if (wand->images == (Image *) NULL)
4172 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4173 status=GetImageChannelMean(wand->images,channel,mean,standard_deviation,
4179 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4183 % 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 %
4187 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4189 % MagickGetImageChannelKurtosis() gets the kurtosis and skewness of one or
4190 % more image channels.
4192 % The format of the MagickGetImageChannelKurtosis method is:
4194 % MagickBooleanType MagickGetImageChannelKurtosis(MagickWand *wand,
4195 % const ChannelType channel,double *kurtosis,double *skewness)
4197 % A description of each parameter follows:
4199 % o wand: the magick wand.
4201 % o channel: the image channel(s).
4203 % o kurtosis: The kurtosis for the specified channel(s).
4205 % o skewness: The skewness for the specified channel(s).
4208 WandExport MagickBooleanType MagickGetImageChannelKurtosis(MagickWand *wand,
4209 const ChannelType channel,double *kurtosis,double *skewness)
4214 assert(wand != (MagickWand *) NULL);
4215 assert(wand->signature == WandSignature);
4216 if (wand->debug != MagickFalse)
4217 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4218 if (wand->images == (Image *) NULL)
4219 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4220 status=GetImageChannelKurtosis(wand->images,channel,kurtosis,skewness,
4226 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4230 % 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 %
4234 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4236 % MagickGetImageChannelRange() gets the range for one or more image channels.
4238 % The format of the MagickGetImageChannelRange method is:
4240 % MagickBooleanType MagickGetImageChannelRange(MagickWand *wand,
4241 % const ChannelType channel,double *minima,double *maxima)
4243 % A description of each parameter follows:
4245 % o wand: the magick wand.
4247 % o channel: the image channel(s).
4249 % o minima: The minimum pixel value for the specified channel(s).
4251 % o maxima: The maximum pixel value for the specified channel(s).
4254 WandExport MagickBooleanType MagickGetImageChannelRange(MagickWand *wand,
4255 const ChannelType channel,double *minima,double *maxima)
4260 assert(wand != (MagickWand *) NULL);
4261 assert(wand->signature == WandSignature);
4262 if (wand->debug != MagickFalse)
4263 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4264 if (wand->images == (Image *) NULL)
4265 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4266 status=GetImageChannelRange(wand->images,channel,minima,maxima,
4272 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4276 % 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 %
4280 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4282 % MagickGetImageChannelStatistics() returns statistics for each channel in the
4283 % image. The statistics include the channel depth, its minima and
4284 % maxima, the mean, the standard deviation, the kurtosis and the skewness.
4285 % You can access the red channel mean, for example, like this:
4287 % channel_statistics=MagickGetImageChannelStatistics(image,excepton);
4288 % red_mean=channel_statistics[RedChannel].mean;
4290 % Use MagickRelinquishMemory() to free the statistics buffer.
4292 % The format of the MagickGetImageChannelStatistics method is:
4294 % ChannelStatistics *MagickGetImageChannelStatistics(MagickWand *wand)
4296 % A description of each parameter follows:
4298 % o wand: the magick wand.
4301 WandExport ChannelStatistics *MagickGetImageChannelStatistics(MagickWand *wand)
4303 assert(wand != (MagickWand *) NULL);
4304 assert(wand->signature == WandSignature);
4305 if (wand->debug != MagickFalse)
4306 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4307 if (wand->images == (Image *) NULL)
4309 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4310 "ContainsNoImages","`%s'",wand->name);
4311 return((ChannelStatistics *) NULL);
4313 return(GetImageChannelStatistics(wand->images,wand->exception));
4317 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4321 % 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 %
4325 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4327 % MagickGetImageColormapColor() returns the color of the specified colormap
4330 % The format of the MagickGetImageColormapColor method is:
4332 % MagickBooleanType MagickGetImageColormapColor(MagickWand *wand,
4333 % const unsigned long index,PixelWand *color)
4335 % A description of each parameter follows:
4337 % o wand: the magick wand.
4339 % o index: the offset into the image colormap.
4341 % o color: Return the colormap color in this wand.
4344 WandExport MagickBooleanType MagickGetImageColormapColor(MagickWand *wand,
4345 const unsigned long index,PixelWand *color)
4347 assert(wand != (MagickWand *) NULL);
4348 assert(wand->signature == WandSignature);
4349 if (wand->debug != MagickFalse)
4350 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4351 if (wand->images == (Image *) NULL)
4352 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4353 if ((wand->images->colormap == (PixelPacket *) NULL) ||
4354 (index >= wand->images->colors))
4356 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4357 "InvalidColormapIndex","`%s'",wand->name);
4358 return(MagickFalse);
4360 PixelSetQuantumColor(color,wand->images->colormap+index);
4365 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4369 % M a g i c k G e t I m a g e C o l o r s %
4373 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4375 % MagickGetImageColors() gets the number of unique colors in the image.
4377 % The format of the MagickGetImageColors method is:
4379 % unsigned long MagickGetImageColors(MagickWand *wand)
4381 % A description of each parameter follows:
4383 % o wand: the magick wand.
4386 WandExport unsigned long MagickGetImageColors(MagickWand *wand)
4388 assert(wand != (MagickWand *) NULL);
4389 assert(wand->signature == WandSignature);
4390 if (wand->debug != MagickFalse)
4391 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4392 if (wand->images == (Image *) NULL)
4394 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4395 "ContainsNoImages","`%s'",wand->name);
4398 return(GetNumberColors(wand->images,(FILE *) NULL,wand->exception));
4402 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4406 % M a g i c k G e t I m a g e C o l o r s p a c e %
4410 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4412 % MagickGetImageColorspace() gets the image colorspace.
4414 % The format of the MagickGetImageColorspace method is:
4416 % ColorspaceType MagickGetImageColorspace(MagickWand *wand)
4418 % A description of each parameter follows:
4420 % o wand: the magick wand.
4423 WandExport ColorspaceType MagickGetImageColorspace(MagickWand *wand)
4425 assert(wand != (MagickWand *) NULL);
4426 assert(wand->signature == WandSignature);
4427 if (wand->debug != MagickFalse)
4428 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4429 if (wand->images == (Image *) NULL)
4431 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4432 "ContainsNoImages","`%s'",wand->name);
4433 return(UndefinedColorspace);
4435 return(wand->images->colorspace);
4439 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4443 % M a g i c k G e t I m a g e C o m p o s e %
4447 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4449 % MagickGetImageCompose() returns the composite operator associated with the
4452 % The format of the MagickGetImageCompose method is:
4454 % CompositeOperator MagickGetImageCompose(MagickWand *wand)
4456 % A description of each parameter follows:
4458 % o wand: the magick wand.
4461 WandExport CompositeOperator MagickGetImageCompose(MagickWand *wand)
4463 assert(wand != (MagickWand *) NULL);
4464 assert(wand->signature == WandSignature);
4465 if (wand->debug != MagickFalse)
4466 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4467 if (wand->images == (Image *) NULL)
4469 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4470 "ContainsNoImages","`%s'",wand->name);
4471 return(UndefinedCompositeOp);
4473 return(wand->images->compose);
4477 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4481 % 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 %
4485 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4487 % MagickGetImageCompression() gets the image compression.
4489 % The format of the MagickGetImageCompression method is:
4491 % CompressionType MagickGetImageCompression(MagickWand *wand)
4493 % A description of each parameter follows:
4495 % o wand: the magick wand.
4498 WandExport CompressionType MagickGetImageCompression(MagickWand *wand)
4500 assert(wand != (MagickWand *) NULL);
4501 assert(wand->signature == WandSignature);
4502 if (wand->debug != MagickFalse)
4503 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4504 if (wand->images == (Image *) NULL)
4506 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4507 "ContainsNoImages","`%s'",wand->name);
4508 return(UndefinedCompression);
4510 return(wand->images->compression);
4514 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4518 % 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 %
4522 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4524 % MagickGetImageCompression() gets the image compression quality.
4526 % The format of the MagickGetImageCompression method is:
4528 % unsigned long MagickGetImageCompression(MagickWand *wand)
4530 % A description of each parameter follows:
4532 % o wand: the magick wand.
4535 WandExport unsigned long MagickGetImageCompressionQuality(MagickWand *wand)
4537 assert(wand != (MagickWand *) NULL);
4538 assert(wand->signature == WandSignature);
4539 if (wand->debug != MagickFalse)
4540 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4541 if (wand->images == (Image *) NULL)
4543 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4544 "ContainsNoImages","`%s'",wand->name);
4547 return(wand->images->quality);
4551 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4555 % M a g i c k G e t I m a g e D e l a y %
4559 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4561 % MagickGetImageDelay() gets the image delay.
4563 % The format of the MagickGetImageDelay method is:
4565 % unsigned long MagickGetImageDelay(MagickWand *wand)
4567 % A description of each parameter follows:
4569 % o wand: the magick wand.
4572 WandExport unsigned long MagickGetImageDelay(MagickWand *wand)
4574 assert(wand != (MagickWand *) NULL);
4575 assert(wand->signature == WandSignature);
4576 if (wand->debug != MagickFalse)
4577 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4578 if (wand->images == (Image *) NULL)
4579 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4580 return(wand->images->delay);
4584 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4588 % M a g i c k G e t I m a g e D e p t h %
4592 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4594 % MagickGetImageDepth() gets the image depth.
4596 % The format of the MagickGetImageDepth method is:
4598 % unsigned long MagickGetImageDepth(MagickWand *wand)
4600 % A description of each parameter follows:
4602 % o wand: the magick wand.
4605 WandExport unsigned long MagickGetImageDepth(MagickWand *wand)
4607 assert(wand != (MagickWand *) NULL);
4608 assert(wand->signature == WandSignature);
4609 if (wand->debug != MagickFalse)
4610 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4611 if (wand->images == (Image *) NULL)
4612 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4613 return(wand->images->depth);
4617 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4621 % M a g i c k G e t I m a g e D i s t o r t i o n %
4625 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4627 % MagickGetImageDistortion() compares an image to a reconstructed image and
4628 % returns the specified distortion metric.
4630 % The format of the MagickGetImageDistortion method is:
4632 % MagickBooleanType MagickGetImageDistortion(MagickWand *wand,
4633 % const MagickWand *reference,const MetricType metric,
4634 % double *distortion)
4636 % A description of each parameter follows:
4638 % o wand: the magick wand.
4640 % o reference: the reference wand.
4642 % o metric: the metric.
4644 % o distortion: the computed distortion between the images.
4647 WandExport MagickBooleanType MagickGetImageDistortion(MagickWand *wand,
4648 const MagickWand *reference,const MetricType metric,double *distortion)
4654 assert(wand != (MagickWand *) NULL);
4655 assert(wand->signature == WandSignature);
4656 if (wand->debug != MagickFalse)
4657 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4658 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
4659 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4660 status=GetImageDistortion(wand->images,reference->images,metric,distortion,
4661 &wand->images->exception);
4666 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4670 % M a g i c k G e t I m a g e D i s p o s e %
4674 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4676 % MagickGetImageDispose() gets the image disposal method.
4678 % The format of the MagickGetImageDispose method is:
4680 % DisposeType MagickGetImageDispose(MagickWand *wand)
4682 % A description of each parameter follows:
4684 % o wand: the magick wand.
4687 WandExport DisposeType MagickGetImageDispose(MagickWand *wand)
4689 assert(wand != (MagickWand *) NULL);
4690 assert(wand->signature == WandSignature);
4691 if (wand->debug != MagickFalse)
4692 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4693 if (wand->images == (Image *) NULL)
4695 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4696 "ContainsNoImages","`%s'",wand->name);
4697 return(UndefinedDispose);
4699 return((DisposeType) wand->images->dispose);
4703 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4707 % M a g i c k G e t I m a g e F i l e n a m e %
4711 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4713 % MagickGetImageFilename() returns the filename of a particular image in a
4716 % The format of the MagickGetImageFilename method is:
4718 % char *MagickGetImageFilename(MagickWand *wand)
4720 % A description of each parameter follows:
4722 % o wand: the magick wand.
4725 WandExport char *MagickGetImageFilename(MagickWand *wand)
4727 assert(wand != (MagickWand *) NULL);
4728 assert(wand->signature == WandSignature);
4729 if (wand->debug != MagickFalse)
4730 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4731 if (wand->images == (Image *) NULL)
4733 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4734 "ContainsNoImages","`%s'",wand->name);
4735 return((char *) NULL);
4737 return(AcquireString(wand->images->filename));
4741 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4745 % M a g i c k G e t I m a g e F o r m a t %
4749 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4751 % MagickGetImageFormat() returns the format of a particular image in a
4754 % The format of the MagickGetImageFormat method is:
4756 % const char MagickGetImageFormat(MagickWand *wand)
4758 % A description of each parameter follows:
4760 % o wand: the magick wand.
4763 WandExport char *MagickGetImageFormat(MagickWand *wand)
4765 assert(wand != (MagickWand *) NULL);
4766 assert(wand->signature == WandSignature);
4767 if (wand->debug != MagickFalse)
4768 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4769 if (wand->images == (Image *) NULL)
4771 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4772 "ContainsNoImages","`%s'",wand->name);
4773 return((char *) NULL);
4775 return(AcquireString(wand->images->magick));
4779 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4783 % M a g i c k G e t I m a g e F u z z %
4787 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4789 % MagickGetImageFuzz() gets the image fuzz.
4791 % The format of the MagickGetImageFuzz method is:
4793 % double MagickGetImageFuzz(MagickWand *wand)
4795 % A description of each parameter follows:
4797 % o wand: the magick wand.
4800 WandExport double MagickGetImageFuzz(MagickWand *wand)
4802 assert(wand != (MagickWand *) NULL);
4803 assert(wand->signature == WandSignature);
4804 if (wand->debug != MagickFalse)
4805 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4806 if (wand->images == (Image *) NULL)
4808 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4809 "ContainsNoImages","`%s'",wand->name);
4812 return(wand->images->fuzz);
4816 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4820 % M a g i c k G e t I m a g e G a m m a %
4824 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4826 % MagickGetImageGamma() gets the image gamma.
4828 % The format of the MagickGetImageGamma method is:
4830 % double MagickGetImageGamma(MagickWand *wand)
4832 % A description of each parameter follows:
4834 % o wand: the magick wand.
4837 WandExport double MagickGetImageGamma(MagickWand *wand)
4839 assert(wand != (MagickWand *) NULL);
4840 assert(wand->signature == WandSignature);
4841 if (wand->debug != MagickFalse)
4842 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4843 if (wand->images == (Image *) NULL)
4845 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4846 "ContainsNoImages","`%s'",wand->name);
4849 return(wand->images->gamma);
4853 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4857 % 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 %
4861 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4863 % MagickGetImageGravity() gets the image gravity.
4865 % The format of the MagickGetImageGravity method is:
4867 % GravityType MagickGetImageGravity(MagickWand *wand)
4869 % A description of each parameter follows:
4871 % o wand: the magick wand.
4874 WandExport GravityType MagickGetImageGravity(MagickWand *wand)
4876 assert(wand != (MagickWand *) NULL);
4877 assert(wand->signature == WandSignature);
4878 if (wand->debug != MagickFalse)
4879 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4880 if (wand->images == (Image *) NULL)
4882 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4883 "ContainsNoImages","`%s'",wand->name);
4884 return(UndefinedGravity);
4886 return(wand->images->gravity);
4890 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4894 % 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 %
4898 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4900 % MagickGetImageGreenPrimary() returns the chromaticy green primary point.
4902 % The format of the MagickGetImageGreenPrimary method is:
4904 % MagickBooleanType MagickGetImageGreenPrimary(MagickWand *wand,double *x,
4907 % A description of each parameter follows:
4909 % o wand: the magick wand.
4911 % o x: the chromaticity green primary x-point.
4913 % o y: the chromaticity green primary y-point.
4916 WandExport MagickBooleanType MagickGetImageGreenPrimary(MagickWand *wand,
4917 double *x,double *y)
4919 assert(wand != (MagickWand *) NULL);
4920 assert(wand->signature == WandSignature);
4921 if (wand->debug != MagickFalse)
4922 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4923 if (wand->images == (Image *) NULL)
4924 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4925 *x=wand->images->chromaticity.green_primary.x;
4926 *y=wand->images->chromaticity.green_primary.y;
4931 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4935 % M a g i c k G e t I m a g e H e i g h t %
4939 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4941 % MagickGetImageHeight() returns the image height.
4943 % The format of the MagickGetImageHeight method is:
4945 % unsigned long MagickGetImageHeight(MagickWand *wand)
4947 % A description of each parameter follows:
4949 % o wand: the magick wand.
4952 WandExport unsigned long MagickGetImageHeight(MagickWand *wand)
4954 assert(wand != (MagickWand *) NULL);
4955 assert(wand->signature == WandSignature);
4956 if (wand->debug != MagickFalse)
4957 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4958 if (wand->images == (Image *) NULL)
4959 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4960 return(wand->images->rows);
4964 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4968 % M a g i c k G e t I m a g e H i s t o g r a m %
4972 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4974 % MagickGetImageHistogram() returns the image histogram as an array of
4977 % The format of the MagickGetImageHistogram method is:
4979 % PixelWand **MagickGetImageHistogram(MagickWand *wand,
4980 % unsigned long *number_colors)
4982 % A description of each parameter follows:
4984 % o wand: the magick wand.
4986 % o number_colors: the number of unique colors in the image and the number
4987 % of pixel wands returned.
4990 WandExport PixelWand **MagickGetImageHistogram(MagickWand *wand,
4991 unsigned long *number_colors)
5002 assert(wand != (MagickWand *) NULL);
5003 assert(wand->signature == WandSignature);
5004 if (wand->debug != MagickFalse)
5005 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5006 if (wand->images == (Image *) NULL)
5008 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5009 "ContainsNoImages","`%s'",wand->name);
5010 return((PixelWand **) NULL);
5012 histogram=GetImageHistogram(wand->images,number_colors,wand->exception);
5013 if (histogram == (ColorPacket *) NULL)
5014 return((PixelWand **) NULL);
5015 pixel_wands=NewPixelWands(*number_colors);
5016 for (i=0; i < (long) *number_colors; i++)
5018 PixelSetQuantumColor(pixel_wands[i],&histogram[i].pixel);
5019 PixelSetIndex(pixel_wands[i],histogram[i].index);
5020 PixelSetColorCount(pixel_wands[i],(unsigned long) histogram[i].count);
5022 histogram=(ColorPacket *) RelinquishMagickMemory(histogram);
5023 return(pixel_wands);
5027 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5031 % 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 %
5035 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5037 % MagickGetImageInterlaceScheme() gets the image interlace scheme.
5039 % The format of the MagickGetImageInterlaceScheme method is:
5041 % InterlaceType MagickGetImageInterlaceScheme(MagickWand *wand)
5043 % A description of each parameter follows:
5045 % o wand: the magick wand.
5048 WandExport InterlaceType MagickGetImageInterlaceScheme(MagickWand *wand)
5050 assert(wand != (MagickWand *) NULL);
5051 assert(wand->signature == WandSignature);
5052 if (wand->debug != MagickFalse)
5053 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5054 if (wand->images == (Image *) NULL)
5056 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5057 "ContainsNoImages","`%s'",wand->name);
5058 return(UndefinedInterlace);
5060 return(wand->images->interlace);
5064 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5068 % 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 %
5072 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5074 % MagickGetImageInterpolateMethod() returns the interpolation method for the
5077 % The format of the MagickGetImageInterpolateMethod method is:
5079 % InterpolatePixelMethod MagickGetImageInterpolateMethod(MagickWand *wand)
5081 % A description of each parameter follows:
5083 % o wand: the magick wand.
5086 WandExport InterpolatePixelMethod MagickGetImageInterpolateMethod(
5089 assert(wand != (MagickWand *) NULL);
5090 assert(wand->signature == WandSignature);
5091 if (wand->debug != MagickFalse)
5092 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5093 if (wand->images == (Image *) NULL)
5095 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5096 "ContainsNoImages","`%s'",wand->name);
5097 return(UndefinedInterpolatePixel);
5099 return(wand->images->interpolate);
5103 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5107 % M a g i c k G e t I m a g e I t e r a t i o n s %
5111 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5113 % MagickGetImageIterations() gets the image iterations.
5115 % The format of the MagickGetImageIterations method is:
5117 % unsigned long MagickGetImageIterations(MagickWand *wand)
5119 % A description of each parameter follows:
5121 % o wand: the magick wand.
5124 WandExport unsigned long MagickGetImageIterations(MagickWand *wand)
5126 assert(wand != (MagickWand *) NULL);
5127 assert(wand->signature == WandSignature);
5128 if (wand->debug != MagickFalse)
5129 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5130 if (wand->images == (Image *) NULL)
5131 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5132 return(wand->images->iterations);
5136 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5140 % M a g i c k G e t I m a g e L e n g t h %
5144 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5146 % MagickGetImageLength() returns the image length in bytes.
5148 % The format of the MagickGetImageLength method is:
5150 % MagickBooleanType MagickGetImageLength(MagickWand *wand,
5151 % MagickSizeType *length)
5153 % A description of each parameter follows:
5155 % o wand: the magick wand.
5157 % o length: the image length in bytes.
5160 WandExport MagickBooleanType MagickGetImageLength(MagickWand *wand,
5161 MagickSizeType *length)
5163 assert(wand != (MagickWand *) NULL);
5164 assert(wand->signature == WandSignature);
5165 if (wand->debug != MagickFalse)
5166 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5167 if (wand->images == (Image *) NULL)
5168 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5169 *length=GetBlobSize(wand->images);
5174 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5178 % M a g i c k G e t I m a g e M a t t e C o l o r %
5182 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5184 % MagickGetImageMatteColor() returns the image matte color.
5186 % The format of the MagickGetImageMatteColor method is:
5188 % MagickBooleanType MagickGetImagematteColor(MagickWand *wand,
5189 % PixelWand *matte_color)
5191 % A description of each parameter follows:
5193 % o wand: the magick wand.
5195 % o matte_color: Return the matte color.
5198 WandExport MagickBooleanType MagickGetImageMatteColor(MagickWand *wand,
5199 PixelWand *matte_color)
5201 assert(wand != (MagickWand *) NULL);
5202 assert(wand->signature == WandSignature);
5203 if (wand->debug != MagickFalse)
5204 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5205 if (wand->images == (Image *) NULL)
5206 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5207 PixelSetQuantumColor(matte_color,&wand->images->matte_color);
5212 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5216 % 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 %
5220 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5222 % MagickGetImageOrientation() returns the image orientation.
5224 % The format of the MagickGetImageOrientation method is:
5226 % OrientationType MagickGetImageOrientation(MagickWand *wand)
5228 % A description of each parameter follows:
5230 % o wand: the magick wand.
5233 WandExport OrientationType MagickGetImageOrientation(MagickWand *wand)
5235 assert(wand != (MagickWand *) NULL);
5236 assert(wand->signature == WandSignature);
5237 if (wand->debug != MagickFalse)
5238 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5239 if (wand->images == (Image *) NULL)
5241 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5242 "ContainsNoImages","`%s'",wand->name);
5243 return(UndefinedOrientation);
5245 return(wand->images->orientation);
5249 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5253 % M a g i c k G e t I m a g e P a g e %
5257 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5259 % MagickGetImagePage() returns the page geometry associated with the image.
5261 % The format of the MagickGetImagePage method is:
5263 % MagickBooleanType MagickGetImagePage(MagickWand *wand,
5264 % unsigned long *width,unsigned long *height,long *x,long *y)
5266 % A description of each parameter follows:
5268 % o wand: the magick wand.
5270 % o width: the page width.
5272 % o height: the page height.
5274 % o x: the page x-offset.
5276 % o y: the page y-offset.
5279 WandExport MagickBooleanType MagickGetImagePage(MagickWand *wand,
5280 unsigned long *width,unsigned long *height,long *x,long *y)
5282 assert(wand != (const MagickWand *) NULL);
5283 assert(wand->signature == WandSignature);
5284 if (wand->debug != MagickFalse)
5285 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5286 if (wand->images == (Image *) NULL)
5287 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5288 *width=wand->images->page.width;
5289 *height=wand->images->page.height;
5290 *x=wand->images->page.x;
5291 *y=wand->images->page.y;
5296 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5300 % M a g i c k G e t I m a g e P i x e l C o l o r %
5304 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5306 % MagickGetImagePixelColor() returns the color of the specified pixel.
5308 % The format of the MagickGetImagePixelColor method is:
5310 % MagickBooleanType MagickGetImagePixelColor(MagickWand *wand,
5311 % const long x,const long y,PixelWand *color)
5313 % A description of each parameter follows:
5315 % o wand: the magick wand.
5317 % o x,y: the pixel offset into the image.
5319 % o color: Return the colormap color in this wand.
5322 WandExport MagickBooleanType MagickGetImagePixelColor(MagickWand *wand,
5323 const long x,const long y,PixelWand *color)
5328 register const PixelPacket
5334 assert(wand != (MagickWand *) NULL);
5335 assert(wand->signature == WandSignature);
5336 if (wand->debug != MagickFalse)
5337 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5338 if (wand->images == (Image *) NULL)
5339 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5340 image_view=AcquireCacheView(wand->images);
5341 p=GetCacheViewVirtualPixels(image_view,x,y,1,1,wand->exception);
5342 if (p == (const PixelPacket *) NULL)
5344 image_view=DestroyCacheView(image_view);
5345 return(MagickFalse);
5347 indexes=GetCacheViewAuthenticIndexQueue(image_view);
5348 PixelSetQuantumColor(color,p);
5349 if (GetCacheViewColorspace(image_view) == CMYKColorspace)
5350 PixelSetBlackQuantum(color,*indexes);
5352 if (GetCacheViewStorageClass(image_view) == PseudoClass)
5353 PixelSetIndex(color,*indexes);
5354 image_view=DestroyCacheView(image_view);
5359 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5363 + M a g i c k G e t I m a g e R a n g e %
5367 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5369 % MagickGetImageRange() gets the pixel range for the image.
5371 % The format of the MagickGetImageRange method is:
5373 % MagickBooleanType MagickGetImageRange(MagickWand *wand,double *minima,
5376 % A description of each parameter follows:
5378 % o wand: the magick wand.
5380 % o minima: The minimum pixel value for the specified channel(s).
5382 % o maxima: The maximum pixel value for the specified channel(s).
5385 WandExport MagickBooleanType MagickGetImageRange(MagickWand *wand,
5386 double *minima,double *maxima)
5391 assert(wand != (MagickWand *) NULL);
5392 assert(wand->signature == WandSignature);
5393 if (wand->debug != MagickFalse)
5394 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5395 if (wand->images == (Image *) NULL)
5396 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5397 status=GetImageRange(wand->images,minima,maxima,wand->exception);
5402 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5406 % M a g i c k G e t I m a g e R e d P r i m a r y %
5410 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5412 % MagickGetImageRedPrimary() returns the chromaticy red primary point.
5414 % The format of the MagickGetImageRedPrimary method is:
5416 % MagickBooleanType MagickGetImageRedPrimary(MagickWand *wand,double *x,
5419 % A description of each parameter follows:
5421 % o wand: the magick wand.
5423 % o x: the chromaticity red primary x-point.
5425 % o y: the chromaticity red primary y-point.
5428 WandExport MagickBooleanType MagickGetImageRedPrimary(MagickWand *wand,
5429 double *x,double *y)
5431 assert(wand != (MagickWand *) NULL);
5432 assert(wand->signature == WandSignature);
5433 if (wand->debug != MagickFalse)
5434 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5435 if (wand->images == (Image *) NULL)
5436 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5437 *x=wand->images->chromaticity.red_primary.x;
5438 *y=wand->images->chromaticity.red_primary.y;
5443 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5447 % M a g i c k G e t I m a g e R e g i o n %
5451 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5453 % MagickGetImageRegion() extracts a region of the image and returns it as a
5456 % The format of the MagickGetImageRegion method is:
5458 % MagickWand *MagickGetImageRegion(MagickWand *wand,
5459 % const unsigned long width,const unsigned long height,const long x,
5462 % A description of each parameter follows:
5464 % o wand: the magick wand.
5466 % o width: the region width.
5468 % o height: the region height.
5470 % o x: the region x offset.
5472 % o y: the region y offset.
5475 WandExport MagickWand *MagickGetImageRegion(MagickWand *wand,
5476 const unsigned long width,const unsigned long height,const long x,
5485 assert(wand != (MagickWand *) NULL);
5486 assert(wand->signature == WandSignature);
5487 if (wand->debug != MagickFalse)
5488 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5489 if (wand->images == (Image *) NULL)
5490 return((MagickWand *) NULL);
5492 region.height=height;
5495 region_image=CropImage(wand->images,®ion,wand->exception);
5496 if (region_image == (Image *) NULL)
5497 return((MagickWand *) NULL);
5498 return(CloneMagickWandFromImages(wand,region_image));
5502 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5506 % 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 %
5510 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5512 % MagickGetImageRenderingIntent() gets the image rendering intent.
5514 % The format of the MagickGetImageRenderingIntent method is:
5516 % RenderingIntent MagickGetImageRenderingIntent(MagickWand *wand)
5518 % A description of each parameter follows:
5520 % o wand: the magick wand.
5523 WandExport RenderingIntent MagickGetImageRenderingIntent(MagickWand *wand)
5525 assert(wand != (MagickWand *) NULL);
5526 assert(wand->signature == WandSignature);
5527 if (wand->debug != MagickFalse)
5528 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5529 if (wand->images == (Image *) NULL)
5531 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5532 "ContainsNoImages","`%s'",wand->name);
5533 return(UndefinedIntent);
5535 return((RenderingIntent) wand->images->rendering_intent);
5539 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5543 % M a g i c k G e t I m a g e R e s o l u t i o n %
5547 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5549 % MagickGetImageResolution() gets the image X and Y resolution.
5551 % The format of the MagickGetImageResolution method is:
5553 % MagickBooleanType MagickGetImageResolution(MagickWand *wand,double *x,
5556 % A description of each parameter follows:
5558 % o wand: the magick wand.
5560 % o x: the image x-resolution.
5562 % o y: the image y-resolution.
5565 WandExport MagickBooleanType MagickGetImageResolution(MagickWand *wand,
5566 double *x,double *y)
5568 assert(wand != (MagickWand *) NULL);
5569 assert(wand->signature == WandSignature);
5570 if (wand->debug != MagickFalse)
5571 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5572 if (wand->images == (Image *) NULL)
5573 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5574 *x=wand->images->x_resolution;
5575 *y=wand->images->y_resolution;
5580 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5584 % M a g i c k G e t I m a g e S c e n e %
5588 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5590 % MagickGetImageScene() gets the image scene.
5592 % The format of the MagickGetImageScene method is:
5594 % unsigned long MagickGetImageScene(MagickWand *wand)
5596 % A description of each parameter follows:
5598 % o wand: the magick wand.
5601 WandExport unsigned long MagickGetImageScene(MagickWand *wand)
5603 assert(wand != (MagickWand *) NULL);
5604 assert(wand->signature == WandSignature);
5605 if (wand->debug != MagickFalse)
5606 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5607 if (wand->images == (Image *) NULL)
5608 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5609 return(wand->images->scene);
5613 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5617 % M a g i c k G e t I m a g e S i g n a t u r e %
5621 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5623 % MagickGetImageSignature() generates an SHA-256 message digest for the image
5626 % The format of the MagickGetImageSignature method is:
5628 % const char MagickGetImageSignature(MagickWand *wand)
5630 % A description of each parameter follows:
5632 % o wand: the magick wand.
5635 WandExport char *MagickGetImageSignature(MagickWand *wand)
5643 assert(wand != (MagickWand *) NULL);
5644 assert(wand->signature == WandSignature);
5645 if (wand->debug != MagickFalse)
5646 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5647 if (wand->images == (Image *) NULL)
5649 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5650 "ContainsNoImages","`%s'",wand->name);
5651 return((char *) NULL);
5653 status=SignatureImage(wand->images);
5654 if (status == MagickFalse)
5655 InheritException(wand->exception,&wand->images->exception);
5656 value=GetImageProperty(wand->images,"signature");
5657 if (value != (const char *) NULL)
5658 return(AcquireString(value));
5659 InheritException(wand->exception,&wand->images->exception);
5660 return((char *) NULL);
5664 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5668 % 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 %
5672 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5674 % MagickGetImageTicksPerSecond() gets the image ticks-per-second.
5676 % The format of the MagickGetImageTicksPerSecond method is:
5678 % unsigned long MagickGetImageTicksPerSecond(MagickWand *wand)
5680 % A description of each parameter follows:
5682 % o wand: the magick wand.
5685 WandExport unsigned long MagickGetImageTicksPerSecond(MagickWand *wand)
5687 assert(wand != (MagickWand *) NULL);
5688 assert(wand->signature == WandSignature);
5689 if (wand->debug != MagickFalse)
5690 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5691 if (wand->images == (Image *) NULL)
5692 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5693 return((unsigned long) wand->images->ticks_per_second);
5697 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5701 % M a g i c k G e t I m a g e T y p e %
5705 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5707 % MagickGetImageType() gets the potential image type:
5709 % Bilevel Grayscale GrayscaleMatte
5710 % Palette PaletteMatte TrueColor
5711 % TrueColorMatte ColorSeparation ColorSeparationMatte
5713 % To ensure the image type matches its potential, use MagickSetImageType():
5715 % (void) MagickSetImageType(wand,MagickGetImageType(wand));
5717 % The format of the MagickGetImageType method is:
5719 % ImageType MagickGetImageType(MagickWand *wand)
5721 % A description of each parameter follows:
5723 % o wand: the magick wand.
5726 WandExport ImageType MagickGetImageType(MagickWand *wand)
5728 assert(wand != (MagickWand *) NULL);
5729 assert(wand->signature == WandSignature);
5730 if (wand->debug != MagickFalse)
5731 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5732 if (wand->images == (Image *) NULL)
5734 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5735 "ContainsNoImages","`%s'",wand->name);
5736 return(UndefinedType);
5738 return(GetImageType(wand->images,wand->exception));
5742 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5746 % M a g i c k G e t I m a g e U n i t s %
5750 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5752 % MagickGetImageUnits() gets the image units of resolution.
5754 % The format of the MagickGetImageUnits method is:
5756 % ResolutionType MagickGetImageUnits(MagickWand *wand)
5758 % A description of each parameter follows:
5760 % o wand: the magick wand.
5763 WandExport ResolutionType MagickGetImageUnits(MagickWand *wand)
5765 assert(wand != (MagickWand *) NULL);
5766 assert(wand->signature == WandSignature);
5767 if (wand->debug != MagickFalse)
5768 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5769 if (wand->images == (Image *) NULL)
5771 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5772 "ContainsNoImages","`%s'",wand->name);
5773 return(UndefinedResolution);
5775 return(wand->images->units);
5779 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5783 % 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 %
5787 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5789 % MagickGetImageVirtualPixelMethod() returns the virtual pixel method for the
5792 % The format of the MagickGetImageVirtualPixelMethod method is:
5794 % VirtualPixelMethod MagickGetImageVirtualPixelMethod(MagickWand *wand)
5796 % A description of each parameter follows:
5798 % o wand: the magick wand.
5801 WandExport VirtualPixelMethod MagickGetImageVirtualPixelMethod(MagickWand *wand)
5803 assert(wand != (MagickWand *) NULL);
5804 assert(wand->signature == WandSignature);
5805 if (wand->debug != MagickFalse)
5806 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5807 if (wand->images == (Image *) NULL)
5809 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5810 "ContainsNoImages","`%s'",wand->name);
5811 return(UndefinedVirtualPixelMethod);
5813 return(GetImageVirtualPixelMethod(wand->images));
5817 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5821 % M a g i c k G e t I m a g e W h i t e P o i n t %
5825 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5827 % MagickGetImageWhitePoint() returns the chromaticy white point.
5829 % The format of the MagickGetImageWhitePoint method is:
5831 % MagickBooleanType MagickGetImageWhitePoint(MagickWand *wand,double *x,
5834 % A description of each parameter follows:
5836 % o wand: the magick wand.
5838 % o x: the chromaticity white x-point.
5840 % o y: the chromaticity white y-point.
5843 WandExport MagickBooleanType MagickGetImageWhitePoint(MagickWand *wand,
5844 double *x,double *y)
5846 assert(wand != (MagickWand *) NULL);
5847 assert(wand->signature == WandSignature);
5848 if (wand->debug != MagickFalse)
5849 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5850 if (wand->images == (Image *) NULL)
5851 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5852 *x=wand->images->chromaticity.white_point.x;
5853 *y=wand->images->chromaticity.white_point.y;
5858 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5862 % M a g i c k G e t I m a g e W i d t h %
5866 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5868 % MagickGetImageWidth() returns the image width.
5870 % The format of the MagickGetImageWidth method is:
5872 % unsigned long MagickGetImageWidth(MagickWand *wand)
5874 % A description of each parameter follows:
5876 % o wand: the magick wand.
5879 WandExport unsigned long MagickGetImageWidth(MagickWand *wand)
5881 assert(wand != (MagickWand *) NULL);
5882 assert(wand->signature == WandSignature);
5883 if (wand->debug != MagickFalse)
5884 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5885 if (wand->images == (Image *) NULL)
5886 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5887 return(wand->images->columns);
5891 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5895 % M a g i c k G e t N u m b e r I m a g e s %
5899 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5901 % MagickGetNumberImages() returns the number of images associated with a
5904 % The format of the MagickGetNumberImages method is:
5906 % unsigned long MagickGetNumberImages(MagickWand *wand)
5908 % A description of each parameter follows:
5910 % o wand: the magick wand.
5913 WandExport unsigned long MagickGetNumberImages(MagickWand *wand)
5915 assert(wand != (MagickWand *) NULL);
5916 assert(wand->signature == WandSignature);
5917 if (wand->debug != MagickFalse)
5918 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5919 return(GetImageListLength(wand->images));
5923 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5927 % 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 %
5931 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5933 % MagickGetImageTotalInkDensity() gets the image total ink density.
5935 % The format of the MagickGetImageTotalInkDensity method is:
5937 % double MagickGetImageTotalInkDensity(MagickWand *wand)
5939 % A description of each parameter follows:
5941 % o wand: the magick wand.
5944 WandExport double MagickGetImageTotalInkDensity(MagickWand *wand)
5946 assert(wand != (MagickWand *) NULL);
5947 assert(wand->signature == WandSignature);
5948 if (wand->debug != MagickFalse)
5949 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5950 if (wand->images == (Image *) NULL)
5952 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5953 "ContainsNoImages","`%s'",wand->name);
5956 return(GetImageTotalInkDensity(wand->images));
5960 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5964 % M a g i c k H a l d C l u t I m a g e %
5968 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5970 % MagickHaldClutImage() replaces colors in the image from a Hald color lookup
5971 % table. A Hald color lookup table is a 3-dimensional color cube mapped to 2
5972 % dimensions. Create it with the HALD coder. You can apply any color
5973 % transformation to the Hald image and then use this method to apply the
5974 % transform to the image.
5976 % The format of the MagickHaldClutImage method is:
5978 % MagickBooleanType MagickHaldClutImage(MagickWand *wand,
5979 % const MagickWand *hald_wand)
5980 % MagickBooleanType MagickHaldClutImageChannel(MagickWand *wand,
5981 % const ChannelType channel,const MagickWand *hald_wand)
5983 % A description of each parameter follows:
5985 % o wand: the magick wand.
5987 % o hald_image: the hald CLUT image.
5991 WandExport MagickBooleanType MagickHaldClutImage(MagickWand *wand,
5992 const MagickWand *hald_wand)
5997 status=MagickHaldClutImageChannel(wand,DefaultChannels,hald_wand);
6001 WandExport MagickBooleanType MagickHaldClutImageChannel(MagickWand *wand,
6002 const ChannelType channel,const MagickWand *hald_wand)
6007 assert(wand != (MagickWand *) NULL);
6008 assert(wand->signature == WandSignature);
6009 if (wand->debug != MagickFalse)
6010 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6011 if ((wand->images == (Image *) NULL) || (hald_wand->images == (Image *) NULL))
6012 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6013 status=HaldClutImageChannel(wand->images,channel,hald_wand->images);
6014 if (status == MagickFalse)
6015 InheritException(wand->exception,&wand->images->exception);
6020 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6024 % M a g i c k H a s N e x t I m a g e %
6028 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6030 % MagickHasNextImage() returns MagickTrue if the wand has more images when
6031 % traversing the list in the forward direction
6033 % The format of the MagickHasNextImage method is:
6035 % MagickBooleanType MagickHasNextImage(MagickWand *wand)
6037 % A description of each parameter follows:
6039 % o wand: the magick wand.
6042 WandExport MagickBooleanType MagickHasNextImage(MagickWand *wand)
6044 assert(wand != (MagickWand *) NULL);
6045 assert(wand->signature == WandSignature);
6046 if (wand->debug != MagickFalse)
6047 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6048 if (wand->images == (Image *) NULL)
6049 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6050 if (GetNextImageInList(wand->images) == (Image *) NULL)
6051 return(MagickFalse);
6056 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6060 % M a g i c k H a s P r e v i o u s I m a g e %
6064 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6066 % MagickHasPreviousImage() returns MagickTrue if the wand has more images when
6067 % traversing the list in the reverse direction
6069 % The format of the MagickHasPreviousImage method is:
6071 % MagickBooleanType MagickHasPreviousImage(MagickWand *wand)
6073 % A description of each parameter follows:
6075 % o wand: the magick wand.
6078 WandExport MagickBooleanType MagickHasPreviousImage(MagickWand *wand)
6080 assert(wand != (MagickWand *) NULL);
6081 assert(wand->signature == WandSignature);
6082 if (wand->debug != MagickFalse)
6083 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6084 if (wand->images == (Image *) NULL)
6085 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6086 if (GetPreviousImageInList(wand->images) == (Image *) NULL)
6087 return(MagickFalse);
6092 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6096 % M a g i c k I d e n t i f y I m a g e %
6100 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6102 % MagickIdentifyImage() identifies an image by printing its attributes to the
6103 % file. Attributes include the image width, height, size, and others.
6105 % The format of the MagickIdentifyImage method is:
6107 % const char *MagickIdentifyImage(MagickWand *wand)
6109 % A description of each parameter follows:
6111 % o wand: the magick wand.
6114 WandExport char *MagickIdentifyImage(MagickWand *wand)
6118 filename[MaxTextExtent];
6126 assert(wand != (MagickWand *) NULL);
6127 assert(wand->signature == WandSignature);
6128 if (wand->debug != MagickFalse)
6129 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6130 if (wand->images == (Image *) NULL)
6132 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
6133 "ContainsNoImages","`%s'",wand->name);
6134 return((char *) NULL);
6136 description=(char *) NULL;
6137 unique_file=AcquireUniqueFileResource(filename);
6139 if (unique_file != -1)
6140 file=fdopen(unique_file,"wb");
6141 if ((unique_file == -1) || (file == (FILE *) NULL))
6143 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
6144 "UnableToCreateTemporaryFile","`%s'",wand->name);
6145 return((char *) NULL);
6147 (void) IdentifyImage(wand->images,file,MagickTrue);
6148 (void) fclose(file);
6149 description=FileToString(filename,~0,wand->exception);
6150 (void) RelinquishUniqueFileResource(filename);
6151 return(description);
6155 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6159 % M a g i c k I m p l o d e I m a g e %
6163 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6165 % MagickImplodeImage() creates a new image that is a copy of an existing
6166 % one with the image pixels "implode" by the specified percentage. It
6167 % allocates the memory necessary for the new Image structure and returns a
6168 % pointer to the new image.
6170 % The format of the MagickImplodeImage method is:
6172 % MagickBooleanType MagickImplodeImage(MagickWand *wand,
6173 % const double radius)
6175 % A description of each parameter follows:
6177 % o wand: the magick wand.
6179 % o amount: Define the extent of the implosion.
6182 WandExport MagickBooleanType MagickImplodeImage(MagickWand *wand,
6183 const double amount)
6188 assert(wand != (MagickWand *) NULL);
6189 assert(wand->signature == WandSignature);
6190 if (wand->debug != MagickFalse)
6191 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6192 if (wand->images == (Image *) NULL)
6193 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6194 implode_image=ImplodeImage(wand->images,amount,wand->exception);
6195 if (implode_image == (Image *) NULL)
6196 return(MagickFalse);
6197 ReplaceImageInList(&wand->images,implode_image);
6202 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6206 % M a g i c k I m p o r t I m a g e P i x e l s %
6210 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6212 % MagickImportImagePixels() accepts pixel datand stores it in the image at the
6213 % location you specify. The method returns MagickFalse on success otherwise
6214 % MagickTrue if an error is encountered. The pixel data can be either char,
6215 % short int, int, long, float, or double in the order specified by map.
6217 % Suppose your want to upload the first scanline of a 640x480 image from
6218 % character data in red-green-blue order:
6220 % MagickImportImagePixels(wand,0,0,640,1,"RGB",CharPixel,pixels);
6222 % The format of the MagickImportImagePixels method is:
6224 % MagickBooleanType MagickImportImagePixels(MagickWand *wand,
6225 % const long x,const long y,const unsigned long columns,
6226 % const unsigned long rows,const char *map,const StorageType storage,
6227 % const void *pixels)
6229 % A description of each parameter follows:
6231 % o wand: the magick wand.
6233 % o x, y, columns, rows: These values define the perimeter of a region
6234 % of pixels you want to define.
6236 % o map: This string reflects the expected ordering of the pixel array.
6237 % It can be any combination or order of R = red, G = green, B = blue,
6238 % A = alpha (0 is transparent), O = opacity (0 is opaque), C = cyan,
6239 % Y = yellow, M = magenta, K = black, I = intensity (for grayscale),
6242 % o storage: Define the data type of the pixels. Float and double types are
6243 % expected to be normalized [0..1] otherwise [0..QuantumRange]. Choose from
6244 % these types: CharPixel, ShortPixel, IntegerPixel, LongPixel, FloatPixel,
6247 % o pixels: This array of values contain the pixel components as defined by
6248 % map and type. You must preallocate this array where the expected
6249 % length varies depending on the values of width, height, map, and type.
6252 WandExport MagickBooleanType MagickImportImagePixels(MagickWand *wand,
6253 const long x,const long y,const unsigned long columns,
6254 const unsigned long rows,const char *map,const StorageType storage,
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 status=ImportImagePixels(wand->images,x,y,columns,rows,map,storage,pixels);
6267 if (status == MagickFalse)
6268 InheritException(wand->exception,&wand->images->exception);
6273 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6277 % 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 %
6281 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6283 % MagickInverseFourierTransformImage() implements the inverse discrete
6284 % Fourier transform (DFT) of the image either as a magnitude / phase or real /
6285 % imaginary image pair.
6287 % The format of the MagickInverseFourierTransformImage method is:
6289 % MagickBooleanType MagickInverseFourierTransformImage(
6290 % MagickWand *magnitude_wand,MagickWand *phase_wand,
6291 % const MagickBooleanType magnitude)
6293 % A description of each parameter follows:
6295 % o magnitude_wand: the magnitude or real wand.
6297 % o phase_wand: the phase or imaginary wand.
6299 % o magnitude: if true, return as magnitude / phase pair otherwise a real /
6300 % imaginary image pair.
6303 WandExport MagickBooleanType MagickInverseFourierTransformImage(
6304 MagickWand *magnitude_wand,MagickWand *phase_wand,
6305 const MagickBooleanType magnitude)
6313 assert(magnitude_wand != (MagickWand *) NULL);
6314 assert(magnitude_wand->signature == WandSignature);
6315 if (magnitude_wand->debug != MagickFalse)
6316 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",
6317 magnitude_wand->name);
6318 wand=magnitude_wand;
6319 if (magnitude_wand->images == (Image *) NULL)
6320 ThrowWandException(WandError,"ContainsNoImages",
6321 magnitude_wand->name);
6322 assert(phase_wand != (MagickWand *) NULL);
6323 assert(phase_wand->signature == WandSignature);
6324 inverse_image=InverseFourierTransformImage(magnitude_wand->images,
6325 phase_wand->images,magnitude,wand->exception);
6326 if (inverse_image == (Image *) NULL)
6327 return(MagickFalse);
6328 ReplaceImageInList(&wand->images,inverse_image);
6333 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6337 % M a g i c k L a b e l I m a g e %
6341 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6343 % MagickLabelImage() adds a label to your image.
6345 % The format of the MagickLabelImage method is:
6347 % MagickBooleanType MagickLabelImage(MagickWand *wand,const char *label)
6349 % A description of each parameter follows:
6351 % o wand: the magick wand.
6353 % o label: the image label.
6356 WandExport MagickBooleanType MagickLabelImage(MagickWand *wand,
6362 assert(wand != (MagickWand *) NULL);
6363 assert(wand->signature == WandSignature);
6364 if (wand->debug != MagickFalse)
6365 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6366 if (wand->images == (Image *) NULL)
6367 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6368 status=SetImageProperty(wand->images,"label",label);
6369 if (status == MagickFalse)
6370 InheritException(wand->exception,&wand->images->exception);
6375 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6379 % M a g i c k L e v e l I m a g e %
6383 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6385 % MagickLevelImage() adjusts the levels of an image by scaling the colors
6386 % falling between specified white and black points to the full available
6387 % quantum range. The parameters provided represent the black, mid, and white
6388 % points. The black point specifies the darkest color in the image. Colors
6389 % darker than the black point are set to zero. Mid point specifies a gamma
6390 % correction to apply to the image. White point specifies the lightest color
6391 % in the image. Colors brighter than the white point are set to the maximum
6394 % The format of the MagickLevelImage method is:
6396 % MagickBooleanType MagickLevelImage(MagickWand *wand,
6397 % const double black_point,const double gamma,const double white_point)
6398 % MagickBooleanType MagickLevelImageChannel(MagickWand *wand,
6399 % const ChannelType channel,const double black_point,const double gamma,
6400 % const double white_point)
6402 % A description of each parameter follows:
6404 % o wand: the magick wand.
6406 % o channel: Identify which channel to level: RedChannel, GreenChannel,
6408 % o black_point: the black point.
6410 % o gamma: the gamma.
6412 % o white_point: the white point.
6416 WandExport MagickBooleanType MagickLevelImage(MagickWand *wand,
6417 const double black_point,const double gamma,const double white_point)
6422 status=MagickLevelImageChannel(wand,DefaultChannels,black_point,gamma,
6427 WandExport MagickBooleanType MagickLevelImageChannel(MagickWand *wand,
6428 const ChannelType channel,const double black_point,const double gamma,
6429 const double white_point)
6434 assert(wand != (MagickWand *) NULL);
6435 assert(wand->signature == WandSignature);
6436 if (wand->debug != MagickFalse)
6437 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6438 if (wand->images == (Image *) NULL)
6439 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6440 status=LevelImageChannel(wand->images,channel,black_point,white_point,gamma);
6441 if (status == MagickFalse)
6442 InheritException(wand->exception,&wand->images->exception);
6447 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6451 % M a g i c k L i n e a r S t r e t c h I m a g e %
6455 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6457 % MagickLinearStretchImage() stretches with saturation the image intensity.
6459 % You can also reduce the influence of a particular channel with a gamma
6462 % The format of the MagickLinearStretchImage method is:
6464 % MagickBooleanType MagickLinearStretchImage(MagickWand *wand,
6465 % const double black_point,const double white_point)
6467 % A description of each parameter follows:
6469 % o wand: the magick wand.
6471 % o black_point: the black point.
6473 % o white_point: the white point.
6476 WandExport MagickBooleanType MagickLinearStretchImage(MagickWand *wand,
6477 const double black_point,const double white_point)
6482 assert(wand != (MagickWand *) NULL);
6483 assert(wand->signature == WandSignature);
6484 if (wand->debug != MagickFalse)
6485 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6486 if (wand->images == (Image *) NULL)
6487 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6488 status=LinearStretchImage(wand->images,black_point,white_point);
6489 if (status == MagickFalse)
6490 InheritException(wand->exception,&wand->images->exception);
6495 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6499 % M a g i c k L i q u i d R e s c a l e I m a g e %
6503 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6505 % MagickLiquidRescaleImage() rescales image with seam carving.
6507 % MagickBooleanType MagickLiquidRescaleImage(MagickWand *wand,
6508 % const unsigned long columns,const unsigned long rows,
6509 % const double delta_x,const double rigidity)
6511 % A description of each parameter follows:
6513 % o wand: the magick wand.
6515 % o columns: the number of columns in the scaled image.
6517 % o rows: the number of rows in the scaled image.
6519 % o delta_x: maximum seam transversal step (0 means straight seams).
6521 % o rigidity: introduce a bias for non-straight seams (typically 0).
6524 WandExport MagickBooleanType MagickLiquidRescaleImage(MagickWand *wand,
6525 const unsigned long columns,const unsigned long rows,const double delta_x,
6526 const double rigidity)
6531 assert(wand != (MagickWand *) NULL);
6532 assert(wand->signature == WandSignature);
6533 if (wand->debug != MagickFalse)
6534 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6535 if (wand->images == (Image *) NULL)
6536 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6537 rescale_image=LiquidRescaleImage(wand->images,columns,rows,delta_x,
6538 rigidity,wand->exception);
6539 if (rescale_image == (Image *) NULL)
6540 return(MagickFalse);
6541 ReplaceImageInList(&wand->images,rescale_image);
6546 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6550 % M a g i c k M a g n i f y I m a g e %
6554 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6556 % MagickMagnifyImage() is a convenience method that scales an image
6557 % proportionally to twice its original size.
6559 % The format of the MagickMagnifyImage method is:
6561 % MagickBooleanType MagickMagnifyImage(MagickWand *wand)
6563 % A description of each parameter follows:
6565 % o wand: the magick wand.
6568 WandExport MagickBooleanType MagickMagnifyImage(MagickWand *wand)
6573 assert(wand != (MagickWand *) NULL);
6574 assert(wand->signature == WandSignature);
6575 if (wand->debug != MagickFalse)
6576 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6577 if (wand->images == (Image *) NULL)
6578 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6579 magnify_image=MagnifyImage(wand->images,wand->exception);
6580 if (magnify_image == (Image *) NULL)
6581 return(MagickFalse);
6582 ReplaceImageInList(&wand->images,magnify_image);
6587 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6591 % M a g i c k M e d i a n F i l t e r I m a g e %
6595 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6597 % MagickMedianFilterImage() applies a digital filter that improves the quality
6598 % of a noisy image. Each pixel is replaced by the median in a set of
6599 % neighboring pixels as defined by radius.
6601 % The format of the MagickMedianFilterImage method is:
6603 % MagickBooleanType MagickMedianFilterImage(MagickWand *wand,
6604 % const double radius)
6606 % A description of each parameter follows:
6608 % o wand: the magick wand.
6610 % o radius: the radius of the pixel neighborhood.
6613 WandExport MagickBooleanType MagickMedianFilterImage(MagickWand *wand,
6614 const double radius)
6619 assert(wand != (MagickWand *) NULL);
6620 assert(wand->signature == WandSignature);
6621 if (wand->debug != MagickFalse)
6622 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6623 if (wand->images == (Image *) NULL)
6624 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6625 median_image=MedianFilterImage(wand->images,radius,wand->exception);
6626 if (median_image == (Image *) NULL)
6627 return(MagickFalse);
6628 ReplaceImageInList(&wand->images,median_image);
6633 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6637 % M a g i c k M e r g e I m a g e L a y e r s %
6641 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6643 % MagickMergeImageLayers() composes all the image layers from the current given
6644 % image onward to produce a single image of the merged layers.
6646 % The inital canvas's size depends on the given ImageLayerMethod, and is
6647 % initialized using the first images background color. The images
6648 % are then compositied onto that image in sequence using the given
6649 % composition that has been assigned to each individual image.
6651 % The format of the MagickMergeImageLayers method is:
6653 % MagickWand *MagickMergeImageLayers(MagickWand *wand,
6654 % const ImageLayerMethod method)
6656 % A description of each parameter follows:
6658 % o wand: the magick wand.
6660 % o method: the method of selecting the size of the initial canvas.
6662 % MergeLayer: Merge all layers onto a canvas just large enough
6663 % to hold all the actual images. The virtual canvas of the
6664 % first image is preserved but otherwise ignored.
6666 % FlattenLayer: Use the virtual canvas size of first image.
6667 % Images which fall outside this canvas is clipped.
6668 % This can be used to 'fill out' a given virtual canvas.
6670 % MosaicLayer: Start with the virtual canvas of the first image,
6671 % enlarging left and right edges to contain all images.
6672 % Images with negative offsets will be clipped.
6675 WandExport MagickWand *MagickMergeImageLayers(MagickWand *wand,
6676 const ImageLayerMethod method)
6681 assert(wand != (MagickWand *) NULL);
6682 assert(wand->signature == WandSignature);
6683 if (wand->debug != MagickFalse)
6684 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6685 if (wand->images == (Image *) NULL)
6686 return((MagickWand *) NULL);
6687 mosaic_image=MergeImageLayers(wand->images,method,wand->exception);
6688 if (mosaic_image == (Image *) NULL)
6689 return((MagickWand *) NULL);
6690 return(CloneMagickWandFromImages(wand,mosaic_image));
6694 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6698 % M a g i c k M i n i f y I m a g e %
6702 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6704 % MagickMinifyImage() is a convenience method that scales an image
6705 % proportionally to one-half its original size
6707 % The format of the MagickMinifyImage method is:
6709 % MagickBooleanType MagickMinifyImage(MagickWand *wand)
6711 % A description of each parameter follows:
6713 % o wand: the magick wand.
6716 WandExport MagickBooleanType MagickMinifyImage(MagickWand *wand)
6721 assert(wand != (MagickWand *) NULL);
6722 assert(wand->signature == WandSignature);
6723 if (wand->debug != MagickFalse)
6724 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6725 if (wand->images == (Image *) NULL)
6726 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6727 minify_image=MinifyImage(wand->images,wand->exception);
6728 if (minify_image == (Image *) NULL)
6729 return(MagickFalse);
6730 ReplaceImageInList(&wand->images,minify_image);
6735 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6739 % M a g i c k M o d u l a t e I m a g e %
6743 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6745 % MagickModulateImage() lets you control the brightness, saturation, and hue
6746 % of an image. Hue is the percentage of absolute rotation from the current
6747 % position. For example 50 results in a counter-clockwise rotation of 90
6748 % degrees, 150 results in a clockwise rotation of 90 degrees, with 0 and 200
6749 % both resulting in a rotation of 180 degrees.
6751 % To increase the color brightness by 20% and decrease the color saturation by
6752 % 10% and leave the hue unchanged, use: 120,90,100.
6754 % The format of the MagickModulateImage method is:
6756 % MagickBooleanType MagickModulateImage(MagickWand *wand,
6757 % const double brightness,const double saturation,const double hue)
6759 % A description of each parameter follows:
6761 % o wand: the magick wand.
6763 % o brightness: the percent change in brighness.
6765 % o saturation: the percent change in saturation.
6767 % o hue: the percent change in hue.
6770 WandExport MagickBooleanType MagickModulateImage(MagickWand *wand,
6771 const double brightness,const double saturation,const double hue)
6774 modulate[MaxTextExtent];
6779 assert(wand != (MagickWand *) NULL);
6780 assert(wand->signature == WandSignature);
6781 if (wand->debug != MagickFalse)
6782 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6783 if (wand->images == (Image *) NULL)
6784 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6785 (void) FormatMagickString(modulate,MaxTextExtent,"%g,%g,%g",brightness,
6787 status=ModulateImage(wand->images,modulate);
6788 if (status == MagickFalse)
6789 InheritException(wand->exception,&wand->images->exception);
6794 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6798 % M a g i c k M o n t a g e I m a g e %
6802 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6804 % MagickMontageImage() creates a composite image by combining several
6805 % separate images. The images are tiled on the composite image with the name
6806 % of the image optionally appearing just below the individual tile.
6808 % The format of the MagickMontageImage method is:
6810 % MagickWand *MagickMontageImage(MagickWand *wand,
6811 % const DrawingWand drawing_wand,const char *tile_geometry,
6812 % const char *thumbnail_geometry,const MontageMode mode,
6813 % const char *frame)
6815 % A description of each parameter follows:
6817 % o wand: the magick wand.
6819 % o drawing_wand: the drawing wand. The font name, size, and color are
6820 % obtained from this wand.
6822 % o tile_geometry: the number of tiles per row and page (e.g. 6x4+0+0).
6824 % o thumbnail_geometry: Preferred image size and border size of each
6825 % thumbnail (e.g. 120x120+4+3>).
6827 % o mode: Thumbnail framing mode: Frame, Unframe, or Concatenate.
6829 % o frame: Surround the image with an ornamental border (e.g. 15x15+3+3).
6830 % The frame color is that of the thumbnail's matte color.
6833 WandExport MagickWand *MagickMontageImage(MagickWand *wand,
6834 const DrawingWand *drawing_wand,const char *tile_geometry,
6835 const char *thumbnail_geometry,const MontageMode mode,const char *frame)
6849 assert(wand != (MagickWand *) NULL);
6850 assert(wand->signature == WandSignature);
6851 if (wand->debug != MagickFalse)
6852 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6853 if (wand->images == (Image *) NULL)
6854 return((MagickWand *) NULL);
6855 montage_info=CloneMontageInfo(wand->image_info,(MontageInfo *) NULL);
6860 (void) CloneString(&montage_info->frame,"15x15+3+3");
6861 montage_info->shadow=MagickTrue;
6866 montage_info->frame=(char *) NULL;
6867 montage_info->shadow=MagickFalse;
6868 montage_info->border_width=0;
6871 case ConcatenateMode:
6873 montage_info->frame=(char *) NULL;
6874 montage_info->shadow=MagickFalse;
6875 (void) CloneString(&montage_info->geometry,"+0+0");
6876 montage_info->border_width=0;
6882 font=DrawGetFont(drawing_wand);
6883 if (font != (char *) NULL)
6884 (void) CloneString(&montage_info->font,font);
6885 if (frame != (char *) NULL)
6886 (void) CloneString(&montage_info->frame,frame);
6887 montage_info->pointsize=DrawGetFontSize(drawing_wand);
6888 pixel_wand=NewPixelWand();
6889 DrawGetFillColor(drawing_wand,pixel_wand);
6890 PixelGetQuantumColor(pixel_wand,&montage_info->fill);
6891 DrawGetStrokeColor(drawing_wand,pixel_wand);
6892 PixelGetQuantumColor(pixel_wand,&montage_info->stroke);
6893 pixel_wand=DestroyPixelWand(pixel_wand);
6894 if (thumbnail_geometry != (char *) NULL)
6895 (void) CloneString(&montage_info->geometry,thumbnail_geometry);
6896 if (tile_geometry != (char *) NULL)
6897 (void) CloneString(&montage_info->tile,tile_geometry);
6898 montage_image=MontageImageList(wand->image_info,montage_info,wand->images,
6900 montage_info=DestroyMontageInfo(montage_info);
6901 if (montage_image == (Image *) NULL)
6902 return((MagickWand *) NULL);
6903 return(CloneMagickWandFromImages(wand,montage_image));
6907 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6911 % M a g i c k M o r p h I m a g e s %
6915 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6917 % MagickMorphImages() method morphs a set of images. Both the image pixels
6918 % and size are linearly interpolated to give the appearance of a
6919 % meta-morphosis from one image to the next.
6921 % The format of the MagickMorphImages method is:
6923 % MagickWand *MagickMorphImages(MagickWand *wand,
6924 % const unsigned long number_frames)
6926 % A description of each parameter follows:
6928 % o wand: the magick wand.
6930 % o number_frames: the number of in-between images to generate.
6933 WandExport MagickWand *MagickMorphImages(MagickWand *wand,
6934 const unsigned long number_frames)
6939 assert(wand != (MagickWand *) NULL);
6940 assert(wand->signature == WandSignature);
6941 if (wand->debug != MagickFalse)
6942 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6943 if (wand->images == (Image *) NULL)
6944 return((MagickWand *) NULL);
6945 morph_image=MorphImages(wand->images,number_frames,wand->exception);
6946 if (morph_image == (Image *) NULL)
6947 return((MagickWand *) NULL);
6948 return(CloneMagickWandFromImages(wand,morph_image));
6952 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6956 % M a g i c k M o t i o n B l u r I m a g e %
6960 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6962 % MagickMotionBlurImage() simulates motion blur. We convolve the image with a
6963 % Gaussian operator of the given radius and standard deviation (sigma).
6964 % For reasonable results, radius should be larger than sigma. Use a
6965 % radius of 0 and MotionBlurImage() selects a suitable radius for you.
6966 % Angle gives the angle of the blurring motion.
6968 % The format of the MagickMotionBlurImage method is:
6970 % MagickBooleanType MagickMotionBlurImage(MagickWand *wand,
6971 % const double radius,const double sigma,const double angle)
6972 % MagickBooleanType MagickMotionBlurImageChannel(MagickWand *wand,
6973 % const ChannelType channel,const double radius,const double sigma,
6974 % const double angle)
6976 % A description of each parameter follows:
6978 % o wand: the magick wand.
6980 % o channel: the image channel(s).
6982 % o radius: the radius of the Gaussian, in pixels, not counting
6985 % o sigma: the standard deviation of the Gaussian, in pixels.
6987 % o angle: Apply the effect along this angle.
6991 WandExport MagickBooleanType MagickMotionBlurImage(MagickWand *wand,
6992 const double radius,const double sigma,const double angle)
6997 status=MagickMotionBlurImageChannel(wand,DefaultChannels,radius,sigma,angle);
7001 WandExport MagickBooleanType MagickMotionBlurImageChannel(MagickWand *wand,
7002 const ChannelType channel,const double radius,const double sigma,
7008 assert(wand != (MagickWand *) NULL);
7009 assert(wand->signature == WandSignature);
7010 if (wand->debug != MagickFalse)
7011 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7012 if (wand->images == (Image *) NULL)
7013 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7014 blur_image=MotionBlurImageChannel(wand->images,channel,radius,sigma,angle,
7016 if (blur_image == (Image *) NULL)
7017 return(MagickFalse);
7018 ReplaceImageInList(&wand->images,blur_image);
7023 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7027 % M a g i c k N e g a t e I m a g e %
7031 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7033 % MagickNegateImage() negates the colors in the reference image. The
7034 % Grayscale option means that only grayscale values within the image are
7037 % You can also reduce the influence of a particular channel with a gamma
7040 % The format of the MagickNegateImage method is:
7042 % MagickBooleanType MagickNegateImage(MagickWand *wand,
7043 % const MagickBooleanType gray)
7044 % MagickBooleanType MagickNegateImage(MagickWand *wand,
7045 % const ChannelType channel,const MagickBooleanType gray)
7047 % A description of each parameter follows:
7049 % o wand: the magick wand.
7051 % o channel: the image channel(s).
7053 % o gray: If MagickTrue, only negate grayscale pixels within the image.
7057 WandExport MagickBooleanType MagickNegateImage(MagickWand *wand,
7058 const MagickBooleanType gray)
7063 status=MagickNegateImageChannel(wand,DefaultChannels,gray);
7067 WandExport MagickBooleanType MagickNegateImageChannel(MagickWand *wand,
7068 const ChannelType channel,const MagickBooleanType gray)
7073 assert(wand != (MagickWand *) NULL);
7074 assert(wand->signature == WandSignature);
7075 if (wand->debug != MagickFalse)
7076 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7077 if (wand->images == (Image *) NULL)
7078 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7079 status=NegateImageChannel(wand->images,channel,gray);
7080 if (status == MagickFalse)
7081 InheritException(wand->exception,&wand->images->exception);
7086 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7090 % M a g i c k N e w I m a g e %
7094 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7096 % MagickNewImage() adds a blank image canvas of the specified size and
7097 % background color to the wand.
7099 % The format of the MagickNewImage method is:
7101 % MagickBooleanType MagickNewImage(MagickWand *wand,
7102 % const unsigned long columns,const unsigned long rows,
7103 % const PixelWand *background)
7105 % A description of each parameter follows:
7107 % o wand: the magick wand.
7109 % o width: the image width.
7111 % o height: the image height.
7113 % o background: the image color.
7116 WandExport MagickBooleanType MagickNewImage(MagickWand *wand,
7117 const unsigned long width,const unsigned long height,
7118 const PixelWand *background)
7126 assert(wand != (MagickWand *) NULL);
7127 assert(wand->signature == WandSignature);
7128 if (wand->debug != MagickFalse)
7129 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7130 PixelGetMagickColor(background,&pixel);
7131 images=NewMagickImage(wand->image_info,width,height,&pixel);
7132 if (images == (Image *) NULL)
7133 return(MagickFalse);
7134 if (images->exception.severity != UndefinedException)
7135 InheritException(wand->exception,&images->exception);
7136 return(InsertImageInWand(wand,images));
7140 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7144 % M a g i c k N e x t I m a g e %
7148 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7150 % MagickNextImage() associates the next image in the image list with a magick
7153 % The format of the MagickNextImage method is:
7155 % MagickBooleanType MagickNextImage(MagickWand *wand)
7157 % A description of each parameter follows:
7159 % o wand: the magick wand.
7162 WandExport MagickBooleanType MagickNextImage(MagickWand *wand)
7164 assert(wand != (MagickWand *) NULL);
7165 assert(wand->signature == WandSignature);
7166 if (wand->debug != MagickFalse)
7167 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7168 if (wand->images == (Image *) NULL)
7169 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7170 if (wand->pend != MagickFalse)
7172 wand->pend=MagickFalse;
7175 if (GetNextImageInList(wand->images) == (Image *) NULL)
7177 wand->pend=MagickTrue;
7178 return(MagickFalse);
7180 wand->images=GetNextImageInList(wand->images);
7185 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7189 % M a g i c k N o r m a l i z e I m a g e %
7193 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7195 % MagickNormalizeImage() enhances the contrast of a color image by adjusting
7196 % the pixels color to span the entire range of colors available
7198 % You can also reduce the influence of a particular channel with a gamma
7201 % The format of the MagickNormalizeImage method is:
7203 % MagickBooleanType MagickNormalizeImage(MagickWand *wand)
7204 % MagickBooleanType MagickNormalizeImageChannel(MagickWand *wand,
7205 % const ChannelType channel)
7207 % A description of each parameter follows:
7209 % o wand: the magick wand.
7211 % o channel: the image channel(s).
7215 WandExport MagickBooleanType MagickNormalizeImage(MagickWand *wand)
7220 status=MagickNormalizeImageChannel(wand,DefaultChannels);
7224 WandExport MagickBooleanType MagickNormalizeImageChannel(MagickWand *wand,
7225 const ChannelType channel)
7230 assert(wand != (MagickWand *) NULL);
7231 assert(wand->signature == WandSignature);
7232 if (wand->debug != MagickFalse)
7233 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7234 if (wand->images == (Image *) NULL)
7235 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7236 status=NormalizeImageChannel(wand->images,channel);
7237 if (status == MagickFalse)
7238 InheritException(wand->exception,&wand->images->exception);
7243 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7247 % M a g i c k O i l P a i n t I m a g e %
7251 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7253 % MagickOilPaintImage() applies a special effect filter that simulates an oil
7254 % painting. Each pixel is replaced by the most frequent color occurring
7255 % in a circular region defined by radius.
7257 % The format of the MagickOilPaintImage method is:
7259 % MagickBooleanType MagickOilPaintImage(MagickWand *wand,
7260 % const double radius)
7262 % A description of each parameter follows:
7264 % o wand: the magick wand.
7266 % o radius: the radius of the circular neighborhood.
7269 WandExport MagickBooleanType MagickOilPaintImage(MagickWand *wand,
7270 const double radius)
7275 assert(wand != (MagickWand *) NULL);
7276 assert(wand->signature == WandSignature);
7277 if (wand->debug != MagickFalse)
7278 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7279 if (wand->images == (Image *) NULL)
7280 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7281 paint_image=OilPaintImage(wand->images,radius,wand->exception);
7282 if (paint_image == (Image *) NULL)
7283 return(MagickFalse);
7284 ReplaceImageInList(&wand->images,paint_image);
7289 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7293 % M a g i c k O p a q u e P a i n t I m a g e %
7297 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7299 % MagickOpaquePaintImage() changes any pixel that matches color with the color
7302 % The format of the MagickOpaquePaintImage method is:
7304 % MagickBooleanType MagickOpaquePaintImage(MagickWand *wand,
7305 % const PixelWand *target,const PixelWand *fill,const double fuzz,
7306 % const MagickBooleanType invert)
7307 % MagickBooleanType MagickOpaquePaintImageChannel(MagickWand *wand,
7308 % const ChannelType channel,const PixelWand *target,
7309 % const PixelWand *fill,const double fuzz,const MagickBooleanType invert)
7311 % A description of each parameter follows:
7313 % o wand: the magick wand.
7315 % o channel: the channel(s).
7317 % o target: Change this target color to the fill color within the image.
7319 % o fill: the fill pixel wand.
7321 % o fuzz: By default target must match a particular pixel color
7322 % exactly. However, in many cases two colors may differ by a small amount.
7323 % The fuzz member of image defines how much tolerance is acceptable to
7324 % consider two colors as the same. For example, set fuzz to 10 and the
7325 % color red at intensities of 100 and 102 respectively are now interpreted
7326 % as the same color for the purposes of the floodfill.
7328 % o invert: paint any pixel that does not match the target color.
7332 WandExport MagickBooleanType MagickOpaquePaintImage(MagickWand *wand,
7333 const PixelWand *target,const PixelWand *fill,const double fuzz,
7334 const MagickBooleanType invert)
7339 status=MagickOpaquePaintImageChannel(wand,DefaultChannels,target,fill,fuzz,
7344 WandExport MagickBooleanType MagickOpaquePaintImageChannel(MagickWand *wand,
7345 const ChannelType channel,const PixelWand *target,const PixelWand *fill,
7346 const double fuzz,const MagickBooleanType invert)
7355 assert(wand != (MagickWand *) NULL);
7356 assert(wand->signature == WandSignature);
7357 if (wand->debug != MagickFalse)
7358 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7359 if (wand->images == (Image *) NULL)
7360 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7361 PixelGetMagickColor(target,&target_pixel);
7362 PixelGetMagickColor(fill,&fill_pixel);
7363 wand->images->fuzz=fuzz;
7364 status=OpaquePaintImageChannel(wand->images,channel,&target_pixel,
7365 &fill_pixel,invert);
7366 if (status == MagickFalse)
7367 InheritException(wand->exception,&wand->images->exception);
7372 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7376 % 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 %
7380 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7382 % MagickOptimizeImageLayers() compares each image the GIF disposed forms of the
7383 % previous image in the sequence. From this it attempts to select the
7384 % smallest cropped image to replace each frame, while preserving the results
7387 % The format of the MagickOptimizeImageLayers method is:
7389 % MagickWand *MagickOptimizeImageLayers(MagickWand *wand)
7391 % A description of each parameter follows:
7393 % o wand: the magick wand.
7396 WandExport MagickWand *MagickOptimizeImageLayers(MagickWand *wand)
7401 assert(wand != (MagickWand *) NULL);
7402 assert(wand->signature == WandSignature);
7403 if (wand->debug != MagickFalse)
7404 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7405 if (wand->images == (Image *) NULL)
7406 return((MagickWand *) NULL);
7407 optimize_image=OptimizeImageLayers(wand->images,wand->exception);
7408 if (optimize_image == (Image *) NULL)
7409 return((MagickWand *) NULL);
7410 return(CloneMagickWandFromImages(wand,optimize_image));
7414 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7418 % 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 %
7422 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7424 % MagickOrderedPosterizeImage() performs an ordered dither based on a number
7425 % of pre-defined dithering threshold maps, but over multiple intensity levels,
7426 % which can be different for different channels, according to the input
7429 % The format of the MagickOrderedPosterizeImage method is:
7431 % MagickBooleanType MagickOrderedPosterizeImage(MagickWand *wand,
7432 % const char *threshold_map)
7433 % MagickBooleanType MagickOrderedPosterizeImageChannel(MagickWand *wand,
7434 % const ChannelType channel,const char *threshold_map)
7436 % A description of each parameter follows:
7438 % o image: the image.
7440 % o channel: the channel or channels to be thresholded.
7442 % o threshold_map: A string containing the name of the threshold dither
7443 % map to use, followed by zero or more numbers representing the number of
7444 % color levels tho dither between.
7446 % Any level number less than 2 is equivelent to 2, and means only binary
7447 % dithering will be applied to each color channel.
7449 % No numbers also means a 2 level (bitmap) dither will be applied to all
7450 % channels, while a single number is the number of levels applied to each
7451 % channel in sequence. More numbers will be applied in turn to each of
7452 % the color channels.
7454 % For example: "o3x3,6" generates a 6 level posterization of the image
7455 % with a ordered 3x3 diffused pixel dither being applied between each
7456 % level. While checker,8,8,4 will produce a 332 colormaped image with
7457 % only a single checkerboard hash pattern (50% grey) between each color
7458 % level, to basically double the number of color levels with a bare
7459 % minimim of dithering.
7463 WandExport MagickBooleanType MagickOrderedPosterizeImage(MagickWand *wand,
7464 const char *threshold_map)
7469 status=MagickOrderedPosterizeImageChannel(wand,DefaultChannels,threshold_map);
7473 WandExport MagickBooleanType MagickOrderedPosterizeImageChannel(
7474 MagickWand *wand,const ChannelType channel,const char *threshold_map)
7479 assert(wand != (MagickWand *) NULL);
7480 assert(wand->signature == WandSignature);
7481 if (wand->debug != MagickFalse)
7482 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7483 if (wand->images == (Image *) NULL)
7484 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7485 status=OrderedPosterizeImageChannel(wand->images,channel,threshold_map,
7491 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7495 % M a g i c k P i n g I m a g e %
7499 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7501 % MagickPingImage() is like MagickReadImage() except the only valid
7502 % information returned is the image width, height, size, and format. It
7503 % is designed to efficiently obtain this information from a file without
7504 % reading the entire image sequence into memory.
7506 % The format of the MagickPingImage method is:
7508 % MagickBooleanType MagickPingImage(MagickWand *wand,const char *filename)
7510 % A description of each parameter follows:
7512 % o wand: the magick wand.
7514 % o filename: the image filename.
7517 WandExport MagickBooleanType MagickPingImage(MagickWand *wand,
7518 const char *filename)
7526 assert(wand != (MagickWand *) NULL);
7527 assert(wand->signature == WandSignature);
7528 if (wand->debug != MagickFalse)
7529 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7530 ping_info=CloneImageInfo(wand->image_info);
7531 if (filename != (const char *) NULL)
7532 (void) CopyMagickString(ping_info->filename,filename,MaxTextExtent);
7533 images=PingImage(ping_info,wand->exception);
7534 ping_info=DestroyImageInfo(ping_info);
7535 if (images == (Image *) NULL)
7536 return(MagickFalse);
7537 return(InsertImageInWand(wand,images));
7541 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7545 % M a g i c k P i n g I m a g e B l o b %
7549 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7551 % MagickPingImageBlob() pings an image or image sequence from a blob.
7553 % The format of the MagickPingImageBlob method is:
7555 % MagickBooleanType MagickPingImageBlob(MagickWand *wand,
7556 % const void *blob,const size_t length)
7558 % A description of each parameter follows:
7560 % o wand: the magick wand.
7564 % o length: the blob length.
7567 WandExport MagickBooleanType MagickPingImageBlob(MagickWand *wand,
7568 const void *blob,const size_t length)
7576 assert(wand != (MagickWand *) NULL);
7577 assert(wand->signature == WandSignature);
7578 if (wand->debug != MagickFalse)
7579 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7580 read_info=CloneImageInfo(wand->image_info);
7581 SetImageInfoBlob(read_info,blob,length);
7582 images=PingImage(read_info,wand->exception);
7583 read_info=DestroyImageInfo(read_info);
7584 if (images == (Image *) NULL)
7585 return(MagickFalse);
7586 return(InsertImageInWand(wand,images));
7590 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7594 % M a g i c k P i n g I m a g e F i l e %
7598 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7600 % MagickPingImageFile() pings an image or image sequence from an open file
7603 % The format of the MagickPingImageFile method is:
7605 % MagickBooleanType MagickPingImageFile(MagickWand *wand,FILE *file)
7607 % A description of each parameter follows:
7609 % o wand: the magick wand.
7611 % o file: the file descriptor.
7614 WandExport MagickBooleanType MagickPingImageFile(MagickWand *wand,FILE *file)
7622 assert(wand != (MagickWand *) NULL);
7623 assert(wand->signature == WandSignature);
7624 assert(file != (FILE *) NULL);
7625 if (wand->debug != MagickFalse)
7626 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7627 read_info=CloneImageInfo(wand->image_info);
7628 SetImageInfoFile(read_info,file);
7629 images=PingImage(read_info,wand->exception);
7630 read_info=DestroyImageInfo(read_info);
7631 if (images == (Image *) NULL)
7632 return(MagickFalse);
7633 return(InsertImageInWand(wand,images));
7637 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7641 % M a g i c k P o l a r o i d I m a g e %
7645 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7647 % MagickPolaroidImage() simulates a Polaroid picture.
7649 % The format of the MagickPolaroidImage method is:
7651 % MagickBooleanType MagickPolaroidImage(MagickWand *wand,
7652 % const DrawingWand *drawing_wand,const double angle)
7654 % A description of each parameter follows:
7656 % o wand: the magick wand.
7658 % o drawing_wand: the draw wand.
7660 % o angle: Apply the effect along this angle.
7663 WandExport MagickBooleanType MagickPolaroidImage(MagickWand *wand,
7664 const DrawingWand *drawing_wand,const double angle)
7672 assert(wand != (MagickWand *) NULL);
7673 assert(wand->signature == WandSignature);
7674 if (wand->debug != MagickFalse)
7675 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7676 if (wand->images == (Image *) NULL)
7677 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7678 draw_info=PeekDrawingWand(drawing_wand);
7679 if (draw_info == (DrawInfo *) NULL)
7680 return(MagickFalse);
7681 polaroid_image=PolaroidImage(wand->images,draw_info,angle,wand->exception);
7682 if (polaroid_image == (Image *) NULL)
7683 return(MagickFalse);
7684 ReplaceImageInList(&wand->images,polaroid_image);
7689 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7693 % M a g i c k P o s t e r i z e I m a g e %
7697 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7699 % MagickPosterizeImage() reduces the image to a limited number of color level.
7701 % The format of the MagickPosterizeImage method is:
7703 % MagickBooleanType MagickPosterizeImage(MagickWand *wand,
7704 % const unsigned levels,const MagickBooleanType dither)
7706 % A description of each parameter follows:
7708 % o wand: the magick wand.
7710 % o levels: Number of color levels allowed in each channel. Very low values
7711 % (2, 3, or 4) have the most visible effect.
7713 % o dither: Set this integer value to something other than zero to dither
7717 WandExport MagickBooleanType MagickPosterizeImage(MagickWand *wand,
7718 const unsigned long levels,const MagickBooleanType dither)
7723 assert(wand != (MagickWand *) NULL);
7724 assert(wand->signature == WandSignature);
7725 if (wand->debug != MagickFalse)
7726 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7727 if (wand->images == (Image *) NULL)
7728 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7729 status=PosterizeImage(wand->images,levels,dither);
7730 if (status == MagickFalse)
7731 InheritException(wand->exception,&wand->images->exception);
7736 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7740 % M a g i c k P r e v i e w I m a g e s %
7744 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7746 % MagickPreviewImages() tiles 9 thumbnails of the specified image with an
7747 % image processing operation applied at varying strengths. This helpful
7748 % to quickly pin-point an appropriate parameter for an image processing
7751 % The format of the MagickPreviewImages method is:
7753 % MagickWand *MagickPreviewImages(MagickWand *wand,
7754 % const PreviewType preview)
7756 % A description of each parameter follows:
7758 % o wand: the magick wand.
7760 % o preview: the preview type.
7763 WandExport MagickWand *MagickPreviewImages(MagickWand *wand,
7764 const PreviewType preview)
7769 assert(wand != (MagickWand *) NULL);
7770 assert(wand->signature == WandSignature);
7771 if (wand->debug != MagickFalse)
7772 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7773 if (wand->images == (Image *) NULL)
7774 return((MagickWand *) NULL);
7775 preview_image=PreviewImage(wand->images,preview,wand->exception);
7776 if (preview_image == (Image *) NULL)
7777 return((MagickWand *) NULL);
7778 return(CloneMagickWandFromImages(wand,preview_image));
7782 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7786 % M a g i c k P r e v i o u s I m a g e %
7790 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7792 % MagickPreviousImage() assocates the previous image in an image list with
7795 % The format of the MagickPreviousImage method is:
7797 % MagickBooleanType MagickPreviousImage(MagickWand *wand)
7799 % A description of each parameter follows:
7801 % o wand: the magick wand.
7804 WandExport MagickBooleanType MagickPreviousImage(MagickWand *wand)
7806 assert(wand != (MagickWand *) NULL);
7807 assert(wand->signature == WandSignature);
7808 if (wand->debug != MagickFalse)
7809 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7810 if (wand->images == (Image *) NULL)
7811 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7812 if (wand->pend != MagickFalse)
7814 wand->pend=MagickFalse;
7817 if (GetPreviousImageInList(wand->images) == (Image *) NULL)
7819 wand->pend=MagickTrue;
7820 return(MagickFalse);
7822 wand->images=GetPreviousImageInList(wand->images);
7827 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7831 % M a g i c k Q u a n t i z e I m a g e %
7835 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7837 % MagickQuantizeImage() analyzes the colors within a reference image and
7838 % chooses a fixed number of colors to represent the image. The goal of the
7839 % algorithm is to minimize the color difference between the input and output
7840 % image while minimizing the processing time.
7842 % The format of the MagickQuantizeImage method is:
7844 % MagickBooleanType MagickQuantizeImage(MagickWand *wand,
7845 % const unsigned long number_colors,const ColorspaceType colorspace,
7846 % const unsigned long treedepth,const MagickBooleanType dither,
7847 % const MagickBooleanType measure_error)
7849 % A description of each parameter follows:
7851 % o wand: the magick wand.
7853 % o number_colors: the number of colors.
7855 % o colorspace: Perform color reduction in this colorspace, typically
7858 % o treedepth: Normally, this integer value is zero or one. A zero or
7859 % 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
7860 % reference image with the least amount of memory and the fastest
7861 % computational speed. In some cases, such as an image with low color
7862 % dispersion (a few number of colors), a value other than
7863 % Log4(number_colors) is required. To expand the color tree completely,
7866 % o dither: A value other than zero distributes the difference between an
7867 % original image and the corresponding color reduced image to
7868 % neighboring pixels along a Hilbert curve.
7870 % o measure_error: A value other than zero measures the difference between
7871 % the original and quantized images. This difference is the total
7872 % quantization error. The error is computed by summing over all pixels
7873 % in an image the distance squared in RGB space between each reference
7874 % pixel value and its quantized value.
7877 WandExport MagickBooleanType MagickQuantizeImage(MagickWand *wand,
7878 const unsigned long number_colors,const ColorspaceType colorspace,
7879 const unsigned long treedepth,const MagickBooleanType dither,
7880 const MagickBooleanType measure_error)
7888 assert(wand != (MagickWand *) NULL);
7889 assert(wand->signature == WandSignature);
7890 if (wand->debug != MagickFalse)
7891 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7892 if (wand->images == (Image *) NULL)
7893 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7894 quantize_info=CloneQuantizeInfo((QuantizeInfo *) NULL);
7895 quantize_info->number_colors=number_colors;
7896 quantize_info->dither=dither;
7897 quantize_info->tree_depth=treedepth;
7898 quantize_info->colorspace=colorspace;
7899 quantize_info->measure_error=measure_error;
7900 status=QuantizeImage(quantize_info,wand->images);
7901 if (status == MagickFalse)
7902 InheritException(wand->exception,&wand->images->exception);
7903 quantize_info=DestroyQuantizeInfo(quantize_info);
7908 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7912 % M a g i c k Q u a n t i z e I m a g e s %
7916 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7918 % MagickQuantizeImages() analyzes the colors within a sequence of images and
7919 % chooses a fixed number of colors to represent the image. The goal of the
7920 % algorithm is to minimize the color difference between the input and output
7921 % image while minimizing the processing time.
7923 % The format of the MagickQuantizeImages method is:
7925 % MagickBooleanType MagickQuantizeImages(MagickWand *wand,
7926 % const unsigned long number_colors,const ColorspaceType colorspace,
7927 % const unsigned long treedepth,const MagickBooleanType dither,
7928 % const MagickBooleanType measure_error)
7930 % A description of each parameter follows:
7932 % o wand: the magick wand.
7934 % o number_colors: the number of colors.
7936 % o colorspace: Perform color reduction in this colorspace, typically
7939 % o treedepth: Normally, this integer value is zero or one. A zero or
7940 % 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
7941 % reference image with the least amount of memory and the fastest
7942 % computational speed. In some cases, such as an image with low color
7943 % dispersion (a few number of colors), a value other than
7944 % Log4(number_colors) is required. To expand the color tree completely,
7947 % o dither: A value other than zero distributes the difference between an
7948 % original image and the corresponding color reduced algorithm to
7949 % neighboring pixels along a Hilbert curve.
7951 % o measure_error: A value other than zero measures the difference between
7952 % the original and quantized images. This difference is the total
7953 % quantization error. The error is computed by summing over all pixels
7954 % in an image the distance squared in RGB space between each reference
7955 % pixel value and its quantized value.
7958 WandExport MagickBooleanType MagickQuantizeImages(MagickWand *wand,
7959 const unsigned long number_colors,const ColorspaceType colorspace,
7960 const unsigned long treedepth,const MagickBooleanType dither,
7961 const MagickBooleanType measure_error)
7969 assert(wand != (MagickWand *) NULL);
7970 assert(wand->signature == WandSignature);
7971 if (wand->debug != MagickFalse)
7972 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7973 if (wand->images == (Image *) NULL)
7974 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7975 quantize_info=CloneQuantizeInfo((QuantizeInfo *) NULL);
7976 quantize_info->number_colors=number_colors;
7977 quantize_info->dither=dither;
7978 quantize_info->tree_depth=treedepth;
7979 quantize_info->colorspace=colorspace;
7980 quantize_info->measure_error=measure_error;
7981 status=QuantizeImages(quantize_info,wand->images);
7982 if (status == MagickFalse)
7983 InheritException(wand->exception,&wand->images->exception);
7984 quantize_info=DestroyQuantizeInfo(quantize_info);
7989 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7993 % M a g i c k R a d i a l B l u r I m a g e %
7997 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7999 % MagickRadialBlurImage() radial blurs an image.
8001 % The format of the MagickRadialBlurImage method is:
8003 % MagickBooleanType MagickRadialBlurImage(MagickWand *wand,
8004 % const double angle)
8005 % MagickBooleanType MagickRadialBlurImageChannel(MagickWand *wand,
8006 % const ChannelType channel,const double angle)
8008 % A description of each parameter follows:
8010 % o wand: the magick wand.
8012 % o channel: the image channel(s).
8014 % o angle: the angle of the blur in degrees.
8017 WandExport MagickBooleanType MagickRadialBlurImage(MagickWand *wand,
8023 status=MagickRadialBlurImageChannel(wand,DefaultChannels,angle);
8027 WandExport MagickBooleanType MagickRadialBlurImageChannel(MagickWand *wand,
8028 const ChannelType channel,const double angle)
8033 assert(wand != (MagickWand *) NULL);
8034 assert(wand->signature == WandSignature);
8035 if (wand->debug != MagickFalse)
8036 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8037 if (wand->images == (Image *) NULL)
8038 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8039 blur_image=RadialBlurImageChannel(wand->images,channel,angle,
8041 if (blur_image == (Image *) NULL)
8042 return(MagickFalse);
8043 ReplaceImageInList(&wand->images,blur_image);
8048 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8052 % M a g i c k R a i s e I m a g e %
8056 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8058 % MagickRaiseImage() creates a simulated three-dimensional button-like effect
8059 % by lightening and darkening the edges of the image. Members width and
8060 % height of raise_info define the width of the vertical and horizontal
8061 % edge of the effect.
8063 % The format of the MagickRaiseImage method is:
8065 % MagickBooleanType MagickRaiseImage(MagickWand *wand,
8066 % const unsigned long width,const unsigned long height,const long x,
8067 % const long y,const MagickBooleanType raise)
8069 % A description of each parameter follows:
8071 % o wand: the magick wand.
8073 % o width,height,x,y: Define the dimensions of the area to raise.
8075 % o raise: A value other than zero creates a 3-D raise effect,
8076 % otherwise it has a lowered effect.
8079 WandExport MagickBooleanType MagickRaiseImage(MagickWand *wand,
8080 const unsigned long width,const unsigned long height,const long x,
8081 const long y,const MagickBooleanType raise)
8089 assert(wand != (MagickWand *) NULL);
8090 assert(wand->signature == WandSignature);
8091 if (wand->debug != MagickFalse)
8092 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8093 if (wand->images == (Image *) NULL)
8094 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8095 raise_info.width=width;
8096 raise_info.height=height;
8099 status=RaiseImage(wand->images,&raise_info,raise);
8100 if (status == MagickFalse)
8101 InheritException(wand->exception,&wand->images->exception);
8106 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8110 % 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 %
8114 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8116 % MagickRandomThresholdImage() changes the value of individual pixels based on
8117 % the intensity of each pixel compared to threshold. The result is a
8118 % high-contrast, two color image.
8120 % The format of the MagickRandomThresholdImage method is:
8122 % MagickBooleanType MagickRandomThresholdImage(MagickWand *wand,
8123 % const double low,const double high)
8124 % MagickBooleanType MagickRandomThresholdImageChannel(MagickWand *wand,
8125 % const ChannelType channel,const double low,const double high)
8127 % A description of each parameter follows:
8129 % o wand: the magick wand.
8131 % o channel: the image channel(s).
8133 % o low,high: Specify the high and low thresholds. These values range from
8134 % 0 to QuantumRange.
8138 WandExport MagickBooleanType MagickRandomThresholdImage(MagickWand *wand,
8139 const double low,const double high)
8144 status=MagickRandomThresholdImageChannel(wand,DefaultChannels,low,high);
8148 WandExport MagickBooleanType MagickRandomThresholdImageChannel(
8149 MagickWand *wand,const ChannelType channel,const double low,
8153 threshold[MaxTextExtent];
8158 assert(wand != (MagickWand *) NULL);
8159 assert(wand->signature == WandSignature);
8160 if (wand->debug != MagickFalse)
8161 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8162 if (wand->images == (Image *) NULL)
8163 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8164 (void) FormatMagickString(threshold,MaxTextExtent,"%gx%g",low,high);
8165 status=RandomThresholdImageChannel(wand->images,channel,threshold,
8167 if (status == MagickFalse)
8168 InheritException(wand->exception,&wand->images->exception);
8173 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8177 % M a g i c k R e a d I m a g e %
8181 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8183 % MagickReadImage() reads an image or image sequence. The images are inserted
8184 % at the current image pointer position. Use MagickSetFirstIterator(),
8185 % MagickSetLastIterator, or MagickSetImageIndex() to specify the current
8186 % image pointer position at the beginning of the image list, the end, or
8187 % anywhere in-between respectively.
8189 % The format of the MagickReadImage method is:
8191 % MagickBooleanType MagickReadImage(MagickWand *wand,const char *filename)
8193 % A description of each parameter follows:
8195 % o wand: the magick wand.
8197 % o filename: the image filename.
8200 WandExport MagickBooleanType MagickReadImage(MagickWand *wand,
8201 const char *filename)
8209 assert(wand != (MagickWand *) NULL);
8210 assert(wand->signature == WandSignature);
8211 if (wand->debug != MagickFalse)
8212 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8213 read_info=CloneImageInfo(wand->image_info);
8214 if (filename != (const char *) NULL)
8215 (void) CopyMagickString(read_info->filename,filename,MaxTextExtent);
8216 images=ReadImage(read_info,wand->exception);
8217 read_info=DestroyImageInfo(read_info);
8218 if (images == (Image *) NULL)
8219 return(MagickFalse);
8220 return(InsertImageInWand(wand,images));
8224 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8228 % M a g i c k R e a d I m a g e B l o b %
8232 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8234 % MagickReadImageBlob() reads an image or image sequence from a blob.
8236 % The format of the MagickReadImageBlob method is:
8238 % MagickBooleanType MagickReadImageBlob(MagickWand *wand,
8239 % const void *blob,const size_t length)
8241 % A description of each parameter follows:
8243 % o wand: the magick wand.
8247 % o length: the blob length.
8250 WandExport MagickBooleanType MagickReadImageBlob(MagickWand *wand,
8251 const void *blob,const size_t length)
8256 assert(wand != (MagickWand *) NULL);
8257 assert(wand->signature == WandSignature);
8258 if (wand->debug != MagickFalse)
8259 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8260 images=BlobToImage(wand->image_info,blob,length,wand->exception);
8261 if (images == (Image *) NULL)
8262 return(MagickFalse);
8263 return(InsertImageInWand(wand,images));
8267 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8271 % M a g i c k R e a d I m a g e F i l e %
8275 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8277 % MagickReadImageFile() reads an image or image sequence from an open file
8280 % The format of the MagickReadImageFile method is:
8282 % MagickBooleanType MagickReadImageFile(MagickWand *wand,FILE *file)
8284 % A description of each parameter follows:
8286 % o wand: the magick wand.
8288 % o file: the file descriptor.
8291 WandExport MagickBooleanType MagickReadImageFile(MagickWand *wand,FILE *file)
8299 assert(wand != (MagickWand *) NULL);
8300 assert(wand->signature == WandSignature);
8301 assert(file != (FILE *) NULL);
8302 if (wand->debug != MagickFalse)
8303 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8304 read_info=CloneImageInfo(wand->image_info);
8305 SetImageInfoFile(read_info,file);
8306 images=ReadImage(read_info,wand->exception);
8307 read_info=DestroyImageInfo(read_info);
8308 if (images == (Image *) NULL)
8309 return(MagickFalse);
8310 return(InsertImageInWand(wand,images));
8314 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8318 % M a g i c k R e c o l o r I m a g e %
8322 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8324 % MagickRecolorImage() translate, scale, shear, or rotate image colors.
8325 % Although you can use variable sized matrices, typically you use a 5 x 5 for
8326 % an RGBA image and a 6x6 for CMYKA. Populate the last row with normalized
8327 % values to translate.
8329 % The format of the MagickRecolorImage method is:
8331 % MagickBooleanType MagickRecolorImage(MagickWand *wand,
8332 % const unsigned long order,const double *color_matrix)
8334 % A description of each parameter follows:
8336 % o wand: the magick wand.
8338 % o order: the number of columns and rows in the color matrix.
8340 % o color_matrix: An array of doubles representing the color matrix.
8343 WandExport MagickBooleanType MagickRecolorImage(MagickWand *wand,
8344 const unsigned long order,const double *color_matrix)
8349 assert(wand != (MagickWand *) NULL);
8350 assert(wand->signature == WandSignature);
8351 if (wand->debug != MagickFalse)
8352 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8353 if (color_matrix == (const double *) NULL)
8354 return(MagickFalse);
8355 if (wand->images == (Image *) NULL)
8356 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8357 transform_image=RecolorImage(wand->images,order,color_matrix,
8359 if (transform_image == (Image *) NULL)
8360 return(MagickFalse);
8361 ReplaceImageInList(&wand->images,transform_image);
8366 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8370 % M a g i c k R e d u c e N o i s e I m a g e %
8374 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8376 % MagickReduceNoiseImage() smooths the contours of an image while still
8377 % preserving edge information. The algorithm works by replacing each pixel
8378 % with its neighbor closest in value. A neighbor is defined by radius. Use
8379 % a radius of 0 and ReduceNoise() selects a suitable radius for you.
8381 % The format of the MagickReduceNoiseImage method is:
8383 % MagickBooleanType MagickReduceNoiseImage(MagickWand *wand,
8384 % const double radius)
8386 % A description of each parameter follows:
8388 % o wand: the magick wand.
8390 % o radius: the radius of the pixel neighborhood.
8393 WandExport MagickBooleanType MagickReduceNoiseImage(MagickWand *wand,
8394 const double radius)
8399 assert(wand != (MagickWand *) NULL);
8400 assert(wand->signature == WandSignature);
8401 if (wand->debug != MagickFalse)
8402 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8403 if (wand->images == (Image *) NULL)
8404 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8405 noise_image=ReduceNoiseImage(wand->images,radius,wand->exception);
8406 if (noise_image == (Image *) NULL)
8407 return(MagickFalse);
8408 ReplaceImageInList(&wand->images,noise_image);
8413 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8417 % M a g i c k R e m a p I m a g e %
8421 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8423 % MagickRemapImage() replaces the colors of an image with the closest color
8424 % from a reference image.
8426 % The format of the MagickRemapImage method is:
8428 % MagickBooleanType MagickRemapImage(MagickWand *wand,
8429 % const MagickWand *remap_wand,const DitherMethod method)
8431 % A description of each parameter follows:
8433 % o wand: the magick wand.
8435 % o affinity: the affinity wand.
8437 % o method: choose from these dither methods: NoDitherMethod,
8438 % RiemersmaDitherMethod, or FloydSteinbergDitherMethod.
8441 WandExport MagickBooleanType MagickRemapImage(MagickWand *wand,
8442 const MagickWand *remap_wand,const DitherMethod method)
8450 assert(wand != (MagickWand *) NULL);
8451 assert(wand->signature == WandSignature);
8452 if (wand->debug != MagickFalse)
8453 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8454 if ((wand->images == (Image *) NULL) ||
8455 (remap_wand->images == (Image *) NULL))
8456 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8457 quantize_info=AcquireQuantizeInfo(wand->image_info);
8458 quantize_info->dither_method=method;
8459 if (method == NoDitherMethod)
8460 quantize_info->dither=MagickFalse;
8461 status=RemapImage(quantize_info,wand->images,remap_wand->images);
8462 quantize_info=DestroyQuantizeInfo(quantize_info);
8463 if (status == MagickFalse)
8464 InheritException(wand->exception,&wand->images->exception);
8469 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8473 % M a g i c k R e m o v e I m a g e %
8477 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8479 % MagickRemoveImage() removes an image from the image list.
8481 % The format of the MagickRemoveImage method is:
8483 % MagickBooleanType MagickRemoveImage(MagickWand *wand)
8485 % A description of each parameter follows:
8487 % o wand: the magick wand.
8489 % o insert: the splice wand.
8492 WandExport MagickBooleanType MagickRemoveImage(MagickWand *wand)
8494 assert(wand != (MagickWand *) NULL);
8495 assert(wand->signature == WandSignature);
8496 if (wand->debug != MagickFalse)
8497 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8498 if (wand->images == (Image *) NULL)
8499 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8500 DeleteImageFromList(&wand->images);
8505 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8509 % M a g i c k R e s a m p l e I m a g e %
8513 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8515 % MagickResampleImage() resample image to desired resolution.
8517 % Bessel Blackman Box
8518 % Catrom Cubic Gaussian
8519 % Hanning Hermite Lanczos
8520 % Mitchell Point Quandratic
8523 % Most of the filters are FIR (finite impulse response), however, Bessel,
8524 % Gaussian, and Sinc are IIR (infinite impulse response). Bessel and Sinc
8525 % are windowed (brought down to zero) with the Blackman filter.
8527 % The format of the MagickResampleImage method is:
8529 % MagickBooleanType MagickResampleImage(MagickWand *wand,
8530 % const double x_resolution,const double y_resolution,
8531 % const FilterTypes filter,const double blur)
8533 % A description of each parameter follows:
8535 % o wand: the magick wand.
8537 % o x_resolution: the new image x resolution.
8539 % o y_resolution: the new image y resolution.
8541 % o filter: Image filter to use.
8543 % o blur: the blur factor where > 1 is blurry, < 1 is sharp.
8546 WandExport MagickBooleanType MagickResampleImage(MagickWand *wand,
8547 const double x_resolution,const double y_resolution,const FilterTypes filter,
8553 assert(wand != (MagickWand *) NULL);
8554 assert(wand->signature == WandSignature);
8555 if (wand->debug != MagickFalse)
8556 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8557 if (wand->images == (Image *) NULL)
8558 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8559 resample_image=ResampleImage(wand->images,x_resolution,y_resolution,filter,
8560 blur,wand->exception);
8561 if (resample_image == (Image *) NULL)
8562 return(MagickFalse);
8563 ReplaceImageInList(&wand->images,resample_image);
8568 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8572 % M a g i c k R e s e t I m a g e P a g e %
8576 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8578 % MagickResetImagePage() resets the Wand page canvas and position.
8580 % The format of the MagickResetImagePage method is:
8582 % MagickBooleanType MagickResetImagePage(MagickWand *wand,
8585 % A description of each parameter follows:
8587 % o wand: the magick wand.
8589 % o page: the relative page specification.
8592 WandExport MagickBooleanType MagickResetImagePage(MagickWand *wand,
8595 assert(wand != (MagickWand *) NULL);
8596 assert(wand->signature == WandSignature);
8597 if (wand->debug != MagickFalse)
8598 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8599 if (wand->images == (Image *) NULL)
8600 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8601 if ((page == (char *) NULL) || (*page == '\0'))
8603 (void) ParseAbsoluteGeometry("0x0+0+0",&wand->images->page);
8606 return(ResetImagePage(wand->images,page));
8610 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8614 % M a g i c k R e s i z e I m a g e %
8618 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8620 % MagickResizeImage() scales an image to the desired dimensions with one of
8623 % Bessel Blackman Box
8624 % Catrom Cubic Gaussian
8625 % Hanning Hermite Lanczos
8626 % Mitchell Point Quandratic
8629 % Most of the filters are FIR (finite impulse response), however, Bessel,
8630 % Gaussian, and Sinc are IIR (infinite impulse response). Bessel and Sinc
8631 % are windowed (brought down to zero) with the Blackman filter.
8633 % The format of the MagickResizeImage method is:
8635 % MagickBooleanType MagickResizeImage(MagickWand *wand,
8636 % const unsigned long columns,const unsigned long rows,
8637 % const FilterTypes filter,const double blur)
8639 % A description of each parameter follows:
8641 % o wand: the magick wand.
8643 % o columns: the number of columns in the scaled image.
8645 % o rows: the number of rows in the scaled image.
8647 % o filter: Image filter to use.
8649 % o blur: the blur factor where > 1 is blurry, < 1 is sharp.
8652 WandExport MagickBooleanType MagickResizeImage(MagickWand *wand,
8653 const unsigned long columns,const unsigned long rows,const FilterTypes filter,
8659 assert(wand != (MagickWand *) NULL);
8660 assert(wand->signature == WandSignature);
8661 if (wand->debug != MagickFalse)
8662 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8663 if (wand->images == (Image *) NULL)
8664 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8665 resize_image=ResizeImage(wand->images,columns,rows,filter,blur,
8667 if (resize_image == (Image *) NULL)
8668 return(MagickFalse);
8669 ReplaceImageInList(&wand->images,resize_image);
8674 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8678 % M a g i c k R o l l I m a g e %
8682 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8684 % MagickRollImage() offsets an image as defined by x and y.
8686 % The format of the MagickRollImage method is:
8688 % MagickBooleanType MagickRollImage(MagickWand *wand,const long x,
8689 % const unsigned long y)
8691 % A description of each parameter follows:
8693 % o wand: the magick wand.
8695 % o x: the x offset.
8697 % o y: the y offset.
8701 WandExport MagickBooleanType MagickRollImage(MagickWand *wand,
8702 const long x,const long y)
8707 assert(wand != (MagickWand *) NULL);
8708 assert(wand->signature == WandSignature);
8709 if (wand->debug != MagickFalse)
8710 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8711 if (wand->images == (Image *) NULL)
8712 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8713 roll_image=RollImage(wand->images,x,y,wand->exception);
8714 if (roll_image == (Image *) NULL)
8715 return(MagickFalse);
8716 ReplaceImageInList(&wand->images,roll_image);
8721 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8725 % M a g i c k R o t a t e I m a g e %
8729 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8731 % MagickRotateImage() rotates an image the specified number of degrees. Empty
8732 % triangles left over from rotating the image are filled with the
8735 % The format of the MagickRotateImage method is:
8737 % MagickBooleanType MagickRotateImage(MagickWand *wand,
8738 % const PixelWand *background,const double degrees)
8740 % A description of each parameter follows:
8742 % o wand: the magick wand.
8744 % o background: the background pixel wand.
8746 % o degrees: the number of degrees to rotate the image.
8750 WandExport MagickBooleanType MagickRotateImage(MagickWand *wand,
8751 const PixelWand *background,const double degrees)
8756 assert(wand != (MagickWand *) NULL);
8757 assert(wand->signature == WandSignature);
8758 if (wand->debug != MagickFalse)
8759 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8760 if (wand->images == (Image *) NULL)
8761 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8762 PixelGetQuantumColor(background,&wand->images->background_color);
8763 rotate_image=RotateImage(wand->images,degrees,wand->exception);
8764 if (rotate_image == (Image *) NULL)
8765 return(MagickFalse);
8766 ReplaceImageInList(&wand->images,rotate_image);
8771 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8775 % M a g i c k S a m p l e I m a g e %
8779 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8781 % MagickSampleImage() scales an image to the desired dimensions with pixel
8782 % sampling. Unlike other scaling methods, this method does not introduce
8783 % any additional color into the scaled image.
8785 % The format of the MagickSampleImage method is:
8787 % MagickBooleanType MagickSampleImage(MagickWand *wand,
8788 % const unsigned long columns,const unsigned long rows)
8790 % A description of each parameter follows:
8792 % o wand: the magick wand.
8794 % o columns: the number of columns in the scaled image.
8796 % o rows: the number of rows in the scaled image.
8800 WandExport MagickBooleanType MagickSampleImage(MagickWand *wand,
8801 const unsigned long columns,const unsigned long rows)
8806 assert(wand != (MagickWand *) NULL);
8807 assert(wand->signature == WandSignature);
8808 if (wand->debug != MagickFalse)
8809 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8810 if (wand->images == (Image *) NULL)
8811 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8812 sample_image=SampleImage(wand->images,columns,rows,wand->exception);
8813 if (sample_image == (Image *) NULL)
8814 return(MagickFalse);
8815 ReplaceImageInList(&wand->images,sample_image);
8820 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8824 % M a g i c k S c a l e I m a g e %
8828 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8830 % MagickScaleImage() scales the size of an image to the given dimensions.
8832 % The format of the MagickScaleImage method is:
8834 % MagickBooleanType MagickScaleImage(MagickWand *wand,
8835 % const unsigned long columns,const unsigned long rows)
8837 % A description of each parameter follows:
8839 % o wand: the magick wand.
8841 % o columns: the number of columns in the scaled image.
8843 % o rows: the number of rows in the scaled image.
8847 WandExport MagickBooleanType MagickScaleImage(MagickWand *wand,
8848 const unsigned long columns,const unsigned long rows)
8853 assert(wand != (MagickWand *) NULL);
8854 assert(wand->signature == WandSignature);
8855 if (wand->debug != MagickFalse)
8856 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8857 if (wand->images == (Image *) NULL)
8858 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8859 scale_image=ScaleImage(wand->images,columns,rows,wand->exception);
8860 if (scale_image == (Image *) NULL)
8861 return(MagickFalse);
8862 ReplaceImageInList(&wand->images,scale_image);
8867 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8871 % M a g i c k S e g m e n t I m a g e %
8875 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8877 % MagickSegmentImage() segments an image by analyzing the histograms of the
8878 % color components and identifying units that are homogeneous with the fuzzy
8879 % C-means technique.
8881 % The format of the SegmentImage method is:
8883 % MagickBooleanType MagickSegmentImage(MagickWand *wand,
8884 % const ColorspaceType colorspace,const MagickBooleanType verbose,
8885 % const double cluster_threshold,const double smooth_threshold)
8887 % A description of each parameter follows.
8891 % o colorspace: the image colorspace.
8893 % o verbose: Set to MagickTrue to print detailed information about the
8894 % identified classes.
8896 % o cluster_threshold: This represents the minimum number of pixels
8897 % contained in a hexahedra before it can be considered valid (expressed as
8900 % o smooth_threshold: the smoothing threshold eliminates noise in the second
8901 % derivative of the histogram. As the value is increased, you can expect a
8902 % smoother second derivative.
8905 MagickExport MagickBooleanType MagickSegmentImage(MagickWand *wand,
8906 const ColorspaceType colorspace,const MagickBooleanType verbose,
8907 const double cluster_threshold,const double smooth_threshold)
8912 assert(wand != (MagickWand *) NULL);
8913 assert(wand->signature == WandSignature);
8914 if (wand->debug != MagickFalse)
8915 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8916 if (wand->images == (Image *) NULL)
8917 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8918 status=SegmentImage(wand->images,colorspace,verbose,cluster_threshold,
8920 if (status == MagickFalse)
8921 InheritException(wand->exception,&wand->images->exception);
8926 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8930 % M a g i c k S e l e c t i v e B l u r I m a g e %
8934 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8936 % MagickSelectiveBlurImage() selectively blur an image within a contrast
8937 % threshold. It is similar to the unsharpen mask that sharpens everything with
8938 % contrast above a certain threshold.
8940 % The format of the MagickSelectiveBlurImage method is:
8942 % MagickBooleanType MagickSelectiveBlurImage(MagickWand *wand,
8943 % const double radius,const double sigma,const double threshold)
8944 % MagickBooleanType MagickSelectiveBlurImageChannel(MagickWand *wand,
8945 % const ChannelType channel,const double radius,const double sigma,
8946 % const double threshold)
8948 % A description of each parameter follows:
8950 % o wand: the magick wand.
8952 % o channel: the image channel(s).
8954 % o radius: the radius of the gaussian, in pixels, not counting the center
8957 % o sigma: the standard deviation of the gaussian, in pixels.
8959 % o threshold: only pixels within this contrast threshold are included
8960 % in the blur operation.
8964 WandExport MagickBooleanType MagickSelectiveBlurImage(MagickWand *wand,
8965 const double radius,const double sigma,const double threshold)
8970 status=MagickSelectiveBlurImageChannel(wand,DefaultChannels,radius,sigma,
8975 WandExport MagickBooleanType MagickSelectiveBlurImageChannel(MagickWand *wand,
8976 const ChannelType channel,const double radius,const double sigma,
8977 const double threshold)
8982 assert(wand != (MagickWand *) NULL);
8983 assert(wand->signature == WandSignature);
8984 if (wand->debug != MagickFalse)
8985 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8986 if (wand->images == (Image *) NULL)
8987 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8988 blur_image=SelectiveBlurImageChannel(wand->images,channel,radius,sigma,
8989 threshold,wand->exception);
8990 if (blur_image == (Image *) NULL)
8991 return(MagickFalse);
8992 ReplaceImageInList(&wand->images,blur_image);
8997 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9001 % 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 %
9005 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9007 % MagickSeparateImageChannel() separates a channel from the image and returns a
9008 % grayscale image. A channel is a particular color component of each pixel
9011 % The format of the MagickSeparateImageChannel method is:
9013 % MagickBooleanType MagickSeparateImageChannel(MagickWand *wand,
9014 % const ChannelType channel)
9016 % A description of each parameter follows:
9018 % o wand: the magick wand.
9020 % o channel: the image channel(s).
9023 WandExport MagickBooleanType MagickSeparateImageChannel(MagickWand *wand,
9024 const ChannelType channel)
9029 assert(wand != (MagickWand *) NULL);
9030 assert(wand->signature == WandSignature);
9031 if (wand->debug != MagickFalse)
9032 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9033 if (wand->images == (Image *) NULL)
9034 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9035 status=SeparateImageChannel(wand->images,channel);
9036 if (status == MagickFalse)
9037 InheritException(wand->exception,&wand->images->exception);
9042 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9046 % M a g i c k S e p i a T o n e I m a g e %
9050 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9052 % MagickSepiaToneImage() applies a special effect to the image, similar to the
9053 % effect achieved in a photo darkroom by sepia toning. Threshold ranges from
9054 % 0 to QuantumRange and is a measure of the extent of the sepia toning. A
9055 % threshold of 80% is a good starting point for a reasonable tone.
9057 % The format of the MagickSepiaToneImage method is:
9059 % MagickBooleanType MagickSepiaToneImage(MagickWand *wand,
9060 % const double threshold)
9062 % A description of each parameter follows:
9064 % o wand: the magick wand.
9066 % o threshold: Define the extent of the sepia toning.
9069 WandExport MagickBooleanType MagickSepiaToneImage(MagickWand *wand,
9070 const double threshold)
9075 assert(wand != (MagickWand *) NULL);
9076 assert(wand->signature == WandSignature);
9077 if (wand->debug != MagickFalse)
9078 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9079 if (wand->images == (Image *) NULL)
9080 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9081 sepia_image=SepiaToneImage(wand->images,threshold,wand->exception);
9082 if (sepia_image == (Image *) NULL)
9083 return(MagickFalse);
9084 ReplaceImageInList(&wand->images,sepia_image);
9089 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9093 % M a g i c k S e t I m a g e %
9097 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9099 % MagickSetImage() replaces the last image returned by MagickSetImageIndex(),
9100 % MagickNextImage(), MagickPreviousImage() with the images from the specified
9103 % The format of the MagickSetImage method is:
9105 % MagickBooleanType MagickSetImage(MagickWand *wand,
9106 % const MagickWand *set_wand)
9108 % A description of each parameter follows:
9110 % o wand: the magick wand.
9112 % o set_wand: the set_wand wand.
9115 WandExport MagickBooleanType MagickSetImage(MagickWand *wand,
9116 const MagickWand *set_wand)
9121 assert(wand != (MagickWand *) NULL);
9122 assert(wand->signature == WandSignature);
9123 if (wand->debug != MagickFalse)
9124 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9125 assert(set_wand != (MagickWand *) NULL);
9126 assert(set_wand->signature == WandSignature);
9127 if (wand->debug != MagickFalse)
9128 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",set_wand->name);
9129 if (set_wand->images == (Image *) NULL)
9130 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9131 images=CloneImageList(set_wand->images,wand->exception);
9132 if (images == (Image *) NULL)
9133 return(MagickFalse);
9134 ReplaceImageInList(&wand->images,images);
9139 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9143 % 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 %
9147 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9149 % MagickSetImageAlphaChannel() activates, deactivates, resets, or sets the
9152 % The format of the MagickSetImageAlphaChannel method is:
9154 % MagickBooleanType MagickSetImageAlphaChannel(MagickWand *wand,
9155 % const AlphaChannelType alpha_type)
9157 % A description of each parameter follows:
9159 % o wand: the magick wand.
9161 % o alpha_type: the alpha channel type: ActivateAlphaChannel,
9162 % DeactivateAlphaChannel, OpaqueAlphaChannel, or SetAlphaChannel.
9165 WandExport MagickBooleanType MagickSetImageAlphaChannel(MagickWand *wand,
9166 const AlphaChannelType alpha_type)
9168 assert(wand != (MagickWand *) NULL);
9169 assert(wand->signature == WandSignature);
9170 if (wand->debug != MagickFalse)
9171 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9172 if (wand->images == (Image *) NULL)
9173 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9174 return(SetImageAlphaChannel(wand->images,alpha_type));
9178 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9182 % 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 %
9186 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9188 % MagickSetImageBackgroundColor() sets the image background color.
9190 % The format of the MagickSetImageBackgroundColor method is:
9192 % MagickBooleanType MagickSetImageBackgroundColor(MagickWand *wand,
9193 % const PixelWand *background)
9195 % A description of each parameter follows:
9197 % o wand: the magick wand.
9199 % o background: the background pixel wand.
9202 WandExport MagickBooleanType MagickSetImageBackgroundColor(MagickWand *wand,
9203 const PixelWand *background)
9205 assert(wand != (MagickWand *) NULL);
9206 assert(wand->signature == WandSignature);
9207 if (wand->debug != MagickFalse)
9208 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9209 if (wand->images == (Image *) NULL)
9210 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9211 PixelGetQuantumColor(background,&wand->images->background_color);
9216 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9220 % M a g i c k S e t I m a g e B i a s %
9224 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9226 % MagickSetImageBias() sets the image bias for any method that convolves an
9227 % image (e.g. MagickConvolveImage()).
9229 % The format of the MagickSetImageBias method is:
9231 % MagickBooleanType MagickSetImageBias(MagickWand *wand,
9232 % const double bias)
9234 % A description of each parameter follows:
9236 % o wand: the magick wand.
9238 % o bias: the image bias.
9241 WandExport MagickBooleanType MagickSetImageBias(MagickWand *wand,
9244 assert(wand != (MagickWand *) NULL);
9245 assert(wand->signature == WandSignature);
9246 if (wand->debug != MagickFalse)
9247 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9248 if (wand->images == (Image *) NULL)
9249 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9250 wand->images->bias=bias;
9255 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9259 % 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 %
9263 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9265 % MagickSetImageBluePrimary() sets the image chromaticity blue primary point.
9267 % The format of the MagickSetImageBluePrimary method is:
9269 % MagickBooleanType MagickSetImageBluePrimary(MagickWand *wand,
9270 % const double x,const double y)
9272 % A description of each parameter follows:
9274 % o wand: the magick wand.
9276 % o x: the blue primary x-point.
9278 % o y: the blue primary y-point.
9281 WandExport MagickBooleanType MagickSetImageBluePrimary(MagickWand *wand,
9282 const double x,const double y)
9284 assert(wand != (MagickWand *) NULL);
9285 assert(wand->signature == WandSignature);
9286 if (wand->debug != MagickFalse)
9287 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9288 if (wand->images == (Image *) NULL)
9289 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9290 wand->images->chromaticity.blue_primary.x=x;
9291 wand->images->chromaticity.blue_primary.y=y;
9296 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9300 % 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 %
9304 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9306 % MagickSetImageBorderColor() sets the image border color.
9308 % The format of the MagickSetImageBorderColor method is:
9310 % MagickBooleanType MagickSetImageBorderColor(MagickWand *wand,
9311 % const PixelWand *border)
9313 % A description of each parameter follows:
9315 % o wand: the magick wand.
9317 % o border: the border pixel wand.
9320 WandExport MagickBooleanType MagickSetImageBorderColor(MagickWand *wand,
9321 const PixelWand *border)
9323 assert(wand != (MagickWand *) NULL);
9324 assert(wand->signature == WandSignature);
9325 if (wand->debug != MagickFalse)
9326 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9327 if (wand->images == (Image *) NULL)
9328 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9329 PixelGetQuantumColor(border,&wand->images->border_color);
9334 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9338 % 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 %
9342 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9344 % MagickSetImageChannelDepth() sets the depth of a particular image channel.
9346 % The format of the MagickSetImageChannelDepth method is:
9348 % MagickBooleanType MagickSetImageChannelDepth(MagickWand *wand,
9349 % const ChannelType channel,const unsigned long depth)
9351 % A description of each parameter follows:
9353 % o wand: the magick wand.
9355 % o channel: the image channel(s).
9357 % o depth: the image depth in bits.
9360 WandExport MagickBooleanType MagickSetImageChannelDepth(MagickWand *wand,
9361 const ChannelType channel,const unsigned long depth)
9363 assert(wand != (MagickWand *) NULL);
9364 assert(wand->signature == WandSignature);
9365 if (wand->debug != MagickFalse)
9366 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9367 if (wand->images == (Image *) NULL)
9368 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9369 return(SetImageChannelDepth(wand->images,channel,depth));
9373 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9377 % M a g i c k S e t I m a g e C l i p M a s k %
9381 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9383 % MagickSetImageClipMask() sets image clip mask.
9385 % The format of the MagickSetImageClipMask method is:
9387 % MagickBooleanType MagickSetImageClipMask(MagickWand *wand,
9388 % const MagickWand *clip_mask)
9390 % A description of each parameter follows:
9392 % o wand: the magick wand.
9394 % o clip_mask: the clip_mask wand.
9397 WandExport MagickBooleanType MagickSetImageClipMask(MagickWand *wand,
9398 const MagickWand *clip_mask)
9400 assert(wand != (MagickWand *) NULL);
9401 assert(wand->signature == WandSignature);
9402 if (wand->debug != MagickFalse)
9403 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9404 assert(clip_mask != (MagickWand *) NULL);
9405 assert(clip_mask->signature == WandSignature);
9406 if (wand->debug != MagickFalse)
9407 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",clip_mask->name);
9408 if (clip_mask->images == (Image *) NULL)
9409 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9410 return(SetImageClipMask(wand->images,clip_mask->images));
9414 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9418 % 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 %
9422 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9424 % MagickSetImageColormapColor() sets the color of the specified colormap
9427 % The format of the MagickSetImageColormapColor method is:
9429 % MagickBooleanType MagickSetImageColormapColor(MagickWand *wand,
9430 % const unsigned long index,const PixelWand *color)
9432 % A description of each parameter follows:
9434 % o wand: the magick wand.
9436 % o index: the offset into the image colormap.
9438 % o color: Return the colormap color in this wand.
9441 WandExport MagickBooleanType MagickSetImageColormapColor(MagickWand *wand,
9442 const unsigned long index,const PixelWand *color)
9444 assert(wand != (MagickWand *) NULL);
9445 assert(wand->signature == WandSignature);
9446 if (wand->debug != MagickFalse)
9447 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9448 if (wand->images == (Image *) NULL)
9449 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9450 if ((wand->images->colormap == (PixelPacket *) NULL) ||
9451 (index >= wand->images->colors))
9452 ThrowWandException(WandError,"InvalidColormapIndex",wand->name);
9453 PixelGetQuantumColor(color,wand->images->colormap+index);
9454 return(SyncImage(wand->images));
9458 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9462 % M a g i c k S e t I m a g e C o l o r s p a c e %
9466 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9468 % MagickSetImageColorspace() sets the image colorspace.
9470 % The format of the MagickSetImageColorspace method is:
9472 % MagickBooleanType MagickSetImageColorspace(MagickWand *wand,
9473 % const ColorspaceType colorspace)
9475 % A description of each parameter follows:
9477 % o wand: the magick wand.
9479 % o colorspace: the image colorspace: UndefinedColorspace, RGBColorspace,
9480 % GRAYColorspace, TransparentColorspace, OHTAColorspace, XYZColorspace,
9481 % YCbCrColorspace, YCCColorspace, YIQColorspace, YPbPrColorspace,
9482 % YPbPrColorspace, YUVColorspace, CMYKColorspace, sRGBColorspace,
9483 % HSLColorspace, or HWBColorspace.
9486 WandExport MagickBooleanType MagickSetImageColorspace(MagickWand *wand,
9487 const ColorspaceType colorspace)
9489 assert(wand != (MagickWand *) NULL);
9490 assert(wand->signature == WandSignature);
9491 if (wand->debug != MagickFalse)
9492 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9493 if (wand->images == (Image *) NULL)
9494 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9495 return(SetImageColorspace(wand->images,colorspace));
9499 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9503 % M a g i c k S e t I m a g e C o m p o s e %
9507 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9509 % MagickSetImageCompose() sets the image composite operator, useful for
9510 % specifying how to composite the image thumbnail when using the
9511 % MagickMontageImage() method.
9513 % The format of the MagickSetImageCompose method is:
9515 % MagickBooleanType MagickSetImageCompose(MagickWand *wand,
9516 % const CompositeOperator compose)
9518 % A description of each parameter follows:
9520 % o wand: the magick wand.
9522 % o compose: the image composite operator.
9525 WandExport MagickBooleanType MagickSetImageCompose(MagickWand *wand,
9526 const CompositeOperator compose)
9528 assert(wand != (MagickWand *) NULL);
9529 assert(wand->signature == WandSignature);
9530 if (wand->debug != MagickFalse)
9531 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9532 if (wand->images == (Image *) NULL)
9533 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9534 wand->images->compose=compose;
9539 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9543 % 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 %
9547 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9549 % MagickSetImageCompression() sets the image compression.
9551 % The format of the MagickSetImageCompression method is:
9553 % MagickBooleanType MagickSetImageCompression(MagickWand *wand,
9554 % const CompressionType compression)
9556 % A description of each parameter follows:
9558 % o wand: the magick wand.
9560 % o compression: the image compression type.
9563 WandExport MagickBooleanType MagickSetImageCompression(MagickWand *wand,
9564 const CompressionType compression)
9566 assert(wand != (MagickWand *) NULL);
9567 assert(wand->signature == WandSignature);
9568 if (wand->debug != MagickFalse)
9569 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9570 if (wand->images == (Image *) NULL)
9571 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9572 wand->images->compression=compression;
9577 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9581 % 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 %
9585 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9587 % MagickSetImageCompressionQuality() sets the image compression quality.
9589 % The format of the MagickSetImageCompressionQuality method is:
9591 % MagickBooleanType MagickSetImageCompressionQuality(MagickWand *wand,
9592 % const unsigned long quality)
9594 % A description of each parameter follows:
9596 % o wand: the magick wand.
9598 % o quality: the image compression tlityype.
9601 WandExport MagickBooleanType MagickSetImageCompressionQuality(MagickWand *wand,
9602 const unsigned long quality)
9604 assert(wand != (MagickWand *) NULL);
9605 assert(wand->signature == WandSignature);
9606 if (wand->debug != MagickFalse)
9607 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9608 if (wand->images == (Image *) NULL)
9609 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9610 wand->images->quality=quality;
9615 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9619 % M a g i c k S e t I m a g e D e l a y %
9623 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9625 % MagickSetImageDelay() sets the image delay.
9627 % The format of the MagickSetImageDelay method is:
9629 % MagickBooleanType MagickSetImageDelay(MagickWand *wand,
9630 % const unsigned long delay)
9632 % A description of each parameter follows:
9634 % o wand: the magick wand.
9636 % o delay: the image delay in ticks-per-second units.
9639 WandExport MagickBooleanType MagickSetImageDelay(MagickWand *wand,
9640 const unsigned long delay)
9642 assert(wand != (MagickWand *) NULL);
9643 assert(wand->signature == WandSignature);
9644 if (wand->debug != MagickFalse)
9645 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9646 if (wand->images == (Image *) NULL)
9647 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9648 wand->images->delay=delay;
9653 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9657 % M a g i c k S e t I m a g e D e p t h %
9661 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9663 % MagickSetImageDepth() sets the image depth.
9665 % The format of the MagickSetImageDepth method is:
9667 % MagickBooleanType MagickSetImageDepth(MagickWand *wand,
9668 % const unsigned long depth)
9670 % A description of each parameter follows:
9672 % o wand: the magick wand.
9674 % o depth: the image depth in bits: 8, 16, or 32.
9677 WandExport MagickBooleanType MagickSetImageDepth(MagickWand *wand,
9678 const unsigned long depth)
9680 assert(wand != (MagickWand *) NULL);
9681 assert(wand->signature == WandSignature);
9682 if (wand->debug != MagickFalse)
9683 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9684 if (wand->images == (Image *) NULL)
9685 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9686 wand->images->depth=depth;
9691 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9695 % M a g i c k S e t I m a g e D i s p o s e %
9699 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9701 % MagickSetImageDispose() sets the image disposal method.
9703 % The format of the MagickSetImageDispose method is:
9705 % MagickBooleanType MagickSetImageDispose(MagickWand *wand,
9706 % const DisposeType dispose)
9708 % A description of each parameter follows:
9710 % o wand: the magick wand.
9712 % o dispose: the image disposeal type.
9715 WandExport MagickBooleanType MagickSetImageDispose(MagickWand *wand,
9716 const DisposeType dispose)
9718 assert(wand != (MagickWand *) NULL);
9719 assert(wand->signature == WandSignature);
9720 if (wand->debug != MagickFalse)
9721 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9722 if (wand->images == (Image *) NULL)
9723 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9724 wand->images->dispose=dispose;
9729 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9733 % M a g i c k S e t I m a g e E x t e n t %
9737 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9739 % MagickSetImageExtent() sets the image size (i.e. columns & rows).
9741 % The format of the MagickSetImageExtent method is:
9743 % MagickBooleanType MagickSetImageExtent(MagickWand *wand,
9744 % const unsigned long columns,const unsigned rows)
9746 % A description of each parameter follows:
9748 % o wand: the magick wand.
9750 % o columns: The image width in pixels.
9752 % o rows: The image height in pixels.
9755 WandExport MagickBooleanType MagickSetImageExtent(MagickWand *wand,
9756 const unsigned long columns,const unsigned long rows)
9758 assert(wand != (MagickWand *) NULL);
9759 assert(wand->signature == WandSignature);
9760 if (wand->debug != MagickFalse)
9761 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9762 if (wand->images == (Image *) NULL)
9763 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9764 return(SetImageExtent(wand->images,columns,rows));
9768 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9772 % M a g i c k S e t I m a g e F i l e n a m e %
9776 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9778 % MagickSetImageFilename() sets the filename of a particular image in a
9781 % The format of the MagickSetImageFilename method is:
9783 % MagickBooleanType MagickSetImageFilename(MagickWand *wand,
9784 % const char *filename)
9786 % A description of each parameter follows:
9788 % o wand: the magick wand.
9790 % o filename: the image filename.
9793 WandExport MagickBooleanType MagickSetImageFilename(MagickWand *wand,
9794 const char *filename)
9796 assert(wand != (MagickWand *) NULL);
9797 assert(wand->signature == WandSignature);
9798 if (wand->debug != MagickFalse)
9799 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9800 if (wand->images == (Image *) NULL)
9801 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9802 if (filename != (const char *) NULL)
9803 (void) CopyMagickString(wand->images->filename,filename,MaxTextExtent);
9808 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9812 % M a g i c k S e t I m a g e F o r m a t %
9816 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9818 % MagickSetImageFormat() sets the format of a particular image in a
9821 % The format of the MagickSetImageFormat method is:
9823 % MagickBooleanType MagickSetImageFormat(MagickWand *wand,
9824 % const char *format)
9826 % A description of each parameter follows:
9828 % o wand: the magick wand.
9830 % o format: the image format.
9833 WandExport MagickBooleanType MagickSetImageFormat(MagickWand *wand,
9839 assert(wand != (MagickWand *) NULL);
9840 assert(wand->signature == WandSignature);
9841 if (wand->debug != MagickFalse)
9842 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9843 if (wand->images == (Image *) NULL)
9844 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9845 if ((format == (char *) NULL) || (*format == '\0'))
9847 *wand->images->magick='\0';
9850 magick_info=GetMagickInfo(format,wand->exception);
9851 if (magick_info == (const MagickInfo *) NULL)
9852 return(MagickFalse);
9853 ClearMagickException(wand->exception);
9854 (void) CopyMagickString(wand->images->magick,format,MaxTextExtent);
9859 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9863 % M a g i c k S e t I m a g e F u z z %
9867 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9869 % MagickSetImageFuzz() sets the image fuzz.
9871 % The format of the MagickSetImageFuzz method is:
9873 % MagickBooleanType MagickSetImageFuzz(MagickWand *wand,
9874 % const double fuzz)
9876 % A description of each parameter follows:
9878 % o wand: the magick wand.
9880 % o fuzz: the image fuzz.
9883 WandExport MagickBooleanType MagickSetImageFuzz(MagickWand *wand,
9886 assert(wand != (MagickWand *) NULL);
9887 assert(wand->signature == WandSignature);
9888 if (wand->debug != MagickFalse)
9889 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9890 if (wand->images == (Image *) NULL)
9891 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9892 wand->images->fuzz=fuzz;
9897 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9901 % M a g i c k S e t I m a g e G a m m a %
9905 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9907 % MagickSetImageGamma() sets the image gamma.
9909 % The format of the MagickSetImageGamma method is:
9911 % MagickBooleanType MagickSetImageGamma(MagickWand *wand,
9912 % const double gamma)
9914 % A description of each parameter follows:
9916 % o wand: the magick wand.
9918 % o gamma: the image gamma.
9921 WandExport MagickBooleanType MagickSetImageGamma(MagickWand *wand,
9924 assert(wand != (MagickWand *) NULL);
9925 assert(wand->signature == WandSignature);
9926 if (wand->debug != MagickFalse)
9927 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9928 if (wand->images == (Image *) NULL)
9929 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9930 wand->images->gamma=gamma;
9935 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9939 % M a g i c k S e t I m a g e G r a v i t y %
9943 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9945 % MagickSetImageGravity() sets the image gravity type.
9947 % The format of the MagickSetImageGravity method is:
9949 % MagickBooleanType MagickSetImageGravity(MagickWand *wand,
9950 % const GravityType gravity)
9952 % A description of each parameter follows:
9954 % o wand: the magick wand.
9956 % o gravity: the image interlace scheme: NoInterlace, LineInterlace,
9957 % PlaneInterlace, PartitionInterlace.
9960 WandExport MagickBooleanType MagickSetImageGravity(MagickWand *wand,
9961 const GravityType gravity)
9963 assert(wand != (MagickWand *) NULL);
9964 assert(wand->signature == WandSignature);
9965 if (wand->debug != MagickFalse)
9966 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9967 if (wand->images == (Image *) NULL)
9968 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9969 wand->images->gravity=gravity;
9974 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9978 % 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 %
9982 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9984 % MagickSetImageGreenPrimary() sets the image chromaticity green primary
9987 % The format of the MagickSetImageGreenPrimary method is:
9989 % MagickBooleanType MagickSetImageGreenPrimary(MagickWand *wand,
9990 % const double x,const double y)
9992 % A description of each parameter follows:
9994 % o wand: the magick wand.
9996 % o x: the green primary x-point.
9998 % o y: the green primary y-point.
10002 WandExport MagickBooleanType MagickSetImageGreenPrimary(MagickWand *wand,
10003 const double x,const double y)
10005 assert(wand != (MagickWand *) NULL);
10006 assert(wand->signature == WandSignature);
10007 if (wand->debug != MagickFalse)
10008 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10009 if (wand->images == (Image *) NULL)
10010 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10011 wand->images->chromaticity.green_primary.x=x;
10012 wand->images->chromaticity.green_primary.y=y;
10013 return(MagickTrue);
10017 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10021 % 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 %
10025 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10027 % MagickSetImageInterlaceScheme() sets the image interlace scheme.
10029 % The format of the MagickSetImageInterlaceScheme method is:
10031 % MagickBooleanType MagickSetImageInterlaceScheme(MagickWand *wand,
10032 % const InterlaceType interlace)
10034 % A description of each parameter follows:
10036 % o wand: the magick wand.
10038 % o interlace: the image interlace scheme: NoInterlace, LineInterlace,
10039 % PlaneInterlace, PartitionInterlace.
10042 WandExport MagickBooleanType MagickSetImageInterlaceScheme(MagickWand *wand,
10043 const InterlaceType interlace)
10045 assert(wand != (MagickWand *) NULL);
10046 assert(wand->signature == WandSignature);
10047 if (wand->debug != MagickFalse)
10048 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10049 if (wand->images == (Image *) NULL)
10050 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10051 wand->images->interlace=interlace;
10052 return(MagickTrue);
10056 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10060 % 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 %
10064 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10066 % MagickSetImageInterpolateMethod() sets the image interpolate pixel method.
10068 % The format of the MagickSetImageInterpolateMethod method is:
10070 % MagickBooleanType MagickSetImageInterpolateMethod(MagickWand *wand,
10071 % const InterpolatePixelMethod method)
10073 % A description of each parameter follows:
10075 % o wand: the magick wand.
10077 % o method: the image interpole pixel methods: choose from Undefined,
10078 % Average, Bicubic, Bilinear, Filter, Integer, Mesh, NearestNeighbor.
10081 WandExport MagickBooleanType MagickSetImageInterpolateMethod(MagickWand *wand,
10082 const InterpolatePixelMethod method)
10084 assert(wand != (MagickWand *) NULL);
10085 assert(wand->signature == WandSignature);
10086 if (wand->debug != MagickFalse)
10087 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10088 if (wand->images == (Image *) NULL)
10089 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10090 wand->images->interpolate=method;
10091 return(MagickTrue);
10095 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10099 % M a g i c k S e t I m a g e I t e r a t i o n s %
10103 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10105 % MagickSetImageIterations() sets the image iterations.
10107 % The format of the MagickSetImageIterations method is:
10109 % MagickBooleanType MagickSetImageIterations(MagickWand *wand,
10110 % const unsigned long iterations)
10112 % A description of each parameter follows:
10114 % o wand: the magick wand.
10116 % o delay: the image delay in 1/100th of a second.
10119 WandExport MagickBooleanType MagickSetImageIterations(MagickWand *wand,
10120 const unsigned long iterations)
10122 assert(wand != (MagickWand *) NULL);
10123 assert(wand->signature == WandSignature);
10124 if (wand->debug != MagickFalse)
10125 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10126 if (wand->images == (Image *) NULL)
10127 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10128 wand->images->iterations=iterations;
10129 return(MagickTrue);
10133 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10137 % M a g i c k S e t I m a g e M a t t e %
10141 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10143 % MagickSetImageMatte() sets the image matte channel.
10145 % The format of the MagickSetImageMatteColor method is:
10147 % MagickBooleanType MagickSetImageMatteColor(MagickWand *wand,
10148 % const MagickBooleanType *matte)
10150 % A description of each parameter follows:
10152 % o wand: the magick wand.
10154 % o matte: Set to MagickTrue to enable the image matte channel otherwise
10158 WandExport MagickBooleanType MagickSetImageMatte(MagickWand *wand,
10159 const MagickBooleanType matte)
10161 assert(wand != (MagickWand *) NULL);
10162 assert(wand->signature == WandSignature);
10163 if (wand->debug != MagickFalse)
10164 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10165 if (wand->images == (Image *) NULL)
10166 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10167 if ((wand->images->matte == MagickFalse) && (matte != MagickFalse))
10168 (void) SetImageOpacity(wand->images,OpaqueOpacity);
10169 wand->images->matte=matte;
10170 return(MagickTrue);
10174 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10178 % M a g i c k S e t I m a g e M a t t e C o l o r %
10182 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10184 % MagickSetImageMatteColor() sets the image matte color.
10186 % The format of the MagickSetImageMatteColor method is:
10188 % MagickBooleanType MagickSetImageMatteColor(MagickWand *wand,
10189 % const PixelWand *matte)
10191 % A description of each parameter follows:
10193 % o wand: the magick wand.
10195 % o matte: the matte pixel wand.
10198 WandExport MagickBooleanType MagickSetImageMatteColor(MagickWand *wand,
10199 const PixelWand *matte)
10201 assert(wand != (MagickWand *) NULL);
10202 assert(wand->signature == WandSignature);
10203 if (wand->debug != MagickFalse)
10204 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10205 if (wand->images == (Image *) NULL)
10206 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10207 PixelGetQuantumColor(matte,&wand->images->matte_color);
10208 return(MagickTrue);
10212 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10216 % M a g i c k S e t I m a g e O p a c i t y %
10220 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10222 % MagickSetImageOpacity() sets the image to the specified opacity level.
10224 % The format of the MagickSetImageOpacity method is:
10226 % MagickBooleanType MagickSetImageOpacity(MagickWand *wand,
10227 % const double alpha)
10229 % A description of each parameter follows:
10231 % o wand: the magick wand.
10233 % o alpha: the level of transparency: 1.0 is fully opaque and 0.0 is fully
10237 WandExport MagickBooleanType MagickSetImageOpacity(MagickWand *wand,
10238 const double alpha)
10243 assert(wand != (MagickWand *) NULL);
10244 assert(wand->signature == WandSignature);
10245 if (wand->debug != MagickFalse)
10246 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10247 if (wand->images == (Image *) NULL)
10248 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10249 status=SetImageOpacity(wand->images,RoundToQuantum((MagickRealType)
10250 QuantumRange-QuantumRange*alpha));
10251 if (status == MagickFalse)
10252 InheritException(wand->exception,&wand->images->exception);
10257 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10261 % 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 %
10265 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10267 % MagickSetImageOrientation() sets the image orientation.
10269 % The format of the MagickSetImageOrientation method is:
10271 % MagickBooleanType MagickSetImageOrientation(MagickWand *wand,
10272 % const OrientationType orientation)
10274 % A description of each parameter follows:
10276 % o wand: the magick wand.
10278 % o orientation: the image orientation type.
10281 WandExport MagickBooleanType MagickSetImageOrientation(MagickWand *wand,
10282 const OrientationType orientation)
10284 assert(wand != (MagickWand *) NULL);
10285 assert(wand->signature == WandSignature);
10286 if (wand->debug != MagickFalse)
10287 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10288 if (wand->images == (Image *) NULL)
10289 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10290 wand->images->orientation=orientation;
10291 return(MagickTrue);
10295 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10299 % M a g i c k S e t I m a g e P a g e %
10303 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10305 % MagickSetImagePage() sets the page geometry of the image.
10307 % The format of the MagickSetImagePage method is:
10309 % MagickBooleanType MagickSetImagePage(MagickWand *wand,
10310 % const unsigned long width,const unsigned long height,const long x,
10313 % A description of each parameter follows:
10315 % o wand: the magick wand.
10317 % o width: the page width.
10319 % o height: the page height.
10321 % o x: the page x-offset.
10323 % o y: the page y-offset.
10326 WandExport MagickBooleanType MagickSetImagePage(MagickWand *wand,
10327 const unsigned long width,const unsigned long height,const long x,
10330 assert(wand != (MagickWand *) NULL);
10331 assert(wand->signature == WandSignature);
10332 if (wand->debug != MagickFalse)
10333 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10334 if (wand->images == (Image *) NULL)
10335 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10336 wand->images->page.width=width;
10337 wand->images->page.height=height;
10338 wand->images->page.x=x;
10339 wand->images->page.y=y;
10340 return(MagickTrue);
10344 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10348 % 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 %
10352 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10354 % MagickSetImageProgressMonitor() sets the wand image progress monitor to the
10355 % specified method and returns the previous progress monitor if any. The
10356 % progress monitor method looks like this:
10358 % MagickBooleanType MagickProgressMonitor(const char *text,
10359 % const MagickOffsetType offset,const MagickSizeType span,
10360 % void *client_data)
10362 % If the progress monitor returns MagickFalse, the current operation is
10365 % The format of the MagickSetImageProgressMonitor method is:
10367 % MagickProgressMonitor MagickSetImageProgressMonitor(MagickWand *wand
10368 % const MagickProgressMonitor progress_monitor,void *client_data)
10370 % A description of each parameter follows:
10372 % o wand: the magick wand.
10374 % o progress_monitor: Specifies a pointer to a method to monitor progress
10375 % of an image operation.
10377 % o client_data: Specifies a pointer to any client data.
10380 WandExport MagickProgressMonitor MagickSetImageProgressMonitor(MagickWand *wand,
10381 const MagickProgressMonitor progress_monitor,void *client_data)
10383 MagickProgressMonitor
10386 assert(wand != (MagickWand *) NULL);
10387 assert(wand->signature == WandSignature);
10388 if (wand->debug != MagickFalse)
10389 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10390 if (wand->images == (Image *) NULL)
10392 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
10393 "ContainsNoImages","`%s'",wand->name);
10394 return((MagickProgressMonitor) NULL);
10396 previous_monitor=SetImageProgressMonitor(wand->images,
10397 progress_monitor,client_data);
10398 return(previous_monitor);
10402 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10406 % M a g i c k S e t I m a g e R e d P r i m a r y %
10410 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10412 % MagickSetImageRedPrimary() sets the image chromaticity red primary point.
10414 % The format of the MagickSetImageRedPrimary method is:
10416 % MagickBooleanType MagickSetImageRedPrimary(MagickWand *wand,
10417 % const double x,const double y)
10419 % A description of each parameter follows:
10421 % o wand: the magick wand.
10423 % o x: the red primary x-point.
10425 % o y: the red primary y-point.
10428 WandExport MagickBooleanType MagickSetImageRedPrimary(MagickWand *wand,
10429 const double x,const double y)
10431 assert(wand != (MagickWand *) NULL);
10432 assert(wand->signature == WandSignature);
10433 if (wand->debug != MagickFalse)
10434 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10435 if (wand->images == (Image *) NULL)
10436 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10437 wand->images->chromaticity.red_primary.x=x;
10438 wand->images->chromaticity.red_primary.y=y;
10439 return(MagickTrue);
10443 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10447 % 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 %
10451 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10453 % MagickSetImageRenderingIntent() sets the image rendering intent.
10455 % The format of the MagickSetImageRenderingIntent method is:
10457 % MagickBooleanType MagickSetImageRenderingIntent(MagickWand *wand,
10458 % const RenderingIntent rendering_intent)
10460 % A description of each parameter follows:
10462 % o wand: the magick wand.
10464 % o rendering_intent: the image rendering intent: UndefinedIntent,
10465 % SaturationIntent, PerceptualIntent, AbsoluteIntent, or RelativeIntent.
10468 WandExport MagickBooleanType MagickSetImageRenderingIntent(MagickWand *wand,
10469 const RenderingIntent rendering_intent)
10471 assert(wand != (MagickWand *) NULL);
10472 assert(wand->signature == WandSignature);
10473 if (wand->debug != MagickFalse)
10474 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10475 if (wand->images == (Image *) NULL)
10476 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10477 wand->images->rendering_intent=rendering_intent;
10478 return(MagickTrue);
10482 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10486 % M a g i c k S e t I m a g e R e s o l u t i o n %
10490 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10492 % MagickSetImageResolution() sets the image resolution.
10494 % The format of the MagickSetImageResolution method is:
10496 % MagickBooleanType MagickSetImageResolution(MagickWand *wand,
10497 % const double x_resolution,const doubtl y_resolution)
10499 % A description of each parameter follows:
10501 % o wand: the magick wand.
10503 % o x_resolution: the image x resolution.
10505 % o y_resolution: the image y resolution.
10508 WandExport MagickBooleanType MagickSetImageResolution(MagickWand *wand,
10509 const double x_resolution,const double y_resolution)
10511 assert(wand != (MagickWand *) NULL);
10512 assert(wand->signature == WandSignature);
10513 if (wand->debug != MagickFalse)
10514 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10515 if (wand->images == (Image *) NULL)
10516 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10517 wand->images->x_resolution=x_resolution;
10518 wand->images->y_resolution=y_resolution;
10519 return(MagickTrue);
10523 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10527 % M a g i c k S e t I m a g e S c e n e %
10531 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10533 % MagickSetImageScene() sets the image scene.
10535 % The format of the MagickSetImageScene method is:
10537 % MagickBooleanType MagickSetImageScene(MagickWand *wand,
10538 % const unsigned long scene)
10540 % A description of each parameter follows:
10542 % o wand: the magick wand.
10544 % o delay: the image scene number.
10547 WandExport MagickBooleanType MagickSetImageScene(MagickWand *wand,
10548 const unsigned long scene)
10550 assert(wand != (MagickWand *) NULL);
10551 assert(wand->signature == WandSignature);
10552 if (wand->debug != MagickFalse)
10553 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10554 if (wand->images == (Image *) NULL)
10555 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10556 wand->images->scene=scene;
10557 return(MagickTrue);
10561 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10565 % 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 %
10569 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10571 % MagickSetImageTicksPerSecond() sets the image ticks-per-second.
10573 % The format of the MagickSetImageTicksPerSecond method is:
10575 % MagickBooleanType MagickSetImageTicksPerSecond(MagickWand *wand,
10576 % const long ticks_per-second)
10578 % A description of each parameter follows:
10580 % o wand: the magick wand.
10582 % o ticks_per_second: the units to use for the image delay.
10585 WandExport MagickBooleanType MagickSetImageTicksPerSecond(MagickWand *wand,
10586 const long ticks_per_second)
10588 assert(wand != (MagickWand *) NULL);
10589 assert(wand->signature == WandSignature);
10590 if (wand->debug != MagickFalse)
10591 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10592 if (wand->images == (Image *) NULL)
10593 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10594 wand->images->ticks_per_second=ticks_per_second;
10595 return(MagickTrue);
10599 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10603 % M a g i c k S e t I m a g e T y p e %
10607 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10609 % MagickSetImageType() sets the image type.
10611 % The format of the MagickSetImageType method is:
10613 % MagickBooleanType MagickSetImageType(MagickWand *wand,
10614 % const ImageType image_type)
10616 % A description of each parameter follows:
10618 % o wand: the magick wand.
10620 % o image_type: the image type: UndefinedType, BilevelType, GrayscaleType,
10621 % GrayscaleMatteType, PaletteType, PaletteMatteType, TrueColorType,
10622 % TrueColorMatteType, ColorSeparationType, ColorSeparationMatteType,
10626 WandExport MagickBooleanType MagickSetImageType(MagickWand *wand,
10627 const ImageType image_type)
10629 assert(wand != (MagickWand *) NULL);
10630 assert(wand->signature == WandSignature);
10631 if (wand->debug != MagickFalse)
10632 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10633 if (wand->images == (Image *) NULL)
10634 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10635 return(SetImageType(wand->images,image_type));
10639 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10643 % M a g i c k S e t I m a g e U n i t s %
10647 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10649 % MagickSetImageUnits() sets the image units of resolution.
10651 % The format of the MagickSetImageUnits method is:
10653 % MagickBooleanType MagickSetImageUnits(MagickWand *wand,
10654 % const ResolutionType units)
10656 % A description of each parameter follows:
10658 % o wand: the magick wand.
10660 % o units: the image units of resolution : UndefinedResolution,
10661 % PixelsPerInchResolution, or PixelsPerCentimeterResolution.
10664 WandExport MagickBooleanType MagickSetImageUnits(MagickWand *wand,
10665 const ResolutionType units)
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)
10672 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10673 wand->images->units=units;
10674 return(MagickTrue);
10678 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10682 % 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 %
10686 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10688 % MagickSetImageVirtualPixelMethod() sets the image virtual pixel method.
10690 % The format of the MagickSetImageVirtualPixelMethod method is:
10692 % VirtualPixelMethod MagickSetImageVirtualPixelMethod(MagickWand *wand,
10693 % const VirtualPixelMethod method)
10695 % A description of each parameter follows:
10697 % o wand: the magick wand.
10699 % o method: the image virtual pixel method : UndefinedVirtualPixelMethod,
10700 % ConstantVirtualPixelMethod, EdgeVirtualPixelMethod,
10701 % MirrorVirtualPixelMethod, or TileVirtualPixelMethod.
10704 WandExport VirtualPixelMethod MagickSetImageVirtualPixelMethod(MagickWand *wand,
10705 const VirtualPixelMethod method)
10707 assert(wand != (MagickWand *) NULL);
10708 assert(wand->signature == WandSignature);
10709 if (wand->debug != MagickFalse)
10710 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10711 if (wand->images == (Image *) NULL)
10712 return(UndefinedVirtualPixelMethod);
10713 return(SetImageVirtualPixelMethod(wand->images,method));
10717 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10721 % M a g i c k S e t I m a g e W h i t e P o i n t %
10725 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10727 % MagickSetImageWhitePoint() sets the image chromaticity white point.
10729 % The format of the MagickSetImageWhitePoint method is:
10731 % MagickBooleanType MagickSetImageWhitePoint(MagickWand *wand,
10732 % const double x,const double y)
10734 % A description of each parameter follows:
10736 % o wand: the magick wand.
10738 % o x: the white x-point.
10740 % o y: the white y-point.
10743 WandExport MagickBooleanType MagickSetImageWhitePoint(MagickWand *wand,
10744 const double x,const double y)
10746 assert(wand != (MagickWand *) NULL);
10747 assert(wand->signature == WandSignature);
10748 if (wand->debug != MagickFalse)
10749 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10750 if (wand->images == (Image *) NULL)
10751 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10752 wand->images->chromaticity.white_point.x=x;
10753 wand->images->chromaticity.white_point.y=y;
10754 return(MagickTrue);
10758 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10762 % M a g i c k S h a d e I m a g e C h a n n e l %
10766 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10768 % MagickShadeImage() shines a distant light on an image to create a
10769 % three-dimensional effect. You control the positioning of the light with
10770 % azimuth and elevation; azimuth is measured in degrees off the x axis
10771 % and elevation is measured in pixels above the Z axis.
10773 % The format of the MagickShadeImage method is:
10775 % MagickBooleanType MagickShadeImage(MagickWand *wand,
10776 % const MagickBooleanType gray,const double azimuth,
10777 % const double elevation)
10779 % A description of each parameter follows:
10781 % o wand: the magick wand.
10783 % o gray: A value other than zero shades the intensity of each pixel.
10785 % o azimuth, elevation: Define the light source direction.
10788 WandExport MagickBooleanType MagickShadeImage(MagickWand *wand,
10789 const MagickBooleanType gray,const double asimuth,const double elevation)
10794 assert(wand != (MagickWand *) NULL);
10795 assert(wand->signature == WandSignature);
10796 if (wand->debug != MagickFalse)
10797 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10798 if (wand->images == (Image *) NULL)
10799 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10800 shade_image=ShadeImage(wand->images,gray,asimuth,elevation,wand->exception);
10801 if (shade_image == (Image *) NULL)
10802 return(MagickFalse);
10803 ReplaceImageInList(&wand->images,shade_image);
10804 return(MagickTrue);
10808 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10812 % M a g i c k S h a d o w I m a g e %
10816 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10818 % MagickShadowImage() simulates an image shadow.
10820 % The format of the MagickShadowImage method is:
10822 % MagickBooleanType MagickShadowImage(MagickWand *wand,
10823 % const double opacity,const double sigma,const long x,const long y)
10825 % A description of each parameter follows:
10827 % o wand: the magick wand.
10829 % o opacity: percentage transparency.
10831 % o sigma: the standard deviation of the Gaussian, in pixels.
10833 % o x: the shadow x-offset.
10835 % o y: the shadow y-offset.
10838 WandExport MagickBooleanType MagickShadowImage(MagickWand *wand,
10839 const double opacity,const double sigma,const long x,const long y)
10844 assert(wand != (MagickWand *) NULL);
10845 assert(wand->signature == WandSignature);
10846 if (wand->debug != MagickFalse)
10847 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10848 if (wand->images == (Image *) NULL)
10849 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10850 shadow_image=ShadowImage(wand->images,opacity,sigma,x,y,wand->exception);
10851 if (shadow_image == (Image *) NULL)
10852 return(MagickFalse);
10853 ReplaceImageInList(&wand->images,shadow_image);
10854 return(MagickTrue);
10858 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10862 % M a g i c k S h a r p e n I m a g e %
10866 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10868 % MagickSharpenImage() sharpens an image. We convolve the image with a
10869 % Gaussian operator of the given radius and standard deviation (sigma).
10870 % For reasonable results, the radius should be larger than sigma. Use a
10871 % radius of 0 and MagickSharpenImage() selects a suitable radius for you.
10873 % The format of the MagickSharpenImage method is:
10875 % MagickBooleanType MagickSharpenImage(MagickWand *wand,
10876 % const double radius,const double sigma)
10877 % MagickBooleanType MagickSharpenImageChannel(MagickWand *wand,
10878 % const ChannelType channel,const double radius,const double sigma)
10880 % A description of each parameter follows:
10882 % o wand: the magick wand.
10884 % o channel: the image channel(s).
10886 % o radius: the radius of the Gaussian, in pixels, not counting the center
10889 % o sigma: the standard deviation of the Gaussian, in pixels.
10893 WandExport MagickBooleanType MagickSharpenImage(MagickWand *wand,
10894 const double radius,const double sigma)
10899 status=MagickSharpenImageChannel(wand,DefaultChannels,radius,sigma);
10903 WandExport MagickBooleanType MagickSharpenImageChannel(MagickWand *wand,
10904 const ChannelType channel,const double radius,const double sigma)
10909 assert(wand != (MagickWand *) NULL);
10910 assert(wand->signature == WandSignature);
10911 if (wand->debug != MagickFalse)
10912 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10913 if (wand->images == (Image *) NULL)
10914 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10915 sharp_image=SharpenImageChannel(wand->images,channel,radius,sigma,
10917 if (sharp_image == (Image *) NULL)
10918 return(MagickFalse);
10919 ReplaceImageInList(&wand->images,sharp_image);
10920 return(MagickTrue);
10924 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10928 % M a g i c k S h a v e I m a g e %
10932 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10934 % MagickShaveImage() shaves pixels from the image edges. It allocates the
10935 % memory necessary for the new Image structure and returns a pointer to the
10938 % The format of the MagickShaveImage method is:
10940 % MagickBooleanType MagickShaveImage(MagickWand *wand,
10941 % const unsigned long columns,const unsigned long rows)
10943 % A description of each parameter follows:
10945 % o wand: the magick wand.
10947 % o columns: the number of columns in the scaled image.
10949 % o rows: the number of rows in the scaled image.
10953 WandExport MagickBooleanType MagickShaveImage(MagickWand *wand,
10954 const unsigned long columns,const unsigned long rows)
10962 assert(wand != (MagickWand *) NULL);
10963 assert(wand->signature == WandSignature);
10964 if (wand->debug != MagickFalse)
10965 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10966 if (wand->images == (Image *) NULL)
10967 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10968 shave_info.width=columns;
10969 shave_info.height=rows;
10972 shave_image=ShaveImage(wand->images,&shave_info,wand->exception);
10973 if (shave_image == (Image *) NULL)
10974 return(MagickFalse);
10975 ReplaceImageInList(&wand->images,shave_image);
10976 return(MagickTrue);
10980 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10984 % M a g i c k S h e a r I m a g e %
10988 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10990 % MagickShearImage() slides one edge of an image along the X or Y axis,
10991 % creating a parallelogram. An X direction shear slides an edge along the X
10992 % axis, while a Y direction shear slides an edge along the Y axis. The amount
10993 % of the shear is controlled by a shear angle. For X direction shears, x_shear
10994 % is measured relative to the Y axis, and similarly, for Y direction shears
10995 % y_shear is measured relative to the X axis. Empty triangles left over from
10996 % shearing the image are filled with the background color.
10998 % The format of the MagickShearImage method is:
11000 % MagickBooleanType MagickShearImage(MagickWand *wand,
11001 % const PixelWand *background,const double x_shear,onst double y_shear)
11003 % A description of each parameter follows:
11005 % o wand: the magick wand.
11007 % o background: the background pixel wand.
11009 % o x_shear: the number of degrees to shear the image.
11011 % o y_shear: the number of degrees to shear the image.
11014 WandExport MagickBooleanType MagickShearImage(MagickWand *wand,
11015 const PixelWand *background,const double x_shear,const double y_shear)
11020 assert(wand != (MagickWand *) NULL);
11021 assert(wand->signature == WandSignature);
11022 if (wand->debug != MagickFalse)
11023 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11024 if (wand->images == (Image *) NULL)
11025 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11026 PixelGetQuantumColor(background,&wand->images->background_color);
11027 shear_image=ShearImage(wand->images,x_shear,y_shear,wand->exception);
11028 if (shear_image == (Image *) NULL)
11029 return(MagickFalse);
11030 ReplaceImageInList(&wand->images,shear_image);
11031 return(MagickTrue);
11035 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11039 % 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 %
11043 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11045 % MagickSigmoidalContrastImage() adjusts the contrast of an image with a
11046 % non-linear sigmoidal contrast algorithm. Increase the contrast of the
11047 % image using a sigmoidal transfer function without saturating highlights or
11048 % shadows. Contrast indicates how much to increase the contrast (0 is none;
11049 % 3 is typical; 20 is pushing it); mid-point indicates where midtones fall in
11050 % the resultant image (0 is white; 50% is middle-gray; 100% is black). Set
11051 % sharpen to MagickTrue to increase the image contrast otherwise the contrast
11054 % The format of the MagickSigmoidalContrastImage method is:
11056 % MagickBooleanType MagickSigmoidalContrastImage(MagickWand *wand,
11057 % const MagickBooleanType sharpen,const double alpha,const double beta)
11058 % MagickBooleanType MagickSigmoidalContrastImageChannel(MagickWand *wand,
11059 % const ChannelType channel,const MagickBooleanType sharpen,
11060 % const double alpha,const double beta)
11062 % A description of each parameter follows:
11064 % o wand: the magick wand.
11066 % o channel: Identify which channel to level: RedChannel, GreenChannel,
11068 % o sharpen: Increase or decrease image contrast.
11070 % o alpha: control the "shoulder" of the contast curve.
11072 % o beta: control the "toe" of the contast curve.
11076 WandExport MagickBooleanType MagickSigmoidalContrastImage(MagickWand *wand,
11077 const MagickBooleanType sharpen,const double alpha,const double beta)
11082 status=MagickSigmoidalContrastImageChannel(wand,DefaultChannels,sharpen,
11087 WandExport MagickBooleanType MagickSigmoidalContrastImageChannel(
11088 MagickWand *wand,const ChannelType channel,const MagickBooleanType sharpen,
11089 const double alpha,const double beta)
11094 assert(wand != (MagickWand *) NULL);
11095 assert(wand->signature == WandSignature);
11096 if (wand->debug != MagickFalse)
11097 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11098 if (wand->images == (Image *) NULL)
11099 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11100 status=SigmoidalContrastImageChannel(wand->images,channel,sharpen,alpha,beta);
11101 if (status == MagickFalse)
11102 InheritException(wand->exception,&wand->images->exception);
11107 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11111 % M a g i c k S i m i l a r i t y I m a g e %
11115 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11117 % MagickSimilarityImage() compares the reference image of the image and
11118 % returns the best match offset. In addition, it returns a similarity image
11119 % such that an exact match location is completely white and if none of the
11120 % pixels match, black, otherwise some gray level in-between.
11122 % The format of the MagickSimilarityImage method is:
11124 % MagickWand *MagickSimilarityImage(MagickWand *wand,
11125 % const MagickWand *reference,RectangeInfo *offset,double *similarity)
11127 % A description of each parameter follows:
11129 % o wand: the magick wand.
11131 % o reference: the reference wand.
11133 % o offset: the best match offset of the reference image within the image.
11135 % o similarity: the computed similarity between the images.
11138 WandExport MagickWand *MagickSimilarityImage(MagickWand *wand,
11139 const MagickWand *reference,RectangleInfo *offset,double *similarity)
11144 assert(wand != (MagickWand *) NULL);
11145 assert(wand->signature == WandSignature);
11146 if (wand->debug != MagickFalse)
11147 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11148 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
11150 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
11151 "ContainsNoImages","`%s'",wand->name);
11152 return((MagickWand *) NULL);
11154 similarity_image=SimilarityImage(wand->images,reference->images,offset,
11155 similarity,&wand->images->exception);
11156 if (similarity_image == (Image *) NULL)
11157 return((MagickWand *) NULL);
11158 return(CloneMagickWandFromImages(wand,similarity_image));
11162 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11166 % M a g i c k S k e t c h I m a g e %
11170 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11172 % MagickSketchImage() simulates a pencil sketch. We convolve the image with
11173 % a Gaussian operator of the given radius and standard deviation (sigma).
11174 % For reasonable results, radius should be larger than sigma. Use a
11175 % radius of 0 and SketchImage() selects a suitable radius for you.
11176 % Angle gives the angle of the blurring motion.
11178 % The format of the MagickSketchImage method is:
11180 % MagickBooleanType MagickSketchImage(MagickWand *wand,
11181 % const double radius,const double sigma,const double angle)
11183 % A description of each parameter follows:
11185 % o wand: the magick wand.
11187 % o radius: the radius of the Gaussian, in pixels, not counting
11188 % the center pixel.
11190 % o sigma: the standard deviation of the Gaussian, in pixels.
11192 % o angle: Apply the effect along this angle.
11195 WandExport MagickBooleanType MagickSketchImage(MagickWand *wand,
11196 const double radius,const double sigma,const double angle)
11201 assert(wand != (MagickWand *) NULL);
11202 assert(wand->signature == WandSignature);
11203 if (wand->debug != MagickFalse)
11204 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11205 if (wand->images == (Image *) NULL)
11206 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11207 sketch_image=SketchImage(wand->images,radius,sigma,angle,wand->exception);
11208 if (sketch_image == (Image *) NULL)
11209 return(MagickFalse);
11210 ReplaceImageInList(&wand->images,sketch_image);
11211 return(MagickTrue);
11215 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11219 % M a g i c k S o l a r i z e I m a g e %
11223 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11225 % MagickSolarizeImage() applies a special effect to the image, similar to the
11226 % effect achieved in a photo darkroom by selectively exposing areas of photo
11227 % sensitive paper to light. Threshold ranges from 0 to QuantumRange and is a
11228 % measure of the extent of the solarization.
11230 % The format of the MagickSolarizeImage method is:
11232 % MagickBooleanType MagickSolarizeImage(MagickWand *wand,
11233 % const double threshold)
11235 % A description of each parameter follows:
11237 % o wand: the magick wand.
11239 % o threshold: Define the extent of the solarization.
11242 WandExport MagickBooleanType MagickSolarizeImage(MagickWand *wand,
11243 const double threshold)
11248 assert(wand != (MagickWand *) NULL);
11249 assert(wand->signature == WandSignature);
11250 if (wand->debug != MagickFalse)
11251 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11252 if (wand->images == (Image *) NULL)
11253 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11254 status=SolarizeImage(wand->images,threshold);
11255 if (status == MagickFalse)
11256 InheritException(wand->exception,&wand->images->exception);
11261 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11265 % M a g i c k S p a r s e C o l o r I m a g e %
11269 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11271 % MagickSparseColorImage(), given a set of coordinates, interpolates the
11272 % colors found at those coordinates, across the whole image, using various
11275 % The format of the MagickSparseColorImage method is:
11277 % MagickBooleanType MagickSparseColorImage(MagickWand *wand,
11278 % const ChannelType channel,const SparseColorMethod method,
11279 % const unsigned long number_arguments,const double *arguments)
11281 % A description of each parameter follows:
11283 % o image: the image to be sparseed.
11285 % o method: the method of image sparseion.
11287 % ArcSparseColorion will always ignore source image offset, and always
11288 % 'bestfit' the destination image with the top left corner offset
11289 % relative to the polar mapping center.
11291 % Bilinear has no simple inverse mapping so will not allow 'bestfit'
11292 % style of image sparseion.
11294 % Affine, Perspective, and Bilinear, will do least squares fitting of
11295 % the distrotion when more than the minimum number of control point
11296 % pairs are provided.
11298 % Perspective, and Bilinear, will fall back to a Affine sparseion when
11299 % less than 4 control point pairs are provided. While Affine sparseions
11300 % will let you use any number of control point pairs, that is Zero pairs
11301 % is a No-Op (viewport only) distrotion, one pair is a translation and
11302 % two pairs of control points will do a scale-rotate-translate, without
11305 % o number_arguments: the number of arguments given for this sparseion
11308 % o arguments: the arguments for this sparseion method.
11311 WandExport MagickBooleanType MagickSparseColorImage(MagickWand *wand,
11312 const ChannelType channel,const SparseColorMethod method,
11313 const unsigned long number_arguments,const double *arguments)
11318 assert(wand != (MagickWand *) NULL);
11319 assert(wand->signature == WandSignature);
11320 if (wand->debug != MagickFalse)
11321 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11322 if (wand->images == (Image *) NULL)
11323 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11324 sparse_image=SparseColorImage(wand->images,channel,method,number_arguments,
11325 arguments,wand->exception);
11326 if (sparse_image == (Image *) NULL)
11327 return(MagickFalse);
11328 ReplaceImageInList(&wand->images,sparse_image);
11329 return(MagickTrue);
11333 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11337 % M a g i c k S p l i c e I m a g e %
11341 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11343 % MagickSpliceImage() splices a solid color into the image.
11345 % The format of the MagickSpliceImage method is:
11347 % MagickBooleanType MagickSpliceImage(MagickWand *wand,
11348 % const unsigned long width,const unsigned long height,const long x,
11351 % A description of each parameter follows:
11353 % o wand: the magick wand.
11355 % o width: the region width.
11357 % o height: the region height.
11359 % o x: the region x offset.
11361 % o y: the region y offset.
11364 WandExport MagickBooleanType MagickSpliceImage(MagickWand *wand,
11365 const unsigned long width,const unsigned long height,const long x,
11374 assert(wand != (MagickWand *) NULL);
11375 assert(wand->signature == WandSignature);
11376 if (wand->debug != MagickFalse)
11377 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11378 if (wand->images == (Image *) NULL)
11379 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11380 splice.width=width;
11381 splice.height=height;
11384 splice_image=SpliceImage(wand->images,&splice,wand->exception);
11385 if (splice_image == (Image *) NULL)
11386 return(MagickFalse);
11387 ReplaceImageInList(&wand->images,splice_image);
11388 return(MagickTrue);
11392 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11396 % M a g i c k S p r e a d I m a g e %
11400 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11402 % MagickSpreadImage() is a special effects method that randomly displaces each
11403 % pixel in a block defined by the radius parameter.
11405 % The format of the MagickSpreadImage method is:
11407 % MagickBooleanType MagickSpreadImage(MagickWand *wand,const double radius)
11409 % A description of each parameter follows:
11411 % o wand: the magick wand.
11413 % o radius: Choose a random pixel in a neighborhood of this extent.
11416 WandExport MagickBooleanType MagickSpreadImage(MagickWand *wand,
11417 const double radius)
11422 assert(wand != (MagickWand *) NULL);
11423 assert(wand->signature == WandSignature);
11424 if (wand->debug != MagickFalse)
11425 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11426 if (wand->images == (Image *) NULL)
11427 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11428 spread_image=SpreadImage(wand->images,radius,wand->exception);
11429 if (spread_image == (Image *) NULL)
11430 return(MagickFalse);
11431 ReplaceImageInList(&wand->images,spread_image);
11432 return(MagickTrue);
11436 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11440 % M a g i c k S t e g a n o I m a g e %
11444 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11446 % MagickSteganoImage() hides a digital watermark within the image.
11447 % Recover the hidden watermark later to prove that the authenticity of
11448 % an image. Offset defines the start position within the image to hide
11451 % The format of the MagickSteganoImage method is:
11453 % MagickWand *MagickSteganoImage(MagickWand *wand,
11454 % const MagickWand *watermark_wand,const long offset)
11456 % A description of each parameter follows:
11458 % o wand: the magick wand.
11460 % o watermark_wand: the watermark wand.
11462 % o offset: Start hiding at this offset into the image.
11465 WandExport MagickWand *MagickSteganoImage(MagickWand *wand,
11466 const MagickWand *watermark_wand,const long offset)
11471 assert(wand != (MagickWand *) NULL);
11472 assert(wand->signature == WandSignature);
11473 if (wand->debug != MagickFalse)
11474 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11475 if ((wand->images == (Image *) NULL) ||
11476 (watermark_wand->images == (Image *) NULL))
11478 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
11479 "ContainsNoImages","`%s'",wand->name);
11480 return((MagickWand *) NULL);
11482 wand->images->offset=offset;
11483 stegano_image=SteganoImage(wand->images,watermark_wand->images,
11485 if (stegano_image == (Image *) NULL)
11486 return((MagickWand *) NULL);
11487 return(CloneMagickWandFromImages(wand,stegano_image));
11491 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11495 % M a g i c k S t e r e o I m a g e %
11499 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11501 % MagickStereoImage() composites two images and produces a single image that
11502 % is the composite of a left and right image of a stereo pair
11504 % The format of the MagickStereoImage method is:
11506 % MagickWand *MagickStereoImage(MagickWand *wand,
11507 % const MagickWand *offset_wand)
11509 % A description of each parameter follows:
11511 % o wand: the magick wand.
11513 % o offset_wand: Another image wand.
11516 WandExport MagickWand *MagickStereoImage(MagickWand *wand,
11517 const MagickWand *offset_wand)
11522 assert(wand != (MagickWand *) NULL);
11523 assert(wand->signature == WandSignature);
11524 if (wand->debug != MagickFalse)
11525 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11526 if ((wand->images == (Image *) NULL) ||
11527 (offset_wand->images == (Image *) NULL))
11529 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
11530 "ContainsNoImages","`%s'",wand->name);
11531 return((MagickWand *) NULL);
11533 stereo_image=StereoImage(wand->images,offset_wand->images,wand->exception);
11534 if (stereo_image == (Image *) NULL)
11535 return((MagickWand *) NULL);
11536 return(CloneMagickWandFromImages(wand,stereo_image));
11540 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11544 % M a g i c k S t r i p I m a g e %
11548 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11550 % MagickStripImage() strips an image of all profiles and comments.
11552 % The format of the MagickStripImage method is:
11554 % MagickBooleanType MagickStripImage(MagickWand *wand)
11556 % A description of each parameter follows:
11558 % o wand: the magick wand.
11561 WandExport MagickBooleanType MagickStripImage(MagickWand *wand)
11566 assert(wand != (MagickWand *) NULL);
11567 assert(wand->signature == WandSignature);
11568 if (wand->debug != MagickFalse)
11569 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11570 if (wand->images == (Image *) NULL)
11571 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11572 status=StripImage(wand->images);
11573 if (status == MagickFalse)
11574 InheritException(wand->exception,&wand->images->exception);
11579 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11583 % M a g i c k S w i r l I m a g e %
11587 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11589 % MagickSwirlImage() swirls the pixels about the center of the image, where
11590 % degrees indicates the sweep of the arc through which each pixel is moved.
11591 % You get a more dramatic effect as the degrees move from 1 to 360.
11593 % The format of the MagickSwirlImage method is:
11595 % MagickBooleanType MagickSwirlImage(MagickWand *wand,const double degrees)
11597 % A description of each parameter follows:
11599 % o wand: the magick wand.
11601 % o degrees: Define the tightness of the swirling effect.
11604 WandExport MagickBooleanType MagickSwirlImage(MagickWand *wand,
11605 const double degrees)
11610 assert(wand != (MagickWand *) NULL);
11611 assert(wand->signature == WandSignature);
11612 if (wand->debug != MagickFalse)
11613 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11614 if (wand->images == (Image *) NULL)
11615 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11616 swirl_image=SwirlImage(wand->images,degrees,wand->exception);
11617 if (swirl_image == (Image *) NULL)
11618 return(MagickFalse);
11619 ReplaceImageInList(&wand->images,swirl_image);
11620 return(MagickTrue);
11624 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11628 % M a g i c k T e x t u r e I m a g e %
11632 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11634 % MagickTextureImage() repeatedly tiles the texture image across and down the
11637 % The format of the MagickTextureImage method is:
11639 % MagickWand *MagickTextureImage(MagickWand *wand,
11640 % const MagickWand *texture_wand)
11642 % A description of each parameter follows:
11644 % o wand: the magick wand.
11646 % o texture_wand: the texture wand
11649 WandExport MagickWand *MagickTextureImage(MagickWand *wand,
11650 const MagickWand *texture_wand)
11658 assert(wand != (MagickWand *) NULL);
11659 assert(wand->signature == WandSignature);
11660 if (wand->debug != MagickFalse)
11661 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11662 if ((wand->images == (Image *) NULL) ||
11663 (texture_wand->images == (Image *) NULL))
11665 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
11666 "ContainsNoImages","`%s'",wand->name);
11667 return((MagickWand *) NULL);
11669 texture_image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
11670 if (texture_image == (Image *) NULL)
11671 return((MagickWand *) NULL);
11672 status=TextureImage(texture_image,texture_wand->images);
11673 if (status == MagickFalse)
11675 InheritException(wand->exception,&texture_image->exception);
11676 texture_image=DestroyImage(texture_image);
11677 return((MagickWand *) NULL);
11679 return(CloneMagickWandFromImages(wand,texture_image));
11683 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11687 % M a g i c k T h r e s h o l d I m a g e %
11691 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11693 % MagickThresholdImage() changes the value of individual pixels based on
11694 % the intensity of each pixel compared to threshold. The result is a
11695 % high-contrast, two color image.
11697 % The format of the MagickThresholdImage method is:
11699 % MagickBooleanType MagickThresholdImage(MagickWand *wand,
11700 % const double threshold)
11701 % MagickBooleanType MagickThresholdImageChannel(MagickWand *wand,
11702 % const ChannelType channel,const double threshold)
11704 % A description of each parameter follows:
11706 % o wand: the magick wand.
11708 % o channel: the image channel(s).
11710 % o threshold: Define the threshold value.
11713 WandExport MagickBooleanType MagickThresholdImage(MagickWand *wand,
11714 const double threshold)
11719 status=MagickThresholdImageChannel(wand,DefaultChannels,threshold);
11723 WandExport MagickBooleanType MagickThresholdImageChannel(MagickWand *wand,
11724 const ChannelType channel,const double threshold)
11729 assert(wand != (MagickWand *) NULL);
11730 assert(wand->signature == WandSignature);
11731 if (wand->debug != MagickFalse)
11732 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11733 if (wand->images == (Image *) NULL)
11734 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11735 status=BilevelImageChannel(wand->images,channel,threshold);
11736 if (status == MagickFalse)
11737 InheritException(wand->exception,&wand->images->exception);
11742 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11746 % M a g i c k T h u m b n a i l I m a g e %
11750 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11752 % MagickThumbnailImage() changes the size of an image to the given dimensions
11753 % and removes any associated profiles. The goal is to produce small low cost
11754 % thumbnail images suited for display on the Web.
11756 % The format of the MagickThumbnailImage method is:
11758 % MagickBooleanType MagickThumbnailImage(MagickWand *wand,
11759 % const unsigned long columns,const unsigned long rows)
11761 % A description of each parameter follows:
11763 % o wand: the magick wand.
11765 % o columns: the number of columns in the scaled image.
11767 % o rows: the number of rows in the scaled image.
11770 WandExport MagickBooleanType MagickThumbnailImage(MagickWand *wand,
11771 const unsigned long columns,const unsigned long rows)
11776 assert(wand != (MagickWand *) NULL);
11777 assert(wand->signature == WandSignature);
11778 if (wand->debug != MagickFalse)
11779 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11780 if (wand->images == (Image *) NULL)
11781 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11782 thumbnail_image=ThumbnailImage(wand->images,columns,rows,wand->exception);
11783 if (thumbnail_image == (Image *) NULL)
11784 return(MagickFalse);
11785 ReplaceImageInList(&wand->images,thumbnail_image);
11786 return(MagickTrue);
11790 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11794 % M a g i c k T i n t I m a g e %
11798 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11800 % MagickTintImage() applies a color vector to each pixel in the image. The
11801 % length of the vector is 0 for black and white and at its maximum for the
11802 % midtones. The vector weighting function is
11803 % f(x)=(1-(4.0*((x-0.5)*(x-0.5)))).
11805 % The format of the MagickTintImage method is:
11807 % MagickBooleanType MagickTintImage(MagickWand *wand,
11808 % const PixelWand *tint,const PixelWand *opacity)
11810 % A description of each parameter follows:
11812 % o wand: the magick wand.
11814 % o tint: the tint pixel wand.
11816 % o opacity: the opacity pixel wand.
11819 WandExport MagickBooleanType MagickTintImage(MagickWand *wand,
11820 const PixelWand *tint,const PixelWand *opacity)
11823 percent_opaque[MaxTextExtent];
11831 assert(wand != (MagickWand *) NULL);
11832 assert(wand->signature == WandSignature);
11833 if (wand->debug != MagickFalse)
11834 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11835 if (wand->images == (Image *) NULL)
11836 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11837 (void) FormatMagickString(percent_opaque,MaxTextExtent,"%g,%g,%g,%g",
11838 (double) (100.0*QuantumScale*PixelGetRedQuantum(opacity)),
11839 (double) (100.0*QuantumScale*PixelGetGreenQuantum(opacity)),
11840 (double) (100.0*QuantumScale*PixelGetBlueQuantum(opacity)),
11841 (double) (100.0*QuantumScale*PixelGetOpacityQuantum(opacity)));
11842 PixelGetQuantumColor(tint,&target);
11843 tint_image=TintImage(wand->images,percent_opaque,target,wand->exception);
11844 if (tint_image == (Image *) NULL)
11845 return(MagickFalse);
11846 ReplaceImageInList(&wand->images,tint_image);
11847 return(MagickTrue);
11851 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11855 % M a g i c k T r a n s f o r m I m a g e %
11859 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11861 % MagickTransformImage() is a convenience method that behaves like
11862 % MagickResizeImage() or MagickCropImage() but accepts scaling and/or cropping
11863 % information as a region geometry specification. If the operation fails,
11864 % a NULL image handle is returned.
11866 % The format of the MagickTransformImage method is:
11868 % MagickWand *MagickTransformImage(MagickWand *wand,const char *crop,
11869 % const char *geometry)
11871 % A description of each parameter follows:
11873 % o wand: the magick wand.
11875 % o crop: A crop geometry string. This geometry defines a subregion of the
11878 % o geometry: An image geometry string. This geometry defines the final
11879 % size of the image.
11882 WandExport MagickWand *MagickTransformImage(MagickWand *wand,
11883 const char *crop,const char *geometry)
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 return((MagickWand *) NULL);
11897 transform_image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
11898 if (transform_image == (Image *) NULL)
11899 return((MagickWand *) NULL);
11900 status=TransformImage(&transform_image,crop,geometry);
11901 if (status == MagickFalse)
11903 InheritException(wand->exception,&transform_image->exception);
11904 transform_image=DestroyImage(transform_image);
11905 return((MagickWand *) NULL);
11907 return(CloneMagickWandFromImages(wand,transform_image));
11911 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11915 % 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 %
11919 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11921 % MagickTransformImageColorspace() transform the image colorspace.
11923 % The format of the MagickTransformImageColorspace method is:
11925 % MagickBooleanType MagickTransformImageColorspace(MagickWand *wand,
11926 % const ColorspaceType colorspace)
11928 % A description of each parameter follows:
11930 % o wand: the magick wand.
11932 % o colorspace: the image colorspace: UndefinedColorspace, RGBColorspace,
11933 % GRAYColorspace, TransparentColorspace, OHTAColorspace, XYZColorspace,
11934 % YCbCrColorspace, YCCColorspace, YIQColorspace, YPbPrColorspace,
11935 % YPbPrColorspace, YUVColorspace, CMYKColorspace, sRGBColorspace,
11936 % HSLColorspace, or HWBColorspace.
11939 WandExport MagickBooleanType MagickTransformImageColorspace(MagickWand *wand,
11940 const ColorspaceType colorspace)
11942 assert(wand != (MagickWand *) NULL);
11943 assert(wand->signature == WandSignature);
11944 if (wand->debug != MagickFalse)
11945 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11946 if (wand->images == (Image *) NULL)
11947 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11948 return(TransformImageColorspace(wand->images,colorspace));
11952 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11956 % 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 %
11960 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11962 % MagickTransparentPaintImage() changes any pixel that matches color with the
11963 % color defined by fill.
11965 % The format of the MagickTransparentPaintImage method is:
11967 % MagickBooleanType MagickTransparentPaintImage(MagickWand *wand,
11968 % const PixelWand *target,const double alpha,const double fuzz,
11969 % const MagickBooleanType invert)
11971 % A description of each parameter follows:
11973 % o wand: the magick wand.
11975 % o target: Change this target color to specified opacity value within
11978 % o alpha: the level of transparency: 1.0 is fully opaque and 0.0 is fully
11981 % o fuzz: By default target must match a particular pixel color
11982 % exactly. However, in many cases two colors may differ by a small amount.
11983 % The fuzz member of image defines how much tolerance is acceptable to
11984 % consider two colors as the same. For example, set fuzz to 10 and the
11985 % color red at intensities of 100 and 102 respectively are now interpreted
11986 % as the same color for the purposes of the floodfill.
11988 % o invert: paint any pixel that does not match the target color.
11991 WandExport MagickBooleanType MagickTransparentPaintImage(MagickWand *wand,
11992 const PixelWand *target,const double alpha,const double fuzz,
11993 const MagickBooleanType invert)
12001 assert(wand != (MagickWand *) NULL);
12002 assert(wand->signature == WandSignature);
12003 if (wand->debug != MagickFalse)
12004 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12005 if (wand->images == (Image *) NULL)
12006 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12007 PixelGetMagickColor(target,&target_pixel);
12008 wand->images->fuzz=fuzz;
12009 status=TransparentPaintImage(wand->images,&target_pixel,RoundToQuantum(
12010 (MagickRealType) QuantumRange-QuantumRange*alpha),invert);
12011 if (status == MagickFalse)
12012 InheritException(wand->exception,&wand->images->exception);
12017 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12021 % M a g i c k T r a n s p o s e I m a g e %
12025 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12027 % MagickTransposeImage() creates a vertical mirror image by reflecting the
12028 % pixels around the central x-axis while rotating them 90-degrees.
12030 % The format of the MagickTransposeImage method is:
12032 % MagickBooleanType MagickTransposeImage(MagickWand *wand)
12034 % A description of each parameter follows:
12036 % o wand: the magick wand.
12039 WandExport MagickBooleanType MagickTransposeImage(MagickWand *wand)
12044 assert(wand != (MagickWand *) NULL);
12045 assert(wand->signature == WandSignature);
12046 if (wand->debug != MagickFalse)
12047 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12048 if (wand->images == (Image *) NULL)
12049 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12050 transpose_image=TransposeImage(wand->images,wand->exception);
12051 if (transpose_image == (Image *) NULL)
12052 return(MagickFalse);
12053 ReplaceImageInList(&wand->images,transpose_image);
12054 return(MagickTrue);
12058 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12062 % M a g i c k T r a n s v e r s e I m a g e %
12066 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12068 % MagickTransverseImage() creates a horizontal mirror image by reflecting the
12069 % pixels around the central y-axis while rotating them 270-degrees.
12071 % The format of the MagickTransverseImage method is:
12073 % MagickBooleanType MagickTransverseImage(MagickWand *wand)
12075 % A description of each parameter follows:
12077 % o wand: the magick wand.
12080 WandExport MagickBooleanType MagickTransverseImage(MagickWand *wand)
12085 assert(wand != (MagickWand *) NULL);
12086 assert(wand->signature == WandSignature);
12087 if (wand->debug != MagickFalse)
12088 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12089 if (wand->images == (Image *) NULL)
12090 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12091 transverse_image=TransverseImage(wand->images,wand->exception);
12092 if (transverse_image == (Image *) NULL)
12093 return(MagickFalse);
12094 ReplaceImageInList(&wand->images,transverse_image);
12095 return(MagickTrue);
12099 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12103 % M a g i c k T r i m I m a g e %
12107 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12109 % MagickTrimImage() remove edges that are the background color from the image.
12111 % The format of the MagickTrimImage method is:
12113 % MagickBooleanType MagickTrimImage(MagickWand *wand,const double fuzz)
12115 % A description of each parameter follows:
12117 % o wand: the magick wand.
12119 % o fuzz: By default target must match a particular pixel color
12120 % exactly. However, in many cases two colors may differ by a small amount.
12121 % The fuzz member of image defines how much tolerance is acceptable to
12122 % consider two colors as the same. For example, set fuzz to 10 and the
12123 % color red at intensities of 100 and 102 respectively are now interpreted
12124 % as the same color for the purposes of the floodfill.
12127 WandExport MagickBooleanType MagickTrimImage(MagickWand *wand,const double fuzz)
12132 assert(wand != (MagickWand *) NULL);
12133 assert(wand->signature == WandSignature);
12134 if (wand->debug != MagickFalse)
12135 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12136 if (wand->images == (Image *) NULL)
12137 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12138 wand->images->fuzz=fuzz;
12139 trim_image=TrimImage(wand->images,wand->exception);
12140 if (trim_image == (Image *) NULL)
12141 return(MagickFalse);
12142 ReplaceImageInList(&wand->images,trim_image);
12143 return(MagickTrue);
12147 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12151 % M a g i c k U n i q u e I m a g e C o l o r s %
12155 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12157 % MagickUniqueImageColors() discards all but one of any pixel color.
12159 % The format of the MagickUniqueImageColors method is:
12161 % MagickBooleanType MagickUniqueImageColors(MagickWand *wand)
12163 % A description of each parameter follows:
12165 % o wand: the magick wand.
12168 WandExport MagickBooleanType MagickUniqueImageColors(MagickWand *wand)
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 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12179 unique_image=UniqueImageColors(wand->images,wand->exception);
12180 if (unique_image == (Image *) NULL)
12181 return(MagickFalse);
12182 ReplaceImageInList(&wand->images,unique_image);
12183 return(MagickTrue);
12187 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12191 % M a g i c k U n s h a r p M a s k I m a g e %
12195 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12197 % MagickUnsharpMaskImage() sharpens an image. We convolve the image with a
12198 % Gaussian operator of the given radius and standard deviation (sigma).
12199 % For reasonable results, radius should be larger than sigma. Use a radius
12200 % of 0 and UnsharpMaskImage() selects a suitable radius for you.
12202 % The format of the MagickUnsharpMaskImage method is:
12204 % MagickBooleanType MagickUnsharpMaskImage(MagickWand *wand,
12205 % const double radius,const double sigma,const double amount,
12206 % const double threshold)
12207 % MagickBooleanType MagickUnsharpMaskImageChannel(MagickWand *wand,
12208 % const ChannelType channel,const double radius,const double sigma,
12209 % const double amount,const double threshold)
12211 % A description of each parameter follows:
12213 % o wand: the magick wand.
12215 % o channel: the image channel(s).
12217 % o radius: the radius of the Gaussian, in pixels, not counting the center
12220 % o sigma: the standard deviation of the Gaussian, in pixels.
12222 % o amount: the percentage of the difference between the original and the
12223 % blur image that is added back into the original.
12225 % o threshold: the threshold in pixels needed to apply the diffence amount.
12229 WandExport MagickBooleanType MagickUnsharpMaskImage(MagickWand *wand,
12230 const double radius,const double sigma,const double amount,
12231 const double threshold)
12236 status=MagickUnsharpMaskImageChannel(wand,DefaultChannels,radius,sigma,
12241 WandExport MagickBooleanType MagickUnsharpMaskImageChannel(MagickWand *wand,
12242 const ChannelType channel,const double radius,const double sigma,
12243 const double amount,const double threshold)
12248 assert(wand != (MagickWand *) NULL);
12249 assert(wand->signature == WandSignature);
12250 if (wand->debug != MagickFalse)
12251 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12252 if (wand->images == (Image *) NULL)
12253 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12254 unsharp_image=UnsharpMaskImageChannel(wand->images,channel,radius,sigma,
12255 amount,threshold,wand->exception);
12256 if (unsharp_image == (Image *) NULL)
12257 return(MagickFalse);
12258 ReplaceImageInList(&wand->images,unsharp_image);
12259 return(MagickTrue);
12263 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12267 % M a g i c k V i g n e t t e I m a g e %
12271 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12273 % MagickVignetteImage() softens the edges of the image in vignette style.
12275 % The format of the MagickVignetteImage method is:
12277 % MagickBooleanType MagickVignetteImage(MagickWand *wand,
12278 % const double black_point,const double white_point,const long x,
12281 % A description of each parameter follows:
12283 % o wand: the magick wand.
12285 % o black_point: the black point.
12287 % o white_point: the white point.
12289 % o x, y: Define the x and y ellipse offset.
12292 WandExport MagickBooleanType MagickVignetteImage(MagickWand *wand,
12293 const double black_point,const double white_point,const long x,const long y)
12298 assert(wand != (MagickWand *) NULL);
12299 assert(wand->signature == WandSignature);
12300 if (wand->debug != MagickFalse)
12301 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12302 if (wand->images == (Image *) NULL)
12303 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12304 vignette_image=VignetteImage(wand->images,black_point,white_point,x,y,
12306 if (vignette_image == (Image *) NULL)
12307 return(MagickFalse);
12308 ReplaceImageInList(&wand->images,vignette_image);
12309 return(MagickTrue);
12313 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12317 % M a g i c k W a v e I m a g e %
12321 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12323 % MagickWaveImage() creates a "ripple" effect in the image by shifting
12324 % the pixels vertically along a sine wave whose amplitude and wavelength
12325 % is specified by the given parameters.
12327 % The format of the MagickWaveImage method is:
12329 % MagickBooleanType MagickWaveImage(MagickWand *wand,const double amplitude,
12330 % const double wave_length)
12332 % A description of each parameter follows:
12334 % o wand: the magick wand.
12336 % o amplitude, wave_length: Define the amplitude and wave length of the
12340 WandExport MagickBooleanType MagickWaveImage(MagickWand *wand,
12341 const double amplitude,const double wave_length)
12346 assert(wand != (MagickWand *) NULL);
12347 assert(wand->signature == WandSignature);
12348 if (wand->debug != MagickFalse)
12349 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12350 if (wand->images == (Image *) NULL)
12351 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12352 wave_image=WaveImage(wand->images,amplitude,wave_length,wand->exception);
12353 if (wave_image == (Image *) NULL)
12354 return(MagickFalse);
12355 ReplaceImageInList(&wand->images,wave_image);
12356 return(MagickTrue);
12360 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12364 % 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 %
12368 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12370 % MagickWhiteThresholdImage() is like ThresholdImage() but force all pixels
12371 % above the threshold into white while leaving all pixels below the threshold
12374 % The format of the MagickWhiteThresholdImage method is:
12376 % MagickBooleanType MagickWhiteThresholdImage(MagickWand *wand,
12377 % const PixelWand *threshold)
12379 % A description of each parameter follows:
12381 % o wand: the magick wand.
12383 % o threshold: the pixel wand.
12386 WandExport MagickBooleanType MagickWhiteThresholdImage(MagickWand *wand,
12387 const PixelWand *threshold)
12390 thresholds[MaxTextExtent];
12395 assert(wand != (MagickWand *) NULL);
12396 assert(wand->signature == WandSignature);
12397 if (wand->debug != MagickFalse)
12398 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12399 if (wand->images == (Image *) NULL)
12400 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12401 (void) FormatMagickString(thresholds,MaxTextExtent,
12402 QuantumFormat "," QuantumFormat "," QuantumFormat "," QuantumFormat,
12403 PixelGetRedQuantum(threshold),PixelGetGreenQuantum(threshold),
12404 PixelGetBlueQuantum(threshold),PixelGetOpacityQuantum(threshold));
12405 status=WhiteThresholdImage(wand->images,thresholds);
12406 if (status == MagickFalse)
12407 InheritException(wand->exception,&wand->images->exception);
12412 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12416 % M a g i c k W r i t e I m a g e %
12420 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12422 % MagickWriteImage() writes an image to the specified filename. If the
12423 % filename parameter is NULL, the image is written to the filename set
12424 % by MagickReadImage() or MagickSetImageFilename().
12426 % The format of the MagickWriteImage method is:
12428 % MagickBooleanType MagickWriteImage(MagickWand *wand,
12429 % const char *filename)
12431 % A description of each parameter follows:
12433 % o wand: the magick wand.
12435 % o filename: the image filename.
12439 WandExport MagickBooleanType MagickWriteImage(MagickWand *wand,
12440 const char *filename)
12451 assert(wand != (MagickWand *) NULL);
12452 assert(wand->signature == WandSignature);
12453 if (wand->debug != MagickFalse)
12454 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12455 if (wand->images == (Image *) NULL)
12456 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12457 if (filename != (const char *) NULL)
12458 (void) CopyMagickString(wand->images->filename,filename,MaxTextExtent);
12459 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
12460 if (image == (Image *) NULL)
12461 return(MagickFalse);
12462 write_info=CloneImageInfo(wand->image_info);
12463 write_info->adjoin=MagickTrue;
12464 status=WriteImage(write_info,image);
12465 if (status == MagickFalse)
12466 InheritException(wand->exception,&image->exception);
12467 image=DestroyImage(image);
12468 write_info=DestroyImageInfo(write_info);
12473 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12477 % M a g i c k W r i t e I m a g e F i l e %
12481 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12483 % MagickWriteImageFile() writes an image to an open file descriptor.
12485 % The format of the MagickWriteImageFile method is:
12487 % MagickBooleanType MagickWriteImageFile(MagickWand *wand,FILE *file)
12489 % A description of each parameter follows:
12491 % o wand: the magick wand.
12493 % o file: the file descriptor.
12497 WandExport MagickBooleanType MagickWriteImageFile(MagickWand *wand,FILE *file)
12508 assert(wand != (MagickWand *) NULL);
12509 assert(wand->signature == WandSignature);
12510 assert(file != (FILE *) NULL);
12511 if (wand->debug != MagickFalse)
12512 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12513 if (wand->images == (Image *) NULL)
12514 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12515 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
12516 if (image == (Image *) NULL)
12517 return(MagickFalse);
12518 write_info=CloneImageInfo(wand->image_info);
12519 SetImageInfoFile(write_info,file);
12520 write_info->adjoin=MagickTrue;
12521 status=WriteImage(write_info,image);
12522 write_info=DestroyImageInfo(write_info);
12523 if (status == MagickFalse)
12524 InheritException(wand->exception,&image->exception);
12525 image=DestroyImage(image);
12530 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12534 % M a g i c k W r i t e I m a g e s %
12538 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12540 % MagickWriteImages() writes an image or image sequence.
12542 % The format of the MagickWriteImages method is:
12544 % MagickBooleanType MagickWriteImages(MagickWand *wand,
12545 % const char *filename,const MagickBooleanType adjoin)
12547 % A description of each parameter follows:
12549 % o wand: the magick wand.
12551 % o filename: the image filename.
12553 % o adjoin: join images into a single multi-image file.
12556 WandExport MagickBooleanType MagickWriteImages(MagickWand *wand,
12557 const char *filename,const MagickBooleanType adjoin)
12565 assert(wand != (MagickWand *) NULL);
12566 assert(wand->signature == WandSignature);
12567 if (wand->debug != MagickFalse)
12568 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12569 if (wand->images == (Image *) NULL)
12570 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12571 write_info=CloneImageInfo(wand->image_info);
12572 write_info->adjoin=adjoin;
12573 status=WriteImages(write_info,wand->images,filename,wand->exception);
12574 if (status == MagickFalse)
12575 InheritException(wand->exception,&wand->images->exception);
12576 write_info=DestroyImageInfo(write_info);
12581 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12585 % M a g i c k W r i t e I m a g e s F i l e %
12589 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12591 % MagickWriteImagesFile() writes an image sequence to an open file descriptor.
12593 % The format of the MagickWriteImagesFile method is:
12595 % MagickBooleanType MagickWriteImagesFile(MagickWand *wand,FILE *file)
12597 % A description of each parameter follows:
12599 % o wand: the magick wand.
12601 % o file: the file descriptor.
12604 WandExport MagickBooleanType MagickWriteImagesFile(MagickWand *wand,FILE *file)
12612 assert(wand != (MagickWand *) NULL);
12613 assert(wand->signature == WandSignature);
12614 if (wand->debug != MagickFalse)
12615 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12616 if (wand->images == (Image *) NULL)
12617 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12618 write_info=CloneImageInfo(wand->image_info);
12619 SetImageInfoFile(write_info,file);
12620 write_info->adjoin=MagickTrue;
12621 status=WriteImages(write_info,wand->images,(const char *) NULL,
12623 write_info=DestroyImageInfo(write_info);
12624 if (status == MagickFalse)
12625 InheritException(wand->exception,&wand->images->exception);