2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6 % M M AAA GGGG IIIII CCCC K K %
7 % MM MM A A G I C K K %
8 % M M M AAAAA G GGG I C KKK %
9 % M M A A G G I C K K %
10 % M M A A GGGG IIIII CCCC K K %
12 % IIIII M M AAA GGGG EEEEE %
14 % I M M M AAAAA G GG EEE %
16 % IIIII M M A A GGGG EEEEE %
19 % MagickWand Image Methods %
26 % Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization %
27 % dedicated to making software imaging solutions freely available. %
29 % You may not use this file except in compliance with the License. You may %
30 % obtain a copy of the License at %
32 % http://www.imagemagick.org/script/license.php %
34 % Unless required by applicable law or agreed to in writing, software %
35 % distributed under the License is distributed on an "AS IS" BASIS, %
36 % WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. %
37 % See the License for the specific language governing permissions and %
38 % limitations under the License. %
40 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
49 #include "MagickWand/studio.h"
50 #include "MagickWand/MagickWand.h"
51 #include "MagickWand/magick-wand-private.h"
52 #include "MagickWand/wand.h"
53 #include "MagickWand/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) FormatLocaleString(clone_wand->name,MaxTextExtent,"%s-%.20g",
109 MagickWandId,(double) clone_wand->id);
110 clone_wand->exception=AcquireExceptionInfo();
111 InheritException(clone_wand->exception,wand->exception);
112 clone_wand->image_info=CloneImageInfo(wand->image_info);
113 clone_wand->quantize_info=CloneQuantizeInfo(wand->quantize_info);
114 clone_wand->images=images;
115 clone_wand->debug=IsEventLogging();
116 if (clone_wand->debug != MagickFalse)
117 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",clone_wand->name);
118 clone_wand->signature=WandSignature;
123 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
127 % G e t I m a g e F r o m M a g i c k W a n d %
131 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
133 % GetImageFromMagickWand() returns the current image from the magick wand.
135 % The format of the GetImageFromMagickWand method is:
137 % Image *GetImageFromMagickWand(const MagickWand *wand)
139 % A description of each parameter follows:
141 % o wand: the magick wand.
144 WandExport Image *GetImageFromMagickWand(const MagickWand *wand)
146 assert(wand != (MagickWand *) NULL);
147 assert(wand->signature == WandSignature);
148 if (wand->debug != MagickFalse)
149 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
150 if (wand->images == (Image *) NULL)
152 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
153 "ContainsNoImages","`%s'",wand->name);
154 return((Image *) NULL);
156 return(wand->images);
160 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
164 % M a g i c k A d a p t i v e S h a r p e n I m a g e %
168 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
170 % MagickAdaptiveBlurImage() adaptively blurs the image by blurring
171 % less intensely near image edges and more intensely far from edges. We
172 % blur the image with a Gaussian operator of the given radius and standard
173 % deviation (sigma). For reasonable results, radius should be larger than
174 % sigma. Use a radius of 0 and MagickAdaptiveBlurImage() selects a
175 % suitable radius for you.
177 % The format of the MagickAdaptiveBlurImage method is:
179 % MagickBooleanType MagickAdaptiveBlurImage(MagickWand *wand,
180 % const double radius,const double sigma,const double bias)
182 % A description of each parameter follows:
184 % o wand: the magick wand.
186 % o radius: the radius of the Gaussian, in pixels, not counting the center
189 % o sigma: the standard deviation of the Gaussian, in pixels.
194 WandExport MagickBooleanType MagickAdaptiveBlurImage(MagickWand *wand,
195 const double radius,const double sigma,const double bias)
200 assert(wand != (MagickWand *) NULL);
201 assert(wand->signature == WandSignature);
202 if (wand->debug != MagickFalse)
203 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
204 if (wand->images == (Image *) NULL)
205 ThrowWandException(WandError,"ContainsNoImages",wand->name);
206 sharp_image=AdaptiveBlurImage(wand->images,radius,sigma,bias,wand->exception);
207 if (sharp_image == (Image *) NULL)
209 ReplaceImageInList(&wand->images,sharp_image);
214 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
218 % 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 %
222 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
224 % MagickAdaptiveResizeImage() adaptively resize image with data dependent
227 % MagickBooleanType MagickAdaptiveResizeImage(MagickWand *wand,
228 % const size_t columns,const size_t rows,
229 % const PixelInterpolateMethod method)
231 % A description of each parameter follows:
233 % o wand: the magick wand.
235 % o columns: the number of columns in the scaled image.
237 % o rows: the number of rows in the scaled image.
239 % o interpolate: the pixel interpolation method.
242 WandExport MagickBooleanType MagickAdaptiveResizeImage(MagickWand *wand,
243 const size_t columns,const size_t rows,const PixelInterpolateMethod method)
248 assert(wand != (MagickWand *) NULL);
249 assert(wand->signature == WandSignature);
250 if (wand->debug != MagickFalse)
251 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
252 if (wand->images == (Image *) NULL)
253 ThrowWandException(WandError,"ContainsNoImages",wand->name);
254 resize_image=AdaptiveResizeImage(wand->images,columns,rows,method,
256 if (resize_image == (Image *) NULL)
258 ReplaceImageInList(&wand->images,resize_image);
263 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
267 % 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 %
271 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
273 % MagickAdaptiveSharpenImage() adaptively sharpens the image by sharpening
274 % more intensely near image edges and less intensely far from edges. We
275 % sharpen the image with a Gaussian operator of the given radius and standard
276 % deviation (sigma). For reasonable results, radius should be larger than
277 % sigma. Use a radius of 0 and MagickAdaptiveSharpenImage() selects a
278 % suitable radius for you.
280 % The format of the MagickAdaptiveSharpenImage method is:
282 % MagickBooleanType MagickAdaptiveSharpenImage(MagickWand *wand,
283 % const double radius,const double sigma,const double bias)
285 % A description of each parameter follows:
287 % o wand: the magick wand.
289 % o radius: the radius of the Gaussian, in pixels, not counting the center
292 % o sigma: the standard deviation of the Gaussian, in pixels.
297 WandExport MagickBooleanType MagickAdaptiveSharpenImage(MagickWand *wand,
298 const double radius,const double sigma,const double bias)
303 assert(wand != (MagickWand *) NULL);
304 assert(wand->signature == WandSignature);
305 if (wand->debug != MagickFalse)
306 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
307 if (wand->images == (Image *) NULL)
308 ThrowWandException(WandError,"ContainsNoImages",wand->name);
309 sharp_image=AdaptiveSharpenImage(wand->images,radius,sigma,bias,
311 if (sharp_image == (Image *) NULL)
313 ReplaceImageInList(&wand->images,sharp_image);
318 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
322 % 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 %
326 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
328 % MagickAdaptiveThresholdImage() selects an individual threshold for each pixel
329 % based on the range of intensity values in its local neighborhood. This
330 % allows for thresholding of an image whose global intensity histogram
331 % doesn't contain distinctive peaks.
333 % The format of the AdaptiveThresholdImage method is:
335 % MagickBooleanType MagickAdaptiveThresholdImage(MagickWand *wand,
336 % const size_t width,const size_t height,const double bias)
338 % A description of each parameter follows:
340 % o wand: the magick wand.
342 % o width: the width of the local neighborhood.
344 % o height: the height of the local neighborhood.
346 % o offset: the mean bias.
349 WandExport MagickBooleanType MagickAdaptiveThresholdImage(MagickWand *wand,
350 const size_t width,const size_t height,const double bias)
355 assert(wand != (MagickWand *) NULL);
356 assert(wand->signature == WandSignature);
357 if (wand->debug != MagickFalse)
358 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
359 if (wand->images == (Image *) NULL)
360 ThrowWandException(WandError,"ContainsNoImages",wand->name);
361 threshold_image=AdaptiveThresholdImage(wand->images,width,height,bias,
363 if (threshold_image == (Image *) NULL)
365 ReplaceImageInList(&wand->images,threshold_image);
370 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
374 % M a g i c k A d d I m a g e %
378 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
380 % MagickAddImage() adds a clone of the images in the second wand and
381 % inserts them into the first wand, at the current image location.
383 % Use MagickSetFirstIterator(), to insert new images before all the current
384 % images in the wand, otherwise image is placed after the current image.
386 % The format of the MagickAddImage method is:
388 % MagickBooleanType MagickAddImage(MagickWand *wand,
389 % const MagickWand *add_wand)
391 % A description of each parameter follows:
393 % o wand: the magick wand.
395 % o add_wand: A wand that contains images to add at the current image
400 static inline MagickBooleanType InsertImageInWand(MagickWand *wand,
406 current=wand->images; /* note the current image */
408 /* if no images in wand, just add them and set first image as current */
409 if (current == (Image *) NULL)
411 wand->images=GetFirstImageInList(images);
415 /* user jumped to first image, so prepend new images - remain active */
416 if ((wand->set_first != MagickFalse) &&
417 (current->previous == (Image *) NULL) )
419 PrependImageToList(¤t,images);
420 wand->images=GetFirstImageInList(images);
423 wand->set_first = MagickFalse; /* flag no longer valid */
425 /* Current image was flaged as 'pending' iterative processing. */
426 if (wand->image_pending != MagickFalse)
428 /* current pending image is the last, append new images */
429 if (current->next == (Image *) NULL)
431 AppendImageToList(¤t,images);
432 wand->images=GetLastImageInList(images);
435 /* current pending image is the first image, prepend it */
436 if (current->previous == (Image *) NULL)
438 PrependImageToList(¤t,images);
439 wand->images=GetFirstImageInList(images);
444 /* if at last image append new images */
445 if (current->next == (Image *) NULL)
447 InsertImageInList(¤t,images);
448 wand->images=GetLastImageInList(images);
451 /* otherwise just insert image, just after the current image */
452 InsertImageInList(¤t,images);
453 wand->images=GetFirstImageInList(images);
457 WandExport MagickBooleanType MagickAddImage(MagickWand *wand,
458 const MagickWand *add_wand)
463 assert(wand != (MagickWand *) NULL);
464 assert(wand->signature == WandSignature);
465 if (wand->debug != MagickFalse)
466 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
467 assert(add_wand != (MagickWand *) NULL);
468 assert(add_wand->signature == WandSignature);
469 if (add_wand->images == (Image *) NULL)
470 ThrowWandException(WandError,"ContainsNoImages",add_wand->name);
472 /* clone images in second wand, and insert into first */
473 images=CloneImageList(add_wand->images,wand->exception);
474 if (images == (Image *) NULL)
476 return(InsertImageInWand(wand,images));
480 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
484 % M a g i c k A d d N o i s e I m a g e %
488 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
490 % MagickAddNoiseImage() adds random noise to the image.
492 % The format of the MagickAddNoiseImage method is:
494 % MagickBooleanType MagickAddNoiseImage(MagickWand *wand,
495 % const NoiseType noise_type,const double attenuate)
497 % A description of each parameter follows:
499 % o wand: the magick wand.
501 % o noise_type: The type of noise: Uniform, Gaussian, Multiplicative,
502 % Impulse, Laplacian, or Poisson.
504 % o attenuate: attenuate the random distribution.
507 WandExport MagickBooleanType MagickAddNoiseImage(MagickWand *wand,
508 const NoiseType noise_type,const double attenuate)
513 assert(wand != (MagickWand *) NULL);
514 assert(wand->signature == WandSignature);
515 if (wand->debug != MagickFalse)
516 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
517 if (wand->images == (Image *) NULL)
518 ThrowWandException(WandError,"ContainsNoImages",wand->name);
519 noise_image=AddNoiseImage(wand->images,noise_type,attenuate,wand->exception);
520 if (noise_image == (Image *) NULL)
522 ReplaceImageInList(&wand->images,noise_image);
527 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
531 % 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 %
535 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
537 % MagickAffineTransformImage() transforms an image as dictated by the affine
538 % matrix of the drawing wand.
540 % The format of the MagickAffineTransformImage method is:
542 % MagickBooleanType MagickAffineTransformImage(MagickWand *wand,
543 % const DrawingWand *drawing_wand)
545 % A description of each parameter follows:
547 % o wand: the magick wand.
549 % o drawing_wand: the draw wand.
552 WandExport MagickBooleanType MagickAffineTransformImage(MagickWand *wand,
553 const DrawingWand *drawing_wand)
561 assert(wand != (MagickWand *) NULL);
562 assert(wand->signature == WandSignature);
563 if (wand->debug != MagickFalse)
564 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
565 if (wand->images == (Image *) NULL)
566 ThrowWandException(WandError,"ContainsNoImages",wand->name);
567 draw_info=PeekDrawingWand(drawing_wand);
568 if (draw_info == (DrawInfo *) NULL)
570 affine_image=AffineTransformImage(wand->images,&draw_info->affine,
572 draw_info=DestroyDrawInfo(draw_info);
573 if (affine_image == (Image *) NULL)
575 ReplaceImageInList(&wand->images,affine_image);
580 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
584 % M a g i c k A n n o t a t e I m a g e %
588 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
590 % MagickAnnotateImage() annotates an image with text.
592 % The format of the MagickAnnotateImage method is:
594 % MagickBooleanType MagickAnnotateImage(MagickWand *wand,
595 % const DrawingWand *drawing_wand,const double x,const double y,
596 % const double angle,const char *text)
598 % A description of each parameter follows:
600 % o wand: the magick wand.
602 % o drawing_wand: the draw wand.
604 % o x: x ordinate to left of text
606 % o y: y ordinate to text baseline
608 % o angle: rotate text relative to this angle.
610 % o text: text to draw
613 WandExport MagickBooleanType MagickAnnotateImage(MagickWand *wand,
614 const DrawingWand *drawing_wand,const double x,const double y,
615 const double angle,const char *text)
618 geometry[MaxTextExtent];
626 assert(wand != (MagickWand *) NULL);
627 assert(wand->signature == WandSignature);
628 if (wand->debug != MagickFalse)
629 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
630 if (wand->images == (Image *) NULL)
631 ThrowWandException(WandError,"ContainsNoImages",wand->name);
632 draw_info=PeekDrawingWand(drawing_wand);
633 if (draw_info == (DrawInfo *) NULL)
635 (void) CloneString(&draw_info->text,text);
636 (void) FormatLocaleString(geometry,MaxTextExtent,"%+g%+g",x,y);
637 draw_info->affine.sx=cos((double) DegreesToRadians(fmod(angle,360.0)));
638 draw_info->affine.rx=sin((double) DegreesToRadians(fmod(angle,360.0)));
639 draw_info->affine.ry=(-sin((double) DegreesToRadians(fmod(angle,360.0))));
640 draw_info->affine.sy=cos((double) DegreesToRadians(fmod(angle,360.0)));
641 (void) CloneString(&draw_info->geometry,geometry);
642 status=AnnotateImage(wand->images,draw_info,&wand->images->exception);
643 draw_info=DestroyDrawInfo(draw_info);
648 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
652 % M a g i c k A n i m a t e I m a g e s %
656 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
658 % MagickAnimateImages() animates an image or image sequence.
660 % The format of the MagickAnimateImages method is:
662 % MagickBooleanType MagickAnimateImages(MagickWand *wand,
663 % const char *server_name)
665 % A description of each parameter follows:
667 % o wand: the magick wand.
669 % o server_name: the X server name.
672 WandExport MagickBooleanType MagickAnimateImages(MagickWand *wand,
673 const char *server_name)
678 assert(wand != (MagickWand *) NULL);
679 assert(wand->signature == WandSignature);
680 if (wand->debug != MagickFalse)
681 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
682 (void) CloneString(&wand->image_info->server_name,server_name);
683 status=AnimateImages(wand->image_info,wand->images,&wand->images->exception);
688 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
692 % M a g i c k A p p e n d I m a g e s %
696 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
698 % MagickAppendImages() append a set of images.
700 % The format of the MagickAppendImages method is:
702 % MagickWand *MagickAppendImages(MagickWand *wand,
703 % const MagickBooleanType stack)
705 % A description of each parameter follows:
707 % o wand: the magick wand.
709 % o stack: By default, images are stacked left-to-right. Set stack to
710 % MagickTrue to stack them top-to-bottom.
713 WandExport MagickWand *MagickAppendImages(MagickWand *wand,
714 const MagickBooleanType stack)
719 assert(wand != (MagickWand *) NULL);
720 assert(wand->signature == WandSignature);
721 if (wand->debug != MagickFalse)
722 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
723 if (wand->images == (Image *) NULL)
724 return((MagickWand *) NULL);
725 append_image=AppendImages(wand->images,stack,wand->exception);
726 if (append_image == (Image *) NULL)
727 return((MagickWand *) NULL);
728 return(CloneMagickWandFromImages(wand,append_image));
732 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
736 % M a g i c k A u t o G a m m a I m a g e %
740 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
742 % MagickAutoGammaImage() extracts the 'mean' from the image and adjust the
743 % image to try make set its gamma appropriatally.
745 % The format of the MagickAutoGammaImage method is:
747 % MagickBooleanType MagickAutoGammaImage(MagickWand *wand)
749 % A description of each parameter follows:
751 % o wand: the magick wand.
754 WandExport MagickBooleanType MagickAutoGammaImage(MagickWand *wand)
759 assert(wand != (MagickWand *) NULL);
760 assert(wand->signature == WandSignature);
761 if (wand->debug != MagickFalse)
762 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
763 if (wand->images == (Image *) NULL)
764 ThrowWandException(WandError,"ContainsNoImages",wand->name);
765 status=AutoGammaImage(wand->images,&wand->images->exception);
770 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
774 % M a g i c k A u t o L e v e l I m a g e %
778 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
780 % MagickAutoLevelImage() adjusts the levels of a particular image channel by
781 % scaling the minimum and maximum values to the full quantum range.
783 % The format of the MagickAutoLevelImage method is:
785 % MagickBooleanType MagickAutoLevelImage(MagickWand *wand)
787 % A description of each parameter follows:
789 % o wand: the magick wand.
792 WandExport MagickBooleanType MagickAutoLevelImage(MagickWand *wand)
797 assert(wand != (MagickWand *) NULL);
798 assert(wand->signature == WandSignature);
799 if (wand->debug != MagickFalse)
800 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
801 if (wand->images == (Image *) NULL)
802 ThrowWandException(WandError,"ContainsNoImages",wand->name);
803 status=AutoLevelImage(wand->images,&wand->images->exception);
808 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
812 % 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 %
816 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
818 % MagickBlackThresholdImage() is like MagickThresholdImage() but forces all
819 % pixels below the threshold into black while leaving all pixels above the
820 % threshold unchanged.
822 % The format of the MagickBlackThresholdImage method is:
824 % MagickBooleanType MagickBlackThresholdImage(MagickWand *wand,
825 % const PixelWand *threshold)
827 % A description of each parameter follows:
829 % o wand: the magick wand.
831 % o threshold: the pixel wand.
834 WandExport MagickBooleanType MagickBlackThresholdImage(MagickWand *wand,
835 const PixelWand *threshold)
838 thresholds[MaxTextExtent];
843 assert(wand != (MagickWand *) NULL);
844 assert(wand->signature == WandSignature);
845 if (wand->debug != MagickFalse)
846 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
847 if (wand->images == (Image *) NULL)
848 ThrowWandException(WandError,"ContainsNoImages",wand->name);
849 (void) FormatLocaleString(thresholds,MaxTextExtent,
850 QuantumFormat "," QuantumFormat "," QuantumFormat "," QuantumFormat,
851 PixelGetRedQuantum(threshold),PixelGetGreenQuantum(threshold),
852 PixelGetBlueQuantum(threshold),PixelGetAlphaQuantum(threshold));
853 status=BlackThresholdImage(wand->images,thresholds,wand->exception);
858 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
862 % M a g i c k B l u e S h i f t I m a g e %
866 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
868 % MagickBlueShiftImage() mutes the colors of the image to simulate a scene at
869 % nighttime in the moonlight.
871 % The format of the MagickBlueShiftImage method is:
873 % MagickBooleanType MagickBlueShiftImage(MagickWand *wand,
874 % const double factor)
876 % A description of each parameter follows:
878 % o wand: the magick wand.
880 % o factor: the blue shift factor (default 1.5)
883 WandExport MagickBooleanType MagickBlueShiftImage(MagickWand *wand,
889 assert(wand != (MagickWand *) NULL);
890 assert(wand->signature == WandSignature);
891 if (wand->debug != MagickFalse)
892 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
893 if (wand->images == (Image *) NULL)
894 ThrowWandException(WandError,"ContainsNoImages",wand->name);
895 shift_image=BlueShiftImage(wand->images,factor,wand->exception);
896 if (shift_image == (Image *) NULL)
898 ReplaceImageInList(&wand->images,shift_image);
903 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
907 % M a g i c k B l u r I m a g e %
911 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
913 % MagickBlurImage() blurs an image. We convolve the image with a
914 % gaussian operator of the given radius and standard deviation (sigma).
915 % For reasonable results, the radius should be larger than sigma. Use a
916 % radius of 0 and BlurImage() selects a suitable radius for you.
918 % The format of the MagickBlurImage method is:
920 % MagickBooleanType MagickBlurImage(MagickWand *wand,const double radius,
921 % const double sigmaconst double bias)
923 % A description of each parameter follows:
925 % o wand: the magick wand.
927 % o radius: the radius of the , in pixels, not counting the center
930 % o sigma: the standard deviation of the , in pixels.
935 WandExport MagickBooleanType MagickBlurImage(MagickWand *wand,
936 const double radius,const double sigma,const double bias)
941 assert(wand != (MagickWand *) NULL);
942 assert(wand->signature == WandSignature);
943 if (wand->debug != MagickFalse)
944 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
945 if (wand->images == (Image *) NULL)
946 ThrowWandException(WandError,"ContainsNoImages",wand->name);
947 blur_image=BlurImage(wand->images,radius,sigma,bias,wand->exception);
948 if (blur_image == (Image *) NULL)
950 ReplaceImageInList(&wand->images,blur_image);
955 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
959 % M a g i c k B o r d e r I m a g e %
963 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
965 % MagickBorderImage() surrounds the image with a border of the color defined
966 % by the bordercolor pixel wand.
968 % The format of the MagickBorderImage method is:
970 % MagickBooleanType MagickBorderImage(MagickWand *wand,
971 % const PixelWand *bordercolor,const size_t width,
972 % const size_t height,const CompositeOperator compose)
974 % A description of each parameter follows:
976 % o wand: the magick wand.
978 % o bordercolor: the border color pixel wand.
980 % o width: the border width.
982 % o height: the border height.
984 % o compose: the composite operator.
987 WandExport MagickBooleanType MagickBorderImage(MagickWand *wand,
988 const PixelWand *bordercolor,const size_t width,const size_t height,
989 const CompositeOperator compose)
997 assert(wand != (MagickWand *) NULL);
998 assert(wand->signature == WandSignature);
999 if (wand->debug != MagickFalse)
1000 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1001 if (wand->images == (Image *) NULL)
1002 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1003 border_info.width=width;
1004 border_info.height=height;
1007 PixelGetQuantumPacket(bordercolor,&wand->images->border_color);
1008 border_image=BorderImage(wand->images,&border_info,compose,wand->exception);
1009 if (border_image == (Image *) NULL)
1010 return(MagickFalse);
1011 ReplaceImageInList(&wand->images,border_image);
1016 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1020 % M a g i c k B r i g h t n e s s C o n t r a s t S t r e t c h I m a g e %
1024 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1026 % Use MagickBrightnessContrastImage() to change the brightness and/or contrast
1027 % of an image. It converts the brightness and contrast parameters into slope
1028 % and intercept and calls a polynomical function to apply to the image.
1031 % The format of the MagickBrightnessContrastImage method is:
1033 % MagickBooleanType MagickBrightnessContrastImage(MagickWand *wand,
1034 % const double brightness,const double contrast)
1036 % A description of each parameter follows:
1038 % o wand: the magick wand.
1040 % o brightness: the brightness percent (-100 .. 100).
1042 % o contrast: the contrast percent (-100 .. 100).
1045 WandExport MagickBooleanType MagickBrightnessContrastImage(
1046 MagickWand *wand,const double brightness,const double contrast)
1051 assert(wand != (MagickWand *) NULL);
1052 assert(wand->signature == WandSignature);
1053 if (wand->debug != MagickFalse)
1054 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1055 if (wand->images == (Image *) NULL)
1056 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1057 status=BrightnessContrastImage(wand->images,brightness,contrast,
1058 &wand->images->exception);
1063 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1067 % M a g i c k C h a r c o a l I m a g e %
1071 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1073 % MagickCharcoalImage() simulates a charcoal drawing.
1075 % The format of the MagickCharcoalImage method is:
1077 % MagickBooleanType MagickCharcoalImage(MagickWand *wand,
1078 % const double radius,const double sigma,const double bias)
1080 % A description of each parameter follows:
1082 % o wand: the magick wand.
1084 % o radius: the radius of the Gaussian, in pixels, not counting the center
1087 % o sigma: the standard deviation of the Gaussian, in pixels.
1092 WandExport MagickBooleanType MagickCharcoalImage(MagickWand *wand,
1093 const double radius,const double sigma,const double bias)
1098 assert(wand != (MagickWand *) NULL);
1099 assert(wand->signature == WandSignature);
1100 if (wand->debug != MagickFalse)
1101 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1102 if (wand->images == (Image *) NULL)
1103 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1104 charcoal_image=CharcoalImage(wand->images,radius,sigma,bias,wand->exception);
1105 if (charcoal_image == (Image *) NULL)
1106 return(MagickFalse);
1107 ReplaceImageInList(&wand->images,charcoal_image);
1112 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1116 % M a g i c k C h o p I m a g e %
1120 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1122 % MagickChopImage() removes a region of an image and collapses the image to
1123 % occupy the removed portion
1125 % The format of the MagickChopImage method is:
1127 % MagickBooleanType MagickChopImage(MagickWand *wand,
1128 % const size_t width,const size_t height,const ssize_t x,
1131 % A description of each parameter follows:
1133 % o wand: the magick wand.
1135 % o width: the region width.
1137 % o height: the region height.
1139 % o x: the region x offset.
1141 % o y: the region y offset.
1145 WandExport MagickBooleanType MagickChopImage(MagickWand *wand,
1146 const size_t width,const size_t height,const ssize_t x,
1155 assert(wand != (MagickWand *) NULL);
1156 assert(wand->signature == WandSignature);
1157 if (wand->debug != MagickFalse)
1158 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1159 if (wand->images == (Image *) NULL)
1160 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1165 chop_image=ChopImage(wand->images,&chop,wand->exception);
1166 if (chop_image == (Image *) NULL)
1167 return(MagickFalse);
1168 ReplaceImageInList(&wand->images,chop_image);
1173 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1177 % M a g i c k C l a m p I m a g e %
1181 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1183 % MagickClampImage() restricts the color range from 0 to the quantum depth.
1185 % The format of the MagickClampImage method is:
1187 % MagickBooleanType MagickClampImage(MagickWand *wand)
1189 % A description of each parameter follows:
1191 % o wand: the magick wand.
1193 % o channel: the channel.
1196 WandExport MagickBooleanType MagickClampImage(MagickWand *wand)
1198 assert(wand != (MagickWand *) NULL);
1199 assert(wand->signature == WandSignature);
1200 if (wand->debug != MagickFalse)
1201 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1202 if (wand->images == (Image *) NULL)
1203 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1204 return(ClampImage(wand->images,wand->exception));
1208 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1212 % M a g i c k C l i p I m a g e %
1216 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1218 % MagickClipImage() clips along the first path from the 8BIM profile, if
1221 % The format of the MagickClipImage method is:
1223 % MagickBooleanType MagickClipImage(MagickWand *wand)
1225 % A description of each parameter follows:
1227 % o wand: the magick wand.
1230 WandExport MagickBooleanType MagickClipImage(MagickWand *wand)
1235 assert(wand != (MagickWand *) NULL);
1236 assert(wand->signature == WandSignature);
1237 if (wand->debug != MagickFalse)
1238 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1239 if (wand->images == (Image *) NULL)
1240 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1241 status=ClipImage(wand->images,wand->exception);
1246 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1250 % M a g i c k C l i p I m a g e P a t h %
1254 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1256 % MagickClipImagePath() clips along the named paths from the 8BIM profile, if
1257 % present. Later operations take effect inside the path. Id may be a number
1258 % if preceded with #, to work on a numbered path, e.g., "#1" to use the first
1261 % The format of the MagickClipImagePath method is:
1263 % MagickBooleanType MagickClipImagePath(MagickWand *wand,
1264 % const char *pathname,const MagickBooleanType inside)
1266 % A description of each parameter follows:
1268 % o wand: the magick wand.
1270 % o pathname: name of clipping path resource. If name is preceded by #, use
1271 % clipping path numbered by name.
1273 % o inside: if non-zero, later operations take effect inside clipping path.
1274 % Otherwise later operations take effect outside clipping path.
1277 WandExport MagickBooleanType MagickClipImagePath(MagickWand *wand,
1278 const char *pathname,const MagickBooleanType inside)
1283 assert(wand != (MagickWand *) NULL);
1284 assert(wand->signature == WandSignature);
1285 if (wand->debug != MagickFalse)
1286 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1287 if (wand->images == (Image *) NULL)
1288 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1289 status=ClipImagePath(wand->images,pathname,inside,wand->exception);
1294 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1298 % M a g i c k C l u t I m a g e %
1302 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1304 % MagickClutImage() replaces colors in the image from a color lookup table.
1306 % The format of the MagickClutImage method is:
1308 % MagickBooleanType MagickClutImage(MagickWand *wand,
1309 % const MagickWand *clut_wand,const PixelInterpolateMethod method)
1311 % A description of each parameter follows:
1313 % o wand: the magick wand.
1315 % o clut_image: the clut image.
1317 % o method: the pixel interpolation method.
1320 WandExport MagickBooleanType MagickClutImage(MagickWand *wand,
1321 const MagickWand *clut_wand,const PixelInterpolateMethod method)
1326 assert(wand != (MagickWand *) NULL);
1327 assert(wand->signature == WandSignature);
1328 if (wand->debug != MagickFalse)
1329 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1330 if ((wand->images == (Image *) NULL) || (clut_wand->images == (Image *) NULL))
1331 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1332 status=ClutImage(wand->images,clut_wand->images,method,wand->exception);
1337 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1341 % M a g i c k C o a l e s c e I m a g e s %
1345 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1347 % MagickCoalesceImages() composites a set of images while respecting any page
1348 % offsets and disposal methods. GIF, MIFF, and MNG animation sequences
1349 % typically start with an image background and each subsequent image
1350 % varies in size and offset. MagickCoalesceImages() returns a new sequence
1351 % where each image in the sequence is the same size as the first and
1352 % composited with the next image in the sequence.
1354 % The format of the MagickCoalesceImages method is:
1356 % MagickWand *MagickCoalesceImages(MagickWand *wand)
1358 % A description of each parameter follows:
1360 % o wand: the magick wand.
1363 WandExport MagickWand *MagickCoalesceImages(MagickWand *wand)
1368 assert(wand != (MagickWand *) NULL);
1369 assert(wand->signature == WandSignature);
1370 if (wand->debug != MagickFalse)
1371 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1372 if (wand->images == (Image *) NULL)
1373 return((MagickWand *) NULL);
1374 coalesce_image=CoalesceImages(wand->images,wand->exception);
1375 if (coalesce_image == (Image *) NULL)
1376 return((MagickWand *) NULL);
1377 return(CloneMagickWandFromImages(wand,coalesce_image));
1381 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1385 % M a g i c k C o l o r D e c i s i o n I m a g e %
1389 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1391 % MagickColorDecisionListImage() accepts a lightweight Color Correction
1392 % Collection (CCC) file which solely contains one or more color corrections
1393 % and applies the color correction to the image. Here is a sample CCC file:
1395 % <ColorCorrectionCollection xmlns="urn:ASC:CDL:v1.2">
1396 % <ColorCorrection id="cc03345">
1398 % <Slope> 0.9 1.2 0.5 </Slope>
1399 % <Offset> 0.4 -0.5 0.6 </Offset>
1400 % <Power> 1.0 0.8 1.5 </Power>
1403 % <Saturation> 0.85 </Saturation>
1405 % </ColorCorrection>
1406 % </ColorCorrectionCollection>
1408 % which includes the offset, slope, and power for each of the RGB channels
1409 % as well as the saturation.
1411 % The format of the MagickColorDecisionListImage method is:
1413 % MagickBooleanType MagickColorDecisionListImage(MagickWand *wand,
1414 % const double gamma)
1416 % A description of each parameter follows:
1418 % o wand: the magick wand.
1420 % o color_correction_collection: the color correction collection in XML.
1423 WandExport MagickBooleanType MagickColorDecisionListImage(MagickWand *wand,
1424 const char *color_correction_collection)
1429 assert(wand != (MagickWand *) NULL);
1430 assert(wand->signature == WandSignature);
1431 if (wand->debug != MagickFalse)
1432 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1433 if (wand->images == (Image *) NULL)
1434 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1435 status=ColorDecisionListImage(wand->images,color_correction_collection,
1436 &wand->images->exception);
1441 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1445 % M a g i c k C o l o r i z e I m a g e %
1449 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1451 % MagickColorizeImage() blends the fill color with each pixel in the image.
1453 % The format of the MagickColorizeImage method is:
1455 % MagickBooleanType MagickColorizeImage(MagickWand *wand,
1456 % const PixelWand *colorize,const PixelWand *blend)
1458 % A description of each parameter follows:
1460 % o wand: the magick wand.
1462 % o colorize: the colorize pixel wand.
1464 % o alpha: the alpha pixel wand.
1467 WandExport MagickBooleanType MagickColorizeImage(MagickWand *wand,
1468 const PixelWand *colorize,const PixelWand *blend)
1471 percent_blend[MaxTextExtent];
1479 assert(wand != (MagickWand *) NULL);
1480 assert(wand->signature == WandSignature);
1481 if (wand->debug != MagickFalse)
1482 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1483 if (wand->images == (Image *) NULL)
1484 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1485 GetPixelInfo(wand->images,&target);
1486 if (target.colorspace != CMYKColorspace)
1487 (void) FormatLocaleString(percent_blend,MaxTextExtent,
1488 "%g,%g,%g,%g",(double) (100.0*QuantumScale*
1489 PixelGetRedQuantum(blend)),(double) (100.0*QuantumScale*
1490 PixelGetGreenQuantum(blend)),(double) (100.0*QuantumScale*
1491 PixelGetBlueQuantum(blend)),(double) (100.0*QuantumScale*
1492 PixelGetAlphaQuantum(blend)));
1494 (void) FormatLocaleString(percent_blend,MaxTextExtent,
1495 "%g,%g,%g,%g,%g",(double) (100.0*QuantumScale*
1496 PixelGetRedQuantum(blend)),(double) (100.0*QuantumScale*
1497 PixelGetGreenQuantum(blend)),(double) (100.0*QuantumScale*
1498 PixelGetBlueQuantum(blend)),(double) (100.0*QuantumScale*
1499 PixelGetBlackQuantum(blend)),(double) (100.0*QuantumScale*
1500 PixelGetAlphaQuantum(blend)));
1501 target=PixelGetPixel(colorize);
1502 colorize_image=ColorizeImage(wand->images,percent_blend,&target,
1504 if (colorize_image == (Image *) NULL)
1505 return(MagickFalse);
1506 ReplaceImageInList(&wand->images,colorize_image);
1511 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1515 % M a g i c k C o l o r M a t r i x I m a g e %
1519 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1521 % MagickColorMatrixImage() apply color transformation to an image. The method
1522 % permits saturation changes, hue rotation, luminance to alpha, and various
1523 % other effects. Although variable-sized transformation matrices can be used,
1524 % typically one uses a 5x5 matrix for an RGBA image and a 6x6 for CMYKA
1525 % (or RGBA with offsets). The matrix is similar to those used by Adobe Flash
1526 % except offsets are in column 6 rather than 5 (in support of CMYKA images)
1527 % and offsets are normalized (divide Flash offset by 255).
1529 % The format of the MagickColorMatrixImage method is:
1531 % MagickBooleanType MagickColorMatrixImage(MagickWand *wand,
1532 % const KernelInfo *color_matrix)
1534 % A description of each parameter follows:
1536 % o wand: the magick wand.
1538 % o color_matrix: the color matrix.
1541 WandExport MagickBooleanType MagickColorMatrixImage(MagickWand *wand,
1542 const KernelInfo *color_matrix)
1547 assert(wand != (MagickWand *) NULL);
1548 assert(wand->signature == WandSignature);
1549 if (wand->debug != MagickFalse)
1550 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1551 if (color_matrix == (const KernelInfo *) NULL)
1552 return(MagickFalse);
1553 if (wand->images == (Image *) NULL)
1554 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1555 color_image=ColorMatrixImage(wand->images,color_matrix,wand->exception);
1556 if (color_image == (Image *) NULL)
1557 return(MagickFalse);
1558 ReplaceImageInList(&wand->images,color_image);
1563 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1567 % M a g i c k C o m b i n e I m a g e s %
1571 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1573 % MagickCombineImages() combines one or more images into a single image. The
1574 % grayscale value of the pixels of each image in the sequence is assigned in
1575 % order to the specified hannels of the combined image. The typical
1576 % ordering would be image 1 => Red, 2 => Green, 3 => Blue, etc.
1578 % The format of the MagickCombineImages method is:
1580 % MagickWand *MagickCombineImages(MagickWand *wand)
1582 % A description of each parameter follows:
1584 % o wand: the magick wand.
1587 WandExport MagickWand *MagickCombineImages(MagickWand *wand)
1592 assert(wand != (MagickWand *) NULL);
1593 assert(wand->signature == WandSignature);
1594 if (wand->debug != MagickFalse)
1595 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1596 if (wand->images == (Image *) NULL)
1597 return((MagickWand *) NULL);
1598 combine_image=CombineImages(wand->images,wand->exception);
1599 if (combine_image == (Image *) NULL)
1600 return((MagickWand *) NULL);
1601 return(CloneMagickWandFromImages(wand,combine_image));
1605 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1609 % M a g i c k C o m m e n t I m a g e %
1613 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1615 % MagickCommentImage() adds a comment to your image.
1617 % The format of the MagickCommentImage method is:
1619 % MagickBooleanType MagickCommentImage(MagickWand *wand,
1620 % const char *comment)
1622 % A description of each parameter follows:
1624 % o wand: the magick wand.
1626 % o comment: the image comment.
1629 WandExport MagickBooleanType MagickCommentImage(MagickWand *wand,
1630 const char *comment)
1635 assert(wand != (MagickWand *) NULL);
1636 assert(wand->signature == WandSignature);
1637 if (wand->debug != MagickFalse)
1638 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1639 if (wand->images == (Image *) NULL)
1640 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1641 status=SetImageProperty(wand->images,"comment",comment,wand->exception);
1646 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1650 % M a g i c k C o m p a r e I m a g e L a y e r s %
1654 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1656 % MagickCompareImagesLayers() compares each image with the next in a sequence
1657 % and returns the maximum bounding region of any pixel differences it
1660 % The format of the MagickCompareImagesLayers method is:
1662 % MagickWand *MagickCompareImagesLayers(MagickWand *wand,
1663 % const ImageLayerMethod method)
1665 % A description of each parameter follows:
1667 % o wand: the magick wand.
1669 % o method: the compare method.
1672 WandExport MagickWand *MagickCompareImagesLayers(MagickWand *wand,
1673 const ImageLayerMethod method)
1678 assert(wand != (MagickWand *) NULL);
1679 assert(wand->signature == WandSignature);
1680 if (wand->debug != MagickFalse)
1681 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1682 if (wand->images == (Image *) NULL)
1683 return((MagickWand *) NULL);
1684 layers_image=CompareImagesLayers(wand->images,method,wand->exception);
1685 if (layers_image == (Image *) NULL)
1686 return((MagickWand *) NULL);
1687 return(CloneMagickWandFromImages(wand,layers_image));
1691 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1695 % M a g i c k C o m p a r e I m a g e s %
1699 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1701 % MagickCompareImages() compares an image to a reconstructed image and returns
1702 % the specified difference image.
1704 % The format of the MagickCompareImages method is:
1706 % MagickWand *MagickCompareImages(MagickWand *wand,
1707 % const MagickWand *reference,const MetricType metric,
1708 % double *distortion)
1710 % A description of each parameter follows:
1712 % o wand: the magick wand.
1714 % o reference: the reference wand.
1716 % o metric: the metric.
1718 % o distortion: the computed distortion between the images.
1721 WandExport MagickWand *MagickCompareImages(MagickWand *wand,
1722 const MagickWand *reference,const MetricType metric,double *distortion)
1728 assert(wand != (MagickWand *) NULL);
1729 assert(wand->signature == WandSignature);
1730 if (wand->debug != MagickFalse)
1731 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1732 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
1734 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
1735 "ContainsNoImages","`%s'",wand->name);
1736 return((MagickWand *) NULL);
1738 compare_image=CompareImages(wand->images,reference->images,metric,distortion,
1739 &wand->images->exception);
1740 if (compare_image == (Image *) NULL)
1741 return((MagickWand *) NULL);
1742 return(CloneMagickWandFromImages(wand,compare_image));
1746 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1750 % M a g i c k C o m p o s i t e I m a g e %
1754 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1756 % MagickCompositeImage() composite one image onto another at the specified
1759 % The format of the MagickCompositeImage method is:
1761 % MagickBooleanType MagickCompositeImage(MagickWand *wand,
1762 % const MagickWand *composite_wand,const CompositeOperator compose,
1763 % const ssize_t x,const ssize_t y)
1765 % A description of each parameter follows:
1767 % o wand: the magick wand.
1769 % o composite_image: the composite image.
1771 % o compose: This operator affects how the composite is applied to the
1772 % image. The default is Over. Choose from these operators:
1774 % OverCompositeOp InCompositeOp OutCompositeOp
1775 % AtopCompositeOp XorCompositeOp PlusCompositeOp
1776 % MinusCompositeOp AddCompositeOp SubtractCompositeOp
1777 % DifferenceCompositeOp BumpmapCompositeOp CopyCompositeOp
1778 % DisplaceCompositeOp
1780 % o x: the column offset of the composited image.
1782 % o y: the row offset of the composited image.
1785 WandExport MagickBooleanType MagickCompositeImage(MagickWand *wand,
1786 const MagickWand *composite_wand,const CompositeOperator compose,
1787 const ssize_t x,const ssize_t y)
1792 assert(wand != (MagickWand *) NULL);
1793 assert(wand->signature == WandSignature);
1794 if (wand->debug != MagickFalse)
1795 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1796 if ((wand->images == (Image *) NULL) ||
1797 (composite_wand->images == (Image *) NULL))
1798 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1799 status=CompositeImage(wand->images,compose,composite_wand->images,x,y,
1805 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1809 % M a g i c k C o n t r a s t I m a g e %
1813 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1815 % MagickContrastImage() enhances the intensity differences between the lighter
1816 % and darker elements of the image. Set sharpen to a value other than 0 to
1817 % increase the image contrast otherwise the contrast is reduced.
1819 % The format of the MagickContrastImage method is:
1821 % MagickBooleanType MagickContrastImage(MagickWand *wand,
1822 % const MagickBooleanType sharpen)
1824 % A description of each parameter follows:
1826 % o wand: the magick wand.
1828 % o sharpen: Increase or decrease image contrast.
1832 WandExport MagickBooleanType MagickContrastImage(MagickWand *wand,
1833 const MagickBooleanType sharpen)
1838 assert(wand != (MagickWand *) NULL);
1839 assert(wand->signature == WandSignature);
1840 if (wand->debug != MagickFalse)
1841 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1842 if (wand->images == (Image *) NULL)
1843 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1844 status=ContrastImage(wand->images,sharpen,&wand->images->exception);
1849 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1853 % 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 %
1857 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1859 % MagickContrastStretchImage() enhances the contrast of a color image by
1860 % adjusting the pixels color to span the entire range of colors available.
1861 % You can also reduce the influence of a particular channel with a gamma
1864 % The format of the MagickContrastStretchImage method is:
1866 % MagickBooleanType MagickContrastStretchImage(MagickWand *wand,
1867 % const double black_point,const double white_point)
1869 % A description of each parameter follows:
1871 % o wand: the magick wand.
1873 % o black_point: the black point.
1875 % o white_point: the white point.
1878 WandExport MagickBooleanType MagickContrastStretchImage(MagickWand *wand,
1879 const double black_point,const double white_point)
1884 assert(wand != (MagickWand *) NULL);
1885 assert(wand->signature == WandSignature);
1886 if (wand->debug != MagickFalse)
1887 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1888 if (wand->images == (Image *) NULL)
1889 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1890 status=ContrastStretchImage(wand->images,black_point,white_point,
1891 &wand->images->exception);
1896 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1900 % M a g i c k C o n v o l v e I m a g e %
1904 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1906 % MagickConvolveImage() applies a custom convolution kernel to the image.
1908 % The format of the MagickConvolveImage method is:
1910 % MagickBooleanType MagickConvolveImage(MagickWand *wand,
1911 % const KernelInfo *kernel)
1913 % A description of each parameter follows:
1915 % o wand: the magick wand.
1917 % o kernel: An array of doubles representing the convolution kernel.
1920 WandExport MagickBooleanType MagickConvolveImage(MagickWand *wand,
1921 const KernelInfo *kernel)
1926 assert(wand != (MagickWand *) NULL);
1927 assert(wand->signature == WandSignature);
1928 if (wand->debug != MagickFalse)
1929 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1930 if (kernel == (const KernelInfo *) NULL)
1931 return(MagickFalse);
1932 if (wand->images == (Image *) NULL)
1933 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1934 filter_image=ConvolveImage(wand->images,kernel,wand->exception);
1935 if (filter_image == (Image *) NULL)
1936 return(MagickFalse);
1937 ReplaceImageInList(&wand->images,filter_image);
1942 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1946 % M a g i c k C r o p I m a g e %
1950 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1952 % MagickCropImage() extracts a region of the image.
1954 % The format of the MagickCropImage method is:
1956 % MagickBooleanType MagickCropImage(MagickWand *wand,
1957 % const size_t width,const size_t height,const ssize_t x,const ssize_t y)
1959 % A description of each parameter follows:
1961 % o wand: the magick wand.
1963 % o width: the region width.
1965 % o height: the region height.
1967 % o x: the region x-offset.
1969 % o y: the region y-offset.
1972 WandExport MagickBooleanType MagickCropImage(MagickWand *wand,
1973 const size_t width,const size_t height,const ssize_t x,const ssize_t y)
1981 assert(wand != (MagickWand *) NULL);
1982 assert(wand->signature == WandSignature);
1983 if (wand->debug != MagickFalse)
1984 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1985 if (wand->images == (Image *) NULL)
1986 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1991 crop_image=CropImage(wand->images,&crop,wand->exception);
1992 if (crop_image == (Image *) NULL)
1993 return(MagickFalse);
1994 ReplaceImageInList(&wand->images,crop_image);
1999 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2003 % M a g i c k C y c l e C o l o r m a p I m a g e %
2007 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2009 % MagickCycleColormapImage() displaces an image's colormap by a given number
2010 % of positions. If you cycle the colormap a number of times you can produce
2011 % a psychodelic effect.
2013 % The format of the MagickCycleColormapImage method is:
2015 % MagickBooleanType MagickCycleColormapImage(MagickWand *wand,
2016 % const ssize_t displace)
2018 % A description of each parameter follows:
2020 % o wand: the magick wand.
2022 % o pixel_wand: the pixel wand.
2025 WandExport MagickBooleanType MagickCycleColormapImage(MagickWand *wand,
2026 const ssize_t displace)
2031 assert(wand != (MagickWand *) NULL);
2032 assert(wand->signature == WandSignature);
2033 if (wand->debug != MagickFalse)
2034 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2035 if (wand->images == (Image *) NULL)
2036 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2037 status=CycleColormapImage(wand->images,displace,wand->exception);
2042 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2046 % M a g i c k C o n s t i t u t e I m a g e %
2050 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2052 % MagickConstituteImage() adds an image to the wand comprised of the pixel
2053 % data you supply. The pixel data must be in scanline order top-to-bottom.
2054 % The data can be char, short int, int, float, or double. Float and double
2055 % require the pixels to be normalized [0..1], otherwise [0..Max], where Max
2056 % is the maximum value the type can accomodate (e.g. 255 for char). For
2057 % example, to create a 640x480 image from unsigned red-green-blue character
2060 % MagickConstituteImage(wand,640,640,"RGB",CharPixel,pixels);
2062 % The format of the MagickConstituteImage method is:
2064 % MagickBooleanType MagickConstituteImage(MagickWand *wand,
2065 % const size_t columns,const size_t rows,const char *map,
2066 % const StorageType storage,void *pixels)
2068 % A description of each parameter follows:
2070 % o wand: the magick wand.
2072 % o columns: width in pixels of the image.
2074 % o rows: height in pixels of the image.
2076 % o map: This string reflects the expected ordering of the pixel array.
2077 % It can be any combination or order of R = red, G = green, B = blue,
2078 % A = alpha (0 is transparent), O = alpha (0 is opaque), C = cyan,
2079 % Y = yellow, M = magenta, K = black, I = intensity (for grayscale),
2082 % o storage: Define the data type of the pixels. Float and double types are
2083 % expected to be normalized [0..1] otherwise [0..QuantumRange]. Choose from
2084 % these types: CharPixel, DoublePixel, FloatPixel, IntegerPixel,
2085 % LongPixel, QuantumPixel, or ShortPixel.
2087 % o pixels: This array of values contain the pixel components as defined by
2088 % map and type. You must preallocate this array where the expected
2089 % length varies depending on the values of width, height, map, and type.
2093 WandExport MagickBooleanType MagickConstituteImage(MagickWand *wand,
2094 const size_t columns,const size_t rows,const char *map,
2095 const StorageType storage,const void *pixels)
2100 assert(wand != (MagickWand *) NULL);
2101 assert(wand->signature == WandSignature);
2102 if (wand->debug != MagickFalse)
2103 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2104 images=ConstituteImage(columns,rows,map,storage,pixels,wand->exception);
2105 if (images == (Image *) NULL)
2106 return(MagickFalse);
2107 return(InsertImageInWand(wand,images));
2111 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2115 % M a g i c k D e c i p h e r I m a g e %
2119 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2121 % MagickDecipherImage() converts cipher pixels to plain pixels.
2123 % The format of the MagickDecipherImage method is:
2125 % MagickBooleanType MagickDecipherImage(MagickWand *wand,
2126 % const char *passphrase)
2128 % A description of each parameter follows:
2130 % o wand: the magick wand.
2132 % o passphrase: the passphrase.
2135 WandExport MagickBooleanType MagickDecipherImage(MagickWand *wand,
2136 const char *passphrase)
2138 assert(wand != (MagickWand *) NULL);
2139 assert(wand->signature == WandSignature);
2140 if (wand->debug != MagickFalse)
2141 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2142 if (wand->images == (Image *) NULL)
2143 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2144 return(DecipherImage(wand->images,passphrase,&wand->images->exception));
2148 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2152 % M a g i c k D e c o n s t r u c t I m a g e s %
2156 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2158 % MagickDeconstructImages() compares each image with the next in a sequence
2159 % and returns the maximum bounding region of any pixel differences it
2162 % The format of the MagickDeconstructImages method is:
2164 % MagickWand *MagickDeconstructImages(MagickWand *wand)
2166 % A description of each parameter follows:
2168 % o wand: the magick wand.
2171 WandExport MagickWand *MagickDeconstructImages(MagickWand *wand)
2176 assert(wand != (MagickWand *) NULL);
2177 assert(wand->signature == WandSignature);
2178 if (wand->debug != MagickFalse)
2179 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2180 if (wand->images == (Image *) NULL)
2181 return((MagickWand *) NULL);
2182 deconstruct_image=CompareImagesLayers(wand->images,CompareAnyLayer,
2184 if (deconstruct_image == (Image *) NULL)
2185 return((MagickWand *) NULL);
2186 return(CloneMagickWandFromImages(wand,deconstruct_image));
2190 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2194 % M a g i c k D e s k e w I m a g e %
2198 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2200 % MagickDeskewImage() removes skew from the image. Skew is an artifact that
2201 % occurs in scanned images because of the camera being misaligned,
2202 % imperfections in the scanning or surface, or simply because the paper was
2203 % not placed completely flat when scanned.
2205 % The format of the MagickDeskewImage method is:
2207 % MagickBooleanType MagickDeskewImage(MagickWand *wand,
2208 % const double threshold)
2210 % A description of each parameter follows:
2212 % o wand: the magick wand.
2214 % o threshold: separate background from foreground.
2217 WandExport MagickBooleanType MagickDeskewImage(MagickWand *wand,
2218 const double threshold)
2223 assert(wand != (MagickWand *) NULL);
2224 assert(wand->signature == WandSignature);
2225 if (wand->debug != MagickFalse)
2226 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2227 if (wand->images == (Image *) NULL)
2228 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2229 sepia_image=DeskewImage(wand->images,threshold,wand->exception);
2230 if (sepia_image == (Image *) NULL)
2231 return(MagickFalse);
2232 ReplaceImageInList(&wand->images,sepia_image);
2237 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2241 % M a g i c k D e s p e c k l e I m a g e %
2245 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2247 % MagickDespeckleImage() reduces the speckle noise in an image while
2248 % perserving the edges of the original image.
2250 % The format of the MagickDespeckleImage method is:
2252 % MagickBooleanType MagickDespeckleImage(MagickWand *wand)
2254 % A description of each parameter follows:
2256 % o wand: the magick wand.
2259 WandExport MagickBooleanType MagickDespeckleImage(MagickWand *wand)
2264 assert(wand != (MagickWand *) NULL);
2265 assert(wand->signature == WandSignature);
2266 if (wand->debug != MagickFalse)
2267 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2268 if (wand->images == (Image *) NULL)
2269 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2270 despeckle_image=DespeckleImage(wand->images,wand->exception);
2271 if (despeckle_image == (Image *) NULL)
2272 return(MagickFalse);
2273 ReplaceImageInList(&wand->images,despeckle_image);
2278 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2282 % M a g i c k D e s t r o y I m a g e %
2286 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2288 % MagickDestroyImage() dereferences an image, deallocating memory associated
2289 % with the image if the reference count becomes zero.
2291 % The format of the MagickDestroyImage method is:
2293 % Image *MagickDestroyImage(Image *image)
2295 % A description of each parameter follows:
2297 % o image: the image.
2300 WandExport Image *MagickDestroyImage(Image *image)
2302 return(DestroyImage(image));
2306 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2310 % M a g i c k D i s p l a y I m a g e %
2314 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2316 % MagickDisplayImage() displays an image.
2318 % The format of the MagickDisplayImage method is:
2320 % MagickBooleanType MagickDisplayImage(MagickWand *wand,
2321 % const char *server_name)
2323 % A description of each parameter follows:
2325 % o wand: the magick wand.
2327 % o server_name: the X server name.
2330 WandExport MagickBooleanType MagickDisplayImage(MagickWand *wand,
2331 const char *server_name)
2339 assert(wand != (MagickWand *) NULL);
2340 assert(wand->signature == WandSignature);
2341 if (wand->debug != MagickFalse)
2342 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2343 if (wand->images == (Image *) NULL)
2344 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2345 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
2346 if (image == (Image *) NULL)
2347 return(MagickFalse);
2348 (void) CloneString(&wand->image_info->server_name,server_name);
2349 status=DisplayImages(wand->image_info,image,&image->exception);
2350 image=DestroyImage(image);
2355 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2359 % M a g i c k D i s p l a y I m a g e s %
2363 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2365 % MagickDisplayImages() displays an image or image sequence.
2367 % The format of the MagickDisplayImages method is:
2369 % MagickBooleanType MagickDisplayImages(MagickWand *wand,
2370 % const char *server_name)
2372 % A description of each parameter follows:
2374 % o wand: the magick wand.
2376 % o server_name: the X server name.
2379 WandExport MagickBooleanType MagickDisplayImages(MagickWand *wand,
2380 const char *server_name)
2385 assert(wand != (MagickWand *) NULL);
2386 assert(wand->signature == WandSignature);
2387 if (wand->debug != MagickFalse)
2388 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2389 (void) CloneString(&wand->image_info->server_name,server_name);
2390 status=DisplayImages(wand->image_info,wand->images,&wand->images->exception);
2395 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2399 % M a g i c k D i s t o r t I m a g e %
2403 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2405 % MagickDistortImage() distorts an image using various distortion methods, by
2406 % mapping color lookups of the source image to a new destination image
2407 % usally of the same size as the source image, unless 'bestfit' is set to
2410 % If 'bestfit' is enabled, and distortion allows it, the destination image is
2411 % adjusted to ensure the whole source 'image' will just fit within the final
2412 % destination image, which will be sized and offset accordingly. Also in
2413 % many cases the virtual offset of the source image will be taken into
2414 % account in the mapping.
2416 % The format of the MagickDistortImage method is:
2418 % MagickBooleanType MagickDistortImage(MagickWand *wand,
2419 % const DistortImageMethod method,const size_t number_arguments,
2420 % const double *arguments,const MagickBooleanType bestfit)
2422 % A description of each parameter follows:
2424 % o image: the image to be distorted.
2426 % o method: the method of image distortion.
2428 % ArcDistortion always ignores the source image offset, and always
2429 % 'bestfit' the destination image with the top left corner offset
2430 % relative to the polar mapping center.
2432 % Bilinear has no simple inverse mapping so it does not allow 'bestfit'
2433 % style of image distortion.
2435 % Affine, Perspective, and Bilinear, do least squares fitting of the
2436 % distortion when more than the minimum number of control point pairs
2439 % Perspective, and Bilinear, falls back to a Affine distortion when less
2440 % that 4 control point pairs are provided. While Affine distortions let
2441 % you use any number of control point pairs, that is Zero pairs is a
2442 % no-Op (viewport only) distrotion, one pair is a translation and two
2443 % pairs of control points do a scale-rotate-translate, without any
2446 % o number_arguments: the number of arguments given for this distortion
2449 % o arguments: the arguments for this distortion method.
2451 % o bestfit: Attempt to resize destination to fit distorted source.
2454 WandExport MagickBooleanType MagickDistortImage(MagickWand *wand,
2455 const DistortImageMethod method,const size_t number_arguments,
2456 const double *arguments,const MagickBooleanType bestfit)
2461 assert(wand != (MagickWand *) NULL);
2462 assert(wand->signature == WandSignature);
2463 if (wand->debug != MagickFalse)
2464 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2465 if (wand->images == (Image *) NULL)
2466 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2467 distort_image=DistortImage(wand->images,method,number_arguments,arguments,
2468 bestfit,wand->exception);
2469 if (distort_image == (Image *) NULL)
2470 return(MagickFalse);
2471 ReplaceImageInList(&wand->images,distort_image);
2476 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2480 % M a g i c k D r a w I m a g e %
2484 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2486 % MagickDrawImage() renders the drawing wand on the current image.
2488 % The format of the MagickDrawImage method is:
2490 % MagickBooleanType MagickDrawImage(MagickWand *wand,
2491 % const DrawingWand *drawing_wand)
2493 % A description of each parameter follows:
2495 % o wand: the magick wand.
2497 % o drawing_wand: the draw wand.
2500 WandExport MagickBooleanType MagickDrawImage(MagickWand *wand,
2501 const DrawingWand *drawing_wand)
2512 assert(wand != (MagickWand *) NULL);
2513 assert(wand->signature == WandSignature);
2514 if (wand->debug != MagickFalse)
2515 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2516 if (wand->images == (Image *) NULL)
2517 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2518 draw_info=PeekDrawingWand(drawing_wand);
2519 if ((draw_info == (DrawInfo *) NULL) ||
2520 (draw_info->primitive == (char *) NULL))
2521 return(MagickFalse);
2522 primitive=AcquireString(draw_info->primitive);
2523 draw_info=DestroyDrawInfo(draw_info);
2524 draw_info=CloneDrawInfo(wand->image_info,(DrawInfo *) NULL);
2525 draw_info->primitive=primitive;
2526 status=DrawImage(wand->images,draw_info,wand->exception);
2527 draw_info=DestroyDrawInfo(draw_info);
2532 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2536 % M a g i c k E d g e I m a g e %
2540 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2542 % MagickEdgeImage() enhance edges within the image with a convolution filter
2543 % of the given radius. Use a radius of 0 and Edge() selects a suitable
2546 % The format of the MagickEdgeImage method is:
2548 % MagickBooleanType MagickEdgeImage(MagickWand *wand,const double radius,
2549 % const double sigma)
2551 % A description of each parameter follows:
2553 % o wand: the magick wand.
2555 % o radius: the radius of the pixel neighborhood.
2557 % o sigma: the standard deviation of the Gaussian, in pixels.
2560 WandExport MagickBooleanType MagickEdgeImage(MagickWand *wand,
2561 const double radius,const double sigma)
2566 assert(wand != (MagickWand *) NULL);
2567 assert(wand->signature == WandSignature);
2568 if (wand->debug != MagickFalse)
2569 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2570 if (wand->images == (Image *) NULL)
2571 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2572 edge_image=EdgeImage(wand->images,radius,sigma,wand->exception);
2573 if (edge_image == (Image *) NULL)
2574 return(MagickFalse);
2575 ReplaceImageInList(&wand->images,edge_image);
2580 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2584 % M a g i c k E m b o s s I m a g e %
2588 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2590 % MagickEmbossImage() returns a grayscale image with a three-dimensional
2591 % effect. We convolve the image with a Gaussian operator of the given radius
2592 % and standard deviation (sigma). For reasonable results, radius should be
2593 % larger than sigma. Use a radius of 0 and Emboss() selects a suitable
2596 % The format of the MagickEmbossImage method is:
2598 % MagickBooleanType MagickEmbossImage(MagickWand *wand,const double radius,
2599 % const double sigma)
2601 % A description of each parameter follows:
2603 % o wand: the magick wand.
2605 % o radius: the radius of the Gaussian, in pixels, not counting the center
2608 % o sigma: the standard deviation of the Gaussian, in pixels.
2611 WandExport MagickBooleanType MagickEmbossImage(MagickWand *wand,
2612 const double radius,const double sigma)
2617 assert(wand != (MagickWand *) NULL);
2618 assert(wand->signature == WandSignature);
2619 if (wand->debug != MagickFalse)
2620 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2621 if (wand->images == (Image *) NULL)
2622 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2623 emboss_image=EmbossImage(wand->images,radius,sigma,wand->exception);
2624 if (emboss_image == (Image *) NULL)
2625 return(MagickFalse);
2626 ReplaceImageInList(&wand->images,emboss_image);
2631 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2635 % M a g i c k E n c i p h e r I m a g e %
2639 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2641 % MagickEncipherImage() converts plaint pixels to cipher pixels.
2643 % The format of the MagickEncipherImage method is:
2645 % MagickBooleanType MagickEncipherImage(MagickWand *wand,
2646 % const char *passphrase)
2648 % A description of each parameter follows:
2650 % o wand: the magick wand.
2652 % o passphrase: the passphrase.
2655 WandExport MagickBooleanType MagickEncipherImage(MagickWand *wand,
2656 const char *passphrase)
2658 assert(wand != (MagickWand *) NULL);
2659 assert(wand->signature == WandSignature);
2660 if (wand->debug != MagickFalse)
2661 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2662 if (wand->images == (Image *) NULL)
2663 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2664 return(EncipherImage(wand->images,passphrase,&wand->images->exception));
2668 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2672 % M a g i c k E n h a n c e I m a g e %
2676 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2678 % MagickEnhanceImage() applies a digital filter that improves the quality of a
2681 % The format of the MagickEnhanceImage method is:
2683 % MagickBooleanType MagickEnhanceImage(MagickWand *wand)
2685 % A description of each parameter follows:
2687 % o wand: the magick wand.
2690 WandExport MagickBooleanType MagickEnhanceImage(MagickWand *wand)
2695 assert(wand != (MagickWand *) NULL);
2696 assert(wand->signature == WandSignature);
2697 if (wand->debug != MagickFalse)
2698 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2699 if (wand->images == (Image *) NULL)
2700 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2701 enhance_image=EnhanceImage(wand->images,wand->exception);
2702 if (enhance_image == (Image *) NULL)
2703 return(MagickFalse);
2704 ReplaceImageInList(&wand->images,enhance_image);
2709 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2713 % M a g i c k E q u a l i z e I m a g e %
2717 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2719 % MagickEqualizeImage() equalizes the image histogram.
2721 % The format of the MagickEqualizeImage method is:
2723 % MagickBooleanType MagickEqualizeImage(MagickWand *wand)
2725 % A description of each parameter follows:
2727 % o wand: the magick wand.
2729 % o channel: the image channel(s).
2732 WandExport MagickBooleanType MagickEqualizeImage(MagickWand *wand)
2737 assert(wand != (MagickWand *) NULL);
2738 assert(wand->signature == WandSignature);
2739 if (wand->debug != MagickFalse)
2740 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2741 if (wand->images == (Image *) NULL)
2742 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2743 status=EqualizeImage(wand->images,&wand->images->exception);
2748 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2752 % M a g i c k E v a l u a t e I m a g e %
2756 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2758 % MagickEvaluateImage() applys an arithmetic, relational, or logical
2759 % expression to an image. Use these operators to lighten or darken an image,
2760 % to increase or decrease contrast in an image, or to produce the "negative"
2763 % The format of the MagickEvaluateImage method is:
2765 % MagickBooleanType MagickEvaluateImage(MagickWand *wand,
2766 % const MagickEvaluateOperator operator,const double value)
2767 % MagickBooleanType MagickEvaluateImages(MagickWand *wand,
2768 % const MagickEvaluateOperator operator)
2770 % A description of each parameter follows:
2772 % o wand: the magick wand.
2774 % o op: A channel operator.
2776 % o value: A value value.
2780 WandExport MagickWand *MagickEvaluateImages(MagickWand *wand,
2781 const MagickEvaluateOperator op)
2786 assert(wand != (MagickWand *) NULL);
2787 assert(wand->signature == WandSignature);
2788 if (wand->debug != MagickFalse)
2789 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2790 if (wand->images == (Image *) NULL)
2791 return((MagickWand *) NULL);
2792 evaluate_image=EvaluateImages(wand->images,op,wand->exception);
2793 if (evaluate_image == (Image *) NULL)
2794 return((MagickWand *) NULL);
2795 return(CloneMagickWandFromImages(wand,evaluate_image));
2798 WandExport MagickBooleanType MagickEvaluateImage(MagickWand *wand,
2799 const MagickEvaluateOperator op,const double value)
2804 assert(wand != (MagickWand *) NULL);
2805 assert(wand->signature == WandSignature);
2806 if (wand->debug != MagickFalse)
2807 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2808 if (wand->images == (Image *) NULL)
2809 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2810 status=EvaluateImage(wand->images,op,value,&wand->images->exception);
2815 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2819 % M a g i c k E x p o r t I m a g e P i x e l s %
2823 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2825 % MagickExportImagePixels() extracts pixel data from an image and returns it
2826 % to you. The method returns MagickTrue on success otherwise MagickFalse if
2827 % an error is encountered. The data is returned as char, short int, int,
2828 % ssize_t, float, or double in the order specified by map.
2830 % Suppose you want to extract the first scanline of a 640x480 image as
2831 % character data in red-green-blue order:
2833 % MagickExportImagePixels(wand,0,0,640,1,"RGB",CharPixel,pixels);
2835 % The format of the MagickExportImagePixels method is:
2837 % MagickBooleanType MagickExportImagePixels(MagickWand *wand,
2838 % const ssize_t x,const ssize_t y,const size_t columns,
2839 % const size_t rows,const char *map,const StorageType storage,
2842 % A description of each parameter follows:
2844 % o wand: the magick wand.
2846 % o x, y, columns, rows: These values define the perimeter
2847 % of a region of pixels you want to extract.
2849 % o map: This string reflects the expected ordering of the pixel array.
2850 % It can be any combination or order of R = red, G = green, B = blue,
2851 % A = alpha (0 is transparent), O = alpha (0 is opaque), C = cyan,
2852 % Y = yellow, M = magenta, K = black, I = intensity (for grayscale),
2855 % o storage: Define the data type of the pixels. Float and double types are
2856 % expected to be normalized [0..1] otherwise [0..QuantumRange]. Choose from
2857 % these types: CharPixel, DoublePixel, FloatPixel, IntegerPixel,
2858 % LongPixel, QuantumPixel, or ShortPixel.
2860 % o pixels: This array of values contain the pixel components as defined by
2861 % map and type. You must preallocate this array where the expected
2862 % length varies depending on the values of width, height, map, and type.
2865 WandExport MagickBooleanType MagickExportImagePixels(MagickWand *wand,
2866 const ssize_t x,const ssize_t y,const size_t columns,
2867 const size_t rows,const char *map,const StorageType storage,
2873 assert(wand != (MagickWand *) NULL);
2874 assert(wand->signature == WandSignature);
2875 if (wand->debug != MagickFalse)
2876 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2877 if (wand->images == (Image *) NULL)
2878 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2879 status=ExportImagePixels(wand->images,x,y,columns,rows,map,
2880 storage,pixels,wand->exception);
2885 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2889 % M a g i c k E x t e n t I m a g e %
2893 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2895 % MagickExtentImage() extends the image as defined by the geometry, gravity,
2896 % and wand background color. Set the (x,y) offset of the geometry to move
2897 % the original wand relative to the extended wand.
2899 % The format of the MagickExtentImage method is:
2901 % MagickBooleanType MagickExtentImage(MagickWand *wand,
2902 % const size_t width,const size_t height,const ssize_t x,
2905 % A description of each parameter follows:
2907 % o wand: the magick wand.
2909 % o width: the region width.
2911 % o height: the region height.
2913 % o x: the region x offset.
2915 % o y: the region y offset.
2918 WandExport MagickBooleanType MagickExtentImage(MagickWand *wand,
2919 const size_t width,const size_t height,const ssize_t x,
2928 assert(wand != (MagickWand *) NULL);
2929 assert(wand->signature == WandSignature);
2930 if (wand->debug != MagickFalse)
2931 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2932 if (wand->images == (Image *) NULL)
2933 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2935 extent.height=height;
2938 extent_image=ExtentImage(wand->images,&extent,wand->exception);
2939 if (extent_image == (Image *) NULL)
2940 return(MagickFalse);
2941 ReplaceImageInList(&wand->images,extent_image);
2946 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2950 % M a g i c k F l i p I m a g e %
2954 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2956 % MagickFlipImage() creates a vertical mirror image by reflecting the pixels
2957 % around the central x-axis.
2959 % The format of the MagickFlipImage method is:
2961 % MagickBooleanType MagickFlipImage(MagickWand *wand)
2963 % A description of each parameter follows:
2965 % o wand: the magick wand.
2968 WandExport MagickBooleanType MagickFlipImage(MagickWand *wand)
2973 assert(wand != (MagickWand *) NULL);
2974 assert(wand->signature == WandSignature);
2975 if (wand->debug != MagickFalse)
2976 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2977 if (wand->images == (Image *) NULL)
2978 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2979 flip_image=FlipImage(wand->images,wand->exception);
2980 if (flip_image == (Image *) NULL)
2981 return(MagickFalse);
2982 ReplaceImageInList(&wand->images,flip_image);
2987 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2991 % 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 %
2995 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2997 % MagickFloodfillPaintImage() changes the color value of any pixel that matches
2998 % target and is an immediate neighbor. If the method FillToBorderMethod is
2999 % specified, the color value is changed for any neighbor pixel that does not
3000 % match the bordercolor member of image.
3002 % The format of the MagickFloodfillPaintImage method is:
3004 % MagickBooleanType MagickFloodfillPaintImage(MagickWand *wand,
3005 % const PixelWand *fill,const double fuzz,const PixelWand *bordercolor,
3006 % const ssize_t x,const ssize_t y,const MagickBooleanType invert)
3008 % A description of each parameter follows:
3010 % o wand: the magick wand.
3012 % o fill: the floodfill color pixel wand.
3014 % o fuzz: By default target must match a particular pixel color
3015 % exactly. However, in many cases two colors may differ by a small amount.
3016 % The fuzz member of image defines how much tolerance is acceptable to
3017 % consider two colors as the same. For example, set fuzz to 10 and the
3018 % color red at intensities of 100 and 102 respectively are now interpreted
3019 % as the same color for the purposes of the floodfill.
3021 % o bordercolor: the border color pixel wand.
3023 % o x,y: the starting location of the operation.
3025 % o invert: paint any pixel that does not match the target color.
3028 WandExport MagickBooleanType MagickFloodfillPaintImage(MagickWand *wand,
3029 const PixelWand *fill,const double fuzz,const PixelWand *bordercolor,
3030 const ssize_t x,const ssize_t y,const MagickBooleanType invert)
3041 assert(wand != (MagickWand *) NULL);
3042 assert(wand->signature == WandSignature);
3043 if (wand->debug != MagickFalse)
3044 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3045 if (wand->images == (Image *) NULL)
3046 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3047 draw_info=CloneDrawInfo(wand->image_info,(DrawInfo *) NULL);
3048 PixelGetQuantumPacket(fill,&draw_info->fill);
3049 (void) GetOneVirtualMagickPixel(wand->images,x % wand->images->columns,
3050 y % wand->images->rows,&target,wand->exception);
3051 if (bordercolor != (PixelWand *) NULL)
3052 PixelGetMagickColor(bordercolor,&target);
3053 wand->images->fuzz=fuzz;
3054 status=FloodfillPaintImage(wand->images,draw_info,&target,x,y,invert,
3055 &wand->images->exception);
3056 draw_info=DestroyDrawInfo(draw_info);
3061 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3065 % M a g i c k F l o p I m a g e %
3069 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3071 % MagickFlopImage() creates a horizontal mirror image by reflecting the pixels
3072 % around the central y-axis.
3074 % The format of the MagickFlopImage method is:
3076 % MagickBooleanType MagickFlopImage(MagickWand *wand)
3078 % A description of each parameter follows:
3080 % o wand: the magick wand.
3083 WandExport MagickBooleanType MagickFlopImage(MagickWand *wand)
3088 assert(wand != (MagickWand *) NULL);
3089 assert(wand->signature == WandSignature);
3090 if (wand->debug != MagickFalse)
3091 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3092 if (wand->images == (Image *) NULL)
3093 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3094 flop_image=FlopImage(wand->images,wand->exception);
3095 if (flop_image == (Image *) NULL)
3096 return(MagickFalse);
3097 ReplaceImageInList(&wand->images,flop_image);
3102 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3106 % 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 %
3110 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3112 % MagickForwardFourierTransformImage() implements the discrete Fourier
3113 % transform (DFT) of the image either as a magnitude / phase or real /
3114 % imaginary image pair.
3116 % The format of the MagickForwardFourierTransformImage method is:
3118 % MagickBooleanType MagickForwardFourierTransformImage(MagickWand *wand,
3119 % const MagickBooleanType magnitude)
3121 % A description of each parameter follows:
3123 % o wand: the magick wand.
3125 % o magnitude: if true, return as magnitude / phase pair otherwise a real /
3126 % imaginary image pair.
3129 WandExport MagickBooleanType MagickForwardFourierTransformImage(
3130 MagickWand *wand,const MagickBooleanType magnitude)
3135 assert(wand != (MagickWand *) NULL);
3136 assert(wand->signature == WandSignature);
3137 if (wand->debug != MagickFalse)
3138 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3139 if (wand->images == (Image *) NULL)
3140 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3141 forward_image=ForwardFourierTransformImage(wand->images,magnitude,
3143 if (forward_image == (Image *) NULL)
3144 return(MagickFalse);
3145 ReplaceImageInList(&wand->images,forward_image);
3150 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3154 % M a g i c k F r a m e I m a g e %
3158 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3160 % MagickFrameImage() adds a simulated three-dimensional border around the
3161 % image. The width and height specify the border width of the vertical and
3162 % horizontal sides of the frame. The inner and outer bevels indicate the
3163 % width of the inner and outer shadows of the frame.
3165 % The format of the MagickFrameImage method is:
3167 % MagickBooleanType MagickFrameImage(MagickWand *wand,
3168 % const PixelWand *matte_color,const size_t width,
3169 % const size_t height,const ssize_t inner_bevel,
3170 % const ssize_t outer_bevel,const CompositeOperator compose)
3172 % A description of each parameter follows:
3174 % o wand: the magick wand.
3176 % o matte_color: the frame color pixel wand.
3178 % o width: the border width.
3180 % o height: the border height.
3182 % o inner_bevel: the inner bevel width.
3184 % o outer_bevel: the outer bevel width.
3186 % o compose: the composite operator.
3189 WandExport MagickBooleanType MagickFrameImage(MagickWand *wand,
3190 const PixelWand *matte_color,const size_t width,const size_t height,
3191 const ssize_t inner_bevel,const ssize_t outer_bevel,
3192 const CompositeOperator compose)
3200 assert(wand != (MagickWand *) NULL);
3201 assert(wand->signature == WandSignature);
3202 if (wand->debug != MagickFalse)
3203 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3204 if (wand->images == (Image *) NULL)
3205 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3206 (void) ResetMagickMemory(&frame_info,0,sizeof(frame_info));
3207 frame_info.width=wand->images->columns+2*width;
3208 frame_info.height=wand->images->rows+2*height;
3209 frame_info.x=(ssize_t) width;
3210 frame_info.y=(ssize_t) height;
3211 frame_info.inner_bevel=inner_bevel;
3212 frame_info.outer_bevel=outer_bevel;
3213 PixelGetQuantumPacket(matte_color,&wand->images->matte_color);
3214 frame_image=FrameImage(wand->images,&frame_info,compose,wand->exception);
3215 if (frame_image == (Image *) NULL)
3216 return(MagickFalse);
3217 ReplaceImageInList(&wand->images,frame_image);
3222 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3226 % M a g i c k F u n c t i o n I m a g e %
3230 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3232 % MagickFunctionImage() applys an arithmetic, relational, or logical
3233 % expression to an image. Use these operators to lighten or darken an image,
3234 % to increase or decrease contrast in an image, or to produce the "negative"
3237 % The format of the MagickFunctionImage method is:
3239 % MagickBooleanType MagickFunctionImage(MagickWand *wand,
3240 % const MagickFunction function,const size_t number_arguments,
3241 % const double *arguments)
3243 % A description of each parameter follows:
3245 % o wand: the magick wand.
3247 % o function: the image function.
3249 % o number_arguments: the number of function arguments.
3251 % o arguments: the function arguments.
3254 WandExport MagickBooleanType MagickFunctionImage(MagickWand *wand,
3255 const MagickFunction function,const size_t number_arguments,
3256 const double *arguments)
3261 assert(wand != (MagickWand *) NULL);
3262 assert(wand->signature == WandSignature);
3263 if (wand->debug != MagickFalse)
3264 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3265 if (wand->images == (Image *) NULL)
3266 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3267 status=FunctionImage(wand->images,function,number_arguments,arguments,
3268 &wand->images->exception);
3273 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3277 % M a g i c k F x I m a g e %
3281 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3283 % MagickFxImage() evaluate expression for each pixel in the image.
3285 % The format of the MagickFxImage method is:
3287 % MagickWand *MagickFxImage(MagickWand *wand,const char *expression)
3289 % A description of each parameter follows:
3291 % o wand: the magick wand.
3293 % o expression: the expression.
3296 WandExport MagickWand *MagickFxImage(MagickWand *wand,const char *expression)
3301 assert(wand != (MagickWand *) NULL);
3302 assert(wand->signature == WandSignature);
3303 if (wand->debug != MagickFalse)
3304 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3305 if (wand->images == (Image *) NULL)
3306 return((MagickWand *) NULL);
3307 fx_image=FxImage(wand->images,expression,wand->exception);
3308 if (fx_image == (Image *) NULL)
3309 return((MagickWand *) NULL);
3310 return(CloneMagickWandFromImages(wand,fx_image));
3314 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3318 % M a g i c k G a m m a I m a g e %
3322 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3324 % MagickGammaImage() gamma-corrects an image. The same image viewed on
3325 % different devices will have perceptual differences in the way the image's
3326 % intensities are represented on the screen. Specify individual gamma levels
3327 % for the red, green, and blue channels, or adjust all three with the gamma
3328 % parameter. Values typically range from 0.8 to 2.3.
3330 % You can also reduce the influence of a particular channel with a gamma
3333 % The format of the MagickGammaImage method is:
3335 % MagickBooleanType MagickGammaImage(MagickWand *wand,const double gamma)
3337 % A description of each parameter follows:
3339 % o wand: the magick wand.
3341 % o level: Define the level of gamma correction.
3344 WandExport MagickBooleanType MagickGammaImage(MagickWand *wand,
3350 assert(wand != (MagickWand *) NULL);
3351 assert(wand->signature == WandSignature);
3352 if (wand->debug != MagickFalse)
3353 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3354 if (wand->images == (Image *) NULL)
3355 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3356 status=GammaImage(wand->images,gamma,wand->exception);
3361 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3365 % M a g i c k G a u s s i a n B l u r I m a g e %
3369 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3371 % MagickGaussianBlurImage() blurs an image. We convolve the image with a
3372 % Gaussian operator of the given radius and standard deviation (sigma).
3373 % For reasonable results, the radius should be larger than sigma. Use a
3374 % radius of 0 and MagickGaussianBlurImage() selects a suitable radius for you.
3376 % The format of the MagickGaussianBlurImage method is:
3378 % MagickBooleanType MagickGaussianBlurImage(MagickWand *wand,
3379 % const double radius,const double sigma,const double bias)
3381 % A description of each parameter follows:
3383 % o wand: the magick wand.
3385 % o radius: the radius of the Gaussian, in pixels, not counting the center
3388 % o sigma: the standard deviation of the Gaussian, in pixels.
3393 WandExport MagickBooleanType MagickGaussianBlurImage(MagickWand *wand,
3394 const double radius,const double sigma,const double bias)
3399 assert(wand != (MagickWand *) NULL);
3400 assert(wand->signature == WandSignature);
3401 if (wand->debug != MagickFalse)
3402 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3403 if (wand->images == (Image *) NULL)
3404 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3405 blur_image=GaussianBlurImage(wand->images,radius,sigma,bias,wand->exception);
3406 if (blur_image == (Image *) NULL)
3407 return(MagickFalse);
3408 ReplaceImageInList(&wand->images,blur_image);
3413 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3417 % M a g i c k G e t I m a g e %
3421 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3423 % MagickGetImage() gets the image at the current image index.
3425 % The format of the MagickGetImage method is:
3427 % MagickWand *MagickGetImage(MagickWand *wand)
3429 % A description of each parameter follows:
3431 % o wand: the magick wand.
3434 WandExport MagickWand *MagickGetImage(MagickWand *wand)
3439 assert(wand != (MagickWand *) NULL);
3440 assert(wand->signature == WandSignature);
3441 if (wand->debug != MagickFalse)
3442 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3443 if (wand->images == (Image *) NULL)
3445 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3446 "ContainsNoImages","`%s'",wand->name);
3447 return((MagickWand *) NULL);
3449 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
3450 if (image == (Image *) NULL)
3451 return((MagickWand *) NULL);
3452 return(CloneMagickWandFromImages(wand,image));
3456 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3460 % 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 %
3464 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3466 % MagickGetImageAlphaChannel() returns MagickFalse if the image alpha channel
3467 % is not activated. That is, the image is RGB rather than RGBA or CMYK rather
3470 % The format of the MagickGetImageAlphaChannel method is:
3472 % size_t MagickGetImageAlphaChannel(MagickWand *wand)
3474 % A description of each parameter follows:
3476 % o wand: the magick wand.
3479 WandExport MagickBooleanType MagickGetImageAlphaChannel(MagickWand *wand)
3481 assert(wand != (MagickWand *) NULL);
3482 assert(wand->signature == WandSignature);
3483 if (wand->debug != MagickFalse)
3484 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3485 if (wand->images == (Image *) NULL)
3486 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3487 return(GetImageAlphaChannel(wand->images));
3491 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3495 % M a g i c k G e t I m a g e C l i p M a s k %
3499 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3501 % MagickGetImageClipMask() gets the image clip mask at the current image index.
3503 % The format of the MagickGetImageClipMask method is:
3505 % MagickWand *MagickGetImageClipMask(MagickWand *wand)
3507 % A description of each parameter follows:
3509 % o wand: the magick wand.
3512 WandExport MagickWand *MagickGetImageClipMask(MagickWand *wand)
3517 assert(wand != (MagickWand *) NULL);
3518 assert(wand->signature == WandSignature);
3519 if (wand->debug != MagickFalse)
3520 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3521 if (wand->images == (Image *) NULL)
3523 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3524 "ContainsNoImages","`%s'",wand->name);
3525 return((MagickWand *) NULL);
3527 image=GetImageClipMask(wand->images,wand->exception);
3528 if (image == (Image *) NULL)
3529 return((MagickWand *) NULL);
3530 return(CloneMagickWandFromImages(wand,image));
3534 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3538 % 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 %
3542 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3544 % MagickGetImageBackgroundColor() returns the image background color.
3546 % The format of the MagickGetImageBackgroundColor method is:
3548 % MagickBooleanType MagickGetImageBackgroundColor(MagickWand *wand,
3549 % PixelWand *background_color)
3551 % A description of each parameter follows:
3553 % o wand: the magick wand.
3555 % o background_color: Return the background color.
3558 WandExport MagickBooleanType MagickGetImageBackgroundColor(MagickWand *wand,
3559 PixelWand *background_color)
3561 assert(wand != (MagickWand *) NULL);
3562 assert(wand->signature == WandSignature);
3563 if (wand->debug != MagickFalse)
3564 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3565 if (wand->images == (Image *) NULL)
3566 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3567 PixelSetQuantumPacket(background_color,&wand->images->background_color);
3572 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3576 % M a g i c k G e t I m a g e B l o b %
3580 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3582 % MagickGetImageBlob() implements direct to memory image formats. It returns
3583 % the image as a blob (a formatted "file" in memory) and its length, starting
3584 % from the current position in the image sequence. Use MagickSetImageFormat()
3585 % to set the format to write to the blob (GIF, JPEG, PNG, etc.).
3587 % Utilize MagickResetIterator() to ensure the write is from the beginning of
3588 % the image sequence.
3590 % Use MagickRelinquishMemory() to free the blob when you are done with it.
3592 % The format of the MagickGetImageBlob method is:
3594 % unsigned char *MagickGetImageBlob(MagickWand *wand,size_t *length)
3596 % A description of each parameter follows:
3598 % o wand: the magick wand.
3600 % o length: the length of the blob.
3603 WandExport unsigned char *MagickGetImageBlob(MagickWand *wand,size_t *length)
3605 assert(wand != (MagickWand *) NULL);
3606 assert(wand->signature == WandSignature);
3607 if (wand->debug != MagickFalse)
3608 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3609 if (wand->images == (Image *) NULL)
3611 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3612 "ContainsNoImages","`%s'",wand->name);
3613 return((unsigned char *) NULL);
3615 return(ImageToBlob(wand->image_info,wand->images,length,wand->exception));
3619 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3623 % M a g i c k G e t I m a g e s B l o b %
3627 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3629 % MagickGetImageBlob() implements direct to memory image formats. It
3630 % returns the image sequence as a blob and its length. The format of the image
3631 % determines the format of the returned blob (GIF, JPEG, PNG, etc.). To
3632 % return a different image format, use MagickSetImageFormat().
3634 % Note, some image formats do not permit multiple images to the same image
3635 % stream (e.g. JPEG). in this instance, just the first image of the
3636 % sequence is returned as a blob.
3638 % The format of the MagickGetImagesBlob method is:
3640 % unsigned char *MagickGetImagesBlob(MagickWand *wand,size_t *length)
3642 % A description of each parameter follows:
3644 % o wand: the magick wand.
3646 % o length: the length of the blob.
3649 WandExport unsigned char *MagickGetImagesBlob(MagickWand *wand,size_t *length)
3654 assert(wand != (MagickWand *) NULL);
3655 assert(wand->signature == WandSignature);
3656 if (wand->debug != MagickFalse)
3657 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3658 if (wand->images == (Image *) NULL)
3660 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3661 "ContainsNoImages","`%s'",wand->name);
3662 return((unsigned char *) NULL);
3664 blob=ImagesToBlob(wand->image_info,GetFirstImageInList(wand->images),length,
3670 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3674 % 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 %
3678 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3680 % MagickGetImageBluePrimary() returns the chromaticy blue primary point for the
3683 % The format of the MagickGetImageBluePrimary method is:
3685 % MagickBooleanType MagickGetImageBluePrimary(MagickWand *wand,double *x,
3688 % A description of each parameter follows:
3690 % o wand: the magick wand.
3692 % o x: the chromaticity blue primary x-point.
3694 % o y: the chromaticity blue primary y-point.
3697 WandExport MagickBooleanType MagickGetImageBluePrimary(MagickWand *wand,
3698 double *x,double *y)
3700 assert(wand != (MagickWand *) NULL);
3701 assert(wand->signature == WandSignature);
3702 if (wand->debug != MagickFalse)
3703 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3704 if (wand->images == (Image *) NULL)
3705 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3706 *x=wand->images->chromaticity.blue_primary.x;
3707 *y=wand->images->chromaticity.blue_primary.y;
3712 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3716 % 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 %
3720 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3722 % MagickGetImageBorderColor() returns the image border color.
3724 % The format of the MagickGetImageBorderColor method is:
3726 % MagickBooleanType MagickGetImageBorderColor(MagickWand *wand,
3727 % PixelWand *border_color)
3729 % A description of each parameter follows:
3731 % o wand: the magick wand.
3733 % o border_color: Return the border color.
3736 WandExport MagickBooleanType MagickGetImageBorderColor(MagickWand *wand,
3737 PixelWand *border_color)
3739 assert(wand != (MagickWand *) NULL);
3740 assert(wand->signature == WandSignature);
3741 if (wand->debug != MagickFalse)
3742 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3743 if (wand->images == (Image *) NULL)
3744 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3745 PixelSetQuantumPacket(border_color,&wand->images->border_color);
3750 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3754 % M a g i c k G e t I m a g e F e a t u r e s %
3758 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3760 % MagickGetImageFeatures() returns features for each channel in the
3761 % image in each of four directions (horizontal, vertical, left and right
3762 % diagonals) for the specified distance. The features include the angular
3763 % second moment, contrast, correlation, sum of squares: variance, inverse
3764 % difference moment, sum average, sum varience, sum entropy, entropy,
3765 % difference variance, difference entropy, information measures of
3766 % correlation 1, information measures of correlation 2, and maximum
3767 % correlation coefficient. You can access the red channel contrast, for
3768 % example, like this:
3770 % channel_features=MagickGetImageFeatures(wand,1);
3771 % contrast=channel_features[RedChannel].contrast[0];
3773 % Use MagickRelinquishMemory() to free the statistics buffer.
3775 % The format of the MagickGetImageFeatures method is:
3777 % ChannelFeatures *MagickGetImageFeatures(MagickWand *wand,
3778 % const size_t distance)
3780 % A description of each parameter follows:
3782 % o wand: the magick wand.
3784 % o distance: the distance.
3787 WandExport ChannelFeatures *MagickGetImageFeatures(MagickWand *wand,
3788 const size_t distance)
3790 assert(wand != (MagickWand *) NULL);
3791 assert(wand->signature == WandSignature);
3792 if (wand->debug != MagickFalse)
3793 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3794 if (wand->images == (Image *) NULL)
3796 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3797 "ContainsNoImages","`%s'",wand->name);
3798 return((ChannelFeatures *) NULL);
3800 return(GetImageFeatures(wand->images,distance,wand->exception));
3804 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3808 % M a g i c k G e t I m a g e K u r t o s i s %
3812 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3814 % MagickGetImageKurtosis() gets the kurtosis and skewness of one or
3815 % more image channels.
3817 % The format of the MagickGetImageKurtosis method is:
3819 % MagickBooleanType MagickGetImageKurtosis(MagickWand *wand,
3820 % double *kurtosis,double *skewness)
3822 % A description of each parameter follows:
3824 % o wand: the magick wand.
3826 % o kurtosis: The kurtosis for the specified channel(s).
3828 % o skewness: The skewness for the specified channel(s).
3831 WandExport MagickBooleanType MagickGetImageKurtosis(MagickWand *wand,
3832 double *kurtosis,double *skewness)
3837 assert(wand != (MagickWand *) NULL);
3838 assert(wand->signature == WandSignature);
3839 if (wand->debug != MagickFalse)
3840 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3841 if (wand->images == (Image *) NULL)
3842 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3843 status=GetImageKurtosis(wand->images,kurtosis,skewness,wand->exception);
3848 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3852 % M a g i c k G e t I m a g e M e a n %
3856 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3858 % MagickGetImageMean() gets the mean and standard deviation of one or more
3861 % The format of the MagickGetImageMean method is:
3863 % MagickBooleanType MagickGetImageMean(MagickWand *wand,double *mean,
3864 % double *standard_deviation)
3866 % A description of each parameter follows:
3868 % o wand: the magick wand.
3870 % o channel: the image channel(s).
3872 % o mean: The mean pixel value for the specified channel(s).
3874 % o standard_deviation: The standard deviation for the specified channel(s).
3877 WandExport MagickBooleanType MagickGetImageMean(MagickWand *wand,double *mean,
3878 double *standard_deviation)
3883 assert(wand != (MagickWand *) NULL);
3884 assert(wand->signature == WandSignature);
3885 if (wand->debug != MagickFalse)
3886 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3887 if (wand->images == (Image *) NULL)
3888 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3889 status=GetImageMean(wand->images,mean,standard_deviation,wand->exception);
3894 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3898 % M a g i c k G e t I m a g e R a n g e %
3902 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3904 % MagickGetImageRange() gets the range for one or more image channels.
3906 % The format of the MagickGetImageRange method is:
3908 % MagickBooleanType MagickGetImageRange(MagickWand *wand,double *minima,
3911 % A description of each parameter follows:
3913 % o wand: the magick wand.
3915 % o minima: The minimum pixel value for the specified channel(s).
3917 % o maxima: The maximum pixel value for the specified channel(s).
3920 WandExport MagickBooleanType MagickGetImageRange(MagickWand *wand,
3921 double *minima,double *maxima)
3926 assert(wand != (MagickWand *) NULL);
3927 assert(wand->signature == WandSignature);
3928 if (wand->debug != MagickFalse)
3929 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3930 if (wand->images == (Image *) NULL)
3931 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3932 status=GetImageRange(wand->images,minima,maxima,wand->exception);
3937 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3941 % M a g i c k G e t I m a g e S t a t i s t i c s %
3945 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3947 % MagickGetImageStatistics() returns statistics for each channel in the
3948 % image. The statistics include the channel depth, its minima and
3949 % maxima, the mean, the standard deviation, the kurtosis and the skewness.
3950 % You can access the red channel mean, for example, like this:
3952 % channel_statistics=MagickGetImageStatistics(wand);
3953 % red_mean=channel_statistics[RedChannel].mean;
3955 % Use MagickRelinquishMemory() to free the statistics buffer.
3957 % The format of the MagickGetImageStatistics method is:
3959 % ChannelStatistics *MagickGetImageStatistics(MagickWand *wand)
3961 % A description of each parameter follows:
3963 % o wand: the magick wand.
3966 WandExport ChannelStatistics *MagickGetImageStatistics(MagickWand *wand)
3968 assert(wand != (MagickWand *) NULL);
3969 assert(wand->signature == WandSignature);
3970 if (wand->debug != MagickFalse)
3971 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3972 if (wand->images == (Image *) NULL)
3974 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3975 "ContainsNoImages","`%s'",wand->name);
3976 return((ChannelStatistics *) NULL);
3978 return(GetImageStatistics(wand->images,wand->exception));
3982 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3986 % 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 %
3990 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3992 % MagickGetImageColormapColor() returns the color of the specified colormap
3995 % The format of the MagickGetImageColormapColor method is:
3997 % MagickBooleanType MagickGetImageColormapColor(MagickWand *wand,
3998 % const size_t index,PixelWand *color)
4000 % A description of each parameter follows:
4002 % o wand: the magick wand.
4004 % o index: the offset into the image colormap.
4006 % o color: Return the colormap color in this wand.
4009 WandExport MagickBooleanType MagickGetImageColormapColor(MagickWand *wand,
4010 const size_t index,PixelWand *color)
4012 assert(wand != (MagickWand *) NULL);
4013 assert(wand->signature == WandSignature);
4014 if (wand->debug != MagickFalse)
4015 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4016 if (wand->images == (Image *) NULL)
4017 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4018 if ((wand->images->colormap == (PixelInfo *) NULL) ||
4019 (index >= wand->images->colors))
4021 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4022 "InvalidColormapIndex","`%s'",wand->name);
4023 return(MagickFalse);
4025 PixelSetQuantumPacket(color,wand->images->colormap+index);
4030 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4034 % M a g i c k G e t I m a g e C o l o r s %
4038 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4040 % MagickGetImageColors() gets the number of unique colors in the image.
4042 % The format of the MagickGetImageColors method is:
4044 % size_t MagickGetImageColors(MagickWand *wand)
4046 % A description of each parameter follows:
4048 % o wand: the magick wand.
4051 WandExport size_t MagickGetImageColors(MagickWand *wand)
4053 assert(wand != (MagickWand *) NULL);
4054 assert(wand->signature == WandSignature);
4055 if (wand->debug != MagickFalse)
4056 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4057 if (wand->images == (Image *) NULL)
4059 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4060 "ContainsNoImages","`%s'",wand->name);
4063 return(GetNumberColors(wand->images,(FILE *) NULL,wand->exception));
4067 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4071 % M a g i c k G e t I m a g e C o l o r s p a c e %
4075 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4077 % MagickGetImageColorspace() gets the image colorspace.
4079 % The format of the MagickGetImageColorspace method is:
4081 % ColorspaceType MagickGetImageColorspace(MagickWand *wand)
4083 % A description of each parameter follows:
4085 % o wand: the magick wand.
4088 WandExport ColorspaceType MagickGetImageColorspace(MagickWand *wand)
4090 assert(wand != (MagickWand *) NULL);
4091 assert(wand->signature == WandSignature);
4092 if (wand->debug != MagickFalse)
4093 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4094 if (wand->images == (Image *) NULL)
4096 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4097 "ContainsNoImages","`%s'",wand->name);
4098 return(UndefinedColorspace);
4100 return(wand->images->colorspace);
4104 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4108 % M a g i c k G e t I m a g e C o m p o s e %
4112 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4114 % MagickGetImageCompose() returns the composite operator associated with the
4117 % The format of the MagickGetImageCompose method is:
4119 % CompositeOperator MagickGetImageCompose(MagickWand *wand)
4121 % A description of each parameter follows:
4123 % o wand: the magick wand.
4126 WandExport CompositeOperator MagickGetImageCompose(MagickWand *wand)
4128 assert(wand != (MagickWand *) NULL);
4129 assert(wand->signature == WandSignature);
4130 if (wand->debug != MagickFalse)
4131 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4132 if (wand->images == (Image *) NULL)
4134 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4135 "ContainsNoImages","`%s'",wand->name);
4136 return(UndefinedCompositeOp);
4138 return(wand->images->compose);
4142 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4146 % 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 %
4150 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4152 % MagickGetImageCompression() gets the image compression.
4154 % The format of the MagickGetImageCompression method is:
4156 % CompressionType MagickGetImageCompression(MagickWand *wand)
4158 % A description of each parameter follows:
4160 % o wand: the magick wand.
4163 WandExport CompressionType MagickGetImageCompression(MagickWand *wand)
4165 assert(wand != (MagickWand *) NULL);
4166 assert(wand->signature == WandSignature);
4167 if (wand->debug != MagickFalse)
4168 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4169 if (wand->images == (Image *) NULL)
4171 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4172 "ContainsNoImages","`%s'",wand->name);
4173 return(UndefinedCompression);
4175 return(wand->images->compression);
4179 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4183 % 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 %
4187 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4189 % MagickGetImageCompression() gets the image compression quality.
4191 % The format of the MagickGetImageCompression method is:
4193 % size_t MagickGetImageCompression(MagickWand *wand)
4195 % A description of each parameter follows:
4197 % o wand: the magick wand.
4200 WandExport size_t MagickGetImageCompressionQuality(MagickWand *wand)
4202 assert(wand != (MagickWand *) NULL);
4203 assert(wand->signature == WandSignature);
4204 if (wand->debug != MagickFalse)
4205 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4206 if (wand->images == (Image *) NULL)
4208 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4209 "ContainsNoImages","`%s'",wand->name);
4212 return(wand->images->quality);
4216 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4220 % M a g i c k G e t I m a g e D e l a y %
4224 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4226 % MagickGetImageDelay() gets the image delay.
4228 % The format of the MagickGetImageDelay method is:
4230 % size_t MagickGetImageDelay(MagickWand *wand)
4232 % A description of each parameter follows:
4234 % o wand: the magick wand.
4237 WandExport size_t MagickGetImageDelay(MagickWand *wand)
4239 assert(wand != (MagickWand *) NULL);
4240 assert(wand->signature == WandSignature);
4241 if (wand->debug != MagickFalse)
4242 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4243 if (wand->images == (Image *) NULL)
4244 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4245 return(wand->images->delay);
4249 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4253 % M a g i c k G e t I m a g e D e p t h %
4257 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4259 % MagickGetImageDepth() gets the image depth.
4261 % The format of the MagickGetImageDepth method is:
4263 % size_t MagickGetImageDepth(MagickWand *wand)
4265 % A description of each parameter follows:
4267 % o wand: the magick wand.
4270 WandExport size_t MagickGetImageDepth(MagickWand *wand)
4272 assert(wand != (MagickWand *) NULL);
4273 assert(wand->signature == WandSignature);
4274 if (wand->debug != MagickFalse)
4275 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4276 if (wand->images == (Image *) NULL)
4277 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4278 return(GetImageDepth(wand->images,wand->exception));
4282 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4286 % M a g i c k G e t I m a g e D i s p o s e %
4290 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4292 % MagickGetImageDispose() gets the image disposal method.
4294 % The format of the MagickGetImageDispose method is:
4296 % DisposeType MagickGetImageDispose(MagickWand *wand)
4298 % A description of each parameter follows:
4300 % o wand: the magick wand.
4303 WandExport DisposeType MagickGetImageDispose(MagickWand *wand)
4305 assert(wand != (MagickWand *) NULL);
4306 assert(wand->signature == WandSignature);
4307 if (wand->debug != MagickFalse)
4308 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4309 if (wand->images == (Image *) NULL)
4311 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4312 "ContainsNoImages","`%s'",wand->name);
4313 return(UndefinedDispose);
4315 return((DisposeType) wand->images->dispose);
4319 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4323 % M a g i c k G e t I m a g e D i s t o r t i o n %
4327 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4329 % MagickGetImageDistortion() compares an image to a reconstructed image and
4330 % returns the specified distortion metric.
4332 % The format of the MagickGetImageDistortion method is:
4334 % MagickBooleanType MagickGetImageDistortion(MagickWand *wand,
4335 % const MagickWand *reference,const MetricType metric,
4336 % double *distortion)
4338 % A description of each parameter follows:
4340 % o wand: the magick wand.
4342 % o reference: the reference wand.
4344 % o metric: the metric.
4346 % o distortion: the computed distortion between the images.
4349 WandExport MagickBooleanType MagickGetImageDistortion(MagickWand *wand,
4350 const MagickWand *reference,const MetricType metric,double *distortion)
4355 assert(wand != (MagickWand *) NULL);
4356 assert(wand->signature == WandSignature);
4357 if (wand->debug != MagickFalse)
4358 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4359 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
4360 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4361 status=GetImageDistortion(wand->images,reference->images,metric,distortion,
4362 &wand->images->exception);
4367 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4371 % M a g i c k G e t I m a g e D i s t o r t i o n s %
4375 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4377 % MagickGetImageDistortions() compares one or more pixel channels of an
4378 % image to a reconstructed image and returns the specified distortion metrics.
4380 % Use MagickRelinquishMemory() to free the metrics when you are done with them.
4382 % The format of the MagickGetImageDistortion method is:
4384 % double *MagickGetImageDistortion(MagickWand *wand,
4385 % const MagickWand *reference,const MetricType metric)
4387 % A description of each parameter follows:
4389 % o wand: the magick wand.
4391 % o reference: the reference wand.
4393 % o metric: the metric.
4396 WandExport double *MagickGetImageDistortions(MagickWand *wand,
4397 const MagickWand *reference,const MetricType metric)
4400 *channel_distortion;
4402 assert(wand != (MagickWand *) NULL);
4403 assert(wand->signature == WandSignature);
4404 if (wand->debug != MagickFalse)
4405 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4406 assert(reference != (MagickWand *) NULL);
4407 assert(reference->signature == WandSignature);
4408 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
4410 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4411 "ContainsNoImages","`%s'",wand->name);
4412 return((double *) NULL);
4414 channel_distortion=GetImageDistortions(wand->images,reference->images,
4415 metric,&wand->images->exception);
4416 return(channel_distortion);
4420 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4424 % M a g i c k G e t I m a g e F i l e n a m e %
4428 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4430 % MagickGetImageFilename() returns the filename of a particular image in a
4433 % The format of the MagickGetImageFilename method is:
4435 % char *MagickGetImageFilename(MagickWand *wand)
4437 % A description of each parameter follows:
4439 % o wand: the magick wand.
4442 WandExport char *MagickGetImageFilename(MagickWand *wand)
4444 assert(wand != (MagickWand *) NULL);
4445 assert(wand->signature == WandSignature);
4446 if (wand->debug != MagickFalse)
4447 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4448 if (wand->images == (Image *) NULL)
4450 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4451 "ContainsNoImages","`%s'",wand->name);
4452 return((char *) NULL);
4454 return(AcquireString(wand->images->filename));
4458 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4462 % M a g i c k G e t I m a g e F o r m a t %
4466 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4468 % MagickGetImageFormat() returns the format of a particular image in a
4471 % The format of the MagickGetImageFormat method is:
4473 % const char *MagickGetImageFormat(MagickWand *wand)
4475 % A description of each parameter follows:
4477 % o wand: the magick wand.
4480 WandExport char *MagickGetImageFormat(MagickWand *wand)
4482 assert(wand != (MagickWand *) NULL);
4483 assert(wand->signature == WandSignature);
4484 if (wand->debug != MagickFalse)
4485 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4486 if (wand->images == (Image *) NULL)
4488 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4489 "ContainsNoImages","`%s'",wand->name);
4490 return((char *) NULL);
4492 return(AcquireString(wand->images->magick));
4496 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4500 % M a g i c k G e t I m a g e F u z z %
4504 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4506 % MagickGetImageFuzz() gets the image fuzz.
4508 % The format of the MagickGetImageFuzz method is:
4510 % double MagickGetImageFuzz(MagickWand *wand)
4512 % A description of each parameter follows:
4514 % o wand: the magick wand.
4517 WandExport double MagickGetImageFuzz(MagickWand *wand)
4519 assert(wand != (MagickWand *) NULL);
4520 assert(wand->signature == WandSignature);
4521 if (wand->debug != MagickFalse)
4522 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4523 if (wand->images == (Image *) NULL)
4525 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4526 "ContainsNoImages","`%s'",wand->name);
4529 return(wand->images->fuzz);
4533 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4537 % M a g i c k G e t I m a g e G a m m a %
4541 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4543 % MagickGetImageGamma() gets the image gamma.
4545 % The format of the MagickGetImageGamma method is:
4547 % double MagickGetImageGamma(MagickWand *wand)
4549 % A description of each parameter follows:
4551 % o wand: the magick wand.
4554 WandExport double MagickGetImageGamma(MagickWand *wand)
4556 assert(wand != (MagickWand *) NULL);
4557 assert(wand->signature == WandSignature);
4558 if (wand->debug != MagickFalse)
4559 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4560 if (wand->images == (Image *) NULL)
4562 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4563 "ContainsNoImages","`%s'",wand->name);
4566 return(wand->images->gamma);
4570 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4574 % 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 %
4578 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4580 % MagickGetImageGravity() gets the image gravity.
4582 % The format of the MagickGetImageGravity method is:
4584 % GravityType MagickGetImageGravity(MagickWand *wand)
4586 % A description of each parameter follows:
4588 % o wand: the magick wand.
4591 WandExport GravityType MagickGetImageGravity(MagickWand *wand)
4593 assert(wand != (MagickWand *) NULL);
4594 assert(wand->signature == WandSignature);
4595 if (wand->debug != MagickFalse)
4596 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4597 if (wand->images == (Image *) NULL)
4599 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4600 "ContainsNoImages","`%s'",wand->name);
4601 return(UndefinedGravity);
4603 return(wand->images->gravity);
4607 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4611 % 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 %
4615 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4617 % MagickGetImageGreenPrimary() returns the chromaticy green primary point.
4619 % The format of the MagickGetImageGreenPrimary method is:
4621 % MagickBooleanType MagickGetImageGreenPrimary(MagickWand *wand,double *x,
4624 % A description of each parameter follows:
4626 % o wand: the magick wand.
4628 % o x: the chromaticity green primary x-point.
4630 % o y: the chromaticity green primary y-point.
4633 WandExport MagickBooleanType MagickGetImageGreenPrimary(MagickWand *wand,
4634 double *x,double *y)
4636 assert(wand != (MagickWand *) NULL);
4637 assert(wand->signature == WandSignature);
4638 if (wand->debug != MagickFalse)
4639 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4640 if (wand->images == (Image *) NULL)
4641 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4642 *x=wand->images->chromaticity.green_primary.x;
4643 *y=wand->images->chromaticity.green_primary.y;
4648 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4652 % M a g i c k G e t I m a g e H e i g h t %
4656 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4658 % MagickGetImageHeight() returns the image height.
4660 % The format of the MagickGetImageHeight method is:
4662 % size_t MagickGetImageHeight(MagickWand *wand)
4664 % A description of each parameter follows:
4666 % o wand: the magick wand.
4669 WandExport size_t MagickGetImageHeight(MagickWand *wand)
4671 assert(wand != (MagickWand *) NULL);
4672 assert(wand->signature == WandSignature);
4673 if (wand->debug != MagickFalse)
4674 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4675 if (wand->images == (Image *) NULL)
4676 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4677 return(wand->images->rows);
4681 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4685 % M a g i c k G e t I m a g e H i s t o g r a m %
4689 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4691 % MagickGetImageHistogram() returns the image histogram as an array of
4694 % The format of the MagickGetImageHistogram method is:
4696 % PixelWand **MagickGetImageHistogram(MagickWand *wand,
4697 % size_t *number_colors)
4699 % A description of each parameter follows:
4701 % o wand: the magick wand.
4703 % o number_colors: the number of unique colors in the image and the number
4704 % of pixel wands returned.
4707 WandExport PixelWand **MagickGetImageHistogram(MagickWand *wand,
4708 size_t *number_colors)
4719 assert(wand != (MagickWand *) NULL);
4720 assert(wand->signature == WandSignature);
4721 if (wand->debug != MagickFalse)
4722 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4723 if (wand->images == (Image *) NULL)
4725 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4726 "ContainsNoImages","`%s'",wand->name);
4727 return((PixelWand **) NULL);
4729 histogram=GetImageHistogram(wand->images,number_colors,wand->exception);
4730 if (histogram == (PixelInfo *) NULL)
4731 return((PixelWand **) NULL);
4732 pixel_wands=NewPixelWands(*number_colors);
4733 for (i=0; i < (ssize_t) *number_colors; i++)
4735 PixelSetQuantumPacket(pixel_wands[i],&histogram[i]);
4736 PixelSetColorCount(pixel_wands[i],(size_t) histogram[i].count);
4738 histogram=(PixelInfo *) RelinquishMagickMemory(histogram);
4739 return(pixel_wands);
4743 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4747 % 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 %
4751 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4753 % MagickGetImageInterlaceScheme() gets the image interlace scheme.
4755 % The format of the MagickGetImageInterlaceScheme method is:
4757 % InterlaceType MagickGetImageInterlaceScheme(MagickWand *wand)
4759 % A description of each parameter follows:
4761 % o wand: the magick wand.
4764 WandExport InterlaceType MagickGetImageInterlaceScheme(MagickWand *wand)
4766 assert(wand != (MagickWand *) NULL);
4767 assert(wand->signature == WandSignature);
4768 if (wand->debug != MagickFalse)
4769 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4770 if (wand->images == (Image *) NULL)
4772 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4773 "ContainsNoImages","`%s'",wand->name);
4774 return(UndefinedInterlace);
4776 return(wand->images->interlace);
4780 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4784 % 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 %
4788 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4790 % MagickGetImageInterpolateMethod() returns the interpolation method for the
4793 % The format of the MagickGetImageInterpolateMethod method is:
4795 % PixelInterpolateMethod MagickGetImagePixelInterpolateMethod(
4798 % A description of each parameter follows:
4800 % o wand: the magick wand.
4803 WandExport PixelInterpolateMethod MagickGetImageInterpolateMethod(
4806 assert(wand != (MagickWand *) NULL);
4807 assert(wand->signature == WandSignature);
4808 if (wand->debug != MagickFalse)
4809 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4810 if (wand->images == (Image *) NULL)
4812 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4813 "ContainsNoImages","`%s'",wand->name);
4814 return(UndefinedInterpolatePixel);
4816 return(wand->images->interpolate);
4820 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4824 % M a g i c k G e t I m a g e I t e r a t i o n s %
4828 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4830 % MagickGetImageIterations() gets the image iterations.
4832 % The format of the MagickGetImageIterations method is:
4834 % size_t MagickGetImageIterations(MagickWand *wand)
4836 % A description of each parameter follows:
4838 % o wand: the magick wand.
4841 WandExport size_t MagickGetImageIterations(MagickWand *wand)
4843 assert(wand != (MagickWand *) NULL);
4844 assert(wand->signature == WandSignature);
4845 if (wand->debug != MagickFalse)
4846 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4847 if (wand->images == (Image *) NULL)
4848 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4849 return(wand->images->iterations);
4853 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4857 % M a g i c k G e t I m a g e L e n g t h %
4861 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4863 % MagickGetImageLength() returns the image length in bytes.
4865 % The format of the MagickGetImageLength method is:
4867 % MagickBooleanType MagickGetImageLength(MagickWand *wand,
4868 % MagickSizeType *length)
4870 % A description of each parameter follows:
4872 % o wand: the magick wand.
4874 % o length: the image length in bytes.
4877 WandExport MagickBooleanType MagickGetImageLength(MagickWand *wand,
4878 MagickSizeType *length)
4880 assert(wand != (MagickWand *) NULL);
4881 assert(wand->signature == WandSignature);
4882 if (wand->debug != MagickFalse)
4883 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4884 if (wand->images == (Image *) NULL)
4885 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4886 *length=GetBlobSize(wand->images);
4891 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4895 % M a g i c k G e t I m a g e M a t t e C o l o r %
4899 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4901 % MagickGetImageMatteColor() returns the image matte color.
4903 % The format of the MagickGetImageMatteColor method is:
4905 % MagickBooleanType MagickGetImagematteColor(MagickWand *wand,
4906 % PixelWand *matte_color)
4908 % A description of each parameter follows:
4910 % o wand: the magick wand.
4912 % o matte_color: Return the matte color.
4915 WandExport MagickBooleanType MagickGetImageMatteColor(MagickWand *wand,
4916 PixelWand *matte_color)
4918 assert(wand != (MagickWand *) NULL);
4919 assert(wand->signature == WandSignature);
4920 if (wand->debug != MagickFalse)
4921 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4922 if (wand->images == (Image *) NULL)
4923 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4924 PixelSetQuantumPacket(matte_color,&wand->images->matte_color);
4929 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4933 % 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 %
4937 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4939 % MagickGetImageOrientation() returns the image orientation.
4941 % The format of the MagickGetImageOrientation method is:
4943 % OrientationType MagickGetImageOrientation(MagickWand *wand)
4945 % A description of each parameter follows:
4947 % o wand: the magick wand.
4950 WandExport OrientationType MagickGetImageOrientation(MagickWand *wand)
4952 assert(wand != (MagickWand *) NULL);
4953 assert(wand->signature == WandSignature);
4954 if (wand->debug != MagickFalse)
4955 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4956 if (wand->images == (Image *) NULL)
4958 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4959 "ContainsNoImages","`%s'",wand->name);
4960 return(UndefinedOrientation);
4962 return(wand->images->orientation);
4966 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4970 % M a g i c k G e t I m a g e P a g e %
4974 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4976 % MagickGetImagePage() returns the page geometry associated with the image.
4978 % The format of the MagickGetImagePage method is:
4980 % MagickBooleanType MagickGetImagePage(MagickWand *wand,
4981 % size_t *width,size_t *height,ssize_t *x,ssize_t *y)
4983 % A description of each parameter follows:
4985 % o wand: the magick wand.
4987 % o width: the page width.
4989 % o height: the page height.
4991 % o x: the page x-offset.
4993 % o y: the page y-offset.
4996 WandExport MagickBooleanType MagickGetImagePage(MagickWand *wand,
4997 size_t *width,size_t *height,ssize_t *x,ssize_t *y)
4999 assert(wand != (const MagickWand *) NULL);
5000 assert(wand->signature == WandSignature);
5001 if (wand->debug != MagickFalse)
5002 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5003 if (wand->images == (Image *) NULL)
5004 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5005 *width=wand->images->page.width;
5006 *height=wand->images->page.height;
5007 *x=wand->images->page.x;
5008 *y=wand->images->page.y;
5013 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5017 % M a g i c k G e t I m a g e P i x e l C o l o r %
5021 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5023 % MagickGetImagePixelColor() returns the color of the specified pixel.
5025 % The format of the MagickGetImagePixelColor method is:
5027 % MagickBooleanType MagickGetImagePixelColor(MagickWand *wand,
5028 % const ssize_t x,const ssize_t y,PixelWand *color)
5030 % A description of each parameter follows:
5032 % o wand: the magick wand.
5034 % o x,y: the pixel offset into the image.
5036 % o color: Return the colormap color in this wand.
5039 WandExport MagickBooleanType MagickGetImagePixelColor(MagickWand *wand,
5040 const ssize_t x,const ssize_t y,PixelWand *color)
5042 register const Quantum
5048 assert(wand != (MagickWand *) NULL);
5049 assert(wand->signature == WandSignature);
5050 if (wand->debug != MagickFalse)
5051 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5052 if (wand->images == (Image *) NULL)
5053 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5054 image_view=AcquireCacheView(wand->images);
5055 p=GetCacheViewVirtualPixels(image_view,x,y,1,1,wand->exception);
5056 if (p == (const Quantum *) NULL)
5058 image_view=DestroyCacheView(image_view);
5059 return(MagickFalse);
5061 PixelSetQuantumPixel(wand->images,p,color);
5062 image_view=DestroyCacheView(image_view);
5067 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5071 % M a g i c k G e t I m a g e R e d P r i m a r y %
5075 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5077 % MagickGetImageRedPrimary() returns the chromaticy red primary point.
5079 % The format of the MagickGetImageRedPrimary method is:
5081 % MagickBooleanType MagickGetImageRedPrimary(MagickWand *wand,double *x,
5084 % A description of each parameter follows:
5086 % o wand: the magick wand.
5088 % o x: the chromaticity red primary x-point.
5090 % o y: the chromaticity red primary y-point.
5093 WandExport MagickBooleanType MagickGetImageRedPrimary(MagickWand *wand,
5094 double *x,double *y)
5096 assert(wand != (MagickWand *) NULL);
5097 assert(wand->signature == WandSignature);
5098 if (wand->debug != MagickFalse)
5099 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5100 if (wand->images == (Image *) NULL)
5101 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5102 *x=wand->images->chromaticity.red_primary.x;
5103 *y=wand->images->chromaticity.red_primary.y;
5108 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5112 % M a g i c k G e t I m a g e R e g i o n %
5116 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5118 % MagickGetImageRegion() extracts a region of the image and returns it as a
5121 % The format of the MagickGetImageRegion method is:
5123 % MagickWand *MagickGetImageRegion(MagickWand *wand,
5124 % const size_t width,const size_t height,const ssize_t x,
5127 % A description of each parameter follows:
5129 % o wand: the magick wand.
5131 % o width: the region width.
5133 % o height: the region height.
5135 % o x: the region x offset.
5137 % o y: the region y offset.
5140 WandExport MagickWand *MagickGetImageRegion(MagickWand *wand,
5141 const size_t width,const size_t height,const ssize_t x,
5150 assert(wand != (MagickWand *) NULL);
5151 assert(wand->signature == WandSignature);
5152 if (wand->debug != MagickFalse)
5153 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5154 if (wand->images == (Image *) NULL)
5155 return((MagickWand *) NULL);
5157 region.height=height;
5160 region_image=CropImage(wand->images,®ion,wand->exception);
5161 if (region_image == (Image *) NULL)
5162 return((MagickWand *) NULL);
5163 return(CloneMagickWandFromImages(wand,region_image));
5167 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5171 % 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 %
5175 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5177 % MagickGetImageRenderingIntent() gets the image rendering intent.
5179 % The format of the MagickGetImageRenderingIntent method is:
5181 % RenderingIntent MagickGetImageRenderingIntent(MagickWand *wand)
5183 % A description of each parameter follows:
5185 % o wand: the magick wand.
5188 WandExport RenderingIntent MagickGetImageRenderingIntent(MagickWand *wand)
5190 assert(wand != (MagickWand *) NULL);
5191 assert(wand->signature == WandSignature);
5192 if (wand->debug != MagickFalse)
5193 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5194 if (wand->images == (Image *) NULL)
5196 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5197 "ContainsNoImages","`%s'",wand->name);
5198 return(UndefinedIntent);
5200 return((RenderingIntent) wand->images->rendering_intent);
5204 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5208 % M a g i c k G e t I m a g e R e s o l u t i o n %
5212 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5214 % MagickGetImageResolution() gets the image X and Y resolution.
5216 % The format of the MagickGetImageResolution method is:
5218 % MagickBooleanType MagickGetImageResolution(MagickWand *wand,double *x,
5221 % A description of each parameter follows:
5223 % o wand: the magick wand.
5225 % o x: the image x-resolution.
5227 % o y: the image y-resolution.
5230 WandExport MagickBooleanType MagickGetImageResolution(MagickWand *wand,
5231 double *x,double *y)
5233 assert(wand != (MagickWand *) NULL);
5234 assert(wand->signature == WandSignature);
5235 if (wand->debug != MagickFalse)
5236 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5237 if (wand->images == (Image *) NULL)
5238 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5239 *x=wand->images->x_resolution;
5240 *y=wand->images->y_resolution;
5245 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5249 % M a g i c k G e t I m a g e S c e n e %
5253 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5255 % MagickGetImageScene() gets the image scene.
5257 % The format of the MagickGetImageScene method is:
5259 % size_t MagickGetImageScene(MagickWand *wand)
5261 % A description of each parameter follows:
5263 % o wand: the magick wand.
5266 WandExport size_t MagickGetImageScene(MagickWand *wand)
5268 assert(wand != (MagickWand *) NULL);
5269 assert(wand->signature == WandSignature);
5270 if (wand->debug != MagickFalse)
5271 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5272 if (wand->images == (Image *) NULL)
5273 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5274 return(wand->images->scene);
5278 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5282 % M a g i c k G e t I m a g e S i g n a t u r e %
5286 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5288 % MagickGetImageSignature() generates an SHA-256 message digest for the image
5291 % The format of the MagickGetImageSignature method is:
5293 % const char MagickGetImageSignature(MagickWand *wand)
5295 % A description of each parameter follows:
5297 % o wand: the magick wand.
5300 WandExport char *MagickGetImageSignature(MagickWand *wand)
5308 assert(wand != (MagickWand *) NULL);
5309 assert(wand->signature == WandSignature);
5310 if (wand->debug != MagickFalse)
5311 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5312 if (wand->images == (Image *) NULL)
5314 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5315 "ContainsNoImages","`%s'",wand->name);
5316 return((char *) NULL);
5318 status=SignatureImage(wand->images,wand->exception);
5319 if (status == MagickFalse)
5320 return((char *) NULL);
5321 value=GetImageProperty(wand->images,"signature",wand->exception);
5322 if (value == (const char *) NULL)
5323 return((char *) NULL);
5324 return(AcquireString(value));
5328 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5332 % 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 %
5336 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5338 % MagickGetImageTicksPerSecond() gets the image ticks-per-second.
5340 % The format of the MagickGetImageTicksPerSecond method is:
5342 % size_t MagickGetImageTicksPerSecond(MagickWand *wand)
5344 % A description of each parameter follows:
5346 % o wand: the magick wand.
5349 WandExport size_t MagickGetImageTicksPerSecond(MagickWand *wand)
5351 assert(wand != (MagickWand *) NULL);
5352 assert(wand->signature == WandSignature);
5353 if (wand->debug != MagickFalse)
5354 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5355 if (wand->images == (Image *) NULL)
5356 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5357 return((size_t) wand->images->ticks_per_second);
5361 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5365 % M a g i c k G e t I m a g e T y p e %
5369 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5371 % MagickGetImageType() gets the potential image type:
5373 % Bilevel Grayscale GrayscaleMatte
5374 % Palette PaletteMatte TrueColor
5375 % TrueColorMatte ColorSeparation ColorSeparationMatte
5377 % To ensure the image type matches its potential, use MagickSetImageType():
5379 % (void) MagickSetImageType(wand,MagickGetImageType(wand));
5381 % The format of the MagickGetImageType method is:
5383 % ImageType MagickGetImageType(MagickWand *wand)
5385 % A description of each parameter follows:
5387 % o wand: the magick wand.
5390 WandExport ImageType MagickGetImageType(MagickWand *wand)
5392 assert(wand != (MagickWand *) NULL);
5393 assert(wand->signature == WandSignature);
5394 if (wand->debug != MagickFalse)
5395 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5396 if (wand->images == (Image *) NULL)
5398 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5399 "ContainsNoImages","`%s'",wand->name);
5400 return(UndefinedType);
5402 return(GetImageType(wand->images,wand->exception));
5406 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5410 % M a g i c k G e t I m a g e U n i t s %
5414 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5416 % MagickGetImageUnits() gets the image units of resolution.
5418 % The format of the MagickGetImageUnits method is:
5420 % ResolutionType MagickGetImageUnits(MagickWand *wand)
5422 % A description of each parameter follows:
5424 % o wand: the magick wand.
5427 WandExport ResolutionType MagickGetImageUnits(MagickWand *wand)
5429 assert(wand != (MagickWand *) NULL);
5430 assert(wand->signature == WandSignature);
5431 if (wand->debug != MagickFalse)
5432 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5433 if (wand->images == (Image *) NULL)
5435 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5436 "ContainsNoImages","`%s'",wand->name);
5437 return(UndefinedResolution);
5439 return(wand->images->units);
5443 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5447 % 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 %
5451 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5453 % MagickGetImageVirtualPixelMethod() returns the virtual pixel method for the
5456 % The format of the MagickGetImageVirtualPixelMethod method is:
5458 % VirtualPixelMethod MagickGetImageVirtualPixelMethod(MagickWand *wand)
5460 % A description of each parameter follows:
5462 % o wand: the magick wand.
5465 WandExport VirtualPixelMethod MagickGetImageVirtualPixelMethod(MagickWand *wand)
5467 assert(wand != (MagickWand *) NULL);
5468 assert(wand->signature == WandSignature);
5469 if (wand->debug != MagickFalse)
5470 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5471 if (wand->images == (Image *) NULL)
5473 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5474 "ContainsNoImages","`%s'",wand->name);
5475 return(UndefinedVirtualPixelMethod);
5477 return(GetImageVirtualPixelMethod(wand->images));
5481 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5485 % M a g i c k G e t I m a g e W h i t e P o i n t %
5489 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5491 % MagickGetImageWhitePoint() returns the chromaticy white point.
5493 % The format of the MagickGetImageWhitePoint method is:
5495 % MagickBooleanType MagickGetImageWhitePoint(MagickWand *wand,double *x,
5498 % A description of each parameter follows:
5500 % o wand: the magick wand.
5502 % o x: the chromaticity white x-point.
5504 % o y: the chromaticity white y-point.
5507 WandExport MagickBooleanType MagickGetImageWhitePoint(MagickWand *wand,
5508 double *x,double *y)
5510 assert(wand != (MagickWand *) NULL);
5511 assert(wand->signature == WandSignature);
5512 if (wand->debug != MagickFalse)
5513 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5514 if (wand->images == (Image *) NULL)
5515 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5516 *x=wand->images->chromaticity.white_point.x;
5517 *y=wand->images->chromaticity.white_point.y;
5522 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5526 % M a g i c k G e t I m a g e W i d t h %
5530 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5532 % MagickGetImageWidth() returns the image width.
5534 % The format of the MagickGetImageWidth method is:
5536 % size_t MagickGetImageWidth(MagickWand *wand)
5538 % A description of each parameter follows:
5540 % o wand: the magick wand.
5543 WandExport size_t MagickGetImageWidth(MagickWand *wand)
5545 assert(wand != (MagickWand *) NULL);
5546 assert(wand->signature == WandSignature);
5547 if (wand->debug != MagickFalse)
5548 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5549 if (wand->images == (Image *) NULL)
5550 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5551 return(wand->images->columns);
5555 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5559 % M a g i c k G e t N u m b e r I m a g e s %
5563 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5565 % MagickGetNumberImages() returns the number of images associated with a
5568 % The format of the MagickGetNumberImages method is:
5570 % size_t MagickGetNumberImages(MagickWand *wand)
5572 % A description of each parameter follows:
5574 % o wand: the magick wand.
5577 WandExport size_t MagickGetNumberImages(MagickWand *wand)
5579 assert(wand != (MagickWand *) NULL);
5580 assert(wand->signature == WandSignature);
5581 if (wand->debug != MagickFalse)
5582 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5583 return(GetImageListLength(wand->images));
5587 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5591 % 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 %
5595 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5597 % MagickGetImageTotalInkDensity() gets the image total ink density.
5599 % The format of the MagickGetImageTotalInkDensity method is:
5601 % double MagickGetImageTotalInkDensity(MagickWand *wand)
5603 % A description of each parameter follows:
5605 % o wand: the magick wand.
5608 WandExport double MagickGetImageTotalInkDensity(MagickWand *wand)
5610 assert(wand != (MagickWand *) NULL);
5611 assert(wand->signature == WandSignature);
5612 if (wand->debug != MagickFalse)
5613 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5614 if (wand->images == (Image *) NULL)
5616 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5617 "ContainsNoImages","`%s'",wand->name);
5620 return(GetImageTotalInkDensity(wand->images));
5624 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5628 % M a g i c k H a l d C l u t I m a g e %
5632 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5634 % MagickHaldClutImage() replaces colors in the image from a Hald color lookup
5635 % table. A Hald color lookup table is a 3-dimensional color cube mapped to 2
5636 % dimensions. Create it with the HALD coder. You can apply any color
5637 % transformation to the Hald image and then use this method to apply the
5638 % transform to the image.
5640 % The format of the MagickHaldClutImage method is:
5642 % MagickBooleanType MagickHaldClutImage(MagickWand *wand,
5643 % const MagickWand *hald_wand)
5645 % A description of each parameter follows:
5647 % o wand: the magick wand.
5649 % o hald_image: the hald CLUT image.
5652 WandExport MagickBooleanType MagickHaldClutImage(MagickWand *wand,
5653 const MagickWand *hald_wand)
5658 assert(wand != (MagickWand *) NULL);
5659 assert(wand->signature == WandSignature);
5660 if (wand->debug != MagickFalse)
5661 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5662 if ((wand->images == (Image *) NULL) || (hald_wand->images == (Image *) NULL))
5663 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5664 status=HaldClutImage(wand->images,hald_wand->images,&wand->images->exception);
5669 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5673 % M a g i c k H a s N e x t I m a g e %
5677 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5679 % MagickHasNextImage() returns MagickTrue if the wand has more images when
5680 % traversing the list in the forward direction
5682 % The format of the MagickHasNextImage method is:
5684 % MagickBooleanType MagickHasNextImage(MagickWand *wand)
5686 % A description of each parameter follows:
5688 % o wand: the magick wand.
5691 WandExport MagickBooleanType MagickHasNextImage(MagickWand *wand)
5693 assert(wand != (MagickWand *) NULL);
5694 assert(wand->signature == WandSignature);
5695 if (wand->debug != MagickFalse)
5696 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5697 if (wand->images == (Image *) NULL)
5698 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5699 if (GetNextImageInList(wand->images) == (Image *) NULL)
5700 return(MagickFalse);
5705 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5709 % M a g i c k H a s P r e v i o u s I m a g e %
5713 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5715 % MagickHasPreviousImage() returns MagickTrue if the wand has more images when
5716 % traversing the list in the reverse direction
5718 % The format of the MagickHasPreviousImage method is:
5720 % MagickBooleanType MagickHasPreviousImage(MagickWand *wand)
5722 % A description of each parameter follows:
5724 % o wand: the magick wand.
5727 WandExport MagickBooleanType MagickHasPreviousImage(MagickWand *wand)
5729 assert(wand != (MagickWand *) NULL);
5730 assert(wand->signature == WandSignature);
5731 if (wand->debug != MagickFalse)
5732 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5733 if (wand->images == (Image *) NULL)
5734 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5735 if (GetPreviousImageInList(wand->images) == (Image *) NULL)
5736 return(MagickFalse);
5741 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5745 % M a g i c k I d e n t i f y I m a g e %
5749 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5751 % MagickIdentifyImage() identifies an image by printing its attributes to the
5752 % file. Attributes include the image width, height, size, and others.
5754 % The format of the MagickIdentifyImage method is:
5756 % const char *MagickIdentifyImage(MagickWand *wand)
5758 % A description of each parameter follows:
5760 % o wand: the magick wand.
5763 WandExport char *MagickIdentifyImage(MagickWand *wand)
5767 filename[MaxTextExtent];
5775 assert(wand != (MagickWand *) NULL);
5776 assert(wand->signature == WandSignature);
5777 if (wand->debug != MagickFalse)
5778 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5779 if (wand->images == (Image *) NULL)
5781 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5782 "ContainsNoImages","`%s'",wand->name);
5783 return((char *) NULL);
5785 description=(char *) NULL;
5786 unique_file=AcquireUniqueFileResource(filename);
5788 if (unique_file != -1)
5789 file=fdopen(unique_file,"wb");
5790 if ((unique_file == -1) || (file == (FILE *) NULL))
5792 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5793 "UnableToCreateTemporaryFile","`%s'",wand->name);
5794 return((char *) NULL);
5796 (void) IdentifyImage(wand->images,file,MagickTrue,wand->exception);
5797 (void) fclose(file);
5798 description=FileToString(filename,~0,wand->exception);
5799 (void) RelinquishUniqueFileResource(filename);
5800 return(description);
5804 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5808 % M a g i c k I m p l o d e I m a g e %
5812 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5814 % MagickImplodeImage() creates a new image that is a copy of an existing
5815 % one with the image pixels "implode" by the specified percentage. It
5816 % allocates the memory necessary for the new Image structure and returns a
5817 % pointer to the new image.
5819 % The format of the MagickImplodeImage method is:
5821 % MagickBooleanType MagickImplodeImage(MagickWand *wand,
5822 % const double radius,const PixelInterpolateMethod method)
5824 % A description of each parameter follows:
5826 % o wand: the magick wand.
5828 % o amount: Define the extent of the implosion.
5830 % o method: the pixel interpolation method.
5833 WandExport MagickBooleanType MagickImplodeImage(MagickWand *wand,
5834 const double amount,const PixelInterpolateMethod method)
5839 assert(wand != (MagickWand *) NULL);
5840 assert(wand->signature == WandSignature);
5841 if (wand->debug != MagickFalse)
5842 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5843 if (wand->images == (Image *) NULL)
5844 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5845 implode_image=ImplodeImage(wand->images,amount,method,wand->exception);
5846 if (implode_image == (Image *) NULL)
5847 return(MagickFalse);
5848 ReplaceImageInList(&wand->images,implode_image);
5853 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5857 % M a g i c k I m p o r t I m a g e P i x e l s %
5861 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5863 % MagickImportImagePixels() accepts pixel datand stores it in the image at the
5864 % location you specify. The method returns MagickFalse on success otherwise
5865 % MagickTrue if an error is encountered. The pixel data can be either char,
5866 % short int, int, ssize_t, float, or double in the order specified by map.
5868 % Suppose your want to upload the first scanline of a 640x480 image from
5869 % character data in red-green-blue order:
5871 % MagickImportImagePixels(wand,0,0,640,1,"RGB",CharPixel,pixels);
5873 % The format of the MagickImportImagePixels method is:
5875 % MagickBooleanType MagickImportImagePixels(MagickWand *wand,
5876 % const ssize_t x,const ssize_t y,const size_t columns,
5877 % const size_t rows,const char *map,const StorageType storage,
5878 % const void *pixels)
5880 % A description of each parameter follows:
5882 % o wand: the magick wand.
5884 % o x, y, columns, rows: These values define the perimeter of a region
5885 % of pixels you want to define.
5887 % o map: This string reflects the expected ordering of the pixel array.
5888 % It can be any combination or order of R = red, G = green, B = blue,
5889 % A = alpha (0 is transparent), O = alpha (0 is opaque), C = cyan,
5890 % Y = yellow, M = magenta, K = black, I = intensity (for grayscale),
5893 % o storage: Define the data type of the pixels. Float and double types are
5894 % expected to be normalized [0..1] otherwise [0..QuantumRange]. Choose from
5895 % these types: CharPixel, ShortPixel, IntegerPixel, LongPixel, FloatPixel,
5898 % o pixels: This array of values contain the pixel components as defined by
5899 % map and type. You must preallocate this array where the expected
5900 % length varies depending on the values of width, height, map, and type.
5903 WandExport MagickBooleanType MagickImportImagePixels(MagickWand *wand,
5904 const ssize_t x,const ssize_t y,const size_t columns,const size_t rows,
5905 const char *map,const StorageType storage,const void *pixels)
5910 assert(wand != (MagickWand *) NULL);
5911 assert(wand->signature == WandSignature);
5912 if (wand->debug != MagickFalse)
5913 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5914 if (wand->images == (Image *) NULL)
5915 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5916 status=ImportImagePixels(wand->images,x,y,columns,rows,map,storage,pixels,
5922 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5926 % 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 %
5930 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5932 % MagickInverseFourierTransformImage() implements the inverse discrete
5933 % Fourier transform (DFT) of the image either as a magnitude / phase or real /
5934 % imaginary image pair.
5936 % The format of the MagickInverseFourierTransformImage method is:
5938 % MagickBooleanType MagickInverseFourierTransformImage(
5939 % MagickWand *magnitude_wand,MagickWand *phase_wand,
5940 % const MagickBooleanType magnitude)
5942 % A description of each parameter follows:
5944 % o magnitude_wand: the magnitude or real wand.
5946 % o phase_wand: the phase or imaginary wand.
5948 % o magnitude: if true, return as magnitude / phase pair otherwise a real /
5949 % imaginary image pair.
5952 WandExport MagickBooleanType MagickInverseFourierTransformImage(
5953 MagickWand *magnitude_wand,MagickWand *phase_wand,
5954 const MagickBooleanType magnitude)
5962 assert(magnitude_wand != (MagickWand *) NULL);
5963 assert(magnitude_wand->signature == WandSignature);
5964 if (magnitude_wand->debug != MagickFalse)
5965 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",
5966 magnitude_wand->name);
5967 wand=magnitude_wand;
5968 if (magnitude_wand->images == (Image *) NULL)
5969 ThrowWandException(WandError,"ContainsNoImages",
5970 magnitude_wand->name);
5971 assert(phase_wand != (MagickWand *) NULL);
5972 assert(phase_wand->signature == WandSignature);
5973 inverse_image=InverseFourierTransformImage(magnitude_wand->images,
5974 phase_wand->images,magnitude,wand->exception);
5975 if (inverse_image == (Image *) NULL)
5976 return(MagickFalse);
5977 ReplaceImageInList(&wand->images,inverse_image);
5982 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5986 % M a g i c k L a b e l I m a g e %
5990 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5992 % MagickLabelImage() adds a label to your image.
5994 % The format of the MagickLabelImage method is:
5996 % MagickBooleanType MagickLabelImage(MagickWand *wand,const char *label)
5998 % A description of each parameter follows:
6000 % o wand: the magick wand.
6002 % o label: the image label.
6005 WandExport MagickBooleanType MagickLabelImage(MagickWand *wand,
6011 assert(wand != (MagickWand *) NULL);
6012 assert(wand->signature == WandSignature);
6013 if (wand->debug != MagickFalse)
6014 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6015 if (wand->images == (Image *) NULL)
6016 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6017 status=SetImageProperty(wand->images,"label",label,wand->exception);
6022 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6026 % M a g i c k L e v e l I m a g e %
6030 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6032 % MagickLevelImage() adjusts the levels of an image by scaling the colors
6033 % falling between specified white and black points to the full available
6034 % quantum range. The parameters provided represent the black, mid, and white
6035 % points. The black point specifies the darkest color in the image. Colors
6036 % darker than the black point are set to zero. Mid point specifies a gamma
6037 % correction to apply to the image. White point specifies the lightest color
6038 % in the image. Colors brighter than the white point are set to the maximum
6041 % The format of the MagickLevelImage method is:
6043 % MagickBooleanType MagickLevelImage(MagickWand *wand,
6044 % const double black_point,const double gamma,const double white_point)
6045 % MagickBooleanType MagickLevelImage(MagickWand *wand,
6046 % const ChannelType channel,const double black_point,const double gamma,
6047 % const double white_point)
6049 % A description of each parameter follows:
6051 % o wand: the magick wand.
6053 % o channel: Identify which channel to level: RedChannel, GreenChannel,
6055 % o black_point: the black point.
6057 % o gamma: the gamma.
6059 % o white_point: the white point.
6062 WandExport MagickBooleanType MagickLevelImage(MagickWand *wand,
6063 const double black_point,const double gamma,const double white_point)
6068 assert(wand != (MagickWand *) NULL);
6069 assert(wand->signature == WandSignature);
6070 if (wand->debug != MagickFalse)
6071 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6072 if (wand->images == (Image *) NULL)
6073 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6074 status=LevelImage(wand->images,black_point,white_point,gamma,
6075 &wand->images->exception);
6080 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6084 % M a g i c k L i n e a r S t r e t c h I m a g e %
6088 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6090 % MagickLinearStretchImage() stretches with saturation the image intensity.
6092 % You can also reduce the influence of a particular channel with a gamma
6095 % The format of the MagickLinearStretchImage method is:
6097 % MagickBooleanType MagickLinearStretchImage(MagickWand *wand,
6098 % const double black_point,const double white_point)
6100 % A description of each parameter follows:
6102 % o wand: the magick wand.
6104 % o black_point: the black point.
6106 % o white_point: the white point.
6109 WandExport MagickBooleanType MagickLinearStretchImage(MagickWand *wand,
6110 const double black_point,const double white_point)
6115 assert(wand != (MagickWand *) NULL);
6116 assert(wand->signature == WandSignature);
6117 if (wand->debug != MagickFalse)
6118 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6119 if (wand->images == (Image *) NULL)
6120 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6121 status=LinearStretchImage(wand->images,black_point,white_point,
6122 &wand->images->exception);
6127 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6131 % M a g i c k L i q u i d R e s c a l e I m a g e %
6135 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6137 % MagickLiquidRescaleImage() rescales image with seam carving.
6139 % MagickBooleanType MagickLiquidRescaleImage(MagickWand *wand,
6140 % const size_t columns,const size_t rows,
6141 % const double delta_x,const double rigidity)
6143 % A description of each parameter follows:
6145 % o wand: the magick wand.
6147 % o columns: the number of columns in the scaled image.
6149 % o rows: the number of rows in the scaled image.
6151 % o delta_x: maximum seam transversal step (0 means straight seams).
6153 % o rigidity: introduce a bias for non-straight seams (typically 0).
6156 WandExport MagickBooleanType MagickLiquidRescaleImage(MagickWand *wand,
6157 const size_t columns,const size_t rows,const double delta_x,
6158 const double rigidity)
6163 assert(wand != (MagickWand *) NULL);
6164 assert(wand->signature == WandSignature);
6165 if (wand->debug != MagickFalse)
6166 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6167 if (wand->images == (Image *) NULL)
6168 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6169 rescale_image=LiquidRescaleImage(wand->images,columns,rows,delta_x,
6170 rigidity,wand->exception);
6171 if (rescale_image == (Image *) NULL)
6172 return(MagickFalse);
6173 ReplaceImageInList(&wand->images,rescale_image);
6178 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6182 % M a g i c k M a g n i f y I m a g e %
6186 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6188 % MagickMagnifyImage() is a convenience method that scales an image
6189 % proportionally to twice its original size.
6191 % The format of the MagickMagnifyImage method is:
6193 % MagickBooleanType MagickMagnifyImage(MagickWand *wand)
6195 % A description of each parameter follows:
6197 % o wand: the magick wand.
6200 WandExport MagickBooleanType MagickMagnifyImage(MagickWand *wand)
6205 assert(wand != (MagickWand *) NULL);
6206 assert(wand->signature == WandSignature);
6207 if (wand->debug != MagickFalse)
6208 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6209 if (wand->images == (Image *) NULL)
6210 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6211 magnify_image=MagnifyImage(wand->images,wand->exception);
6212 if (magnify_image == (Image *) NULL)
6213 return(MagickFalse);
6214 ReplaceImageInList(&wand->images,magnify_image);
6219 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6223 % M a g i c k M e r g e I m a g e L a y e r s %
6227 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6229 % MagickMergeImageLayers() composes all the image layers from the current
6230 % given image onward to produce a single image of the merged layers.
6232 % The inital canvas's size depends on the given ImageLayerMethod, and is
6233 % initialized using the first images background color. The images
6234 % are then compositied onto that image in sequence using the given
6235 % composition that has been assigned to each individual image.
6237 % The format of the MagickMergeImageLayers method is:
6239 % MagickWand *MagickMergeImageLayers(MagickWand *wand,
6240 % const ImageLayerMethod method)
6242 % A description of each parameter follows:
6244 % o wand: the magick wand.
6246 % o method: the method of selecting the size of the initial canvas.
6248 % MergeLayer: Merge all layers onto a canvas just large enough
6249 % to hold all the actual images. The virtual canvas of the
6250 % first image is preserved but otherwise ignored.
6252 % FlattenLayer: Use the virtual canvas size of first image.
6253 % Images which fall outside this canvas is clipped.
6254 % This can be used to 'fill out' a given virtual canvas.
6256 % MosaicLayer: Start with the virtual canvas of the first image,
6257 % enlarging left and right edges to contain all images.
6258 % Images with negative offsets will be clipped.
6261 WandExport MagickWand *MagickMergeImageLayers(MagickWand *wand,
6262 const ImageLayerMethod method)
6267 assert(wand != (MagickWand *) NULL);
6268 assert(wand->signature == WandSignature);
6269 if (wand->debug != MagickFalse)
6270 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6271 if (wand->images == (Image *) NULL)
6272 return((MagickWand *) NULL);
6273 mosaic_image=MergeImageLayers(wand->images,method,wand->exception);
6274 if (mosaic_image == (Image *) NULL)
6275 return((MagickWand *) NULL);
6276 return(CloneMagickWandFromImages(wand,mosaic_image));
6280 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6284 % M a g i c k M i n i f y I m a g e %
6288 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6290 % MagickMinifyImage() is a convenience method that scales an image
6291 % proportionally to one-half its original size
6293 % The format of the MagickMinifyImage method is:
6295 % MagickBooleanType MagickMinifyImage(MagickWand *wand)
6297 % A description of each parameter follows:
6299 % o wand: the magick wand.
6302 WandExport MagickBooleanType MagickMinifyImage(MagickWand *wand)
6307 assert(wand != (MagickWand *) NULL);
6308 assert(wand->signature == WandSignature);
6309 if (wand->debug != MagickFalse)
6310 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6311 if (wand->images == (Image *) NULL)
6312 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6313 minify_image=MinifyImage(wand->images,wand->exception);
6314 if (minify_image == (Image *) NULL)
6315 return(MagickFalse);
6316 ReplaceImageInList(&wand->images,minify_image);
6321 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6325 % M a g i c k M o d u l a t e I m a g e %
6329 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6331 % MagickModulateImage() lets you control the brightness, saturation, and hue
6332 % of an image. Hue is the percentage of absolute rotation from the current
6333 % position. For example 50 results in a counter-clockwise rotation of 90
6334 % degrees, 150 results in a clockwise rotation of 90 degrees, with 0 and 200
6335 % both resulting in a rotation of 180 degrees.
6337 % To increase the color brightness by 20% and decrease the color saturation by
6338 % 10% and leave the hue unchanged, use: 120,90,100.
6340 % The format of the MagickModulateImage method is:
6342 % MagickBooleanType MagickModulateImage(MagickWand *wand,
6343 % const double brightness,const double saturation,const double hue)
6345 % A description of each parameter follows:
6347 % o wand: the magick wand.
6349 % o brightness: the percent change in brighness.
6351 % o saturation: the percent change in saturation.
6353 % o hue: the percent change in hue.
6356 WandExport MagickBooleanType MagickModulateImage(MagickWand *wand,
6357 const double brightness,const double saturation,const double hue)
6360 modulate[MaxTextExtent];
6365 assert(wand != (MagickWand *) NULL);
6366 assert(wand->signature == WandSignature);
6367 if (wand->debug != MagickFalse)
6368 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6369 if (wand->images == (Image *) NULL)
6370 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6371 (void) FormatLocaleString(modulate,MaxTextExtent,"%g,%g,%g",
6372 brightness,saturation,hue);
6373 status=ModulateImage(wand->images,modulate,&wand->images->exception);
6378 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6382 % M a g i c k M o n t a g e I m a g e %
6386 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6388 % MagickMontageImage() creates a composite image by combining several
6389 % separate images. The images are tiled on the composite image with the name
6390 % of the image optionally appearing just below the individual tile.
6392 % The format of the MagickMontageImage method is:
6394 % MagickWand *MagickMontageImage(MagickWand *wand,
6395 % const DrawingWand drawing_wand,const char *tile_geometry,
6396 % const char *thumbnail_geometry,const MontageMode mode,
6397 % const char *frame)
6399 % A description of each parameter follows:
6401 % o wand: the magick wand.
6403 % o drawing_wand: the drawing wand. The font name, size, and color are
6404 % obtained from this wand.
6406 % o tile_geometry: the number of tiles per row and page (e.g. 6x4+0+0).
6408 % o thumbnail_geometry: Preferred image size and border size of each
6409 % thumbnail (e.g. 120x120+4+3>).
6411 % o mode: Thumbnail framing mode: Frame, Unframe, or Concatenate.
6413 % o frame: Surround the image with an ornamental border (e.g. 15x15+3+3).
6414 % The frame color is that of the thumbnail's matte color.
6417 WandExport MagickWand *MagickMontageImage(MagickWand *wand,
6418 const DrawingWand *drawing_wand,const char *tile_geometry,
6419 const char *thumbnail_geometry,const MontageMode mode,const char *frame)
6433 assert(wand != (MagickWand *) NULL);
6434 assert(wand->signature == WandSignature);
6435 if (wand->debug != MagickFalse)
6436 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6437 if (wand->images == (Image *) NULL)
6438 return((MagickWand *) NULL);
6439 montage_info=CloneMontageInfo(wand->image_info,(MontageInfo *) NULL);
6444 (void) CloneString(&montage_info->frame,"15x15+3+3");
6445 montage_info->shadow=MagickTrue;
6450 montage_info->frame=(char *) NULL;
6451 montage_info->shadow=MagickFalse;
6452 montage_info->border_width=0;
6455 case ConcatenateMode:
6457 montage_info->frame=(char *) NULL;
6458 montage_info->shadow=MagickFalse;
6459 (void) CloneString(&montage_info->geometry,"+0+0");
6460 montage_info->border_width=0;
6466 font=DrawGetFont(drawing_wand);
6467 if (font != (char *) NULL)
6468 (void) CloneString(&montage_info->font,font);
6469 if (frame != (char *) NULL)
6470 (void) CloneString(&montage_info->frame,frame);
6471 montage_info->pointsize=DrawGetFontSize(drawing_wand);
6472 pixel_wand=NewPixelWand();
6473 DrawGetFillColor(drawing_wand,pixel_wand);
6474 PixelGetQuantumPacket(pixel_wand,&montage_info->fill);
6475 DrawGetStrokeColor(drawing_wand,pixel_wand);
6476 PixelGetQuantumPacket(pixel_wand,&montage_info->stroke);
6477 pixel_wand=DestroyPixelWand(pixel_wand);
6478 if (thumbnail_geometry != (char *) NULL)
6479 (void) CloneString(&montage_info->geometry,thumbnail_geometry);
6480 if (tile_geometry != (char *) NULL)
6481 (void) CloneString(&montage_info->tile,tile_geometry);
6482 montage_image=MontageImageList(wand->image_info,montage_info,wand->images,
6484 montage_info=DestroyMontageInfo(montage_info);
6485 if (montage_image == (Image *) NULL)
6486 return((MagickWand *) NULL);
6487 return(CloneMagickWandFromImages(wand,montage_image));
6491 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6495 % M a g i c k M o r p h I m a g e s %
6499 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6501 % MagickMorphImages() method morphs a set of images. Both the image pixels
6502 % and size are linearly interpolated to give the appearance of a
6503 % meta-morphosis from one image to the next.
6505 % The format of the MagickMorphImages method is:
6507 % MagickWand *MagickMorphImages(MagickWand *wand,
6508 % const size_t number_frames)
6510 % A description of each parameter follows:
6512 % o wand: the magick wand.
6514 % o number_frames: the number of in-between images to generate.
6517 WandExport MagickWand *MagickMorphImages(MagickWand *wand,
6518 const size_t number_frames)
6523 assert(wand != (MagickWand *) NULL);
6524 assert(wand->signature == WandSignature);
6525 if (wand->debug != MagickFalse)
6526 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6527 if (wand->images == (Image *) NULL)
6528 return((MagickWand *) NULL);
6529 morph_image=MorphImages(wand->images,number_frames,wand->exception);
6530 if (morph_image == (Image *) NULL)
6531 return((MagickWand *) NULL);
6532 return(CloneMagickWandFromImages(wand,morph_image));
6536 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6540 % M a g i c k M o r p h o l o g y I m a g e %
6544 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6546 % MagickMorphologyImage() applies a user supplied kernel to the image
6547 % according to the given mophology method.
6549 % The format of the MagickMorphologyImage method is:
6551 % MagickBooleanType MagickMorphologyImage(MagickWand *wand,
6552 % MorphologyMethod method,const ssize_t iterations,KernelInfo *kernel)
6554 % A description of each parameter follows:
6556 % o wand: the magick wand.
6558 % o method: the morphology method to be applied.
6560 % o iterations: apply the operation this many times (or no change).
6561 % A value of -1 means loop until no change found. How this is applied
6562 % may depend on the morphology method. Typically this is a value of 1.
6564 % o kernel: An array of doubles representing the morphology kernel.
6567 WandExport MagickBooleanType MagickMorphologyImage(MagickWand *wand,
6568 MorphologyMethod method,const ssize_t iterations,KernelInfo *kernel)
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 (kernel == (const KernelInfo *) NULL)
6578 return(MagickFalse);
6579 if (wand->images == (Image *) NULL)
6580 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6581 morphology_image=MorphologyImage(wand->images,method,iterations,kernel,
6583 if (morphology_image == (Image *) NULL)
6584 return(MagickFalse);
6585 ReplaceImageInList(&wand->images,morphology_image);
6590 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6594 % M a g i c k M o t i o n B l u r I m a g e %
6598 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6600 % MagickMotionBlurImage() simulates motion blur. We convolve the image with a
6601 % Gaussian operator of the given radius and standard deviation (sigma).
6602 % For reasonable results, radius should be larger than sigma. Use a
6603 % radius of 0 and MotionBlurImage() selects a suitable radius for you.
6604 % Angle gives the angle of the blurring motion.
6606 % The format of the MagickMotionBlurImage method is:
6608 % MagickBooleanType MagickMotionBlurImage(MagickWand *wand,
6609 % const double radius,const double sigma,const double angle,
6610 % const double bias)
6612 % A description of each parameter follows:
6614 % o wand: the magick wand.
6616 % o radius: the radius of the Gaussian, in pixels, not counting
6619 % o sigma: the standard deviation of the Gaussian, in pixels.
6621 % o angle: Apply the effect along this angle.
6624 WandExport MagickBooleanType MagickMotionBlurImage(MagickWand *wand,
6625 const double radius,const double sigma,const double angle,const double bias)
6630 assert(wand != (MagickWand *) NULL);
6631 assert(wand->signature == WandSignature);
6632 if (wand->debug != MagickFalse)
6633 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6634 if (wand->images == (Image *) NULL)
6635 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6636 blur_image=MotionBlurImage(wand->images,radius,sigma,angle,bias,
6638 if (blur_image == (Image *) NULL)
6639 return(MagickFalse);
6640 ReplaceImageInList(&wand->images,blur_image);
6645 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6649 % M a g i c k N e g a t e I m a g e %
6653 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6655 % MagickNegateImage() negates the colors in the reference image. The
6656 % Grayscale option means that only grayscale values within the image are
6659 % You can also reduce the influence of a particular channel with a gamma
6662 % The format of the MagickNegateImage method is:
6664 % MagickBooleanType MagickNegateImage(MagickWand *wand,
6665 % const MagickBooleanType gray)
6667 % A description of each parameter follows:
6669 % o wand: the magick wand.
6671 % o gray: If MagickTrue, only negate grayscale pixels within the image.
6674 WandExport MagickBooleanType MagickNegateImage(MagickWand *wand,
6675 const MagickBooleanType gray)
6680 assert(wand != (MagickWand *) NULL);
6681 assert(wand->signature == WandSignature);
6682 if (wand->debug != MagickFalse)
6683 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6684 if (wand->images == (Image *) NULL)
6685 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6686 status=NegateImage(wand->images,gray,wand->exception);
6691 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6695 % M a g i c k N e w I m a g e %
6699 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6701 % MagickNewImage() adds a blank image canvas of the specified size and
6702 % background color to the wand.
6704 % The format of the MagickNewImage method is:
6706 % MagickBooleanType MagickNewImage(MagickWand *wand,
6707 % const size_t columns,const size_t rows,
6708 % const PixelWand *background)
6710 % A description of each parameter follows:
6712 % o wand: the magick wand.
6714 % o width: the image width.
6716 % o height: the image height.
6718 % o background: the image color.
6721 WandExport MagickBooleanType MagickNewImage(MagickWand *wand,const size_t width,
6722 const size_t height,const PixelWand *background)
6730 assert(wand != (MagickWand *) NULL);
6731 assert(wand->signature == WandSignature);
6732 if (wand->debug != MagickFalse)
6733 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6734 PixelGetMagickColor(background,&pixel);
6735 images=NewMagickImage(wand->image_info,width,height,&pixel,wand->exception);
6736 if (images == (Image *) NULL)
6737 return(MagickFalse);
6738 return(InsertImageInWand(wand,images));
6742 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6746 % M a g i c k N e x t I m a g e %
6750 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6752 % MagickNextImage() associates the next image in the image list with a magick
6753 % wand. It returns true if the it succeeds, meaning the current image is the
6754 % next image to be iterated over.
6756 % The format of the MagickNextImage method is:
6758 % MagickBooleanType MagickNextImage(MagickWand *wand)
6760 % A description of each parameter follows:
6762 % o wand: the magick wand.
6765 WandExport MagickBooleanType MagickNextImage(MagickWand *wand)
6767 assert(wand != (MagickWand *) NULL);
6768 assert(wand->signature == WandSignature);
6769 if (wand->debug != MagickFalse)
6770 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6771 if (wand->images == (Image *) NULL)
6772 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6773 /* If current image is 'pending' just return true. */
6774 if (wand->image_pending != MagickFalse)
6776 wand->image_pending=MagickFalse;
6779 /* If there is no next image, (Iterator is finished) */
6780 if (GetNextImageInList(wand->images) == (Image *) NULL)
6781 return(MagickFalse);
6782 /* just move to next image - current image is not 'pending' */
6783 wand->images=GetNextImageInList(wand->images);
6788 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6792 % M a g i c k N o r m a l i z e I m a g e %
6796 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6798 % MagickNormalizeImage() enhances the contrast of a color image by adjusting
6799 % the pixels color to span the entire range of colors available
6801 % You can also reduce the influence of a particular channel with a gamma
6804 % The format of the MagickNormalizeImage method is:
6806 % MagickBooleanType MagickNormalizeImage(MagickWand *wand)
6808 % A description of each parameter follows:
6810 % o wand: the magick wand.
6813 WandExport MagickBooleanType MagickNormalizeImage(MagickWand *wand)
6818 assert(wand != (MagickWand *) NULL);
6819 assert(wand->signature == WandSignature);
6820 if (wand->debug != MagickFalse)
6821 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6822 if (wand->images == (Image *) NULL)
6823 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6824 status=NormalizeImage(wand->images,&wand->images->exception);
6829 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6833 % M a g i c k O i l P a i n t I m a g e %
6837 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6839 % MagickOilPaintImage() applies a special effect filter that simulates an oil
6840 % painting. Each pixel is replaced by the most frequent color occurring
6841 % in a circular region defined by radius.
6843 % The format of the MagickOilPaintImage method is:
6845 % MagickBooleanType MagickOilPaintImage(MagickWand *wand,
6846 % const double radius,const double sigma)
6848 % A description of each parameter follows:
6850 % o wand: the magick wand.
6852 % o radius: the radius of the circular neighborhood.
6854 % o sigma: the standard deviation of the Gaussian, in pixels.
6857 WandExport MagickBooleanType MagickOilPaintImage(MagickWand *wand,
6858 const double radius,const double sigma)
6863 assert(wand != (MagickWand *) NULL);
6864 assert(wand->signature == WandSignature);
6865 if (wand->debug != MagickFalse)
6866 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6867 if (wand->images == (Image *) NULL)
6868 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6869 paint_image=OilPaintImage(wand->images,radius,sigma,wand->exception);
6870 if (paint_image == (Image *) NULL)
6871 return(MagickFalse);
6872 ReplaceImageInList(&wand->images,paint_image);
6877 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6881 % M a g i c k O p a q u e P a i n t I m a g e %
6885 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6887 % MagickOpaquePaintImage() changes any pixel that matches color with the color
6890 % The format of the MagickOpaquePaintImage method is:
6892 % MagickBooleanType MagickOpaquePaintImage(MagickWand *wand,
6893 % const PixelWand *target,const PixelWand *fill,const double fuzz,
6894 % const MagickBooleanType invert)
6896 % A description of each parameter follows:
6898 % o wand: the magick wand.
6900 % o target: Change this target color to the fill color within the image.
6902 % o fill: the fill pixel wand.
6904 % o fuzz: By default target must match a particular pixel color
6905 % exactly. However, in many cases two colors may differ by a small amount.
6906 % The fuzz member of image defines how much tolerance is acceptable to
6907 % consider two colors as the same. For example, set fuzz to 10 and the
6908 % color red at intensities of 100 and 102 respectively are now interpreted
6909 % as the same color for the purposes of the floodfill.
6911 % o invert: paint any pixel that does not match the target color.
6914 WandExport MagickBooleanType MagickOpaquePaintImage(MagickWand *wand,
6915 const PixelWand *target,const PixelWand *fill,const double fuzz,
6916 const MagickBooleanType invert)
6925 assert(wand != (MagickWand *) NULL);
6926 assert(wand->signature == WandSignature);
6927 if (wand->debug != MagickFalse)
6928 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6929 if (wand->images == (Image *) NULL)
6930 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6931 PixelGetMagickColor(target,&target_pixel);
6932 PixelGetMagickColor(fill,&fill_pixel);
6933 wand->images->fuzz=fuzz;
6934 status=OpaquePaintImage(wand->images,&target_pixel,&fill_pixel,invert,
6935 &wand->images->exception);
6940 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6944 % 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 %
6948 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6950 % MagickOptimizeImageLayers() compares each image the GIF disposed forms of the
6951 % previous image in the sequence. From this it attempts to select the
6952 % smallest cropped image to replace each frame, while preserving the results
6955 % The format of the MagickOptimizeImageLayers method is:
6957 % MagickWand *MagickOptimizeImageLayers(MagickWand *wand)
6959 % A description of each parameter follows:
6961 % o wand: the magick wand.
6964 WandExport MagickWand *MagickOptimizeImageLayers(MagickWand *wand)
6969 assert(wand != (MagickWand *) NULL);
6970 assert(wand->signature == WandSignature);
6971 if (wand->debug != MagickFalse)
6972 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6973 if (wand->images == (Image *) NULL)
6974 return((MagickWand *) NULL);
6975 optimize_image=OptimizeImageLayers(wand->images,wand->exception);
6976 if (optimize_image == (Image *) NULL)
6977 return((MagickWand *) NULL);
6978 return(CloneMagickWandFromImages(wand,optimize_image));
6982 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6986 % 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 %
6990 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6992 % MagickOrderedPosterizeImage() performs an ordered dither based on a number
6993 % of pre-defined dithering threshold maps, but over multiple intensity levels,
6994 % which can be different for different channels, according to the input
6997 % The format of the MagickOrderedPosterizeImage method is:
6999 % MagickBooleanType MagickOrderedPosterizeImage(MagickWand *wand,
7000 % const char *threshold_map)
7002 % A description of each parameter follows:
7004 % o image: the image.
7006 % o threshold_map: A string containing the name of the threshold dither
7007 % map to use, followed by zero or more numbers representing the number of
7008 % color levels tho dither between.
7010 % Any level number less than 2 is equivalent to 2, and means only binary
7011 % dithering will be applied to each color channel.
7013 % No numbers also means a 2 level (bitmap) dither will be applied to all
7014 % channels, while a single number is the number of levels applied to each
7015 % channel in sequence. More numbers will be applied in turn to each of
7016 % the color channels.
7018 % For example: "o3x3,6" generates a 6 level posterization of the image
7019 % with a ordered 3x3 diffused pixel dither being applied between each
7020 % level. While checker,8,8,4 will produce a 332 colormaped image with
7021 % only a single checkerboard hash pattern (50% grey) between each color
7022 % level, to basically double the number of color levels with a bare
7023 % minimim of dithering.
7026 WandExport MagickBooleanType MagickOrderedPosterizeImage(MagickWand *wand,
7027 const char *threshold_map)
7032 assert(wand != (MagickWand *) NULL);
7033 assert(wand->signature == WandSignature);
7034 if (wand->debug != MagickFalse)
7035 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7036 if (wand->images == (Image *) NULL)
7037 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7038 status=OrderedPosterizeImage(wand->images,threshold_map,wand->exception);
7043 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7047 % M a g i c k P i n g I m a g e %
7051 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7053 % MagickPingImage() is the same as MagickReadImage() except the only valid
7054 % information returned is the image width, height, size, and format. It
7055 % is designed to efficiently obtain this information from a file without
7056 % reading the entire image sequence into memory.
7058 % The format of the MagickPingImage method is:
7060 % MagickBooleanType MagickPingImage(MagickWand *wand,const char *filename)
7062 % A description of each parameter follows:
7064 % o wand: the magick wand.
7066 % o filename: the image filename.
7069 WandExport MagickBooleanType MagickPingImage(MagickWand *wand,
7070 const char *filename)
7078 assert(wand != (MagickWand *) NULL);
7079 assert(wand->signature == WandSignature);
7080 if (wand->debug != MagickFalse)
7081 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7082 ping_info=CloneImageInfo(wand->image_info);
7083 if (filename != (const char *) NULL)
7084 (void) CopyMagickString(ping_info->filename,filename,MaxTextExtent);
7085 images=PingImage(ping_info,wand->exception);
7086 ping_info=DestroyImageInfo(ping_info);
7087 if (images == (Image *) NULL)
7088 return(MagickFalse);
7089 return(InsertImageInWand(wand,images));
7093 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7097 % M a g i c k P i n g I m a g e B l o b %
7101 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7103 % MagickPingImageBlob() pings an image or image sequence from a blob.
7105 % The format of the MagickPingImageBlob method is:
7107 % MagickBooleanType MagickPingImageBlob(MagickWand *wand,
7108 % const void *blob,const size_t length)
7110 % A description of each parameter follows:
7112 % o wand: the magick wand.
7116 % o length: the blob length.
7119 WandExport MagickBooleanType MagickPingImageBlob(MagickWand *wand,
7120 const void *blob,const size_t length)
7128 assert(wand != (MagickWand *) NULL);
7129 assert(wand->signature == WandSignature);
7130 if (wand->debug != MagickFalse)
7131 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7132 read_info=CloneImageInfo(wand->image_info);
7133 SetImageInfoBlob(read_info,blob,length);
7134 images=PingImage(read_info,wand->exception);
7135 read_info=DestroyImageInfo(read_info);
7136 if (images == (Image *) NULL)
7137 return(MagickFalse);
7138 return(InsertImageInWand(wand,images));
7142 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7146 % M a g i c k P i n g I m a g e F i l e %
7150 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7152 % MagickPingImageFile() pings an image or image sequence from an open file
7155 % The format of the MagickPingImageFile method is:
7157 % MagickBooleanType MagickPingImageFile(MagickWand *wand,FILE *file)
7159 % A description of each parameter follows:
7161 % o wand: the magick wand.
7163 % o file: the file descriptor.
7166 WandExport MagickBooleanType MagickPingImageFile(MagickWand *wand,FILE *file)
7174 assert(wand != (MagickWand *) NULL);
7175 assert(wand->signature == WandSignature);
7176 assert(file != (FILE *) NULL);
7177 if (wand->debug != MagickFalse)
7178 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7179 read_info=CloneImageInfo(wand->image_info);
7180 SetImageInfoFile(read_info,file);
7181 images=PingImage(read_info,wand->exception);
7182 read_info=DestroyImageInfo(read_info);
7183 if (images == (Image *) NULL)
7184 return(MagickFalse);
7185 return(InsertImageInWand(wand,images));
7189 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7193 % M a g i c k P o l a r o i d I m a g e %
7197 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7199 % MagickPolaroidImage() simulates a Polaroid picture.
7201 % The format of the MagickPolaroidImage method is:
7203 % MagickBooleanType MagickPolaroidImage(MagickWand *wand,
7204 % const DrawingWand *drawing_wand,const double angle,
7205 % const PixelInterpolateMethod method)
7207 % A description of each parameter follows:
7209 % o wand: the magick wand.
7211 % o drawing_wand: the draw wand.
7213 % o angle: Apply the effect along this angle.
7215 % o method: the pixel interpolation method.
7218 WandExport MagickBooleanType MagickPolaroidImage(MagickWand *wand,
7219 const DrawingWand *drawing_wand,const double angle,
7220 const PixelInterpolateMethod method)
7228 assert(wand != (MagickWand *) NULL);
7229 assert(wand->signature == WandSignature);
7230 if (wand->debug != MagickFalse)
7231 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7232 if (wand->images == (Image *) NULL)
7233 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7234 draw_info=PeekDrawingWand(drawing_wand);
7235 if (draw_info == (DrawInfo *) NULL)
7236 return(MagickFalse);
7237 polaroid_image=PolaroidImage(wand->images,draw_info,angle,method,
7239 if (polaroid_image == (Image *) NULL)
7240 return(MagickFalse);
7241 ReplaceImageInList(&wand->images,polaroid_image);
7246 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7250 % M a g i c k P o s t e r i z e I m a g e %
7254 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7256 % MagickPosterizeImage() reduces the image to a limited number of color level.
7258 % The format of the MagickPosterizeImage method is:
7260 % MagickBooleanType MagickPosterizeImage(MagickWand *wand,
7261 % const unsigned levels,const MagickBooleanType dither)
7263 % A description of each parameter follows:
7265 % o wand: the magick wand.
7267 % o levels: Number of color levels allowed in each channel. Very low values
7268 % (2, 3, or 4) have the most visible effect.
7270 % o dither: Set this integer value to something other than zero to dither
7274 WandExport MagickBooleanType MagickPosterizeImage(MagickWand *wand,
7275 const size_t levels,const MagickBooleanType dither)
7280 assert(wand != (MagickWand *) NULL);
7281 assert(wand->signature == WandSignature);
7282 if (wand->debug != MagickFalse)
7283 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7284 if (wand->images == (Image *) NULL)
7285 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7286 status=PosterizeImage(wand->images,levels,dither,wand->exception);
7291 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7295 % M a g i c k P r e v i e w I m a g e s %
7299 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7301 % MagickPreviewImages() tiles 9 thumbnails of the specified image with an
7302 % image processing operation applied at varying strengths. This helpful
7303 % to quickly pin-point an appropriate parameter for an image processing
7306 % The format of the MagickPreviewImages method is:
7308 % MagickWand *MagickPreviewImages(MagickWand *wand,
7309 % const PreviewType preview)
7311 % A description of each parameter follows:
7313 % o wand: the magick wand.
7315 % o preview: the preview type.
7318 WandExport MagickWand *MagickPreviewImages(MagickWand *wand,
7319 const PreviewType preview)
7324 assert(wand != (MagickWand *) NULL);
7325 assert(wand->signature == WandSignature);
7326 if (wand->debug != MagickFalse)
7327 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7328 if (wand->images == (Image *) NULL)
7329 return((MagickWand *) NULL);
7330 preview_image=PreviewImage(wand->images,preview,wand->exception);
7331 if (preview_image == (Image *) NULL)
7332 return((MagickWand *) NULL);
7333 return(CloneMagickWandFromImages(wand,preview_image));
7337 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7341 % M a g i c k P r e v i o u s I m a g e %
7345 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7347 % MagickPreviousImage() assocates the previous image in an image list with
7350 % The format of the MagickPreviousImage method is:
7352 % MagickBooleanType MagickPreviousImage(MagickWand *wand)
7354 % A description of each parameter follows:
7356 % o wand: the magick wand.
7359 WandExport MagickBooleanType MagickPreviousImage(MagickWand *wand)
7361 assert(wand != (MagickWand *) NULL);
7362 assert(wand->signature == WandSignature);
7363 if (wand->debug != MagickFalse)
7364 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7365 if (wand->images == (Image *) NULL)
7366 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7368 wand->image_pending=MagickFalse; /* pending status has no meaning */
7369 /* If there is no prev image, return false (Iterator is finished) */
7370 if (GetPreviousImageInList(wand->images) == (Image *) NULL)
7371 return(MagickFalse);
7372 /* just do it - current image is not 'pending' */
7373 wand->images=GetPreviousImageInList(wand->images);
7378 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7382 % M a g i c k Q u a n t i z e I m a g e %
7386 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7388 % MagickQuantizeImage() analyzes the colors within a reference image and
7389 % chooses a fixed number of colors to represent the image. The goal of the
7390 % algorithm is to minimize the color difference between the input and output
7391 % image while minimizing the processing time.
7393 % The format of the MagickQuantizeImage method is:
7395 % MagickBooleanType MagickQuantizeImage(MagickWand *wand,
7396 % const size_t number_colors,const ColorspaceType colorspace,
7397 % const size_t treedepth,const MagickBooleanType dither,
7398 % const MagickBooleanType measure_error)
7400 % A description of each parameter follows:
7402 % o wand: the magick wand.
7404 % o number_colors: the number of colors.
7406 % o colorspace: Perform color reduction in this colorspace, typically
7409 % o treedepth: Normally, this integer value is zero or one. A zero or
7410 % 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
7411 % reference image with the least amount of memory and the fastest
7412 % computational speed. In some cases, such as an image with low color
7413 % dispersion (a few number of colors), a value other than
7414 % Log4(number_colors) is required. To expand the color tree completely,
7417 % o dither: A value other than zero distributes the difference between an
7418 % original image and the corresponding color reduced image to
7419 % neighboring pixels along a Hilbert curve.
7421 % o measure_error: A value other than zero measures the difference between
7422 % the original and quantized images. This difference is the total
7423 % quantization error. The error is computed by summing over all pixels
7424 % in an image the distance squared in RGB space between each reference
7425 % pixel value and its quantized value.
7428 WandExport MagickBooleanType MagickQuantizeImage(MagickWand *wand,
7429 const size_t number_colors,const ColorspaceType colorspace,
7430 const size_t treedepth,const MagickBooleanType dither,
7431 const MagickBooleanType measure_error)
7439 assert(wand != (MagickWand *) NULL);
7440 assert(wand->signature == WandSignature);
7441 if (wand->debug != MagickFalse)
7442 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7443 if (wand->images == (Image *) NULL)
7444 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7445 quantize_info=CloneQuantizeInfo((QuantizeInfo *) NULL);
7446 quantize_info->number_colors=number_colors;
7447 quantize_info->dither=dither;
7448 quantize_info->tree_depth=treedepth;
7449 quantize_info->colorspace=colorspace;
7450 quantize_info->measure_error=measure_error;
7451 status=QuantizeImage(quantize_info,wand->images,wand->exception);
7452 quantize_info=DestroyQuantizeInfo(quantize_info);
7457 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7461 % M a g i c k Q u a n t i z e I m a g e s %
7465 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7467 % MagickQuantizeImages() analyzes the colors within a sequence of images and
7468 % chooses a fixed number of colors to represent the image. The goal of the
7469 % algorithm is to minimize the color difference between the input and output
7470 % image while minimizing the processing time.
7472 % The format of the MagickQuantizeImages method is:
7474 % MagickBooleanType MagickQuantizeImages(MagickWand *wand,
7475 % const size_t number_colors,const ColorspaceType colorspace,
7476 % const size_t treedepth,const MagickBooleanType dither,
7477 % const MagickBooleanType measure_error)
7479 % A description of each parameter follows:
7481 % o wand: the magick wand.
7483 % o number_colors: the number of colors.
7485 % o colorspace: Perform color reduction in this colorspace, typically
7488 % o treedepth: Normally, this integer value is zero or one. A zero or
7489 % 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
7490 % reference image with the least amount of memory and the fastest
7491 % computational speed. In some cases, such as an image with low color
7492 % dispersion (a few number of colors), a value other than
7493 % Log4(number_colors) is required. To expand the color tree completely,
7496 % o dither: A value other than zero distributes the difference between an
7497 % original image and the corresponding color reduced algorithm to
7498 % neighboring pixels along a Hilbert curve.
7500 % o measure_error: A value other than zero measures the difference between
7501 % the original and quantized images. This difference is the total
7502 % quantization error. The error is computed by summing over all pixels
7503 % in an image the distance squared in RGB space between each reference
7504 % pixel value and its quantized value.
7507 WandExport MagickBooleanType MagickQuantizeImages(MagickWand *wand,
7508 const size_t number_colors,const ColorspaceType colorspace,
7509 const size_t treedepth,const MagickBooleanType dither,
7510 const MagickBooleanType measure_error)
7518 assert(wand != (MagickWand *) NULL);
7519 assert(wand->signature == WandSignature);
7520 if (wand->debug != MagickFalse)
7521 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7522 if (wand->images == (Image *) NULL)
7523 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7524 quantize_info=CloneQuantizeInfo((QuantizeInfo *) NULL);
7525 quantize_info->number_colors=number_colors;
7526 quantize_info->dither=dither;
7527 quantize_info->tree_depth=treedepth;
7528 quantize_info->colorspace=colorspace;
7529 quantize_info->measure_error=measure_error;
7530 status=QuantizeImages(quantize_info,wand->images,wand->exception);
7531 quantize_info=DestroyQuantizeInfo(quantize_info);
7536 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7540 % M a g i c k R a d i a l B l u r I m a g e %
7544 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7546 % MagickRadialBlurImage() radial blurs an image.
7548 % The format of the MagickRadialBlurImage method is:
7550 % MagickBooleanType MagickRadialBlurImage(MagickWand *wand,
7551 % const double angle,const double bias)
7553 % A description of each parameter follows:
7555 % o wand: the magick wand.
7557 % o angle: the angle of the blur in degrees.
7562 WandExport MagickBooleanType MagickRadialBlurImage(MagickWand *wand,
7563 const double angle,const double bias)
7568 assert(wand != (MagickWand *) NULL);
7569 assert(wand->signature == WandSignature);
7570 if (wand->debug != MagickFalse)
7571 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7572 if (wand->images == (Image *) NULL)
7573 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7574 blur_image=RadialBlurImage(wand->images,angle,bias,wand->exception);
7575 if (blur_image == (Image *) NULL)
7576 return(MagickFalse);
7577 ReplaceImageInList(&wand->images,blur_image);
7582 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7586 % M a g i c k R a i s e I m a g e %
7590 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7592 % MagickRaiseImage() creates a simulated three-dimensional button-like effect
7593 % by lightening and darkening the edges of the image. Members width and
7594 % height of raise_info define the width of the vertical and horizontal
7595 % edge of the effect.
7597 % The format of the MagickRaiseImage method is:
7599 % MagickBooleanType MagickRaiseImage(MagickWand *wand,
7600 % const size_t width,const size_t height,const ssize_t x,
7601 % const ssize_t y,const MagickBooleanType raise)
7603 % A description of each parameter follows:
7605 % o wand: the magick wand.
7607 % o width,height,x,y: Define the dimensions of the area to raise.
7609 % o raise: A value other than zero creates a 3-D raise effect,
7610 % otherwise it has a lowered effect.
7613 WandExport MagickBooleanType MagickRaiseImage(MagickWand *wand,
7614 const size_t width,const size_t height,const ssize_t x,
7615 const ssize_t y,const MagickBooleanType raise)
7623 assert(wand != (MagickWand *) NULL);
7624 assert(wand->signature == WandSignature);
7625 if (wand->debug != MagickFalse)
7626 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7627 if (wand->images == (Image *) NULL)
7628 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7629 raise_info.width=width;
7630 raise_info.height=height;
7633 status=RaiseImage(wand->images,&raise_info,raise,&wand->images->exception);
7638 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7642 % 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 %
7646 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7648 % MagickRandomThresholdImage() changes the value of individual pixels based on
7649 % the intensity of each pixel compared to threshold. The result is a
7650 % high-contrast, two color image.
7652 % The format of the MagickRandomThresholdImage method is:
7654 % MagickBooleanType MagickRandomThresholdImage(MagickWand *wand,
7655 % const double low,const double high)
7657 % A description of each parameter follows:
7659 % o wand: the magick wand.
7661 % o low,high: Specify the high and low thresholds. These values range from
7662 % 0 to QuantumRange.
7665 WandExport MagickBooleanType MagickRandomThresholdImage(MagickWand *wand,
7666 const double low,const double high)
7669 threshold[MaxTextExtent];
7671 assert(wand != (MagickWand *) NULL);
7672 assert(wand->signature == WandSignature);
7673 if (wand->debug != MagickFalse)
7674 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7675 if (wand->images == (Image *) NULL)
7676 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7677 (void) FormatLocaleString(threshold,MaxTextExtent,"%gx%g",low,high);
7678 return(RandomThresholdImage(wand->images,threshold,wand->exception));
7682 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7686 % M a g i c k R e a d I m a g e %
7690 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7692 % MagickReadImage() reads an image or image sequence. The images are inserted
7693 % at the current image pointer position.
7695 % Use MagickSetFirstIterator(), to insert new images before all the current
7696 % images in the wand, MagickSetLastIterator() to append add to the end,
7697 % MagickSetImageIndex() to place images just after the given index.
7699 % The format of the MagickReadImage method is:
7701 % MagickBooleanType MagickReadImage(MagickWand *wand,const char *filename)
7703 % A description of each parameter follows:
7705 % o wand: the magick wand.
7707 % o filename: the image filename.
7710 WandExport MagickBooleanType MagickReadImage(MagickWand *wand,
7711 const char *filename)
7719 assert(wand != (MagickWand *) NULL);
7720 assert(wand->signature == WandSignature);
7721 if (wand->debug != MagickFalse)
7722 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7723 read_info=CloneImageInfo(wand->image_info);
7724 if (filename != (const char *) NULL)
7725 (void) CopyMagickString(read_info->filename,filename,MaxTextExtent);
7726 images=ReadImage(read_info,wand->exception);
7727 read_info=DestroyImageInfo(read_info);
7728 if (images == (Image *) NULL)
7729 return(MagickFalse);
7730 return(InsertImageInWand(wand,images));
7734 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7738 % M a g i c k R e a d I m a g e B l o b %
7742 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7744 % MagickReadImageBlob() reads an image or image sequence from a blob.
7745 % In all other respects it is like MagickReadImage().
7747 % The format of the MagickReadImageBlob method is:
7749 % MagickBooleanType MagickReadImageBlob(MagickWand *wand,
7750 % const void *blob,const size_t length)
7752 % A description of each parameter follows:
7754 % o wand: the magick wand.
7758 % o length: the blob length.
7761 WandExport MagickBooleanType MagickReadImageBlob(MagickWand *wand,
7762 const void *blob,const size_t length)
7767 assert(wand != (MagickWand *) NULL);
7768 assert(wand->signature == WandSignature);
7769 if (wand->debug != MagickFalse)
7770 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7771 images=BlobToImage(wand->image_info,blob,length,wand->exception);
7772 if (images == (Image *) NULL)
7773 return(MagickFalse);
7774 return(InsertImageInWand(wand,images));
7778 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7782 % M a g i c k R e a d I m a g e F i l e %
7786 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7788 % MagickReadImageFile() reads an image or image sequence from an already
7789 % opened file descriptor. Otherwise it is like MagickReadImage().
7791 % The format of the MagickReadImageFile method is:
7793 % MagickBooleanType MagickReadImageFile(MagickWand *wand,FILE *file)
7795 % A description of each parameter follows:
7797 % o wand: the magick wand.
7799 % o file: the file descriptor.
7802 WandExport MagickBooleanType MagickReadImageFile(MagickWand *wand,FILE *file)
7810 assert(wand != (MagickWand *) NULL);
7811 assert(wand->signature == WandSignature);
7812 assert(file != (FILE *) NULL);
7813 if (wand->debug != MagickFalse)
7814 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7815 read_info=CloneImageInfo(wand->image_info);
7816 SetImageInfoFile(read_info,file);
7817 images=ReadImage(read_info,wand->exception);
7818 read_info=DestroyImageInfo(read_info);
7819 if (images == (Image *) NULL)
7820 return(MagickFalse);
7821 return(InsertImageInWand(wand,images));
7825 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7829 % M a g i c k R e m a p I m a g e %
7833 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7835 % MagickRemapImage() replaces the colors of an image with the closest color
7836 % from a reference image.
7838 % The format of the MagickRemapImage method is:
7840 % MagickBooleanType MagickRemapImage(MagickWand *wand,
7841 % const MagickWand *remap_wand,const DitherMethod method)
7843 % A description of each parameter follows:
7845 % o wand: the magick wand.
7847 % o affinity: the affinity wand.
7849 % o method: choose from these dither methods: NoDitherMethod,
7850 % RiemersmaDitherMethod, or FloydSteinbergDitherMethod.
7853 WandExport MagickBooleanType MagickRemapImage(MagickWand *wand,
7854 const MagickWand *remap_wand,const DitherMethod method)
7862 assert(wand != (MagickWand *) NULL);
7863 assert(wand->signature == WandSignature);
7864 if (wand->debug != MagickFalse)
7865 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7866 if ((wand->images == (Image *) NULL) ||
7867 (remap_wand->images == (Image *) NULL))
7868 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7869 quantize_info=AcquireQuantizeInfo(wand->image_info);
7870 quantize_info->dither_method=method;
7871 if (method == NoDitherMethod)
7872 quantize_info->dither=MagickFalse;
7873 status=RemapImage(quantize_info,wand->images,remap_wand->images,
7875 quantize_info=DestroyQuantizeInfo(quantize_info);
7880 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7884 % M a g i c k R e m o v e I m a g e %
7888 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7890 % MagickRemoveImage() removes an image from the image list.
7892 % The format of the MagickRemoveImage method is:
7894 % MagickBooleanType MagickRemoveImage(MagickWand *wand)
7896 % A description of each parameter follows:
7898 % o wand: the magick wand.
7900 % o insert: the splice wand.
7903 WandExport MagickBooleanType MagickRemoveImage(MagickWand *wand)
7905 assert(wand != (MagickWand *) NULL);
7906 assert(wand->signature == WandSignature);
7907 if (wand->debug != MagickFalse)
7908 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7909 if (wand->images == (Image *) NULL)
7910 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7911 DeleteImageFromList(&wand->images);
7916 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7920 % M a g i c k R e s a m p l e I m a g e %
7924 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7926 % MagickResampleImage() resample image to desired resolution.
7928 % Bessel Blackman Box
7929 % Catrom Cubic Gaussian
7930 % Hanning Hermite Lanczos
7931 % Mitchell Point Quandratic
7934 % Most of the filters are FIR (finite impulse response), however, Bessel,
7935 % Gaussian, and Sinc are IIR (infinite impulse response). Bessel and Sinc
7936 % are windowed (brought down to zero) with the Blackman filter.
7938 % The format of the MagickResampleImage method is:
7940 % MagickBooleanType MagickResampleImage(MagickWand *wand,
7941 % const double x_resolution,const double y_resolution,
7942 % const FilterTypes filter,const double blur)
7944 % A description of each parameter follows:
7946 % o wand: the magick wand.
7948 % o x_resolution: the new image x resolution.
7950 % o y_resolution: the new image y resolution.
7952 % o filter: Image filter to use.
7954 % o blur: the blur factor where > 1 is blurry, < 1 is sharp.
7957 WandExport MagickBooleanType MagickResampleImage(MagickWand *wand,
7958 const double x_resolution,const double y_resolution,const FilterTypes filter,
7964 assert(wand != (MagickWand *) NULL);
7965 assert(wand->signature == WandSignature);
7966 if (wand->debug != MagickFalse)
7967 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7968 if (wand->images == (Image *) NULL)
7969 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7970 resample_image=ResampleImage(wand->images,x_resolution,y_resolution,filter,
7971 blur,wand->exception);
7972 if (resample_image == (Image *) NULL)
7973 return(MagickFalse);
7974 ReplaceImageInList(&wand->images,resample_image);
7979 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7983 % M a g i c k R e s e t I m a g e P a g e %
7987 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7989 % MagickResetImagePage() resets the Wand page canvas and position.
7991 % The format of the MagickResetImagePage method is:
7993 % MagickBooleanType MagickResetImagePage(MagickWand *wand,
7996 % A description of each parameter follows:
7998 % o wand: the magick wand.
8000 % o page: the relative page specification.
8003 WandExport MagickBooleanType MagickResetImagePage(MagickWand *wand,
8006 assert(wand != (MagickWand *) NULL);
8007 assert(wand->signature == WandSignature);
8008 if (wand->debug != MagickFalse)
8009 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8010 if (wand->images == (Image *) NULL)
8011 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8012 if ((page == (char *) NULL) || (*page == '\0'))
8014 (void) ParseAbsoluteGeometry("0x0+0+0",&wand->images->page);
8017 return(ResetImagePage(wand->images,page));
8021 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8025 % M a g i c k R e s i z e I m a g e %
8029 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8031 % MagickResizeImage() scales an image to the desired dimensions with one of
8034 % Bessel Blackman Box
8035 % Catrom Cubic Gaussian
8036 % Hanning Hermite Lanczos
8037 % Mitchell Point Quandratic
8040 % Most of the filters are FIR (finite impulse response), however, Bessel,
8041 % Gaussian, and Sinc are IIR (infinite impulse response). Bessel and Sinc
8042 % are windowed (brought down to zero) with the Blackman filter.
8044 % The format of the MagickResizeImage method is:
8046 % MagickBooleanType MagickResizeImage(MagickWand *wand,
8047 % const size_t columns,const size_t rows,
8048 % const FilterTypes filter,const double blur)
8050 % A description of each parameter follows:
8052 % o wand: the magick wand.
8054 % o columns: the number of columns in the scaled image.
8056 % o rows: the number of rows in the scaled image.
8058 % o filter: Image filter to use.
8060 % o blur: the blur factor where > 1 is blurry, < 1 is sharp.
8063 WandExport MagickBooleanType MagickResizeImage(MagickWand *wand,
8064 const size_t columns,const size_t rows,const FilterTypes filter,
8070 assert(wand != (MagickWand *) NULL);
8071 assert(wand->signature == WandSignature);
8072 if (wand->debug != MagickFalse)
8073 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8074 if (wand->images == (Image *) NULL)
8075 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8076 resize_image=ResizeImage(wand->images,columns,rows,filter,blur,
8078 if (resize_image == (Image *) NULL)
8079 return(MagickFalse);
8080 ReplaceImageInList(&wand->images,resize_image);
8085 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8089 % M a g i c k R o l l I m a g e %
8093 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8095 % MagickRollImage() offsets an image as defined by x and y.
8097 % The format of the MagickRollImage method is:
8099 % MagickBooleanType MagickRollImage(MagickWand *wand,const ssize_t x,
8102 % A description of each parameter follows:
8104 % o wand: the magick wand.
8106 % o x: the x offset.
8108 % o y: the y offset.
8112 WandExport MagickBooleanType MagickRollImage(MagickWand *wand,
8113 const ssize_t x,const ssize_t y)
8118 assert(wand != (MagickWand *) NULL);
8119 assert(wand->signature == WandSignature);
8120 if (wand->debug != MagickFalse)
8121 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8122 if (wand->images == (Image *) NULL)
8123 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8124 roll_image=RollImage(wand->images,x,y,wand->exception);
8125 if (roll_image == (Image *) NULL)
8126 return(MagickFalse);
8127 ReplaceImageInList(&wand->images,roll_image);
8132 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8136 % M a g i c k R o t a t e I m a g e %
8140 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8142 % MagickRotateImage() rotates an image the specified number of degrees. Empty
8143 % triangles left over from rotating the image are filled with the
8146 % The format of the MagickRotateImage method is:
8148 % MagickBooleanType MagickRotateImage(MagickWand *wand,
8149 % const PixelWand *background,const double degrees)
8151 % A description of each parameter follows:
8153 % o wand: the magick wand.
8155 % o background: the background pixel wand.
8157 % o degrees: the number of degrees to rotate the image.
8161 WandExport MagickBooleanType MagickRotateImage(MagickWand *wand,
8162 const PixelWand *background,const double degrees)
8167 assert(wand != (MagickWand *) NULL);
8168 assert(wand->signature == WandSignature);
8169 if (wand->debug != MagickFalse)
8170 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8171 if (wand->images == (Image *) NULL)
8172 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8173 PixelGetQuantumPacket(background,&wand->images->background_color);
8174 rotate_image=RotateImage(wand->images,degrees,wand->exception);
8175 if (rotate_image == (Image *) NULL)
8176 return(MagickFalse);
8177 ReplaceImageInList(&wand->images,rotate_image);
8182 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8186 % M a g i c k S a m p l e I m a g e %
8190 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8192 % MagickSampleImage() scales an image to the desired dimensions with pixel
8193 % sampling. Unlike other scaling methods, this method does not introduce
8194 % any additional color into the scaled image.
8196 % The format of the MagickSampleImage method is:
8198 % MagickBooleanType MagickSampleImage(MagickWand *wand,
8199 % const size_t columns,const size_t rows)
8201 % A description of each parameter follows:
8203 % o wand: the magick wand.
8205 % o columns: the number of columns in the scaled image.
8207 % o rows: the number of rows in the scaled image.
8211 WandExport MagickBooleanType MagickSampleImage(MagickWand *wand,
8212 const size_t columns,const size_t rows)
8217 assert(wand != (MagickWand *) NULL);
8218 assert(wand->signature == WandSignature);
8219 if (wand->debug != MagickFalse)
8220 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8221 if (wand->images == (Image *) NULL)
8222 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8223 sample_image=SampleImage(wand->images,columns,rows,wand->exception);
8224 if (sample_image == (Image *) NULL)
8225 return(MagickFalse);
8226 ReplaceImageInList(&wand->images,sample_image);
8231 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8235 % M a g i c k S c a l e I m a g e %
8239 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8241 % MagickScaleImage() scales the size of an image to the given dimensions.
8243 % The format of the MagickScaleImage method is:
8245 % MagickBooleanType MagickScaleImage(MagickWand *wand,
8246 % const size_t columns,const size_t rows)
8248 % A description of each parameter follows:
8250 % o wand: the magick wand.
8252 % o columns: the number of columns in the scaled image.
8254 % o rows: the number of rows in the scaled image.
8258 WandExport MagickBooleanType MagickScaleImage(MagickWand *wand,
8259 const size_t columns,const size_t rows)
8264 assert(wand != (MagickWand *) NULL);
8265 assert(wand->signature == WandSignature);
8266 if (wand->debug != MagickFalse)
8267 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8268 if (wand->images == (Image *) NULL)
8269 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8270 scale_image=ScaleImage(wand->images,columns,rows,wand->exception);
8271 if (scale_image == (Image *) NULL)
8272 return(MagickFalse);
8273 ReplaceImageInList(&wand->images,scale_image);
8278 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8282 % M a g i c k S e g m e n t I m a g e %
8286 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8288 % MagickSegmentImage() segments an image by analyzing the histograms of the
8289 % color components and identifying units that are homogeneous with the fuzzy
8290 % C-means technique.
8292 % The format of the SegmentImage method is:
8294 % MagickBooleanType MagickSegmentImage(MagickWand *wand,
8295 % const ColorspaceType colorspace,const MagickBooleanType verbose,
8296 % const double cluster_threshold,const double smooth_threshold)
8298 % A description of each parameter follows.
8302 % o colorspace: the image colorspace.
8304 % o verbose: Set to MagickTrue to print detailed information about the
8305 % identified classes.
8307 % o cluster_threshold: This represents the minimum number of pixels
8308 % contained in a hexahedra before it can be considered valid (expressed as
8311 % o smooth_threshold: the smoothing threshold eliminates noise in the second
8312 % derivative of the histogram. As the value is increased, you can expect a
8313 % smoother second derivative.
8316 MagickExport MagickBooleanType MagickSegmentImage(MagickWand *wand,
8317 const ColorspaceType colorspace,const MagickBooleanType verbose,
8318 const double cluster_threshold,const double smooth_threshold)
8323 assert(wand != (MagickWand *) NULL);
8324 assert(wand->signature == WandSignature);
8325 if (wand->debug != MagickFalse)
8326 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8327 if (wand->images == (Image *) NULL)
8328 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8329 status=SegmentImage(wand->images,colorspace,verbose,cluster_threshold,
8330 smooth_threshold,wand->exception);
8335 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8339 % M a g i c k S e l e c t i v e B l u r I m a g e %
8343 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8345 % MagickSelectiveBlurImage() selectively blur an image within a contrast
8346 % threshold. It is similar to the unsharpen mask that sharpens everything with
8347 % contrast above a certain threshold.
8349 % The format of the MagickSelectiveBlurImage method is:
8351 % MagickBooleanType MagickSelectiveBlurImage(MagickWand *wand,
8352 % const double radius,const double sigma,const double threshold,
8353 % const double bias)
8355 % A description of each parameter follows:
8357 % o wand: the magick wand.
8359 % o radius: the radius of the gaussian, in pixels, not counting the center
8362 % o sigma: the standard deviation of the gaussian, in pixels.
8364 % o threshold: only pixels within this contrast threshold are included
8365 % in the blur operation.
8370 WandExport MagickBooleanType MagickSelectiveBlurImage(MagickWand *wand,
8371 const double radius,const double sigma,const double threshold,
8377 assert(wand != (MagickWand *) NULL);
8378 assert(wand->signature == WandSignature);
8379 if (wand->debug != MagickFalse)
8380 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8381 if (wand->images == (Image *) NULL)
8382 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8383 blur_image=SelectiveBlurImage(wand->images,radius,sigma,threshold,bias,
8385 if (blur_image == (Image *) NULL)
8386 return(MagickFalse);
8387 ReplaceImageInList(&wand->images,blur_image);
8392 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8396 % 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 %
8400 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8402 % MagickSeparateImage() separates a channel from the image and returns a
8403 % grayscale image. A channel is a particular color component of each pixel
8406 % The format of the MagickSeparateImage method is:
8408 % MagickBooleanType MagickSeparateImage(MagickWand *wand)
8410 % A description of each parameter follows:
8412 % o wand: the magick wand.
8415 WandExport MagickBooleanType MagickSeparateImage(MagickWand *wand)
8417 assert(wand != (MagickWand *) NULL);
8418 assert(wand->signature == WandSignature);
8419 if (wand->debug != MagickFalse)
8420 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8421 if (wand->images == (Image *) NULL)
8422 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8423 return(SeparateImage(wand->images,wand->exception));
8427 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8431 % M a g i c k S e p i a T o n e I m a g e %
8435 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8437 % MagickSepiaToneImage() applies a special effect to the image, similar to the
8438 % effect achieved in a photo darkroom by sepia toning. Threshold ranges from
8439 % 0 to QuantumRange and is a measure of the extent of the sepia toning. A
8440 % threshold of 80% is a good starting point for a reasonable tone.
8442 % The format of the MagickSepiaToneImage method is:
8444 % MagickBooleanType MagickSepiaToneImage(MagickWand *wand,
8445 % const double threshold)
8447 % A description of each parameter follows:
8449 % o wand: the magick wand.
8451 % o threshold: Define the extent of the sepia toning.
8454 WandExport MagickBooleanType MagickSepiaToneImage(MagickWand *wand,
8455 const double threshold)
8460 assert(wand != (MagickWand *) NULL);
8461 assert(wand->signature == WandSignature);
8462 if (wand->debug != MagickFalse)
8463 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8464 if (wand->images == (Image *) NULL)
8465 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8466 sepia_image=SepiaToneImage(wand->images,threshold,wand->exception);
8467 if (sepia_image == (Image *) NULL)
8468 return(MagickFalse);
8469 ReplaceImageInList(&wand->images,sepia_image);
8474 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8478 % M a g i c k S e t I m a g e %
8482 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8484 % MagickSetImage() replaces the last image returned by MagickSetImageIndex(),
8485 % MagickNextImage(), MagickPreviousImage() with the images from the specified
8488 % The format of the MagickSetImage method is:
8490 % MagickBooleanType MagickSetImage(MagickWand *wand,
8491 % const MagickWand *set_wand)
8493 % A description of each parameter follows:
8495 % o wand: the magick wand.
8497 % o set_wand: the set_wand wand.
8500 WandExport MagickBooleanType MagickSetImage(MagickWand *wand,
8501 const MagickWand *set_wand)
8506 assert(wand != (MagickWand *) NULL);
8507 assert(wand->signature == WandSignature);
8508 if (wand->debug != MagickFalse)
8509 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8510 assert(set_wand != (MagickWand *) NULL);
8511 assert(set_wand->signature == WandSignature);
8512 if (wand->debug != MagickFalse)
8513 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",set_wand->name);
8514 if (set_wand->images == (Image *) NULL)
8515 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8516 images=CloneImageList(set_wand->images,wand->exception);
8517 if (images == (Image *) NULL)
8518 return(MagickFalse);
8519 ReplaceImageInList(&wand->images,images);
8524 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8528 % 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 %
8532 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8534 % MagickSetImageAlphaChannel() activates, deactivates, resets, or sets the
8537 % The format of the MagickSetImageAlphaChannel method is:
8539 % MagickBooleanType MagickSetImageAlphaChannel(MagickWand *wand,
8540 % const AlphaChannelType alpha_type)
8542 % A description of each parameter follows:
8544 % o wand: the magick wand.
8546 % o alpha_type: the alpha channel type: ActivateAlphaChannel,
8547 % DeactivateAlphaChannel, OpaqueAlphaChannel, or SetAlphaChannel.
8550 WandExport MagickBooleanType MagickSetImageAlphaChannel(MagickWand *wand,
8551 const AlphaChannelType alpha_type)
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 return(SetImageAlphaChannel(wand->images,alpha_type,&wand->images->exception));
8563 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8567 % 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 %
8571 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8573 % MagickSetImageBackgroundColor() sets the image background color.
8575 % The format of the MagickSetImageBackgroundColor method is:
8577 % MagickBooleanType MagickSetImageBackgroundColor(MagickWand *wand,
8578 % const PixelWand *background)
8580 % A description of each parameter follows:
8582 % o wand: the magick wand.
8584 % o background: the background pixel wand.
8587 WandExport MagickBooleanType MagickSetImageBackgroundColor(MagickWand *wand,
8588 const PixelWand *background)
8590 assert(wand != (MagickWand *) NULL);
8591 assert(wand->signature == WandSignature);
8592 if (wand->debug != MagickFalse)
8593 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8594 if (wand->images == (Image *) NULL)
8595 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8596 PixelGetQuantumPacket(background,&wand->images->background_color);
8601 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8605 % M a g i c k S e t I m a g e B i a s %
8609 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8611 % MagickSetImageBias() sets the image bias for any method that convolves an
8612 % image (e.g. MagickConvolveImage()).
8614 % The format of the MagickSetImageBias method is:
8616 % MagickBooleanType MagickSetImageBias(MagickWand *wand,
8617 % const double bias)
8619 % A description of each parameter follows:
8621 % o wand: the magick wand.
8623 % o bias: the image bias.
8626 WandExport MagickBooleanType MagickSetImageBias(MagickWand *wand,
8629 assert(wand != (MagickWand *) NULL);
8630 assert(wand->signature == WandSignature);
8631 if (wand->debug != MagickFalse)
8632 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8633 if (wand->images == (Image *) NULL)
8634 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8635 wand->images->bias=bias;
8640 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8644 % 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 %
8648 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8650 % MagickSetImageBluePrimary() sets the image chromaticity blue primary point.
8652 % The format of the MagickSetImageBluePrimary method is:
8654 % MagickBooleanType MagickSetImageBluePrimary(MagickWand *wand,
8655 % const double x,const double y)
8657 % A description of each parameter follows:
8659 % o wand: the magick wand.
8661 % o x: the blue primary x-point.
8663 % o y: the blue primary y-point.
8666 WandExport MagickBooleanType MagickSetImageBluePrimary(MagickWand *wand,
8667 const double x,const double y)
8669 assert(wand != (MagickWand *) NULL);
8670 assert(wand->signature == WandSignature);
8671 if (wand->debug != MagickFalse)
8672 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8673 if (wand->images == (Image *) NULL)
8674 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8675 wand->images->chromaticity.blue_primary.x=x;
8676 wand->images->chromaticity.blue_primary.y=y;
8681 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8685 % 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 %
8689 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8691 % MagickSetImageBorderColor() sets the image border color.
8693 % The format of the MagickSetImageBorderColor method is:
8695 % MagickBooleanType MagickSetImageBorderColor(MagickWand *wand,
8696 % const PixelWand *border)
8698 % A description of each parameter follows:
8700 % o wand: the magick wand.
8702 % o border: the border pixel wand.
8705 WandExport MagickBooleanType MagickSetImageBorderColor(MagickWand *wand,
8706 const PixelWand *border)
8708 assert(wand != (MagickWand *) NULL);
8709 assert(wand->signature == WandSignature);
8710 if (wand->debug != MagickFalse)
8711 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8712 if (wand->images == (Image *) NULL)
8713 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8714 PixelGetQuantumPacket(border,&wand->images->border_color);
8719 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8723 % M a g i c k S e t I m a g e C l i p M a s k %
8727 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8729 % MagickSetImageClipMask() sets image clip mask.
8731 % The format of the MagickSetImageClipMask method is:
8733 % MagickBooleanType MagickSetImageClipMask(MagickWand *wand,
8734 % const MagickWand *clip_mask)
8736 % A description of each parameter follows:
8738 % o wand: the magick wand.
8740 % o clip_mask: the clip_mask wand.
8743 WandExport MagickBooleanType MagickSetImageClipMask(MagickWand *wand,
8744 const MagickWand *clip_mask)
8746 assert(wand != (MagickWand *) NULL);
8747 assert(wand->signature == WandSignature);
8748 if (wand->debug != MagickFalse)
8749 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8750 assert(clip_mask != (MagickWand *) NULL);
8751 assert(clip_mask->signature == WandSignature);
8752 if (wand->debug != MagickFalse)
8753 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",clip_mask->name);
8754 if (clip_mask->images == (Image *) NULL)
8755 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8756 return(SetImageClipMask(wand->images,clip_mask->images,wand->exception));
8760 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8764 % M a g i c k S e t I m a g e C o l o r %
8768 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8770 % MagickSetImageColor() set the entire wand canvas to the specified color.
8772 % The format of the MagickSetImageColor method is:
8774 % MagickBooleanType MagickSetImageColor(MagickWand *wand,
8775 % const PixelWand *color)
8777 % A description of each parameter follows:
8779 % o wand: the magick wand.
8781 % o background: the image color.
8784 WandExport MagickBooleanType MagickSetImageColor(MagickWand *wand,
8785 const PixelWand *color)
8790 assert(wand != (MagickWand *) NULL);
8791 assert(wand->signature == WandSignature);
8792 if (wand->debug != MagickFalse)
8793 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8794 PixelGetMagickColor(color,&pixel);
8795 return(SetImageColor(wand->images,&pixel,wand->exception));
8799 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8803 % 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 %
8807 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8809 % MagickSetImageColormapColor() sets the color of the specified colormap
8812 % The format of the MagickSetImageColormapColor method is:
8814 % MagickBooleanType MagickSetImageColormapColor(MagickWand *wand,
8815 % const size_t index,const PixelWand *color)
8817 % A description of each parameter follows:
8819 % o wand: the magick wand.
8821 % o index: the offset into the image colormap.
8823 % o color: Return the colormap color in this wand.
8826 WandExport MagickBooleanType MagickSetImageColormapColor(MagickWand *wand,
8827 const size_t index,const PixelWand *color)
8829 assert(wand != (MagickWand *) NULL);
8830 assert(wand->signature == WandSignature);
8831 if (wand->debug != MagickFalse)
8832 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8833 if (wand->images == (Image *) NULL)
8834 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8835 if ((wand->images->colormap == (PixelInfo *) NULL) ||
8836 (index >= wand->images->colors))
8837 ThrowWandException(WandError,"InvalidColormapIndex",wand->name);
8838 PixelGetQuantumPacket(color,wand->images->colormap+index);
8839 return(SyncImage(wand->images));
8843 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8847 % M a g i c k S e t I m a g e C o l o r s p a c e %
8851 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8853 % MagickSetImageColorspace() sets the image colorspace.
8855 % The format of the MagickSetImageColorspace method is:
8857 % MagickBooleanType MagickSetImageColorspace(MagickWand *wand,
8858 % const ColorspaceType colorspace)
8860 % A description of each parameter follows:
8862 % o wand: the magick wand.
8864 % o colorspace: the image colorspace: UndefinedColorspace, RGBColorspace,
8865 % GRAYColorspace, TransparentColorspace, OHTAColorspace, XYZColorspace,
8866 % YCbCrColorspace, YCCColorspace, YIQColorspace, YPbPrColorspace,
8867 % YPbPrColorspace, YUVColorspace, CMYKColorspace, sRGBColorspace,
8868 % HSLColorspace, or HWBColorspace.
8871 WandExport MagickBooleanType MagickSetImageColorspace(MagickWand *wand,
8872 const ColorspaceType colorspace)
8874 assert(wand != (MagickWand *) NULL);
8875 assert(wand->signature == WandSignature);
8876 if (wand->debug != MagickFalse)
8877 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8878 if (wand->images == (Image *) NULL)
8879 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8880 return(SetImageColorspace(wand->images,colorspace,&wand->images->exception));
8884 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8888 % M a g i c k S e t I m a g e C o m p o s e %
8892 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8894 % MagickSetImageCompose() sets the image composite operator, useful for
8895 % specifying how to composite the image thumbnail when using the
8896 % MagickMontageImage() method.
8898 % The format of the MagickSetImageCompose method is:
8900 % MagickBooleanType MagickSetImageCompose(MagickWand *wand,
8901 % const CompositeOperator compose)
8903 % A description of each parameter follows:
8905 % o wand: the magick wand.
8907 % o compose: the image composite operator.
8910 WandExport MagickBooleanType MagickSetImageCompose(MagickWand *wand,
8911 const CompositeOperator compose)
8913 assert(wand != (MagickWand *) NULL);
8914 assert(wand->signature == WandSignature);
8915 if (wand->debug != MagickFalse)
8916 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8917 if (wand->images == (Image *) NULL)
8918 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8919 wand->images->compose=compose;
8924 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8928 % 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 %
8932 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8934 % MagickSetImageCompression() sets the image compression.
8936 % The format of the MagickSetImageCompression method is:
8938 % MagickBooleanType MagickSetImageCompression(MagickWand *wand,
8939 % const CompressionType compression)
8941 % A description of each parameter follows:
8943 % o wand: the magick wand.
8945 % o compression: the image compression type.
8948 WandExport MagickBooleanType MagickSetImageCompression(MagickWand *wand,
8949 const CompressionType compression)
8951 assert(wand != (MagickWand *) NULL);
8952 assert(wand->signature == WandSignature);
8953 if (wand->debug != MagickFalse)
8954 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8955 if (wand->images == (Image *) NULL)
8956 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8957 wand->images->compression=compression;
8962 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8966 % 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 %
8970 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8972 % MagickSetImageCompressionQuality() sets the image compression quality.
8974 % The format of the MagickSetImageCompressionQuality method is:
8976 % MagickBooleanType MagickSetImageCompressionQuality(MagickWand *wand,
8977 % const size_t quality)
8979 % A description of each parameter follows:
8981 % o wand: the magick wand.
8983 % o quality: the image compression tlityype.
8986 WandExport MagickBooleanType MagickSetImageCompressionQuality(MagickWand *wand,
8987 const size_t quality)
8989 assert(wand != (MagickWand *) NULL);
8990 assert(wand->signature == WandSignature);
8991 if (wand->debug != MagickFalse)
8992 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8993 if (wand->images == (Image *) NULL)
8994 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8995 wand->images->quality=quality;
9000 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9004 % M a g i c k S e t I m a g e D e l a y %
9008 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9010 % MagickSetImageDelay() sets the image delay.
9012 % The format of the MagickSetImageDelay method is:
9014 % MagickBooleanType MagickSetImageDelay(MagickWand *wand,
9015 % const size_t delay)
9017 % A description of each parameter follows:
9019 % o wand: the magick wand.
9021 % o delay: the image delay in ticks-per-second units.
9024 WandExport MagickBooleanType MagickSetImageDelay(MagickWand *wand,
9027 assert(wand != (MagickWand *) NULL);
9028 assert(wand->signature == WandSignature);
9029 if (wand->debug != MagickFalse)
9030 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9031 if (wand->images == (Image *) NULL)
9032 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9033 wand->images->delay=delay;
9038 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9042 % M a g i c k S e t I m a g e D e p t h %
9046 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9048 % MagickSetImageDepth() sets the image depth.
9050 % The format of the MagickSetImageDepth method is:
9052 % MagickBooleanType MagickSetImageDepth(MagickWand *wand,
9053 % const size_t depth)
9055 % A description of each parameter follows:
9057 % o wand: the magick wand.
9059 % o depth: the image depth in bits: 8, 16, or 32.
9062 WandExport MagickBooleanType MagickSetImageDepth(MagickWand *wand,
9065 assert(wand != (MagickWand *) NULL);
9066 assert(wand->signature == WandSignature);
9067 if (wand->debug != MagickFalse)
9068 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9069 if (wand->images == (Image *) NULL)
9070 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9071 return(SetImageDepth(wand->images,depth));
9075 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9079 % M a g i c k S e t I m a g e D i s p o s e %
9083 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9085 % MagickSetImageDispose() sets the image disposal method.
9087 % The format of the MagickSetImageDispose method is:
9089 % MagickBooleanType MagickSetImageDispose(MagickWand *wand,
9090 % const DisposeType dispose)
9092 % A description of each parameter follows:
9094 % o wand: the magick wand.
9096 % o dispose: the image disposeal type.
9099 WandExport MagickBooleanType MagickSetImageDispose(MagickWand *wand,
9100 const DisposeType dispose)
9102 assert(wand != (MagickWand *) NULL);
9103 assert(wand->signature == WandSignature);
9104 if (wand->debug != MagickFalse)
9105 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9106 if (wand->images == (Image *) NULL)
9107 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9108 wand->images->dispose=dispose;
9113 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9117 % M a g i c k S e t I m a g e E x t e n t %
9121 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9123 % MagickSetImageExtent() sets the image size (i.e. columns & rows).
9125 % The format of the MagickSetImageExtent method is:
9127 % MagickBooleanType MagickSetImageExtent(MagickWand *wand,
9128 % const size_t columns,const unsigned rows)
9130 % A description of each parameter follows:
9132 % o wand: the magick wand.
9134 % o columns: The image width in pixels.
9136 % o rows: The image height in pixels.
9139 WandExport MagickBooleanType MagickSetImageExtent(MagickWand *wand,
9140 const size_t columns,const size_t rows)
9142 assert(wand != (MagickWand *) NULL);
9143 assert(wand->signature == WandSignature);
9144 if (wand->debug != MagickFalse)
9145 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9146 if (wand->images == (Image *) NULL)
9147 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9148 return(SetImageExtent(wand->images,columns,rows,&wand->images->exception));
9152 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9156 % M a g i c k S e t I m a g e F i l e n a m e %
9160 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9162 % MagickSetImageFilename() sets the filename of a particular image in a
9165 % The format of the MagickSetImageFilename method is:
9167 % MagickBooleanType MagickSetImageFilename(MagickWand *wand,
9168 % const char *filename)
9170 % A description of each parameter follows:
9172 % o wand: the magick wand.
9174 % o filename: the image filename.
9177 WandExport MagickBooleanType MagickSetImageFilename(MagickWand *wand,
9178 const char *filename)
9180 assert(wand != (MagickWand *) NULL);
9181 assert(wand->signature == WandSignature);
9182 if (wand->debug != MagickFalse)
9183 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9184 if (wand->images == (Image *) NULL)
9185 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9186 if (filename != (const char *) NULL)
9187 (void) CopyMagickString(wand->images->filename,filename,MaxTextExtent);
9192 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9196 % M a g i c k S e t I m a g e F o r m a t %
9200 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9202 % MagickSetImageFormat() sets the format of a particular image in a
9205 % The format of the MagickSetImageFormat method is:
9207 % MagickBooleanType MagickSetImageFormat(MagickWand *wand,
9208 % const char *format)
9210 % A description of each parameter follows:
9212 % o wand: the magick wand.
9214 % o format: the image format.
9217 WandExport MagickBooleanType MagickSetImageFormat(MagickWand *wand,
9223 assert(wand != (MagickWand *) NULL);
9224 assert(wand->signature == WandSignature);
9225 if (wand->debug != MagickFalse)
9226 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9227 if (wand->images == (Image *) NULL)
9228 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9229 if ((format == (char *) NULL) || (*format == '\0'))
9231 *wand->images->magick='\0';
9234 magick_info=GetMagickInfo(format,wand->exception);
9235 if (magick_info == (const MagickInfo *) NULL)
9236 return(MagickFalse);
9237 ClearMagickException(wand->exception);
9238 (void) CopyMagickString(wand->images->magick,format,MaxTextExtent);
9243 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9247 % M a g i c k S e t I m a g e F u z z %
9251 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9253 % MagickSetImageFuzz() sets the image fuzz.
9255 % The format of the MagickSetImageFuzz method is:
9257 % MagickBooleanType MagickSetImageFuzz(MagickWand *wand,
9258 % const double fuzz)
9260 % A description of each parameter follows:
9262 % o wand: the magick wand.
9264 % o fuzz: the image fuzz.
9267 WandExport MagickBooleanType MagickSetImageFuzz(MagickWand *wand,
9270 assert(wand != (MagickWand *) NULL);
9271 assert(wand->signature == WandSignature);
9272 if (wand->debug != MagickFalse)
9273 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9274 if (wand->images == (Image *) NULL)
9275 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9276 wand->images->fuzz=fuzz;
9281 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9285 % M a g i c k S e t I m a g e G a m m a %
9289 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9291 % MagickSetImageGamma() sets the image gamma.
9293 % The format of the MagickSetImageGamma method is:
9295 % MagickBooleanType MagickSetImageGamma(MagickWand *wand,
9296 % const double gamma)
9298 % A description of each parameter follows:
9300 % o wand: the magick wand.
9302 % o gamma: the image gamma.
9305 WandExport MagickBooleanType MagickSetImageGamma(MagickWand *wand,
9308 assert(wand != (MagickWand *) NULL);
9309 assert(wand->signature == WandSignature);
9310 if (wand->debug != MagickFalse)
9311 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9312 if (wand->images == (Image *) NULL)
9313 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9314 wand->images->gamma=gamma;
9319 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9323 % M a g i c k S e t I m a g e G r a v i t y %
9327 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9329 % MagickSetImageGravity() sets the image gravity type.
9331 % The format of the MagickSetImageGravity method is:
9333 % MagickBooleanType MagickSetImageGravity(MagickWand *wand,
9334 % const GravityType gravity)
9336 % A description of each parameter follows:
9338 % o wand: the magick wand.
9340 % o gravity: the image interlace scheme: NoInterlace, LineInterlace,
9341 % PlaneInterlace, PartitionInterlace.
9344 WandExport MagickBooleanType MagickSetImageGravity(MagickWand *wand,
9345 const GravityType gravity)
9347 assert(wand != (MagickWand *) NULL);
9348 assert(wand->signature == WandSignature);
9349 if (wand->debug != MagickFalse)
9350 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9351 if (wand->images == (Image *) NULL)
9352 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9353 wand->images->gravity=gravity;
9358 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9362 % 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 %
9366 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9368 % MagickSetImageGreenPrimary() sets the image chromaticity green primary
9371 % The format of the MagickSetImageGreenPrimary method is:
9373 % MagickBooleanType MagickSetImageGreenPrimary(MagickWand *wand,
9374 % const double x,const double y)
9376 % A description of each parameter follows:
9378 % o wand: the magick wand.
9380 % o x: the green primary x-point.
9382 % o y: the green primary y-point.
9386 WandExport MagickBooleanType MagickSetImageGreenPrimary(MagickWand *wand,
9387 const double x,const double y)
9389 assert(wand != (MagickWand *) NULL);
9390 assert(wand->signature == WandSignature);
9391 if (wand->debug != MagickFalse)
9392 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9393 if (wand->images == (Image *) NULL)
9394 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9395 wand->images->chromaticity.green_primary.x=x;
9396 wand->images->chromaticity.green_primary.y=y;
9401 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9405 % 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 %
9409 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9411 % MagickSetImageInterlaceScheme() sets the image interlace scheme.
9413 % The format of the MagickSetImageInterlaceScheme method is:
9415 % MagickBooleanType MagickSetImageInterlaceScheme(MagickWand *wand,
9416 % const InterlaceType interlace)
9418 % A description of each parameter follows:
9420 % o wand: the magick wand.
9422 % o interlace: the image interlace scheme: NoInterlace, LineInterlace,
9423 % PlaneInterlace, PartitionInterlace.
9426 WandExport MagickBooleanType MagickSetImageInterlaceScheme(MagickWand *wand,
9427 const InterlaceType interlace)
9429 assert(wand != (MagickWand *) NULL);
9430 assert(wand->signature == WandSignature);
9431 if (wand->debug != MagickFalse)
9432 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9433 if (wand->images == (Image *) NULL)
9434 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9435 wand->images->interlace=interlace;
9440 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9444 % 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 %
9448 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9450 % MagickSetImagePixelInterpolateMethod() sets the image interpolate pixel method.
9452 % The format of the MagickSetImagePixelInterpolateMethod method is:
9454 % MagickBooleanType MagickSetImagePixelInterpolateMethod(MagickWand *wand,
9455 % const PixelInterpolateMethod method)
9457 % A description of each parameter follows:
9459 % o wand: the magick wand.
9461 % o method: the image interpole pixel methods: choose from Undefined,
9462 % Average, Bicubic, Bilinear, Filter, Integer, Mesh, NearestNeighbor.
9465 WandExport MagickBooleanType MagickSetImagePixelInterpolateMethod(MagickWand *wand,
9466 const PixelInterpolateMethod method)
9468 assert(wand != (MagickWand *) NULL);
9469 assert(wand->signature == WandSignature);
9470 if (wand->debug != MagickFalse)
9471 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9472 if (wand->images == (Image *) NULL)
9473 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9474 wand->images->interpolate=method;
9479 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9483 % M a g i c k S e t I m a g e I t e r a t i o n s %
9487 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9489 % MagickSetImageIterations() sets the image iterations.
9491 % The format of the MagickSetImageIterations method is:
9493 % MagickBooleanType MagickSetImageIterations(MagickWand *wand,
9494 % const size_t iterations)
9496 % A description of each parameter follows:
9498 % o wand: the magick wand.
9500 % o delay: the image delay in 1/100th of a second.
9503 WandExport MagickBooleanType MagickSetImageIterations(MagickWand *wand,
9504 const size_t iterations)
9506 assert(wand != (MagickWand *) NULL);
9507 assert(wand->signature == WandSignature);
9508 if (wand->debug != MagickFalse)
9509 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9510 if (wand->images == (Image *) NULL)
9511 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9512 wand->images->iterations=iterations;
9517 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9521 % M a g i c k S e t I m a g e M a t t e %
9525 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9527 % MagickSetImageMatte() sets the image matte channel.
9529 % The format of the MagickSetImageMatteColor method is:
9531 % MagickBooleanType MagickSetImageMatteColor(MagickWand *wand,
9532 % const MagickBooleanType *matte)
9534 % A description of each parameter follows:
9536 % o wand: the magick wand.
9538 % o matte: Set to MagickTrue to enable the image matte channel otherwise
9542 WandExport MagickBooleanType MagickSetImageMatte(MagickWand *wand,
9543 const MagickBooleanType matte)
9545 assert(wand != (MagickWand *) NULL);
9546 assert(wand->signature == WandSignature);
9547 if (wand->debug != MagickFalse)
9548 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9549 if (wand->images == (Image *) NULL)
9550 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9551 if ((wand->images->matte == MagickFalse) && (matte != MagickFalse))
9552 (void) SetImageAlpha(wand->images,OpaqueAlpha,wand->exception);
9553 wand->images->matte=matte;
9558 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9562 % M a g i c k S e t I m a g e M a t t e C o l o r %
9566 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9568 % MagickSetImageMatteColor() sets the image matte color.
9570 % The format of the MagickSetImageMatteColor method is:
9572 % MagickBooleanType MagickSetImageMatteColor(MagickWand *wand,
9573 % const PixelWand *matte)
9575 % A description of each parameter follows:
9577 % o wand: the magick wand.
9579 % o matte: the matte pixel wand.
9582 WandExport MagickBooleanType MagickSetImageMatteColor(MagickWand *wand,
9583 const PixelWand *matte)
9585 assert(wand != (MagickWand *) NULL);
9586 assert(wand->signature == WandSignature);
9587 if (wand->debug != MagickFalse)
9588 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9589 if (wand->images == (Image *) NULL)
9590 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9591 PixelGetQuantumPacket(matte,&wand->images->matte_color);
9596 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9600 % M a g i c k S e t I m a g e O p a c i t y %
9604 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9606 % MagickSetImageAlpha() sets the image to the specified alpha level.
9608 % The format of the MagickSetImageAlpha method is:
9610 % MagickBooleanType MagickSetImageAlpha(MagickWand *wand,
9611 % const double alpha)
9613 % A description of each parameter follows:
9615 % o wand: the magick wand.
9617 % o alpha: the level of transparency: 1.0 is fully opaque and 0.0 is fully
9621 WandExport MagickBooleanType MagickSetImageAlpha(MagickWand *wand,
9627 assert(wand != (MagickWand *) NULL);
9628 assert(wand->signature == WandSignature);
9629 if (wand->debug != MagickFalse)
9630 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9631 if (wand->images == (Image *) NULL)
9632 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9633 status=SetImageAlpha(wand->images,ClampToQuantum(QuantumRange*alpha),
9639 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9643 % 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 %
9647 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9649 % MagickSetImageOrientation() sets the image orientation.
9651 % The format of the MagickSetImageOrientation method is:
9653 % MagickBooleanType MagickSetImageOrientation(MagickWand *wand,
9654 % const OrientationType orientation)
9656 % A description of each parameter follows:
9658 % o wand: the magick wand.
9660 % o orientation: the image orientation type.
9663 WandExport MagickBooleanType MagickSetImageOrientation(MagickWand *wand,
9664 const OrientationType orientation)
9666 assert(wand != (MagickWand *) NULL);
9667 assert(wand->signature == WandSignature);
9668 if (wand->debug != MagickFalse)
9669 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9670 if (wand->images == (Image *) NULL)
9671 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9672 wand->images->orientation=orientation;
9677 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9681 % M a g i c k S e t I m a g e P a g e %
9685 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9687 % MagickSetImagePage() sets the page geometry of the image.
9689 % The format of the MagickSetImagePage method is:
9691 % MagickBooleanType MagickSetImagePage(MagickWand *wand,
9692 % const size_t width,const size_t height,const ssize_t x,
9695 % A description of each parameter follows:
9697 % o wand: the magick wand.
9699 % o width: the page width.
9701 % o height: the page height.
9703 % o x: the page x-offset.
9705 % o y: the page y-offset.
9708 WandExport MagickBooleanType MagickSetImagePage(MagickWand *wand,
9709 const size_t width,const size_t height,const ssize_t x,
9712 assert(wand != (MagickWand *) NULL);
9713 assert(wand->signature == WandSignature);
9714 if (wand->debug != MagickFalse)
9715 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9716 if (wand->images == (Image *) NULL)
9717 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9718 wand->images->page.width=width;
9719 wand->images->page.height=height;
9720 wand->images->page.x=x;
9721 wand->images->page.y=y;
9726 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9730 % 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 %
9734 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9736 % MagickSetImageProgressMonitor() sets the wand image progress monitor to the
9737 % specified method and returns the previous progress monitor if any. The
9738 % progress monitor method looks like this:
9740 % MagickBooleanType MagickProgressMonitor(const char *text,
9741 % const MagickOffsetType offset,const MagickSizeType span,
9742 % void *client_data)
9744 % If the progress monitor returns MagickFalse, the current operation is
9747 % The format of the MagickSetImageProgressMonitor method is:
9749 % MagickProgressMonitor MagickSetImageProgressMonitor(MagickWand *wand
9750 % const MagickProgressMonitor progress_monitor,void *client_data)
9752 % A description of each parameter follows:
9754 % o wand: the magick wand.
9756 % o progress_monitor: Specifies a pointer to a method to monitor progress
9757 % of an image operation.
9759 % o client_data: Specifies a pointer to any client data.
9762 WandExport MagickProgressMonitor MagickSetImageProgressMonitor(MagickWand *wand,
9763 const MagickProgressMonitor progress_monitor,void *client_data)
9765 MagickProgressMonitor
9768 assert(wand != (MagickWand *) NULL);
9769 assert(wand->signature == WandSignature);
9770 if (wand->debug != MagickFalse)
9771 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9772 if (wand->images == (Image *) NULL)
9774 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
9775 "ContainsNoImages","`%s'",wand->name);
9776 return((MagickProgressMonitor) NULL);
9778 previous_monitor=SetImageProgressMonitor(wand->images,
9779 progress_monitor,client_data);
9780 return(previous_monitor);
9784 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9788 % M a g i c k S e t I m a g e R e d P r i m a r y %
9792 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9794 % MagickSetImageRedPrimary() sets the image chromaticity red primary point.
9796 % The format of the MagickSetImageRedPrimary method is:
9798 % MagickBooleanType MagickSetImageRedPrimary(MagickWand *wand,
9799 % const double x,const double y)
9801 % A description of each parameter follows:
9803 % o wand: the magick wand.
9805 % o x: the red primary x-point.
9807 % o y: the red primary y-point.
9810 WandExport MagickBooleanType MagickSetImageRedPrimary(MagickWand *wand,
9811 const double x,const double y)
9813 assert(wand != (MagickWand *) NULL);
9814 assert(wand->signature == WandSignature);
9815 if (wand->debug != MagickFalse)
9816 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9817 if (wand->images == (Image *) NULL)
9818 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9819 wand->images->chromaticity.red_primary.x=x;
9820 wand->images->chromaticity.red_primary.y=y;
9825 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9829 % 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 %
9833 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9835 % MagickSetImageRenderingIntent() sets the image rendering intent.
9837 % The format of the MagickSetImageRenderingIntent method is:
9839 % MagickBooleanType MagickSetImageRenderingIntent(MagickWand *wand,
9840 % const RenderingIntent rendering_intent)
9842 % A description of each parameter follows:
9844 % o wand: the magick wand.
9846 % o rendering_intent: the image rendering intent: UndefinedIntent,
9847 % SaturationIntent, PerceptualIntent, AbsoluteIntent, or RelativeIntent.
9850 WandExport MagickBooleanType MagickSetImageRenderingIntent(MagickWand *wand,
9851 const RenderingIntent rendering_intent)
9853 assert(wand != (MagickWand *) NULL);
9854 assert(wand->signature == WandSignature);
9855 if (wand->debug != MagickFalse)
9856 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9857 if (wand->images == (Image *) NULL)
9858 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9859 wand->images->rendering_intent=rendering_intent;
9864 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9868 % M a g i c k S e t I m a g e R e s o l u t i o n %
9872 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9874 % MagickSetImageResolution() sets the image resolution.
9876 % The format of the MagickSetImageResolution method is:
9878 % MagickBooleanType MagickSetImageResolution(MagickWand *wand,
9879 % const double x_resolution,const doubtl y_resolution)
9881 % A description of each parameter follows:
9883 % o wand: the magick wand.
9885 % o x_resolution: the image x resolution.
9887 % o y_resolution: the image y resolution.
9890 WandExport MagickBooleanType MagickSetImageResolution(MagickWand *wand,
9891 const double x_resolution,const double y_resolution)
9893 assert(wand != (MagickWand *) NULL);
9894 assert(wand->signature == WandSignature);
9895 if (wand->debug != MagickFalse)
9896 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9897 if (wand->images == (Image *) NULL)
9898 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9899 wand->images->x_resolution=x_resolution;
9900 wand->images->y_resolution=y_resolution;
9905 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9909 % M a g i c k S e t I m a g e S c e n e %
9913 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9915 % MagickSetImageScene() sets the image scene.
9917 % The format of the MagickSetImageScene method is:
9919 % MagickBooleanType MagickSetImageScene(MagickWand *wand,
9920 % const size_t scene)
9922 % A description of each parameter follows:
9924 % o wand: the magick wand.
9926 % o delay: the image scene number.
9929 WandExport MagickBooleanType MagickSetImageScene(MagickWand *wand,
9932 assert(wand != (MagickWand *) NULL);
9933 assert(wand->signature == WandSignature);
9934 if (wand->debug != MagickFalse)
9935 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9936 if (wand->images == (Image *) NULL)
9937 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9938 wand->images->scene=scene;
9943 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9947 % 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 %
9951 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9953 % MagickSetImageTicksPerSecond() sets the image ticks-per-second.
9955 % The format of the MagickSetImageTicksPerSecond method is:
9957 % MagickBooleanType MagickSetImageTicksPerSecond(MagickWand *wand,
9958 % const ssize_t ticks_per-second)
9960 % A description of each parameter follows:
9962 % o wand: the magick wand.
9964 % o ticks_per_second: the units to use for the image delay.
9967 WandExport MagickBooleanType MagickSetImageTicksPerSecond(MagickWand *wand,
9968 const ssize_t ticks_per_second)
9970 assert(wand != (MagickWand *) NULL);
9971 assert(wand->signature == WandSignature);
9972 if (wand->debug != MagickFalse)
9973 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9974 if (wand->images == (Image *) NULL)
9975 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9976 wand->images->ticks_per_second=ticks_per_second;
9981 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9985 % M a g i c k S e t I m a g e T y p e %
9989 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9991 % MagickSetImageType() sets the image type.
9993 % The format of the MagickSetImageType method is:
9995 % MagickBooleanType MagickSetImageType(MagickWand *wand,
9996 % const ImageType image_type)
9998 % A description of each parameter follows:
10000 % o wand: the magick wand.
10002 % o image_type: the image type: UndefinedType, BilevelType, GrayscaleType,
10003 % GrayscaleMatteType, PaletteType, PaletteMatteType, TrueColorType,
10004 % TrueColorMatteType, ColorSeparationType, ColorSeparationMatteType,
10008 WandExport MagickBooleanType MagickSetImageType(MagickWand *wand,
10009 const ImageType image_type)
10011 assert(wand != (MagickWand *) NULL);
10012 assert(wand->signature == WandSignature);
10013 if (wand->debug != MagickFalse)
10014 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10015 if (wand->images == (Image *) NULL)
10016 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10017 return(SetImageType(wand->images,image_type,wand->exception));
10021 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10025 % M a g i c k S e t I m a g e U n i t s %
10029 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10031 % MagickSetImageUnits() sets the image units of resolution.
10033 % The format of the MagickSetImageUnits method is:
10035 % MagickBooleanType MagickSetImageUnits(MagickWand *wand,
10036 % const ResolutionType units)
10038 % A description of each parameter follows:
10040 % o wand: the magick wand.
10042 % o units: the image units of resolution : UndefinedResolution,
10043 % PixelsPerInchResolution, or PixelsPerCentimeterResolution.
10046 WandExport MagickBooleanType MagickSetImageUnits(MagickWand *wand,
10047 const ResolutionType units)
10049 assert(wand != (MagickWand *) NULL);
10050 assert(wand->signature == WandSignature);
10051 if (wand->debug != MagickFalse)
10052 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10053 if (wand->images == (Image *) NULL)
10054 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10055 wand->images->units=units;
10056 return(MagickTrue);
10060 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10064 % 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 %
10068 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10070 % MagickSetImageVirtualPixelMethod() sets the image virtual pixel method.
10072 % The format of the MagickSetImageVirtualPixelMethod method is:
10074 % VirtualPixelMethod MagickSetImageVirtualPixelMethod(MagickWand *wand,
10075 % const VirtualPixelMethod method)
10077 % A description of each parameter follows:
10079 % o wand: the magick wand.
10081 % o method: the image virtual pixel method : UndefinedVirtualPixelMethod,
10082 % ConstantVirtualPixelMethod, EdgeVirtualPixelMethod,
10083 % MirrorVirtualPixelMethod, or TileVirtualPixelMethod.
10086 WandExport VirtualPixelMethod MagickSetImageVirtualPixelMethod(MagickWand *wand,
10087 const VirtualPixelMethod method)
10089 assert(wand != (MagickWand *) NULL);
10090 assert(wand->signature == WandSignature);
10091 if (wand->debug != MagickFalse)
10092 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10093 if (wand->images == (Image *) NULL)
10094 return(UndefinedVirtualPixelMethod);
10095 return(SetImageVirtualPixelMethod(wand->images,method));
10099 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10103 % M a g i c k S e t I m a g e W h i t e P o i n t %
10107 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10109 % MagickSetImageWhitePoint() sets the image chromaticity white point.
10111 % The format of the MagickSetImageWhitePoint method is:
10113 % MagickBooleanType MagickSetImageWhitePoint(MagickWand *wand,
10114 % const double x,const double y)
10116 % A description of each parameter follows:
10118 % o wand: the magick wand.
10120 % o x: the white x-point.
10122 % o y: the white y-point.
10125 WandExport MagickBooleanType MagickSetImageWhitePoint(MagickWand *wand,
10126 const double x,const double y)
10128 assert(wand != (MagickWand *) NULL);
10129 assert(wand->signature == WandSignature);
10130 if (wand->debug != MagickFalse)
10131 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10132 if (wand->images == (Image *) NULL)
10133 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10134 wand->images->chromaticity.white_point.x=x;
10135 wand->images->chromaticity.white_point.y=y;
10136 return(MagickTrue);
10140 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10144 % M a g i c k S h a d e I m a g e C h a n n e l %
10148 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10150 % MagickShadeImage() shines a distant light on an image to create a
10151 % three-dimensional effect. You control the positioning of the light with
10152 % azimuth and elevation; azimuth is measured in degrees off the x axis
10153 % and elevation is measured in pixels above the Z axis.
10155 % The format of the MagickShadeImage method is:
10157 % MagickBooleanType MagickShadeImage(MagickWand *wand,
10158 % const MagickBooleanType gray,const double azimuth,
10159 % const double elevation)
10161 % A description of each parameter follows:
10163 % o wand: the magick wand.
10165 % o gray: A value other than zero shades the intensity of each pixel.
10167 % o azimuth, elevation: Define the light source direction.
10170 WandExport MagickBooleanType MagickShadeImage(MagickWand *wand,
10171 const MagickBooleanType gray,const double asimuth,const double elevation)
10176 assert(wand != (MagickWand *) NULL);
10177 assert(wand->signature == WandSignature);
10178 if (wand->debug != MagickFalse)
10179 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10180 if (wand->images == (Image *) NULL)
10181 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10182 shade_image=ShadeImage(wand->images,gray,asimuth,elevation,wand->exception);
10183 if (shade_image == (Image *) NULL)
10184 return(MagickFalse);
10185 ReplaceImageInList(&wand->images,shade_image);
10186 return(MagickTrue);
10190 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10194 % M a g i c k S h a d o w I m a g e %
10198 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10200 % MagickShadowImage() simulates an image shadow.
10202 % The format of the MagickShadowImage method is:
10204 % MagickBooleanType MagickShadowImage(MagickWand *wand,
10205 % const double alpha,const double sigma,const ssize_t x,const ssize_t y)
10207 % A description of each parameter follows:
10209 % o wand: the magick wand.
10211 % o alpha: percentage transparency.
10213 % o sigma: the standard deviation of the Gaussian, in pixels.
10215 % o x: the shadow x-offset.
10217 % o y: the shadow y-offset.
10220 WandExport MagickBooleanType MagickShadowImage(MagickWand *wand,
10221 const double alpha,const double sigma,const ssize_t x,const ssize_t y)
10226 assert(wand != (MagickWand *) NULL);
10227 assert(wand->signature == WandSignature);
10228 if (wand->debug != MagickFalse)
10229 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10230 if (wand->images == (Image *) NULL)
10231 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10232 shadow_image=ShadowImage(wand->images,alpha,sigma,x,y,wand->exception);
10233 if (shadow_image == (Image *) NULL)
10234 return(MagickFalse);
10235 ReplaceImageInList(&wand->images,shadow_image);
10236 return(MagickTrue);
10240 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10244 % M a g i c k S h a r p e n I m a g e %
10248 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10250 % MagickSharpenImage() sharpens an image. We convolve the image with a
10251 % Gaussian operator of the given radius and standard deviation (sigma).
10252 % For reasonable results, the radius should be larger than sigma. Use a
10253 % radius of 0 and MagickSharpenImage() selects a suitable radius for you.
10255 % The format of the MagickSharpenImage method is:
10257 % MagickBooleanType MagickSharpenImage(MagickWand *wand,
10258 % const double radius,const double sigma,const double bias)
10260 % A description of each parameter follows:
10262 % o wand: the magick wand.
10264 % o radius: the radius of the Gaussian, in pixels, not counting the center
10267 % o sigma: the standard deviation of the Gaussian, in pixels.
10269 % o bias: the bias.
10272 WandExport MagickBooleanType MagickSharpenImage(MagickWand *wand,
10273 const double radius,const double sigma,const double bias)
10278 assert(wand != (MagickWand *) NULL);
10279 assert(wand->signature == WandSignature);
10280 if (wand->debug != MagickFalse)
10281 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10282 if (wand->images == (Image *) NULL)
10283 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10284 sharp_image=SharpenImage(wand->images,radius,sigma,bias,wand->exception);
10285 if (sharp_image == (Image *) NULL)
10286 return(MagickFalse);
10287 ReplaceImageInList(&wand->images,sharp_image);
10288 return(MagickTrue);
10292 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10296 % M a g i c k S h a v e I m a g e %
10300 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10302 % MagickShaveImage() shaves pixels from the image edges. It allocates the
10303 % memory necessary for the new Image structure and returns a pointer to the
10306 % The format of the MagickShaveImage method is:
10308 % MagickBooleanType MagickShaveImage(MagickWand *wand,
10309 % const size_t columns,const size_t rows)
10311 % A description of each parameter follows:
10313 % o wand: the magick wand.
10315 % o columns: the number of columns in the scaled image.
10317 % o rows: the number of rows in the scaled image.
10321 WandExport MagickBooleanType MagickShaveImage(MagickWand *wand,
10322 const size_t columns,const size_t rows)
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 shave_info.width=columns;
10337 shave_info.height=rows;
10340 shave_image=ShaveImage(wand->images,&shave_info,wand->exception);
10341 if (shave_image == (Image *) NULL)
10342 return(MagickFalse);
10343 ReplaceImageInList(&wand->images,shave_image);
10344 return(MagickTrue);
10348 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10352 % M a g i c k S h e a r I m a g e %
10356 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10358 % MagickShearImage() slides one edge of an image along the X or Y axis,
10359 % creating a parallelogram. An X direction shear slides an edge along the X
10360 % axis, while a Y direction shear slides an edge along the Y axis. The amount
10361 % of the shear is controlled by a shear angle. For X direction shears, x_shear
10362 % is measured relative to the Y axis, and similarly, for Y direction shears
10363 % y_shear is measured relative to the X axis. Empty triangles left over from
10364 % shearing the image are filled with the background color.
10366 % The format of the MagickShearImage method is:
10368 % MagickBooleanType MagickShearImage(MagickWand *wand,
10369 % const PixelWand *background,const double x_shear,onst double y_shear)
10371 % A description of each parameter follows:
10373 % o wand: the magick wand.
10375 % o background: the background pixel wand.
10377 % o x_shear: the number of degrees to shear the image.
10379 % o y_shear: the number of degrees to shear the image.
10382 WandExport MagickBooleanType MagickShearImage(MagickWand *wand,
10383 const PixelWand *background,const double x_shear,const double y_shear)
10388 assert(wand != (MagickWand *) NULL);
10389 assert(wand->signature == WandSignature);
10390 if (wand->debug != MagickFalse)
10391 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10392 if (wand->images == (Image *) NULL)
10393 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10394 PixelGetQuantumPacket(background,&wand->images->background_color);
10395 shear_image=ShearImage(wand->images,x_shear,y_shear,wand->exception);
10396 if (shear_image == (Image *) NULL)
10397 return(MagickFalse);
10398 ReplaceImageInList(&wand->images,shear_image);
10399 return(MagickTrue);
10403 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10407 % 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 %
10411 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10413 % MagickSigmoidalContrastImage() adjusts the contrast of an image with a
10414 % non-linear sigmoidal contrast algorithm. Increase the contrast of the
10415 % image using a sigmoidal transfer function without saturating highlights or
10416 % shadows. Contrast indicates how much to increase the contrast (0 is none;
10417 % 3 is typical; 20 is pushing it); mid-point indicates where midtones fall in
10418 % the resultant image (0 is white; 50% is middle-gray; 100% is black). Set
10419 % sharpen to MagickTrue to increase the image contrast otherwise the contrast
10422 % The format of the MagickSigmoidalContrastImage method is:
10424 % MagickBooleanType MagickSigmoidalContrastImage(MagickWand *wand,
10425 % const MagickBooleanType sharpen,const double alpha,const double beta)
10427 % A description of each parameter follows:
10429 % o wand: the magick wand.
10431 % o sharpen: Increase or decrease image contrast.
10433 % o alpha: strength of the contrast, the larger the number the more
10434 % 'threshold-like' it becomes.
10436 % o beta: midpoint of the function as a color value 0 to QuantumRange.
10439 WandExport MagickBooleanType MagickSigmoidalContrastImage(
10440 MagickWand *wand,const MagickBooleanType sharpen,const double alpha,
10446 assert(wand != (MagickWand *) NULL);
10447 assert(wand->signature == WandSignature);
10448 if (wand->debug != MagickFalse)
10449 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10450 if (wand->images == (Image *) NULL)
10451 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10452 status=SigmoidalContrastImage(wand->images,sharpen,alpha,beta,
10453 &wand->images->exception);
10458 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10462 % M a g i c k S i m i l a r i t y I m a g e %
10466 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10468 % MagickSimilarityImage() compares the reference image of the image and
10469 % returns the best match offset. In addition, it returns a similarity image
10470 % such that an exact match location is completely white and if none of the
10471 % pixels match, black, otherwise some gray level in-between.
10473 % The format of the MagickSimilarityImage method is:
10475 % MagickWand *MagickSimilarityImage(MagickWand *wand,
10476 % const MagickWand *reference,RectangeInfo *offset,double *similarity)
10478 % A description of each parameter follows:
10480 % o wand: the magick wand.
10482 % o reference: the reference wand.
10484 % o offset: the best match offset of the reference image within the image.
10486 % o similarity: the computed similarity between the images.
10489 WandExport MagickWand *MagickSimilarityImage(MagickWand *wand,
10490 const MagickWand *reference,RectangleInfo *offset,double *similarity)
10495 assert(wand != (MagickWand *) NULL);
10496 assert(wand->signature == WandSignature);
10497 if (wand->debug != MagickFalse)
10498 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10499 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
10501 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
10502 "ContainsNoImages","`%s'",wand->name);
10503 return((MagickWand *) NULL);
10505 similarity_image=SimilarityImage(wand->images,reference->images,offset,
10506 similarity,&wand->images->exception);
10507 if (similarity_image == (Image *) NULL)
10508 return((MagickWand *) NULL);
10509 return(CloneMagickWandFromImages(wand,similarity_image));
10513 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10517 % M a g i c k S k e t c h I m a g e %
10521 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10523 % MagickSketchImage() simulates a pencil sketch. We convolve the image with
10524 % a Gaussian operator of the given radius and standard deviation (sigma).
10525 % For reasonable results, radius should be larger than sigma. Use a
10526 % radius of 0 and SketchImage() selects a suitable radius for you.
10527 % Angle gives the angle of the blurring motion.
10529 % The format of the MagickSketchImage method is:
10531 % MagickBooleanType MagickSketchImage(MagickWand *wand,
10532 % const double radius,const double sigma,const double angle,
10533 % const double bias)
10535 % A description of each parameter follows:
10537 % o wand: the magick wand.
10539 % o radius: the radius of the Gaussian, in pixels, not counting
10540 % the center pixel.
10542 % o sigma: the standard deviation of the Gaussian, in pixels.
10544 % o angle: apply the effect along this angle.
10546 % o bias: the bias.
10549 WandExport MagickBooleanType MagickSketchImage(MagickWand *wand,
10550 const double radius,const double sigma,const double angle,const double bias)
10555 assert(wand != (MagickWand *) NULL);
10556 assert(wand->signature == WandSignature);
10557 if (wand->debug != MagickFalse)
10558 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10559 if (wand->images == (Image *) NULL)
10560 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10561 sketch_image=SketchImage(wand->images,radius,sigma,angle,bias,
10563 if (sketch_image == (Image *) NULL)
10564 return(MagickFalse);
10565 ReplaceImageInList(&wand->images,sketch_image);
10566 return(MagickTrue);
10570 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10574 % M a g i c k S m u s h I m a g e s %
10578 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10580 % MagickSmushImages() takes all images from the current image pointer to the
10581 % end of the image list and smushs them to each other top-to-bottom if the
10582 % stack parameter is true, otherwise left-to-right.
10584 % The format of the MagickSmushImages method is:
10586 % MagickWand *MagickSmushImages(MagickWand *wand,
10587 % const MagickBooleanType stack,const ssize_t offset)
10589 % A description of each parameter follows:
10591 % o wand: the magick wand.
10593 % o stack: By default, images are stacked left-to-right. Set stack to
10594 % MagickTrue to stack them top-to-bottom.
10596 % o offset: minimum distance in pixels between images.
10599 WandExport MagickWand *MagickSmushImages(MagickWand *wand,
10600 const MagickBooleanType stack,const ssize_t offset)
10605 assert(wand != (MagickWand *) NULL);
10606 assert(wand->signature == WandSignature);
10607 if (wand->debug != MagickFalse)
10608 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10609 if (wand->images == (Image *) NULL)
10610 return((MagickWand *) NULL);
10611 smush_image=SmushImages(wand->images,stack,offset,wand->exception);
10612 if (smush_image == (Image *) NULL)
10613 return((MagickWand *) NULL);
10614 return(CloneMagickWandFromImages(wand,smush_image));
10618 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10622 % M a g i c k S o l a r i z e I m a g e %
10626 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10628 % MagickSolarizeImage() applies a special effect to the image, similar to the
10629 % effect achieved in a photo darkroom by selectively exposing areas of photo
10630 % sensitive paper to light. Threshold ranges from 0 to QuantumRange and is a
10631 % measure of the extent of the solarization.
10633 % The format of the MagickSolarizeImage method is:
10635 % MagickBooleanType MagickSolarizeImage(MagickWand *wand,
10636 % const double threshold)
10638 % A description of each parameter follows:
10640 % o wand: the magick wand.
10642 % o threshold: Define the extent of the solarization.
10645 WandExport MagickBooleanType MagickSolarizeImage(MagickWand *wand,
10646 const double threshold)
10651 assert(wand != (MagickWand *) NULL);
10652 assert(wand->signature == WandSignature);
10653 if (wand->debug != MagickFalse)
10654 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10655 if (wand->images == (Image *) NULL)
10656 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10657 status=SolarizeImage(wand->images,threshold,&wand->images->exception);
10662 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10666 % M a g i c k S p a r s e C o l o r I m a g e %
10670 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10672 % MagickSparseColorImage(), given a set of coordinates, interpolates the
10673 % colors found at those coordinates, across the whole image, using various
10676 % The format of the MagickSparseColorImage method is:
10678 % MagickBooleanType MagickSparseColorImage(MagickWand *wand,
10679 % const SparseColorMethod method,const size_t number_arguments,
10680 % const double *arguments)
10682 % A description of each parameter follows:
10684 % o image: the image to be sparseed.
10686 % o method: the method of image sparseion.
10688 % ArcSparseColorion will always ignore source image offset, and always
10689 % 'bestfit' the destination image with the top left corner offset
10690 % relative to the polar mapping center.
10692 % Bilinear has no simple inverse mapping so will not allow 'bestfit'
10693 % style of image sparseion.
10695 % Affine, Perspective, and Bilinear, will do least squares fitting of
10696 % the distrotion when more than the minimum number of control point
10697 % pairs are provided.
10699 % Perspective, and Bilinear, will fall back to a Affine sparseion when
10700 % less than 4 control point pairs are provided. While Affine sparseions
10701 % will let you use any number of control point pairs, that is Zero pairs
10702 % is a No-Op (viewport only) distrotion, one pair is a translation and
10703 % two pairs of control points will do a scale-rotate-translate, without
10706 % o number_arguments: the number of arguments given for this sparseion
10709 % o arguments: the arguments for this sparseion method.
10712 WandExport MagickBooleanType MagickSparseColorImage(MagickWand *wand,
10713 const SparseColorMethod method,const size_t number_arguments,
10714 const double *arguments)
10719 assert(wand != (MagickWand *) NULL);
10720 assert(wand->signature == WandSignature);
10721 if (wand->debug != MagickFalse)
10722 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10723 if (wand->images == (Image *) NULL)
10724 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10725 sparse_image=SparseColorImage(wand->images,method,number_arguments,arguments,
10727 if (sparse_image == (Image *) NULL)
10728 return(MagickFalse);
10729 ReplaceImageInList(&wand->images,sparse_image);
10730 return(MagickTrue);
10734 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10738 % M a g i c k S p l i c e I m a g e %
10742 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10744 % MagickSpliceImage() splices a solid color into the image.
10746 % The format of the MagickSpliceImage method is:
10748 % MagickBooleanType MagickSpliceImage(MagickWand *wand,
10749 % const size_t width,const size_t height,const ssize_t x,
10752 % A description of each parameter follows:
10754 % o wand: the magick wand.
10756 % o width: the region width.
10758 % o height: the region height.
10760 % o x: the region x offset.
10762 % o y: the region y offset.
10765 WandExport MagickBooleanType MagickSpliceImage(MagickWand *wand,
10766 const size_t width,const size_t height,const ssize_t x,
10775 assert(wand != (MagickWand *) NULL);
10776 assert(wand->signature == WandSignature);
10777 if (wand->debug != MagickFalse)
10778 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10779 if (wand->images == (Image *) NULL)
10780 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10781 splice.width=width;
10782 splice.height=height;
10785 splice_image=SpliceImage(wand->images,&splice,wand->exception);
10786 if (splice_image == (Image *) NULL)
10787 return(MagickFalse);
10788 ReplaceImageInList(&wand->images,splice_image);
10789 return(MagickTrue);
10793 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10797 % M a g i c k S p r e a d I m a g e %
10801 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10803 % MagickSpreadImage() is a special effects method that randomly displaces each
10804 % pixel in a block defined by the radius parameter.
10806 % The format of the MagickSpreadImage method is:
10808 % MagickBooleanType MagickSpreadImage(MagickWand *wand,const double radius,
10809 % const PixelInterpolateMethod method)
10811 % A description of each parameter follows:
10813 % o wand: the magick wand.
10815 % o radius: Choose a random pixel in a neighborhood of this extent.
10817 % o method: the pixel interpolation method.
10820 WandExport MagickBooleanType MagickSpreadImage(MagickWand *wand,
10821 const double radius,const PixelInterpolateMethod method)
10826 assert(wand != (MagickWand *) NULL);
10827 assert(wand->signature == WandSignature);
10828 if (wand->debug != MagickFalse)
10829 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10830 if (wand->images == (Image *) NULL)
10831 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10832 spread_image=SpreadImage(wand->images,radius,method,wand->exception);
10833 if (spread_image == (Image *) NULL)
10834 return(MagickFalse);
10835 ReplaceImageInList(&wand->images,spread_image);
10836 return(MagickTrue);
10840 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10844 % M a g i c k S t a t i s t i c I m a g e %
10848 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10850 % MagickStatisticImage() replace each pixel with corresponding statistic from
10851 % the neighborhood of the specified width and height.
10853 % The format of the MagickStatisticImage method is:
10855 % MagickBooleanType MagickStatisticImage(MagickWand *wand,
10856 % const StatisticType type,const double width,const size_t height)
10858 % A description of each parameter follows:
10860 % o wand: the magick wand.
10862 % o type: the statistic type (e.g. median, mode, etc.).
10864 % o width: the width of the pixel neighborhood.
10866 % o height: the height of the pixel neighborhood.
10869 WandExport MagickBooleanType MagickStatisticImage(MagickWand *wand,
10870 const StatisticType type,const size_t width,const size_t height)
10875 assert(wand != (MagickWand *) NULL);
10876 assert(wand->signature == WandSignature);
10877 if (wand->debug != MagickFalse)
10878 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10879 if (wand->images == (Image *) NULL)
10880 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10881 statistic_image=StatisticImage(wand->images,type,width,height,
10883 if (statistic_image == (Image *) NULL)
10884 return(MagickFalse);
10885 ReplaceImageInList(&wand->images,statistic_image);
10886 return(MagickTrue);
10890 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10894 % M a g i c k S t e g a n o I m a g e %
10898 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10900 % MagickSteganoImage() hides a digital watermark within the image.
10901 % Recover the hidden watermark later to prove that the authenticity of
10902 % an image. Offset defines the start position within the image to hide
10905 % The format of the MagickSteganoImage method is:
10907 % MagickWand *MagickSteganoImage(MagickWand *wand,
10908 % const MagickWand *watermark_wand,const ssize_t offset)
10910 % A description of each parameter follows:
10912 % o wand: the magick wand.
10914 % o watermark_wand: the watermark wand.
10916 % o offset: Start hiding at this offset into the image.
10919 WandExport MagickWand *MagickSteganoImage(MagickWand *wand,
10920 const MagickWand *watermark_wand,const ssize_t offset)
10925 assert(wand != (MagickWand *) NULL);
10926 assert(wand->signature == WandSignature);
10927 if (wand->debug != MagickFalse)
10928 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10929 if ((wand->images == (Image *) NULL) ||
10930 (watermark_wand->images == (Image *) NULL))
10932 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
10933 "ContainsNoImages","`%s'",wand->name);
10934 return((MagickWand *) NULL);
10936 wand->images->offset=offset;
10937 stegano_image=SteganoImage(wand->images,watermark_wand->images,
10939 if (stegano_image == (Image *) NULL)
10940 return((MagickWand *) NULL);
10941 return(CloneMagickWandFromImages(wand,stegano_image));
10945 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10949 % M a g i c k S t e r e o I m a g e %
10953 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10955 % MagickStereoImage() composites two images and produces a single image that
10956 % is the composite of a left and right image of a stereo pair
10958 % The format of the MagickStereoImage method is:
10960 % MagickWand *MagickStereoImage(MagickWand *wand,
10961 % const MagickWand *offset_wand)
10963 % A description of each parameter follows:
10965 % o wand: the magick wand.
10967 % o offset_wand: Another image wand.
10970 WandExport MagickWand *MagickStereoImage(MagickWand *wand,
10971 const MagickWand *offset_wand)
10976 assert(wand != (MagickWand *) NULL);
10977 assert(wand->signature == WandSignature);
10978 if (wand->debug != MagickFalse)
10979 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10980 if ((wand->images == (Image *) NULL) ||
10981 (offset_wand->images == (Image *) NULL))
10983 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
10984 "ContainsNoImages","`%s'",wand->name);
10985 return((MagickWand *) NULL);
10987 stereo_image=StereoImage(wand->images,offset_wand->images,wand->exception);
10988 if (stereo_image == (Image *) NULL)
10989 return((MagickWand *) NULL);
10990 return(CloneMagickWandFromImages(wand,stereo_image));
10994 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10998 % M a g i c k S t r i p I m a g e %
11002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11004 % MagickStripImage() strips an image of all profiles and comments.
11006 % The format of the MagickStripImage method is:
11008 % MagickBooleanType MagickStripImage(MagickWand *wand)
11010 % A description of each parameter follows:
11012 % o wand: the magick wand.
11015 WandExport MagickBooleanType MagickStripImage(MagickWand *wand)
11017 assert(wand != (MagickWand *) NULL);
11018 assert(wand->signature == WandSignature);
11019 if (wand->debug != MagickFalse)
11020 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11021 if (wand->images == (Image *) NULL)
11022 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11023 return(StripImage(wand->images,wand->exception));
11027 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11031 % M a g i c k S w i r l I m a g e %
11035 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11037 % MagickSwirlImage() swirls the pixels about the center of the image, where
11038 % degrees indicates the sweep of the arc through which each pixel is moved.
11039 % You get a more dramatic effect as the degrees move from 1 to 360.
11041 % The format of the MagickSwirlImage method is:
11043 % MagickBooleanType MagickSwirlImage(MagickWand *wand,const double degrees,
11044 % const PixelInterpolateMethod method)
11046 % A description of each parameter follows:
11048 % o wand: the magick wand.
11050 % o degrees: Define the tightness of the swirling effect.
11052 % o method: the pixel interpolation method.
11055 WandExport MagickBooleanType MagickSwirlImage(MagickWand *wand,
11056 const double degrees,const PixelInterpolateMethod method)
11061 assert(wand != (MagickWand *) NULL);
11062 assert(wand->signature == WandSignature);
11063 if (wand->debug != MagickFalse)
11064 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11065 if (wand->images == (Image *) NULL)
11066 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11067 swirl_image=SwirlImage(wand->images,degrees,method,wand->exception);
11068 if (swirl_image == (Image *) NULL)
11069 return(MagickFalse);
11070 ReplaceImageInList(&wand->images,swirl_image);
11071 return(MagickTrue);
11075 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11079 % M a g i c k T e x t u r e I m a g e %
11083 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11085 % MagickTextureImage() repeatedly tiles the texture image across and down the
11088 % The format of the MagickTextureImage method is:
11090 % MagickWand *MagickTextureImage(MagickWand *wand,
11091 % const MagickWand *texture_wand)
11093 % A description of each parameter follows:
11095 % o wand: the magick wand.
11097 % o texture_wand: the texture wand
11100 WandExport MagickWand *MagickTextureImage(MagickWand *wand,
11101 const MagickWand *texture_wand)
11109 assert(wand != (MagickWand *) NULL);
11110 assert(wand->signature == WandSignature);
11111 if (wand->debug != MagickFalse)
11112 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11113 if ((wand->images == (Image *) NULL) ||
11114 (texture_wand->images == (Image *) NULL))
11116 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
11117 "ContainsNoImages","`%s'",wand->name);
11118 return((MagickWand *) NULL);
11120 texture_image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
11121 if (texture_image == (Image *) NULL)
11122 return((MagickWand *) NULL);
11123 status=TextureImage(texture_image,texture_wand->images,wand->exception);
11124 if (status == MagickFalse)
11126 texture_image=DestroyImage(texture_image);
11127 return((MagickWand *) NULL);
11129 return(CloneMagickWandFromImages(wand,texture_image));
11133 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11137 % M a g i c k T h r e s h o l d I m a g e %
11141 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11143 % MagickThresholdImage() changes the value of individual pixels based on
11144 % the intensity of each pixel compared to threshold. The result is a
11145 % high-contrast, two color image.
11147 % The format of the MagickThresholdImage method is:
11149 % MagickBooleanType MagickThresholdImage(MagickWand *wand,
11150 % const double threshold)
11151 % MagickBooleanType MagickThresholdImageChannel(MagickWand *wand,
11152 % const ChannelType channel,const double threshold)
11154 % A description of each parameter follows:
11156 % o wand: the magick wand.
11158 % o channel: the image channel(s).
11160 % o threshold: Define the threshold value.
11163 WandExport MagickBooleanType MagickThresholdImage(MagickWand *wand,
11164 const double threshold)
11169 status=MagickThresholdImageChannel(wand,DefaultChannels,threshold);
11173 WandExport MagickBooleanType MagickThresholdImageChannel(MagickWand *wand,
11174 const ChannelType channel,const double threshold)
11179 assert(wand != (MagickWand *) NULL);
11180 assert(wand->signature == WandSignature);
11181 if (wand->debug != MagickFalse)
11182 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11183 if (wand->images == (Image *) NULL)
11184 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11185 status=BilevelImage(wand->images,threshold,wand->exception);
11190 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11194 % M a g i c k T h u m b n a i l I m a g e %
11198 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11200 % MagickThumbnailImage() changes the size of an image to the given dimensions
11201 % and removes any associated profiles. The goal is to produce small low cost
11202 % thumbnail images suited for display on the Web.
11204 % The format of the MagickThumbnailImage method is:
11206 % MagickBooleanType MagickThumbnailImage(MagickWand *wand,
11207 % const size_t columns,const size_t rows)
11209 % A description of each parameter follows:
11211 % o wand: the magick wand.
11213 % o columns: the number of columns in the scaled image.
11215 % o rows: the number of rows in the scaled image.
11218 WandExport MagickBooleanType MagickThumbnailImage(MagickWand *wand,
11219 const size_t columns,const size_t rows)
11224 assert(wand != (MagickWand *) NULL);
11225 assert(wand->signature == WandSignature);
11226 if (wand->debug != MagickFalse)
11227 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11228 if (wand->images == (Image *) NULL)
11229 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11230 thumbnail_image=ThumbnailImage(wand->images,columns,rows,wand->exception);
11231 if (thumbnail_image == (Image *) NULL)
11232 return(MagickFalse);
11233 ReplaceImageInList(&wand->images,thumbnail_image);
11234 return(MagickTrue);
11238 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11242 % M a g i c k T i n t I m a g e %
11246 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11248 % MagickTintImage() applies a color vector to each pixel in the image. The
11249 % length of the vector is 0 for black and white and at its maximum for the
11250 % midtones. The vector weighting function is
11251 % f(x)=(1-(4.0*((x-0.5)*(x-0.5)))).
11253 % The format of the MagickTintImage method is:
11255 % MagickBooleanType MagickTintImage(MagickWand *wand,
11256 % const PixelWand *tint,const PixelWand *blend)
11258 % A description of each parameter follows:
11260 % o wand: the magick wand.
11262 % o tint: the tint pixel wand.
11264 % o alpha: the alpha pixel wand.
11267 WandExport MagickBooleanType MagickTintImage(MagickWand *wand,
11268 const PixelWand *tint,const PixelWand *blend)
11271 percent_blend[MaxTextExtent];
11279 assert(wand != (MagickWand *) NULL);
11280 assert(wand->signature == WandSignature);
11281 if (wand->debug != MagickFalse)
11282 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11283 if (wand->images == (Image *) NULL)
11284 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11285 if (wand->images->colorspace != CMYKColorspace)
11286 (void) FormatLocaleString(percent_blend,MaxTextExtent,
11287 "%g,%g,%g,%g",(double) (100.0*QuantumScale*
11288 PixelGetRedQuantum(blend)),(double) (100.0*QuantumScale*
11289 PixelGetGreenQuantum(blend)),(double) (100.0*QuantumScale*
11290 PixelGetBlueQuantum(blend)),(double) (100.0*QuantumScale*
11291 PixelGetAlphaQuantum(blend)));
11293 (void) FormatLocaleString(percent_blend,MaxTextExtent,
11294 "%g,%g,%g,%g,%g",(double) (100.0*QuantumScale*
11295 PixelGetCyanQuantum(blend)),(double) (100.0*QuantumScale*
11296 PixelGetMagentaQuantum(blend)),(double) (100.0*QuantumScale*
11297 PixelGetYellowQuantum(blend)),(double) (100.0*QuantumScale*
11298 PixelGetBlackQuantum(blend)),(double) (100.0*QuantumScale*
11299 PixelGetAlphaQuantum(blend)));
11300 target=PixelGetPixel(tint);
11301 tint_image=TintImage(wand->images,percent_blend,&target,wand->exception);
11302 if (tint_image == (Image *) NULL)
11303 return(MagickFalse);
11304 ReplaceImageInList(&wand->images,tint_image);
11305 return(MagickTrue);
11309 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11313 % M a g i c k T r a n s f o r m I m a g e %
11317 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11319 % MagickTransformImage() is a convenience method that behaves like
11320 % MagickResizeImage() or MagickCropImage() but accepts scaling and/or cropping
11321 % information as a region geometry specification. If the operation fails,
11322 % a NULL image handle is returned.
11324 % The format of the MagickTransformImage method is:
11326 % MagickWand *MagickTransformImage(MagickWand *wand,const char *crop,
11327 % const char *geometry)
11329 % A description of each parameter follows:
11331 % o wand: the magick wand.
11333 % o crop: A crop geometry string. This geometry defines a subregion of the
11336 % o geometry: An image geometry string. This geometry defines the final
11337 % size of the image.
11340 WandExport MagickWand *MagickTransformImage(MagickWand *wand,
11341 const char *crop,const char *geometry)
11349 assert(wand != (MagickWand *) NULL);
11350 assert(wand->signature == WandSignature);
11351 if (wand->debug != MagickFalse)
11352 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11353 if (wand->images == (Image *) NULL)
11354 return((MagickWand *) NULL);
11355 transform_image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
11356 if (transform_image == (Image *) NULL)
11357 return((MagickWand *) NULL);
11358 status=TransformImage(&transform_image,crop,geometry,wand->exception);
11359 if (status == MagickFalse)
11361 transform_image=DestroyImage(transform_image);
11362 return((MagickWand *) NULL);
11364 return(CloneMagickWandFromImages(wand,transform_image));
11368 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11372 % 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 %
11376 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11378 % MagickTransformImageColorspace() transform the image colorspace.
11380 % The format of the MagickTransformImageColorspace method is:
11382 % MagickBooleanType MagickTransformImageColorspace(MagickWand *wand,
11383 % const ColorspaceType colorspace)
11385 % A description of each parameter follows:
11387 % o wand: the magick wand.
11389 % o colorspace: the image colorspace: UndefinedColorspace, RGBColorspace,
11390 % GRAYColorspace, TransparentColorspace, OHTAColorspace, XYZColorspace,
11391 % YCbCrColorspace, YCCColorspace, YIQColorspace, YPbPrColorspace,
11392 % YPbPrColorspace, YUVColorspace, CMYKColorspace, sRGBColorspace,
11393 % HSLColorspace, or HWBColorspace.
11396 WandExport MagickBooleanType MagickTransformImageColorspace(MagickWand *wand,
11397 const ColorspaceType colorspace)
11399 assert(wand != (MagickWand *) NULL);
11400 assert(wand->signature == WandSignature);
11401 if (wand->debug != MagickFalse)
11402 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11403 if (wand->images == (Image *) NULL)
11404 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11405 return(TransformImageColorspace(wand->images,colorspace,wand->exception));
11409 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11413 % 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 %
11417 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11419 % MagickTransparentPaintImage() changes any pixel that matches color with the
11420 % color defined by fill.
11422 % The format of the MagickTransparentPaintImage method is:
11424 % MagickBooleanType MagickTransparentPaintImage(MagickWand *wand,
11425 % const PixelWand *target,const double alpha,const double fuzz,
11426 % const MagickBooleanType invert)
11428 % A description of each parameter follows:
11430 % o wand: the magick wand.
11432 % o target: Change this target color to specified alpha value within
11435 % o alpha: the level of transparency: 1.0 is fully opaque and 0.0 is fully
11438 % o fuzz: By default target must match a particular pixel color
11439 % exactly. However, in many cases two colors may differ by a small amount.
11440 % The fuzz member of image defines how much tolerance is acceptable to
11441 % consider two colors as the same. For example, set fuzz to 10 and the
11442 % color red at intensities of 100 and 102 respectively are now interpreted
11443 % as the same color for the purposes of the floodfill.
11445 % o invert: paint any pixel that does not match the target color.
11448 WandExport MagickBooleanType MagickTransparentPaintImage(MagickWand *wand,
11449 const PixelWand *target,const double alpha,const double fuzz,
11450 const MagickBooleanType invert)
11458 assert(wand != (MagickWand *) NULL);
11459 assert(wand->signature == WandSignature);
11460 if (wand->debug != MagickFalse)
11461 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11462 if (wand->images == (Image *) NULL)
11463 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11464 PixelGetMagickColor(target,&target_pixel);
11465 wand->images->fuzz=fuzz;
11466 status=TransparentPaintImage(wand->images,&target_pixel,ClampToQuantum(
11467 QuantumRange*alpha),invert,&wand->images->exception);
11472 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11476 % M a g i c k T r a n s p o s e I m a g e %
11480 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11482 % MagickTransposeImage() creates a vertical mirror image by reflecting the
11483 % pixels around the central x-axis while rotating them 90-degrees.
11485 % The format of the MagickTransposeImage method is:
11487 % MagickBooleanType MagickTransposeImage(MagickWand *wand)
11489 % A description of each parameter follows:
11491 % o wand: the magick wand.
11494 WandExport MagickBooleanType MagickTransposeImage(MagickWand *wand)
11499 assert(wand != (MagickWand *) NULL);
11500 assert(wand->signature == WandSignature);
11501 if (wand->debug != MagickFalse)
11502 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11503 if (wand->images == (Image *) NULL)
11504 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11505 transpose_image=TransposeImage(wand->images,wand->exception);
11506 if (transpose_image == (Image *) NULL)
11507 return(MagickFalse);
11508 ReplaceImageInList(&wand->images,transpose_image);
11509 return(MagickTrue);
11513 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11517 % M a g i c k T r a n s v e r s e I m a g e %
11521 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11523 % MagickTransverseImage() creates a horizontal mirror image by reflecting the
11524 % pixels around the central y-axis while rotating them 270-degrees.
11526 % The format of the MagickTransverseImage method is:
11528 % MagickBooleanType MagickTransverseImage(MagickWand *wand)
11530 % A description of each parameter follows:
11532 % o wand: the magick wand.
11535 WandExport MagickBooleanType MagickTransverseImage(MagickWand *wand)
11540 assert(wand != (MagickWand *) NULL);
11541 assert(wand->signature == WandSignature);
11542 if (wand->debug != MagickFalse)
11543 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11544 if (wand->images == (Image *) NULL)
11545 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11546 transverse_image=TransverseImage(wand->images,wand->exception);
11547 if (transverse_image == (Image *) NULL)
11548 return(MagickFalse);
11549 ReplaceImageInList(&wand->images,transverse_image);
11550 return(MagickTrue);
11554 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11558 % M a g i c k T r i m I m a g e %
11562 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11564 % MagickTrimImage() remove edges that are the background color from the image.
11566 % The format of the MagickTrimImage method is:
11568 % MagickBooleanType MagickTrimImage(MagickWand *wand,const double fuzz)
11570 % A description of each parameter follows:
11572 % o wand: the magick wand.
11574 % o fuzz: By default target must match a particular pixel color
11575 % exactly. However, in many cases two colors may differ by a small amount.
11576 % The fuzz member of image defines how much tolerance is acceptable to
11577 % consider two colors as the same. For example, set fuzz to 10 and the
11578 % color red at intensities of 100 and 102 respectively are now interpreted
11579 % as the same color for the purposes of the floodfill.
11582 WandExport MagickBooleanType MagickTrimImage(MagickWand *wand,const double fuzz)
11587 assert(wand != (MagickWand *) NULL);
11588 assert(wand->signature == WandSignature);
11589 if (wand->debug != MagickFalse)
11590 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11591 if (wand->images == (Image *) NULL)
11592 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11593 wand->images->fuzz=fuzz;
11594 trim_image=TrimImage(wand->images,wand->exception);
11595 if (trim_image == (Image *) NULL)
11596 return(MagickFalse);
11597 ReplaceImageInList(&wand->images,trim_image);
11598 return(MagickTrue);
11602 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11606 % M a g i c k U n i q u e I m a g e C o l o r s %
11610 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11612 % MagickUniqueImageColors() discards all but one of any pixel color.
11614 % The format of the MagickUniqueImageColors method is:
11616 % MagickBooleanType MagickUniqueImageColors(MagickWand *wand)
11618 % A description of each parameter follows:
11620 % o wand: the magick wand.
11623 WandExport MagickBooleanType MagickUniqueImageColors(MagickWand *wand)
11628 assert(wand != (MagickWand *) NULL);
11629 assert(wand->signature == WandSignature);
11630 if (wand->debug != MagickFalse)
11631 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11632 if (wand->images == (Image *) NULL)
11633 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11634 unique_image=UniqueImageColors(wand->images,wand->exception);
11635 if (unique_image == (Image *) NULL)
11636 return(MagickFalse);
11637 ReplaceImageInList(&wand->images,unique_image);
11638 return(MagickTrue);
11642 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11646 % M a g i c k U n s h a r p M a s k I m a g e %
11650 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11652 % MagickUnsharpMaskImage() sharpens an image. We convolve the image with a
11653 % Gaussian operator of the given radius and standard deviation (sigma).
11654 % For reasonable results, radius should be larger than sigma. Use a radius
11655 % of 0 and UnsharpMaskImage() selects a suitable radius for you.
11657 % The format of the MagickUnsharpMaskImage method is:
11659 % MagickBooleanType MagickUnsharpMaskImage(MagickWand *wand,
11660 % const double radius,const double sigma,const double amount,
11661 % const double threshold)
11663 % A description of each parameter follows:
11665 % o wand: the magick wand.
11667 % o radius: the radius of the Gaussian, in pixels, not counting the center
11670 % o sigma: the standard deviation of the Gaussian, in pixels.
11672 % o amount: the percentage of the difference between the original and the
11673 % blur image that is added back into the original.
11675 % o threshold: the threshold in pixels needed to apply the diffence amount.
11678 WandExport MagickBooleanType MagickUnsharpMaskImage(MagickWand *wand,
11679 const double radius,const double sigma,const double amount,
11680 const double threshold)
11685 assert(wand != (MagickWand *) NULL);
11686 assert(wand->signature == WandSignature);
11687 if (wand->debug != MagickFalse)
11688 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11689 if (wand->images == (Image *) NULL)
11690 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11691 unsharp_image=UnsharpMaskImage(wand->images,radius,sigma,amount,threshold,
11693 if (unsharp_image == (Image *) NULL)
11694 return(MagickFalse);
11695 ReplaceImageInList(&wand->images,unsharp_image);
11696 return(MagickTrue);
11700 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11704 % M a g i c k V i g n e t t e I m a g e %
11708 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11710 % MagickVignetteImage() softens the edges of the image in vignette style.
11712 % The format of the MagickVignetteImage method is:
11714 % MagickBooleanType MagickVignetteImage(MagickWand *wand,
11715 % const double black_point,const double white_point,const ssize_t x,
11718 % A description of each parameter follows:
11720 % o wand: the magick wand.
11722 % o black_point: the black point.
11724 % o white_point: the white point.
11726 % o x, y: Define the x and y ellipse offset.
11729 WandExport MagickBooleanType MagickVignetteImage(MagickWand *wand,
11730 const double black_point,const double white_point,const ssize_t x,const ssize_t y)
11735 assert(wand != (MagickWand *) NULL);
11736 assert(wand->signature == WandSignature);
11737 if (wand->debug != MagickFalse)
11738 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11739 if (wand->images == (Image *) NULL)
11740 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11741 vignette_image=VignetteImage(wand->images,black_point,white_point,x,y,
11743 if (vignette_image == (Image *) NULL)
11744 return(MagickFalse);
11745 ReplaceImageInList(&wand->images,vignette_image);
11746 return(MagickTrue);
11750 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11754 % M a g i c k W a v e I m a g e %
11758 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11760 % MagickWaveImage() creates a "ripple" effect in the image by shifting
11761 % the pixels vertically along a sine wave whose amplitude and wavelength
11762 % is specified by the given parameters.
11764 % The format of the MagickWaveImage method is:
11766 % MagickBooleanType MagickWaveImage(MagickWand *wand,
11767 % const double amplitude,const double wave_length,
11768 % const PixelInterpolateMethod method)
11770 % A description of each parameter follows:
11772 % o wand: the magick wand.
11774 % o amplitude, wave_length: Define the amplitude and wave length of the
11777 % o method: the pixel interpolation method.
11780 WandExport MagickBooleanType MagickWaveImage(MagickWand *wand,
11781 const double amplitude,const double wave_length,
11782 const PixelInterpolateMethod method)
11787 assert(wand != (MagickWand *) NULL);
11788 assert(wand->signature == WandSignature);
11789 if (wand->debug != MagickFalse)
11790 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11791 if (wand->images == (Image *) NULL)
11792 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11793 wave_image=WaveImage(wand->images,amplitude,wave_length,method,
11795 if (wave_image == (Image *) NULL)
11796 return(MagickFalse);
11797 ReplaceImageInList(&wand->images,wave_image);
11798 return(MagickTrue);
11802 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11806 % 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 %
11810 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11812 % MagickWhiteThresholdImage() is like ThresholdImage() but force all pixels
11813 % above the threshold into white while leaving all pixels below the threshold
11816 % The format of the MagickWhiteThresholdImage method is:
11818 % MagickBooleanType MagickWhiteThresholdImage(MagickWand *wand,
11819 % const PixelWand *threshold)
11821 % A description of each parameter follows:
11823 % o wand: the magick wand.
11825 % o threshold: the pixel wand.
11828 WandExport MagickBooleanType MagickWhiteThresholdImage(MagickWand *wand,
11829 const PixelWand *threshold)
11832 thresholds[MaxTextExtent];
11834 assert(wand != (MagickWand *) NULL);
11835 assert(wand->signature == WandSignature);
11836 if (wand->debug != MagickFalse)
11837 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11838 if (wand->images == (Image *) NULL)
11839 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11840 (void) FormatLocaleString(thresholds,MaxTextExtent,
11841 QuantumFormat "," QuantumFormat "," QuantumFormat "," QuantumFormat,
11842 PixelGetRedQuantum(threshold),PixelGetGreenQuantum(threshold),
11843 PixelGetBlueQuantum(threshold),PixelGetAlphaQuantum(threshold));
11844 return(WhiteThresholdImage(wand->images,thresholds,wand->exception));
11848 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11852 % M a g i c k W r i t e I m a g e %
11856 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11858 % MagickWriteImage() writes an image to the specified filename. If the
11859 % filename parameter is NULL, the image is written to the filename set
11860 % by MagickReadImage() or MagickSetImageFilename().
11862 % The format of the MagickWriteImage method is:
11864 % MagickBooleanType MagickWriteImage(MagickWand *wand,
11865 % const char *filename)
11867 % A description of each parameter follows:
11869 % o wand: the magick wand.
11871 % o filename: the image filename.
11875 WandExport MagickBooleanType MagickWriteImage(MagickWand *wand,
11876 const char *filename)
11887 assert(wand != (MagickWand *) NULL);
11888 assert(wand->signature == WandSignature);
11889 if (wand->debug != MagickFalse)
11890 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11891 if (wand->images == (Image *) NULL)
11892 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11893 if (filename != (const char *) NULL)
11894 (void) CopyMagickString(wand->images->filename,filename,MaxTextExtent);
11895 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
11896 if (image == (Image *) NULL)
11897 return(MagickFalse);
11898 write_info=CloneImageInfo(wand->image_info);
11899 write_info->adjoin=MagickTrue;
11900 status=WriteImage(write_info,image,wand->exception);
11901 image=DestroyImage(image);
11902 write_info=DestroyImageInfo(write_info);
11907 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11911 % M a g i c k W r i t e I m a g e F i l e %
11915 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11917 % MagickWriteImageFile() writes an image to an open file descriptor.
11919 % The format of the MagickWriteImageFile method is:
11921 % MagickBooleanType MagickWriteImageFile(MagickWand *wand,FILE *file)
11923 % A description of each parameter follows:
11925 % o wand: the magick wand.
11927 % o file: the file descriptor.
11930 WandExport MagickBooleanType MagickWriteImageFile(MagickWand *wand,FILE *file)
11941 assert(wand != (MagickWand *) NULL);
11942 assert(wand->signature == WandSignature);
11943 assert(file != (FILE *) NULL);
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 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
11949 if (image == (Image *) NULL)
11950 return(MagickFalse);
11951 write_info=CloneImageInfo(wand->image_info);
11952 SetImageInfoFile(write_info,file);
11953 write_info->adjoin=MagickTrue;
11954 status=WriteImage(write_info,image,wand->exception);
11955 write_info=DestroyImageInfo(write_info);
11956 image=DestroyImage(image);
11961 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11965 % M a g i c k W r i t e I m a g e s %
11969 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11971 % MagickWriteImages() writes an image or image sequence.
11973 % The format of the MagickWriteImages method is:
11975 % MagickBooleanType MagickWriteImages(MagickWand *wand,
11976 % const char *filename,const MagickBooleanType adjoin)
11978 % A description of each parameter follows:
11980 % o wand: the magick wand.
11982 % o filename: the image filename.
11984 % o adjoin: join images into a single multi-image file.
11987 WandExport MagickBooleanType MagickWriteImages(MagickWand *wand,
11988 const char *filename,const MagickBooleanType adjoin)
11996 assert(wand != (MagickWand *) NULL);
11997 assert(wand->signature == WandSignature);
11998 if (wand->debug != MagickFalse)
11999 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12000 if (wand->images == (Image *) NULL)
12001 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12002 write_info=CloneImageInfo(wand->image_info);
12003 write_info->adjoin=adjoin;
12004 status=WriteImages(write_info,wand->images,filename,wand->exception);
12005 write_info=DestroyImageInfo(write_info);
12010 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12014 % M a g i c k W r i t e I m a g e s F i l e %
12018 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12020 % MagickWriteImagesFile() writes an image sequence to an open file descriptor.
12022 % The format of the MagickWriteImagesFile method is:
12024 % MagickBooleanType MagickWriteImagesFile(MagickWand *wand,FILE *file)
12026 % A description of each parameter follows:
12028 % o wand: the magick wand.
12030 % o file: the file descriptor.
12033 WandExport MagickBooleanType MagickWriteImagesFile(MagickWand *wand,FILE *file)
12041 assert(wand != (MagickWand *) NULL);
12042 assert(wand->signature == WandSignature);
12043 if (wand->debug != MagickFalse)
12044 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12045 if (wand->images == (Image *) NULL)
12046 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12047 write_info=CloneImageInfo(wand->image_info);
12048 SetImageInfoFile(write_info,file);
12049 write_info->adjoin=MagickTrue;
12050 status=WriteImages(write_info,wand->images,(const char *) NULL,
12052 write_info=DestroyImageInfo(write_info);