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->images->exception);
854 if (status == MagickFalse)
855 InheritException(wand->exception,&wand->images->exception);
860 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
864 % M a g i c k B l u e S h i f t I m a g e %
868 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
870 % MagickBlueShiftImage() mutes the colors of the image to simulate a scene at
871 % nighttime in the moonlight.
873 % The format of the MagickBlueShiftImage method is:
875 % MagickBooleanType MagickBlueShiftImage(MagickWand *wand,
876 % const double factor)
878 % A description of each parameter follows:
880 % o wand: the magick wand.
882 % o factor: the blue shift factor (default 1.5)
885 WandExport MagickBooleanType MagickBlueShiftImage(MagickWand *wand,
891 assert(wand != (MagickWand *) NULL);
892 assert(wand->signature == WandSignature);
893 if (wand->debug != MagickFalse)
894 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
895 if (wand->images == (Image *) NULL)
896 ThrowWandException(WandError,"ContainsNoImages",wand->name);
897 shift_image=BlueShiftImage(wand->images,factor,wand->exception);
898 if (shift_image == (Image *) NULL)
900 ReplaceImageInList(&wand->images,shift_image);
905 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
909 % M a g i c k B l u r I m a g e %
913 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
915 % MagickBlurImage() blurs an image. We convolve the image with a
916 % gaussian operator of the given radius and standard deviation (sigma).
917 % For reasonable results, the radius should be larger than sigma. Use a
918 % radius of 0 and BlurImage() selects a suitable radius for you.
920 % The format of the MagickBlurImage method is:
922 % MagickBooleanType MagickBlurImage(MagickWand *wand,const double radius,
923 % const double sigmaconst double bias)
925 % A description of each parameter follows:
927 % o wand: the magick wand.
929 % o radius: the radius of the , in pixels, not counting the center
932 % o sigma: the standard deviation of the , in pixels.
937 WandExport MagickBooleanType MagickBlurImage(MagickWand *wand,
938 const double radius,const double sigma,const double bias)
943 assert(wand != (MagickWand *) NULL);
944 assert(wand->signature == WandSignature);
945 if (wand->debug != MagickFalse)
946 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
947 if (wand->images == (Image *) NULL)
948 ThrowWandException(WandError,"ContainsNoImages",wand->name);
949 blur_image=BlurImage(wand->images,radius,sigma,bias,wand->exception);
950 if (blur_image == (Image *) NULL)
952 ReplaceImageInList(&wand->images,blur_image);
957 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
961 % M a g i c k B o r d e r I m a g e %
965 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
967 % MagickBorderImage() surrounds the image with a border of the color defined
968 % by the bordercolor pixel wand.
970 % The format of the MagickBorderImage method is:
972 % MagickBooleanType MagickBorderImage(MagickWand *wand,
973 % const PixelWand *bordercolor,const size_t width,
974 % const size_t height,const CompositeOperator compose)
976 % A description of each parameter follows:
978 % o wand: the magick wand.
980 % o bordercolor: the border color pixel wand.
982 % o width: the border width.
984 % o height: the border height.
986 % o compose: the composite operator.
989 WandExport MagickBooleanType MagickBorderImage(MagickWand *wand,
990 const PixelWand *bordercolor,const size_t width,const size_t height,
991 const CompositeOperator compose)
999 assert(wand != (MagickWand *) NULL);
1000 assert(wand->signature == WandSignature);
1001 if (wand->debug != MagickFalse)
1002 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1003 if (wand->images == (Image *) NULL)
1004 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1005 border_info.width=width;
1006 border_info.height=height;
1009 PixelGetQuantumPacket(bordercolor,&wand->images->border_color);
1010 border_image=BorderImage(wand->images,&border_info,compose,wand->exception);
1011 if (border_image == (Image *) NULL)
1012 return(MagickFalse);
1013 ReplaceImageInList(&wand->images,border_image);
1018 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1022 % 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 %
1026 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1028 % Use MagickBrightnessContrastImage() to change the brightness and/or contrast
1029 % of an image. It converts the brightness and contrast parameters into slope
1030 % and intercept and calls a polynomical function to apply to the image.
1033 % The format of the MagickBrightnessContrastImage method is:
1035 % MagickBooleanType MagickBrightnessContrastImage(MagickWand *wand,
1036 % const double brightness,const double contrast)
1038 % A description of each parameter follows:
1040 % o wand: the magick wand.
1042 % o brightness: the brightness percent (-100 .. 100).
1044 % o contrast: the contrast percent (-100 .. 100).
1047 WandExport MagickBooleanType MagickBrightnessContrastImage(
1048 MagickWand *wand,const double brightness,const double contrast)
1053 assert(wand != (MagickWand *) NULL);
1054 assert(wand->signature == WandSignature);
1055 if (wand->debug != MagickFalse)
1056 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1057 if (wand->images == (Image *) NULL)
1058 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1059 status=BrightnessContrastImage(wand->images,brightness,contrast,
1060 &wand->images->exception);
1065 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1069 % M a g i c k C h a r c o a l I m a g e %
1073 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1075 % MagickCharcoalImage() simulates a charcoal drawing.
1077 % The format of the MagickCharcoalImage method is:
1079 % MagickBooleanType MagickCharcoalImage(MagickWand *wand,
1080 % const double radius,const double sigma,const double bias)
1082 % A description of each parameter follows:
1084 % o wand: the magick wand.
1086 % o radius: the radius of the Gaussian, in pixels, not counting the center
1089 % o sigma: the standard deviation of the Gaussian, in pixels.
1094 WandExport MagickBooleanType MagickCharcoalImage(MagickWand *wand,
1095 const double radius,const double sigma,const double bias)
1100 assert(wand != (MagickWand *) NULL);
1101 assert(wand->signature == WandSignature);
1102 if (wand->debug != MagickFalse)
1103 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1104 if (wand->images == (Image *) NULL)
1105 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1106 charcoal_image=CharcoalImage(wand->images,radius,sigma,bias,wand->exception);
1107 if (charcoal_image == (Image *) NULL)
1108 return(MagickFalse);
1109 ReplaceImageInList(&wand->images,charcoal_image);
1114 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1118 % M a g i c k C h o p I m a g e %
1122 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1124 % MagickChopImage() removes a region of an image and collapses the image to
1125 % occupy the removed portion
1127 % The format of the MagickChopImage method is:
1129 % MagickBooleanType MagickChopImage(MagickWand *wand,
1130 % const size_t width,const size_t height,const ssize_t x,
1133 % A description of each parameter follows:
1135 % o wand: the magick wand.
1137 % o width: the region width.
1139 % o height: the region height.
1141 % o x: the region x offset.
1143 % o y: the region y offset.
1147 WandExport MagickBooleanType MagickChopImage(MagickWand *wand,
1148 const size_t width,const size_t height,const ssize_t x,
1157 assert(wand != (MagickWand *) NULL);
1158 assert(wand->signature == WandSignature);
1159 if (wand->debug != MagickFalse)
1160 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1161 if (wand->images == (Image *) NULL)
1162 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1167 chop_image=ChopImage(wand->images,&chop,wand->exception);
1168 if (chop_image == (Image *) NULL)
1169 return(MagickFalse);
1170 ReplaceImageInList(&wand->images,chop_image);
1175 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1179 % M a g i c k C l a m p I m a g e %
1183 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1185 % MagickClampImage() restricts the color range from 0 to the quantum depth.
1187 % The format of the MagickClampImage method is:
1189 % MagickBooleanType MagickClampImage(MagickWand *wand)
1191 % A description of each parameter follows:
1193 % o wand: the magick wand.
1195 % o channel: the channel.
1198 WandExport MagickBooleanType MagickClampImage(MagickWand *wand)
1203 assert(wand != (MagickWand *) NULL);
1204 assert(wand->signature == WandSignature);
1205 if (wand->debug != MagickFalse)
1206 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1207 if (wand->images == (Image *) NULL)
1208 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1209 status=ClampImage(wand->images);
1210 if (status == MagickFalse)
1211 InheritException(wand->exception,&wand->images->exception);
1216 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1220 % M a g i c k C l i p I m a g e %
1224 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1226 % MagickClipImage() clips along the first path from the 8BIM profile, if
1229 % The format of the MagickClipImage method is:
1231 % MagickBooleanType MagickClipImage(MagickWand *wand)
1233 % A description of each parameter follows:
1235 % o wand: the magick wand.
1238 WandExport MagickBooleanType MagickClipImage(MagickWand *wand)
1243 assert(wand != (MagickWand *) NULL);
1244 assert(wand->signature == WandSignature);
1245 if (wand->debug != MagickFalse)
1246 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1247 if (wand->images == (Image *) NULL)
1248 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1249 status=ClipImage(wand->images,wand->exception);
1254 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1258 % M a g i c k C l i p I m a g e P a t h %
1262 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1264 % MagickClipImagePath() clips along the named paths from the 8BIM profile, if
1265 % present. Later operations take effect inside the path. Id may be a number
1266 % if preceded with #, to work on a numbered path, e.g., "#1" to use the first
1269 % The format of the MagickClipImagePath method is:
1271 % MagickBooleanType MagickClipImagePath(MagickWand *wand,
1272 % const char *pathname,const MagickBooleanType inside)
1274 % A description of each parameter follows:
1276 % o wand: the magick wand.
1278 % o pathname: name of clipping path resource. If name is preceded by #, use
1279 % clipping path numbered by name.
1281 % o inside: if non-zero, later operations take effect inside clipping path.
1282 % Otherwise later operations take effect outside clipping path.
1285 WandExport MagickBooleanType MagickClipImagePath(MagickWand *wand,
1286 const char *pathname,const MagickBooleanType inside)
1291 assert(wand != (MagickWand *) NULL);
1292 assert(wand->signature == WandSignature);
1293 if (wand->debug != MagickFalse)
1294 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1295 if (wand->images == (Image *) NULL)
1296 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1297 status=ClipImagePath(wand->images,pathname,inside,wand->exception);
1302 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1306 % M a g i c k C l u t I m a g e %
1310 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1312 % MagickClutImage() replaces colors in the image from a color lookup table.
1314 % The format of the MagickClutImage method is:
1316 % MagickBooleanType MagickClutImage(MagickWand *wand,
1317 % const MagickWand *clut_wand,const PixelInterpolateMethod method)
1319 % A description of each parameter follows:
1321 % o wand: the magick wand.
1323 % o clut_image: the clut image.
1325 % o method: the pixel interpolation method.
1328 WandExport MagickBooleanType MagickClutImage(MagickWand *wand,
1329 const MagickWand *clut_wand,const PixelInterpolateMethod method)
1334 assert(wand != (MagickWand *) NULL);
1335 assert(wand->signature == WandSignature);
1336 if (wand->debug != MagickFalse)
1337 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1338 if ((wand->images == (Image *) NULL) || (clut_wand->images == (Image *) NULL))
1339 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1340 status=ClutImage(wand->images,clut_wand->images,method,wand->exception);
1345 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1349 % M a g i c k C o a l e s c e I m a g e s %
1353 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1355 % MagickCoalesceImages() composites a set of images while respecting any page
1356 % offsets and disposal methods. GIF, MIFF, and MNG animation sequences
1357 % typically start with an image background and each subsequent image
1358 % varies in size and offset. MagickCoalesceImages() returns a new sequence
1359 % where each image in the sequence is the same size as the first and
1360 % composited with the next image in the sequence.
1362 % The format of the MagickCoalesceImages method is:
1364 % MagickWand *MagickCoalesceImages(MagickWand *wand)
1366 % A description of each parameter follows:
1368 % o wand: the magick wand.
1371 WandExport MagickWand *MagickCoalesceImages(MagickWand *wand)
1376 assert(wand != (MagickWand *) NULL);
1377 assert(wand->signature == WandSignature);
1378 if (wand->debug != MagickFalse)
1379 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1380 if (wand->images == (Image *) NULL)
1381 return((MagickWand *) NULL);
1382 coalesce_image=CoalesceImages(wand->images,wand->exception);
1383 if (coalesce_image == (Image *) NULL)
1384 return((MagickWand *) NULL);
1385 return(CloneMagickWandFromImages(wand,coalesce_image));
1389 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1393 % M a g i c k C o l o r D e c i s i o n I m a g e %
1397 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1399 % MagickColorDecisionListImage() accepts a lightweight Color Correction
1400 % Collection (CCC) file which solely contains one or more color corrections
1401 % and applies the color correction to the image. Here is a sample CCC file:
1403 % <ColorCorrectionCollection xmlns="urn:ASC:CDL:v1.2">
1404 % <ColorCorrection id="cc03345">
1406 % <Slope> 0.9 1.2 0.5 </Slope>
1407 % <Offset> 0.4 -0.5 0.6 </Offset>
1408 % <Power> 1.0 0.8 1.5 </Power>
1411 % <Saturation> 0.85 </Saturation>
1413 % </ColorCorrection>
1414 % </ColorCorrectionCollection>
1416 % which includes the offset, slope, and power for each of the RGB channels
1417 % as well as the saturation.
1419 % The format of the MagickColorDecisionListImage method is:
1421 % MagickBooleanType MagickColorDecisionListImage(MagickWand *wand,
1422 % const double gamma)
1424 % A description of each parameter follows:
1426 % o wand: the magick wand.
1428 % o color_correction_collection: the color correction collection in XML.
1431 WandExport MagickBooleanType MagickColorDecisionListImage(MagickWand *wand,
1432 const char *color_correction_collection)
1437 assert(wand != (MagickWand *) NULL);
1438 assert(wand->signature == WandSignature);
1439 if (wand->debug != MagickFalse)
1440 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1441 if (wand->images == (Image *) NULL)
1442 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1443 status=ColorDecisionListImage(wand->images,color_correction_collection,
1444 &wand->images->exception);
1449 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1453 % M a g i c k C o l o r i z e I m a g e %
1457 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1459 % MagickColorizeImage() blends the fill color with each pixel in the image.
1461 % The format of the MagickColorizeImage method is:
1463 % MagickBooleanType MagickColorizeImage(MagickWand *wand,
1464 % const PixelWand *colorize,const PixelWand *blend)
1466 % A description of each parameter follows:
1468 % o wand: the magick wand.
1470 % o colorize: the colorize pixel wand.
1472 % o alpha: the alpha pixel wand.
1475 WandExport MagickBooleanType MagickColorizeImage(MagickWand *wand,
1476 const PixelWand *colorize,const PixelWand *blend)
1479 percent_blend[MaxTextExtent];
1487 assert(wand != (MagickWand *) NULL);
1488 assert(wand->signature == WandSignature);
1489 if (wand->debug != MagickFalse)
1490 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1491 if (wand->images == (Image *) NULL)
1492 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1493 GetPixelInfo(wand->images,&target);
1494 if (target.colorspace != CMYKColorspace)
1495 (void) FormatLocaleString(percent_blend,MaxTextExtent,
1496 "%g,%g,%g,%g",(double) (100.0*QuantumScale*
1497 PixelGetRedQuantum(blend)),(double) (100.0*QuantumScale*
1498 PixelGetGreenQuantum(blend)),(double) (100.0*QuantumScale*
1499 PixelGetBlueQuantum(blend)),(double) (100.0*QuantumScale*
1500 PixelGetAlphaQuantum(blend)));
1502 (void) FormatLocaleString(percent_blend,MaxTextExtent,
1503 "%g,%g,%g,%g,%g",(double) (100.0*QuantumScale*
1504 PixelGetRedQuantum(blend)),(double) (100.0*QuantumScale*
1505 PixelGetGreenQuantum(blend)),(double) (100.0*QuantumScale*
1506 PixelGetBlueQuantum(blend)),(double) (100.0*QuantumScale*
1507 PixelGetBlackQuantum(blend)),(double) (100.0*QuantumScale*
1508 PixelGetAlphaQuantum(blend)));
1509 target=PixelGetPixel(colorize);
1510 colorize_image=ColorizeImage(wand->images,percent_blend,&target,
1512 if (colorize_image == (Image *) NULL)
1513 return(MagickFalse);
1514 ReplaceImageInList(&wand->images,colorize_image);
1519 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1523 % M a g i c k C o l o r M a t r i x I m a g e %
1527 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1529 % MagickColorMatrixImage() apply color transformation to an image. The method
1530 % permits saturation changes, hue rotation, luminance to alpha, and various
1531 % other effects. Although variable-sized transformation matrices can be used,
1532 % typically one uses a 5x5 matrix for an RGBA image and a 6x6 for CMYKA
1533 % (or RGBA with offsets). The matrix is similar to those used by Adobe Flash
1534 % except offsets are in column 6 rather than 5 (in support of CMYKA images)
1535 % and offsets are normalized (divide Flash offset by 255).
1537 % The format of the MagickColorMatrixImage method is:
1539 % MagickBooleanType MagickColorMatrixImage(MagickWand *wand,
1540 % const KernelInfo *color_matrix)
1542 % A description of each parameter follows:
1544 % o wand: the magick wand.
1546 % o color_matrix: the color matrix.
1549 WandExport MagickBooleanType MagickColorMatrixImage(MagickWand *wand,
1550 const KernelInfo *color_matrix)
1555 assert(wand != (MagickWand *) NULL);
1556 assert(wand->signature == WandSignature);
1557 if (wand->debug != MagickFalse)
1558 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1559 if (color_matrix == (const KernelInfo *) NULL)
1560 return(MagickFalse);
1561 if (wand->images == (Image *) NULL)
1562 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1563 color_image=ColorMatrixImage(wand->images,color_matrix,wand->exception);
1564 if (color_image == (Image *) NULL)
1565 return(MagickFalse);
1566 ReplaceImageInList(&wand->images,color_image);
1571 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1575 % M a g i c k C o m b i n e I m a g e s %
1579 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1581 % MagickCombineImages() combines one or more images into a single image. The
1582 % grayscale value of the pixels of each image in the sequence is assigned in
1583 % order to the specified hannels of the combined image. The typical
1584 % ordering would be image 1 => Red, 2 => Green, 3 => Blue, etc.
1586 % The format of the MagickCombineImages method is:
1588 % MagickWand *MagickCombineImages(MagickWand *wand)
1590 % A description of each parameter follows:
1592 % o wand: the magick wand.
1595 WandExport MagickWand *MagickCombineImages(MagickWand *wand)
1600 assert(wand != (MagickWand *) NULL);
1601 assert(wand->signature == WandSignature);
1602 if (wand->debug != MagickFalse)
1603 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1604 if (wand->images == (Image *) NULL)
1605 return((MagickWand *) NULL);
1606 combine_image=CombineImages(wand->images,wand->exception);
1607 if (combine_image == (Image *) NULL)
1608 return((MagickWand *) NULL);
1609 return(CloneMagickWandFromImages(wand,combine_image));
1613 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1617 % M a g i c k C o m m e n t I m a g e %
1621 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1623 % MagickCommentImage() adds a comment to your image.
1625 % The format of the MagickCommentImage method is:
1627 % MagickBooleanType MagickCommentImage(MagickWand *wand,
1628 % const char *comment)
1630 % A description of each parameter follows:
1632 % o wand: the magick wand.
1634 % o comment: the image comment.
1637 WandExport MagickBooleanType MagickCommentImage(MagickWand *wand,
1638 const char *comment)
1643 assert(wand != (MagickWand *) NULL);
1644 assert(wand->signature == WandSignature);
1645 if (wand->debug != MagickFalse)
1646 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1647 if (wand->images == (Image *) NULL)
1648 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1649 status=SetImageProperty(wand->images,"comment",comment);
1650 if (status == MagickFalse)
1651 InheritException(wand->exception,&wand->images->exception);
1656 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1660 % M a g i c k C o m p a r e I m a g e L a y e r s %
1664 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1666 % MagickCompareImagesLayers() compares each image with the next in a sequence
1667 % and returns the maximum bounding region of any pixel differences it
1670 % The format of the MagickCompareImagesLayers method is:
1672 % MagickWand *MagickCompareImagesLayers(MagickWand *wand,
1673 % const ImageLayerMethod method)
1675 % A description of each parameter follows:
1677 % o wand: the magick wand.
1679 % o method: the compare method.
1682 WandExport MagickWand *MagickCompareImagesLayers(MagickWand *wand,
1683 const ImageLayerMethod method)
1688 assert(wand != (MagickWand *) NULL);
1689 assert(wand->signature == WandSignature);
1690 if (wand->debug != MagickFalse)
1691 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1692 if (wand->images == (Image *) NULL)
1693 return((MagickWand *) NULL);
1694 layers_image=CompareImagesLayers(wand->images,method,wand->exception);
1695 if (layers_image == (Image *) NULL)
1696 return((MagickWand *) NULL);
1697 return(CloneMagickWandFromImages(wand,layers_image));
1701 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1705 % M a g i c k C o m p a r e I m a g e s %
1709 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1711 % MagickCompareImages() compares an image to a reconstructed image and returns
1712 % the specified difference image.
1714 % The format of the MagickCompareImages method is:
1716 % MagickWand *MagickCompareImages(MagickWand *wand,
1717 % const MagickWand *reference,const MetricType metric,
1718 % double *distortion)
1720 % A description of each parameter follows:
1722 % o wand: the magick wand.
1724 % o reference: the reference wand.
1726 % o metric: the metric.
1728 % o distortion: the computed distortion between the images.
1731 WandExport MagickWand *MagickCompareImages(MagickWand *wand,
1732 const MagickWand *reference,const MetricType metric,double *distortion)
1738 assert(wand != (MagickWand *) NULL);
1739 assert(wand->signature == WandSignature);
1740 if (wand->debug != MagickFalse)
1741 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1742 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
1744 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
1745 "ContainsNoImages","`%s'",wand->name);
1746 return((MagickWand *) NULL);
1748 compare_image=CompareImages(wand->images,reference->images,metric,distortion,
1749 &wand->images->exception);
1750 if (compare_image == (Image *) NULL)
1751 return((MagickWand *) NULL);
1752 return(CloneMagickWandFromImages(wand,compare_image));
1756 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1760 % M a g i c k C o m p o s i t e I m a g e %
1764 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1766 % MagickCompositeImage() composite one image onto another at the specified
1769 % The format of the MagickCompositeImage method is:
1771 % MagickBooleanType MagickCompositeImage(MagickWand *wand,
1772 % const MagickWand *composite_wand,const CompositeOperator compose,
1773 % const ssize_t x,const ssize_t y)
1775 % A description of each parameter follows:
1777 % o wand: the magick wand.
1779 % o composite_image: the composite image.
1781 % o compose: This operator affects how the composite is applied to the
1782 % image. The default is Over. Choose from these operators:
1784 % OverCompositeOp InCompositeOp OutCompositeOp
1785 % AtopCompositeOp XorCompositeOp PlusCompositeOp
1786 % MinusCompositeOp AddCompositeOp SubtractCompositeOp
1787 % DifferenceCompositeOp BumpmapCompositeOp CopyCompositeOp
1788 % DisplaceCompositeOp
1790 % o x: the column offset of the composited image.
1792 % o y: the row offset of the composited image.
1795 WandExport MagickBooleanType MagickCompositeImage(MagickWand *wand,
1796 const MagickWand *composite_wand,const CompositeOperator compose,
1797 const ssize_t x,const ssize_t y)
1802 assert(wand != (MagickWand *) NULL);
1803 assert(wand->signature == WandSignature);
1804 if (wand->debug != MagickFalse)
1805 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1806 if ((wand->images == (Image *) NULL) ||
1807 (composite_wand->images == (Image *) NULL))
1808 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1809 status=CompositeImage(wand->images,compose,composite_wand->images,x,y);
1810 if (status == MagickFalse)
1811 InheritException(wand->exception,&wand->images->exception);
1816 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1820 % M a g i c k C o n t r a s t I m a g e %
1824 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1826 % MagickContrastImage() enhances the intensity differences between the lighter
1827 % and darker elements of the image. Set sharpen to a value other than 0 to
1828 % increase the image contrast otherwise the contrast is reduced.
1830 % The format of the MagickContrastImage method is:
1832 % MagickBooleanType MagickContrastImage(MagickWand *wand,
1833 % const MagickBooleanType sharpen)
1835 % A description of each parameter follows:
1837 % o wand: the magick wand.
1839 % o sharpen: Increase or decrease image contrast.
1843 WandExport MagickBooleanType MagickContrastImage(MagickWand *wand,
1844 const MagickBooleanType sharpen)
1849 assert(wand != (MagickWand *) NULL);
1850 assert(wand->signature == WandSignature);
1851 if (wand->debug != MagickFalse)
1852 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1853 if (wand->images == (Image *) NULL)
1854 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1855 status=ContrastImage(wand->images,sharpen,&wand->images->exception);
1860 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1864 % 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 %
1868 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1870 % MagickContrastStretchImage() enhances the contrast of a color image by
1871 % adjusting the pixels color to span the entire range of colors available.
1872 % You can also reduce the influence of a particular channel with a gamma
1875 % The format of the MagickContrastStretchImage method is:
1877 % MagickBooleanType MagickContrastStretchImage(MagickWand *wand,
1878 % const double black_point,const double white_point)
1880 % A description of each parameter follows:
1882 % o wand: the magick wand.
1884 % o black_point: the black point.
1886 % o white_point: the white point.
1889 WandExport MagickBooleanType MagickContrastStretchImage(MagickWand *wand,
1890 const double black_point,const double white_point)
1895 assert(wand != (MagickWand *) NULL);
1896 assert(wand->signature == WandSignature);
1897 if (wand->debug != MagickFalse)
1898 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1899 if (wand->images == (Image *) NULL)
1900 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1901 status=ContrastStretchImage(wand->images,black_point,white_point,
1902 &wand->images->exception);
1907 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1911 % M a g i c k C o n v o l v e I m a g e %
1915 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1917 % MagickConvolveImage() applies a custom convolution kernel to the image.
1919 % The format of the MagickConvolveImage method is:
1921 % MagickBooleanType MagickConvolveImage(MagickWand *wand,
1922 % const KernelInfo *kernel)
1924 % A description of each parameter follows:
1926 % o wand: the magick wand.
1928 % o kernel: An array of doubles representing the convolution kernel.
1931 WandExport MagickBooleanType MagickConvolveImage(MagickWand *wand,
1932 const KernelInfo *kernel)
1937 assert(wand != (MagickWand *) NULL);
1938 assert(wand->signature == WandSignature);
1939 if (wand->debug != MagickFalse)
1940 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1941 if (kernel == (const KernelInfo *) NULL)
1942 return(MagickFalse);
1943 if (wand->images == (Image *) NULL)
1944 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1945 filter_image=ConvolveImage(wand->images,kernel,wand->exception);
1946 if (filter_image == (Image *) NULL)
1947 return(MagickFalse);
1948 ReplaceImageInList(&wand->images,filter_image);
1953 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1957 % M a g i c k C r o p I m a g e %
1961 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1963 % MagickCropImage() extracts a region of the image.
1965 % The format of the MagickCropImage method is:
1967 % MagickBooleanType MagickCropImage(MagickWand *wand,
1968 % const size_t width,const size_t height,const ssize_t x,const ssize_t y)
1970 % A description of each parameter follows:
1972 % o wand: the magick wand.
1974 % o width: the region width.
1976 % o height: the region height.
1978 % o x: the region x-offset.
1980 % o y: the region y-offset.
1983 WandExport MagickBooleanType MagickCropImage(MagickWand *wand,
1984 const size_t width,const size_t height,const ssize_t x,const ssize_t y)
1992 assert(wand != (MagickWand *) NULL);
1993 assert(wand->signature == WandSignature);
1994 if (wand->debug != MagickFalse)
1995 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1996 if (wand->images == (Image *) NULL)
1997 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2002 crop_image=CropImage(wand->images,&crop,wand->exception);
2003 if (crop_image == (Image *) NULL)
2004 return(MagickFalse);
2005 ReplaceImageInList(&wand->images,crop_image);
2010 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2014 % M a g i c k C y c l e C o l o r m a p I m a g e %
2018 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2020 % MagickCycleColormapImage() displaces an image's colormap by a given number
2021 % of positions. If you cycle the colormap a number of times you can produce
2022 % a psychodelic effect.
2024 % The format of the MagickCycleColormapImage method is:
2026 % MagickBooleanType MagickCycleColormapImage(MagickWand *wand,
2027 % const ssize_t displace)
2029 % A description of each parameter follows:
2031 % o wand: the magick wand.
2033 % o pixel_wand: the pixel wand.
2036 WandExport MagickBooleanType MagickCycleColormapImage(MagickWand *wand,
2037 const ssize_t displace)
2042 assert(wand != (MagickWand *) NULL);
2043 assert(wand->signature == WandSignature);
2044 if (wand->debug != MagickFalse)
2045 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2046 if (wand->images == (Image *) NULL)
2047 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2048 status=CycleColormapImage(wand->images,displace,wand->exception);
2053 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2057 % M a g i c k C o n s t i t u t e I m a g e %
2061 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2063 % MagickConstituteImage() adds an image to the wand comprised of the pixel
2064 % data you supply. The pixel data must be in scanline order top-to-bottom.
2065 % The data can be char, short int, int, float, or double. Float and double
2066 % require the pixels to be normalized [0..1], otherwise [0..Max], where Max
2067 % is the maximum value the type can accomodate (e.g. 255 for char). For
2068 % example, to create a 640x480 image from unsigned red-green-blue character
2071 % MagickConstituteImage(wand,640,640,"RGB",CharPixel,pixels);
2073 % The format of the MagickConstituteImage method is:
2075 % MagickBooleanType MagickConstituteImage(MagickWand *wand,
2076 % const size_t columns,const size_t rows,const char *map,
2077 % const StorageType storage,void *pixels)
2079 % A description of each parameter follows:
2081 % o wand: the magick wand.
2083 % o columns: width in pixels of the image.
2085 % o rows: height in pixels of the image.
2087 % o map: This string reflects the expected ordering of the pixel array.
2088 % It can be any combination or order of R = red, G = green, B = blue,
2089 % A = alpha (0 is transparent), O = alpha (0 is opaque), C = cyan,
2090 % Y = yellow, M = magenta, K = black, I = intensity (for grayscale),
2093 % o storage: Define the data type of the pixels. Float and double types are
2094 % expected to be normalized [0..1] otherwise [0..QuantumRange]. Choose from
2095 % these types: CharPixel, DoublePixel, FloatPixel, IntegerPixel,
2096 % LongPixel, QuantumPixel, or ShortPixel.
2098 % o pixels: This array of values contain the pixel components as defined by
2099 % map and type. You must preallocate this array where the expected
2100 % length varies depending on the values of width, height, map, and type.
2104 WandExport MagickBooleanType MagickConstituteImage(MagickWand *wand,
2105 const size_t columns,const size_t rows,const char *map,
2106 const StorageType storage,const void *pixels)
2111 assert(wand != (MagickWand *) NULL);
2112 assert(wand->signature == WandSignature);
2113 if (wand->debug != MagickFalse)
2114 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2115 images=ConstituteImage(columns,rows,map,storage,pixels,wand->exception);
2116 if (images == (Image *) NULL)
2117 return(MagickFalse);
2118 return(InsertImageInWand(wand,images));
2122 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2126 % M a g i c k D e c i p h e r I m a g e %
2130 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2132 % MagickDecipherImage() converts cipher pixels to plain pixels.
2134 % The format of the MagickDecipherImage method is:
2136 % MagickBooleanType MagickDecipherImage(MagickWand *wand,
2137 % const char *passphrase)
2139 % A description of each parameter follows:
2141 % o wand: the magick wand.
2143 % o passphrase: the passphrase.
2146 WandExport MagickBooleanType MagickDecipherImage(MagickWand *wand,
2147 const char *passphrase)
2149 assert(wand != (MagickWand *) NULL);
2150 assert(wand->signature == WandSignature);
2151 if (wand->debug != MagickFalse)
2152 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2153 if (wand->images == (Image *) NULL)
2154 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2155 return(DecipherImage(wand->images,passphrase,&wand->images->exception));
2159 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2163 % M a g i c k D e c o n s t r u c t I m a g e s %
2167 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2169 % MagickDeconstructImages() compares each image with the next in a sequence
2170 % and returns the maximum bounding region of any pixel differences it
2173 % The format of the MagickDeconstructImages method is:
2175 % MagickWand *MagickDeconstructImages(MagickWand *wand)
2177 % A description of each parameter follows:
2179 % o wand: the magick wand.
2182 WandExport MagickWand *MagickDeconstructImages(MagickWand *wand)
2187 assert(wand != (MagickWand *) NULL);
2188 assert(wand->signature == WandSignature);
2189 if (wand->debug != MagickFalse)
2190 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2191 if (wand->images == (Image *) NULL)
2192 return((MagickWand *) NULL);
2193 deconstruct_image=CompareImagesLayers(wand->images,CompareAnyLayer,
2195 if (deconstruct_image == (Image *) NULL)
2196 return((MagickWand *) NULL);
2197 return(CloneMagickWandFromImages(wand,deconstruct_image));
2201 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2205 % M a g i c k D e s k e w I m a g e %
2209 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2211 % MagickDeskewImage() removes skew from the image. Skew is an artifact that
2212 % occurs in scanned images because of the camera being misaligned,
2213 % imperfections in the scanning or surface, or simply because the paper was
2214 % not placed completely flat when scanned.
2216 % The format of the MagickDeskewImage method is:
2218 % MagickBooleanType MagickDeskewImage(MagickWand *wand,
2219 % const double threshold)
2221 % A description of each parameter follows:
2223 % o wand: the magick wand.
2225 % o threshold: separate background from foreground.
2228 WandExport MagickBooleanType MagickDeskewImage(MagickWand *wand,
2229 const double threshold)
2234 assert(wand != (MagickWand *) NULL);
2235 assert(wand->signature == WandSignature);
2236 if (wand->debug != MagickFalse)
2237 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2238 if (wand->images == (Image *) NULL)
2239 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2240 sepia_image=DeskewImage(wand->images,threshold,wand->exception);
2241 if (sepia_image == (Image *) NULL)
2242 return(MagickFalse);
2243 ReplaceImageInList(&wand->images,sepia_image);
2248 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2252 % M a g i c k D e s p e c k l e I m a g e %
2256 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2258 % MagickDespeckleImage() reduces the speckle noise in an image while
2259 % perserving the edges of the original image.
2261 % The format of the MagickDespeckleImage method is:
2263 % MagickBooleanType MagickDespeckleImage(MagickWand *wand)
2265 % A description of each parameter follows:
2267 % o wand: the magick wand.
2270 WandExport MagickBooleanType MagickDespeckleImage(MagickWand *wand)
2275 assert(wand != (MagickWand *) NULL);
2276 assert(wand->signature == WandSignature);
2277 if (wand->debug != MagickFalse)
2278 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2279 if (wand->images == (Image *) NULL)
2280 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2281 despeckle_image=DespeckleImage(wand->images,wand->exception);
2282 if (despeckle_image == (Image *) NULL)
2283 return(MagickFalse);
2284 ReplaceImageInList(&wand->images,despeckle_image);
2289 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2293 % M a g i c k D e s t r o y I m a g e %
2297 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2299 % MagickDestroyImage() dereferences an image, deallocating memory associated
2300 % with the image if the reference count becomes zero.
2302 % The format of the MagickDestroyImage method is:
2304 % Image *MagickDestroyImage(Image *image)
2306 % A description of each parameter follows:
2308 % o image: the image.
2311 WandExport Image *MagickDestroyImage(Image *image)
2313 return(DestroyImage(image));
2317 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2321 % M a g i c k D i s p l a y I m a g e %
2325 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2327 % MagickDisplayImage() displays an image.
2329 % The format of the MagickDisplayImage method is:
2331 % MagickBooleanType MagickDisplayImage(MagickWand *wand,
2332 % const char *server_name)
2334 % A description of each parameter follows:
2336 % o wand: the magick wand.
2338 % o server_name: the X server name.
2341 WandExport MagickBooleanType MagickDisplayImage(MagickWand *wand,
2342 const char *server_name)
2350 assert(wand != (MagickWand *) NULL);
2351 assert(wand->signature == WandSignature);
2352 if (wand->debug != MagickFalse)
2353 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2354 if (wand->images == (Image *) NULL)
2355 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2356 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
2357 if (image == (Image *) NULL)
2358 return(MagickFalse);
2359 (void) CloneString(&wand->image_info->server_name,server_name);
2360 status=DisplayImages(wand->image_info,image,&image->exception);
2361 image=DestroyImage(image);
2366 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2370 % M a g i c k D i s p l a y I m a g e s %
2374 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2376 % MagickDisplayImages() displays an image or image sequence.
2378 % The format of the MagickDisplayImages method is:
2380 % MagickBooleanType MagickDisplayImages(MagickWand *wand,
2381 % const char *server_name)
2383 % A description of each parameter follows:
2385 % o wand: the magick wand.
2387 % o server_name: the X server name.
2390 WandExport MagickBooleanType MagickDisplayImages(MagickWand *wand,
2391 const char *server_name)
2396 assert(wand != (MagickWand *) NULL);
2397 assert(wand->signature == WandSignature);
2398 if (wand->debug != MagickFalse)
2399 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2400 (void) CloneString(&wand->image_info->server_name,server_name);
2401 status=DisplayImages(wand->image_info,wand->images,&wand->images->exception);
2406 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2410 % M a g i c k D i s t o r t I m a g e %
2414 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2416 % MagickDistortImage() distorts an image using various distortion methods, by
2417 % mapping color lookups of the source image to a new destination image
2418 % usally of the same size as the source image, unless 'bestfit' is set to
2421 % If 'bestfit' is enabled, and distortion allows it, the destination image is
2422 % adjusted to ensure the whole source 'image' will just fit within the final
2423 % destination image, which will be sized and offset accordingly. Also in
2424 % many cases the virtual offset of the source image will be taken into
2425 % account in the mapping.
2427 % The format of the MagickDistortImage method is:
2429 % MagickBooleanType MagickDistortImage(MagickWand *wand,
2430 % const DistortImageMethod method,const size_t number_arguments,
2431 % const double *arguments,const MagickBooleanType bestfit)
2433 % A description of each parameter follows:
2435 % o image: the image to be distorted.
2437 % o method: the method of image distortion.
2439 % ArcDistortion always ignores the source image offset, and always
2440 % 'bestfit' the destination image with the top left corner offset
2441 % relative to the polar mapping center.
2443 % Bilinear has no simple inverse mapping so it does not allow 'bestfit'
2444 % style of image distortion.
2446 % Affine, Perspective, and Bilinear, do least squares fitting of the
2447 % distortion when more than the minimum number of control point pairs
2450 % Perspective, and Bilinear, falls back to a Affine distortion when less
2451 % that 4 control point pairs are provided. While Affine distortions let
2452 % you use any number of control point pairs, that is Zero pairs is a
2453 % no-Op (viewport only) distrotion, one pair is a translation and two
2454 % pairs of control points do a scale-rotate-translate, without any
2457 % o number_arguments: the number of arguments given for this distortion
2460 % o arguments: the arguments for this distortion method.
2462 % o bestfit: Attempt to resize destination to fit distorted source.
2465 WandExport MagickBooleanType MagickDistortImage(MagickWand *wand,
2466 const DistortImageMethod method,const size_t number_arguments,
2467 const double *arguments,const MagickBooleanType bestfit)
2472 assert(wand != (MagickWand *) NULL);
2473 assert(wand->signature == WandSignature);
2474 if (wand->debug != MagickFalse)
2475 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2476 if (wand->images == (Image *) NULL)
2477 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2478 distort_image=DistortImage(wand->images,method,number_arguments,arguments,
2479 bestfit,wand->exception);
2480 if (distort_image == (Image *) NULL)
2481 return(MagickFalse);
2482 ReplaceImageInList(&wand->images,distort_image);
2487 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2491 % M a g i c k D r a w I m a g e %
2495 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2497 % MagickDrawImage() renders the drawing wand on the current image.
2499 % The format of the MagickDrawImage method is:
2501 % MagickBooleanType MagickDrawImage(MagickWand *wand,
2502 % const DrawingWand *drawing_wand)
2504 % A description of each parameter follows:
2506 % o wand: the magick wand.
2508 % o drawing_wand: the draw wand.
2511 WandExport MagickBooleanType MagickDrawImage(MagickWand *wand,
2512 const DrawingWand *drawing_wand)
2523 assert(wand != (MagickWand *) NULL);
2524 assert(wand->signature == WandSignature);
2525 if (wand->debug != MagickFalse)
2526 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2527 if (wand->images == (Image *) NULL)
2528 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2529 draw_info=PeekDrawingWand(drawing_wand);
2530 if ((draw_info == (DrawInfo *) NULL) ||
2531 (draw_info->primitive == (char *) NULL))
2532 return(MagickFalse);
2533 primitive=AcquireString(draw_info->primitive);
2534 draw_info=DestroyDrawInfo(draw_info);
2535 draw_info=CloneDrawInfo(wand->image_info,(DrawInfo *) NULL);
2536 draw_info->primitive=primitive;
2537 status=DrawImage(wand->images,draw_info,wand->exception);
2538 draw_info=DestroyDrawInfo(draw_info);
2543 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2547 % M a g i c k E d g e I m a g e %
2551 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2553 % MagickEdgeImage() enhance edges within the image with a convolution filter
2554 % of the given radius. Use a radius of 0 and Edge() selects a suitable
2557 % The format of the MagickEdgeImage method is:
2559 % MagickBooleanType MagickEdgeImage(MagickWand *wand,const double radius,
2560 % const double sigma)
2562 % A description of each parameter follows:
2564 % o wand: the magick wand.
2566 % o radius: the radius of the pixel neighborhood.
2568 % o sigma: the standard deviation of the Gaussian, in pixels.
2571 WandExport MagickBooleanType MagickEdgeImage(MagickWand *wand,
2572 const double radius,const double sigma)
2577 assert(wand != (MagickWand *) NULL);
2578 assert(wand->signature == WandSignature);
2579 if (wand->debug != MagickFalse)
2580 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2581 if (wand->images == (Image *) NULL)
2582 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2583 edge_image=EdgeImage(wand->images,radius,sigma,wand->exception);
2584 if (edge_image == (Image *) NULL)
2585 return(MagickFalse);
2586 ReplaceImageInList(&wand->images,edge_image);
2591 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2595 % M a g i c k E m b o s s I m a g e %
2599 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2601 % MagickEmbossImage() returns a grayscale image with a three-dimensional
2602 % effect. We convolve the image with a Gaussian operator of the given radius
2603 % and standard deviation (sigma). For reasonable results, radius should be
2604 % larger than sigma. Use a radius of 0 and Emboss() selects a suitable
2607 % The format of the MagickEmbossImage method is:
2609 % MagickBooleanType MagickEmbossImage(MagickWand *wand,const double radius,
2610 % const double sigma)
2612 % A description of each parameter follows:
2614 % o wand: the magick wand.
2616 % o radius: the radius of the Gaussian, in pixels, not counting the center
2619 % o sigma: the standard deviation of the Gaussian, in pixels.
2622 WandExport MagickBooleanType MagickEmbossImage(MagickWand *wand,
2623 const double radius,const double sigma)
2628 assert(wand != (MagickWand *) NULL);
2629 assert(wand->signature == WandSignature);
2630 if (wand->debug != MagickFalse)
2631 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2632 if (wand->images == (Image *) NULL)
2633 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2634 emboss_image=EmbossImage(wand->images,radius,sigma,wand->exception);
2635 if (emboss_image == (Image *) NULL)
2636 return(MagickFalse);
2637 ReplaceImageInList(&wand->images,emboss_image);
2642 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2646 % M a g i c k E n c i p h e r I m a g e %
2650 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2652 % MagickEncipherImage() converts plaint pixels to cipher pixels.
2654 % The format of the MagickEncipherImage method is:
2656 % MagickBooleanType MagickEncipherImage(MagickWand *wand,
2657 % const char *passphrase)
2659 % A description of each parameter follows:
2661 % o wand: the magick wand.
2663 % o passphrase: the passphrase.
2666 WandExport MagickBooleanType MagickEncipherImage(MagickWand *wand,
2667 const char *passphrase)
2669 assert(wand != (MagickWand *) NULL);
2670 assert(wand->signature == WandSignature);
2671 if (wand->debug != MagickFalse)
2672 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2673 if (wand->images == (Image *) NULL)
2674 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2675 return(EncipherImage(wand->images,passphrase,&wand->images->exception));
2679 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2683 % M a g i c k E n h a n c e I m a g e %
2687 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2689 % MagickEnhanceImage() applies a digital filter that improves the quality of a
2692 % The format of the MagickEnhanceImage method is:
2694 % MagickBooleanType MagickEnhanceImage(MagickWand *wand)
2696 % A description of each parameter follows:
2698 % o wand: the magick wand.
2701 WandExport MagickBooleanType MagickEnhanceImage(MagickWand *wand)
2706 assert(wand != (MagickWand *) NULL);
2707 assert(wand->signature == WandSignature);
2708 if (wand->debug != MagickFalse)
2709 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2710 if (wand->images == (Image *) NULL)
2711 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2712 enhance_image=EnhanceImage(wand->images,wand->exception);
2713 if (enhance_image == (Image *) NULL)
2714 return(MagickFalse);
2715 ReplaceImageInList(&wand->images,enhance_image);
2720 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2724 % M a g i c k E q u a l i z e I m a g e %
2728 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2730 % MagickEqualizeImage() equalizes the image histogram.
2732 % The format of the MagickEqualizeImage method is:
2734 % MagickBooleanType MagickEqualizeImage(MagickWand *wand)
2736 % A description of each parameter follows:
2738 % o wand: the magick wand.
2740 % o channel: the image channel(s).
2743 WandExport MagickBooleanType MagickEqualizeImage(MagickWand *wand)
2748 assert(wand != (MagickWand *) NULL);
2749 assert(wand->signature == WandSignature);
2750 if (wand->debug != MagickFalse)
2751 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2752 if (wand->images == (Image *) NULL)
2753 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2754 status=EqualizeImage(wand->images,&wand->images->exception);
2759 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2763 % M a g i c k E v a l u a t e I m a g e %
2767 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2769 % MagickEvaluateImage() applys an arithmetic, relational, or logical
2770 % expression to an image. Use these operators to lighten or darken an image,
2771 % to increase or decrease contrast in an image, or to produce the "negative"
2774 % The format of the MagickEvaluateImage method is:
2776 % MagickBooleanType MagickEvaluateImage(MagickWand *wand,
2777 % const MagickEvaluateOperator operator,const double value)
2778 % MagickBooleanType MagickEvaluateImages(MagickWand *wand,
2779 % const MagickEvaluateOperator operator)
2781 % A description of each parameter follows:
2783 % o wand: the magick wand.
2785 % o op: A channel operator.
2787 % o value: A value value.
2791 WandExport MagickWand *MagickEvaluateImages(MagickWand *wand,
2792 const MagickEvaluateOperator op)
2797 assert(wand != (MagickWand *) NULL);
2798 assert(wand->signature == WandSignature);
2799 if (wand->debug != MagickFalse)
2800 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2801 if (wand->images == (Image *) NULL)
2802 return((MagickWand *) NULL);
2803 evaluate_image=EvaluateImages(wand->images,op,wand->exception);
2804 if (evaluate_image == (Image *) NULL)
2805 return((MagickWand *) NULL);
2806 return(CloneMagickWandFromImages(wand,evaluate_image));
2809 WandExport MagickBooleanType MagickEvaluateImage(MagickWand *wand,
2810 const MagickEvaluateOperator op,const double value)
2815 assert(wand != (MagickWand *) NULL);
2816 assert(wand->signature == WandSignature);
2817 if (wand->debug != MagickFalse)
2818 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2819 if (wand->images == (Image *) NULL)
2820 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2821 status=EvaluateImage(wand->images,op,value,&wand->images->exception);
2826 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2830 % M a g i c k E x p o r t I m a g e P i x e l s %
2834 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2836 % MagickExportImagePixels() extracts pixel data from an image and returns it
2837 % to you. The method returns MagickTrue on success otherwise MagickFalse if
2838 % an error is encountered. The data is returned as char, short int, int,
2839 % ssize_t, float, or double in the order specified by map.
2841 % Suppose you want to extract the first scanline of a 640x480 image as
2842 % character data in red-green-blue order:
2844 % MagickExportImagePixels(wand,0,0,640,1,"RGB",CharPixel,pixels);
2846 % The format of the MagickExportImagePixels method is:
2848 % MagickBooleanType MagickExportImagePixels(MagickWand *wand,
2849 % const ssize_t x,const ssize_t y,const size_t columns,
2850 % const size_t rows,const char *map,const StorageType storage,
2853 % A description of each parameter follows:
2855 % o wand: the magick wand.
2857 % o x, y, columns, rows: These values define the perimeter
2858 % of a region of pixels you want to extract.
2860 % o map: This string reflects the expected ordering of the pixel array.
2861 % It can be any combination or order of R = red, G = green, B = blue,
2862 % A = alpha (0 is transparent), O = alpha (0 is opaque), C = cyan,
2863 % Y = yellow, M = magenta, K = black, I = intensity (for grayscale),
2866 % o storage: Define the data type of the pixels. Float and double types are
2867 % expected to be normalized [0..1] otherwise [0..QuantumRange]. Choose from
2868 % these types: CharPixel, DoublePixel, FloatPixel, IntegerPixel,
2869 % LongPixel, QuantumPixel, or ShortPixel.
2871 % o pixels: This array of values contain the pixel components as defined by
2872 % map and type. You must preallocate this array where the expected
2873 % length varies depending on the values of width, height, map, and type.
2876 WandExport MagickBooleanType MagickExportImagePixels(MagickWand *wand,
2877 const ssize_t x,const ssize_t y,const size_t columns,
2878 const size_t rows,const char *map,const StorageType storage,
2884 assert(wand != (MagickWand *) NULL);
2885 assert(wand->signature == WandSignature);
2886 if (wand->debug != MagickFalse)
2887 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2888 if (wand->images == (Image *) NULL)
2889 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2890 status=ExportImagePixels(wand->images,x,y,columns,rows,map,
2891 storage,pixels,wand->exception);
2892 if (status == MagickFalse)
2893 InheritException(wand->exception,&wand->images->exception);
2898 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2902 % M a g i c k E x t e n t I m a g e %
2906 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2908 % MagickExtentImage() extends the image as defined by the geometry, gravity,
2909 % and wand background color. Set the (x,y) offset of the geometry to move
2910 % the original wand relative to the extended wand.
2912 % The format of the MagickExtentImage method is:
2914 % MagickBooleanType MagickExtentImage(MagickWand *wand,
2915 % const size_t width,const size_t height,const ssize_t x,
2918 % A description of each parameter follows:
2920 % o wand: the magick wand.
2922 % o width: the region width.
2924 % o height: the region height.
2926 % o x: the region x offset.
2928 % o y: the region y offset.
2931 WandExport MagickBooleanType MagickExtentImage(MagickWand *wand,
2932 const size_t width,const size_t height,const ssize_t x,
2941 assert(wand != (MagickWand *) NULL);
2942 assert(wand->signature == WandSignature);
2943 if (wand->debug != MagickFalse)
2944 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2945 if (wand->images == (Image *) NULL)
2946 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2948 extent.height=height;
2951 extent_image=ExtentImage(wand->images,&extent,wand->exception);
2952 if (extent_image == (Image *) NULL)
2953 return(MagickFalse);
2954 ReplaceImageInList(&wand->images,extent_image);
2959 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2963 % M a g i c k F l i p I m a g e %
2967 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2969 % MagickFlipImage() creates a vertical mirror image by reflecting the pixels
2970 % around the central x-axis.
2972 % The format of the MagickFlipImage method is:
2974 % MagickBooleanType MagickFlipImage(MagickWand *wand)
2976 % A description of each parameter follows:
2978 % o wand: the magick wand.
2981 WandExport MagickBooleanType MagickFlipImage(MagickWand *wand)
2986 assert(wand != (MagickWand *) NULL);
2987 assert(wand->signature == WandSignature);
2988 if (wand->debug != MagickFalse)
2989 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2990 if (wand->images == (Image *) NULL)
2991 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2992 flip_image=FlipImage(wand->images,wand->exception);
2993 if (flip_image == (Image *) NULL)
2994 return(MagickFalse);
2995 ReplaceImageInList(&wand->images,flip_image);
3000 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3004 % 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 %
3008 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3010 % MagickFloodfillPaintImage() changes the color value of any pixel that matches
3011 % target and is an immediate neighbor. If the method FillToBorderMethod is
3012 % specified, the color value is changed for any neighbor pixel that does not
3013 % match the bordercolor member of image.
3015 % The format of the MagickFloodfillPaintImage method is:
3017 % MagickBooleanType MagickFloodfillPaintImage(MagickWand *wand,
3018 % const PixelWand *fill,const double fuzz,const PixelWand *bordercolor,
3019 % const ssize_t x,const ssize_t y,const MagickBooleanType invert)
3021 % A description of each parameter follows:
3023 % o wand: the magick wand.
3025 % o fill: the floodfill color pixel wand.
3027 % o fuzz: By default target must match a particular pixel color
3028 % exactly. However, in many cases two colors may differ by a small amount.
3029 % The fuzz member of image defines how much tolerance is acceptable to
3030 % consider two colors as the same. For example, set fuzz to 10 and the
3031 % color red at intensities of 100 and 102 respectively are now interpreted
3032 % as the same color for the purposes of the floodfill.
3034 % o bordercolor: the border color pixel wand.
3036 % o x,y: the starting location of the operation.
3038 % o invert: paint any pixel that does not match the target color.
3041 WandExport MagickBooleanType MagickFloodfillPaintImage(MagickWand *wand,
3042 const PixelWand *fill,const double fuzz,const PixelWand *bordercolor,
3043 const ssize_t x,const ssize_t y,const MagickBooleanType invert)
3054 assert(wand != (MagickWand *) NULL);
3055 assert(wand->signature == WandSignature);
3056 if (wand->debug != MagickFalse)
3057 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3058 if (wand->images == (Image *) NULL)
3059 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3060 draw_info=CloneDrawInfo(wand->image_info,(DrawInfo *) NULL);
3061 PixelGetQuantumPacket(fill,&draw_info->fill);
3062 (void) GetOneVirtualMagickPixel(wand->images,x % wand->images->columns,
3063 y % wand->images->rows,&target,wand->exception);
3064 if (bordercolor != (PixelWand *) NULL)
3065 PixelGetMagickColor(bordercolor,&target);
3066 wand->images->fuzz=fuzz;
3067 status=FloodfillPaintImage(wand->images,draw_info,&target,x,y,invert,
3068 &wand->images->exception);
3069 draw_info=DestroyDrawInfo(draw_info);
3074 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3078 % M a g i c k F l o p I m a g e %
3082 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3084 % MagickFlopImage() creates a horizontal mirror image by reflecting the pixels
3085 % around the central y-axis.
3087 % The format of the MagickFlopImage method is:
3089 % MagickBooleanType MagickFlopImage(MagickWand *wand)
3091 % A description of each parameter follows:
3093 % o wand: the magick wand.
3096 WandExport MagickBooleanType MagickFlopImage(MagickWand *wand)
3101 assert(wand != (MagickWand *) NULL);
3102 assert(wand->signature == WandSignature);
3103 if (wand->debug != MagickFalse)
3104 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3105 if (wand->images == (Image *) NULL)
3106 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3107 flop_image=FlopImage(wand->images,wand->exception);
3108 if (flop_image == (Image *) NULL)
3109 return(MagickFalse);
3110 ReplaceImageInList(&wand->images,flop_image);
3115 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3119 % 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 %
3123 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3125 % MagickForwardFourierTransformImage() implements the discrete Fourier
3126 % transform (DFT) of the image either as a magnitude / phase or real /
3127 % imaginary image pair.
3129 % The format of the MagickForwardFourierTransformImage method is:
3131 % MagickBooleanType MagickForwardFourierTransformImage(MagickWand *wand,
3132 % const MagickBooleanType magnitude)
3134 % A description of each parameter follows:
3136 % o wand: the magick wand.
3138 % o magnitude: if true, return as magnitude / phase pair otherwise a real /
3139 % imaginary image pair.
3142 WandExport MagickBooleanType MagickForwardFourierTransformImage(
3143 MagickWand *wand,const MagickBooleanType magnitude)
3148 assert(wand != (MagickWand *) NULL);
3149 assert(wand->signature == WandSignature);
3150 if (wand->debug != MagickFalse)
3151 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3152 if (wand->images == (Image *) NULL)
3153 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3154 forward_image=ForwardFourierTransformImage(wand->images,magnitude,
3156 if (forward_image == (Image *) NULL)
3157 return(MagickFalse);
3158 ReplaceImageInList(&wand->images,forward_image);
3163 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3167 % M a g i c k F r a m e I m a g e %
3171 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3173 % MagickFrameImage() adds a simulated three-dimensional border around the
3174 % image. The width and height specify the border width of the vertical and
3175 % horizontal sides of the frame. The inner and outer bevels indicate the
3176 % width of the inner and outer shadows of the frame.
3178 % The format of the MagickFrameImage method is:
3180 % MagickBooleanType MagickFrameImage(MagickWand *wand,
3181 % const PixelWand *matte_color,const size_t width,
3182 % const size_t height,const ssize_t inner_bevel,
3183 % const ssize_t outer_bevel,const CompositeOperator compose)
3185 % A description of each parameter follows:
3187 % o wand: the magick wand.
3189 % o matte_color: the frame color pixel wand.
3191 % o width: the border width.
3193 % o height: the border height.
3195 % o inner_bevel: the inner bevel width.
3197 % o outer_bevel: the outer bevel width.
3199 % o compose: the composite operator.
3202 WandExport MagickBooleanType MagickFrameImage(MagickWand *wand,
3203 const PixelWand *matte_color,const size_t width,const size_t height,
3204 const ssize_t inner_bevel,const ssize_t outer_bevel,
3205 const CompositeOperator compose)
3213 assert(wand != (MagickWand *) NULL);
3214 assert(wand->signature == WandSignature);
3215 if (wand->debug != MagickFalse)
3216 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3217 if (wand->images == (Image *) NULL)
3218 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3219 (void) ResetMagickMemory(&frame_info,0,sizeof(frame_info));
3220 frame_info.width=wand->images->columns+2*width;
3221 frame_info.height=wand->images->rows+2*height;
3222 frame_info.x=(ssize_t) width;
3223 frame_info.y=(ssize_t) height;
3224 frame_info.inner_bevel=inner_bevel;
3225 frame_info.outer_bevel=outer_bevel;
3226 PixelGetQuantumPacket(matte_color,&wand->images->matte_color);
3227 frame_image=FrameImage(wand->images,&frame_info,compose,wand->exception);
3228 if (frame_image == (Image *) NULL)
3229 return(MagickFalse);
3230 ReplaceImageInList(&wand->images,frame_image);
3235 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3239 % M a g i c k F u n c t i o n I m a g e %
3243 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3245 % MagickFunctionImage() applys an arithmetic, relational, or logical
3246 % expression to an image. Use these operators to lighten or darken an image,
3247 % to increase or decrease contrast in an image, or to produce the "negative"
3250 % The format of the MagickFunctionImage method is:
3252 % MagickBooleanType MagickFunctionImage(MagickWand *wand,
3253 % const MagickFunction function,const size_t number_arguments,
3254 % const double *arguments)
3256 % A description of each parameter follows:
3258 % o wand: the magick wand.
3260 % o function: the image function.
3262 % o number_arguments: the number of function arguments.
3264 % o arguments: the function arguments.
3267 WandExport MagickBooleanType MagickFunctionImage(MagickWand *wand,
3268 const MagickFunction function,const size_t number_arguments,
3269 const double *arguments)
3274 assert(wand != (MagickWand *) NULL);
3275 assert(wand->signature == WandSignature);
3276 if (wand->debug != MagickFalse)
3277 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3278 if (wand->images == (Image *) NULL)
3279 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3280 status=FunctionImage(wand->images,function,number_arguments,arguments,
3281 &wand->images->exception);
3286 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3290 % M a g i c k F x I m a g e %
3294 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3296 % MagickFxImage() evaluate expression for each pixel in the image.
3298 % The format of the MagickFxImage method is:
3300 % MagickWand *MagickFxImage(MagickWand *wand,const char *expression)
3302 % A description of each parameter follows:
3304 % o wand: the magick wand.
3306 % o expression: the expression.
3309 WandExport MagickWand *MagickFxImage(MagickWand *wand,const char *expression)
3314 assert(wand != (MagickWand *) NULL);
3315 assert(wand->signature == WandSignature);
3316 if (wand->debug != MagickFalse)
3317 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3318 if (wand->images == (Image *) NULL)
3319 return((MagickWand *) NULL);
3320 fx_image=FxImage(wand->images,expression,wand->exception);
3321 if (fx_image == (Image *) NULL)
3322 return((MagickWand *) NULL);
3323 return(CloneMagickWandFromImages(wand,fx_image));
3327 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3331 % M a g i c k G a m m a I m a g e %
3335 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3337 % MagickGammaImage() gamma-corrects an image. The same image viewed on
3338 % different devices will have perceptual differences in the way the image's
3339 % intensities are represented on the screen. Specify individual gamma levels
3340 % for the red, green, and blue channels, or adjust all three with the gamma
3341 % parameter. Values typically range from 0.8 to 2.3.
3343 % You can also reduce the influence of a particular channel with a gamma
3346 % The format of the MagickGammaImage method is:
3348 % MagickBooleanType MagickGammaImage(MagickWand *wand,const double gamma)
3350 % A description of each parameter follows:
3352 % o wand: the magick wand.
3354 % o level: Define the level of gamma correction.
3357 WandExport MagickBooleanType MagickGammaImage(MagickWand *wand,
3363 assert(wand != (MagickWand *) NULL);
3364 assert(wand->signature == WandSignature);
3365 if (wand->debug != MagickFalse)
3366 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3367 if (wand->images == (Image *) NULL)
3368 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3369 status=GammaImage(wand->images,gamma,wand->exception);
3374 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3378 % M a g i c k G a u s s i a n B l u r I m a g e %
3382 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3384 % MagickGaussianBlurImage() blurs an image. We convolve the image with a
3385 % Gaussian operator of the given radius and standard deviation (sigma).
3386 % For reasonable results, the radius should be larger than sigma. Use a
3387 % radius of 0 and MagickGaussianBlurImage() selects a suitable radius for you.
3389 % The format of the MagickGaussianBlurImage method is:
3391 % MagickBooleanType MagickGaussianBlurImage(MagickWand *wand,
3392 % const double radius,const double sigma,const double bias)
3394 % A description of each parameter follows:
3396 % o wand: the magick wand.
3398 % o radius: the radius of the Gaussian, in pixels, not counting the center
3401 % o sigma: the standard deviation of the Gaussian, in pixels.
3406 WandExport MagickBooleanType MagickGaussianBlurImage(MagickWand *wand,
3407 const double radius,const double sigma,const double bias)
3412 assert(wand != (MagickWand *) NULL);
3413 assert(wand->signature == WandSignature);
3414 if (wand->debug != MagickFalse)
3415 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3416 if (wand->images == (Image *) NULL)
3417 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3418 blur_image=GaussianBlurImage(wand->images,radius,sigma,bias,wand->exception);
3419 if (blur_image == (Image *) NULL)
3420 return(MagickFalse);
3421 ReplaceImageInList(&wand->images,blur_image);
3426 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3430 % M a g i c k G e t I m a g e %
3434 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3436 % MagickGetImage() gets the image at the current image index.
3438 % The format of the MagickGetImage method is:
3440 % MagickWand *MagickGetImage(MagickWand *wand)
3442 % A description of each parameter follows:
3444 % o wand: the magick wand.
3447 WandExport MagickWand *MagickGetImage(MagickWand *wand)
3452 assert(wand != (MagickWand *) NULL);
3453 assert(wand->signature == WandSignature);
3454 if (wand->debug != MagickFalse)
3455 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3456 if (wand->images == (Image *) NULL)
3458 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3459 "ContainsNoImages","`%s'",wand->name);
3460 return((MagickWand *) NULL);
3462 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
3463 if (image == (Image *) NULL)
3464 return((MagickWand *) NULL);
3465 return(CloneMagickWandFromImages(wand,image));
3469 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3473 % 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 %
3477 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3479 % MagickGetImageAlphaChannel() returns MagickFalse if the image alpha channel
3480 % is not activated. That is, the image is RGB rather than RGBA or CMYK rather
3483 % The format of the MagickGetImageAlphaChannel method is:
3485 % size_t MagickGetImageAlphaChannel(MagickWand *wand)
3487 % A description of each parameter follows:
3489 % o wand: the magick wand.
3492 WandExport MagickBooleanType MagickGetImageAlphaChannel(MagickWand *wand)
3494 assert(wand != (MagickWand *) NULL);
3495 assert(wand->signature == WandSignature);
3496 if (wand->debug != MagickFalse)
3497 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3498 if (wand->images == (Image *) NULL)
3499 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3500 return(GetImageAlphaChannel(wand->images));
3504 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3508 % M a g i c k G e t I m a g e C l i p M a s k %
3512 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3514 % MagickGetImageClipMask() gets the image clip mask at the current image index.
3516 % The format of the MagickGetImageClipMask method is:
3518 % MagickWand *MagickGetImageClipMask(MagickWand *wand)
3520 % A description of each parameter follows:
3522 % o wand: the magick wand.
3525 WandExport MagickWand *MagickGetImageClipMask(MagickWand *wand)
3530 assert(wand != (MagickWand *) NULL);
3531 assert(wand->signature == WandSignature);
3532 if (wand->debug != MagickFalse)
3533 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3534 if (wand->images == (Image *) NULL)
3536 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3537 "ContainsNoImages","`%s'",wand->name);
3538 return((MagickWand *) NULL);
3540 image=GetImageClipMask(wand->images,wand->exception);
3541 if (image == (Image *) NULL)
3542 return((MagickWand *) NULL);
3543 return(CloneMagickWandFromImages(wand,image));
3547 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3551 % 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 %
3555 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3557 % MagickGetImageBackgroundColor() returns the image background color.
3559 % The format of the MagickGetImageBackgroundColor method is:
3561 % MagickBooleanType MagickGetImageBackgroundColor(MagickWand *wand,
3562 % PixelWand *background_color)
3564 % A description of each parameter follows:
3566 % o wand: the magick wand.
3568 % o background_color: Return the background color.
3571 WandExport MagickBooleanType MagickGetImageBackgroundColor(MagickWand *wand,
3572 PixelWand *background_color)
3574 assert(wand != (MagickWand *) NULL);
3575 assert(wand->signature == WandSignature);
3576 if (wand->debug != MagickFalse)
3577 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3578 if (wand->images == (Image *) NULL)
3579 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3580 PixelSetQuantumPacket(background_color,&wand->images->background_color);
3585 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3589 % M a g i c k G e t I m a g e B l o b %
3593 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3595 % MagickGetImageBlob() implements direct to memory image formats. It returns
3596 % the image as a blob (a formatted "file" in memory) and its length, starting
3597 % from the current position in the image sequence. Use MagickSetImageFormat()
3598 % to set the format to write to the blob (GIF, JPEG, PNG, etc.).
3600 % Utilize MagickResetIterator() to ensure the write is from the beginning of
3601 % the image sequence.
3603 % Use MagickRelinquishMemory() to free the blob when you are done with it.
3605 % The format of the MagickGetImageBlob method is:
3607 % unsigned char *MagickGetImageBlob(MagickWand *wand,size_t *length)
3609 % A description of each parameter follows:
3611 % o wand: the magick wand.
3613 % o length: the length of the blob.
3616 WandExport unsigned char *MagickGetImageBlob(MagickWand *wand,size_t *length)
3618 assert(wand != (MagickWand *) NULL);
3619 assert(wand->signature == WandSignature);
3620 if (wand->debug != MagickFalse)
3621 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3622 if (wand->images == (Image *) NULL)
3624 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3625 "ContainsNoImages","`%s'",wand->name);
3626 return((unsigned char *) NULL);
3628 return(ImageToBlob(wand->image_info,wand->images,length,wand->exception));
3632 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3636 % M a g i c k G e t I m a g e s B l o b %
3640 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3642 % MagickGetImageBlob() implements direct to memory image formats. It
3643 % returns the image sequence as a blob and its length. The format of the image
3644 % determines the format of the returned blob (GIF, JPEG, PNG, etc.). To
3645 % return a different image format, use MagickSetImageFormat().
3647 % Note, some image formats do not permit multiple images to the same image
3648 % stream (e.g. JPEG). in this instance, just the first image of the
3649 % sequence is returned as a blob.
3651 % The format of the MagickGetImagesBlob method is:
3653 % unsigned char *MagickGetImagesBlob(MagickWand *wand,size_t *length)
3655 % A description of each parameter follows:
3657 % o wand: the magick wand.
3659 % o length: the length of the blob.
3662 WandExport unsigned char *MagickGetImagesBlob(MagickWand *wand,size_t *length)
3667 assert(wand != (MagickWand *) NULL);
3668 assert(wand->signature == WandSignature);
3669 if (wand->debug != MagickFalse)
3670 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3671 if (wand->images == (Image *) NULL)
3673 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3674 "ContainsNoImages","`%s'",wand->name);
3675 return((unsigned char *) NULL);
3677 blob=ImagesToBlob(wand->image_info,GetFirstImageInList(wand->images),length,
3683 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3687 % 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 %
3691 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3693 % MagickGetImageBluePrimary() returns the chromaticy blue primary point for the
3696 % The format of the MagickGetImageBluePrimary method is:
3698 % MagickBooleanType MagickGetImageBluePrimary(MagickWand *wand,double *x,
3701 % A description of each parameter follows:
3703 % o wand: the magick wand.
3705 % o x: the chromaticity blue primary x-point.
3707 % o y: the chromaticity blue primary y-point.
3710 WandExport MagickBooleanType MagickGetImageBluePrimary(MagickWand *wand,
3711 double *x,double *y)
3713 assert(wand != (MagickWand *) NULL);
3714 assert(wand->signature == WandSignature);
3715 if (wand->debug != MagickFalse)
3716 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3717 if (wand->images == (Image *) NULL)
3718 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3719 *x=wand->images->chromaticity.blue_primary.x;
3720 *y=wand->images->chromaticity.blue_primary.y;
3725 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3729 % 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 %
3733 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3735 % MagickGetImageBorderColor() returns the image border color.
3737 % The format of the MagickGetImageBorderColor method is:
3739 % MagickBooleanType MagickGetImageBorderColor(MagickWand *wand,
3740 % PixelWand *border_color)
3742 % A description of each parameter follows:
3744 % o wand: the magick wand.
3746 % o border_color: Return the border color.
3749 WandExport MagickBooleanType MagickGetImageBorderColor(MagickWand *wand,
3750 PixelWand *border_color)
3752 assert(wand != (MagickWand *) NULL);
3753 assert(wand->signature == WandSignature);
3754 if (wand->debug != MagickFalse)
3755 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3756 if (wand->images == (Image *) NULL)
3757 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3758 PixelSetQuantumPacket(border_color,&wand->images->border_color);
3763 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3767 % M a g i c k G e t I m a g e F e a t u r e s %
3771 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3773 % MagickGetImageFeatures() returns features for each channel in the
3774 % image in each of four directions (horizontal, vertical, left and right
3775 % diagonals) for the specified distance. The features include the angular
3776 % second moment, contrast, correlation, sum of squares: variance, inverse
3777 % difference moment, sum average, sum varience, sum entropy, entropy,
3778 % difference variance, difference entropy, information measures of
3779 % correlation 1, information measures of correlation 2, and maximum
3780 % correlation coefficient. You can access the red channel contrast, for
3781 % example, like this:
3783 % channel_features=MagickGetImageFeatures(wand,1);
3784 % contrast=channel_features[RedChannel].contrast[0];
3786 % Use MagickRelinquishMemory() to free the statistics buffer.
3788 % The format of the MagickGetImageFeatures method is:
3790 % ChannelFeatures *MagickGetImageFeatures(MagickWand *wand,
3791 % const size_t distance)
3793 % A description of each parameter follows:
3795 % o wand: the magick wand.
3797 % o distance: the distance.
3800 WandExport ChannelFeatures *MagickGetImageFeatures(MagickWand *wand,
3801 const size_t distance)
3803 assert(wand != (MagickWand *) NULL);
3804 assert(wand->signature == WandSignature);
3805 if (wand->debug != MagickFalse)
3806 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3807 if (wand->images == (Image *) NULL)
3809 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3810 "ContainsNoImages","`%s'",wand->name);
3811 return((ChannelFeatures *) NULL);
3813 return(GetImageFeatures(wand->images,distance,wand->exception));
3817 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3821 % M a g i c k G e t I m a g e K u r t o s i s %
3825 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3827 % MagickGetImageKurtosis() gets the kurtosis and skewness of one or
3828 % more image channels.
3830 % The format of the MagickGetImageKurtosis method is:
3832 % MagickBooleanType MagickGetImageKurtosis(MagickWand *wand,
3833 % double *kurtosis,double *skewness)
3835 % A description of each parameter follows:
3837 % o wand: the magick wand.
3839 % o kurtosis: The kurtosis for the specified channel(s).
3841 % o skewness: The skewness for the specified channel(s).
3844 WandExport MagickBooleanType MagickGetImageKurtosis(MagickWand *wand,
3845 double *kurtosis,double *skewness)
3850 assert(wand != (MagickWand *) NULL);
3851 assert(wand->signature == WandSignature);
3852 if (wand->debug != MagickFalse)
3853 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3854 if (wand->images == (Image *) NULL)
3855 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3856 status=GetImageKurtosis(wand->images,kurtosis,skewness,wand->exception);
3861 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3865 % M a g i c k G e t I m a g e M e a n %
3869 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3871 % MagickGetImageMean() gets the mean and standard deviation of one or more
3874 % The format of the MagickGetImageMean method is:
3876 % MagickBooleanType MagickGetImageMean(MagickWand *wand,double *mean,
3877 % double *standard_deviation)
3879 % A description of each parameter follows:
3881 % o wand: the magick wand.
3883 % o channel: the image channel(s).
3885 % o mean: The mean pixel value for the specified channel(s).
3887 % o standard_deviation: The standard deviation for the specified channel(s).
3890 WandExport MagickBooleanType MagickGetImageMean(MagickWand *wand,double *mean,
3891 double *standard_deviation)
3896 assert(wand != (MagickWand *) NULL);
3897 assert(wand->signature == WandSignature);
3898 if (wand->debug != MagickFalse)
3899 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3900 if (wand->images == (Image *) NULL)
3901 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3902 status=GetImageMean(wand->images,mean,standard_deviation,wand->exception);
3907 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3911 % M a g i c k G e t I m a g e R a n g e %
3915 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3917 % MagickGetImageRange() gets the range for one or more image channels.
3919 % The format of the MagickGetImageRange method is:
3921 % MagickBooleanType MagickGetImageRange(MagickWand *wand,double *minima,
3924 % A description of each parameter follows:
3926 % o wand: the magick wand.
3928 % o minima: The minimum pixel value for the specified channel(s).
3930 % o maxima: The maximum pixel value for the specified channel(s).
3933 WandExport MagickBooleanType MagickGetImageRange(MagickWand *wand,
3934 double *minima,double *maxima)
3939 assert(wand != (MagickWand *) NULL);
3940 assert(wand->signature == WandSignature);
3941 if (wand->debug != MagickFalse)
3942 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3943 if (wand->images == (Image *) NULL)
3944 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3945 status=GetImageRange(wand->images,minima,maxima,wand->exception);
3950 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3954 % M a g i c k G e t I m a g e S t a t i s t i c s %
3958 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3960 % MagickGetImageStatistics() returns statistics for each channel in the
3961 % image. The statistics include the channel depth, its minima and
3962 % maxima, the mean, the standard deviation, the kurtosis and the skewness.
3963 % You can access the red channel mean, for example, like this:
3965 % channel_statistics=MagickGetImageStatistics(wand);
3966 % red_mean=channel_statistics[RedChannel].mean;
3968 % Use MagickRelinquishMemory() to free the statistics buffer.
3970 % The format of the MagickGetImageStatistics method is:
3972 % ChannelStatistics *MagickGetImageStatistics(MagickWand *wand)
3974 % A description of each parameter follows:
3976 % o wand: the magick wand.
3979 WandExport ChannelStatistics *MagickGetImageStatistics(MagickWand *wand)
3981 assert(wand != (MagickWand *) NULL);
3982 assert(wand->signature == WandSignature);
3983 if (wand->debug != MagickFalse)
3984 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3985 if (wand->images == (Image *) NULL)
3987 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3988 "ContainsNoImages","`%s'",wand->name);
3989 return((ChannelStatistics *) NULL);
3991 return(GetImageStatistics(wand->images,wand->exception));
3995 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3999 % 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 %
4003 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4005 % MagickGetImageColormapColor() returns the color of the specified colormap
4008 % The format of the MagickGetImageColormapColor method is:
4010 % MagickBooleanType MagickGetImageColormapColor(MagickWand *wand,
4011 % const size_t index,PixelWand *color)
4013 % A description of each parameter follows:
4015 % o wand: the magick wand.
4017 % o index: the offset into the image colormap.
4019 % o color: Return the colormap color in this wand.
4022 WandExport MagickBooleanType MagickGetImageColormapColor(MagickWand *wand,
4023 const size_t index,PixelWand *color)
4025 assert(wand != (MagickWand *) NULL);
4026 assert(wand->signature == WandSignature);
4027 if (wand->debug != MagickFalse)
4028 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4029 if (wand->images == (Image *) NULL)
4030 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4031 if ((wand->images->colormap == (PixelInfo *) NULL) ||
4032 (index >= wand->images->colors))
4034 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4035 "InvalidColormapIndex","`%s'",wand->name);
4036 return(MagickFalse);
4038 PixelSetQuantumPacket(color,wand->images->colormap+index);
4043 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4047 % M a g i c k G e t I m a g e C o l o r s %
4051 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4053 % MagickGetImageColors() gets the number of unique colors in the image.
4055 % The format of the MagickGetImageColors method is:
4057 % size_t MagickGetImageColors(MagickWand *wand)
4059 % A description of each parameter follows:
4061 % o wand: the magick wand.
4064 WandExport size_t MagickGetImageColors(MagickWand *wand)
4066 assert(wand != (MagickWand *) NULL);
4067 assert(wand->signature == WandSignature);
4068 if (wand->debug != MagickFalse)
4069 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4070 if (wand->images == (Image *) NULL)
4072 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4073 "ContainsNoImages","`%s'",wand->name);
4076 return(GetNumberColors(wand->images,(FILE *) NULL,wand->exception));
4080 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4084 % M a g i c k G e t I m a g e C o l o r s p a c e %
4088 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4090 % MagickGetImageColorspace() gets the image colorspace.
4092 % The format of the MagickGetImageColorspace method is:
4094 % ColorspaceType MagickGetImageColorspace(MagickWand *wand)
4096 % A description of each parameter follows:
4098 % o wand: the magick wand.
4101 WandExport ColorspaceType MagickGetImageColorspace(MagickWand *wand)
4103 assert(wand != (MagickWand *) NULL);
4104 assert(wand->signature == WandSignature);
4105 if (wand->debug != MagickFalse)
4106 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4107 if (wand->images == (Image *) NULL)
4109 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4110 "ContainsNoImages","`%s'",wand->name);
4111 return(UndefinedColorspace);
4113 return(wand->images->colorspace);
4117 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4121 % M a g i c k G e t I m a g e C o m p o s e %
4125 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4127 % MagickGetImageCompose() returns the composite operator associated with the
4130 % The format of the MagickGetImageCompose method is:
4132 % CompositeOperator MagickGetImageCompose(MagickWand *wand)
4134 % A description of each parameter follows:
4136 % o wand: the magick wand.
4139 WandExport CompositeOperator MagickGetImageCompose(MagickWand *wand)
4141 assert(wand != (MagickWand *) NULL);
4142 assert(wand->signature == WandSignature);
4143 if (wand->debug != MagickFalse)
4144 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4145 if (wand->images == (Image *) NULL)
4147 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4148 "ContainsNoImages","`%s'",wand->name);
4149 return(UndefinedCompositeOp);
4151 return(wand->images->compose);
4155 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4159 % 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 %
4163 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4165 % MagickGetImageCompression() gets the image compression.
4167 % The format of the MagickGetImageCompression method is:
4169 % CompressionType MagickGetImageCompression(MagickWand *wand)
4171 % A description of each parameter follows:
4173 % o wand: the magick wand.
4176 WandExport CompressionType MagickGetImageCompression(MagickWand *wand)
4178 assert(wand != (MagickWand *) NULL);
4179 assert(wand->signature == WandSignature);
4180 if (wand->debug != MagickFalse)
4181 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4182 if (wand->images == (Image *) NULL)
4184 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4185 "ContainsNoImages","`%s'",wand->name);
4186 return(UndefinedCompression);
4188 return(wand->images->compression);
4192 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4196 % 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 %
4200 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4202 % MagickGetImageCompression() gets the image compression quality.
4204 % The format of the MagickGetImageCompression method is:
4206 % size_t MagickGetImageCompression(MagickWand *wand)
4208 % A description of each parameter follows:
4210 % o wand: the magick wand.
4213 WandExport size_t MagickGetImageCompressionQuality(MagickWand *wand)
4215 assert(wand != (MagickWand *) NULL);
4216 assert(wand->signature == WandSignature);
4217 if (wand->debug != MagickFalse)
4218 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4219 if (wand->images == (Image *) NULL)
4221 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4222 "ContainsNoImages","`%s'",wand->name);
4225 return(wand->images->quality);
4229 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4233 % M a g i c k G e t I m a g e D e l a y %
4237 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4239 % MagickGetImageDelay() gets the image delay.
4241 % The format of the MagickGetImageDelay method is:
4243 % size_t MagickGetImageDelay(MagickWand *wand)
4245 % A description of each parameter follows:
4247 % o wand: the magick wand.
4250 WandExport size_t MagickGetImageDelay(MagickWand *wand)
4252 assert(wand != (MagickWand *) NULL);
4253 assert(wand->signature == WandSignature);
4254 if (wand->debug != MagickFalse)
4255 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4256 if (wand->images == (Image *) NULL)
4257 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4258 return(wand->images->delay);
4262 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4266 % M a g i c k G e t I m a g e D e p t h %
4270 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4272 % MagickGetImageDepth() gets the image depth.
4274 % The format of the MagickGetImageDepth method is:
4276 % size_t MagickGetImageDepth(MagickWand *wand)
4278 % A description of each parameter follows:
4280 % o wand: the magick wand.
4283 WandExport size_t MagickGetImageDepth(MagickWand *wand)
4285 assert(wand != (MagickWand *) NULL);
4286 assert(wand->signature == WandSignature);
4287 if (wand->debug != MagickFalse)
4288 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4289 if (wand->images == (Image *) NULL)
4290 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4291 return(GetImageDepth(wand->images,wand->exception));
4295 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4299 % M a g i c k G e t I m a g e D i s p o s e %
4303 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4305 % MagickGetImageDispose() gets the image disposal method.
4307 % The format of the MagickGetImageDispose method is:
4309 % DisposeType MagickGetImageDispose(MagickWand *wand)
4311 % A description of each parameter follows:
4313 % o wand: the magick wand.
4316 WandExport DisposeType MagickGetImageDispose(MagickWand *wand)
4318 assert(wand != (MagickWand *) NULL);
4319 assert(wand->signature == WandSignature);
4320 if (wand->debug != MagickFalse)
4321 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4322 if (wand->images == (Image *) NULL)
4324 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4325 "ContainsNoImages","`%s'",wand->name);
4326 return(UndefinedDispose);
4328 return((DisposeType) wand->images->dispose);
4332 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4336 % M a g i c k G e t I m a g e D i s t o r t i o n %
4340 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4342 % MagickGetImageDistortion() compares an image to a reconstructed image and
4343 % returns the specified distortion metric.
4345 % The format of the MagickGetImageDistortion method is:
4347 % MagickBooleanType MagickGetImageDistortion(MagickWand *wand,
4348 % const MagickWand *reference,const MetricType metric,
4349 % double *distortion)
4351 % A description of each parameter follows:
4353 % o wand: the magick wand.
4355 % o reference: the reference wand.
4357 % o metric: the metric.
4359 % o distortion: the computed distortion between the images.
4362 WandExport MagickBooleanType MagickGetImageDistortion(MagickWand *wand,
4363 const MagickWand *reference,const MetricType metric,double *distortion)
4368 assert(wand != (MagickWand *) NULL);
4369 assert(wand->signature == WandSignature);
4370 if (wand->debug != MagickFalse)
4371 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4372 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
4373 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4374 status=GetImageDistortion(wand->images,reference->images,metric,distortion,
4375 &wand->images->exception);
4380 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4384 % 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 %
4388 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4390 % MagickGetImageDistortions() compares one or more pixel channels of an
4391 % image to a reconstructed image and returns the specified distortion metrics.
4393 % Use MagickRelinquishMemory() to free the metrics when you are done with them.
4395 % The format of the MagickGetImageDistortion method is:
4397 % double *MagickGetImageDistortion(MagickWand *wand,
4398 % const MagickWand *reference,const MetricType metric)
4400 % A description of each parameter follows:
4402 % o wand: the magick wand.
4404 % o reference: the reference wand.
4406 % o metric: the metric.
4409 WandExport double *MagickGetImageDistortions(MagickWand *wand,
4410 const MagickWand *reference,const MetricType metric)
4413 *channel_distortion;
4415 assert(wand != (MagickWand *) NULL);
4416 assert(wand->signature == WandSignature);
4417 if (wand->debug != MagickFalse)
4418 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4419 assert(reference != (MagickWand *) NULL);
4420 assert(reference->signature == WandSignature);
4421 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
4423 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4424 "ContainsNoImages","`%s'",wand->name);
4425 return((double *) NULL);
4427 channel_distortion=GetImageDistortions(wand->images,reference->images,
4428 metric,&wand->images->exception);
4429 return(channel_distortion);
4433 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4437 % M a g i c k G e t I m a g e F i l e n a m e %
4441 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4443 % MagickGetImageFilename() returns the filename of a particular image in a
4446 % The format of the MagickGetImageFilename method is:
4448 % char *MagickGetImageFilename(MagickWand *wand)
4450 % A description of each parameter follows:
4452 % o wand: the magick wand.
4455 WandExport char *MagickGetImageFilename(MagickWand *wand)
4457 assert(wand != (MagickWand *) NULL);
4458 assert(wand->signature == WandSignature);
4459 if (wand->debug != MagickFalse)
4460 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4461 if (wand->images == (Image *) NULL)
4463 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4464 "ContainsNoImages","`%s'",wand->name);
4465 return((char *) NULL);
4467 return(AcquireString(wand->images->filename));
4471 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4475 % M a g i c k G e t I m a g e F o r m a t %
4479 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4481 % MagickGetImageFormat() returns the format of a particular image in a
4484 % The format of the MagickGetImageFormat method is:
4486 % const char *MagickGetImageFormat(MagickWand *wand)
4488 % A description of each parameter follows:
4490 % o wand: the magick wand.
4493 WandExport char *MagickGetImageFormat(MagickWand *wand)
4495 assert(wand != (MagickWand *) NULL);
4496 assert(wand->signature == WandSignature);
4497 if (wand->debug != MagickFalse)
4498 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4499 if (wand->images == (Image *) NULL)
4501 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4502 "ContainsNoImages","`%s'",wand->name);
4503 return((char *) NULL);
4505 return(AcquireString(wand->images->magick));
4509 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4513 % M a g i c k G e t I m a g e F u z z %
4517 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4519 % MagickGetImageFuzz() gets the image fuzz.
4521 % The format of the MagickGetImageFuzz method is:
4523 % double MagickGetImageFuzz(MagickWand *wand)
4525 % A description of each parameter follows:
4527 % o wand: the magick wand.
4530 WandExport double MagickGetImageFuzz(MagickWand *wand)
4532 assert(wand != (MagickWand *) NULL);
4533 assert(wand->signature == WandSignature);
4534 if (wand->debug != MagickFalse)
4535 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4536 if (wand->images == (Image *) NULL)
4538 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4539 "ContainsNoImages","`%s'",wand->name);
4542 return(wand->images->fuzz);
4546 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4550 % M a g i c k G e t I m a g e G a m m a %
4554 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4556 % MagickGetImageGamma() gets the image gamma.
4558 % The format of the MagickGetImageGamma method is:
4560 % double MagickGetImageGamma(MagickWand *wand)
4562 % A description of each parameter follows:
4564 % o wand: the magick wand.
4567 WandExport double MagickGetImageGamma(MagickWand *wand)
4569 assert(wand != (MagickWand *) NULL);
4570 assert(wand->signature == WandSignature);
4571 if (wand->debug != MagickFalse)
4572 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4573 if (wand->images == (Image *) NULL)
4575 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4576 "ContainsNoImages","`%s'",wand->name);
4579 return(wand->images->gamma);
4583 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4587 % 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 %
4591 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4593 % MagickGetImageGravity() gets the image gravity.
4595 % The format of the MagickGetImageGravity method is:
4597 % GravityType MagickGetImageGravity(MagickWand *wand)
4599 % A description of each parameter follows:
4601 % o wand: the magick wand.
4604 WandExport GravityType MagickGetImageGravity(MagickWand *wand)
4606 assert(wand != (MagickWand *) NULL);
4607 assert(wand->signature == WandSignature);
4608 if (wand->debug != MagickFalse)
4609 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4610 if (wand->images == (Image *) NULL)
4612 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4613 "ContainsNoImages","`%s'",wand->name);
4614 return(UndefinedGravity);
4616 return(wand->images->gravity);
4620 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4624 % 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 %
4628 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4630 % MagickGetImageGreenPrimary() returns the chromaticy green primary point.
4632 % The format of the MagickGetImageGreenPrimary method is:
4634 % MagickBooleanType MagickGetImageGreenPrimary(MagickWand *wand,double *x,
4637 % A description of each parameter follows:
4639 % o wand: the magick wand.
4641 % o x: the chromaticity green primary x-point.
4643 % o y: the chromaticity green primary y-point.
4646 WandExport MagickBooleanType MagickGetImageGreenPrimary(MagickWand *wand,
4647 double *x,double *y)
4649 assert(wand != (MagickWand *) NULL);
4650 assert(wand->signature == WandSignature);
4651 if (wand->debug != MagickFalse)
4652 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4653 if (wand->images == (Image *) NULL)
4654 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4655 *x=wand->images->chromaticity.green_primary.x;
4656 *y=wand->images->chromaticity.green_primary.y;
4661 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4665 % M a g i c k G e t I m a g e H e i g h t %
4669 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4671 % MagickGetImageHeight() returns the image height.
4673 % The format of the MagickGetImageHeight method is:
4675 % size_t MagickGetImageHeight(MagickWand *wand)
4677 % A description of each parameter follows:
4679 % o wand: the magick wand.
4682 WandExport size_t MagickGetImageHeight(MagickWand *wand)
4684 assert(wand != (MagickWand *) NULL);
4685 assert(wand->signature == WandSignature);
4686 if (wand->debug != MagickFalse)
4687 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4688 if (wand->images == (Image *) NULL)
4689 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4690 return(wand->images->rows);
4694 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4698 % M a g i c k G e t I m a g e H i s t o g r a m %
4702 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4704 % MagickGetImageHistogram() returns the image histogram as an array of
4707 % The format of the MagickGetImageHistogram method is:
4709 % PixelWand **MagickGetImageHistogram(MagickWand *wand,
4710 % size_t *number_colors)
4712 % A description of each parameter follows:
4714 % o wand: the magick wand.
4716 % o number_colors: the number of unique colors in the image and the number
4717 % of pixel wands returned.
4720 WandExport PixelWand **MagickGetImageHistogram(MagickWand *wand,
4721 size_t *number_colors)
4732 assert(wand != (MagickWand *) NULL);
4733 assert(wand->signature == WandSignature);
4734 if (wand->debug != MagickFalse)
4735 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4736 if (wand->images == (Image *) NULL)
4738 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4739 "ContainsNoImages","`%s'",wand->name);
4740 return((PixelWand **) NULL);
4742 histogram=GetImageHistogram(wand->images,number_colors,wand->exception);
4743 if (histogram == (PixelInfo *) NULL)
4744 return((PixelWand **) NULL);
4745 pixel_wands=NewPixelWands(*number_colors);
4746 for (i=0; i < (ssize_t) *number_colors; i++)
4748 PixelSetQuantumPacket(pixel_wands[i],&histogram[i]);
4749 PixelSetColorCount(pixel_wands[i],(size_t) histogram[i].count);
4751 histogram=(PixelInfo *) RelinquishMagickMemory(histogram);
4752 return(pixel_wands);
4756 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4760 % 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 %
4764 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4766 % MagickGetImageInterlaceScheme() gets the image interlace scheme.
4768 % The format of the MagickGetImageInterlaceScheme method is:
4770 % InterlaceType MagickGetImageInterlaceScheme(MagickWand *wand)
4772 % A description of each parameter follows:
4774 % o wand: the magick wand.
4777 WandExport InterlaceType MagickGetImageInterlaceScheme(MagickWand *wand)
4779 assert(wand != (MagickWand *) NULL);
4780 assert(wand->signature == WandSignature);
4781 if (wand->debug != MagickFalse)
4782 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4783 if (wand->images == (Image *) NULL)
4785 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4786 "ContainsNoImages","`%s'",wand->name);
4787 return(UndefinedInterlace);
4789 return(wand->images->interlace);
4793 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4797 % 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 %
4801 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4803 % MagickGetImageInterpolateMethod() returns the interpolation method for the
4806 % The format of the MagickGetImageInterpolateMethod method is:
4808 % PixelInterpolateMethod MagickGetImagePixelInterpolateMethod(
4811 % A description of each parameter follows:
4813 % o wand: the magick wand.
4816 WandExport PixelInterpolateMethod MagickGetImageInterpolateMethod(
4819 assert(wand != (MagickWand *) NULL);
4820 assert(wand->signature == WandSignature);
4821 if (wand->debug != MagickFalse)
4822 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4823 if (wand->images == (Image *) NULL)
4825 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4826 "ContainsNoImages","`%s'",wand->name);
4827 return(UndefinedInterpolatePixel);
4829 return(wand->images->interpolate);
4833 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4837 % M a g i c k G e t I m a g e I t e r a t i o n s %
4841 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4843 % MagickGetImageIterations() gets the image iterations.
4845 % The format of the MagickGetImageIterations method is:
4847 % size_t MagickGetImageIterations(MagickWand *wand)
4849 % A description of each parameter follows:
4851 % o wand: the magick wand.
4854 WandExport size_t MagickGetImageIterations(MagickWand *wand)
4856 assert(wand != (MagickWand *) NULL);
4857 assert(wand->signature == WandSignature);
4858 if (wand->debug != MagickFalse)
4859 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4860 if (wand->images == (Image *) NULL)
4861 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4862 return(wand->images->iterations);
4866 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4870 % M a g i c k G e t I m a g e L e n g t h %
4874 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4876 % MagickGetImageLength() returns the image length in bytes.
4878 % The format of the MagickGetImageLength method is:
4880 % MagickBooleanType MagickGetImageLength(MagickWand *wand,
4881 % MagickSizeType *length)
4883 % A description of each parameter follows:
4885 % o wand: the magick wand.
4887 % o length: the image length in bytes.
4890 WandExport MagickBooleanType MagickGetImageLength(MagickWand *wand,
4891 MagickSizeType *length)
4893 assert(wand != (MagickWand *) NULL);
4894 assert(wand->signature == WandSignature);
4895 if (wand->debug != MagickFalse)
4896 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4897 if (wand->images == (Image *) NULL)
4898 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4899 *length=GetBlobSize(wand->images);
4904 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4908 % M a g i c k G e t I m a g e M a t t e C o l o r %
4912 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4914 % MagickGetImageMatteColor() returns the image matte color.
4916 % The format of the MagickGetImageMatteColor method is:
4918 % MagickBooleanType MagickGetImagematteColor(MagickWand *wand,
4919 % PixelWand *matte_color)
4921 % A description of each parameter follows:
4923 % o wand: the magick wand.
4925 % o matte_color: Return the matte color.
4928 WandExport MagickBooleanType MagickGetImageMatteColor(MagickWand *wand,
4929 PixelWand *matte_color)
4931 assert(wand != (MagickWand *) NULL);
4932 assert(wand->signature == WandSignature);
4933 if (wand->debug != MagickFalse)
4934 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4935 if (wand->images == (Image *) NULL)
4936 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4937 PixelSetQuantumPacket(matte_color,&wand->images->matte_color);
4942 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4946 % 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 %
4950 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4952 % MagickGetImageOrientation() returns the image orientation.
4954 % The format of the MagickGetImageOrientation method is:
4956 % OrientationType MagickGetImageOrientation(MagickWand *wand)
4958 % A description of each parameter follows:
4960 % o wand: the magick wand.
4963 WandExport OrientationType MagickGetImageOrientation(MagickWand *wand)
4965 assert(wand != (MagickWand *) NULL);
4966 assert(wand->signature == WandSignature);
4967 if (wand->debug != MagickFalse)
4968 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4969 if (wand->images == (Image *) NULL)
4971 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4972 "ContainsNoImages","`%s'",wand->name);
4973 return(UndefinedOrientation);
4975 return(wand->images->orientation);
4979 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4983 % M a g i c k G e t I m a g e P a g e %
4987 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4989 % MagickGetImagePage() returns the page geometry associated with the image.
4991 % The format of the MagickGetImagePage method is:
4993 % MagickBooleanType MagickGetImagePage(MagickWand *wand,
4994 % size_t *width,size_t *height,ssize_t *x,ssize_t *y)
4996 % A description of each parameter follows:
4998 % o wand: the magick wand.
5000 % o width: the page width.
5002 % o height: the page height.
5004 % o x: the page x-offset.
5006 % o y: the page y-offset.
5009 WandExport MagickBooleanType MagickGetImagePage(MagickWand *wand,
5010 size_t *width,size_t *height,ssize_t *x,ssize_t *y)
5012 assert(wand != (const MagickWand *) NULL);
5013 assert(wand->signature == WandSignature);
5014 if (wand->debug != MagickFalse)
5015 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5016 if (wand->images == (Image *) NULL)
5017 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5018 *width=wand->images->page.width;
5019 *height=wand->images->page.height;
5020 *x=wand->images->page.x;
5021 *y=wand->images->page.y;
5026 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5030 % M a g i c k G e t I m a g e P i x e l C o l o r %
5034 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5036 % MagickGetImagePixelColor() returns the color of the specified pixel.
5038 % The format of the MagickGetImagePixelColor method is:
5040 % MagickBooleanType MagickGetImagePixelColor(MagickWand *wand,
5041 % const ssize_t x,const ssize_t y,PixelWand *color)
5043 % A description of each parameter follows:
5045 % o wand: the magick wand.
5047 % o x,y: the pixel offset into the image.
5049 % o color: Return the colormap color in this wand.
5052 WandExport MagickBooleanType MagickGetImagePixelColor(MagickWand *wand,
5053 const ssize_t x,const ssize_t y,PixelWand *color)
5055 register const Quantum
5061 assert(wand != (MagickWand *) NULL);
5062 assert(wand->signature == WandSignature);
5063 if (wand->debug != MagickFalse)
5064 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5065 if (wand->images == (Image *) NULL)
5066 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5067 image_view=AcquireCacheView(wand->images);
5068 p=GetCacheViewVirtualPixels(image_view,x,y,1,1,wand->exception);
5069 if (p == (const Quantum *) NULL)
5071 image_view=DestroyCacheView(image_view);
5072 return(MagickFalse);
5074 PixelSetQuantumPixel(wand->images,p,color);
5075 image_view=DestroyCacheView(image_view);
5080 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5084 % M a g i c k G e t I m a g e R e d P r i m a r y %
5088 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5090 % MagickGetImageRedPrimary() returns the chromaticy red primary point.
5092 % The format of the MagickGetImageRedPrimary method is:
5094 % MagickBooleanType MagickGetImageRedPrimary(MagickWand *wand,double *x,
5097 % A description of each parameter follows:
5099 % o wand: the magick wand.
5101 % o x: the chromaticity red primary x-point.
5103 % o y: the chromaticity red primary y-point.
5106 WandExport MagickBooleanType MagickGetImageRedPrimary(MagickWand *wand,
5107 double *x,double *y)
5109 assert(wand != (MagickWand *) NULL);
5110 assert(wand->signature == WandSignature);
5111 if (wand->debug != MagickFalse)
5112 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5113 if (wand->images == (Image *) NULL)
5114 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5115 *x=wand->images->chromaticity.red_primary.x;
5116 *y=wand->images->chromaticity.red_primary.y;
5121 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5125 % M a g i c k G e t I m a g e R e g i o n %
5129 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5131 % MagickGetImageRegion() extracts a region of the image and returns it as a
5134 % The format of the MagickGetImageRegion method is:
5136 % MagickWand *MagickGetImageRegion(MagickWand *wand,
5137 % const size_t width,const size_t height,const ssize_t x,
5140 % A description of each parameter follows:
5142 % o wand: the magick wand.
5144 % o width: the region width.
5146 % o height: the region height.
5148 % o x: the region x offset.
5150 % o y: the region y offset.
5153 WandExport MagickWand *MagickGetImageRegion(MagickWand *wand,
5154 const size_t width,const size_t height,const ssize_t x,
5163 assert(wand != (MagickWand *) NULL);
5164 assert(wand->signature == WandSignature);
5165 if (wand->debug != MagickFalse)
5166 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5167 if (wand->images == (Image *) NULL)
5168 return((MagickWand *) NULL);
5170 region.height=height;
5173 region_image=CropImage(wand->images,®ion,wand->exception);
5174 if (region_image == (Image *) NULL)
5175 return((MagickWand *) NULL);
5176 return(CloneMagickWandFromImages(wand,region_image));
5180 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5184 % 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 %
5188 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5190 % MagickGetImageRenderingIntent() gets the image rendering intent.
5192 % The format of the MagickGetImageRenderingIntent method is:
5194 % RenderingIntent MagickGetImageRenderingIntent(MagickWand *wand)
5196 % A description of each parameter follows:
5198 % o wand: the magick wand.
5201 WandExport RenderingIntent MagickGetImageRenderingIntent(MagickWand *wand)
5203 assert(wand != (MagickWand *) NULL);
5204 assert(wand->signature == WandSignature);
5205 if (wand->debug != MagickFalse)
5206 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5207 if (wand->images == (Image *) NULL)
5209 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5210 "ContainsNoImages","`%s'",wand->name);
5211 return(UndefinedIntent);
5213 return((RenderingIntent) wand->images->rendering_intent);
5217 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5221 % M a g i c k G e t I m a g e R e s o l u t i o n %
5225 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5227 % MagickGetImageResolution() gets the image X and Y resolution.
5229 % The format of the MagickGetImageResolution method is:
5231 % MagickBooleanType MagickGetImageResolution(MagickWand *wand,double *x,
5234 % A description of each parameter follows:
5236 % o wand: the magick wand.
5238 % o x: the image x-resolution.
5240 % o y: the image y-resolution.
5243 WandExport MagickBooleanType MagickGetImageResolution(MagickWand *wand,
5244 double *x,double *y)
5246 assert(wand != (MagickWand *) NULL);
5247 assert(wand->signature == WandSignature);
5248 if (wand->debug != MagickFalse)
5249 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5250 if (wand->images == (Image *) NULL)
5251 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5252 *x=wand->images->x_resolution;
5253 *y=wand->images->y_resolution;
5258 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5262 % M a g i c k G e t I m a g e S c e n e %
5266 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5268 % MagickGetImageScene() gets the image scene.
5270 % The format of the MagickGetImageScene method is:
5272 % size_t MagickGetImageScene(MagickWand *wand)
5274 % A description of each parameter follows:
5276 % o wand: the magick wand.
5279 WandExport size_t MagickGetImageScene(MagickWand *wand)
5281 assert(wand != (MagickWand *) NULL);
5282 assert(wand->signature == WandSignature);
5283 if (wand->debug != MagickFalse)
5284 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5285 if (wand->images == (Image *) NULL)
5286 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5287 return(wand->images->scene);
5291 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5295 % M a g i c k G e t I m a g e S i g n a t u r e %
5299 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5301 % MagickGetImageSignature() generates an SHA-256 message digest for the image
5304 % The format of the MagickGetImageSignature method is:
5306 % const char MagickGetImageSignature(MagickWand *wand)
5308 % A description of each parameter follows:
5310 % o wand: the magick wand.
5313 WandExport char *MagickGetImageSignature(MagickWand *wand)
5321 assert(wand != (MagickWand *) NULL);
5322 assert(wand->signature == WandSignature);
5323 if (wand->debug != MagickFalse)
5324 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5325 if (wand->images == (Image *) NULL)
5327 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5328 "ContainsNoImages","`%s'",wand->name);
5329 return((char *) NULL);
5331 status=SignatureImage(wand->images,wand->exception);
5332 if (status == MagickFalse)
5333 return((char *) NULL);
5334 value=GetImageProperty(wand->images,"signature");
5335 if (value == (const char *) NULL)
5336 return((char *) NULL);
5337 return(AcquireString(value));
5341 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5345 % 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 %
5349 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5351 % MagickGetImageTicksPerSecond() gets the image ticks-per-second.
5353 % The format of the MagickGetImageTicksPerSecond method is:
5355 % size_t MagickGetImageTicksPerSecond(MagickWand *wand)
5357 % A description of each parameter follows:
5359 % o wand: the magick wand.
5362 WandExport size_t MagickGetImageTicksPerSecond(MagickWand *wand)
5364 assert(wand != (MagickWand *) NULL);
5365 assert(wand->signature == WandSignature);
5366 if (wand->debug != MagickFalse)
5367 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5368 if (wand->images == (Image *) NULL)
5369 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5370 return((size_t) wand->images->ticks_per_second);
5374 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5378 % M a g i c k G e t I m a g e T y p e %
5382 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5384 % MagickGetImageType() gets the potential image type:
5386 % Bilevel Grayscale GrayscaleMatte
5387 % Palette PaletteMatte TrueColor
5388 % TrueColorMatte ColorSeparation ColorSeparationMatte
5390 % To ensure the image type matches its potential, use MagickSetImageType():
5392 % (void) MagickSetImageType(wand,MagickGetImageType(wand));
5394 % The format of the MagickGetImageType method is:
5396 % ImageType MagickGetImageType(MagickWand *wand)
5398 % A description of each parameter follows:
5400 % o wand: the magick wand.
5403 WandExport ImageType MagickGetImageType(MagickWand *wand)
5405 assert(wand != (MagickWand *) NULL);
5406 assert(wand->signature == WandSignature);
5407 if (wand->debug != MagickFalse)
5408 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5409 if (wand->images == (Image *) NULL)
5411 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5412 "ContainsNoImages","`%s'",wand->name);
5413 return(UndefinedType);
5415 return(GetImageType(wand->images,wand->exception));
5419 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5423 % M a g i c k G e t I m a g e U n i t s %
5427 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5429 % MagickGetImageUnits() gets the image units of resolution.
5431 % The format of the MagickGetImageUnits method is:
5433 % ResolutionType MagickGetImageUnits(MagickWand *wand)
5435 % A description of each parameter follows:
5437 % o wand: the magick wand.
5440 WandExport ResolutionType MagickGetImageUnits(MagickWand *wand)
5442 assert(wand != (MagickWand *) NULL);
5443 assert(wand->signature == WandSignature);
5444 if (wand->debug != MagickFalse)
5445 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5446 if (wand->images == (Image *) NULL)
5448 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5449 "ContainsNoImages","`%s'",wand->name);
5450 return(UndefinedResolution);
5452 return(wand->images->units);
5456 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5460 % 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 %
5464 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5466 % MagickGetImageVirtualPixelMethod() returns the virtual pixel method for the
5469 % The format of the MagickGetImageVirtualPixelMethod method is:
5471 % VirtualPixelMethod MagickGetImageVirtualPixelMethod(MagickWand *wand)
5473 % A description of each parameter follows:
5475 % o wand: the magick wand.
5478 WandExport VirtualPixelMethod MagickGetImageVirtualPixelMethod(MagickWand *wand)
5480 assert(wand != (MagickWand *) NULL);
5481 assert(wand->signature == WandSignature);
5482 if (wand->debug != MagickFalse)
5483 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5484 if (wand->images == (Image *) NULL)
5486 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5487 "ContainsNoImages","`%s'",wand->name);
5488 return(UndefinedVirtualPixelMethod);
5490 return(GetImageVirtualPixelMethod(wand->images));
5494 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5498 % M a g i c k G e t I m a g e W h i t e P o i n t %
5502 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5504 % MagickGetImageWhitePoint() returns the chromaticy white point.
5506 % The format of the MagickGetImageWhitePoint method is:
5508 % MagickBooleanType MagickGetImageWhitePoint(MagickWand *wand,double *x,
5511 % A description of each parameter follows:
5513 % o wand: the magick wand.
5515 % o x: the chromaticity white x-point.
5517 % o y: the chromaticity white y-point.
5520 WandExport MagickBooleanType MagickGetImageWhitePoint(MagickWand *wand,
5521 double *x,double *y)
5523 assert(wand != (MagickWand *) NULL);
5524 assert(wand->signature == WandSignature);
5525 if (wand->debug != MagickFalse)
5526 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5527 if (wand->images == (Image *) NULL)
5528 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5529 *x=wand->images->chromaticity.white_point.x;
5530 *y=wand->images->chromaticity.white_point.y;
5535 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5539 % M a g i c k G e t I m a g e W i d t h %
5543 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5545 % MagickGetImageWidth() returns the image width.
5547 % The format of the MagickGetImageWidth method is:
5549 % size_t MagickGetImageWidth(MagickWand *wand)
5551 % A description of each parameter follows:
5553 % o wand: the magick wand.
5556 WandExport size_t MagickGetImageWidth(MagickWand *wand)
5558 assert(wand != (MagickWand *) NULL);
5559 assert(wand->signature == WandSignature);
5560 if (wand->debug != MagickFalse)
5561 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5562 if (wand->images == (Image *) NULL)
5563 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5564 return(wand->images->columns);
5568 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5572 % M a g i c k G e t N u m b e r I m a g e s %
5576 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5578 % MagickGetNumberImages() returns the number of images associated with a
5581 % The format of the MagickGetNumberImages method is:
5583 % size_t MagickGetNumberImages(MagickWand *wand)
5585 % A description of each parameter follows:
5587 % o wand: the magick wand.
5590 WandExport size_t MagickGetNumberImages(MagickWand *wand)
5592 assert(wand != (MagickWand *) NULL);
5593 assert(wand->signature == WandSignature);
5594 if (wand->debug != MagickFalse)
5595 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5596 return(GetImageListLength(wand->images));
5600 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5604 % 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 %
5608 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5610 % MagickGetImageTotalInkDensity() gets the image total ink density.
5612 % The format of the MagickGetImageTotalInkDensity method is:
5614 % double MagickGetImageTotalInkDensity(MagickWand *wand)
5616 % A description of each parameter follows:
5618 % o wand: the magick wand.
5621 WandExport double MagickGetImageTotalInkDensity(MagickWand *wand)
5623 assert(wand != (MagickWand *) NULL);
5624 assert(wand->signature == WandSignature);
5625 if (wand->debug != MagickFalse)
5626 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5627 if (wand->images == (Image *) NULL)
5629 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5630 "ContainsNoImages","`%s'",wand->name);
5633 return(GetImageTotalInkDensity(wand->images));
5637 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5641 % M a g i c k H a l d C l u t I m a g e %
5645 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5647 % MagickHaldClutImage() replaces colors in the image from a Hald color lookup
5648 % table. A Hald color lookup table is a 3-dimensional color cube mapped to 2
5649 % dimensions. Create it with the HALD coder. You can apply any color
5650 % transformation to the Hald image and then use this method to apply the
5651 % transform to the image.
5653 % The format of the MagickHaldClutImage method is:
5655 % MagickBooleanType MagickHaldClutImage(MagickWand *wand,
5656 % const MagickWand *hald_wand)
5658 % A description of each parameter follows:
5660 % o wand: the magick wand.
5662 % o hald_image: the hald CLUT image.
5665 WandExport MagickBooleanType MagickHaldClutImage(MagickWand *wand,
5666 const MagickWand *hald_wand)
5671 assert(wand != (MagickWand *) NULL);
5672 assert(wand->signature == WandSignature);
5673 if (wand->debug != MagickFalse)
5674 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5675 if ((wand->images == (Image *) NULL) || (hald_wand->images == (Image *) NULL))
5676 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5677 status=HaldClutImage(wand->images,hald_wand->images,&wand->images->exception);
5682 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5686 % M a g i c k H a s N e x t I m a g e %
5690 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5692 % MagickHasNextImage() returns MagickTrue if the wand has more images when
5693 % traversing the list in the forward direction
5695 % The format of the MagickHasNextImage method is:
5697 % MagickBooleanType MagickHasNextImage(MagickWand *wand)
5699 % A description of each parameter follows:
5701 % o wand: the magick wand.
5704 WandExport MagickBooleanType MagickHasNextImage(MagickWand *wand)
5706 assert(wand != (MagickWand *) NULL);
5707 assert(wand->signature == WandSignature);
5708 if (wand->debug != MagickFalse)
5709 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5710 if (wand->images == (Image *) NULL)
5711 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5712 if (GetNextImageInList(wand->images) == (Image *) NULL)
5713 return(MagickFalse);
5718 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5722 % M a g i c k H a s P r e v i o u s I m a g e %
5726 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5728 % MagickHasPreviousImage() returns MagickTrue if the wand has more images when
5729 % traversing the list in the reverse direction
5731 % The format of the MagickHasPreviousImage method is:
5733 % MagickBooleanType MagickHasPreviousImage(MagickWand *wand)
5735 % A description of each parameter follows:
5737 % o wand: the magick wand.
5740 WandExport MagickBooleanType MagickHasPreviousImage(MagickWand *wand)
5742 assert(wand != (MagickWand *) NULL);
5743 assert(wand->signature == WandSignature);
5744 if (wand->debug != MagickFalse)
5745 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5746 if (wand->images == (Image *) NULL)
5747 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5748 if (GetPreviousImageInList(wand->images) == (Image *) NULL)
5749 return(MagickFalse);
5754 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5758 % M a g i c k I d e n t i f y I m a g e %
5762 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5764 % MagickIdentifyImage() identifies an image by printing its attributes to the
5765 % file. Attributes include the image width, height, size, and others.
5767 % The format of the MagickIdentifyImage method is:
5769 % const char *MagickIdentifyImage(MagickWand *wand)
5771 % A description of each parameter follows:
5773 % o wand: the magick wand.
5776 WandExport char *MagickIdentifyImage(MagickWand *wand)
5780 filename[MaxTextExtent];
5788 assert(wand != (MagickWand *) NULL);
5789 assert(wand->signature == WandSignature);
5790 if (wand->debug != MagickFalse)
5791 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5792 if (wand->images == (Image *) NULL)
5794 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5795 "ContainsNoImages","`%s'",wand->name);
5796 return((char *) NULL);
5798 description=(char *) NULL;
5799 unique_file=AcquireUniqueFileResource(filename);
5801 if (unique_file != -1)
5802 file=fdopen(unique_file,"wb");
5803 if ((unique_file == -1) || (file == (FILE *) NULL))
5805 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5806 "UnableToCreateTemporaryFile","`%s'",wand->name);
5807 return((char *) NULL);
5809 (void) IdentifyImage(wand->images,file,MagickTrue,wand->exception);
5810 (void) fclose(file);
5811 description=FileToString(filename,~0,wand->exception);
5812 (void) RelinquishUniqueFileResource(filename);
5813 return(description);
5817 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5821 % M a g i c k I m p l o d e I m a g e %
5825 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5827 % MagickImplodeImage() creates a new image that is a copy of an existing
5828 % one with the image pixels "implode" by the specified percentage. It
5829 % allocates the memory necessary for the new Image structure and returns a
5830 % pointer to the new image.
5832 % The format of the MagickImplodeImage method is:
5834 % MagickBooleanType MagickImplodeImage(MagickWand *wand,
5835 % const double radius,const PixelInterpolateMethod method)
5837 % A description of each parameter follows:
5839 % o wand: the magick wand.
5841 % o amount: Define the extent of the implosion.
5843 % o method: the pixel interpolation method.
5846 WandExport MagickBooleanType MagickImplodeImage(MagickWand *wand,
5847 const double amount,const PixelInterpolateMethod method)
5852 assert(wand != (MagickWand *) NULL);
5853 assert(wand->signature == WandSignature);
5854 if (wand->debug != MagickFalse)
5855 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5856 if (wand->images == (Image *) NULL)
5857 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5858 implode_image=ImplodeImage(wand->images,amount,method,wand->exception);
5859 if (implode_image == (Image *) NULL)
5860 return(MagickFalse);
5861 ReplaceImageInList(&wand->images,implode_image);
5866 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5870 % M a g i c k I m p o r t I m a g e P i x e l s %
5874 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5876 % MagickImportImagePixels() accepts pixel datand stores it in the image at the
5877 % location you specify. The method returns MagickFalse on success otherwise
5878 % MagickTrue if an error is encountered. The pixel data can be either char,
5879 % short int, int, ssize_t, float, or double in the order specified by map.
5881 % Suppose your want to upload the first scanline of a 640x480 image from
5882 % character data in red-green-blue order:
5884 % MagickImportImagePixels(wand,0,0,640,1,"RGB",CharPixel,pixels);
5886 % The format of the MagickImportImagePixels method is:
5888 % MagickBooleanType MagickImportImagePixels(MagickWand *wand,
5889 % const ssize_t x,const ssize_t y,const size_t columns,
5890 % const size_t rows,const char *map,const StorageType storage,
5891 % const void *pixels)
5893 % A description of each parameter follows:
5895 % o wand: the magick wand.
5897 % o x, y, columns, rows: These values define the perimeter of a region
5898 % of pixels you want to define.
5900 % o map: This string reflects the expected ordering of the pixel array.
5901 % It can be any combination or order of R = red, G = green, B = blue,
5902 % A = alpha (0 is transparent), O = alpha (0 is opaque), C = cyan,
5903 % Y = yellow, M = magenta, K = black, I = intensity (for grayscale),
5906 % o storage: Define the data type of the pixels. Float and double types are
5907 % expected to be normalized [0..1] otherwise [0..QuantumRange]. Choose from
5908 % these types: CharPixel, ShortPixel, IntegerPixel, LongPixel, FloatPixel,
5911 % o pixels: This array of values contain the pixel components as defined by
5912 % map and type. You must preallocate this array where the expected
5913 % length varies depending on the values of width, height, map, and type.
5916 WandExport MagickBooleanType MagickImportImagePixels(MagickWand *wand,
5917 const ssize_t x,const ssize_t y,const size_t columns,const size_t rows,
5918 const char *map,const StorageType storage,const void *pixels)
5923 assert(wand != (MagickWand *) NULL);
5924 assert(wand->signature == WandSignature);
5925 if (wand->debug != MagickFalse)
5926 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5927 if (wand->images == (Image *) NULL)
5928 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5929 status=ImportImagePixels(wand->images,x,y,columns,rows,map,storage,pixels,
5935 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5939 % 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 %
5943 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5945 % MagickInverseFourierTransformImage() implements the inverse discrete
5946 % Fourier transform (DFT) of the image either as a magnitude / phase or real /
5947 % imaginary image pair.
5949 % The format of the MagickInverseFourierTransformImage method is:
5951 % MagickBooleanType MagickInverseFourierTransformImage(
5952 % MagickWand *magnitude_wand,MagickWand *phase_wand,
5953 % const MagickBooleanType magnitude)
5955 % A description of each parameter follows:
5957 % o magnitude_wand: the magnitude or real wand.
5959 % o phase_wand: the phase or imaginary wand.
5961 % o magnitude: if true, return as magnitude / phase pair otherwise a real /
5962 % imaginary image pair.
5965 WandExport MagickBooleanType MagickInverseFourierTransformImage(
5966 MagickWand *magnitude_wand,MagickWand *phase_wand,
5967 const MagickBooleanType magnitude)
5975 assert(magnitude_wand != (MagickWand *) NULL);
5976 assert(magnitude_wand->signature == WandSignature);
5977 if (magnitude_wand->debug != MagickFalse)
5978 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",
5979 magnitude_wand->name);
5980 wand=magnitude_wand;
5981 if (magnitude_wand->images == (Image *) NULL)
5982 ThrowWandException(WandError,"ContainsNoImages",
5983 magnitude_wand->name);
5984 assert(phase_wand != (MagickWand *) NULL);
5985 assert(phase_wand->signature == WandSignature);
5986 inverse_image=InverseFourierTransformImage(magnitude_wand->images,
5987 phase_wand->images,magnitude,wand->exception);
5988 if (inverse_image == (Image *) NULL)
5989 return(MagickFalse);
5990 ReplaceImageInList(&wand->images,inverse_image);
5995 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5999 % M a g i c k L a b e l I m a g e %
6003 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6005 % MagickLabelImage() adds a label to your image.
6007 % The format of the MagickLabelImage method is:
6009 % MagickBooleanType MagickLabelImage(MagickWand *wand,const char *label)
6011 % A description of each parameter follows:
6013 % o wand: the magick wand.
6015 % o label: the image label.
6018 WandExport MagickBooleanType MagickLabelImage(MagickWand *wand,
6024 assert(wand != (MagickWand *) NULL);
6025 assert(wand->signature == WandSignature);
6026 if (wand->debug != MagickFalse)
6027 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6028 if (wand->images == (Image *) NULL)
6029 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6030 status=SetImageProperty(wand->images,"label",label);
6031 if (status == MagickFalse)
6032 InheritException(wand->exception,&wand->images->exception);
6037 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6041 % M a g i c k L e v e l I m a g e %
6045 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6047 % MagickLevelImage() adjusts the levels of an image by scaling the colors
6048 % falling between specified white and black points to the full available
6049 % quantum range. The parameters provided represent the black, mid, and white
6050 % points. The black point specifies the darkest color in the image. Colors
6051 % darker than the black point are set to zero. Mid point specifies a gamma
6052 % correction to apply to the image. White point specifies the lightest color
6053 % in the image. Colors brighter than the white point are set to the maximum
6056 % The format of the MagickLevelImage method is:
6058 % MagickBooleanType MagickLevelImage(MagickWand *wand,
6059 % const double black_point,const double gamma,const double white_point)
6060 % MagickBooleanType MagickLevelImage(MagickWand *wand,
6061 % const ChannelType channel,const double black_point,const double gamma,
6062 % const double white_point)
6064 % A description of each parameter follows:
6066 % o wand: the magick wand.
6068 % o channel: Identify which channel to level: RedChannel, GreenChannel,
6070 % o black_point: the black point.
6072 % o gamma: the gamma.
6074 % o white_point: the white point.
6077 WandExport MagickBooleanType MagickLevelImage(MagickWand *wand,
6078 const double black_point,const double gamma,const double white_point)
6083 assert(wand != (MagickWand *) NULL);
6084 assert(wand->signature == WandSignature);
6085 if (wand->debug != MagickFalse)
6086 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6087 if (wand->images == (Image *) NULL)
6088 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6089 status=LevelImage(wand->images,black_point,white_point,gamma,
6090 &wand->images->exception);
6095 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6099 % M a g i c k L i n e a r S t r e t c h I m a g e %
6103 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6105 % MagickLinearStretchImage() stretches with saturation the image intensity.
6107 % You can also reduce the influence of a particular channel with a gamma
6110 % The format of the MagickLinearStretchImage method is:
6112 % MagickBooleanType MagickLinearStretchImage(MagickWand *wand,
6113 % const double black_point,const double white_point)
6115 % A description of each parameter follows:
6117 % o wand: the magick wand.
6119 % o black_point: the black point.
6121 % o white_point: the white point.
6124 WandExport MagickBooleanType MagickLinearStretchImage(MagickWand *wand,
6125 const double black_point,const double white_point)
6130 assert(wand != (MagickWand *) NULL);
6131 assert(wand->signature == WandSignature);
6132 if (wand->debug != MagickFalse)
6133 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6134 if (wand->images == (Image *) NULL)
6135 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6136 status=LinearStretchImage(wand->images,black_point,white_point,
6137 &wand->images->exception);
6142 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6146 % M a g i c k L i q u i d R e s c a l e I m a g e %
6150 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6152 % MagickLiquidRescaleImage() rescales image with seam carving.
6154 % MagickBooleanType MagickLiquidRescaleImage(MagickWand *wand,
6155 % const size_t columns,const size_t rows,
6156 % const double delta_x,const double rigidity)
6158 % A description of each parameter follows:
6160 % o wand: the magick wand.
6162 % o columns: the number of columns in the scaled image.
6164 % o rows: the number of rows in the scaled image.
6166 % o delta_x: maximum seam transversal step (0 means straight seams).
6168 % o rigidity: introduce a bias for non-straight seams (typically 0).
6171 WandExport MagickBooleanType MagickLiquidRescaleImage(MagickWand *wand,
6172 const size_t columns,const size_t rows,const double delta_x,
6173 const double rigidity)
6178 assert(wand != (MagickWand *) NULL);
6179 assert(wand->signature == WandSignature);
6180 if (wand->debug != MagickFalse)
6181 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6182 if (wand->images == (Image *) NULL)
6183 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6184 rescale_image=LiquidRescaleImage(wand->images,columns,rows,delta_x,
6185 rigidity,wand->exception);
6186 if (rescale_image == (Image *) NULL)
6187 return(MagickFalse);
6188 ReplaceImageInList(&wand->images,rescale_image);
6193 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6197 % M a g i c k M a g n i f y I m a g e %
6201 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6203 % MagickMagnifyImage() is a convenience method that scales an image
6204 % proportionally to twice its original size.
6206 % The format of the MagickMagnifyImage method is:
6208 % MagickBooleanType MagickMagnifyImage(MagickWand *wand)
6210 % A description of each parameter follows:
6212 % o wand: the magick wand.
6215 WandExport MagickBooleanType MagickMagnifyImage(MagickWand *wand)
6220 assert(wand != (MagickWand *) NULL);
6221 assert(wand->signature == WandSignature);
6222 if (wand->debug != MagickFalse)
6223 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6224 if (wand->images == (Image *) NULL)
6225 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6226 magnify_image=MagnifyImage(wand->images,wand->exception);
6227 if (magnify_image == (Image *) NULL)
6228 return(MagickFalse);
6229 ReplaceImageInList(&wand->images,magnify_image);
6234 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6238 % M a g i c k M e r g e I m a g e L a y e r s %
6242 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6244 % MagickMergeImageLayers() composes all the image layers from the current
6245 % given image onward to produce a single image of the merged layers.
6247 % The inital canvas's size depends on the given ImageLayerMethod, and is
6248 % initialized using the first images background color. The images
6249 % are then compositied onto that image in sequence using the given
6250 % composition that has been assigned to each individual image.
6252 % The format of the MagickMergeImageLayers method is:
6254 % MagickWand *MagickMergeImageLayers(MagickWand *wand,
6255 % const ImageLayerMethod method)
6257 % A description of each parameter follows:
6259 % o wand: the magick wand.
6261 % o method: the method of selecting the size of the initial canvas.
6263 % MergeLayer: Merge all layers onto a canvas just large enough
6264 % to hold all the actual images. The virtual canvas of the
6265 % first image is preserved but otherwise ignored.
6267 % FlattenLayer: Use the virtual canvas size of first image.
6268 % Images which fall outside this canvas is clipped.
6269 % This can be used to 'fill out' a given virtual canvas.
6271 % MosaicLayer: Start with the virtual canvas of the first image,
6272 % enlarging left and right edges to contain all images.
6273 % Images with negative offsets will be clipped.
6276 WandExport MagickWand *MagickMergeImageLayers(MagickWand *wand,
6277 const ImageLayerMethod method)
6282 assert(wand != (MagickWand *) NULL);
6283 assert(wand->signature == WandSignature);
6284 if (wand->debug != MagickFalse)
6285 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6286 if (wand->images == (Image *) NULL)
6287 return((MagickWand *) NULL);
6288 mosaic_image=MergeImageLayers(wand->images,method,wand->exception);
6289 if (mosaic_image == (Image *) NULL)
6290 return((MagickWand *) NULL);
6291 return(CloneMagickWandFromImages(wand,mosaic_image));
6295 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6299 % M a g i c k M i n i f y I m a g e %
6303 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6305 % MagickMinifyImage() is a convenience method that scales an image
6306 % proportionally to one-half its original size
6308 % The format of the MagickMinifyImage method is:
6310 % MagickBooleanType MagickMinifyImage(MagickWand *wand)
6312 % A description of each parameter follows:
6314 % o wand: the magick wand.
6317 WandExport MagickBooleanType MagickMinifyImage(MagickWand *wand)
6322 assert(wand != (MagickWand *) NULL);
6323 assert(wand->signature == WandSignature);
6324 if (wand->debug != MagickFalse)
6325 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6326 if (wand->images == (Image *) NULL)
6327 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6328 minify_image=MinifyImage(wand->images,wand->exception);
6329 if (minify_image == (Image *) NULL)
6330 return(MagickFalse);
6331 ReplaceImageInList(&wand->images,minify_image);
6336 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6340 % M a g i c k M o d u l a t e I m a g e %
6344 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6346 % MagickModulateImage() lets you control the brightness, saturation, and hue
6347 % of an image. Hue is the percentage of absolute rotation from the current
6348 % position. For example 50 results in a counter-clockwise rotation of 90
6349 % degrees, 150 results in a clockwise rotation of 90 degrees, with 0 and 200
6350 % both resulting in a rotation of 180 degrees.
6352 % To increase the color brightness by 20% and decrease the color saturation by
6353 % 10% and leave the hue unchanged, use: 120,90,100.
6355 % The format of the MagickModulateImage method is:
6357 % MagickBooleanType MagickModulateImage(MagickWand *wand,
6358 % const double brightness,const double saturation,const double hue)
6360 % A description of each parameter follows:
6362 % o wand: the magick wand.
6364 % o brightness: the percent change in brighness.
6366 % o saturation: the percent change in saturation.
6368 % o hue: the percent change in hue.
6371 WandExport MagickBooleanType MagickModulateImage(MagickWand *wand,
6372 const double brightness,const double saturation,const double hue)
6375 modulate[MaxTextExtent];
6380 assert(wand != (MagickWand *) NULL);
6381 assert(wand->signature == WandSignature);
6382 if (wand->debug != MagickFalse)
6383 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6384 if (wand->images == (Image *) NULL)
6385 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6386 (void) FormatLocaleString(modulate,MaxTextExtent,"%g,%g,%g",
6387 brightness,saturation,hue);
6388 status=ModulateImage(wand->images,modulate,&wand->images->exception);
6393 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6397 % M a g i c k M o n t a g e I m a g e %
6401 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6403 % MagickMontageImage() creates a composite image by combining several
6404 % separate images. The images are tiled on the composite image with the name
6405 % of the image optionally appearing just below the individual tile.
6407 % The format of the MagickMontageImage method is:
6409 % MagickWand *MagickMontageImage(MagickWand *wand,
6410 % const DrawingWand drawing_wand,const char *tile_geometry,
6411 % const char *thumbnail_geometry,const MontageMode mode,
6412 % const char *frame)
6414 % A description of each parameter follows:
6416 % o wand: the magick wand.
6418 % o drawing_wand: the drawing wand. The font name, size, and color are
6419 % obtained from this wand.
6421 % o tile_geometry: the number of tiles per row and page (e.g. 6x4+0+0).
6423 % o thumbnail_geometry: Preferred image size and border size of each
6424 % thumbnail (e.g. 120x120+4+3>).
6426 % o mode: Thumbnail framing mode: Frame, Unframe, or Concatenate.
6428 % o frame: Surround the image with an ornamental border (e.g. 15x15+3+3).
6429 % The frame color is that of the thumbnail's matte color.
6432 WandExport MagickWand *MagickMontageImage(MagickWand *wand,
6433 const DrawingWand *drawing_wand,const char *tile_geometry,
6434 const char *thumbnail_geometry,const MontageMode mode,const char *frame)
6448 assert(wand != (MagickWand *) NULL);
6449 assert(wand->signature == WandSignature);
6450 if (wand->debug != MagickFalse)
6451 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6452 if (wand->images == (Image *) NULL)
6453 return((MagickWand *) NULL);
6454 montage_info=CloneMontageInfo(wand->image_info,(MontageInfo *) NULL);
6459 (void) CloneString(&montage_info->frame,"15x15+3+3");
6460 montage_info->shadow=MagickTrue;
6465 montage_info->frame=(char *) NULL;
6466 montage_info->shadow=MagickFalse;
6467 montage_info->border_width=0;
6470 case ConcatenateMode:
6472 montage_info->frame=(char *) NULL;
6473 montage_info->shadow=MagickFalse;
6474 (void) CloneString(&montage_info->geometry,"+0+0");
6475 montage_info->border_width=0;
6481 font=DrawGetFont(drawing_wand);
6482 if (font != (char *) NULL)
6483 (void) CloneString(&montage_info->font,font);
6484 if (frame != (char *) NULL)
6485 (void) CloneString(&montage_info->frame,frame);
6486 montage_info->pointsize=DrawGetFontSize(drawing_wand);
6487 pixel_wand=NewPixelWand();
6488 DrawGetFillColor(drawing_wand,pixel_wand);
6489 PixelGetQuantumPacket(pixel_wand,&montage_info->fill);
6490 DrawGetStrokeColor(drawing_wand,pixel_wand);
6491 PixelGetQuantumPacket(pixel_wand,&montage_info->stroke);
6492 pixel_wand=DestroyPixelWand(pixel_wand);
6493 if (thumbnail_geometry != (char *) NULL)
6494 (void) CloneString(&montage_info->geometry,thumbnail_geometry);
6495 if (tile_geometry != (char *) NULL)
6496 (void) CloneString(&montage_info->tile,tile_geometry);
6497 montage_image=MontageImageList(wand->image_info,montage_info,wand->images,
6499 montage_info=DestroyMontageInfo(montage_info);
6500 if (montage_image == (Image *) NULL)
6501 return((MagickWand *) NULL);
6502 return(CloneMagickWandFromImages(wand,montage_image));
6506 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6510 % M a g i c k M o r p h I m a g e s %
6514 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6516 % MagickMorphImages() method morphs a set of images. Both the image pixels
6517 % and size are linearly interpolated to give the appearance of a
6518 % meta-morphosis from one image to the next.
6520 % The format of the MagickMorphImages method is:
6522 % MagickWand *MagickMorphImages(MagickWand *wand,
6523 % const size_t number_frames)
6525 % A description of each parameter follows:
6527 % o wand: the magick wand.
6529 % o number_frames: the number of in-between images to generate.
6532 WandExport MagickWand *MagickMorphImages(MagickWand *wand,
6533 const size_t number_frames)
6538 assert(wand != (MagickWand *) NULL);
6539 assert(wand->signature == WandSignature);
6540 if (wand->debug != MagickFalse)
6541 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6542 if (wand->images == (Image *) NULL)
6543 return((MagickWand *) NULL);
6544 morph_image=MorphImages(wand->images,number_frames,wand->exception);
6545 if (morph_image == (Image *) NULL)
6546 return((MagickWand *) NULL);
6547 return(CloneMagickWandFromImages(wand,morph_image));
6551 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6555 % M a g i c k M o r p h o l o g y I m a g e %
6559 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6561 % MagickMorphologyImage() applies a user supplied kernel to the image
6562 % according to the given mophology method.
6564 % The format of the MagickMorphologyImage method is:
6566 % MagickBooleanType MagickMorphologyImage(MagickWand *wand,
6567 % MorphologyMethod method,const ssize_t iterations,KernelInfo *kernel)
6569 % A description of each parameter follows:
6571 % o wand: the magick wand.
6573 % o method: the morphology method to be applied.
6575 % o iterations: apply the operation this many times (or no change).
6576 % A value of -1 means loop until no change found. How this is applied
6577 % may depend on the morphology method. Typically this is a value of 1.
6579 % o kernel: An array of doubles representing the morphology kernel.
6582 WandExport MagickBooleanType MagickMorphologyImage(MagickWand *wand,
6583 MorphologyMethod method,const ssize_t iterations,KernelInfo *kernel)
6588 assert(wand != (MagickWand *) NULL);
6589 assert(wand->signature == WandSignature);
6590 if (wand->debug != MagickFalse)
6591 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6592 if (kernel == (const KernelInfo *) NULL)
6593 return(MagickFalse);
6594 if (wand->images == (Image *) NULL)
6595 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6596 morphology_image=MorphologyImage(wand->images,method,iterations,kernel,
6598 if (morphology_image == (Image *) NULL)
6599 return(MagickFalse);
6600 ReplaceImageInList(&wand->images,morphology_image);
6605 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6609 % M a g i c k M o t i o n B l u r I m a g e %
6613 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6615 % MagickMotionBlurImage() simulates motion blur. We convolve the image with a
6616 % Gaussian operator of the given radius and standard deviation (sigma).
6617 % For reasonable results, radius should be larger than sigma. Use a
6618 % radius of 0 and MotionBlurImage() selects a suitable radius for you.
6619 % Angle gives the angle of the blurring motion.
6621 % The format of the MagickMotionBlurImage method is:
6623 % MagickBooleanType MagickMotionBlurImage(MagickWand *wand,
6624 % const double radius,const double sigma,const double angle,
6625 % const double bias)
6627 % A description of each parameter follows:
6629 % o wand: the magick wand.
6631 % o radius: the radius of the Gaussian, in pixels, not counting
6634 % o sigma: the standard deviation of the Gaussian, in pixels.
6636 % o angle: Apply the effect along this angle.
6639 WandExport MagickBooleanType MagickMotionBlurImage(MagickWand *wand,
6640 const double radius,const double sigma,const double angle,const double bias)
6645 assert(wand != (MagickWand *) NULL);
6646 assert(wand->signature == WandSignature);
6647 if (wand->debug != MagickFalse)
6648 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6649 if (wand->images == (Image *) NULL)
6650 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6651 blur_image=MotionBlurImage(wand->images,radius,sigma,angle,bias,
6653 if (blur_image == (Image *) NULL)
6654 return(MagickFalse);
6655 ReplaceImageInList(&wand->images,blur_image);
6660 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6664 % M a g i c k N e g a t e I m a g e %
6668 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6670 % MagickNegateImage() negates the colors in the reference image. The
6671 % Grayscale option means that only grayscale values within the image are
6674 % You can also reduce the influence of a particular channel with a gamma
6677 % The format of the MagickNegateImage method is:
6679 % MagickBooleanType MagickNegateImage(MagickWand *wand,
6680 % const MagickBooleanType gray)
6682 % A description of each parameter follows:
6684 % o wand: the magick wand.
6686 % o gray: If MagickTrue, only negate grayscale pixels within the image.
6689 WandExport MagickBooleanType MagickNegateImage(MagickWand *wand,
6690 const MagickBooleanType gray)
6695 assert(wand != (MagickWand *) NULL);
6696 assert(wand->signature == WandSignature);
6697 if (wand->debug != MagickFalse)
6698 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6699 if (wand->images == (Image *) NULL)
6700 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6701 status=NegateImage(wand->images,gray,wand->exception);
6706 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6710 % M a g i c k N e w I m a g e %
6714 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6716 % MagickNewImage() adds a blank image canvas of the specified size and
6717 % background color to the wand.
6719 % The format of the MagickNewImage method is:
6721 % MagickBooleanType MagickNewImage(MagickWand *wand,
6722 % const size_t columns,const size_t rows,
6723 % const PixelWand *background)
6725 % A description of each parameter follows:
6727 % o wand: the magick wand.
6729 % o width: the image width.
6731 % o height: the image height.
6733 % o background: the image color.
6736 WandExport MagickBooleanType MagickNewImage(MagickWand *wand,const size_t width,
6737 const size_t height,const PixelWand *background)
6745 assert(wand != (MagickWand *) NULL);
6746 assert(wand->signature == WandSignature);
6747 if (wand->debug != MagickFalse)
6748 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6749 PixelGetMagickColor(background,&pixel);
6750 images=NewMagickImage(wand->image_info,width,height,&pixel,&wand->exception);
6751 if (images == (Image *) NULL)
6752 return(MagickFalse);
6753 return(InsertImageInWand(wand,images));
6757 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6761 % M a g i c k N e x t I m a g e %
6765 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6767 % MagickNextImage() associates the next image in the image list with a magick
6768 % wand. It returns true if the it succeeds, meaning the current image is the
6769 % next image to be iterated over.
6771 % The format of the MagickNextImage method is:
6773 % MagickBooleanType MagickNextImage(MagickWand *wand)
6775 % A description of each parameter follows:
6777 % o wand: the magick wand.
6780 WandExport MagickBooleanType MagickNextImage(MagickWand *wand)
6782 assert(wand != (MagickWand *) NULL);
6783 assert(wand->signature == WandSignature);
6784 if (wand->debug != MagickFalse)
6785 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6786 if (wand->images == (Image *) NULL)
6787 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6788 /* If current image is 'pending' just return true. */
6789 if (wand->image_pending != MagickFalse)
6791 wand->image_pending=MagickFalse;
6794 /* If there is no next image, (Iterator is finished) */
6795 if (GetNextImageInList(wand->images) == (Image *) NULL)
6796 return(MagickFalse);
6797 /* just move to next image - current image is not 'pending' */
6798 wand->images=GetNextImageInList(wand->images);
6803 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6807 % M a g i c k N o r m a l i z e I m a g e %
6811 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6813 % MagickNormalizeImage() enhances the contrast of a color image by adjusting
6814 % the pixels color to span the entire range of colors available
6816 % You can also reduce the influence of a particular channel with a gamma
6819 % The format of the MagickNormalizeImage method is:
6821 % MagickBooleanType MagickNormalizeImage(MagickWand *wand)
6823 % A description of each parameter follows:
6825 % o wand: the magick wand.
6828 WandExport MagickBooleanType MagickNormalizeImage(MagickWand *wand)
6833 assert(wand != (MagickWand *) NULL);
6834 assert(wand->signature == WandSignature);
6835 if (wand->debug != MagickFalse)
6836 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6837 if (wand->images == (Image *) NULL)
6838 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6839 status=NormalizeImage(wand->images,&wand->images->exception);
6844 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6848 % M a g i c k O i l P a i n t I m a g e %
6852 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6854 % MagickOilPaintImage() applies a special effect filter that simulates an oil
6855 % painting. Each pixel is replaced by the most frequent color occurring
6856 % in a circular region defined by radius.
6858 % The format of the MagickOilPaintImage method is:
6860 % MagickBooleanType MagickOilPaintImage(MagickWand *wand,
6861 % const double radius,const double sigma)
6863 % A description of each parameter follows:
6865 % o wand: the magick wand.
6867 % o radius: the radius of the circular neighborhood.
6869 % o sigma: the standard deviation of the Gaussian, in pixels.
6872 WandExport MagickBooleanType MagickOilPaintImage(MagickWand *wand,
6873 const double radius,const double sigma)
6878 assert(wand != (MagickWand *) NULL);
6879 assert(wand->signature == WandSignature);
6880 if (wand->debug != MagickFalse)
6881 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6882 if (wand->images == (Image *) NULL)
6883 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6884 paint_image=OilPaintImage(wand->images,radius,sigma,wand->exception);
6885 if (paint_image == (Image *) NULL)
6886 return(MagickFalse);
6887 ReplaceImageInList(&wand->images,paint_image);
6892 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6896 % M a g i c k O p a q u e P a i n t I m a g e %
6900 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6902 % MagickOpaquePaintImage() changes any pixel that matches color with the color
6905 % The format of the MagickOpaquePaintImage method is:
6907 % MagickBooleanType MagickOpaquePaintImage(MagickWand *wand,
6908 % const PixelWand *target,const PixelWand *fill,const double fuzz,
6909 % const MagickBooleanType invert)
6911 % A description of each parameter follows:
6913 % o wand: the magick wand.
6915 % o target: Change this target color to the fill color within the image.
6917 % o fill: the fill pixel wand.
6919 % o fuzz: By default target must match a particular pixel color
6920 % exactly. However, in many cases two colors may differ by a small amount.
6921 % The fuzz member of image defines how much tolerance is acceptable to
6922 % consider two colors as the same. For example, set fuzz to 10 and the
6923 % color red at intensities of 100 and 102 respectively are now interpreted
6924 % as the same color for the purposes of the floodfill.
6926 % o invert: paint any pixel that does not match the target color.
6929 WandExport MagickBooleanType MagickOpaquePaintImage(MagickWand *wand,
6930 const PixelWand *target,const PixelWand *fill,const double fuzz,
6931 const MagickBooleanType invert)
6940 assert(wand != (MagickWand *) NULL);
6941 assert(wand->signature == WandSignature);
6942 if (wand->debug != MagickFalse)
6943 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6944 if (wand->images == (Image *) NULL)
6945 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6946 PixelGetMagickColor(target,&target_pixel);
6947 PixelGetMagickColor(fill,&fill_pixel);
6948 wand->images->fuzz=fuzz;
6949 status=OpaquePaintImage(wand->images,&target_pixel,&fill_pixel,invert,
6950 &wand->images->exception);
6955 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6959 % 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 %
6963 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6965 % MagickOptimizeImageLayers() compares each image the GIF disposed forms of the
6966 % previous image in the sequence. From this it attempts to select the
6967 % smallest cropped image to replace each frame, while preserving the results
6970 % The format of the MagickOptimizeImageLayers method is:
6972 % MagickWand *MagickOptimizeImageLayers(MagickWand *wand)
6974 % A description of each parameter follows:
6976 % o wand: the magick wand.
6979 WandExport MagickWand *MagickOptimizeImageLayers(MagickWand *wand)
6984 assert(wand != (MagickWand *) NULL);
6985 assert(wand->signature == WandSignature);
6986 if (wand->debug != MagickFalse)
6987 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6988 if (wand->images == (Image *) NULL)
6989 return((MagickWand *) NULL);
6990 optimize_image=OptimizeImageLayers(wand->images,wand->exception);
6991 if (optimize_image == (Image *) NULL)
6992 return((MagickWand *) NULL);
6993 return(CloneMagickWandFromImages(wand,optimize_image));
6997 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7001 % 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 %
7005 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7007 % MagickOrderedPosterizeImage() performs an ordered dither based on a number
7008 % of pre-defined dithering threshold maps, but over multiple intensity levels,
7009 % which can be different for different channels, according to the input
7012 % The format of the MagickOrderedPosterizeImage method is:
7014 % MagickBooleanType MagickOrderedPosterizeImage(MagickWand *wand,
7015 % const char *threshold_map)
7017 % A description of each parameter follows:
7019 % o image: the image.
7021 % o threshold_map: A string containing the name of the threshold dither
7022 % map to use, followed by zero or more numbers representing the number of
7023 % color levels tho dither between.
7025 % Any level number less than 2 is equivalent to 2, and means only binary
7026 % dithering will be applied to each color channel.
7028 % No numbers also means a 2 level (bitmap) dither will be applied to all
7029 % channels, while a single number is the number of levels applied to each
7030 % channel in sequence. More numbers will be applied in turn to each of
7031 % the color channels.
7033 % For example: "o3x3,6" generates a 6 level posterization of the image
7034 % with a ordered 3x3 diffused pixel dither being applied between each
7035 % level. While checker,8,8,4 will produce a 332 colormaped image with
7036 % only a single checkerboard hash pattern (50% grey) between each color
7037 % level, to basically double the number of color levels with a bare
7038 % minimim of dithering.
7041 WandExport MagickBooleanType MagickOrderedPosterizeImage(MagickWand *wand,
7042 const char *threshold_map)
7047 assert(wand != (MagickWand *) NULL);
7048 assert(wand->signature == WandSignature);
7049 if (wand->debug != MagickFalse)
7050 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7051 if (wand->images == (Image *) NULL)
7052 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7053 status=OrderedPosterizeImage(wand->images,threshold_map,wand->exception);
7058 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7062 % M a g i c k P i n g I m a g e %
7066 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7068 % MagickPingImage() is the same as MagickReadImage() except the only valid
7069 % information returned is the image width, height, size, and format. It
7070 % is designed to efficiently obtain this information from a file without
7071 % reading the entire image sequence into memory.
7073 % The format of the MagickPingImage method is:
7075 % MagickBooleanType MagickPingImage(MagickWand *wand,const char *filename)
7077 % A description of each parameter follows:
7079 % o wand: the magick wand.
7081 % o filename: the image filename.
7084 WandExport MagickBooleanType MagickPingImage(MagickWand *wand,
7085 const char *filename)
7093 assert(wand != (MagickWand *) NULL);
7094 assert(wand->signature == WandSignature);
7095 if (wand->debug != MagickFalse)
7096 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7097 ping_info=CloneImageInfo(wand->image_info);
7098 if (filename != (const char *) NULL)
7099 (void) CopyMagickString(ping_info->filename,filename,MaxTextExtent);
7100 images=PingImage(ping_info,wand->exception);
7101 ping_info=DestroyImageInfo(ping_info);
7102 if (images == (Image *) NULL)
7103 return(MagickFalse);
7104 return(InsertImageInWand(wand,images));
7108 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7112 % M a g i c k P i n g I m a g e B l o b %
7116 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7118 % MagickPingImageBlob() pings an image or image sequence from a blob.
7120 % The format of the MagickPingImageBlob method is:
7122 % MagickBooleanType MagickPingImageBlob(MagickWand *wand,
7123 % const void *blob,const size_t length)
7125 % A description of each parameter follows:
7127 % o wand: the magick wand.
7131 % o length: the blob length.
7134 WandExport MagickBooleanType MagickPingImageBlob(MagickWand *wand,
7135 const void *blob,const size_t length)
7143 assert(wand != (MagickWand *) NULL);
7144 assert(wand->signature == WandSignature);
7145 if (wand->debug != MagickFalse)
7146 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7147 read_info=CloneImageInfo(wand->image_info);
7148 SetImageInfoBlob(read_info,blob,length);
7149 images=PingImage(read_info,wand->exception);
7150 read_info=DestroyImageInfo(read_info);
7151 if (images == (Image *) NULL)
7152 return(MagickFalse);
7153 return(InsertImageInWand(wand,images));
7157 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7161 % M a g i c k P i n g I m a g e F i l e %
7165 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7167 % MagickPingImageFile() pings an image or image sequence from an open file
7170 % The format of the MagickPingImageFile method is:
7172 % MagickBooleanType MagickPingImageFile(MagickWand *wand,FILE *file)
7174 % A description of each parameter follows:
7176 % o wand: the magick wand.
7178 % o file: the file descriptor.
7181 WandExport MagickBooleanType MagickPingImageFile(MagickWand *wand,FILE *file)
7189 assert(wand != (MagickWand *) NULL);
7190 assert(wand->signature == WandSignature);
7191 assert(file != (FILE *) NULL);
7192 if (wand->debug != MagickFalse)
7193 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7194 read_info=CloneImageInfo(wand->image_info);
7195 SetImageInfoFile(read_info,file);
7196 images=PingImage(read_info,wand->exception);
7197 read_info=DestroyImageInfo(read_info);
7198 if (images == (Image *) NULL)
7199 return(MagickFalse);
7200 return(InsertImageInWand(wand,images));
7204 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7208 % M a g i c k P o l a r o i d I m a g e %
7212 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7214 % MagickPolaroidImage() simulates a Polaroid picture.
7216 % The format of the MagickPolaroidImage method is:
7218 % MagickBooleanType MagickPolaroidImage(MagickWand *wand,
7219 % const DrawingWand *drawing_wand,const double angle,
7220 % const PixelInterpolateMethod method)
7222 % A description of each parameter follows:
7224 % o wand: the magick wand.
7226 % o drawing_wand: the draw wand.
7228 % o angle: Apply the effect along this angle.
7230 % o method: the pixel interpolation method.
7233 WandExport MagickBooleanType MagickPolaroidImage(MagickWand *wand,
7234 const DrawingWand *drawing_wand,const double angle,
7235 const PixelInterpolateMethod method)
7243 assert(wand != (MagickWand *) NULL);
7244 assert(wand->signature == WandSignature);
7245 if (wand->debug != MagickFalse)
7246 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7247 if (wand->images == (Image *) NULL)
7248 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7249 draw_info=PeekDrawingWand(drawing_wand);
7250 if (draw_info == (DrawInfo *) NULL)
7251 return(MagickFalse);
7252 polaroid_image=PolaroidImage(wand->images,draw_info,angle,method,
7254 if (polaroid_image == (Image *) NULL)
7255 return(MagickFalse);
7256 ReplaceImageInList(&wand->images,polaroid_image);
7261 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7265 % M a g i c k P o s t e r i z e I m a g e %
7269 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7271 % MagickPosterizeImage() reduces the image to a limited number of color level.
7273 % The format of the MagickPosterizeImage method is:
7275 % MagickBooleanType MagickPosterizeImage(MagickWand *wand,
7276 % const unsigned levels,const MagickBooleanType dither)
7278 % A description of each parameter follows:
7280 % o wand: the magick wand.
7282 % o levels: Number of color levels allowed in each channel. Very low values
7283 % (2, 3, or 4) have the most visible effect.
7285 % o dither: Set this integer value to something other than zero to dither
7289 WandExport MagickBooleanType MagickPosterizeImage(MagickWand *wand,
7290 const size_t levels,const MagickBooleanType dither)
7295 assert(wand != (MagickWand *) NULL);
7296 assert(wand->signature == WandSignature);
7297 if (wand->debug != MagickFalse)
7298 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7299 if (wand->images == (Image *) NULL)
7300 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7301 status=PosterizeImage(wand->images,levels,dither,wand->exception);
7306 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7310 % M a g i c k P r e v i e w I m a g e s %
7314 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7316 % MagickPreviewImages() tiles 9 thumbnails of the specified image with an
7317 % image processing operation applied at varying strengths. This helpful
7318 % to quickly pin-point an appropriate parameter for an image processing
7321 % The format of the MagickPreviewImages method is:
7323 % MagickWand *MagickPreviewImages(MagickWand *wand,
7324 % const PreviewType preview)
7326 % A description of each parameter follows:
7328 % o wand: the magick wand.
7330 % o preview: the preview type.
7333 WandExport MagickWand *MagickPreviewImages(MagickWand *wand,
7334 const PreviewType preview)
7339 assert(wand != (MagickWand *) NULL);
7340 assert(wand->signature == WandSignature);
7341 if (wand->debug != MagickFalse)
7342 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7343 if (wand->images == (Image *) NULL)
7344 return((MagickWand *) NULL);
7345 preview_image=PreviewImage(wand->images,preview,wand->exception);
7346 if (preview_image == (Image *) NULL)
7347 return((MagickWand *) NULL);
7348 return(CloneMagickWandFromImages(wand,preview_image));
7352 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7356 % M a g i c k P r e v i o u s I m a g e %
7360 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7362 % MagickPreviousImage() assocates the previous image in an image list with
7365 % The format of the MagickPreviousImage method is:
7367 % MagickBooleanType MagickPreviousImage(MagickWand *wand)
7369 % A description of each parameter follows:
7371 % o wand: the magick wand.
7374 WandExport MagickBooleanType MagickPreviousImage(MagickWand *wand)
7376 assert(wand != (MagickWand *) NULL);
7377 assert(wand->signature == WandSignature);
7378 if (wand->debug != MagickFalse)
7379 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7380 if (wand->images == (Image *) NULL)
7381 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7383 wand->image_pending=MagickFalse; /* pending status has no meaning */
7384 /* If there is no prev image, return false (Iterator is finished) */
7385 if (GetPreviousImageInList(wand->images) == (Image *) NULL)
7386 return(MagickFalse);
7387 /* just do it - current image is not 'pending' */
7388 wand->images=GetPreviousImageInList(wand->images);
7393 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7397 % M a g i c k Q u a n t i z e I m a g e %
7401 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7403 % MagickQuantizeImage() analyzes the colors within a reference image and
7404 % chooses a fixed number of colors to represent the image. The goal of the
7405 % algorithm is to minimize the color difference between the input and output
7406 % image while minimizing the processing time.
7408 % The format of the MagickQuantizeImage method is:
7410 % MagickBooleanType MagickQuantizeImage(MagickWand *wand,
7411 % const size_t number_colors,const ColorspaceType colorspace,
7412 % const size_t treedepth,const MagickBooleanType dither,
7413 % const MagickBooleanType measure_error)
7415 % A description of each parameter follows:
7417 % o wand: the magick wand.
7419 % o number_colors: the number of colors.
7421 % o colorspace: Perform color reduction in this colorspace, typically
7424 % o treedepth: Normally, this integer value is zero or one. A zero or
7425 % 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
7426 % reference image with the least amount of memory and the fastest
7427 % computational speed. In some cases, such as an image with low color
7428 % dispersion (a few number of colors), a value other than
7429 % Log4(number_colors) is required. To expand the color tree completely,
7432 % o dither: A value other than zero distributes the difference between an
7433 % original image and the corresponding color reduced image to
7434 % neighboring pixels along a Hilbert curve.
7436 % o measure_error: A value other than zero measures the difference between
7437 % the original and quantized images. This difference is the total
7438 % quantization error. The error is computed by summing over all pixels
7439 % in an image the distance squared in RGB space between each reference
7440 % pixel value and its quantized value.
7443 WandExport MagickBooleanType MagickQuantizeImage(MagickWand *wand,
7444 const size_t number_colors,const ColorspaceType colorspace,
7445 const size_t treedepth,const MagickBooleanType dither,
7446 const MagickBooleanType measure_error)
7454 assert(wand != (MagickWand *) NULL);
7455 assert(wand->signature == WandSignature);
7456 if (wand->debug != MagickFalse)
7457 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7458 if (wand->images == (Image *) NULL)
7459 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7460 quantize_info=CloneQuantizeInfo((QuantizeInfo *) NULL);
7461 quantize_info->number_colors=number_colors;
7462 quantize_info->dither=dither;
7463 quantize_info->tree_depth=treedepth;
7464 quantize_info->colorspace=colorspace;
7465 quantize_info->measure_error=measure_error;
7466 status=QuantizeImage(quantize_info,wand->images,wand->exception);
7467 quantize_info=DestroyQuantizeInfo(quantize_info);
7472 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7476 % M a g i c k Q u a n t i z e I m a g e s %
7480 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7482 % MagickQuantizeImages() analyzes the colors within a sequence of images and
7483 % chooses a fixed number of colors to represent the image. The goal of the
7484 % algorithm is to minimize the color difference between the input and output
7485 % image while minimizing the processing time.
7487 % The format of the MagickQuantizeImages method is:
7489 % MagickBooleanType MagickQuantizeImages(MagickWand *wand,
7490 % const size_t number_colors,const ColorspaceType colorspace,
7491 % const size_t treedepth,const MagickBooleanType dither,
7492 % const MagickBooleanType measure_error)
7494 % A description of each parameter follows:
7496 % o wand: the magick wand.
7498 % o number_colors: the number of colors.
7500 % o colorspace: Perform color reduction in this colorspace, typically
7503 % o treedepth: Normally, this integer value is zero or one. A zero or
7504 % 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
7505 % reference image with the least amount of memory and the fastest
7506 % computational speed. In some cases, such as an image with low color
7507 % dispersion (a few number of colors), a value other than
7508 % Log4(number_colors) is required. To expand the color tree completely,
7511 % o dither: A value other than zero distributes the difference between an
7512 % original image and the corresponding color reduced algorithm to
7513 % neighboring pixels along a Hilbert curve.
7515 % o measure_error: A value other than zero measures the difference between
7516 % the original and quantized images. This difference is the total
7517 % quantization error. The error is computed by summing over all pixels
7518 % in an image the distance squared in RGB space between each reference
7519 % pixel value and its quantized value.
7522 WandExport MagickBooleanType MagickQuantizeImages(MagickWand *wand,
7523 const size_t number_colors,const ColorspaceType colorspace,
7524 const size_t treedepth,const MagickBooleanType dither,
7525 const MagickBooleanType measure_error)
7533 assert(wand != (MagickWand *) NULL);
7534 assert(wand->signature == WandSignature);
7535 if (wand->debug != MagickFalse)
7536 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7537 if (wand->images == (Image *) NULL)
7538 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7539 quantize_info=CloneQuantizeInfo((QuantizeInfo *) NULL);
7540 quantize_info->number_colors=number_colors;
7541 quantize_info->dither=dither;
7542 quantize_info->tree_depth=treedepth;
7543 quantize_info->colorspace=colorspace;
7544 quantize_info->measure_error=measure_error;
7545 status=QuantizeImages(quantize_info,wand->images,wand->exception);
7546 quantize_info=DestroyQuantizeInfo(quantize_info);
7551 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7555 % M a g i c k R a d i a l B l u r I m a g e %
7559 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7561 % MagickRadialBlurImage() radial blurs an image.
7563 % The format of the MagickRadialBlurImage method is:
7565 % MagickBooleanType MagickRadialBlurImage(MagickWand *wand,
7566 % const double angle,const double bias)
7568 % A description of each parameter follows:
7570 % o wand: the magick wand.
7572 % o angle: the angle of the blur in degrees.
7577 WandExport MagickBooleanType MagickRadialBlurImage(MagickWand *wand,
7578 const double angle,const double bias)
7583 assert(wand != (MagickWand *) NULL);
7584 assert(wand->signature == WandSignature);
7585 if (wand->debug != MagickFalse)
7586 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7587 if (wand->images == (Image *) NULL)
7588 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7589 blur_image=RadialBlurImage(wand->images,angle,bias,wand->exception);
7590 if (blur_image == (Image *) NULL)
7591 return(MagickFalse);
7592 ReplaceImageInList(&wand->images,blur_image);
7597 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7601 % M a g i c k R a i s e I m a g e %
7605 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7607 % MagickRaiseImage() creates a simulated three-dimensional button-like effect
7608 % by lightening and darkening the edges of the image. Members width and
7609 % height of raise_info define the width of the vertical and horizontal
7610 % edge of the effect.
7612 % The format of the MagickRaiseImage method is:
7614 % MagickBooleanType MagickRaiseImage(MagickWand *wand,
7615 % const size_t width,const size_t height,const ssize_t x,
7616 % const ssize_t y,const MagickBooleanType raise)
7618 % A description of each parameter follows:
7620 % o wand: the magick wand.
7622 % o width,height,x,y: Define the dimensions of the area to raise.
7624 % o raise: A value other than zero creates a 3-D raise effect,
7625 % otherwise it has a lowered effect.
7628 WandExport MagickBooleanType MagickRaiseImage(MagickWand *wand,
7629 const size_t width,const size_t height,const ssize_t x,
7630 const ssize_t y,const MagickBooleanType raise)
7638 assert(wand != (MagickWand *) NULL);
7639 assert(wand->signature == WandSignature);
7640 if (wand->debug != MagickFalse)
7641 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7642 if (wand->images == (Image *) NULL)
7643 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7644 raise_info.width=width;
7645 raise_info.height=height;
7648 status=RaiseImage(wand->images,&raise_info,raise,&wand->images->exception);
7653 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7657 % 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 %
7661 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7663 % MagickRandomThresholdImage() changes the value of individual pixels based on
7664 % the intensity of each pixel compared to threshold. The result is a
7665 % high-contrast, two color image.
7667 % The format of the MagickRandomThresholdImage method is:
7669 % MagickBooleanType MagickRandomThresholdImage(MagickWand *wand,
7670 % const double low,const double high)
7672 % A description of each parameter follows:
7674 % o wand: the magick wand.
7676 % o low,high: Specify the high and low thresholds. These values range from
7677 % 0 to QuantumRange.
7680 WandExport MagickBooleanType MagickRandomThresholdImage(MagickWand *wand,
7681 const double low,const double high)
7684 threshold[MaxTextExtent];
7689 assert(wand != (MagickWand *) NULL);
7690 assert(wand->signature == WandSignature);
7691 if (wand->debug != MagickFalse)
7692 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7693 if (wand->images == (Image *) NULL)
7694 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7695 (void) FormatLocaleString(threshold,MaxTextExtent,"%gx%g",low,high);
7696 status=RandomThresholdImage(wand->images,threshold,wand->exception);
7697 if (status == MagickFalse)
7698 InheritException(wand->exception,&wand->images->exception);
7703 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7707 % M a g i c k R e a d I m a g e %
7711 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7713 % MagickReadImage() reads an image or image sequence. The images are inserted
7714 % at the current image pointer position.
7716 % Use MagickSetFirstIterator(), to insert new images before all the current
7717 % images in the wand, MagickSetLastIterator() to append add to the end,
7718 % MagickSetImageIndex() to place images just after the given index.
7720 % The format of the MagickReadImage method is:
7722 % MagickBooleanType MagickReadImage(MagickWand *wand,const char *filename)
7724 % A description of each parameter follows:
7726 % o wand: the magick wand.
7728 % o filename: the image filename.
7731 WandExport MagickBooleanType MagickReadImage(MagickWand *wand,
7732 const char *filename)
7740 assert(wand != (MagickWand *) NULL);
7741 assert(wand->signature == WandSignature);
7742 if (wand->debug != MagickFalse)
7743 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7744 read_info=CloneImageInfo(wand->image_info);
7745 if (filename != (const char *) NULL)
7746 (void) CopyMagickString(read_info->filename,filename,MaxTextExtent);
7747 images=ReadImage(read_info,wand->exception);
7748 read_info=DestroyImageInfo(read_info);
7749 if (images == (Image *) NULL)
7750 return(MagickFalse);
7751 return(InsertImageInWand(wand,images));
7755 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7759 % M a g i c k R e a d I m a g e B l o b %
7763 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7765 % MagickReadImageBlob() reads an image or image sequence from a blob.
7766 % In all other respects it is like MagickReadImage().
7768 % The format of the MagickReadImageBlob method is:
7770 % MagickBooleanType MagickReadImageBlob(MagickWand *wand,
7771 % const void *blob,const size_t length)
7773 % A description of each parameter follows:
7775 % o wand: the magick wand.
7779 % o length: the blob length.
7782 WandExport MagickBooleanType MagickReadImageBlob(MagickWand *wand,
7783 const void *blob,const size_t length)
7788 assert(wand != (MagickWand *) NULL);
7789 assert(wand->signature == WandSignature);
7790 if (wand->debug != MagickFalse)
7791 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7792 images=BlobToImage(wand->image_info,blob,length,wand->exception);
7793 if (images == (Image *) NULL)
7794 return(MagickFalse);
7795 return(InsertImageInWand(wand,images));
7799 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7803 % M a g i c k R e a d I m a g e F i l e %
7807 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7809 % MagickReadImageFile() reads an image or image sequence from an already
7810 % opened file descriptor. Otherwise it is like MagickReadImage().
7812 % The format of the MagickReadImageFile method is:
7814 % MagickBooleanType MagickReadImageFile(MagickWand *wand,FILE *file)
7816 % A description of each parameter follows:
7818 % o wand: the magick wand.
7820 % o file: the file descriptor.
7823 WandExport MagickBooleanType MagickReadImageFile(MagickWand *wand,FILE *file)
7831 assert(wand != (MagickWand *) NULL);
7832 assert(wand->signature == WandSignature);
7833 assert(file != (FILE *) NULL);
7834 if (wand->debug != MagickFalse)
7835 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7836 read_info=CloneImageInfo(wand->image_info);
7837 SetImageInfoFile(read_info,file);
7838 images=ReadImage(read_info,wand->exception);
7839 read_info=DestroyImageInfo(read_info);
7840 if (images == (Image *) NULL)
7841 return(MagickFalse);
7842 return(InsertImageInWand(wand,images));
7846 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7850 % M a g i c k R e m a p I m a g e %
7854 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7856 % MagickRemapImage() replaces the colors of an image with the closest color
7857 % from a reference image.
7859 % The format of the MagickRemapImage method is:
7861 % MagickBooleanType MagickRemapImage(MagickWand *wand,
7862 % const MagickWand *remap_wand,const DitherMethod method)
7864 % A description of each parameter follows:
7866 % o wand: the magick wand.
7868 % o affinity: the affinity wand.
7870 % o method: choose from these dither methods: NoDitherMethod,
7871 % RiemersmaDitherMethod, or FloydSteinbergDitherMethod.
7874 WandExport MagickBooleanType MagickRemapImage(MagickWand *wand,
7875 const MagickWand *remap_wand,const DitherMethod method)
7883 assert(wand != (MagickWand *) NULL);
7884 assert(wand->signature == WandSignature);
7885 if (wand->debug != MagickFalse)
7886 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7887 if ((wand->images == (Image *) NULL) ||
7888 (remap_wand->images == (Image *) NULL))
7889 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7890 quantize_info=AcquireQuantizeInfo(wand->image_info);
7891 quantize_info->dither_method=method;
7892 if (method == NoDitherMethod)
7893 quantize_info->dither=MagickFalse;
7894 status=RemapImage(quantize_info,wand->images,remap_wand->images,
7896 quantize_info=DestroyQuantizeInfo(quantize_info);
7901 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7905 % M a g i c k R e m o v e I m a g e %
7909 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7911 % MagickRemoveImage() removes an image from the image list.
7913 % The format of the MagickRemoveImage method is:
7915 % MagickBooleanType MagickRemoveImage(MagickWand *wand)
7917 % A description of each parameter follows:
7919 % o wand: the magick wand.
7921 % o insert: the splice wand.
7924 WandExport MagickBooleanType MagickRemoveImage(MagickWand *wand)
7926 assert(wand != (MagickWand *) NULL);
7927 assert(wand->signature == WandSignature);
7928 if (wand->debug != MagickFalse)
7929 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7930 if (wand->images == (Image *) NULL)
7931 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7932 DeleteImageFromList(&wand->images);
7937 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7941 % M a g i c k R e s a m p l e I m a g e %
7945 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7947 % MagickResampleImage() resample image to desired resolution.
7949 % Bessel Blackman Box
7950 % Catrom Cubic Gaussian
7951 % Hanning Hermite Lanczos
7952 % Mitchell Point Quandratic
7955 % Most of the filters are FIR (finite impulse response), however, Bessel,
7956 % Gaussian, and Sinc are IIR (infinite impulse response). Bessel and Sinc
7957 % are windowed (brought down to zero) with the Blackman filter.
7959 % The format of the MagickResampleImage method is:
7961 % MagickBooleanType MagickResampleImage(MagickWand *wand,
7962 % const double x_resolution,const double y_resolution,
7963 % const FilterTypes filter,const double blur)
7965 % A description of each parameter follows:
7967 % o wand: the magick wand.
7969 % o x_resolution: the new image x resolution.
7971 % o y_resolution: the new image y resolution.
7973 % o filter: Image filter to use.
7975 % o blur: the blur factor where > 1 is blurry, < 1 is sharp.
7978 WandExport MagickBooleanType MagickResampleImage(MagickWand *wand,
7979 const double x_resolution,const double y_resolution,const FilterTypes filter,
7985 assert(wand != (MagickWand *) NULL);
7986 assert(wand->signature == WandSignature);
7987 if (wand->debug != MagickFalse)
7988 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7989 if (wand->images == (Image *) NULL)
7990 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7991 resample_image=ResampleImage(wand->images,x_resolution,y_resolution,filter,
7992 blur,wand->exception);
7993 if (resample_image == (Image *) NULL)
7994 return(MagickFalse);
7995 ReplaceImageInList(&wand->images,resample_image);
8000 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8004 % M a g i c k R e s e t I m a g e P a g e %
8008 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8010 % MagickResetImagePage() resets the Wand page canvas and position.
8012 % The format of the MagickResetImagePage method is:
8014 % MagickBooleanType MagickResetImagePage(MagickWand *wand,
8017 % A description of each parameter follows:
8019 % o wand: the magick wand.
8021 % o page: the relative page specification.
8024 WandExport MagickBooleanType MagickResetImagePage(MagickWand *wand,
8027 assert(wand != (MagickWand *) NULL);
8028 assert(wand->signature == WandSignature);
8029 if (wand->debug != MagickFalse)
8030 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8031 if (wand->images == (Image *) NULL)
8032 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8033 if ((page == (char *) NULL) || (*page == '\0'))
8035 (void) ParseAbsoluteGeometry("0x0+0+0",&wand->images->page);
8038 return(ResetImagePage(wand->images,page));
8042 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8046 % M a g i c k R e s i z e I m a g e %
8050 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8052 % MagickResizeImage() scales an image to the desired dimensions with one of
8055 % Bessel Blackman Box
8056 % Catrom Cubic Gaussian
8057 % Hanning Hermite Lanczos
8058 % Mitchell Point Quandratic
8061 % Most of the filters are FIR (finite impulse response), however, Bessel,
8062 % Gaussian, and Sinc are IIR (infinite impulse response). Bessel and Sinc
8063 % are windowed (brought down to zero) with the Blackman filter.
8065 % The format of the MagickResizeImage method is:
8067 % MagickBooleanType MagickResizeImage(MagickWand *wand,
8068 % const size_t columns,const size_t rows,
8069 % const FilterTypes filter,const double blur)
8071 % A description of each parameter follows:
8073 % o wand: the magick wand.
8075 % o columns: the number of columns in the scaled image.
8077 % o rows: the number of rows in the scaled image.
8079 % o filter: Image filter to use.
8081 % o blur: the blur factor where > 1 is blurry, < 1 is sharp.
8084 WandExport MagickBooleanType MagickResizeImage(MagickWand *wand,
8085 const size_t columns,const size_t rows,const FilterTypes filter,
8091 assert(wand != (MagickWand *) NULL);
8092 assert(wand->signature == WandSignature);
8093 if (wand->debug != MagickFalse)
8094 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8095 if (wand->images == (Image *) NULL)
8096 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8097 resize_image=ResizeImage(wand->images,columns,rows,filter,blur,
8099 if (resize_image == (Image *) NULL)
8100 return(MagickFalse);
8101 ReplaceImageInList(&wand->images,resize_image);
8106 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8110 % M a g i c k R o l l I m a g e %
8114 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8116 % MagickRollImage() offsets an image as defined by x and y.
8118 % The format of the MagickRollImage method is:
8120 % MagickBooleanType MagickRollImage(MagickWand *wand,const ssize_t x,
8123 % A description of each parameter follows:
8125 % o wand: the magick wand.
8127 % o x: the x offset.
8129 % o y: the y offset.
8133 WandExport MagickBooleanType MagickRollImage(MagickWand *wand,
8134 const ssize_t x,const ssize_t y)
8139 assert(wand != (MagickWand *) NULL);
8140 assert(wand->signature == WandSignature);
8141 if (wand->debug != MagickFalse)
8142 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8143 if (wand->images == (Image *) NULL)
8144 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8145 roll_image=RollImage(wand->images,x,y,wand->exception);
8146 if (roll_image == (Image *) NULL)
8147 return(MagickFalse);
8148 ReplaceImageInList(&wand->images,roll_image);
8153 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8157 % M a g i c k R o t a t e I m a g e %
8161 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8163 % MagickRotateImage() rotates an image the specified number of degrees. Empty
8164 % triangles left over from rotating the image are filled with the
8167 % The format of the MagickRotateImage method is:
8169 % MagickBooleanType MagickRotateImage(MagickWand *wand,
8170 % const PixelWand *background,const double degrees)
8172 % A description of each parameter follows:
8174 % o wand: the magick wand.
8176 % o background: the background pixel wand.
8178 % o degrees: the number of degrees to rotate the image.
8182 WandExport MagickBooleanType MagickRotateImage(MagickWand *wand,
8183 const PixelWand *background,const double degrees)
8188 assert(wand != (MagickWand *) NULL);
8189 assert(wand->signature == WandSignature);
8190 if (wand->debug != MagickFalse)
8191 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8192 if (wand->images == (Image *) NULL)
8193 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8194 PixelGetQuantumPacket(background,&wand->images->background_color);
8195 rotate_image=RotateImage(wand->images,degrees,wand->exception);
8196 if (rotate_image == (Image *) NULL)
8197 return(MagickFalse);
8198 ReplaceImageInList(&wand->images,rotate_image);
8203 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8207 % M a g i c k S a m p l e I m a g e %
8211 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8213 % MagickSampleImage() scales an image to the desired dimensions with pixel
8214 % sampling. Unlike other scaling methods, this method does not introduce
8215 % any additional color into the scaled image.
8217 % The format of the MagickSampleImage method is:
8219 % MagickBooleanType MagickSampleImage(MagickWand *wand,
8220 % const size_t columns,const size_t rows)
8222 % A description of each parameter follows:
8224 % o wand: the magick wand.
8226 % o columns: the number of columns in the scaled image.
8228 % o rows: the number of rows in the scaled image.
8232 WandExport MagickBooleanType MagickSampleImage(MagickWand *wand,
8233 const size_t columns,const size_t rows)
8238 assert(wand != (MagickWand *) NULL);
8239 assert(wand->signature == WandSignature);
8240 if (wand->debug != MagickFalse)
8241 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8242 if (wand->images == (Image *) NULL)
8243 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8244 sample_image=SampleImage(wand->images,columns,rows,wand->exception);
8245 if (sample_image == (Image *) NULL)
8246 return(MagickFalse);
8247 ReplaceImageInList(&wand->images,sample_image);
8252 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8256 % M a g i c k S c a l e I m a g e %
8260 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8262 % MagickScaleImage() scales the size of an image to the given dimensions.
8264 % The format of the MagickScaleImage method is:
8266 % MagickBooleanType MagickScaleImage(MagickWand *wand,
8267 % const size_t columns,const size_t rows)
8269 % A description of each parameter follows:
8271 % o wand: the magick wand.
8273 % o columns: the number of columns in the scaled image.
8275 % o rows: the number of rows in the scaled image.
8279 WandExport MagickBooleanType MagickScaleImage(MagickWand *wand,
8280 const size_t columns,const size_t rows)
8285 assert(wand != (MagickWand *) NULL);
8286 assert(wand->signature == WandSignature);
8287 if (wand->debug != MagickFalse)
8288 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8289 if (wand->images == (Image *) NULL)
8290 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8291 scale_image=ScaleImage(wand->images,columns,rows,wand->exception);
8292 if (scale_image == (Image *) NULL)
8293 return(MagickFalse);
8294 ReplaceImageInList(&wand->images,scale_image);
8299 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8303 % M a g i c k S e g m e n t I m a g e %
8307 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8309 % MagickSegmentImage() segments an image by analyzing the histograms of the
8310 % color components and identifying units that are homogeneous with the fuzzy
8311 % C-means technique.
8313 % The format of the SegmentImage method is:
8315 % MagickBooleanType MagickSegmentImage(MagickWand *wand,
8316 % const ColorspaceType colorspace,const MagickBooleanType verbose,
8317 % const double cluster_threshold,const double smooth_threshold)
8319 % A description of each parameter follows.
8323 % o colorspace: the image colorspace.
8325 % o verbose: Set to MagickTrue to print detailed information about the
8326 % identified classes.
8328 % o cluster_threshold: This represents the minimum number of pixels
8329 % contained in a hexahedra before it can be considered valid (expressed as
8332 % o smooth_threshold: the smoothing threshold eliminates noise in the second
8333 % derivative of the histogram. As the value is increased, you can expect a
8334 % smoother second derivative.
8337 MagickExport MagickBooleanType MagickSegmentImage(MagickWand *wand,
8338 const ColorspaceType colorspace,const MagickBooleanType verbose,
8339 const double cluster_threshold,const double smooth_threshold)
8344 assert(wand != (MagickWand *) NULL);
8345 assert(wand->signature == WandSignature);
8346 if (wand->debug != MagickFalse)
8347 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8348 if (wand->images == (Image *) NULL)
8349 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8350 status=SegmentImage(wand->images,colorspace,verbose,cluster_threshold,
8351 smooth_threshold,wand->exception);
8356 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8360 % M a g i c k S e l e c t i v e B l u r I m a g e %
8364 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8366 % MagickSelectiveBlurImage() selectively blur an image within a contrast
8367 % threshold. It is similar to the unsharpen mask that sharpens everything with
8368 % contrast above a certain threshold.
8370 % The format of the MagickSelectiveBlurImage method is:
8372 % MagickBooleanType MagickSelectiveBlurImage(MagickWand *wand,
8373 % const double radius,const double sigma,const double threshold,
8374 % const double bias)
8376 % A description of each parameter follows:
8378 % o wand: the magick wand.
8380 % o radius: the radius of the gaussian, in pixels, not counting the center
8383 % o sigma: the standard deviation of the gaussian, in pixels.
8385 % o threshold: only pixels within this contrast threshold are included
8386 % in the blur operation.
8391 WandExport MagickBooleanType MagickSelectiveBlurImage(MagickWand *wand,
8392 const double radius,const double sigma,const double threshold,
8398 assert(wand != (MagickWand *) NULL);
8399 assert(wand->signature == WandSignature);
8400 if (wand->debug != MagickFalse)
8401 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8402 if (wand->images == (Image *) NULL)
8403 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8404 blur_image=SelectiveBlurImage(wand->images,radius,sigma,threshold,bias,
8406 if (blur_image == (Image *) NULL)
8407 return(MagickFalse);
8408 ReplaceImageInList(&wand->images,blur_image);
8413 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8417 % 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 %
8421 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8423 % MagickSeparateImage() separates a channel from the image and returns a
8424 % grayscale image. A channel is a particular color component of each pixel
8427 % The format of the MagickSeparateImage method is:
8429 % MagickBooleanType MagickSeparateImage(MagickWand *wand)
8431 % A description of each parameter follows:
8433 % o wand: the magick wand.
8436 WandExport MagickBooleanType MagickSeparateImage(MagickWand *wand)
8441 assert(wand != (MagickWand *) NULL);
8442 assert(wand->signature == WandSignature);
8443 if (wand->debug != MagickFalse)
8444 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8445 if (wand->images == (Image *) NULL)
8446 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8447 status=SeparateImage(wand->images);
8448 if (status == MagickFalse)
8449 InheritException(wand->exception,&wand->images->exception);
8454 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8458 % M a g i c k S e p i a T o n e I m a g e %
8462 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8464 % MagickSepiaToneImage() applies a special effect to the image, similar to the
8465 % effect achieved in a photo darkroom by sepia toning. Threshold ranges from
8466 % 0 to QuantumRange and is a measure of the extent of the sepia toning. A
8467 % threshold of 80% is a good starting point for a reasonable tone.
8469 % The format of the MagickSepiaToneImage method is:
8471 % MagickBooleanType MagickSepiaToneImage(MagickWand *wand,
8472 % const double threshold)
8474 % A description of each parameter follows:
8476 % o wand: the magick wand.
8478 % o threshold: Define the extent of the sepia toning.
8481 WandExport MagickBooleanType MagickSepiaToneImage(MagickWand *wand,
8482 const double threshold)
8487 assert(wand != (MagickWand *) NULL);
8488 assert(wand->signature == WandSignature);
8489 if (wand->debug != MagickFalse)
8490 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8491 if (wand->images == (Image *) NULL)
8492 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8493 sepia_image=SepiaToneImage(wand->images,threshold,wand->exception);
8494 if (sepia_image == (Image *) NULL)
8495 return(MagickFalse);
8496 ReplaceImageInList(&wand->images,sepia_image);
8501 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8505 % M a g i c k S e t I m a g e %
8509 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8511 % MagickSetImage() replaces the last image returned by MagickSetImageIndex(),
8512 % MagickNextImage(), MagickPreviousImage() with the images from the specified
8515 % The format of the MagickSetImage method is:
8517 % MagickBooleanType MagickSetImage(MagickWand *wand,
8518 % const MagickWand *set_wand)
8520 % A description of each parameter follows:
8522 % o wand: the magick wand.
8524 % o set_wand: the set_wand wand.
8527 WandExport MagickBooleanType MagickSetImage(MagickWand *wand,
8528 const MagickWand *set_wand)
8533 assert(wand != (MagickWand *) NULL);
8534 assert(wand->signature == WandSignature);
8535 if (wand->debug != MagickFalse)
8536 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8537 assert(set_wand != (MagickWand *) NULL);
8538 assert(set_wand->signature == WandSignature);
8539 if (wand->debug != MagickFalse)
8540 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",set_wand->name);
8541 if (set_wand->images == (Image *) NULL)
8542 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8543 images=CloneImageList(set_wand->images,wand->exception);
8544 if (images == (Image *) NULL)
8545 return(MagickFalse);
8546 ReplaceImageInList(&wand->images,images);
8551 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8555 % 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 %
8559 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8561 % MagickSetImageAlphaChannel() activates, deactivates, resets, or sets the
8564 % The format of the MagickSetImageAlphaChannel method is:
8566 % MagickBooleanType MagickSetImageAlphaChannel(MagickWand *wand,
8567 % const AlphaChannelType alpha_type)
8569 % A description of each parameter follows:
8571 % o wand: the magick wand.
8573 % o alpha_type: the alpha channel type: ActivateAlphaChannel,
8574 % DeactivateAlphaChannel, OpaqueAlphaChannel, or SetAlphaChannel.
8577 WandExport MagickBooleanType MagickSetImageAlphaChannel(MagickWand *wand,
8578 const AlphaChannelType alpha_type)
8580 assert(wand != (MagickWand *) NULL);
8581 assert(wand->signature == WandSignature);
8582 if (wand->debug != MagickFalse)
8583 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8584 if (wand->images == (Image *) NULL)
8585 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8586 return(SetImageAlphaChannel(wand->images,alpha_type,&wand->images->exception));
8590 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8594 % 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 %
8598 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8600 % MagickSetImageBackgroundColor() sets the image background color.
8602 % The format of the MagickSetImageBackgroundColor method is:
8604 % MagickBooleanType MagickSetImageBackgroundColor(MagickWand *wand,
8605 % const PixelWand *background)
8607 % A description of each parameter follows:
8609 % o wand: the magick wand.
8611 % o background: the background pixel wand.
8614 WandExport MagickBooleanType MagickSetImageBackgroundColor(MagickWand *wand,
8615 const PixelWand *background)
8617 assert(wand != (MagickWand *) NULL);
8618 assert(wand->signature == WandSignature);
8619 if (wand->debug != MagickFalse)
8620 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8621 if (wand->images == (Image *) NULL)
8622 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8623 PixelGetQuantumPacket(background,&wand->images->background_color);
8628 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8632 % M a g i c k S e t I m a g e B i a s %
8636 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8638 % MagickSetImageBias() sets the image bias for any method that convolves an
8639 % image (e.g. MagickConvolveImage()).
8641 % The format of the MagickSetImageBias method is:
8643 % MagickBooleanType MagickSetImageBias(MagickWand *wand,
8644 % const double bias)
8646 % A description of each parameter follows:
8648 % o wand: the magick wand.
8650 % o bias: the image bias.
8653 WandExport MagickBooleanType MagickSetImageBias(MagickWand *wand,
8656 assert(wand != (MagickWand *) NULL);
8657 assert(wand->signature == WandSignature);
8658 if (wand->debug != MagickFalse)
8659 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8660 if (wand->images == (Image *) NULL)
8661 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8662 wand->images->bias=bias;
8667 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8671 % 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 %
8675 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8677 % MagickSetImageBluePrimary() sets the image chromaticity blue primary point.
8679 % The format of the MagickSetImageBluePrimary method is:
8681 % MagickBooleanType MagickSetImageBluePrimary(MagickWand *wand,
8682 % const double x,const double y)
8684 % A description of each parameter follows:
8686 % o wand: the magick wand.
8688 % o x: the blue primary x-point.
8690 % o y: the blue primary y-point.
8693 WandExport MagickBooleanType MagickSetImageBluePrimary(MagickWand *wand,
8694 const double x,const double y)
8696 assert(wand != (MagickWand *) NULL);
8697 assert(wand->signature == WandSignature);
8698 if (wand->debug != MagickFalse)
8699 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8700 if (wand->images == (Image *) NULL)
8701 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8702 wand->images->chromaticity.blue_primary.x=x;
8703 wand->images->chromaticity.blue_primary.y=y;
8708 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8712 % 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 %
8716 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8718 % MagickSetImageBorderColor() sets the image border color.
8720 % The format of the MagickSetImageBorderColor method is:
8722 % MagickBooleanType MagickSetImageBorderColor(MagickWand *wand,
8723 % const PixelWand *border)
8725 % A description of each parameter follows:
8727 % o wand: the magick wand.
8729 % o border: the border pixel wand.
8732 WandExport MagickBooleanType MagickSetImageBorderColor(MagickWand *wand,
8733 const PixelWand *border)
8735 assert(wand != (MagickWand *) NULL);
8736 assert(wand->signature == WandSignature);
8737 if (wand->debug != MagickFalse)
8738 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8739 if (wand->images == (Image *) NULL)
8740 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8741 PixelGetQuantumPacket(border,&wand->images->border_color);
8746 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8750 % M a g i c k S e t I m a g e C l i p M a s k %
8754 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8756 % MagickSetImageClipMask() sets image clip mask.
8758 % The format of the MagickSetImageClipMask method is:
8760 % MagickBooleanType MagickSetImageClipMask(MagickWand *wand,
8761 % const MagickWand *clip_mask)
8763 % A description of each parameter follows:
8765 % o wand: the magick wand.
8767 % o clip_mask: the clip_mask wand.
8770 WandExport MagickBooleanType MagickSetImageClipMask(MagickWand *wand,
8771 const MagickWand *clip_mask)
8773 assert(wand != (MagickWand *) NULL);
8774 assert(wand->signature == WandSignature);
8775 if (wand->debug != MagickFalse)
8776 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8777 assert(clip_mask != (MagickWand *) NULL);
8778 assert(clip_mask->signature == WandSignature);
8779 if (wand->debug != MagickFalse)
8780 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",clip_mask->name);
8781 if (clip_mask->images == (Image *) NULL)
8782 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8783 return(SetImageClipMask(wand->images,clip_mask->images,wand->exception));
8787 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8791 % M a g i c k S e t I m a g e C o l o r %
8795 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8797 % MagickSetImageColor() set the entire wand canvas to the specified color.
8799 % The format of the MagickSetImageColor method is:
8801 % MagickBooleanType MagickSetImageColor(MagickWand *wand,
8802 % const PixelWand *color)
8804 % A description of each parameter follows:
8806 % o wand: the magick wand.
8808 % o background: the image color.
8811 WandExport MagickBooleanType MagickSetImageColor(MagickWand *wand,
8812 const PixelWand *color)
8820 assert(wand != (MagickWand *) NULL);
8821 assert(wand->signature == WandSignature);
8822 if (wand->debug != MagickFalse)
8823 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8824 PixelGetMagickColor(color,&pixel);
8825 status=SetImageColor(wand->images,&pixel);
8826 if (status == MagickFalse)
8827 InheritException(wand->exception,&wand->images->exception);
8832 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8836 % 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 %
8840 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8842 % MagickSetImageColormapColor() sets the color of the specified colormap
8845 % The format of the MagickSetImageColormapColor method is:
8847 % MagickBooleanType MagickSetImageColormapColor(MagickWand *wand,
8848 % const size_t index,const PixelWand *color)
8850 % A description of each parameter follows:
8852 % o wand: the magick wand.
8854 % o index: the offset into the image colormap.
8856 % o color: Return the colormap color in this wand.
8859 WandExport MagickBooleanType MagickSetImageColormapColor(MagickWand *wand,
8860 const size_t index,const PixelWand *color)
8862 assert(wand != (MagickWand *) NULL);
8863 assert(wand->signature == WandSignature);
8864 if (wand->debug != MagickFalse)
8865 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8866 if (wand->images == (Image *) NULL)
8867 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8868 if ((wand->images->colormap == (PixelInfo *) NULL) ||
8869 (index >= wand->images->colors))
8870 ThrowWandException(WandError,"InvalidColormapIndex",wand->name);
8871 PixelGetQuantumPacket(color,wand->images->colormap+index);
8872 return(SyncImage(wand->images));
8876 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8880 % M a g i c k S e t I m a g e C o l o r s p a c e %
8884 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8886 % MagickSetImageColorspace() sets the image colorspace.
8888 % The format of the MagickSetImageColorspace method is:
8890 % MagickBooleanType MagickSetImageColorspace(MagickWand *wand,
8891 % const ColorspaceType colorspace)
8893 % A description of each parameter follows:
8895 % o wand: the magick wand.
8897 % o colorspace: the image colorspace: UndefinedColorspace, RGBColorspace,
8898 % GRAYColorspace, TransparentColorspace, OHTAColorspace, XYZColorspace,
8899 % YCbCrColorspace, YCCColorspace, YIQColorspace, YPbPrColorspace,
8900 % YPbPrColorspace, YUVColorspace, CMYKColorspace, sRGBColorspace,
8901 % HSLColorspace, or HWBColorspace.
8904 WandExport MagickBooleanType MagickSetImageColorspace(MagickWand *wand,
8905 const ColorspaceType colorspace)
8907 assert(wand != (MagickWand *) NULL);
8908 assert(wand->signature == WandSignature);
8909 if (wand->debug != MagickFalse)
8910 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8911 if (wand->images == (Image *) NULL)
8912 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8913 return(SetImageColorspace(wand->images,colorspace,&wand->images->exception));
8917 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8921 % M a g i c k S e t I m a g e C o m p o s e %
8925 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8927 % MagickSetImageCompose() sets the image composite operator, useful for
8928 % specifying how to composite the image thumbnail when using the
8929 % MagickMontageImage() method.
8931 % The format of the MagickSetImageCompose method is:
8933 % MagickBooleanType MagickSetImageCompose(MagickWand *wand,
8934 % const CompositeOperator compose)
8936 % A description of each parameter follows:
8938 % o wand: the magick wand.
8940 % o compose: the image composite operator.
8943 WandExport MagickBooleanType MagickSetImageCompose(MagickWand *wand,
8944 const CompositeOperator compose)
8946 assert(wand != (MagickWand *) NULL);
8947 assert(wand->signature == WandSignature);
8948 if (wand->debug != MagickFalse)
8949 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8950 if (wand->images == (Image *) NULL)
8951 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8952 wand->images->compose=compose;
8957 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8961 % 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 %
8965 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8967 % MagickSetImageCompression() sets the image compression.
8969 % The format of the MagickSetImageCompression method is:
8971 % MagickBooleanType MagickSetImageCompression(MagickWand *wand,
8972 % const CompressionType compression)
8974 % A description of each parameter follows:
8976 % o wand: the magick wand.
8978 % o compression: the image compression type.
8981 WandExport MagickBooleanType MagickSetImageCompression(MagickWand *wand,
8982 const CompressionType compression)
8984 assert(wand != (MagickWand *) NULL);
8985 assert(wand->signature == WandSignature);
8986 if (wand->debug != MagickFalse)
8987 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8988 if (wand->images == (Image *) NULL)
8989 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8990 wand->images->compression=compression;
8995 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8999 % 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 %
9003 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9005 % MagickSetImageCompressionQuality() sets the image compression quality.
9007 % The format of the MagickSetImageCompressionQuality method is:
9009 % MagickBooleanType MagickSetImageCompressionQuality(MagickWand *wand,
9010 % const size_t quality)
9012 % A description of each parameter follows:
9014 % o wand: the magick wand.
9016 % o quality: the image compression tlityype.
9019 WandExport MagickBooleanType MagickSetImageCompressionQuality(MagickWand *wand,
9020 const size_t quality)
9022 assert(wand != (MagickWand *) NULL);
9023 assert(wand->signature == WandSignature);
9024 if (wand->debug != MagickFalse)
9025 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9026 if (wand->images == (Image *) NULL)
9027 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9028 wand->images->quality=quality;
9033 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9037 % M a g i c k S e t I m a g e D e l a y %
9041 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9043 % MagickSetImageDelay() sets the image delay.
9045 % The format of the MagickSetImageDelay method is:
9047 % MagickBooleanType MagickSetImageDelay(MagickWand *wand,
9048 % const size_t delay)
9050 % A description of each parameter follows:
9052 % o wand: the magick wand.
9054 % o delay: the image delay in ticks-per-second units.
9057 WandExport MagickBooleanType MagickSetImageDelay(MagickWand *wand,
9060 assert(wand != (MagickWand *) NULL);
9061 assert(wand->signature == WandSignature);
9062 if (wand->debug != MagickFalse)
9063 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9064 if (wand->images == (Image *) NULL)
9065 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9066 wand->images->delay=delay;
9071 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9075 % M a g i c k S e t I m a g e D e p t h %
9079 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9081 % MagickSetImageDepth() sets the image depth.
9083 % The format of the MagickSetImageDepth method is:
9085 % MagickBooleanType MagickSetImageDepth(MagickWand *wand,
9086 % const size_t depth)
9088 % A description of each parameter follows:
9090 % o wand: the magick wand.
9092 % o depth: the image depth in bits: 8, 16, or 32.
9095 WandExport MagickBooleanType MagickSetImageDepth(MagickWand *wand,
9098 assert(wand != (MagickWand *) NULL);
9099 assert(wand->signature == WandSignature);
9100 if (wand->debug != MagickFalse)
9101 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9102 if (wand->images == (Image *) NULL)
9103 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9104 return(SetImageDepth(wand->images,depth));
9108 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9112 % M a g i c k S e t I m a g e D i s p o s e %
9116 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9118 % MagickSetImageDispose() sets the image disposal method.
9120 % The format of the MagickSetImageDispose method is:
9122 % MagickBooleanType MagickSetImageDispose(MagickWand *wand,
9123 % const DisposeType dispose)
9125 % A description of each parameter follows:
9127 % o wand: the magick wand.
9129 % o dispose: the image disposeal type.
9132 WandExport MagickBooleanType MagickSetImageDispose(MagickWand *wand,
9133 const DisposeType dispose)
9135 assert(wand != (MagickWand *) NULL);
9136 assert(wand->signature == WandSignature);
9137 if (wand->debug != MagickFalse)
9138 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9139 if (wand->images == (Image *) NULL)
9140 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9141 wand->images->dispose=dispose;
9146 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9150 % M a g i c k S e t I m a g e E x t e n t %
9154 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9156 % MagickSetImageExtent() sets the image size (i.e. columns & rows).
9158 % The format of the MagickSetImageExtent method is:
9160 % MagickBooleanType MagickSetImageExtent(MagickWand *wand,
9161 % const size_t columns,const unsigned rows)
9163 % A description of each parameter follows:
9165 % o wand: the magick wand.
9167 % o columns: The image width in pixels.
9169 % o rows: The image height in pixels.
9172 WandExport MagickBooleanType MagickSetImageExtent(MagickWand *wand,
9173 const size_t columns,const size_t rows)
9175 assert(wand != (MagickWand *) NULL);
9176 assert(wand->signature == WandSignature);
9177 if (wand->debug != MagickFalse)
9178 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9179 if (wand->images == (Image *) NULL)
9180 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9181 return(SetImageExtent(wand->images,columns,rows,&wand->images->exception));
9185 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9189 % M a g i c k S e t I m a g e F i l e n a m e %
9193 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9195 % MagickSetImageFilename() sets the filename of a particular image in a
9198 % The format of the MagickSetImageFilename method is:
9200 % MagickBooleanType MagickSetImageFilename(MagickWand *wand,
9201 % const char *filename)
9203 % A description of each parameter follows:
9205 % o wand: the magick wand.
9207 % o filename: the image filename.
9210 WandExport MagickBooleanType MagickSetImageFilename(MagickWand *wand,
9211 const char *filename)
9213 assert(wand != (MagickWand *) NULL);
9214 assert(wand->signature == WandSignature);
9215 if (wand->debug != MagickFalse)
9216 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9217 if (wand->images == (Image *) NULL)
9218 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9219 if (filename != (const char *) NULL)
9220 (void) CopyMagickString(wand->images->filename,filename,MaxTextExtent);
9225 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9229 % M a g i c k S e t I m a g e F o r m a t %
9233 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9235 % MagickSetImageFormat() sets the format of a particular image in a
9238 % The format of the MagickSetImageFormat method is:
9240 % MagickBooleanType MagickSetImageFormat(MagickWand *wand,
9241 % const char *format)
9243 % A description of each parameter follows:
9245 % o wand: the magick wand.
9247 % o format: the image format.
9250 WandExport MagickBooleanType MagickSetImageFormat(MagickWand *wand,
9256 assert(wand != (MagickWand *) NULL);
9257 assert(wand->signature == WandSignature);
9258 if (wand->debug != MagickFalse)
9259 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9260 if (wand->images == (Image *) NULL)
9261 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9262 if ((format == (char *) NULL) || (*format == '\0'))
9264 *wand->images->magick='\0';
9267 magick_info=GetMagickInfo(format,wand->exception);
9268 if (magick_info == (const MagickInfo *) NULL)
9269 return(MagickFalse);
9270 ClearMagickException(wand->exception);
9271 (void) CopyMagickString(wand->images->magick,format,MaxTextExtent);
9276 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9280 % M a g i c k S e t I m a g e F u z z %
9284 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9286 % MagickSetImageFuzz() sets the image fuzz.
9288 % The format of the MagickSetImageFuzz method is:
9290 % MagickBooleanType MagickSetImageFuzz(MagickWand *wand,
9291 % const double fuzz)
9293 % A description of each parameter follows:
9295 % o wand: the magick wand.
9297 % o fuzz: the image fuzz.
9300 WandExport MagickBooleanType MagickSetImageFuzz(MagickWand *wand,
9303 assert(wand != (MagickWand *) NULL);
9304 assert(wand->signature == WandSignature);
9305 if (wand->debug != MagickFalse)
9306 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9307 if (wand->images == (Image *) NULL)
9308 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9309 wand->images->fuzz=fuzz;
9314 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9318 % M a g i c k S e t I m a g e G a m m a %
9322 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9324 % MagickSetImageGamma() sets the image gamma.
9326 % The format of the MagickSetImageGamma method is:
9328 % MagickBooleanType MagickSetImageGamma(MagickWand *wand,
9329 % const double gamma)
9331 % A description of each parameter follows:
9333 % o wand: the magick wand.
9335 % o gamma: the image gamma.
9338 WandExport MagickBooleanType MagickSetImageGamma(MagickWand *wand,
9341 assert(wand != (MagickWand *) NULL);
9342 assert(wand->signature == WandSignature);
9343 if (wand->debug != MagickFalse)
9344 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9345 if (wand->images == (Image *) NULL)
9346 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9347 wand->images->gamma=gamma;
9352 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9356 % M a g i c k S e t I m a g e G r a v i t y %
9360 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9362 % MagickSetImageGravity() sets the image gravity type.
9364 % The format of the MagickSetImageGravity method is:
9366 % MagickBooleanType MagickSetImageGravity(MagickWand *wand,
9367 % const GravityType gravity)
9369 % A description of each parameter follows:
9371 % o wand: the magick wand.
9373 % o gravity: the image interlace scheme: NoInterlace, LineInterlace,
9374 % PlaneInterlace, PartitionInterlace.
9377 WandExport MagickBooleanType MagickSetImageGravity(MagickWand *wand,
9378 const GravityType gravity)
9380 assert(wand != (MagickWand *) NULL);
9381 assert(wand->signature == WandSignature);
9382 if (wand->debug != MagickFalse)
9383 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9384 if (wand->images == (Image *) NULL)
9385 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9386 wand->images->gravity=gravity;
9391 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9395 % 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 %
9399 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9401 % MagickSetImageGreenPrimary() sets the image chromaticity green primary
9404 % The format of the MagickSetImageGreenPrimary method is:
9406 % MagickBooleanType MagickSetImageGreenPrimary(MagickWand *wand,
9407 % const double x,const double y)
9409 % A description of each parameter follows:
9411 % o wand: the magick wand.
9413 % o x: the green primary x-point.
9415 % o y: the green primary y-point.
9419 WandExport MagickBooleanType MagickSetImageGreenPrimary(MagickWand *wand,
9420 const double x,const double y)
9422 assert(wand != (MagickWand *) NULL);
9423 assert(wand->signature == WandSignature);
9424 if (wand->debug != MagickFalse)
9425 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9426 if (wand->images == (Image *) NULL)
9427 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9428 wand->images->chromaticity.green_primary.x=x;
9429 wand->images->chromaticity.green_primary.y=y;
9434 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9438 % 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 %
9442 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9444 % MagickSetImageInterlaceScheme() sets the image interlace scheme.
9446 % The format of the MagickSetImageInterlaceScheme method is:
9448 % MagickBooleanType MagickSetImageInterlaceScheme(MagickWand *wand,
9449 % const InterlaceType interlace)
9451 % A description of each parameter follows:
9453 % o wand: the magick wand.
9455 % o interlace: the image interlace scheme: NoInterlace, LineInterlace,
9456 % PlaneInterlace, PartitionInterlace.
9459 WandExport MagickBooleanType MagickSetImageInterlaceScheme(MagickWand *wand,
9460 const InterlaceType interlace)
9462 assert(wand != (MagickWand *) NULL);
9463 assert(wand->signature == WandSignature);
9464 if (wand->debug != MagickFalse)
9465 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9466 if (wand->images == (Image *) NULL)
9467 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9468 wand->images->interlace=interlace;
9473 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9477 % 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 %
9481 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9483 % MagickSetImagePixelInterpolateMethod() sets the image interpolate pixel method.
9485 % The format of the MagickSetImagePixelInterpolateMethod method is:
9487 % MagickBooleanType MagickSetImagePixelInterpolateMethod(MagickWand *wand,
9488 % const PixelInterpolateMethod method)
9490 % A description of each parameter follows:
9492 % o wand: the magick wand.
9494 % o method: the image interpole pixel methods: choose from Undefined,
9495 % Average, Bicubic, Bilinear, Filter, Integer, Mesh, NearestNeighbor.
9498 WandExport MagickBooleanType MagickSetImagePixelInterpolateMethod(MagickWand *wand,
9499 const PixelInterpolateMethod method)
9501 assert(wand != (MagickWand *) NULL);
9502 assert(wand->signature == WandSignature);
9503 if (wand->debug != MagickFalse)
9504 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9505 if (wand->images == (Image *) NULL)
9506 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9507 wand->images->interpolate=method;
9512 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9516 % M a g i c k S e t I m a g e I t e r a t i o n s %
9520 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9522 % MagickSetImageIterations() sets the image iterations.
9524 % The format of the MagickSetImageIterations method is:
9526 % MagickBooleanType MagickSetImageIterations(MagickWand *wand,
9527 % const size_t iterations)
9529 % A description of each parameter follows:
9531 % o wand: the magick wand.
9533 % o delay: the image delay in 1/100th of a second.
9536 WandExport MagickBooleanType MagickSetImageIterations(MagickWand *wand,
9537 const size_t iterations)
9539 assert(wand != (MagickWand *) NULL);
9540 assert(wand->signature == WandSignature);
9541 if (wand->debug != MagickFalse)
9542 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9543 if (wand->images == (Image *) NULL)
9544 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9545 wand->images->iterations=iterations;
9550 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9554 % M a g i c k S e t I m a g e M a t t e %
9558 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9560 % MagickSetImageMatte() sets the image matte channel.
9562 % The format of the MagickSetImageMatteColor method is:
9564 % MagickBooleanType MagickSetImageMatteColor(MagickWand *wand,
9565 % const MagickBooleanType *matte)
9567 % A description of each parameter follows:
9569 % o wand: the magick wand.
9571 % o matte: Set to MagickTrue to enable the image matte channel otherwise
9575 WandExport MagickBooleanType MagickSetImageMatte(MagickWand *wand,
9576 const MagickBooleanType matte)
9578 assert(wand != (MagickWand *) NULL);
9579 assert(wand->signature == WandSignature);
9580 if (wand->debug != MagickFalse)
9581 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9582 if (wand->images == (Image *) NULL)
9583 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9584 if ((wand->images->matte == MagickFalse) && (matte != MagickFalse))
9585 (void) SetImageAlpha(wand->images,OpaqueAlpha);
9586 wand->images->matte=matte;
9591 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9595 % M a g i c k S e t I m a g e M a t t e C o l o r %
9599 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9601 % MagickSetImageMatteColor() sets the image matte color.
9603 % The format of the MagickSetImageMatteColor method is:
9605 % MagickBooleanType MagickSetImageMatteColor(MagickWand *wand,
9606 % const PixelWand *matte)
9608 % A description of each parameter follows:
9610 % o wand: the magick wand.
9612 % o matte: the matte pixel wand.
9615 WandExport MagickBooleanType MagickSetImageMatteColor(MagickWand *wand,
9616 const PixelWand *matte)
9618 assert(wand != (MagickWand *) NULL);
9619 assert(wand->signature == WandSignature);
9620 if (wand->debug != MagickFalse)
9621 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9622 if (wand->images == (Image *) NULL)
9623 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9624 PixelGetQuantumPacket(matte,&wand->images->matte_color);
9629 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9633 % M a g i c k S e t I m a g e O p a c i t y %
9637 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9639 % MagickSetImageAlpha() sets the image to the specified alpha level.
9641 % The format of the MagickSetImageAlpha method is:
9643 % MagickBooleanType MagickSetImageAlpha(MagickWand *wand,
9644 % const double alpha)
9646 % A description of each parameter follows:
9648 % o wand: the magick wand.
9650 % o alpha: the level of transparency: 1.0 is fully opaque and 0.0 is fully
9654 WandExport MagickBooleanType MagickSetImageAlpha(MagickWand *wand,
9660 assert(wand != (MagickWand *) NULL);
9661 assert(wand->signature == WandSignature);
9662 if (wand->debug != MagickFalse)
9663 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9664 if (wand->images == (Image *) NULL)
9665 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9666 status=SetImageAlpha(wand->images,ClampToQuantum(QuantumRange*alpha));
9667 if (status == MagickFalse)
9668 InheritException(wand->exception,&wand->images->exception);
9673 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9677 % 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 %
9681 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9683 % MagickSetImageOrientation() sets the image orientation.
9685 % The format of the MagickSetImageOrientation method is:
9687 % MagickBooleanType MagickSetImageOrientation(MagickWand *wand,
9688 % const OrientationType orientation)
9690 % A description of each parameter follows:
9692 % o wand: the magick wand.
9694 % o orientation: the image orientation type.
9697 WandExport MagickBooleanType MagickSetImageOrientation(MagickWand *wand,
9698 const OrientationType orientation)
9700 assert(wand != (MagickWand *) NULL);
9701 assert(wand->signature == WandSignature);
9702 if (wand->debug != MagickFalse)
9703 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9704 if (wand->images == (Image *) NULL)
9705 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9706 wand->images->orientation=orientation;
9711 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9715 % M a g i c k S e t I m a g e P a g e %
9719 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9721 % MagickSetImagePage() sets the page geometry of the image.
9723 % The format of the MagickSetImagePage method is:
9725 % MagickBooleanType MagickSetImagePage(MagickWand *wand,
9726 % const size_t width,const size_t height,const ssize_t x,
9729 % A description of each parameter follows:
9731 % o wand: the magick wand.
9733 % o width: the page width.
9735 % o height: the page height.
9737 % o x: the page x-offset.
9739 % o y: the page y-offset.
9742 WandExport MagickBooleanType MagickSetImagePage(MagickWand *wand,
9743 const size_t width,const size_t height,const ssize_t x,
9746 assert(wand != (MagickWand *) NULL);
9747 assert(wand->signature == WandSignature);
9748 if (wand->debug != MagickFalse)
9749 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9750 if (wand->images == (Image *) NULL)
9751 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9752 wand->images->page.width=width;
9753 wand->images->page.height=height;
9754 wand->images->page.x=x;
9755 wand->images->page.y=y;
9760 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9764 % 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 %
9768 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9770 % MagickSetImageProgressMonitor() sets the wand image progress monitor to the
9771 % specified method and returns the previous progress monitor if any. The
9772 % progress monitor method looks like this:
9774 % MagickBooleanType MagickProgressMonitor(const char *text,
9775 % const MagickOffsetType offset,const MagickSizeType span,
9776 % void *client_data)
9778 % If the progress monitor returns MagickFalse, the current operation is
9781 % The format of the MagickSetImageProgressMonitor method is:
9783 % MagickProgressMonitor MagickSetImageProgressMonitor(MagickWand *wand
9784 % const MagickProgressMonitor progress_monitor,void *client_data)
9786 % A description of each parameter follows:
9788 % o wand: the magick wand.
9790 % o progress_monitor: Specifies a pointer to a method to monitor progress
9791 % of an image operation.
9793 % o client_data: Specifies a pointer to any client data.
9796 WandExport MagickProgressMonitor MagickSetImageProgressMonitor(MagickWand *wand,
9797 const MagickProgressMonitor progress_monitor,void *client_data)
9799 MagickProgressMonitor
9802 assert(wand != (MagickWand *) NULL);
9803 assert(wand->signature == WandSignature);
9804 if (wand->debug != MagickFalse)
9805 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9806 if (wand->images == (Image *) NULL)
9808 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
9809 "ContainsNoImages","`%s'",wand->name);
9810 return((MagickProgressMonitor) NULL);
9812 previous_monitor=SetImageProgressMonitor(wand->images,
9813 progress_monitor,client_data);
9814 return(previous_monitor);
9818 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9822 % M a g i c k S e t I m a g e R e d P r i m a r y %
9826 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9828 % MagickSetImageRedPrimary() sets the image chromaticity red primary point.
9830 % The format of the MagickSetImageRedPrimary method is:
9832 % MagickBooleanType MagickSetImageRedPrimary(MagickWand *wand,
9833 % const double x,const double y)
9835 % A description of each parameter follows:
9837 % o wand: the magick wand.
9839 % o x: the red primary x-point.
9841 % o y: the red primary y-point.
9844 WandExport MagickBooleanType MagickSetImageRedPrimary(MagickWand *wand,
9845 const double x,const double y)
9847 assert(wand != (MagickWand *) NULL);
9848 assert(wand->signature == WandSignature);
9849 if (wand->debug != MagickFalse)
9850 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9851 if (wand->images == (Image *) NULL)
9852 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9853 wand->images->chromaticity.red_primary.x=x;
9854 wand->images->chromaticity.red_primary.y=y;
9859 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9863 % 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 %
9867 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9869 % MagickSetImageRenderingIntent() sets the image rendering intent.
9871 % The format of the MagickSetImageRenderingIntent method is:
9873 % MagickBooleanType MagickSetImageRenderingIntent(MagickWand *wand,
9874 % const RenderingIntent rendering_intent)
9876 % A description of each parameter follows:
9878 % o wand: the magick wand.
9880 % o rendering_intent: the image rendering intent: UndefinedIntent,
9881 % SaturationIntent, PerceptualIntent, AbsoluteIntent, or RelativeIntent.
9884 WandExport MagickBooleanType MagickSetImageRenderingIntent(MagickWand *wand,
9885 const RenderingIntent rendering_intent)
9887 assert(wand != (MagickWand *) NULL);
9888 assert(wand->signature == WandSignature);
9889 if (wand->debug != MagickFalse)
9890 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9891 if (wand->images == (Image *) NULL)
9892 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9893 wand->images->rendering_intent=rendering_intent;
9898 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9902 % M a g i c k S e t I m a g e R e s o l u t i o n %
9906 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9908 % MagickSetImageResolution() sets the image resolution.
9910 % The format of the MagickSetImageResolution method is:
9912 % MagickBooleanType MagickSetImageResolution(MagickWand *wand,
9913 % const double x_resolution,const doubtl y_resolution)
9915 % A description of each parameter follows:
9917 % o wand: the magick wand.
9919 % o x_resolution: the image x resolution.
9921 % o y_resolution: the image y resolution.
9924 WandExport MagickBooleanType MagickSetImageResolution(MagickWand *wand,
9925 const double x_resolution,const double y_resolution)
9927 assert(wand != (MagickWand *) NULL);
9928 assert(wand->signature == WandSignature);
9929 if (wand->debug != MagickFalse)
9930 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9931 if (wand->images == (Image *) NULL)
9932 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9933 wand->images->x_resolution=x_resolution;
9934 wand->images->y_resolution=y_resolution;
9939 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9943 % M a g i c k S e t I m a g e S c e n e %
9947 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9949 % MagickSetImageScene() sets the image scene.
9951 % The format of the MagickSetImageScene method is:
9953 % MagickBooleanType MagickSetImageScene(MagickWand *wand,
9954 % const size_t scene)
9956 % A description of each parameter follows:
9958 % o wand: the magick wand.
9960 % o delay: the image scene number.
9963 WandExport MagickBooleanType MagickSetImageScene(MagickWand *wand,
9966 assert(wand != (MagickWand *) NULL);
9967 assert(wand->signature == WandSignature);
9968 if (wand->debug != MagickFalse)
9969 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9970 if (wand->images == (Image *) NULL)
9971 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9972 wand->images->scene=scene;
9977 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9981 % 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 %
9985 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9987 % MagickSetImageTicksPerSecond() sets the image ticks-per-second.
9989 % The format of the MagickSetImageTicksPerSecond method is:
9991 % MagickBooleanType MagickSetImageTicksPerSecond(MagickWand *wand,
9992 % const ssize_t ticks_per-second)
9994 % A description of each parameter follows:
9996 % o wand: the magick wand.
9998 % o ticks_per_second: the units to use for the image delay.
10001 WandExport MagickBooleanType MagickSetImageTicksPerSecond(MagickWand *wand,
10002 const ssize_t ticks_per_second)
10004 assert(wand != (MagickWand *) NULL);
10005 assert(wand->signature == WandSignature);
10006 if (wand->debug != MagickFalse)
10007 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10008 if (wand->images == (Image *) NULL)
10009 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10010 wand->images->ticks_per_second=ticks_per_second;
10011 return(MagickTrue);
10015 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10019 % M a g i c k S e t I m a g e T y p e %
10023 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10025 % MagickSetImageType() sets the image type.
10027 % The format of the MagickSetImageType method is:
10029 % MagickBooleanType MagickSetImageType(MagickWand *wand,
10030 % const ImageType image_type)
10032 % A description of each parameter follows:
10034 % o wand: the magick wand.
10036 % o image_type: the image type: UndefinedType, BilevelType, GrayscaleType,
10037 % GrayscaleMatteType, PaletteType, PaletteMatteType, TrueColorType,
10038 % TrueColorMatteType, ColorSeparationType, ColorSeparationMatteType,
10042 WandExport MagickBooleanType MagickSetImageType(MagickWand *wand,
10043 const ImageType image_type)
10045 assert(wand != (MagickWand *) NULL);
10046 assert(wand->signature == WandSignature);
10047 if (wand->debug != MagickFalse)
10048 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10049 if (wand->images == (Image *) NULL)
10050 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10051 return(SetImageType(wand->images,image_type,wand->exception));
10055 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10059 % M a g i c k S e t I m a g e U n i t s %
10063 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10065 % MagickSetImageUnits() sets the image units of resolution.
10067 % The format of the MagickSetImageUnits method is:
10069 % MagickBooleanType MagickSetImageUnits(MagickWand *wand,
10070 % const ResolutionType units)
10072 % A description of each parameter follows:
10074 % o wand: the magick wand.
10076 % o units: the image units of resolution : UndefinedResolution,
10077 % PixelsPerInchResolution, or PixelsPerCentimeterResolution.
10080 WandExport MagickBooleanType MagickSetImageUnits(MagickWand *wand,
10081 const ResolutionType units)
10083 assert(wand != (MagickWand *) NULL);
10084 assert(wand->signature == WandSignature);
10085 if (wand->debug != MagickFalse)
10086 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10087 if (wand->images == (Image *) NULL)
10088 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10089 wand->images->units=units;
10090 return(MagickTrue);
10094 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10098 % 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 %
10102 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10104 % MagickSetImageVirtualPixelMethod() sets the image virtual pixel method.
10106 % The format of the MagickSetImageVirtualPixelMethod method is:
10108 % VirtualPixelMethod MagickSetImageVirtualPixelMethod(MagickWand *wand,
10109 % const VirtualPixelMethod method)
10111 % A description of each parameter follows:
10113 % o wand: the magick wand.
10115 % o method: the image virtual pixel method : UndefinedVirtualPixelMethod,
10116 % ConstantVirtualPixelMethod, EdgeVirtualPixelMethod,
10117 % MirrorVirtualPixelMethod, or TileVirtualPixelMethod.
10120 WandExport VirtualPixelMethod MagickSetImageVirtualPixelMethod(MagickWand *wand,
10121 const VirtualPixelMethod method)
10123 assert(wand != (MagickWand *) NULL);
10124 assert(wand->signature == WandSignature);
10125 if (wand->debug != MagickFalse)
10126 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10127 if (wand->images == (Image *) NULL)
10128 return(UndefinedVirtualPixelMethod);
10129 return(SetImageVirtualPixelMethod(wand->images,method));
10133 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10137 % M a g i c k S e t I m a g e W h i t e P o i n t %
10141 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10143 % MagickSetImageWhitePoint() sets the image chromaticity white point.
10145 % The format of the MagickSetImageWhitePoint method is:
10147 % MagickBooleanType MagickSetImageWhitePoint(MagickWand *wand,
10148 % const double x,const double y)
10150 % A description of each parameter follows:
10152 % o wand: the magick wand.
10154 % o x: the white x-point.
10156 % o y: the white y-point.
10159 WandExport MagickBooleanType MagickSetImageWhitePoint(MagickWand *wand,
10160 const double x,const double y)
10162 assert(wand != (MagickWand *) NULL);
10163 assert(wand->signature == WandSignature);
10164 if (wand->debug != MagickFalse)
10165 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10166 if (wand->images == (Image *) NULL)
10167 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10168 wand->images->chromaticity.white_point.x=x;
10169 wand->images->chromaticity.white_point.y=y;
10170 return(MagickTrue);
10174 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10178 % M a g i c k S h a d e I m a g e C h a n n e l %
10182 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10184 % MagickShadeImage() shines a distant light on an image to create a
10185 % three-dimensional effect. You control the positioning of the light with
10186 % azimuth and elevation; azimuth is measured in degrees off the x axis
10187 % and elevation is measured in pixels above the Z axis.
10189 % The format of the MagickShadeImage method is:
10191 % MagickBooleanType MagickShadeImage(MagickWand *wand,
10192 % const MagickBooleanType gray,const double azimuth,
10193 % const double elevation)
10195 % A description of each parameter follows:
10197 % o wand: the magick wand.
10199 % o gray: A value other than zero shades the intensity of each pixel.
10201 % o azimuth, elevation: Define the light source direction.
10204 WandExport MagickBooleanType MagickShadeImage(MagickWand *wand,
10205 const MagickBooleanType gray,const double asimuth,const double elevation)
10210 assert(wand != (MagickWand *) NULL);
10211 assert(wand->signature == WandSignature);
10212 if (wand->debug != MagickFalse)
10213 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10214 if (wand->images == (Image *) NULL)
10215 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10216 shade_image=ShadeImage(wand->images,gray,asimuth,elevation,wand->exception);
10217 if (shade_image == (Image *) NULL)
10218 return(MagickFalse);
10219 ReplaceImageInList(&wand->images,shade_image);
10220 return(MagickTrue);
10224 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10228 % M a g i c k S h a d o w I m a g e %
10232 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10234 % MagickShadowImage() simulates an image shadow.
10236 % The format of the MagickShadowImage method is:
10238 % MagickBooleanType MagickShadowImage(MagickWand *wand,
10239 % const double alpha,const double sigma,const ssize_t x,const ssize_t y)
10241 % A description of each parameter follows:
10243 % o wand: the magick wand.
10245 % o alpha: percentage transparency.
10247 % o sigma: the standard deviation of the Gaussian, in pixels.
10249 % o x: the shadow x-offset.
10251 % o y: the shadow y-offset.
10254 WandExport MagickBooleanType MagickShadowImage(MagickWand *wand,
10255 const double alpha,const double sigma,const ssize_t x,const ssize_t y)
10260 assert(wand != (MagickWand *) NULL);
10261 assert(wand->signature == WandSignature);
10262 if (wand->debug != MagickFalse)
10263 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10264 if (wand->images == (Image *) NULL)
10265 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10266 shadow_image=ShadowImage(wand->images,alpha,sigma,x,y,wand->exception);
10267 if (shadow_image == (Image *) NULL)
10268 return(MagickFalse);
10269 ReplaceImageInList(&wand->images,shadow_image);
10270 return(MagickTrue);
10274 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10278 % M a g i c k S h a r p e n I m a g e %
10282 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10284 % MagickSharpenImage() sharpens an image. We convolve the image with a
10285 % Gaussian operator of the given radius and standard deviation (sigma).
10286 % For reasonable results, the radius should be larger than sigma. Use a
10287 % radius of 0 and MagickSharpenImage() selects a suitable radius for you.
10289 % The format of the MagickSharpenImage method is:
10291 % MagickBooleanType MagickSharpenImage(MagickWand *wand,
10292 % const double radius,const double sigma,const double bias)
10294 % A description of each parameter follows:
10296 % o wand: the magick wand.
10298 % o radius: the radius of the Gaussian, in pixels, not counting the center
10301 % o sigma: the standard deviation of the Gaussian, in pixels.
10303 % o bias: the bias.
10306 WandExport MagickBooleanType MagickSharpenImage(MagickWand *wand,
10307 const double radius,const double sigma,const double bias)
10312 assert(wand != (MagickWand *) NULL);
10313 assert(wand->signature == WandSignature);
10314 if (wand->debug != MagickFalse)
10315 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10316 if (wand->images == (Image *) NULL)
10317 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10318 sharp_image=SharpenImage(wand->images,radius,sigma,bias,wand->exception);
10319 if (sharp_image == (Image *) NULL)
10320 return(MagickFalse);
10321 ReplaceImageInList(&wand->images,sharp_image);
10322 return(MagickTrue);
10326 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10330 % M a g i c k S h a v e I m a g e %
10334 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10336 % MagickShaveImage() shaves pixels from the image edges. It allocates the
10337 % memory necessary for the new Image structure and returns a pointer to the
10340 % The format of the MagickShaveImage method is:
10342 % MagickBooleanType MagickShaveImage(MagickWand *wand,
10343 % const size_t columns,const size_t rows)
10345 % A description of each parameter follows:
10347 % o wand: the magick wand.
10349 % o columns: the number of columns in the scaled image.
10351 % o rows: the number of rows in the scaled image.
10355 WandExport MagickBooleanType MagickShaveImage(MagickWand *wand,
10356 const size_t columns,const size_t rows)
10364 assert(wand != (MagickWand *) NULL);
10365 assert(wand->signature == WandSignature);
10366 if (wand->debug != MagickFalse)
10367 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10368 if (wand->images == (Image *) NULL)
10369 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10370 shave_info.width=columns;
10371 shave_info.height=rows;
10374 shave_image=ShaveImage(wand->images,&shave_info,wand->exception);
10375 if (shave_image == (Image *) NULL)
10376 return(MagickFalse);
10377 ReplaceImageInList(&wand->images,shave_image);
10378 return(MagickTrue);
10382 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10386 % M a g i c k S h e a r I m a g e %
10390 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10392 % MagickShearImage() slides one edge of an image along the X or Y axis,
10393 % creating a parallelogram. An X direction shear slides an edge along the X
10394 % axis, while a Y direction shear slides an edge along the Y axis. The amount
10395 % of the shear is controlled by a shear angle. For X direction shears, x_shear
10396 % is measured relative to the Y axis, and similarly, for Y direction shears
10397 % y_shear is measured relative to the X axis. Empty triangles left over from
10398 % shearing the image are filled with the background color.
10400 % The format of the MagickShearImage method is:
10402 % MagickBooleanType MagickShearImage(MagickWand *wand,
10403 % const PixelWand *background,const double x_shear,onst double y_shear)
10405 % A description of each parameter follows:
10407 % o wand: the magick wand.
10409 % o background: the background pixel wand.
10411 % o x_shear: the number of degrees to shear the image.
10413 % o y_shear: the number of degrees to shear the image.
10416 WandExport MagickBooleanType MagickShearImage(MagickWand *wand,
10417 const PixelWand *background,const double x_shear,const double y_shear)
10422 assert(wand != (MagickWand *) NULL);
10423 assert(wand->signature == WandSignature);
10424 if (wand->debug != MagickFalse)
10425 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10426 if (wand->images == (Image *) NULL)
10427 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10428 PixelGetQuantumPacket(background,&wand->images->background_color);
10429 shear_image=ShearImage(wand->images,x_shear,y_shear,wand->exception);
10430 if (shear_image == (Image *) NULL)
10431 return(MagickFalse);
10432 ReplaceImageInList(&wand->images,shear_image);
10433 return(MagickTrue);
10437 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10441 % 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 %
10445 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10447 % MagickSigmoidalContrastImage() adjusts the contrast of an image with a
10448 % non-linear sigmoidal contrast algorithm. Increase the contrast of the
10449 % image using a sigmoidal transfer function without saturating highlights or
10450 % shadows. Contrast indicates how much to increase the contrast (0 is none;
10451 % 3 is typical; 20 is pushing it); mid-point indicates where midtones fall in
10452 % the resultant image (0 is white; 50% is middle-gray; 100% is black). Set
10453 % sharpen to MagickTrue to increase the image contrast otherwise the contrast
10456 % The format of the MagickSigmoidalContrastImage method is:
10458 % MagickBooleanType MagickSigmoidalContrastImage(MagickWand *wand,
10459 % const MagickBooleanType sharpen,const double alpha,const double beta)
10461 % A description of each parameter follows:
10463 % o wand: the magick wand.
10465 % o sharpen: Increase or decrease image contrast.
10467 % o alpha: strength of the contrast, the larger the number the more
10468 % 'threshold-like' it becomes.
10470 % o beta: midpoint of the function as a color value 0 to QuantumRange.
10473 WandExport MagickBooleanType MagickSigmoidalContrastImage(
10474 MagickWand *wand,const MagickBooleanType sharpen,const double alpha,
10480 assert(wand != (MagickWand *) NULL);
10481 assert(wand->signature == WandSignature);
10482 if (wand->debug != MagickFalse)
10483 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10484 if (wand->images == (Image *) NULL)
10485 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10486 status=SigmoidalContrastImage(wand->images,sharpen,alpha,beta,
10487 &wand->images->exception);
10492 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10496 % M a g i c k S i m i l a r i t y I m a g e %
10500 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10502 % MagickSimilarityImage() compares the reference image of the image and
10503 % returns the best match offset. In addition, it returns a similarity image
10504 % such that an exact match location is completely white and if none of the
10505 % pixels match, black, otherwise some gray level in-between.
10507 % The format of the MagickSimilarityImage method is:
10509 % MagickWand *MagickSimilarityImage(MagickWand *wand,
10510 % const MagickWand *reference,RectangeInfo *offset,double *similarity)
10512 % A description of each parameter follows:
10514 % o wand: the magick wand.
10516 % o reference: the reference wand.
10518 % o offset: the best match offset of the reference image within the image.
10520 % o similarity: the computed similarity between the images.
10523 WandExport MagickWand *MagickSimilarityImage(MagickWand *wand,
10524 const MagickWand *reference,RectangleInfo *offset,double *similarity)
10529 assert(wand != (MagickWand *) NULL);
10530 assert(wand->signature == WandSignature);
10531 if (wand->debug != MagickFalse)
10532 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10533 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
10535 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
10536 "ContainsNoImages","`%s'",wand->name);
10537 return((MagickWand *) NULL);
10539 similarity_image=SimilarityImage(wand->images,reference->images,offset,
10540 similarity,&wand->images->exception);
10541 if (similarity_image == (Image *) NULL)
10542 return((MagickWand *) NULL);
10543 return(CloneMagickWandFromImages(wand,similarity_image));
10547 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10551 % M a g i c k S k e t c h I m a g e %
10555 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10557 % MagickSketchImage() simulates a pencil sketch. We convolve the image with
10558 % a Gaussian operator of the given radius and standard deviation (sigma).
10559 % For reasonable results, radius should be larger than sigma. Use a
10560 % radius of 0 and SketchImage() selects a suitable radius for you.
10561 % Angle gives the angle of the blurring motion.
10563 % The format of the MagickSketchImage method is:
10565 % MagickBooleanType MagickSketchImage(MagickWand *wand,
10566 % const double radius,const double sigma,const double angle,
10567 % const double bias)
10569 % A description of each parameter follows:
10571 % o wand: the magick wand.
10573 % o radius: the radius of the Gaussian, in pixels, not counting
10574 % the center pixel.
10576 % o sigma: the standard deviation of the Gaussian, in pixels.
10578 % o angle: apply the effect along this angle.
10580 % o bias: the bias.
10583 WandExport MagickBooleanType MagickSketchImage(MagickWand *wand,
10584 const double radius,const double sigma,const double angle,const double bias)
10589 assert(wand != (MagickWand *) NULL);
10590 assert(wand->signature == WandSignature);
10591 if (wand->debug != MagickFalse)
10592 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10593 if (wand->images == (Image *) NULL)
10594 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10595 sketch_image=SketchImage(wand->images,radius,sigma,angle,bias,
10597 if (sketch_image == (Image *) NULL)
10598 return(MagickFalse);
10599 ReplaceImageInList(&wand->images,sketch_image);
10600 return(MagickTrue);
10604 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10608 % M a g i c k S m u s h I m a g e s %
10612 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10614 % MagickSmushImages() takes all images from the current image pointer to the
10615 % end of the image list and smushs them to each other top-to-bottom if the
10616 % stack parameter is true, otherwise left-to-right.
10618 % The format of the MagickSmushImages method is:
10620 % MagickWand *MagickSmushImages(MagickWand *wand,
10621 % const MagickBooleanType stack,const ssize_t offset)
10623 % A description of each parameter follows:
10625 % o wand: the magick wand.
10627 % o stack: By default, images are stacked left-to-right. Set stack to
10628 % MagickTrue to stack them top-to-bottom.
10630 % o offset: minimum distance in pixels between images.
10633 WandExport MagickWand *MagickSmushImages(MagickWand *wand,
10634 const MagickBooleanType stack,const ssize_t offset)
10639 assert(wand != (MagickWand *) NULL);
10640 assert(wand->signature == WandSignature);
10641 if (wand->debug != MagickFalse)
10642 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10643 if (wand->images == (Image *) NULL)
10644 return((MagickWand *) NULL);
10645 smush_image=SmushImages(wand->images,stack,offset,wand->exception);
10646 if (smush_image == (Image *) NULL)
10647 return((MagickWand *) NULL);
10648 return(CloneMagickWandFromImages(wand,smush_image));
10652 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10656 % M a g i c k S o l a r i z e I m a g e %
10660 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10662 % MagickSolarizeImage() applies a special effect to the image, similar to the
10663 % effect achieved in a photo darkroom by selectively exposing areas of photo
10664 % sensitive paper to light. Threshold ranges from 0 to QuantumRange and is a
10665 % measure of the extent of the solarization.
10667 % The format of the MagickSolarizeImage method is:
10669 % MagickBooleanType MagickSolarizeImage(MagickWand *wand,
10670 % const double threshold)
10672 % A description of each parameter follows:
10674 % o wand: the magick wand.
10676 % o threshold: Define the extent of the solarization.
10679 WandExport MagickBooleanType MagickSolarizeImage(MagickWand *wand,
10680 const double threshold)
10685 assert(wand != (MagickWand *) NULL);
10686 assert(wand->signature == WandSignature);
10687 if (wand->debug != MagickFalse)
10688 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10689 if (wand->images == (Image *) NULL)
10690 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10691 status=SolarizeImage(wand->images,threshold,&wand->images->exception);
10696 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10700 % M a g i c k S p a r s e C o l o r I m a g e %
10704 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10706 % MagickSparseColorImage(), given a set of coordinates, interpolates the
10707 % colors found at those coordinates, across the whole image, using various
10710 % The format of the MagickSparseColorImage method is:
10712 % MagickBooleanType MagickSparseColorImage(MagickWand *wand,
10713 % const SparseColorMethod method,const size_t number_arguments,
10714 % const double *arguments)
10716 % A description of each parameter follows:
10718 % o image: the image to be sparseed.
10720 % o method: the method of image sparseion.
10722 % ArcSparseColorion will always ignore source image offset, and always
10723 % 'bestfit' the destination image with the top left corner offset
10724 % relative to the polar mapping center.
10726 % Bilinear has no simple inverse mapping so will not allow 'bestfit'
10727 % style of image sparseion.
10729 % Affine, Perspective, and Bilinear, will do least squares fitting of
10730 % the distrotion when more than the minimum number of control point
10731 % pairs are provided.
10733 % Perspective, and Bilinear, will fall back to a Affine sparseion when
10734 % less than 4 control point pairs are provided. While Affine sparseions
10735 % will let you use any number of control point pairs, that is Zero pairs
10736 % is a No-Op (viewport only) distrotion, one pair is a translation and
10737 % two pairs of control points will do a scale-rotate-translate, without
10740 % o number_arguments: the number of arguments given for this sparseion
10743 % o arguments: the arguments for this sparseion method.
10746 WandExport MagickBooleanType MagickSparseColorImage(MagickWand *wand,
10747 const SparseColorMethod method,const size_t number_arguments,
10748 const double *arguments)
10753 assert(wand != (MagickWand *) NULL);
10754 assert(wand->signature == WandSignature);
10755 if (wand->debug != MagickFalse)
10756 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10757 if (wand->images == (Image *) NULL)
10758 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10759 sparse_image=SparseColorImage(wand->images,method,number_arguments,arguments,
10761 if (sparse_image == (Image *) NULL)
10762 return(MagickFalse);
10763 ReplaceImageInList(&wand->images,sparse_image);
10764 return(MagickTrue);
10768 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10772 % M a g i c k S p l i c e I m a g e %
10776 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10778 % MagickSpliceImage() splices a solid color into the image.
10780 % The format of the MagickSpliceImage method is:
10782 % MagickBooleanType MagickSpliceImage(MagickWand *wand,
10783 % const size_t width,const size_t height,const ssize_t x,
10786 % A description of each parameter follows:
10788 % o wand: the magick wand.
10790 % o width: the region width.
10792 % o height: the region height.
10794 % o x: the region x offset.
10796 % o y: the region y offset.
10799 WandExport MagickBooleanType MagickSpliceImage(MagickWand *wand,
10800 const size_t width,const size_t height,const ssize_t x,
10809 assert(wand != (MagickWand *) NULL);
10810 assert(wand->signature == WandSignature);
10811 if (wand->debug != MagickFalse)
10812 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10813 if (wand->images == (Image *) NULL)
10814 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10815 splice.width=width;
10816 splice.height=height;
10819 splice_image=SpliceImage(wand->images,&splice,wand->exception);
10820 if (splice_image == (Image *) NULL)
10821 return(MagickFalse);
10822 ReplaceImageInList(&wand->images,splice_image);
10823 return(MagickTrue);
10827 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10831 % M a g i c k S p r e a d I m a g e %
10835 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10837 % MagickSpreadImage() is a special effects method that randomly displaces each
10838 % pixel in a block defined by the radius parameter.
10840 % The format of the MagickSpreadImage method is:
10842 % MagickBooleanType MagickSpreadImage(MagickWand *wand,const double radius,
10843 % const PixelInterpolateMethod method)
10845 % A description of each parameter follows:
10847 % o wand: the magick wand.
10849 % o radius: Choose a random pixel in a neighborhood of this extent.
10851 % o method: the pixel interpolation method.
10854 WandExport MagickBooleanType MagickSpreadImage(MagickWand *wand,
10855 const double radius,const PixelInterpolateMethod method)
10860 assert(wand != (MagickWand *) NULL);
10861 assert(wand->signature == WandSignature);
10862 if (wand->debug != MagickFalse)
10863 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10864 if (wand->images == (Image *) NULL)
10865 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10866 spread_image=SpreadImage(wand->images,radius,method,wand->exception);
10867 if (spread_image == (Image *) NULL)
10868 return(MagickFalse);
10869 ReplaceImageInList(&wand->images,spread_image);
10870 return(MagickTrue);
10874 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10878 % M a g i c k S t a t i s t i c I m a g e %
10882 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10884 % MagickStatisticImage() replace each pixel with corresponding statistic from
10885 % the neighborhood of the specified width and height.
10887 % The format of the MagickStatisticImage method is:
10889 % MagickBooleanType MagickStatisticImage(MagickWand *wand,
10890 % const StatisticType type,const double width,const size_t height)
10892 % A description of each parameter follows:
10894 % o wand: the magick wand.
10896 % o type: the statistic type (e.g. median, mode, etc.).
10898 % o width: the width of the pixel neighborhood.
10900 % o height: the height of the pixel neighborhood.
10903 WandExport MagickBooleanType MagickStatisticImage(MagickWand *wand,
10904 const StatisticType type,const size_t width,const size_t height)
10909 assert(wand != (MagickWand *) NULL);
10910 assert(wand->signature == WandSignature);
10911 if (wand->debug != MagickFalse)
10912 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10913 if (wand->images == (Image *) NULL)
10914 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10915 statistic_image=StatisticImage(wand->images,type,width,height,
10917 if (statistic_image == (Image *) NULL)
10918 return(MagickFalse);
10919 ReplaceImageInList(&wand->images,statistic_image);
10920 return(MagickTrue);
10924 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10928 % M a g i c k S t e g a n o I m a g e %
10932 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10934 % MagickSteganoImage() hides a digital watermark within the image.
10935 % Recover the hidden watermark later to prove that the authenticity of
10936 % an image. Offset defines the start position within the image to hide
10939 % The format of the MagickSteganoImage method is:
10941 % MagickWand *MagickSteganoImage(MagickWand *wand,
10942 % const MagickWand *watermark_wand,const ssize_t offset)
10944 % A description of each parameter follows:
10946 % o wand: the magick wand.
10948 % o watermark_wand: the watermark wand.
10950 % o offset: Start hiding at this offset into the image.
10953 WandExport MagickWand *MagickSteganoImage(MagickWand *wand,
10954 const MagickWand *watermark_wand,const ssize_t offset)
10959 assert(wand != (MagickWand *) NULL);
10960 assert(wand->signature == WandSignature);
10961 if (wand->debug != MagickFalse)
10962 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10963 if ((wand->images == (Image *) NULL) ||
10964 (watermark_wand->images == (Image *) NULL))
10966 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
10967 "ContainsNoImages","`%s'",wand->name);
10968 return((MagickWand *) NULL);
10970 wand->images->offset=offset;
10971 stegano_image=SteganoImage(wand->images,watermark_wand->images,
10973 if (stegano_image == (Image *) NULL)
10974 return((MagickWand *) NULL);
10975 return(CloneMagickWandFromImages(wand,stegano_image));
10979 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10983 % M a g i c k S t e r e o I m a g e %
10987 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10989 % MagickStereoImage() composites two images and produces a single image that
10990 % is the composite of a left and right image of a stereo pair
10992 % The format of the MagickStereoImage method is:
10994 % MagickWand *MagickStereoImage(MagickWand *wand,
10995 % const MagickWand *offset_wand)
10997 % A description of each parameter follows:
10999 % o wand: the magick wand.
11001 % o offset_wand: Another image wand.
11004 WandExport MagickWand *MagickStereoImage(MagickWand *wand,
11005 const MagickWand *offset_wand)
11010 assert(wand != (MagickWand *) NULL);
11011 assert(wand->signature == WandSignature);
11012 if (wand->debug != MagickFalse)
11013 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11014 if ((wand->images == (Image *) NULL) ||
11015 (offset_wand->images == (Image *) NULL))
11017 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
11018 "ContainsNoImages","`%s'",wand->name);
11019 return((MagickWand *) NULL);
11021 stereo_image=StereoImage(wand->images,offset_wand->images,wand->exception);
11022 if (stereo_image == (Image *) NULL)
11023 return((MagickWand *) NULL);
11024 return(CloneMagickWandFromImages(wand,stereo_image));
11028 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11032 % M a g i c k S t r i p I m a g e %
11036 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11038 % MagickStripImage() strips an image of all profiles and comments.
11040 % The format of the MagickStripImage method is:
11042 % MagickBooleanType MagickStripImage(MagickWand *wand)
11044 % A description of each parameter follows:
11046 % o wand: the magick wand.
11049 WandExport MagickBooleanType MagickStripImage(MagickWand *wand)
11054 assert(wand != (MagickWand *) NULL);
11055 assert(wand->signature == WandSignature);
11056 if (wand->debug != MagickFalse)
11057 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11058 if (wand->images == (Image *) NULL)
11059 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11060 status=StripImage(wand->images);
11061 if (status == MagickFalse)
11062 InheritException(wand->exception,&wand->images->exception);
11067 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11071 % M a g i c k S w i r l I m a g e %
11075 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11077 % MagickSwirlImage() swirls the pixels about the center of the image, where
11078 % degrees indicates the sweep of the arc through which each pixel is moved.
11079 % You get a more dramatic effect as the degrees move from 1 to 360.
11081 % The format of the MagickSwirlImage method is:
11083 % MagickBooleanType MagickSwirlImage(MagickWand *wand,const double degrees,
11084 % const PixelInterpolateMethod method)
11086 % A description of each parameter follows:
11088 % o wand: the magick wand.
11090 % o degrees: Define the tightness of the swirling effect.
11092 % o method: the pixel interpolation method.
11095 WandExport MagickBooleanType MagickSwirlImage(MagickWand *wand,
11096 const double degrees,const PixelInterpolateMethod method)
11101 assert(wand != (MagickWand *) NULL);
11102 assert(wand->signature == WandSignature);
11103 if (wand->debug != MagickFalse)
11104 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11105 if (wand->images == (Image *) NULL)
11106 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11107 swirl_image=SwirlImage(wand->images,degrees,method,wand->exception);
11108 if (swirl_image == (Image *) NULL)
11109 return(MagickFalse);
11110 ReplaceImageInList(&wand->images,swirl_image);
11111 return(MagickTrue);
11115 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11119 % M a g i c k T e x t u r e I m a g e %
11123 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11125 % MagickTextureImage() repeatedly tiles the texture image across and down the
11128 % The format of the MagickTextureImage method is:
11130 % MagickWand *MagickTextureImage(MagickWand *wand,
11131 % const MagickWand *texture_wand)
11133 % A description of each parameter follows:
11135 % o wand: the magick wand.
11137 % o texture_wand: the texture wand
11140 WandExport MagickWand *MagickTextureImage(MagickWand *wand,
11141 const MagickWand *texture_wand)
11149 assert(wand != (MagickWand *) NULL);
11150 assert(wand->signature == WandSignature);
11151 if (wand->debug != MagickFalse)
11152 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11153 if ((wand->images == (Image *) NULL) ||
11154 (texture_wand->images == (Image *) NULL))
11156 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
11157 "ContainsNoImages","`%s'",wand->name);
11158 return((MagickWand *) NULL);
11160 texture_image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
11161 if (texture_image == (Image *) NULL)
11162 return((MagickWand *) NULL);
11163 status=TextureImage(texture_image,texture_wand->images);
11164 if (status == MagickFalse)
11166 InheritException(wand->exception,&texture_image->exception);
11167 texture_image=DestroyImage(texture_image);
11168 return((MagickWand *) NULL);
11170 return(CloneMagickWandFromImages(wand,texture_image));
11174 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11178 % M a g i c k T h r e s h o l d I m a g e %
11182 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11184 % MagickThresholdImage() changes the value of individual pixels based on
11185 % the intensity of each pixel compared to threshold. The result is a
11186 % high-contrast, two color image.
11188 % The format of the MagickThresholdImage method is:
11190 % MagickBooleanType MagickThresholdImage(MagickWand *wand,
11191 % const double threshold)
11192 % MagickBooleanType MagickThresholdImageChannel(MagickWand *wand,
11193 % const ChannelType channel,const double threshold)
11195 % A description of each parameter follows:
11197 % o wand: the magick wand.
11199 % o channel: the image channel(s).
11201 % o threshold: Define the threshold value.
11204 WandExport MagickBooleanType MagickThresholdImage(MagickWand *wand,
11205 const double threshold)
11210 status=MagickThresholdImageChannel(wand,DefaultChannels,threshold);
11214 WandExport MagickBooleanType MagickThresholdImageChannel(MagickWand *wand,
11215 const ChannelType channel,const double threshold)
11220 assert(wand != (MagickWand *) NULL);
11221 assert(wand->signature == WandSignature);
11222 if (wand->debug != MagickFalse)
11223 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11224 if (wand->images == (Image *) NULL)
11225 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11226 status=BilevelImage(wand->images,threshold);
11227 if (status == MagickFalse)
11228 InheritException(wand->exception,&wand->images->exception);
11233 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11237 % M a g i c k T h u m b n a i l I m a g e %
11241 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11243 % MagickThumbnailImage() changes the size of an image to the given dimensions
11244 % and removes any associated profiles. The goal is to produce small low cost
11245 % thumbnail images suited for display on the Web.
11247 % The format of the MagickThumbnailImage method is:
11249 % MagickBooleanType MagickThumbnailImage(MagickWand *wand,
11250 % const size_t columns,const size_t rows)
11252 % A description of each parameter follows:
11254 % o wand: the magick wand.
11256 % o columns: the number of columns in the scaled image.
11258 % o rows: the number of rows in the scaled image.
11261 WandExport MagickBooleanType MagickThumbnailImage(MagickWand *wand,
11262 const size_t columns,const size_t rows)
11267 assert(wand != (MagickWand *) NULL);
11268 assert(wand->signature == WandSignature);
11269 if (wand->debug != MagickFalse)
11270 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11271 if (wand->images == (Image *) NULL)
11272 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11273 thumbnail_image=ThumbnailImage(wand->images,columns,rows,wand->exception);
11274 if (thumbnail_image == (Image *) NULL)
11275 return(MagickFalse);
11276 ReplaceImageInList(&wand->images,thumbnail_image);
11277 return(MagickTrue);
11281 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11285 % M a g i c k T i n t I m a g e %
11289 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11291 % MagickTintImage() applies a color vector to each pixel in the image. The
11292 % length of the vector is 0 for black and white and at its maximum for the
11293 % midtones. The vector weighting function is
11294 % f(x)=(1-(4.0*((x-0.5)*(x-0.5)))).
11296 % The format of the MagickTintImage method is:
11298 % MagickBooleanType MagickTintImage(MagickWand *wand,
11299 % const PixelWand *tint,const PixelWand *blend)
11301 % A description of each parameter follows:
11303 % o wand: the magick wand.
11305 % o tint: the tint pixel wand.
11307 % o alpha: the alpha pixel wand.
11310 WandExport MagickBooleanType MagickTintImage(MagickWand *wand,
11311 const PixelWand *tint,const PixelWand *blend)
11314 percent_blend[MaxTextExtent];
11322 assert(wand != (MagickWand *) NULL);
11323 assert(wand->signature == WandSignature);
11324 if (wand->debug != MagickFalse)
11325 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11326 if (wand->images == (Image *) NULL)
11327 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11328 if (wand->images->colorspace != CMYKColorspace)
11329 (void) FormatLocaleString(percent_blend,MaxTextExtent,
11330 "%g,%g,%g,%g",(double) (100.0*QuantumScale*
11331 PixelGetRedQuantum(blend)),(double) (100.0*QuantumScale*
11332 PixelGetGreenQuantum(blend)),(double) (100.0*QuantumScale*
11333 PixelGetBlueQuantum(blend)),(double) (100.0*QuantumScale*
11334 PixelGetAlphaQuantum(blend)));
11336 (void) FormatLocaleString(percent_blend,MaxTextExtent,
11337 "%g,%g,%g,%g,%g",(double) (100.0*QuantumScale*
11338 PixelGetCyanQuantum(blend)),(double) (100.0*QuantumScale*
11339 PixelGetMagentaQuantum(blend)),(double) (100.0*QuantumScale*
11340 PixelGetYellowQuantum(blend)),(double) (100.0*QuantumScale*
11341 PixelGetBlackQuantum(blend)),(double) (100.0*QuantumScale*
11342 PixelGetAlphaQuantum(blend)));
11343 target=PixelGetPixel(tint);
11344 tint_image=TintImage(wand->images,percent_blend,&target,wand->exception);
11345 if (tint_image == (Image *) NULL)
11346 return(MagickFalse);
11347 ReplaceImageInList(&wand->images,tint_image);
11348 return(MagickTrue);
11352 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11356 % M a g i c k T r a n s f o r m I m a g e %
11360 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11362 % MagickTransformImage() is a convenience method that behaves like
11363 % MagickResizeImage() or MagickCropImage() but accepts scaling and/or cropping
11364 % information as a region geometry specification. If the operation fails,
11365 % a NULL image handle is returned.
11367 % The format of the MagickTransformImage method is:
11369 % MagickWand *MagickTransformImage(MagickWand *wand,const char *crop,
11370 % const char *geometry)
11372 % A description of each parameter follows:
11374 % o wand: the magick wand.
11376 % o crop: A crop geometry string. This geometry defines a subregion of the
11379 % o geometry: An image geometry string. This geometry defines the final
11380 % size of the image.
11383 WandExport MagickWand *MagickTransformImage(MagickWand *wand,
11384 const char *crop,const char *geometry)
11392 assert(wand != (MagickWand *) NULL);
11393 assert(wand->signature == WandSignature);
11394 if (wand->debug != MagickFalse)
11395 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11396 if (wand->images == (Image *) NULL)
11397 return((MagickWand *) NULL);
11398 transform_image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
11399 if (transform_image == (Image *) NULL)
11400 return((MagickWand *) NULL);
11401 status=TransformImage(&transform_image,crop,geometry);
11402 if (status == MagickFalse)
11404 InheritException(wand->exception,&transform_image->exception);
11405 transform_image=DestroyImage(transform_image);
11406 return((MagickWand *) NULL);
11408 return(CloneMagickWandFromImages(wand,transform_image));
11412 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11416 % 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 %
11420 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11422 % MagickTransformImageColorspace() transform the image colorspace.
11424 % The format of the MagickTransformImageColorspace method is:
11426 % MagickBooleanType MagickTransformImageColorspace(MagickWand *wand,
11427 % const ColorspaceType colorspace)
11429 % A description of each parameter follows:
11431 % o wand: the magick wand.
11433 % o colorspace: the image colorspace: UndefinedColorspace, RGBColorspace,
11434 % GRAYColorspace, TransparentColorspace, OHTAColorspace, XYZColorspace,
11435 % YCbCrColorspace, YCCColorspace, YIQColorspace, YPbPrColorspace,
11436 % YPbPrColorspace, YUVColorspace, CMYKColorspace, sRGBColorspace,
11437 % HSLColorspace, or HWBColorspace.
11440 WandExport MagickBooleanType MagickTransformImageColorspace(MagickWand *wand,
11441 const ColorspaceType colorspace)
11443 assert(wand != (MagickWand *) NULL);
11444 assert(wand->signature == WandSignature);
11445 if (wand->debug != MagickFalse)
11446 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11447 if (wand->images == (Image *) NULL)
11448 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11449 return(TransformImageColorspace(wand->images,colorspace));
11453 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11457 % 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 %
11461 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11463 % MagickTransparentPaintImage() changes any pixel that matches color with the
11464 % color defined by fill.
11466 % The format of the MagickTransparentPaintImage method is:
11468 % MagickBooleanType MagickTransparentPaintImage(MagickWand *wand,
11469 % const PixelWand *target,const double alpha,const double fuzz,
11470 % const MagickBooleanType invert)
11472 % A description of each parameter follows:
11474 % o wand: the magick wand.
11476 % o target: Change this target color to specified alpha value within
11479 % o alpha: the level of transparency: 1.0 is fully opaque and 0.0 is fully
11482 % o fuzz: By default target must match a particular pixel color
11483 % exactly. However, in many cases two colors may differ by a small amount.
11484 % The fuzz member of image defines how much tolerance is acceptable to
11485 % consider two colors as the same. For example, set fuzz to 10 and the
11486 % color red at intensities of 100 and 102 respectively are now interpreted
11487 % as the same color for the purposes of the floodfill.
11489 % o invert: paint any pixel that does not match the target color.
11492 WandExport MagickBooleanType MagickTransparentPaintImage(MagickWand *wand,
11493 const PixelWand *target,const double alpha,const double fuzz,
11494 const MagickBooleanType invert)
11502 assert(wand != (MagickWand *) NULL);
11503 assert(wand->signature == WandSignature);
11504 if (wand->debug != MagickFalse)
11505 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11506 if (wand->images == (Image *) NULL)
11507 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11508 PixelGetMagickColor(target,&target_pixel);
11509 wand->images->fuzz=fuzz;
11510 status=TransparentPaintImage(wand->images,&target_pixel,ClampToQuantum(
11511 QuantumRange*alpha),invert,&wand->images->exception);
11516 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11520 % M a g i c k T r a n s p o s e I m a g e %
11524 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11526 % MagickTransposeImage() creates a vertical mirror image by reflecting the
11527 % pixels around the central x-axis while rotating them 90-degrees.
11529 % The format of the MagickTransposeImage method is:
11531 % MagickBooleanType MagickTransposeImage(MagickWand *wand)
11533 % A description of each parameter follows:
11535 % o wand: the magick wand.
11538 WandExport MagickBooleanType MagickTransposeImage(MagickWand *wand)
11543 assert(wand != (MagickWand *) NULL);
11544 assert(wand->signature == WandSignature);
11545 if (wand->debug != MagickFalse)
11546 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11547 if (wand->images == (Image *) NULL)
11548 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11549 transpose_image=TransposeImage(wand->images,wand->exception);
11550 if (transpose_image == (Image *) NULL)
11551 return(MagickFalse);
11552 ReplaceImageInList(&wand->images,transpose_image);
11553 return(MagickTrue);
11557 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11561 % M a g i c k T r a n s v e r s e I m a g e %
11565 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11567 % MagickTransverseImage() creates a horizontal mirror image by reflecting the
11568 % pixels around the central y-axis while rotating them 270-degrees.
11570 % The format of the MagickTransverseImage method is:
11572 % MagickBooleanType MagickTransverseImage(MagickWand *wand)
11574 % A description of each parameter follows:
11576 % o wand: the magick wand.
11579 WandExport MagickBooleanType MagickTransverseImage(MagickWand *wand)
11584 assert(wand != (MagickWand *) NULL);
11585 assert(wand->signature == WandSignature);
11586 if (wand->debug != MagickFalse)
11587 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11588 if (wand->images == (Image *) NULL)
11589 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11590 transverse_image=TransverseImage(wand->images,wand->exception);
11591 if (transverse_image == (Image *) NULL)
11592 return(MagickFalse);
11593 ReplaceImageInList(&wand->images,transverse_image);
11594 return(MagickTrue);
11598 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11602 % M a g i c k T r i m I m a g e %
11606 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11608 % MagickTrimImage() remove edges that are the background color from the image.
11610 % The format of the MagickTrimImage method is:
11612 % MagickBooleanType MagickTrimImage(MagickWand *wand,const double fuzz)
11614 % A description of each parameter follows:
11616 % o wand: the magick wand.
11618 % o fuzz: By default target must match a particular pixel color
11619 % exactly. However, in many cases two colors may differ by a small amount.
11620 % The fuzz member of image defines how much tolerance is acceptable to
11621 % consider two colors as the same. For example, set fuzz to 10 and the
11622 % color red at intensities of 100 and 102 respectively are now interpreted
11623 % as the same color for the purposes of the floodfill.
11626 WandExport MagickBooleanType MagickTrimImage(MagickWand *wand,const double fuzz)
11631 assert(wand != (MagickWand *) NULL);
11632 assert(wand->signature == WandSignature);
11633 if (wand->debug != MagickFalse)
11634 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11635 if (wand->images == (Image *) NULL)
11636 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11637 wand->images->fuzz=fuzz;
11638 trim_image=TrimImage(wand->images,wand->exception);
11639 if (trim_image == (Image *) NULL)
11640 return(MagickFalse);
11641 ReplaceImageInList(&wand->images,trim_image);
11642 return(MagickTrue);
11646 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11650 % M a g i c k U n i q u e I m a g e C o l o r s %
11654 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11656 % MagickUniqueImageColors() discards all but one of any pixel color.
11658 % The format of the MagickUniqueImageColors method is:
11660 % MagickBooleanType MagickUniqueImageColors(MagickWand *wand)
11662 % A description of each parameter follows:
11664 % o wand: the magick wand.
11667 WandExport MagickBooleanType MagickUniqueImageColors(MagickWand *wand)
11672 assert(wand != (MagickWand *) NULL);
11673 assert(wand->signature == WandSignature);
11674 if (wand->debug != MagickFalse)
11675 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11676 if (wand->images == (Image *) NULL)
11677 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11678 unique_image=UniqueImageColors(wand->images,wand->exception);
11679 if (unique_image == (Image *) NULL)
11680 return(MagickFalse);
11681 ReplaceImageInList(&wand->images,unique_image);
11682 return(MagickTrue);
11686 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11690 % M a g i c k U n s h a r p M a s k I m a g e %
11694 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11696 % MagickUnsharpMaskImage() sharpens an image. We convolve the image with a
11697 % Gaussian operator of the given radius and standard deviation (sigma).
11698 % For reasonable results, radius should be larger than sigma. Use a radius
11699 % of 0 and UnsharpMaskImage() selects a suitable radius for you.
11701 % The format of the MagickUnsharpMaskImage method is:
11703 % MagickBooleanType MagickUnsharpMaskImage(MagickWand *wand,
11704 % const double radius,const double sigma,const double amount,
11705 % const double threshold)
11707 % A description of each parameter follows:
11709 % o wand: the magick wand.
11711 % o radius: the radius of the Gaussian, in pixels, not counting the center
11714 % o sigma: the standard deviation of the Gaussian, in pixels.
11716 % o amount: the percentage of the difference between the original and the
11717 % blur image that is added back into the original.
11719 % o threshold: the threshold in pixels needed to apply the diffence amount.
11722 WandExport MagickBooleanType MagickUnsharpMaskImage(MagickWand *wand,
11723 const double radius,const double sigma,const double amount,
11724 const double threshold)
11729 assert(wand != (MagickWand *) NULL);
11730 assert(wand->signature == WandSignature);
11731 if (wand->debug != MagickFalse)
11732 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11733 if (wand->images == (Image *) NULL)
11734 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11735 unsharp_image=UnsharpMaskImage(wand->images,radius,sigma,amount,threshold,
11737 if (unsharp_image == (Image *) NULL)
11738 return(MagickFalse);
11739 ReplaceImageInList(&wand->images,unsharp_image);
11740 return(MagickTrue);
11744 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11748 % M a g i c k V i g n e t t e I m a g e %
11752 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11754 % MagickVignetteImage() softens the edges of the image in vignette style.
11756 % The format of the MagickVignetteImage method is:
11758 % MagickBooleanType MagickVignetteImage(MagickWand *wand,
11759 % const double black_point,const double white_point,const ssize_t x,
11762 % A description of each parameter follows:
11764 % o wand: the magick wand.
11766 % o black_point: the black point.
11768 % o white_point: the white point.
11770 % o x, y: Define the x and y ellipse offset.
11773 WandExport MagickBooleanType MagickVignetteImage(MagickWand *wand,
11774 const double black_point,const double white_point,const ssize_t x,const ssize_t y)
11779 assert(wand != (MagickWand *) NULL);
11780 assert(wand->signature == WandSignature);
11781 if (wand->debug != MagickFalse)
11782 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11783 if (wand->images == (Image *) NULL)
11784 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11785 vignette_image=VignetteImage(wand->images,black_point,white_point,x,y,
11787 if (vignette_image == (Image *) NULL)
11788 return(MagickFalse);
11789 ReplaceImageInList(&wand->images,vignette_image);
11790 return(MagickTrue);
11794 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11798 % M a g i c k W a v e I m a g e %
11802 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11804 % MagickWaveImage() creates a "ripple" effect in the image by shifting
11805 % the pixels vertically along a sine wave whose amplitude and wavelength
11806 % is specified by the given parameters.
11808 % The format of the MagickWaveImage method is:
11810 % MagickBooleanType MagickWaveImage(MagickWand *wand,
11811 % const double amplitude,const double wave_length,
11812 % const PixelInterpolateMethod method)
11814 % A description of each parameter follows:
11816 % o wand: the magick wand.
11818 % o amplitude, wave_length: Define the amplitude and wave length of the
11821 % o method: the pixel interpolation method.
11824 WandExport MagickBooleanType MagickWaveImage(MagickWand *wand,
11825 const double amplitude,const double wave_length,
11826 const PixelInterpolateMethod method)
11831 assert(wand != (MagickWand *) NULL);
11832 assert(wand->signature == WandSignature);
11833 if (wand->debug != MagickFalse)
11834 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11835 if (wand->images == (Image *) NULL)
11836 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11837 wave_image=WaveImage(wand->images,amplitude,wave_length,method,
11839 if (wave_image == (Image *) NULL)
11840 return(MagickFalse);
11841 ReplaceImageInList(&wand->images,wave_image);
11842 return(MagickTrue);
11846 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11850 % 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 %
11854 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11856 % MagickWhiteThresholdImage() is like ThresholdImage() but force all pixels
11857 % above the threshold into white while leaving all pixels below the threshold
11860 % The format of the MagickWhiteThresholdImage method is:
11862 % MagickBooleanType MagickWhiteThresholdImage(MagickWand *wand,
11863 % const PixelWand *threshold)
11865 % A description of each parameter follows:
11867 % o wand: the magick wand.
11869 % o threshold: the pixel wand.
11872 WandExport MagickBooleanType MagickWhiteThresholdImage(MagickWand *wand,
11873 const PixelWand *threshold)
11876 thresholds[MaxTextExtent];
11881 assert(wand != (MagickWand *) NULL);
11882 assert(wand->signature == WandSignature);
11883 if (wand->debug != MagickFalse)
11884 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11885 if (wand->images == (Image *) NULL)
11886 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11887 (void) FormatLocaleString(thresholds,MaxTextExtent,
11888 QuantumFormat "," QuantumFormat "," QuantumFormat "," QuantumFormat,
11889 PixelGetRedQuantum(threshold),PixelGetGreenQuantum(threshold),
11890 PixelGetBlueQuantum(threshold),PixelGetAlphaQuantum(threshold));
11891 status=WhiteThresholdImage(wand->images,thresholds,&wand->images->exception);
11892 if (status == MagickFalse)
11893 InheritException(wand->exception,&wand->images->exception);
11898 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11902 % M a g i c k W r i t e I m a g e %
11906 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11908 % MagickWriteImage() writes an image to the specified filename. If the
11909 % filename parameter is NULL, the image is written to the filename set
11910 % by MagickReadImage() or MagickSetImageFilename().
11912 % The format of the MagickWriteImage method is:
11914 % MagickBooleanType MagickWriteImage(MagickWand *wand,
11915 % const char *filename)
11917 % A description of each parameter follows:
11919 % o wand: the magick wand.
11921 % o filename: the image filename.
11925 WandExport MagickBooleanType MagickWriteImage(MagickWand *wand,
11926 const char *filename)
11937 assert(wand != (MagickWand *) NULL);
11938 assert(wand->signature == WandSignature);
11939 if (wand->debug != MagickFalse)
11940 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11941 if (wand->images == (Image *) NULL)
11942 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11943 if (filename != (const char *) NULL)
11944 (void) CopyMagickString(wand->images->filename,filename,MaxTextExtent);
11945 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
11946 if (image == (Image *) NULL)
11947 return(MagickFalse);
11948 write_info=CloneImageInfo(wand->image_info);
11949 write_info->adjoin=MagickTrue;
11950 status=WriteImage(write_info,image,&image->exception);
11951 image=DestroyImage(image);
11952 write_info=DestroyImageInfo(write_info);
11957 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11961 % M a g i c k W r i t e I m a g e F i l e %
11965 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11967 % MagickWriteImageFile() writes an image to an open file descriptor.
11969 % The format of the MagickWriteImageFile method is:
11971 % MagickBooleanType MagickWriteImageFile(MagickWand *wand,FILE *file)
11973 % A description of each parameter follows:
11975 % o wand: the magick wand.
11977 % o file: the file descriptor.
11980 WandExport MagickBooleanType MagickWriteImageFile(MagickWand *wand,FILE *file)
11991 assert(wand != (MagickWand *) NULL);
11992 assert(wand->signature == WandSignature);
11993 assert(file != (FILE *) NULL);
11994 if (wand->debug != MagickFalse)
11995 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11996 if (wand->images == (Image *) NULL)
11997 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11998 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
11999 if (image == (Image *) NULL)
12000 return(MagickFalse);
12001 write_info=CloneImageInfo(wand->image_info);
12002 SetImageInfoFile(write_info,file);
12003 write_info->adjoin=MagickTrue;
12004 status=WriteImage(write_info,image,&image->exception);
12005 write_info=DestroyImageInfo(write_info);
12006 image=DestroyImage(image);
12011 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12015 % M a g i c k W r i t e I m a g e s %
12019 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12021 % MagickWriteImages() writes an image or image sequence.
12023 % The format of the MagickWriteImages method is:
12025 % MagickBooleanType MagickWriteImages(MagickWand *wand,
12026 % const char *filename,const MagickBooleanType adjoin)
12028 % A description of each parameter follows:
12030 % o wand: the magick wand.
12032 % o filename: the image filename.
12034 % o adjoin: join images into a single multi-image file.
12037 WandExport MagickBooleanType MagickWriteImages(MagickWand *wand,
12038 const char *filename,const MagickBooleanType adjoin)
12046 assert(wand != (MagickWand *) NULL);
12047 assert(wand->signature == WandSignature);
12048 if (wand->debug != MagickFalse)
12049 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12050 if (wand->images == (Image *) NULL)
12051 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12052 write_info=CloneImageInfo(wand->image_info);
12053 write_info->adjoin=adjoin;
12054 status=WriteImages(write_info,wand->images,filename,wand->exception);
12055 if (status == MagickFalse)
12056 InheritException(wand->exception,&wand->images->exception);
12057 write_info=DestroyImageInfo(write_info);
12062 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12066 % M a g i c k W r i t e I m a g e s F i l e %
12070 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12072 % MagickWriteImagesFile() writes an image sequence to an open file descriptor.
12074 % The format of the MagickWriteImagesFile method is:
12076 % MagickBooleanType MagickWriteImagesFile(MagickWand *wand,FILE *file)
12078 % A description of each parameter follows:
12080 % o wand: the magick wand.
12082 % o file: the file descriptor.
12085 WandExport MagickBooleanType MagickWriteImagesFile(MagickWand *wand,FILE *file)
12093 assert(wand != (MagickWand *) NULL);
12094 assert(wand->signature == WandSignature);
12095 if (wand->debug != MagickFalse)
12096 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12097 if (wand->images == (Image *) NULL)
12098 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12099 write_info=CloneImageInfo(wand->image_info);
12100 SetImageInfoFile(write_info,file);
12101 write_info->adjoin=MagickTrue;
12102 status=WriteImages(write_info,wand->images,(const char *) NULL,
12104 write_info=DestroyImageInfo(write_info);
12105 if (status == MagickFalse)
12106 InheritException(wand->exception,&wand->images->exception);