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)
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.
192 WandExport MagickBooleanType MagickAdaptiveBlurImage(MagickWand *wand,
193 const double radius,const double sigma)
198 assert(wand != (MagickWand *) NULL);
199 assert(wand->signature == WandSignature);
200 if (wand->debug != MagickFalse)
201 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
202 if (wand->images == (Image *) NULL)
203 ThrowWandException(WandError,"ContainsNoImages",wand->name);
204 sharp_image=AdaptiveBlurImage(wand->images,radius,sigma,wand->exception);
205 if (sharp_image == (Image *) NULL)
207 ReplaceImageInList(&wand->images,sharp_image);
212 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
216 % 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 %
220 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
222 % MagickAdaptiveResizeImage() adaptively resize image with data dependent
225 % MagickBooleanType MagickAdaptiveResizeImage(MagickWand *wand,
226 % const size_t columns,const size_t rows)
228 % A description of each parameter follows:
230 % o wand: the magick wand.
232 % o columns: the number of columns in the scaled image.
234 % o rows: the number of rows in the scaled image.
237 WandExport MagickBooleanType MagickAdaptiveResizeImage(MagickWand *wand,
238 const size_t columns,const size_t rows)
243 assert(wand != (MagickWand *) NULL);
244 assert(wand->signature == WandSignature);
245 if (wand->debug != MagickFalse)
246 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
247 if (wand->images == (Image *) NULL)
248 ThrowWandException(WandError,"ContainsNoImages",wand->name);
249 resize_image=AdaptiveResizeImage(wand->images,columns,rows,wand->exception);
250 if (resize_image == (Image *) NULL)
252 ReplaceImageInList(&wand->images,resize_image);
257 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
261 % 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 %
265 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
267 % MagickAdaptiveSharpenImage() adaptively sharpens the image by sharpening
268 % more intensely near image edges and less intensely far from edges. We
269 % sharpen the image with a Gaussian operator of the given radius and standard
270 % deviation (sigma). For reasonable results, radius should be larger than
271 % sigma. Use a radius of 0 and MagickAdaptiveSharpenImage() selects a
272 % suitable radius for you.
274 % The format of the MagickAdaptiveSharpenImage method is:
276 % MagickBooleanType MagickAdaptiveSharpenImage(MagickWand *wand,
277 % const double radius,const double sigma)
279 % A description of each parameter follows:
281 % o wand: the magick wand.
283 % o radius: the radius of the Gaussian, in pixels, not counting the center
286 % o sigma: the standard deviation of the Gaussian, in pixels.
289 WandExport MagickBooleanType MagickAdaptiveSharpenImage(MagickWand *wand,
290 const double radius,const double sigma)
295 assert(wand != (MagickWand *) NULL);
296 assert(wand->signature == WandSignature);
297 if (wand->debug != MagickFalse)
298 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
299 if (wand->images == (Image *) NULL)
300 ThrowWandException(WandError,"ContainsNoImages",wand->name);
301 sharp_image=AdaptiveSharpenImage(wand->images,radius,sigma,wand->exception);
302 if (sharp_image == (Image *) NULL)
304 ReplaceImageInList(&wand->images,sharp_image);
309 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
313 % 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 %
317 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
319 % MagickAdaptiveThresholdImage() selects an individual threshold for each pixel
320 % based on the range of intensity values in its local neighborhood. This
321 % allows for thresholding of an image whose global intensity histogram
322 % doesn't contain distinctive peaks.
324 % The format of the AdaptiveThresholdImage method is:
326 % MagickBooleanType MagickAdaptiveThresholdImage(MagickWand *wand,
327 % const size_t width,const size_t height,const ssize_t offset)
329 % A description of each parameter follows:
331 % o wand: the magick wand.
333 % o width: the width of the local neighborhood.
335 % o height: the height of the local neighborhood.
337 % o offset: the mean offset.
340 WandExport MagickBooleanType MagickAdaptiveThresholdImage(MagickWand *wand,
341 const size_t width,const size_t height,const ssize_t offset)
346 assert(wand != (MagickWand *) NULL);
347 assert(wand->signature == WandSignature);
348 if (wand->debug != MagickFalse)
349 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
350 if (wand->images == (Image *) NULL)
351 ThrowWandException(WandError,"ContainsNoImages",wand->name);
352 threshold_image=AdaptiveThresholdImage(wand->images,width,height,offset,
354 if (threshold_image == (Image *) NULL)
356 ReplaceImageInList(&wand->images,threshold_image);
361 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
365 % M a g i c k A d d I m a g e %
369 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
371 % MagickAddImage() adds the specified images at the current image location.
373 % The format of the MagickAddImage method is:
375 % MagickBooleanType MagickAddImage(MagickWand *wand,
376 % const MagickWand *add_wand)
378 % A description of each parameter follows:
380 % o wand: the magick wand.
382 % o add_wand: A wand that contains images to add at the current image
387 static inline MagickBooleanType InsertImageInWand(MagickWand *wand,
393 sentinel=wand->images;
394 if (sentinel == (Image *) NULL)
396 wand->images=GetFirstImageInList(images);
399 if (wand->active == MagickFalse)
401 if ((wand->pend != MagickFalse) && (sentinel->next == (Image *) NULL))
403 AppendImageToList(&sentinel,images);
404 wand->images=GetLastImageInList(images);
407 if ((wand->pend != MagickFalse) && (sentinel->previous == (Image *) NULL))
409 PrependImageToList(&sentinel,images);
410 wand->images=GetFirstImageInList(images);
414 if (sentinel->next == (Image *) NULL)
416 InsertImageInList(&sentinel,images);
417 wand->images=GetLastImageInList(images);
420 InsertImageInList(&sentinel,images);
421 wand->images=GetFirstImageInList(images);
425 WandExport MagickBooleanType MagickAddImage(MagickWand *wand,
426 const MagickWand *add_wand)
431 assert(wand != (MagickWand *) NULL);
432 assert(wand->signature == WandSignature);
433 if (wand->debug != MagickFalse)
434 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
435 assert(add_wand != (MagickWand *) NULL);
436 assert(add_wand->signature == WandSignature);
437 if (add_wand->images == (Image *) NULL)
438 ThrowWandException(WandError,"ContainsNoImages",add_wand->name);
439 images=CloneImageList(add_wand->images,wand->exception);
440 if (images == (Image *) NULL)
442 return(InsertImageInWand(wand,images));
446 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
450 % M a g i c k A d d N o i s e I m a g e %
454 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
456 % MagickAddNoiseImage() adds random noise to the image.
458 % The format of the MagickAddNoiseImage method is:
460 % MagickBooleanType MagickAddNoiseImage(MagickWand *wand,
461 % const NoiseType noise_type)
463 % A description of each parameter follows:
465 % o wand: the magick wand.
467 % o noise_type: The type of noise: Uniform, Gaussian, Multiplicative,
468 % Impulse, Laplacian, or Poisson.
471 WandExport MagickBooleanType MagickAddNoiseImage(MagickWand *wand,
472 const NoiseType noise_type)
477 assert(wand != (MagickWand *) NULL);
478 assert(wand->signature == WandSignature);
479 if (wand->debug != MagickFalse)
480 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
481 if (wand->images == (Image *) NULL)
482 ThrowWandException(WandError,"ContainsNoImages",wand->name);
483 noise_image=AddNoiseImage(wand->images,noise_type,wand->exception);
484 if (noise_image == (Image *) NULL)
486 ReplaceImageInList(&wand->images,noise_image);
491 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
495 % 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 %
499 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
501 % MagickAffineTransformImage() transforms an image as dictated by the affine
502 % matrix of the drawing wand.
504 % The format of the MagickAffineTransformImage method is:
506 % MagickBooleanType MagickAffineTransformImage(MagickWand *wand,
507 % const DrawingWand *drawing_wand)
509 % A description of each parameter follows:
511 % o wand: the magick wand.
513 % o drawing_wand: the draw wand.
516 WandExport MagickBooleanType MagickAffineTransformImage(MagickWand *wand,
517 const DrawingWand *drawing_wand)
525 assert(wand != (MagickWand *) NULL);
526 assert(wand->signature == WandSignature);
527 if (wand->debug != MagickFalse)
528 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
529 if (wand->images == (Image *) NULL)
530 ThrowWandException(WandError,"ContainsNoImages",wand->name);
531 draw_info=PeekDrawingWand(drawing_wand);
532 if (draw_info == (DrawInfo *) NULL)
534 affine_image=AffineTransformImage(wand->images,&draw_info->affine,
536 draw_info=DestroyDrawInfo(draw_info);
537 if (affine_image == (Image *) NULL)
539 ReplaceImageInList(&wand->images,affine_image);
544 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
548 % M a g i c k A n n o t a t e I m a g e %
552 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
554 % MagickAnnotateImage() annotates an image with text.
556 % The format of the MagickAnnotateImage method is:
558 % MagickBooleanType MagickAnnotateImage(MagickWand *wand,
559 % const DrawingWand *drawing_wand,const double x,const double y,
560 % const double angle,const char *text)
562 % A description of each parameter follows:
564 % o wand: the magick wand.
566 % o drawing_wand: the draw wand.
568 % o x: x ordinate to left of text
570 % o y: y ordinate to text baseline
572 % o angle: rotate text relative to this angle.
574 % o text: text to draw
577 WandExport MagickBooleanType MagickAnnotateImage(MagickWand *wand,
578 const DrawingWand *drawing_wand,const double x,const double y,
579 const double angle,const char *text)
582 geometry[MaxTextExtent];
590 assert(wand != (MagickWand *) NULL);
591 assert(wand->signature == WandSignature);
592 if (wand->debug != MagickFalse)
593 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
594 if (wand->images == (Image *) NULL)
595 ThrowWandException(WandError,"ContainsNoImages",wand->name);
596 draw_info=PeekDrawingWand(drawing_wand);
597 if (draw_info == (DrawInfo *) NULL)
599 (void) CloneString(&draw_info->text,text);
600 (void) FormatLocaleString(geometry,MaxTextExtent,"%+g%+g",x,y);
601 draw_info->affine.sx=cos(DegreesToRadians(fmod(angle,360.0)));
602 draw_info->affine.rx=sin(DegreesToRadians(fmod(angle,360.0)));
603 draw_info->affine.ry=(-sin(DegreesToRadians(fmod(angle,360.0))));
604 draw_info->affine.sy=cos(DegreesToRadians(fmod(angle,360.0)));
605 (void) CloneString(&draw_info->geometry,geometry);
606 status=AnnotateImage(wand->images,draw_info);
607 draw_info=DestroyDrawInfo(draw_info);
608 if (status == MagickFalse)
609 InheritException(wand->exception,&wand->images->exception);
614 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
618 % M a g i c k A n i m a t e I m a g e s %
622 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
624 % MagickAnimateImages() animates an image or image sequence.
626 % The format of the MagickAnimateImages method is:
628 % MagickBooleanType MagickAnimateImages(MagickWand *wand,
629 % const char *server_name)
631 % A description of each parameter follows:
633 % o wand: the magick wand.
635 % o server_name: the X server name.
638 WandExport MagickBooleanType MagickAnimateImages(MagickWand *wand,
639 const char *server_name)
644 assert(wand != (MagickWand *) NULL);
645 assert(wand->signature == WandSignature);
646 if (wand->debug != MagickFalse)
647 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
648 (void) CloneString(&wand->image_info->server_name,server_name);
649 status=AnimateImages(wand->image_info,wand->images);
650 if (status == MagickFalse)
651 InheritException(wand->exception,&wand->images->exception);
656 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
660 % M a g i c k A p p e n d I m a g e s %
664 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
666 % MagickAppendImages() append a set of images.
668 % The format of the MagickAppendImages method is:
670 % MagickWand *MagickAppendImages(MagickWand *wand,
671 % const MagickBooleanType stack)
673 % A description of each parameter follows:
675 % o wand: the magick wand.
677 % o stack: By default, images are stacked left-to-right. Set stack to
678 % MagickTrue to stack them top-to-bottom.
681 WandExport MagickWand *MagickAppendImages(MagickWand *wand,
682 const MagickBooleanType stack)
687 assert(wand != (MagickWand *) NULL);
688 assert(wand->signature == WandSignature);
689 if (wand->debug != MagickFalse)
690 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
691 if (wand->images == (Image *) NULL)
692 return((MagickWand *) NULL);
693 append_image=AppendImages(wand->images,stack,wand->exception);
694 if (append_image == (Image *) NULL)
695 return((MagickWand *) NULL);
696 return(CloneMagickWandFromImages(wand,append_image));
700 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
704 % M a g i c k A u t o G a m m a I m a g e %
708 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
710 % MagickAutoGammaImage() extracts the 'mean' from the image and adjust the
711 % image to try make set its gamma appropriatally.
713 % The format of the MagickAutoGammaImage method is:
715 % MagickBooleanType MagickAutoGammaImage(MagickWand *wand)
717 % A description of each parameter follows:
719 % o wand: the magick wand.
722 WandExport MagickBooleanType MagickAutoGammaImage(MagickWand *wand)
727 assert(wand != (MagickWand *) NULL);
728 assert(wand->signature == WandSignature);
729 if (wand->debug != MagickFalse)
730 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
731 if (wand->images == (Image *) NULL)
732 ThrowWandException(WandError,"ContainsNoImages",wand->name);
733 status=AutoGammaImage(wand->images,&wand->images->exception);
738 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
742 % M a g i c k A u t o L e v e l I m a g e %
746 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
748 % MagickAutoLevelImage() adjusts the levels of a particular image channel by
749 % scaling the minimum and maximum values to the full quantum range.
751 % The format of the MagickAutoLevelImage method is:
753 % MagickBooleanType MagickAutoLevelImage(MagickWand *wand)
755 % A description of each parameter follows:
757 % o wand: the magick wand.
760 WandExport MagickBooleanType MagickAutoLevelImage(MagickWand *wand)
765 assert(wand != (MagickWand *) NULL);
766 assert(wand->signature == WandSignature);
767 if (wand->debug != MagickFalse)
768 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
769 if (wand->images == (Image *) NULL)
770 ThrowWandException(WandError,"ContainsNoImages",wand->name);
771 status=AutoLevelImage(wand->images,&wand->images->exception);
776 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
780 % 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 %
784 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
786 % MagickBlackThresholdImage() is like MagickThresholdImage() but forces all
787 % pixels below the threshold into black while leaving all pixels above the
788 % threshold unchanged.
790 % The format of the MagickBlackThresholdImage method is:
792 % MagickBooleanType MagickBlackThresholdImage(MagickWand *wand,
793 % const PixelWand *threshold)
795 % A description of each parameter follows:
797 % o wand: the magick wand.
799 % o threshold: the pixel wand.
802 WandExport MagickBooleanType MagickBlackThresholdImage(MagickWand *wand,
803 const PixelWand *threshold)
806 thresholds[MaxTextExtent];
811 assert(wand != (MagickWand *) NULL);
812 assert(wand->signature == WandSignature);
813 if (wand->debug != MagickFalse)
814 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
815 if (wand->images == (Image *) NULL)
816 ThrowWandException(WandError,"ContainsNoImages",wand->name);
817 (void) FormatLocaleString(thresholds,MaxTextExtent,
818 QuantumFormat "," QuantumFormat "," QuantumFormat "," QuantumFormat,
819 PixelGetRedQuantum(threshold),PixelGetGreenQuantum(threshold),
820 PixelGetBlueQuantum(threshold),PixelGetOpacityQuantum(threshold));
821 status=BlackThresholdImage(wand->images,thresholds,&wand->images->exception);
822 if (status == MagickFalse)
823 InheritException(wand->exception,&wand->images->exception);
828 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
832 % M a g i c k B l u e S h i f t I m a g e %
836 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
838 % MagickBlueShiftImage() mutes the colors of the image to simulate a scene at
839 % nighttime in the moonlight.
841 % The format of the MagickBlueShiftImage method is:
843 % MagickBooleanType MagickBlueShiftImage(MagickWand *wand,
844 % const double factor)
846 % A description of each parameter follows:
848 % o wand: the magick wand.
850 % o factor: the blue shift factor (default 1.5)
853 WandExport MagickBooleanType MagickBlueShiftImage(MagickWand *wand,
859 assert(wand != (MagickWand *) NULL);
860 assert(wand->signature == WandSignature);
861 if (wand->debug != MagickFalse)
862 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
863 if (wand->images == (Image *) NULL)
864 ThrowWandException(WandError,"ContainsNoImages",wand->name);
865 shift_image=BlueShiftImage(wand->images,factor,wand->exception);
866 if (shift_image == (Image *) NULL)
868 ReplaceImageInList(&wand->images,shift_image);
873 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
877 % M a g i c k B l u r I m a g e %
881 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
883 % MagickBlurImage() blurs an image. We convolve the image with a
884 % gaussian operator of the given radius and standard deviation (sigma).
885 % For reasonable results, the radius should be larger than sigma. Use a
886 % radius of 0 and BlurImage() selects a suitable radius for you.
888 % The format of the MagickBlurImage method is:
890 % MagickBooleanType MagickBlurImage(MagickWand *wand,const double radius,
891 % const double sigma)
893 % A description of each parameter follows:
895 % o wand: the magick wand.
897 % o radius: the radius of the , in pixels, not counting the center
900 % o sigma: the standard deviation of the , in pixels.
903 WandExport MagickBooleanType MagickBlurImage(MagickWand *wand,
904 const double radius,const double sigma)
909 assert(wand != (MagickWand *) NULL);
910 assert(wand->signature == WandSignature);
911 if (wand->debug != MagickFalse)
912 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
913 if (wand->images == (Image *) NULL)
914 ThrowWandException(WandError,"ContainsNoImages",wand->name);
915 blur_image=BlurImage(wand->images,radius,sigma,wand->exception);
916 if (blur_image == (Image *) NULL)
918 ReplaceImageInList(&wand->images,blur_image);
923 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
927 % M a g i c k B o r d e r I m a g e %
931 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
933 % MagickBorderImage() surrounds the image with a border of the color defined
934 % by the bordercolor pixel wand.
936 % The format of the MagickBorderImage method is:
938 % MagickBooleanType MagickBorderImage(MagickWand *wand,
939 % const PixelWand *bordercolor,const size_t width,
940 % const size_t height)
942 % A description of each parameter follows:
944 % o wand: the magick wand.
946 % o bordercolor: the border color pixel wand.
948 % o width: the border width.
950 % o height: the border height.
953 WandExport MagickBooleanType MagickBorderImage(MagickWand *wand,
954 const PixelWand *bordercolor,const size_t width,
963 assert(wand != (MagickWand *) NULL);
964 assert(wand->signature == WandSignature);
965 if (wand->debug != MagickFalse)
966 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
967 if (wand->images == (Image *) NULL)
968 ThrowWandException(WandError,"ContainsNoImages",wand->name);
969 border_info.width=width;
970 border_info.height=height;
973 PixelGetQuantumPacket(bordercolor,&wand->images->border_color);
974 border_image=BorderImage(wand->images,&border_info,wand->exception);
975 if (border_image == (Image *) NULL)
977 ReplaceImageInList(&wand->images,border_image);
982 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
986 % 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 %
990 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
992 % Use MagickBrightnessContrastImage() to change the brightness and/or contrast
993 % of an image. It converts the brightness and contrast parameters into slope
994 % and intercept and calls a polynomical function to apply to the image.
997 % The format of the MagickBrightnessContrastImage method is:
999 % MagickBooleanType MagickBrightnessContrastImage(MagickWand *wand,
1000 % const double brightness,const double contrast)
1002 % A description of each parameter follows:
1004 % o wand: the magick wand.
1006 % o brightness: the brightness percent (-100 .. 100).
1008 % o contrast: the contrast percent (-100 .. 100).
1011 WandExport MagickBooleanType MagickBrightnessContrastImage(
1012 MagickWand *wand,const double brightness,const double contrast)
1017 assert(wand != (MagickWand *) NULL);
1018 assert(wand->signature == WandSignature);
1019 if (wand->debug != MagickFalse)
1020 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1021 if (wand->images == (Image *) NULL)
1022 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1023 status=BrightnessContrastImage(wand->images,brightness,contrast,
1024 &wand->images->exception);
1029 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1033 % M a g i c k C h a r c o a l I m a g e %
1037 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1039 % MagickCharcoalImage() simulates a charcoal drawing.
1041 % The format of the MagickCharcoalImage method is:
1043 % MagickBooleanType MagickCharcoalImage(MagickWand *wand,
1044 % const double radius,const double sigma)
1046 % A description of each parameter follows:
1048 % o wand: the magick wand.
1050 % o radius: the radius of the Gaussian, in pixels, not counting the center
1053 % o sigma: the standard deviation of the Gaussian, in pixels.
1056 WandExport MagickBooleanType MagickCharcoalImage(MagickWand *wand,
1057 const double radius,const double sigma)
1062 assert(wand != (MagickWand *) NULL);
1063 assert(wand->signature == WandSignature);
1064 if (wand->debug != MagickFalse)
1065 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1066 if (wand->images == (Image *) NULL)
1067 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1068 charcoal_image=CharcoalImage(wand->images,radius,sigma,wand->exception);
1069 if (charcoal_image == (Image *) NULL)
1070 return(MagickFalse);
1071 ReplaceImageInList(&wand->images,charcoal_image);
1076 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1080 % M a g i c k C h o p I m a g e %
1084 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1086 % MagickChopImage() removes a region of an image and collapses the image to
1087 % occupy the removed portion
1089 % The format of the MagickChopImage method is:
1091 % MagickBooleanType MagickChopImage(MagickWand *wand,
1092 % const size_t width,const size_t height,const ssize_t x,
1095 % A description of each parameter follows:
1097 % o wand: the magick wand.
1099 % o width: the region width.
1101 % o height: the region height.
1103 % o x: the region x offset.
1105 % o y: the region y offset.
1109 WandExport MagickBooleanType MagickChopImage(MagickWand *wand,
1110 const size_t width,const size_t height,const ssize_t x,
1119 assert(wand != (MagickWand *) NULL);
1120 assert(wand->signature == WandSignature);
1121 if (wand->debug != MagickFalse)
1122 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1123 if (wand->images == (Image *) NULL)
1124 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1129 chop_image=ChopImage(wand->images,&chop,wand->exception);
1130 if (chop_image == (Image *) NULL)
1131 return(MagickFalse);
1132 ReplaceImageInList(&wand->images,chop_image);
1137 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1141 % M a g i c k C l a m p I m a g e %
1145 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1147 % MagickClampImage() restricts the color range from 0 to the quantum depth.
1149 % The format of the MagickClampImage method is:
1151 % MagickBooleanType MagickClampImage(MagickWand *wand)
1153 % A description of each parameter follows:
1155 % o wand: the magick wand.
1157 % o channel: the channel.
1160 WandExport MagickBooleanType MagickClampImage(MagickWand *wand)
1165 assert(wand != (MagickWand *) NULL);
1166 assert(wand->signature == WandSignature);
1167 if (wand->debug != MagickFalse)
1168 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1169 if (wand->images == (Image *) NULL)
1170 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1171 status=ClampImage(wand->images);
1172 if (status == MagickFalse)
1173 InheritException(wand->exception,&wand->images->exception);
1178 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1182 % M a g i c k C l i p I m a g e %
1186 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1188 % MagickClipImage() clips along the first path from the 8BIM profile, if
1191 % The format of the MagickClipImage method is:
1193 % MagickBooleanType MagickClipImage(MagickWand *wand)
1195 % A description of each parameter follows:
1197 % o wand: the magick wand.
1200 WandExport MagickBooleanType MagickClipImage(MagickWand *wand)
1205 assert(wand != (MagickWand *) NULL);
1206 assert(wand->signature == WandSignature);
1207 if (wand->debug != MagickFalse)
1208 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1209 if (wand->images == (Image *) NULL)
1210 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1211 status=ClipImage(wand->images);
1212 if (status == MagickFalse)
1213 InheritException(wand->exception,&wand->images->exception);
1218 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1222 % M a g i c k C l i p I m a g e P a t h %
1226 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1228 % MagickClipImagePath() clips along the named paths from the 8BIM profile, if
1229 % present. Later operations take effect inside the path. Id may be a number
1230 % if preceded with #, to work on a numbered path, e.g., "#1" to use the first
1233 % The format of the MagickClipImagePath method is:
1235 % MagickBooleanType MagickClipImagePath(MagickWand *wand,
1236 % const char *pathname,const MagickBooleanType inside)
1238 % A description of each parameter follows:
1240 % o wand: the magick wand.
1242 % o pathname: name of clipping path resource. If name is preceded by #, use
1243 % clipping path numbered by name.
1245 % o inside: if non-zero, later operations take effect inside clipping path.
1246 % Otherwise later operations take effect outside clipping path.
1249 WandExport MagickBooleanType MagickClipImagePath(MagickWand *wand,
1250 const char *pathname,const MagickBooleanType inside)
1255 assert(wand != (MagickWand *) NULL);
1256 assert(wand->signature == WandSignature);
1257 if (wand->debug != MagickFalse)
1258 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1259 if (wand->images == (Image *) NULL)
1260 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1261 status=ClipImagePath(wand->images,pathname,inside);
1262 if (status == MagickFalse)
1263 InheritException(wand->exception,&wand->images->exception);
1268 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1272 % M a g i c k C l u t I m a g e %
1276 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1278 % MagickClutImage() replaces colors in the image from a color lookup table.
1280 % The format of the MagickClutImage method is:
1282 % MagickBooleanType MagickClutImage(MagickWand *wand,
1283 % const MagickWand *clut_wand)
1285 % A description of each parameter follows:
1287 % o wand: the magick wand.
1289 % o clut_image: the clut image.
1292 WandExport MagickBooleanType MagickClutImage(MagickWand *wand,
1293 const MagickWand *clut_wand)
1298 assert(wand != (MagickWand *) NULL);
1299 assert(wand->signature == WandSignature);
1300 if (wand->debug != MagickFalse)
1301 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1302 if ((wand->images == (Image *) NULL) || (clut_wand->images == (Image *) NULL))
1303 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1304 status=ClutImage(wand->images,clut_wand->images,&wand->images->exception);
1309 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1313 % M a g i c k C o a l e s c e I m a g e s %
1317 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1319 % MagickCoalesceImages() composites a set of images while respecting any page
1320 % offsets and disposal methods. GIF, MIFF, and MNG animation sequences
1321 % typically start with an image background and each subsequent image
1322 % varies in size and offset. MagickCoalesceImages() returns a new sequence
1323 % where each image in the sequence is the same size as the first and
1324 % composited with the next image in the sequence.
1326 % The format of the MagickCoalesceImages method is:
1328 % MagickWand *MagickCoalesceImages(MagickWand *wand)
1330 % A description of each parameter follows:
1332 % o wand: the magick wand.
1335 WandExport MagickWand *MagickCoalesceImages(MagickWand *wand)
1340 assert(wand != (MagickWand *) NULL);
1341 assert(wand->signature == WandSignature);
1342 if (wand->debug != MagickFalse)
1343 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1344 if (wand->images == (Image *) NULL)
1345 return((MagickWand *) NULL);
1346 coalesce_image=CoalesceImages(wand->images,wand->exception);
1347 if (coalesce_image == (Image *) NULL)
1348 return((MagickWand *) NULL);
1349 return(CloneMagickWandFromImages(wand,coalesce_image));
1353 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1357 % M a g i c k C o l o r D e c i s i o n I m a g e %
1361 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1363 % MagickColorDecisionListImage() accepts a lightweight Color Correction
1364 % Collection (CCC) file which solely contains one or more color corrections
1365 % and applies the color correction to the image. Here is a sample CCC file:
1367 % <ColorCorrectionCollection xmlns="urn:ASC:CDL:v1.2">
1368 % <ColorCorrection id="cc03345">
1370 % <Slope> 0.9 1.2 0.5 </Slope>
1371 % <Offset> 0.4 -0.5 0.6 </Offset>
1372 % <Power> 1.0 0.8 1.5 </Power>
1375 % <Saturation> 0.85 </Saturation>
1377 % </ColorCorrection>
1378 % </ColorCorrectionCollection>
1380 % which includes the offset, slope, and power for each of the RGB channels
1381 % as well as the saturation.
1383 % The format of the MagickColorDecisionListImage method is:
1385 % MagickBooleanType MagickColorDecisionListImage(MagickWand *wand,
1386 % const double gamma)
1388 % A description of each parameter follows:
1390 % o wand: the magick wand.
1392 % o color_correction_collection: the color correction collection in XML.
1395 WandExport MagickBooleanType MagickColorDecisionListImage(MagickWand *wand,
1396 const char *color_correction_collection)
1401 assert(wand != (MagickWand *) NULL);
1402 assert(wand->signature == WandSignature);
1403 if (wand->debug != MagickFalse)
1404 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1405 if (wand->images == (Image *) NULL)
1406 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1407 status=ColorDecisionListImage(wand->images,color_correction_collection);
1408 if (status == MagickFalse)
1409 InheritException(wand->exception,&wand->images->exception);
1414 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1418 % M a g i c k C o l o r i z e I m a g e %
1422 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1424 % MagickColorizeImage() blends the fill color with each pixel in the image.
1426 % The format of the MagickColorizeImage method is:
1428 % MagickBooleanType MagickColorizeImage(MagickWand *wand,
1429 % const PixelWand *colorize,const PixelWand *opacity)
1431 % A description of each parameter follows:
1433 % o wand: the magick wand.
1435 % o colorize: the colorize pixel wand.
1437 % o opacity: the opacity pixel wand.
1440 WandExport MagickBooleanType MagickColorizeImage(MagickWand *wand,
1441 const PixelWand *colorize,const PixelWand *opacity)
1444 percent_opaque[MaxTextExtent];
1452 assert(wand != (MagickWand *) NULL);
1453 assert(wand->signature == WandSignature);
1454 if (wand->debug != MagickFalse)
1455 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1456 if (wand->images == (Image *) NULL)
1457 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1458 (void) FormatLocaleString(percent_opaque,MaxTextExtent,
1459 "%g,%g,%g,%g",(double) (100.0*QuantumScale*
1460 PixelGetRedQuantum(opacity)),(double) (100.0*QuantumScale*
1461 PixelGetGreenQuantum(opacity)),(double) (100.0*QuantumScale*
1462 PixelGetBlueQuantum(opacity)),(double) (100.0*QuantumScale*
1463 PixelGetOpacityQuantum(opacity)));
1464 PixelGetQuantumPacket(colorize,&target);
1465 colorize_image=ColorizeImage(wand->images,percent_opaque,target,
1467 if (colorize_image == (Image *) NULL)
1468 return(MagickFalse);
1469 ReplaceImageInList(&wand->images,colorize_image);
1474 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1478 % M a g i c k C o l o r M a t r i x I m a g e %
1482 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1484 % MagickColorMatrixImage() apply color transformation to an image. The method
1485 % permits saturation changes, hue rotation, luminance to alpha, and various
1486 % other effects. Although variable-sized transformation matrices can be used,
1487 % typically one uses a 5x5 matrix for an RGBA image and a 6x6 for CMYKA
1488 % (or RGBA with offsets). The matrix is similar to those used by Adobe Flash
1489 % except offsets are in column 6 rather than 5 (in support of CMYKA images)
1490 % and offsets are normalized (divide Flash offset by 255).
1492 % The format of the MagickColorMatrixImage method is:
1494 % MagickBooleanType MagickColorMatrixImage(MagickWand *wand,
1495 % const KernelInfo *color_matrix)
1497 % A description of each parameter follows:
1499 % o wand: the magick wand.
1501 % o color_matrix: the color matrix.
1504 WandExport MagickBooleanType MagickColorMatrixImage(MagickWand *wand,
1505 const KernelInfo *color_matrix)
1510 assert(wand != (MagickWand *) NULL);
1511 assert(wand->signature == WandSignature);
1512 if (wand->debug != MagickFalse)
1513 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1514 if (color_matrix == (const KernelInfo *) NULL)
1515 return(MagickFalse);
1516 if (wand->images == (Image *) NULL)
1517 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1518 color_image=ColorMatrixImage(wand->images,color_matrix,wand->exception);
1519 if (color_image == (Image *) NULL)
1520 return(MagickFalse);
1521 ReplaceImageInList(&wand->images,color_image);
1526 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1530 % M a g i c k C o m b i n e I m a g e s %
1534 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1536 % MagickCombineImages() combines one or more images into a single image. The
1537 % grayscale value of the pixels of each image in the sequence is assigned in
1538 % order to the specified hannels of the combined image. The typical
1539 % ordering would be image 1 => Red, 2 => Green, 3 => Blue, etc.
1541 % The format of the MagickCombineImages method is:
1543 % MagickWand *MagickCombineImages(MagickWand *wand)
1545 % A description of each parameter follows:
1547 % o wand: the magick wand.
1550 WandExport MagickWand *MagickCombineImages(MagickWand *wand)
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 (wand->images == (Image *) NULL)
1560 return((MagickWand *) NULL);
1561 combine_image=CombineImages(wand->images,wand->exception);
1562 if (combine_image == (Image *) NULL)
1563 return((MagickWand *) NULL);
1564 return(CloneMagickWandFromImages(wand,combine_image));
1568 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1572 % M a g i c k C o m m e n t I m a g e %
1576 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1578 % MagickCommentImage() adds a comment to your image.
1580 % The format of the MagickCommentImage method is:
1582 % MagickBooleanType MagickCommentImage(MagickWand *wand,
1583 % const char *comment)
1585 % A description of each parameter follows:
1587 % o wand: the magick wand.
1589 % o comment: the image comment.
1592 WandExport MagickBooleanType MagickCommentImage(MagickWand *wand,
1593 const char *comment)
1598 assert(wand != (MagickWand *) NULL);
1599 assert(wand->signature == WandSignature);
1600 if (wand->debug != MagickFalse)
1601 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1602 if (wand->images == (Image *) NULL)
1603 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1604 status=SetImageProperty(wand->images,"comment",comment);
1605 if (status == MagickFalse)
1606 InheritException(wand->exception,&wand->images->exception);
1611 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1615 % M a g i c k C o m p a r e I m a g e L a y e r s %
1619 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1621 % MagickCompareImagesLayers() compares each image with the next in a sequence
1622 % and returns the maximum bounding region of any pixel differences it
1625 % The format of the MagickCompareImagesLayers method is:
1627 % MagickWand *MagickCompareImagesLayers(MagickWand *wand,
1628 % const ImageLayerMethod method)
1630 % A description of each parameter follows:
1632 % o wand: the magick wand.
1634 % o method: the compare method.
1637 WandExport MagickWand *MagickCompareImagesLayers(MagickWand *wand,
1638 const ImageLayerMethod method)
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 return((MagickWand *) NULL);
1649 layers_image=CompareImagesLayers(wand->images,method,wand->exception);
1650 if (layers_image == (Image *) NULL)
1651 return((MagickWand *) NULL);
1652 return(CloneMagickWandFromImages(wand,layers_image));
1656 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1660 % M a g i c k C o m p a r e I m a g e s %
1664 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1666 % MagickCompareImages() compares an image to a reconstructed image and returns
1667 % the specified difference image.
1669 % The format of the MagickCompareImages method is:
1671 % MagickWand *MagickCompareImages(MagickWand *wand,
1672 % const MagickWand *reference,const MetricType metric,
1673 % double *distortion)
1675 % A description of each parameter follows:
1677 % o wand: the magick wand.
1679 % o reference: the reference wand.
1681 % o metric: the metric.
1683 % o distortion: the computed distortion between the images.
1686 WandExport MagickWand *MagickCompareImages(MagickWand *wand,
1687 const MagickWand *reference,const MetricType metric,double *distortion)
1693 assert(wand != (MagickWand *) NULL);
1694 assert(wand->signature == WandSignature);
1695 if (wand->debug != MagickFalse)
1696 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1697 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
1699 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
1700 "ContainsNoImages","`%s'",wand->name);
1701 return((MagickWand *) NULL);
1703 compare_image=CompareImages(wand->images,reference->images,metric,distortion,
1704 &wand->images->exception);
1705 if (compare_image == (Image *) NULL)
1706 return((MagickWand *) NULL);
1707 return(CloneMagickWandFromImages(wand,compare_image));
1711 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1715 % M a g i c k C o m p o s i t e I m a g e %
1719 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1721 % MagickCompositeImage() composite one image onto another at the specified
1724 % The format of the MagickCompositeImage method is:
1726 % MagickBooleanType MagickCompositeImage(MagickWand *wand,
1727 % const MagickWand *composite_wand,const CompositeOperator compose,
1728 % const ssize_t x,const ssize_t y)
1730 % A description of each parameter follows:
1732 % o wand: the magick wand.
1734 % o composite_image: the composite image.
1736 % o compose: This operator affects how the composite is applied to the
1737 % image. The default is Over. Choose from these operators:
1739 % OverCompositeOp InCompositeOp OutCompositeOp
1740 % AtopCompositeOp XorCompositeOp PlusCompositeOp
1741 % MinusCompositeOp AddCompositeOp SubtractCompositeOp
1742 % DifferenceCompositeOp BumpmapCompositeOp CopyCompositeOp
1743 % DisplaceCompositeOp
1745 % o x: the column offset of the composited image.
1747 % o y: the row offset of the composited image.
1750 WandExport MagickBooleanType MagickCompositeImage(MagickWand *wand,
1751 const MagickWand *composite_wand,const CompositeOperator compose,
1752 const ssize_t x,const ssize_t y)
1757 assert(wand != (MagickWand *) NULL);
1758 assert(wand->signature == WandSignature);
1759 if (wand->debug != MagickFalse)
1760 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1761 if ((wand->images == (Image *) NULL) ||
1762 (composite_wand->images == (Image *) NULL))
1763 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1764 status=CompositeImage(wand->images,compose,composite_wand->images,x,y);
1765 if (status == MagickFalse)
1766 InheritException(wand->exception,&wand->images->exception);
1771 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1775 % M a g i c k C o n t r a s t I m a g e %
1779 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1781 % MagickContrastImage() enhances the intensity differences between the lighter
1782 % and darker elements of the image. Set sharpen to a value other than 0 to
1783 % increase the image contrast otherwise the contrast is reduced.
1785 % The format of the MagickContrastImage method is:
1787 % MagickBooleanType MagickContrastImage(MagickWand *wand,
1788 % const MagickBooleanType sharpen)
1790 % A description of each parameter follows:
1792 % o wand: the magick wand.
1794 % o sharpen: Increase or decrease image contrast.
1798 WandExport MagickBooleanType MagickContrastImage(MagickWand *wand,
1799 const MagickBooleanType sharpen)
1804 assert(wand != (MagickWand *) NULL);
1805 assert(wand->signature == WandSignature);
1806 if (wand->debug != MagickFalse)
1807 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1808 if (wand->images == (Image *) NULL)
1809 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1810 status=ContrastImage(wand->images,sharpen);
1811 if (status == MagickFalse)
1812 InheritException(wand->exception,&wand->images->exception);
1817 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1821 % 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 %
1825 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1827 % MagickContrastStretchImage() enhances the contrast of a color image by
1828 % adjusting the pixels color to span the entire range of colors available.
1829 % You can also reduce the influence of a particular channel with a gamma
1832 % The format of the MagickContrastStretchImage method is:
1834 % MagickBooleanType MagickContrastStretchImage(MagickWand *wand,
1835 % const double black_point,const double white_point)
1837 % A description of each parameter follows:
1839 % o wand: the magick wand.
1841 % o black_point: the black point.
1843 % o white_point: the white point.
1846 WandExport MagickBooleanType MagickContrastStretchImage(MagickWand *wand,
1847 const double black_point,const double white_point)
1852 assert(wand != (MagickWand *) NULL);
1853 assert(wand->signature == WandSignature);
1854 if (wand->debug != MagickFalse)
1855 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1856 if (wand->images == (Image *) NULL)
1857 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1858 status=ContrastStretchImage(wand->images,black_point,white_point);
1859 if (status == MagickFalse)
1860 InheritException(wand->exception,&wand->images->exception);
1865 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1869 % M a g i c k C o n v o l v e I m a g e %
1873 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1875 % MagickConvolveImage() applies a custom convolution kernel to the image.
1877 % The format of the MagickConvolveImage method is:
1879 % MagickBooleanType MagickConvolveImage(MagickWand *wand,
1880 % const KernelInfo *kernel)
1882 % A description of each parameter follows:
1884 % o wand: the magick wand.
1886 % o kernel: An array of doubles representing the convolution kernel.
1889 WandExport MagickBooleanType MagickConvolveImage(MagickWand *wand,
1890 const KernelInfo *kernel)
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 (kernel == (const KernelInfo *) NULL)
1900 return(MagickFalse);
1901 if (wand->images == (Image *) NULL)
1902 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1903 filter_image=ConvolveImage(wand->images,kernel,wand->exception);
1904 if (filter_image == (Image *) NULL)
1905 return(MagickFalse);
1906 ReplaceImageInList(&wand->images,filter_image);
1911 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1915 % M a g i c k C r o p I m a g e %
1919 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1921 % MagickCropImage() extracts a region of the image.
1923 % The format of the MagickCropImage method is:
1925 % MagickBooleanType MagickCropImage(MagickWand *wand,
1926 % const size_t width,const size_t height,const ssize_t x,const ssize_t y)
1928 % A description of each parameter follows:
1930 % o wand: the magick wand.
1932 % o width: the region width.
1934 % o height: the region height.
1936 % o x: the region x-offset.
1938 % o y: the region y-offset.
1941 WandExport MagickBooleanType MagickCropImage(MagickWand *wand,
1942 const size_t width,const size_t height,const ssize_t x,const ssize_t y)
1950 assert(wand != (MagickWand *) NULL);
1951 assert(wand->signature == WandSignature);
1952 if (wand->debug != MagickFalse)
1953 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1954 if (wand->images == (Image *) NULL)
1955 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1960 crop_image=CropImage(wand->images,&crop,wand->exception);
1961 if (crop_image == (Image *) NULL)
1962 return(MagickFalse);
1963 ReplaceImageInList(&wand->images,crop_image);
1968 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1972 % M a g i c k C y c l e C o l o r m a p I m a g e %
1976 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1978 % MagickCycleColormapImage() displaces an image's colormap by a given number
1979 % of positions. If you cycle the colormap a number of times you can produce
1980 % a psychodelic effect.
1982 % The format of the MagickCycleColormapImage method is:
1984 % MagickBooleanType MagickCycleColormapImage(MagickWand *wand,
1985 % const ssize_t displace)
1987 % A description of each parameter follows:
1989 % o wand: the magick wand.
1991 % o pixel_wand: the pixel wand.
1994 WandExport MagickBooleanType MagickCycleColormapImage(MagickWand *wand,
1995 const ssize_t displace)
2000 assert(wand != (MagickWand *) NULL);
2001 assert(wand->signature == WandSignature);
2002 if (wand->debug != MagickFalse)
2003 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2004 if (wand->images == (Image *) NULL)
2005 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2006 status=CycleColormapImage(wand->images,displace);
2007 if (status == MagickFalse)
2008 InheritException(wand->exception,&wand->images->exception);
2013 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2017 % M a g i c k C o n s t i t u t e I m a g e %
2021 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2023 % MagickConstituteImage() adds an image to the wand comprised of the pixel
2024 % data you supply. The pixel data must be in scanline order top-to-bottom.
2025 % The data can be char, short int, int, float, or double. Float and double
2026 % require the pixels to be normalized [0..1], otherwise [0..Max], where Max
2027 % is the maximum value the type can accomodate (e.g. 255 for char). For
2028 % example, to create a 640x480 image from unsigned red-green-blue character
2031 % MagickConstituteImage(wand,640,640,"RGB",CharPixel,pixels);
2033 % The format of the MagickConstituteImage method is:
2035 % MagickBooleanType MagickConstituteImage(MagickWand *wand,
2036 % const size_t columns,const size_t rows,const char *map,
2037 % const StorageType storage,void *pixels)
2039 % A description of each parameter follows:
2041 % o wand: the magick wand.
2043 % o columns: width in pixels of the image.
2045 % o rows: height in pixels of the image.
2047 % o map: This string reflects the expected ordering of the pixel array.
2048 % It can be any combination or order of R = red, G = green, B = blue,
2049 % A = alpha (0 is transparent), O = opacity (0 is opaque), C = cyan,
2050 % Y = yellow, M = magenta, K = black, I = intensity (for grayscale),
2053 % o storage: Define the data type of the pixels. Float and double types are
2054 % expected to be normalized [0..1] otherwise [0..QuantumRange]. Choose from
2055 % these types: CharPixel, DoublePixel, FloatPixel, IntegerPixel,
2056 % LongPixel, QuantumPixel, or ShortPixel.
2058 % o pixels: This array of values contain the pixel components as defined by
2059 % map and type. You must preallocate this array where the expected
2060 % length varies depending on the values of width, height, map, and type.
2064 WandExport MagickBooleanType MagickConstituteImage(MagickWand *wand,
2065 const size_t columns,const size_t rows,const char *map,
2066 const StorageType storage,const void *pixels)
2071 assert(wand != (MagickWand *) NULL);
2072 assert(wand->signature == WandSignature);
2073 if (wand->debug != MagickFalse)
2074 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2075 images=ConstituteImage(columns,rows,map,storage,pixels,wand->exception);
2076 if (images == (Image *) NULL)
2077 return(MagickFalse);
2078 return(InsertImageInWand(wand,images));
2082 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2086 % M a g i c k D e c i p h e r I m a g e %
2090 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2092 % MagickDecipherImage() converts cipher pixels to plain pixels.
2094 % The format of the MagickDecipherImage method is:
2096 % MagickBooleanType MagickDecipherImage(MagickWand *wand,
2097 % const char *passphrase)
2099 % A description of each parameter follows:
2101 % o wand: the magick wand.
2103 % o passphrase: the passphrase.
2106 WandExport MagickBooleanType MagickDecipherImage(MagickWand *wand,
2107 const char *passphrase)
2109 assert(wand != (MagickWand *) NULL);
2110 assert(wand->signature == WandSignature);
2111 if (wand->debug != MagickFalse)
2112 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2113 if (wand->images == (Image *) NULL)
2114 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2115 return(DecipherImage(wand->images,passphrase,&wand->images->exception));
2119 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2123 % M a g i c k D e c o n s t r u c t I m a g e s %
2127 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2129 % MagickDeconstructImages() compares each image with the next in a sequence
2130 % and returns the maximum bounding region of any pixel differences it
2133 % The format of the MagickDeconstructImages method is:
2135 % MagickWand *MagickDeconstructImages(MagickWand *wand)
2137 % A description of each parameter follows:
2139 % o wand: the magick wand.
2142 WandExport MagickWand *MagickDeconstructImages(MagickWand *wand)
2147 assert(wand != (MagickWand *) NULL);
2148 assert(wand->signature == WandSignature);
2149 if (wand->debug != MagickFalse)
2150 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2151 if (wand->images == (Image *) NULL)
2152 return((MagickWand *) NULL);
2153 deconstruct_image=CompareImagesLayers(wand->images,CompareAnyLayer,
2155 if (deconstruct_image == (Image *) NULL)
2156 return((MagickWand *) NULL);
2157 return(CloneMagickWandFromImages(wand,deconstruct_image));
2161 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2165 % M a g i c k D e s k e w I m a g e %
2169 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2171 % MagickDeskewImage() removes skew from the image. Skew is an artifact that
2172 % occurs in scanned images because of the camera being misaligned,
2173 % imperfections in the scanning or surface, or simply because the paper was
2174 % not placed completely flat when scanned.
2176 % The format of the MagickDeskewImage method is:
2178 % MagickBooleanType MagickDeskewImage(MagickWand *wand,
2179 % const double threshold)
2181 % A description of each parameter follows:
2183 % o wand: the magick wand.
2185 % o threshold: separate background from foreground.
2188 WandExport MagickBooleanType MagickDeskewImage(MagickWand *wand,
2189 const double threshold)
2194 assert(wand != (MagickWand *) NULL);
2195 assert(wand->signature == WandSignature);
2196 if (wand->debug != MagickFalse)
2197 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2198 if (wand->images == (Image *) NULL)
2199 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2200 sepia_image=DeskewImage(wand->images,threshold,wand->exception);
2201 if (sepia_image == (Image *) NULL)
2202 return(MagickFalse);
2203 ReplaceImageInList(&wand->images,sepia_image);
2208 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2212 % M a g i c k D e s p e c k l e I m a g e %
2216 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2218 % MagickDespeckleImage() reduces the speckle noise in an image while
2219 % perserving the edges of the original image.
2221 % The format of the MagickDespeckleImage method is:
2223 % MagickBooleanType MagickDespeckleImage(MagickWand *wand)
2225 % A description of each parameter follows:
2227 % o wand: the magick wand.
2230 WandExport MagickBooleanType MagickDespeckleImage(MagickWand *wand)
2235 assert(wand != (MagickWand *) NULL);
2236 assert(wand->signature == WandSignature);
2237 if (wand->debug != MagickFalse)
2238 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2239 if (wand->images == (Image *) NULL)
2240 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2241 despeckle_image=DespeckleImage(wand->images,wand->exception);
2242 if (despeckle_image == (Image *) NULL)
2243 return(MagickFalse);
2244 ReplaceImageInList(&wand->images,despeckle_image);
2249 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2253 % M a g i c k D e s t r o y I m a g e %
2257 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2259 % MagickDestroyImage() dereferences an image, deallocating memory associated
2260 % with the image if the reference count becomes zero.
2262 % The format of the MagickDestroyImage method is:
2264 % Image *MagickDestroyImage(Image *image)
2266 % A description of each parameter follows:
2268 % o image: the image.
2271 WandExport Image *MagickDestroyImage(Image *image)
2273 return(DestroyImage(image));
2277 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2281 % M a g i c k D i s p l a y I m a g e %
2285 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2287 % MagickDisplayImage() displays an image.
2289 % The format of the MagickDisplayImage method is:
2291 % MagickBooleanType MagickDisplayImage(MagickWand *wand,
2292 % const char *server_name)
2294 % A description of each parameter follows:
2296 % o wand: the magick wand.
2298 % o server_name: the X server name.
2301 WandExport MagickBooleanType MagickDisplayImage(MagickWand *wand,
2302 const char *server_name)
2310 assert(wand != (MagickWand *) NULL);
2311 assert(wand->signature == WandSignature);
2312 if (wand->debug != MagickFalse)
2313 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2314 if (wand->images == (Image *) NULL)
2315 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2316 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
2317 if (image == (Image *) NULL)
2318 return(MagickFalse);
2319 (void) CloneString(&wand->image_info->server_name,server_name);
2320 status=DisplayImages(wand->image_info,image);
2321 if (status == MagickFalse)
2322 InheritException(wand->exception,&image->exception);
2323 image=DestroyImage(image);
2328 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2332 % M a g i c k D i s p l a y I m a g e s %
2336 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2338 % MagickDisplayImages() displays an image or image sequence.
2340 % The format of the MagickDisplayImages method is:
2342 % MagickBooleanType MagickDisplayImages(MagickWand *wand,
2343 % const char *server_name)
2345 % A description of each parameter follows:
2347 % o wand: the magick wand.
2349 % o server_name: the X server name.
2352 WandExport MagickBooleanType MagickDisplayImages(MagickWand *wand,
2353 const char *server_name)
2358 assert(wand != (MagickWand *) NULL);
2359 assert(wand->signature == WandSignature);
2360 if (wand->debug != MagickFalse)
2361 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2362 (void) CloneString(&wand->image_info->server_name,server_name);
2363 status=DisplayImages(wand->image_info,wand->images);
2364 if (status == MagickFalse)
2365 InheritException(wand->exception,&wand->images->exception);
2370 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2374 % M a g i c k D i s t o r t I m a g e %
2378 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2380 % MagickDistortImage() distorts an image using various distortion methods, by
2381 % mapping color lookups of the source image to a new destination image
2382 % usally of the same size as the source image, unless 'bestfit' is set to
2385 % If 'bestfit' is enabled, and distortion allows it, the destination image is
2386 % adjusted to ensure the whole source 'image' will just fit within the final
2387 % destination image, which will be sized and offset accordingly. Also in
2388 % many cases the virtual offset of the source image will be taken into
2389 % account in the mapping.
2391 % The format of the MagickDistortImage method is:
2393 % MagickBooleanType MagickDistortImage(MagickWand *wand,
2394 % const DistortImageMethod method,const size_t number_arguments,
2395 % const double *arguments,const MagickBooleanType bestfit)
2397 % A description of each parameter follows:
2399 % o image: the image to be distorted.
2401 % o method: the method of image distortion.
2403 % ArcDistortion always ignores the source image offset, and always
2404 % 'bestfit' the destination image with the top left corner offset
2405 % relative to the polar mapping center.
2407 % Bilinear has no simple inverse mapping so it does not allow 'bestfit'
2408 % style of image distortion.
2410 % Affine, Perspective, and Bilinear, do least squares fitting of the
2411 % distortion when more than the minimum number of control point pairs
2414 % Perspective, and Bilinear, falls back to a Affine distortion when less
2415 % that 4 control point pairs are provided. While Affine distortions let
2416 % you use any number of control point pairs, that is Zero pairs is a
2417 % no-Op (viewport only) distrotion, one pair is a translation and two
2418 % pairs of control points do a scale-rotate-translate, without any
2421 % o number_arguments: the number of arguments given for this distortion
2424 % o arguments: the arguments for this distortion method.
2426 % o bestfit: Attempt to resize destination to fit distorted source.
2429 WandExport MagickBooleanType MagickDistortImage(MagickWand *wand,
2430 const DistortImageMethod method,const size_t number_arguments,
2431 const double *arguments,const MagickBooleanType bestfit)
2436 assert(wand != (MagickWand *) NULL);
2437 assert(wand->signature == WandSignature);
2438 if (wand->debug != MagickFalse)
2439 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2440 if (wand->images == (Image *) NULL)
2441 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2442 distort_image=DistortImage(wand->images,method,number_arguments,arguments,
2443 bestfit,wand->exception);
2444 if (distort_image == (Image *) NULL)
2445 return(MagickFalse);
2446 ReplaceImageInList(&wand->images,distort_image);
2451 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2455 % M a g i c k D r a w I m a g e %
2459 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2461 % MagickDrawImage() renders the drawing wand on the current image.
2463 % The format of the MagickDrawImage method is:
2465 % MagickBooleanType MagickDrawImage(MagickWand *wand,
2466 % const DrawingWand *drawing_wand)
2468 % A description of each parameter follows:
2470 % o wand: the magick wand.
2472 % o drawing_wand: the draw wand.
2475 WandExport MagickBooleanType MagickDrawImage(MagickWand *wand,
2476 const DrawingWand *drawing_wand)
2487 assert(wand != (MagickWand *) NULL);
2488 assert(wand->signature == WandSignature);
2489 if (wand->debug != MagickFalse)
2490 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2491 if (wand->images == (Image *) NULL)
2492 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2493 draw_info=PeekDrawingWand(drawing_wand);
2494 if ((draw_info == (DrawInfo *) NULL) ||
2495 (draw_info->primitive == (char *) NULL))
2496 return(MagickFalse);
2497 primitive=AcquireString(draw_info->primitive);
2498 draw_info=DestroyDrawInfo(draw_info);
2499 draw_info=CloneDrawInfo(wand->image_info,(DrawInfo *) NULL);
2500 draw_info->primitive=primitive;
2501 status=DrawImage(wand->images,draw_info);
2502 if (status == MagickFalse)
2503 InheritException(wand->exception,&wand->images->exception);
2504 draw_info=DestroyDrawInfo(draw_info);
2509 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2513 % M a g i c k E d g e I m a g e %
2517 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2519 % MagickEdgeImage() enhance edges within the image with a convolution filter
2520 % of the given radius. Use a radius of 0 and Edge() selects a suitable
2523 % The format of the MagickEdgeImage method is:
2525 % MagickBooleanType MagickEdgeImage(MagickWand *wand,const double radius)
2527 % A description of each parameter follows:
2529 % o wand: the magick wand.
2531 % o radius: the radius of the pixel neighborhood.
2534 WandExport MagickBooleanType MagickEdgeImage(MagickWand *wand,
2535 const double radius)
2540 assert(wand != (MagickWand *) NULL);
2541 assert(wand->signature == WandSignature);
2542 if (wand->debug != MagickFalse)
2543 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2544 if (wand->images == (Image *) NULL)
2545 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2546 edge_image=EdgeImage(wand->images,radius,wand->exception);
2547 if (edge_image == (Image *) NULL)
2548 return(MagickFalse);
2549 ReplaceImageInList(&wand->images,edge_image);
2554 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2558 % M a g i c k E m b o s s I m a g e %
2562 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2564 % MagickEmbossImage() returns a grayscale image with a three-dimensional
2565 % effect. We convolve the image with a Gaussian operator of the given radius
2566 % and standard deviation (sigma). For reasonable results, radius should be
2567 % larger than sigma. Use a radius of 0 and Emboss() selects a suitable
2570 % The format of the MagickEmbossImage method is:
2572 % MagickBooleanType MagickEmbossImage(MagickWand *wand,const double radius,
2573 % const double sigma)
2575 % A description of each parameter follows:
2577 % o wand: the magick wand.
2579 % o radius: the radius of the Gaussian, in pixels, not counting the center
2582 % o sigma: the standard deviation of the Gaussian, in pixels.
2585 WandExport MagickBooleanType MagickEmbossImage(MagickWand *wand,
2586 const double radius,const double sigma)
2591 assert(wand != (MagickWand *) NULL);
2592 assert(wand->signature == WandSignature);
2593 if (wand->debug != MagickFalse)
2594 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2595 if (wand->images == (Image *) NULL)
2596 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2597 emboss_image=EmbossImage(wand->images,radius,sigma,wand->exception);
2598 if (emboss_image == (Image *) NULL)
2599 return(MagickFalse);
2600 ReplaceImageInList(&wand->images,emboss_image);
2605 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2609 % M a g i c k E n c i p h e r I m a g e %
2613 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2615 % MagickEncipherImage() converts plaint pixels to cipher pixels.
2617 % The format of the MagickEncipherImage method is:
2619 % MagickBooleanType MagickEncipherImage(MagickWand *wand,
2620 % const char *passphrase)
2622 % A description of each parameter follows:
2624 % o wand: the magick wand.
2626 % o passphrase: the passphrase.
2629 WandExport MagickBooleanType MagickEncipherImage(MagickWand *wand,
2630 const char *passphrase)
2632 assert(wand != (MagickWand *) NULL);
2633 assert(wand->signature == WandSignature);
2634 if (wand->debug != MagickFalse)
2635 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2636 if (wand->images == (Image *) NULL)
2637 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2638 return(EncipherImage(wand->images,passphrase,&wand->images->exception));
2642 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2646 % M a g i c k E n h a n c e I m a g e %
2650 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2652 % MagickEnhanceImage() applies a digital filter that improves the quality of a
2655 % The format of the MagickEnhanceImage method is:
2657 % MagickBooleanType MagickEnhanceImage(MagickWand *wand)
2659 % A description of each parameter follows:
2661 % o wand: the magick wand.
2664 WandExport MagickBooleanType MagickEnhanceImage(MagickWand *wand)
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 enhance_image=EnhanceImage(wand->images,wand->exception);
2676 if (enhance_image == (Image *) NULL)
2677 return(MagickFalse);
2678 ReplaceImageInList(&wand->images,enhance_image);
2683 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2687 % M a g i c k E q u a l i z e I m a g e %
2691 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2693 % MagickEqualizeImage() equalizes the image histogram.
2695 % The format of the MagickEqualizeImage method is:
2697 % MagickBooleanType MagickEqualizeImage(MagickWand *wand)
2699 % A description of each parameter follows:
2701 % o wand: the magick wand.
2703 % o channel: the image channel(s).
2706 WandExport MagickBooleanType MagickEqualizeImage(MagickWand *wand)
2711 assert(wand != (MagickWand *) NULL);
2712 assert(wand->signature == WandSignature);
2713 if (wand->debug != MagickFalse)
2714 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2715 if (wand->images == (Image *) NULL)
2716 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2717 status=EqualizeImage(wand->images);
2718 if (status == MagickFalse)
2719 InheritException(wand->exception,&wand->images->exception);
2724 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2728 % M a g i c k E v a l u a t e I m a g e %
2732 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2734 % MagickEvaluateImage() applys an arithmetic, relational, or logical
2735 % expression to an image. Use these operators to lighten or darken an image,
2736 % to increase or decrease contrast in an image, or to produce the "negative"
2739 % The format of the MagickEvaluateImage method is:
2741 % MagickBooleanType MagickEvaluateImage(MagickWand *wand,
2742 % const MagickEvaluateOperator operator,const double value)
2743 % MagickBooleanType MagickEvaluateImages(MagickWand *wand,
2744 % const MagickEvaluateOperator operator)
2746 % A description of each parameter follows:
2748 % o wand: the magick wand.
2750 % o op: A channel operator.
2752 % o value: A value value.
2756 WandExport MagickWand *MagickEvaluateImages(MagickWand *wand,
2757 const MagickEvaluateOperator op)
2762 assert(wand != (MagickWand *) NULL);
2763 assert(wand->signature == WandSignature);
2764 if (wand->debug != MagickFalse)
2765 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2766 if (wand->images == (Image *) NULL)
2767 return((MagickWand *) NULL);
2768 evaluate_image=EvaluateImages(wand->images,op,wand->exception);
2769 if (evaluate_image == (Image *) NULL)
2770 return((MagickWand *) NULL);
2771 return(CloneMagickWandFromImages(wand,evaluate_image));
2774 WandExport MagickBooleanType MagickEvaluateImage(MagickWand *wand,
2775 const MagickEvaluateOperator op,const double value)
2780 assert(wand != (MagickWand *) NULL);
2781 assert(wand->signature == WandSignature);
2782 if (wand->debug != MagickFalse)
2783 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2784 if (wand->images == (Image *) NULL)
2785 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2786 status=EvaluateImage(wand->images,op,value,&wand->images->exception);
2791 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2795 % M a g i c k E x p o r t I m a g e P i x e l s %
2799 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2801 % MagickExportImagePixels() extracts pixel data from an image and returns it
2802 % to you. The method returns MagickTrue on success otherwise MagickFalse if
2803 % an error is encountered. The data is returned as char, short int, int,
2804 % ssize_t, float, or double in the order specified by map.
2806 % Suppose you want to extract the first scanline of a 640x480 image as
2807 % character data in red-green-blue order:
2809 % MagickExportImagePixels(wand,0,0,640,1,"RGB",CharPixel,pixels);
2811 % The format of the MagickExportImagePixels method is:
2813 % MagickBooleanType MagickExportImagePixels(MagickWand *wand,
2814 % const ssize_t x,const ssize_t y,const size_t columns,
2815 % const size_t rows,const char *map,const StorageType storage,
2818 % A description of each parameter follows:
2820 % o wand: the magick wand.
2822 % o x, y, columns, rows: These values define the perimeter
2823 % of a region of pixels you want to extract.
2825 % o map: This string reflects the expected ordering of the pixel array.
2826 % It can be any combination or order of R = red, G = green, B = blue,
2827 % A = alpha (0 is transparent), O = opacity (0 is opaque), C = cyan,
2828 % Y = yellow, M = magenta, K = black, I = intensity (for grayscale),
2831 % o storage: Define the data type of the pixels. Float and double types are
2832 % expected to be normalized [0..1] otherwise [0..QuantumRange]. Choose from
2833 % these types: CharPixel, DoublePixel, FloatPixel, IntegerPixel,
2834 % LongPixel, QuantumPixel, or ShortPixel.
2836 % o pixels: This array of values contain the pixel components as defined by
2837 % map and type. You must preallocate this array where the expected
2838 % length varies depending on the values of width, height, map, and type.
2841 WandExport MagickBooleanType MagickExportImagePixels(MagickWand *wand,
2842 const ssize_t x,const ssize_t y,const size_t columns,
2843 const size_t rows,const char *map,const StorageType storage,
2849 assert(wand != (MagickWand *) NULL);
2850 assert(wand->signature == WandSignature);
2851 if (wand->debug != MagickFalse)
2852 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2853 if (wand->images == (Image *) NULL)
2854 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2855 status=ExportImagePixels(wand->images,x,y,columns,rows,map,
2856 storage,pixels,wand->exception);
2857 if (status == MagickFalse)
2858 InheritException(wand->exception,&wand->images->exception);
2863 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2867 % M a g i c k E x t e n t I m a g e %
2871 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2873 % MagickExtentImage() extends the image as defined by the geometry, gravity,
2874 % and wand background color. Set the (x,y) offset of the geometry to move
2875 % the original wand relative to the extended wand.
2877 % The format of the MagickExtentImage method is:
2879 % MagickBooleanType MagickExtentImage(MagickWand *wand,
2880 % const size_t width,const size_t height,const ssize_t x,
2883 % A description of each parameter follows:
2885 % o wand: the magick wand.
2887 % o width: the region width.
2889 % o height: the region height.
2891 % o x: the region x offset.
2893 % o y: the region y offset.
2896 WandExport MagickBooleanType MagickExtentImage(MagickWand *wand,
2897 const size_t width,const size_t height,const ssize_t x,
2906 assert(wand != (MagickWand *) NULL);
2907 assert(wand->signature == WandSignature);
2908 if (wand->debug != MagickFalse)
2909 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2910 if (wand->images == (Image *) NULL)
2911 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2913 extent.height=height;
2916 extent_image=ExtentImage(wand->images,&extent,wand->exception);
2917 if (extent_image == (Image *) NULL)
2918 return(MagickFalse);
2919 ReplaceImageInList(&wand->images,extent_image);
2924 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2928 % M a g i c k F l i p I m a g e %
2932 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2934 % MagickFlipImage() creates a vertical mirror image by reflecting the pixels
2935 % around the central x-axis.
2937 % The format of the MagickFlipImage method is:
2939 % MagickBooleanType MagickFlipImage(MagickWand *wand)
2941 % A description of each parameter follows:
2943 % o wand: the magick wand.
2946 WandExport MagickBooleanType MagickFlipImage(MagickWand *wand)
2951 assert(wand != (MagickWand *) NULL);
2952 assert(wand->signature == WandSignature);
2953 if (wand->debug != MagickFalse)
2954 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2955 if (wand->images == (Image *) NULL)
2956 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2957 flip_image=FlipImage(wand->images,wand->exception);
2958 if (flip_image == (Image *) NULL)
2959 return(MagickFalse);
2960 ReplaceImageInList(&wand->images,flip_image);
2965 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2969 % 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 %
2973 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2975 % MagickFloodfillPaintImage() changes the color value of any pixel that matches
2976 % target and is an immediate neighbor. If the method FillToBorderMethod is
2977 % specified, the color value is changed for any neighbor pixel that does not
2978 % match the bordercolor member of image.
2980 % The format of the MagickFloodfillPaintImage method is:
2982 % MagickBooleanType MagickFloodfillPaintImage(MagickWand *wand,
2983 % const PixelWand *fill,const double fuzz,const PixelWand *bordercolor,
2984 % const ssize_t x,const ssize_t y,const MagickBooleanType invert)
2986 % A description of each parameter follows:
2988 % o wand: the magick wand.
2990 % o fill: the floodfill color pixel wand.
2992 % o fuzz: By default target must match a particular pixel color
2993 % exactly. However, in many cases two colors may differ by a small amount.
2994 % The fuzz member of image defines how much tolerance is acceptable to
2995 % consider two colors as the same. For example, set fuzz to 10 and the
2996 % color red at intensities of 100 and 102 respectively are now interpreted
2997 % as the same color for the purposes of the floodfill.
2999 % o bordercolor: the border color pixel wand.
3001 % o x,y: the starting location of the operation.
3003 % o invert: paint any pixel that does not match the target color.
3006 WandExport MagickBooleanType MagickFloodfillPaintImage(MagickWand *wand,
3007 const PixelWand *fill,const double fuzz,const PixelWand *bordercolor,
3008 const ssize_t x,const ssize_t y,const MagickBooleanType invert)
3019 assert(wand != (MagickWand *) NULL);
3020 assert(wand->signature == WandSignature);
3021 if (wand->debug != MagickFalse)
3022 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3023 if (wand->images == (Image *) NULL)
3024 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3025 draw_info=CloneDrawInfo(wand->image_info,(DrawInfo *) NULL);
3026 PixelGetQuantumPacket(fill,&draw_info->fill);
3027 (void) GetOneVirtualMagickPixel(wand->images,x % wand->images->columns,
3028 y % wand->images->rows,&target,wand->exception);
3029 if (bordercolor != (PixelWand *) NULL)
3030 PixelGetMagickColor(bordercolor,&target);
3031 wand->images->fuzz=fuzz;
3032 status=FloodfillPaintImage(wand->images,draw_info,&target,x,y,invert);
3033 if (status == MagickFalse)
3034 InheritException(wand->exception,&wand->images->exception);
3035 draw_info=DestroyDrawInfo(draw_info);
3040 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3044 % M a g i c k F l o p I m a g e %
3048 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3050 % MagickFlopImage() creates a horizontal mirror image by reflecting the pixels
3051 % around the central y-axis.
3053 % The format of the MagickFlopImage method is:
3055 % MagickBooleanType MagickFlopImage(MagickWand *wand)
3057 % A description of each parameter follows:
3059 % o wand: the magick wand.
3062 WandExport MagickBooleanType MagickFlopImage(MagickWand *wand)
3067 assert(wand != (MagickWand *) NULL);
3068 assert(wand->signature == WandSignature);
3069 if (wand->debug != MagickFalse)
3070 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3071 if (wand->images == (Image *) NULL)
3072 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3073 flop_image=FlopImage(wand->images,wand->exception);
3074 if (flop_image == (Image *) NULL)
3075 return(MagickFalse);
3076 ReplaceImageInList(&wand->images,flop_image);
3081 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3085 % 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 %
3089 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3091 % MagickForwardFourierTransformImage() implements the discrete Fourier
3092 % transform (DFT) of the image either as a magnitude / phase or real /
3093 % imaginary image pair.
3095 % The format of the MagickForwardFourierTransformImage method is:
3097 % MagickBooleanType MagickForwardFourierTransformImage(MagickWand *wand,
3098 % const MagickBooleanType magnitude)
3100 % A description of each parameter follows:
3102 % o wand: the magick wand.
3104 % o magnitude: if true, return as magnitude / phase pair otherwise a real /
3105 % imaginary image pair.
3108 WandExport MagickBooleanType MagickForwardFourierTransformImage(
3109 MagickWand *wand,const MagickBooleanType magnitude)
3114 assert(wand != (MagickWand *) NULL);
3115 assert(wand->signature == WandSignature);
3116 if (wand->debug != MagickFalse)
3117 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3118 if (wand->images == (Image *) NULL)
3119 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3120 forward_image=ForwardFourierTransformImage(wand->images,magnitude,
3122 if (forward_image == (Image *) NULL)
3123 return(MagickFalse);
3124 ReplaceImageInList(&wand->images,forward_image);
3129 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3133 % M a g i c k F r a m e I m a g e %
3137 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3139 % MagickFrameImage() adds a simulated three-dimensional border around the
3140 % image. The width and height specify the border width of the vertical and
3141 % horizontal sides of the frame. The inner and outer bevels indicate the
3142 % width of the inner and outer shadows of the frame.
3144 % The format of the MagickFrameImage method is:
3146 % MagickBooleanType MagickFrameImage(MagickWand *wand,
3147 % const PixelWand *matte_color,const size_t width,
3148 % const size_t height,const ssize_t inner_bevel,
3149 % const ssize_t outer_bevel)
3151 % A description of each parameter follows:
3153 % o wand: the magick wand.
3155 % o matte_color: the frame color pixel wand.
3157 % o width: the border width.
3159 % o height: the border height.
3161 % o inner_bevel: the inner bevel width.
3163 % o outer_bevel: the outer bevel width.
3166 WandExport MagickBooleanType MagickFrameImage(MagickWand *wand,
3167 const PixelWand *matte_color,const size_t width,
3168 const size_t height,const ssize_t inner_bevel,const ssize_t outer_bevel)
3176 assert(wand != (MagickWand *) NULL);
3177 assert(wand->signature == WandSignature);
3178 if (wand->debug != MagickFalse)
3179 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3180 if (wand->images == (Image *) NULL)
3181 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3182 (void) ResetMagickMemory(&frame_info,0,sizeof(frame_info));
3183 frame_info.width=wand->images->columns+2*width;
3184 frame_info.height=wand->images->rows+2*height;
3185 frame_info.x=(ssize_t) width;
3186 frame_info.y=(ssize_t) height;
3187 frame_info.inner_bevel=inner_bevel;
3188 frame_info.outer_bevel=outer_bevel;
3189 PixelGetQuantumPacket(matte_color,&wand->images->matte_color);
3190 frame_image=FrameImage(wand->images,&frame_info,wand->exception);
3191 if (frame_image == (Image *) NULL)
3192 return(MagickFalse);
3193 ReplaceImageInList(&wand->images,frame_image);
3198 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3202 % M a g i c k F u n c t i o n I m a g e %
3206 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3208 % MagickFunctionImage() applys an arithmetic, relational, or logical
3209 % expression to an image. Use these operators to lighten or darken an image,
3210 % to increase or decrease contrast in an image, or to produce the "negative"
3213 % The format of the MagickFunctionImage method is:
3215 % MagickBooleanType MagickFunctionImage(MagickWand *wand,
3216 % const MagickFunction function,const size_t number_arguments,
3217 % const double *arguments)
3219 % A description of each parameter follows:
3221 % o wand: the magick wand.
3223 % o function: the image function.
3225 % o number_arguments: the number of function arguments.
3227 % o arguments: the function arguments.
3230 WandExport MagickBooleanType MagickFunctionImage(MagickWand *wand,
3231 const MagickFunction function,const size_t number_arguments,
3232 const double *arguments)
3237 assert(wand != (MagickWand *) NULL);
3238 assert(wand->signature == WandSignature);
3239 if (wand->debug != MagickFalse)
3240 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3241 if (wand->images == (Image *) NULL)
3242 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3243 status=FunctionImage(wand->images,function,number_arguments,arguments,
3244 &wand->images->exception);
3249 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3253 % M a g i c k F x I m a g e %
3257 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3259 % MagickFxImage() evaluate expression for each pixel in the image.
3261 % The format of the MagickFxImage method is:
3263 % MagickWand *MagickFxImage(MagickWand *wand,const char *expression)
3265 % A description of each parameter follows:
3267 % o wand: the magick wand.
3269 % o expression: the expression.
3272 WandExport MagickWand *MagickFxImage(MagickWand *wand,const char *expression)
3277 assert(wand != (MagickWand *) NULL);
3278 assert(wand->signature == WandSignature);
3279 if (wand->debug != MagickFalse)
3280 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3281 if (wand->images == (Image *) NULL)
3282 return((MagickWand *) NULL);
3283 fx_image=FxImage(wand->images,expression,wand->exception);
3284 if (fx_image == (Image *) NULL)
3285 return((MagickWand *) NULL);
3286 return(CloneMagickWandFromImages(wand,fx_image));
3290 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3294 % M a g i c k G a m m a I m a g e %
3298 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3300 % MagickGammaImage() gamma-corrects an image. The same image viewed on
3301 % different devices will have perceptual differences in the way the image's
3302 % intensities are represented on the screen. Specify individual gamma levels
3303 % for the red, green, and blue channels, or adjust all three with the gamma
3304 % parameter. Values typically range from 0.8 to 2.3.
3306 % You can also reduce the influence of a particular channel with a gamma
3309 % The format of the MagickGammaImage method is:
3311 % MagickBooleanType MagickGammaImage(MagickWand *wand,const double gamma)
3313 % A description of each parameter follows:
3315 % o wand: the magick wand.
3317 % o level: Define the level of gamma correction.
3320 WandExport MagickBooleanType MagickGammaImage(MagickWand *wand,
3326 assert(wand != (MagickWand *) NULL);
3327 assert(wand->signature == WandSignature);
3328 if (wand->debug != MagickFalse)
3329 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3330 if (wand->images == (Image *) NULL)
3331 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3332 status=GammaImage(wand->images,gamma,wand->exception);
3337 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3341 % M a g i c k G a u s s i a n B l u r I m a g e %
3345 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3347 % MagickGaussianBlurImage() blurs an image. We convolve the image with a
3348 % Gaussian operator of the given radius and standard deviation (sigma).
3349 % For reasonable results, the radius should be larger than sigma. Use a
3350 % radius of 0 and MagickGaussianBlurImage() selects a suitable radius for you.
3352 % The format of the MagickGaussianBlurImage method is:
3354 % MagickBooleanType MagickGaussianBlurImage(MagickWand *wand,
3355 % const double radius,const double sigma)
3357 % A description of each parameter follows:
3359 % o wand: the magick wand.
3361 % o radius: the radius of the Gaussian, in pixels, not counting the center
3364 % o sigma: the standard deviation of the Gaussian, in pixels.
3367 WandExport MagickBooleanType MagickGaussianBlurImage(MagickWand *wand,
3368 const double radius,const double sigma)
3373 assert(wand != (MagickWand *) NULL);
3374 assert(wand->signature == WandSignature);
3375 if (wand->debug != MagickFalse)
3376 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3377 if (wand->images == (Image *) NULL)
3378 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3379 blur_image=GaussianBlurImage(wand->images,radius,sigma,wand->exception);
3380 if (blur_image == (Image *) NULL)
3381 return(MagickFalse);
3382 ReplaceImageInList(&wand->images,blur_image);
3387 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3391 % M a g i c k G e t I m a g e %
3395 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3397 % MagickGetImage() gets the image at the current image index.
3399 % The format of the MagickGetImage method is:
3401 % MagickWand *MagickGetImage(MagickWand *wand)
3403 % A description of each parameter follows:
3405 % o wand: the magick wand.
3408 WandExport MagickWand *MagickGetImage(MagickWand *wand)
3413 assert(wand != (MagickWand *) NULL);
3414 assert(wand->signature == WandSignature);
3415 if (wand->debug != MagickFalse)
3416 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3417 if (wand->images == (Image *) NULL)
3419 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3420 "ContainsNoImages","`%s'",wand->name);
3421 return((MagickWand *) NULL);
3423 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
3424 if (image == (Image *) NULL)
3425 return((MagickWand *) NULL);
3426 return(CloneMagickWandFromImages(wand,image));
3430 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3434 % 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 %
3438 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3440 % MagickGetImageAlphaChannel() returns MagickFalse if the image alpha channel
3441 % is not activated. That is, the image is RGB rather than RGBA or CMYK rather
3444 % The format of the MagickGetImageAlphaChannel method is:
3446 % size_t MagickGetImageAlphaChannel(MagickWand *wand)
3448 % A description of each parameter follows:
3450 % o wand: the magick wand.
3453 WandExport MagickBooleanType MagickGetImageAlphaChannel(MagickWand *wand)
3455 assert(wand != (MagickWand *) NULL);
3456 assert(wand->signature == WandSignature);
3457 if (wand->debug != MagickFalse)
3458 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3459 if (wand->images == (Image *) NULL)
3460 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3461 return(GetImageAlphaChannel(wand->images));
3465 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3469 % M a g i c k G e t I m a g e C l i p M a s k %
3473 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3475 % MagickGetImageClipMask() gets the image clip mask at the current image index.
3477 % The format of the MagickGetImageClipMask method is:
3479 % MagickWand *MagickGetImageClipMask(MagickWand *wand)
3481 % A description of each parameter follows:
3483 % o wand: the magick wand.
3486 WandExport MagickWand *MagickGetImageClipMask(MagickWand *wand)
3491 assert(wand != (MagickWand *) NULL);
3492 assert(wand->signature == WandSignature);
3493 if (wand->debug != MagickFalse)
3494 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3495 if (wand->images == (Image *) NULL)
3497 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3498 "ContainsNoImages","`%s'",wand->name);
3499 return((MagickWand *) NULL);
3501 image=GetImageClipMask(wand->images,wand->exception);
3502 if (image == (Image *) NULL)
3503 return((MagickWand *) NULL);
3504 return(CloneMagickWandFromImages(wand,image));
3508 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3512 % 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 %
3516 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3518 % MagickGetImageBackgroundColor() returns the image background color.
3520 % The format of the MagickGetImageBackgroundColor method is:
3522 % MagickBooleanType MagickGetImageBackgroundColor(MagickWand *wand,
3523 % PixelWand *background_color)
3525 % A description of each parameter follows:
3527 % o wand: the magick wand.
3529 % o background_color: Return the background color.
3532 WandExport MagickBooleanType MagickGetImageBackgroundColor(MagickWand *wand,
3533 PixelWand *background_color)
3535 assert(wand != (MagickWand *) NULL);
3536 assert(wand->signature == WandSignature);
3537 if (wand->debug != MagickFalse)
3538 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3539 if (wand->images == (Image *) NULL)
3540 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3541 PixelSetQuantumPacket(background_color,&wand->images->background_color);
3546 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3550 % M a g i c k G e t I m a g e B l o b %
3554 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3556 % MagickGetImageBlob() implements direct to memory image formats. It returns
3557 % the image as a blob (a formatted "file" in memory) and its length, starting
3558 % from the current position in the image sequence. Use MagickSetImageFormat()
3559 % to set the format to write to the blob (GIF, JPEG, PNG, etc.).
3561 % Utilize MagickResetIterator() to ensure the write is from the beginning of
3562 % the image sequence.
3564 % Use MagickRelinquishMemory() to free the blob when you are done with it.
3566 % The format of the MagickGetImageBlob method is:
3568 % unsigned char *MagickGetImageBlob(MagickWand *wand,size_t *length)
3570 % A description of each parameter follows:
3572 % o wand: the magick wand.
3574 % o length: the length of the blob.
3577 WandExport unsigned char *MagickGetImageBlob(MagickWand *wand,size_t *length)
3579 assert(wand != (MagickWand *) NULL);
3580 assert(wand->signature == WandSignature);
3581 if (wand->debug != MagickFalse)
3582 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3583 if (wand->images == (Image *) NULL)
3585 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3586 "ContainsNoImages","`%s'",wand->name);
3587 return((unsigned char *) NULL);
3589 return(ImageToBlob(wand->image_info,wand->images,length,wand->exception));
3593 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3597 % M a g i c k G e t I m a g e s B l o b %
3601 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3603 % MagickGetImageBlob() implements direct to memory image formats. It
3604 % returns the image sequence as a blob and its length. The format of the image
3605 % determines the format of the returned blob (GIF, JPEG, PNG, etc.). To
3606 % return a different image format, use MagickSetImageFormat().
3608 % Note, some image formats do not permit multiple images to the same image
3609 % stream (e.g. JPEG). in this instance, just the first image of the
3610 % sequence is returned as a blob.
3612 % The format of the MagickGetImagesBlob method is:
3614 % unsigned char *MagickGetImagesBlob(MagickWand *wand,size_t *length)
3616 % A description of each parameter follows:
3618 % o wand: the magick wand.
3620 % o length: the length of the blob.
3623 WandExport unsigned char *MagickGetImagesBlob(MagickWand *wand,size_t *length)
3628 assert(wand != (MagickWand *) NULL);
3629 assert(wand->signature == WandSignature);
3630 if (wand->debug != MagickFalse)
3631 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3632 if (wand->images == (Image *) NULL)
3634 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3635 "ContainsNoImages","`%s'",wand->name);
3636 return((unsigned char *) NULL);
3638 blob=ImagesToBlob(wand->image_info,GetFirstImageInList(wand->images),length,
3644 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3648 % 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 %
3652 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3654 % MagickGetImageBluePrimary() returns the chromaticy blue primary point for the
3657 % The format of the MagickGetImageBluePrimary method is:
3659 % MagickBooleanType MagickGetImageBluePrimary(MagickWand *wand,double *x,
3662 % A description of each parameter follows:
3664 % o wand: the magick wand.
3666 % o x: the chromaticity blue primary x-point.
3668 % o y: the chromaticity blue primary y-point.
3671 WandExport MagickBooleanType MagickGetImageBluePrimary(MagickWand *wand,
3672 double *x,double *y)
3674 assert(wand != (MagickWand *) NULL);
3675 assert(wand->signature == WandSignature);
3676 if (wand->debug != MagickFalse)
3677 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3678 if (wand->images == (Image *) NULL)
3679 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3680 *x=wand->images->chromaticity.blue_primary.x;
3681 *y=wand->images->chromaticity.blue_primary.y;
3686 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3690 % 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 %
3694 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3696 % MagickGetImageBorderColor() returns the image border color.
3698 % The format of the MagickGetImageBorderColor method is:
3700 % MagickBooleanType MagickGetImageBorderColor(MagickWand *wand,
3701 % PixelWand *border_color)
3703 % A description of each parameter follows:
3705 % o wand: the magick wand.
3707 % o border_color: Return the border color.
3710 WandExport MagickBooleanType MagickGetImageBorderColor(MagickWand *wand,
3711 PixelWand *border_color)
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 PixelSetQuantumPacket(border_color,&wand->images->border_color);
3724 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3728 % M a g i c k G e t I m a g e F e a t u r e s %
3732 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3734 % MagickGetImageFeatures() returns features for each channel in the
3735 % image in each of four directions (horizontal, vertical, left and right
3736 % diagonals) for the specified distance. The features include the angular
3737 % second moment, contrast, correlation, sum of squares: variance, inverse
3738 % difference moment, sum average, sum varience, sum entropy, entropy,
3739 % difference variance, difference entropy, information measures of
3740 % correlation 1, information measures of correlation 2, and maximum
3741 % correlation coefficient. You can access the red channel contrast, for
3742 % example, like this:
3744 % channel_features=MagickGetImageFeatures(wand,1);
3745 % contrast=channel_features[RedChannel].contrast[0];
3747 % Use MagickRelinquishMemory() to free the statistics buffer.
3749 % The format of the MagickGetImageFeatures method is:
3751 % ChannelFeatures *MagickGetImageFeatures(MagickWand *wand,
3752 % const size_t distance)
3754 % A description of each parameter follows:
3756 % o wand: the magick wand.
3758 % o distance: the distance.
3761 WandExport ChannelFeatures *MagickGetImageFeatures(MagickWand *wand,
3762 const size_t distance)
3764 assert(wand != (MagickWand *) NULL);
3765 assert(wand->signature == WandSignature);
3766 if (wand->debug != MagickFalse)
3767 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3768 if (wand->images == (Image *) NULL)
3770 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3771 "ContainsNoImages","`%s'",wand->name);
3772 return((ChannelFeatures *) NULL);
3774 return(GetImageFeatures(wand->images,distance,wand->exception));
3778 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3782 % M a g i c k G e t I m a g e K u r t o s i s %
3786 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3788 % MagickGetImageKurtosis() gets the kurtosis and skewness of one or
3789 % more image channels.
3791 % The format of the MagickGetImageKurtosis method is:
3793 % MagickBooleanType MagickGetImageKurtosis(MagickWand *wand,
3794 % double *kurtosis,double *skewness)
3796 % A description of each parameter follows:
3798 % o wand: the magick wand.
3800 % o kurtosis: The kurtosis for the specified channel(s).
3802 % o skewness: The skewness for the specified channel(s).
3805 WandExport MagickBooleanType MagickGetImageKurtosis(MagickWand *wand,
3806 double *kurtosis,double *skewness)
3811 assert(wand != (MagickWand *) NULL);
3812 assert(wand->signature == WandSignature);
3813 if (wand->debug != MagickFalse)
3814 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3815 if (wand->images == (Image *) NULL)
3816 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3817 status=GetImageKurtosis(wand->images,kurtosis,skewness,wand->exception);
3822 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3826 % M a g i c k G e t I m a g e M e a n %
3830 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3832 % MagickGetImageMean() gets the mean and standard deviation of one or more
3835 % The format of the MagickGetImageMean method is:
3837 % MagickBooleanType MagickGetImageMean(MagickWand *wand,double *mean,
3838 % double *standard_deviation)
3840 % A description of each parameter follows:
3842 % o wand: the magick wand.
3844 % o channel: the image channel(s).
3846 % o mean: The mean pixel value for the specified channel(s).
3848 % o standard_deviation: The standard deviation for the specified channel(s).
3851 WandExport MagickBooleanType MagickGetImageMean(MagickWand *wand,double *mean,
3852 double *standard_deviation)
3857 assert(wand != (MagickWand *) NULL);
3858 assert(wand->signature == WandSignature);
3859 if (wand->debug != MagickFalse)
3860 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3861 if (wand->images == (Image *) NULL)
3862 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3863 status=GetImageMean(wand->images,mean,standard_deviation,wand->exception);
3868 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3872 % M a g i c k G e t I m a g e R a n g e %
3876 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3878 % MagickGetImageRange() gets the range for one or more image channels.
3880 % The format of the MagickGetImageRange method is:
3882 % MagickBooleanType MagickGetImageRange(MagickWand *wand,double *minima,
3885 % A description of each parameter follows:
3887 % o wand: the magick wand.
3889 % o minima: The minimum pixel value for the specified channel(s).
3891 % o maxima: The maximum pixel value for the specified channel(s).
3894 WandExport MagickBooleanType MagickGetImageRange(MagickWand *wand,
3895 double *minima,double *maxima)
3900 assert(wand != (MagickWand *) NULL);
3901 assert(wand->signature == WandSignature);
3902 if (wand->debug != MagickFalse)
3903 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3904 if (wand->images == (Image *) NULL)
3905 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3906 status=GetImageRange(wand->images,minima,maxima,wand->exception);
3911 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3915 % M a g i c k G e t I m a g e S t a t i s t i c s %
3919 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3921 % MagickGetImageStatistics() returns statistics for each channel in the
3922 % image. The statistics include the channel depth, its minima and
3923 % maxima, the mean, the standard deviation, the kurtosis and the skewness.
3924 % You can access the red channel mean, for example, like this:
3926 % channel_statistics=MagickGetImageStatistics(wand);
3927 % red_mean=channel_statistics[RedChannel].mean;
3929 % Use MagickRelinquishMemory() to free the statistics buffer.
3931 % The format of the MagickGetImageStatistics method is:
3933 % ChannelStatistics *MagickGetImageStatistics(MagickWand *wand)
3935 % A description of each parameter follows:
3937 % o wand: the magick wand.
3940 WandExport ChannelStatistics *MagickGetImageStatistics(MagickWand *wand)
3942 assert(wand != (MagickWand *) NULL);
3943 assert(wand->signature == WandSignature);
3944 if (wand->debug != MagickFalse)
3945 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3946 if (wand->images == (Image *) NULL)
3948 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3949 "ContainsNoImages","`%s'",wand->name);
3950 return((ChannelStatistics *) NULL);
3952 return(GetImageStatistics(wand->images,wand->exception));
3956 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3960 % 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 %
3964 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3966 % MagickGetImageColormapColor() returns the color of the specified colormap
3969 % The format of the MagickGetImageColormapColor method is:
3971 % MagickBooleanType MagickGetImageColormapColor(MagickWand *wand,
3972 % const size_t index,PixelWand *color)
3974 % A description of each parameter follows:
3976 % o wand: the magick wand.
3978 % o index: the offset into the image colormap.
3980 % o color: Return the colormap color in this wand.
3983 WandExport MagickBooleanType MagickGetImageColormapColor(MagickWand *wand,
3984 const size_t index,PixelWand *color)
3986 assert(wand != (MagickWand *) NULL);
3987 assert(wand->signature == WandSignature);
3988 if (wand->debug != MagickFalse)
3989 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3990 if (wand->images == (Image *) NULL)
3991 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3992 if ((wand->images->colormap == (PixelPacket *) NULL) ||
3993 (index >= wand->images->colors))
3995 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3996 "InvalidColormapIndex","`%s'",wand->name);
3997 return(MagickFalse);
3999 PixelSetQuantumPacket(color,wand->images->colormap+index);
4004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4008 % M a g i c k G e t I m a g e C o l o r s %
4012 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4014 % MagickGetImageColors() gets the number of unique colors in the image.
4016 % The format of the MagickGetImageColors method is:
4018 % size_t MagickGetImageColors(MagickWand *wand)
4020 % A description of each parameter follows:
4022 % o wand: the magick wand.
4025 WandExport size_t MagickGetImageColors(MagickWand *wand)
4027 assert(wand != (MagickWand *) NULL);
4028 assert(wand->signature == WandSignature);
4029 if (wand->debug != MagickFalse)
4030 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4031 if (wand->images == (Image *) NULL)
4033 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4034 "ContainsNoImages","`%s'",wand->name);
4037 return(GetNumberColors(wand->images,(FILE *) NULL,wand->exception));
4041 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4045 % M a g i c k G e t I m a g e C o l o r s p a c e %
4049 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4051 % MagickGetImageColorspace() gets the image colorspace.
4053 % The format of the MagickGetImageColorspace method is:
4055 % ColorspaceType MagickGetImageColorspace(MagickWand *wand)
4057 % A description of each parameter follows:
4059 % o wand: the magick wand.
4062 WandExport ColorspaceType MagickGetImageColorspace(MagickWand *wand)
4064 assert(wand != (MagickWand *) NULL);
4065 assert(wand->signature == WandSignature);
4066 if (wand->debug != MagickFalse)
4067 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4068 if (wand->images == (Image *) NULL)
4070 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4071 "ContainsNoImages","`%s'",wand->name);
4072 return(UndefinedColorspace);
4074 return(wand->images->colorspace);
4078 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4082 % M a g i c k G e t I m a g e C o m p o s e %
4086 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4088 % MagickGetImageCompose() returns the composite operator associated with the
4091 % The format of the MagickGetImageCompose method is:
4093 % CompositeOperator MagickGetImageCompose(MagickWand *wand)
4095 % A description of each parameter follows:
4097 % o wand: the magick wand.
4100 WandExport CompositeOperator MagickGetImageCompose(MagickWand *wand)
4102 assert(wand != (MagickWand *) NULL);
4103 assert(wand->signature == WandSignature);
4104 if (wand->debug != MagickFalse)
4105 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4106 if (wand->images == (Image *) NULL)
4108 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4109 "ContainsNoImages","`%s'",wand->name);
4110 return(UndefinedCompositeOp);
4112 return(wand->images->compose);
4116 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4120 % 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 %
4124 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4126 % MagickGetImageCompression() gets the image compression.
4128 % The format of the MagickGetImageCompression method is:
4130 % CompressionType MagickGetImageCompression(MagickWand *wand)
4132 % A description of each parameter follows:
4134 % o wand: the magick wand.
4137 WandExport CompressionType MagickGetImageCompression(MagickWand *wand)
4139 assert(wand != (MagickWand *) NULL);
4140 assert(wand->signature == WandSignature);
4141 if (wand->debug != MagickFalse)
4142 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4143 if (wand->images == (Image *) NULL)
4145 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4146 "ContainsNoImages","`%s'",wand->name);
4147 return(UndefinedCompression);
4149 return(wand->images->compression);
4153 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4157 % 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 %
4161 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4163 % MagickGetImageCompression() gets the image compression quality.
4165 % The format of the MagickGetImageCompression method is:
4167 % size_t MagickGetImageCompression(MagickWand *wand)
4169 % A description of each parameter follows:
4171 % o wand: the magick wand.
4174 WandExport size_t MagickGetImageCompressionQuality(MagickWand *wand)
4176 assert(wand != (MagickWand *) NULL);
4177 assert(wand->signature == WandSignature);
4178 if (wand->debug != MagickFalse)
4179 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4180 if (wand->images == (Image *) NULL)
4182 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4183 "ContainsNoImages","`%s'",wand->name);
4186 return(wand->images->quality);
4190 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4194 % M a g i c k G e t I m a g e D e l a y %
4198 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4200 % MagickGetImageDelay() gets the image delay.
4202 % The format of the MagickGetImageDelay method is:
4204 % size_t MagickGetImageDelay(MagickWand *wand)
4206 % A description of each parameter follows:
4208 % o wand: the magick wand.
4211 WandExport size_t MagickGetImageDelay(MagickWand *wand)
4213 assert(wand != (MagickWand *) NULL);
4214 assert(wand->signature == WandSignature);
4215 if (wand->debug != MagickFalse)
4216 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4217 if (wand->images == (Image *) NULL)
4218 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4219 return(wand->images->delay);
4223 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4227 % M a g i c k G e t I m a g e D e p t h %
4231 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4233 % MagickGetImageDepth() gets the image depth.
4235 % The format of the MagickGetImageDepth method is:
4237 % size_t MagickGetImageDepth(MagickWand *wand)
4239 % A description of each parameter follows:
4241 % o wand: the magick wand.
4244 WandExport size_t MagickGetImageDepth(MagickWand *wand)
4246 assert(wand != (MagickWand *) NULL);
4247 assert(wand->signature == WandSignature);
4248 if (wand->debug != MagickFalse)
4249 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4250 if (wand->images == (Image *) NULL)
4251 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4252 return(GetImageDepth(wand->images,wand->exception));
4256 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4260 % M a g i c k G e t I m a g e D i s p o s e %
4264 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4266 % MagickGetImageDispose() gets the image disposal method.
4268 % The format of the MagickGetImageDispose method is:
4270 % DisposeType MagickGetImageDispose(MagickWand *wand)
4272 % A description of each parameter follows:
4274 % o wand: the magick wand.
4277 WandExport DisposeType MagickGetImageDispose(MagickWand *wand)
4279 assert(wand != (MagickWand *) NULL);
4280 assert(wand->signature == WandSignature);
4281 if (wand->debug != MagickFalse)
4282 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4283 if (wand->images == (Image *) NULL)
4285 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4286 "ContainsNoImages","`%s'",wand->name);
4287 return(UndefinedDispose);
4289 return((DisposeType) wand->images->dispose);
4293 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4297 % M a g i c k G e t I m a g e D i s t o r t i o n %
4301 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4303 % MagickGetImageDistortion() compares an image to a reconstructed image and
4304 % returns the specified distortion metric.
4306 % The format of the MagickGetImageDistortion method is:
4308 % MagickBooleanType MagickGetImageDistortion(MagickWand *wand,
4309 % const MagickWand *reference,const MetricType metric,
4310 % double *distortion)
4312 % A description of each parameter follows:
4314 % o wand: the magick wand.
4316 % o reference: the reference wand.
4318 % o metric: the metric.
4320 % o distortion: the computed distortion between the images.
4323 WandExport MagickBooleanType MagickGetImageDistortion(MagickWand *wand,
4324 const MagickWand *reference,const MetricType metric,double *distortion)
4329 assert(wand != (MagickWand *) NULL);
4330 assert(wand->signature == WandSignature);
4331 if (wand->debug != MagickFalse)
4332 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4333 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
4334 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4335 status=GetImageDistortion(wand->images,reference->images,metric,distortion,
4336 &wand->images->exception);
4341 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4345 % 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 %
4349 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4351 % MagickGetImageDistortions() compares one or more pixel channels of an
4352 % image to a reconstructed image and returns the specified distortion metrics.
4354 % Use MagickRelinquishMemory() to free the metrics when you are done with them.
4356 % The format of the MagickGetImageDistortion method is:
4358 % double *MagickGetImageDistortion(MagickWand *wand,
4359 % const MagickWand *reference,const MetricType metric)
4361 % A description of each parameter follows:
4363 % o wand: the magick wand.
4365 % o reference: the reference wand.
4367 % o metric: the metric.
4370 WandExport double *MagickGetImageDistortions(MagickWand *wand,
4371 const MagickWand *reference,const MetricType metric)
4374 *channel_distortion;
4376 assert(wand != (MagickWand *) NULL);
4377 assert(wand->signature == WandSignature);
4378 if (wand->debug != MagickFalse)
4379 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4380 assert(reference != (MagickWand *) NULL);
4381 assert(reference->signature == WandSignature);
4382 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
4384 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4385 "ContainsNoImages","`%s'",wand->name);
4386 return((double *) NULL);
4388 channel_distortion=GetImageDistortions(wand->images,reference->images,
4389 metric,&wand->images->exception);
4390 return(channel_distortion);
4394 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4398 % M a g i c k G e t I m a g e F i l e n a m e %
4402 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4404 % MagickGetImageFilename() returns the filename of a particular image in a
4407 % The format of the MagickGetImageFilename method is:
4409 % char *MagickGetImageFilename(MagickWand *wand)
4411 % A description of each parameter follows:
4413 % o wand: the magick wand.
4416 WandExport char *MagickGetImageFilename(MagickWand *wand)
4418 assert(wand != (MagickWand *) NULL);
4419 assert(wand->signature == WandSignature);
4420 if (wand->debug != MagickFalse)
4421 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4422 if (wand->images == (Image *) NULL)
4424 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4425 "ContainsNoImages","`%s'",wand->name);
4426 return((char *) NULL);
4428 return(AcquireString(wand->images->filename));
4432 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4436 % M a g i c k G e t I m a g e F o r m a t %
4440 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4442 % MagickGetImageFormat() returns the format of a particular image in a
4445 % The format of the MagickGetImageFormat method is:
4447 % const char *MagickGetImageFormat(MagickWand *wand)
4449 % A description of each parameter follows:
4451 % o wand: the magick wand.
4454 WandExport char *MagickGetImageFormat(MagickWand *wand)
4456 assert(wand != (MagickWand *) NULL);
4457 assert(wand->signature == WandSignature);
4458 if (wand->debug != MagickFalse)
4459 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4460 if (wand->images == (Image *) NULL)
4462 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4463 "ContainsNoImages","`%s'",wand->name);
4464 return((char *) NULL);
4466 return(AcquireString(wand->images->magick));
4470 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4474 % M a g i c k G e t I m a g e F u z z %
4478 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4480 % MagickGetImageFuzz() gets the image fuzz.
4482 % The format of the MagickGetImageFuzz method is:
4484 % double MagickGetImageFuzz(MagickWand *wand)
4486 % A description of each parameter follows:
4488 % o wand: the magick wand.
4491 WandExport double MagickGetImageFuzz(MagickWand *wand)
4493 assert(wand != (MagickWand *) NULL);
4494 assert(wand->signature == WandSignature);
4495 if (wand->debug != MagickFalse)
4496 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4497 if (wand->images == (Image *) NULL)
4499 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4500 "ContainsNoImages","`%s'",wand->name);
4503 return(wand->images->fuzz);
4507 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4511 % M a g i c k G e t I m a g e G a m m a %
4515 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4517 % MagickGetImageGamma() gets the image gamma.
4519 % The format of the MagickGetImageGamma method is:
4521 % double MagickGetImageGamma(MagickWand *wand)
4523 % A description of each parameter follows:
4525 % o wand: the magick wand.
4528 WandExport double MagickGetImageGamma(MagickWand *wand)
4530 assert(wand != (MagickWand *) NULL);
4531 assert(wand->signature == WandSignature);
4532 if (wand->debug != MagickFalse)
4533 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4534 if (wand->images == (Image *) NULL)
4536 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4537 "ContainsNoImages","`%s'",wand->name);
4540 return(wand->images->gamma);
4544 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4548 % 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 %
4552 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4554 % MagickGetImageGravity() gets the image gravity.
4556 % The format of the MagickGetImageGravity method is:
4558 % GravityType MagickGetImageGravity(MagickWand *wand)
4560 % A description of each parameter follows:
4562 % o wand: the magick wand.
4565 WandExport GravityType MagickGetImageGravity(MagickWand *wand)
4567 assert(wand != (MagickWand *) NULL);
4568 assert(wand->signature == WandSignature);
4569 if (wand->debug != MagickFalse)
4570 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4571 if (wand->images == (Image *) NULL)
4573 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4574 "ContainsNoImages","`%s'",wand->name);
4575 return(UndefinedGravity);
4577 return(wand->images->gravity);
4581 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4585 % 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 %
4589 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4591 % MagickGetImageGreenPrimary() returns the chromaticy green primary point.
4593 % The format of the MagickGetImageGreenPrimary method is:
4595 % MagickBooleanType MagickGetImageGreenPrimary(MagickWand *wand,double *x,
4598 % A description of each parameter follows:
4600 % o wand: the magick wand.
4602 % o x: the chromaticity green primary x-point.
4604 % o y: the chromaticity green primary y-point.
4607 WandExport MagickBooleanType MagickGetImageGreenPrimary(MagickWand *wand,
4608 double *x,double *y)
4610 assert(wand != (MagickWand *) NULL);
4611 assert(wand->signature == WandSignature);
4612 if (wand->debug != MagickFalse)
4613 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4614 if (wand->images == (Image *) NULL)
4615 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4616 *x=wand->images->chromaticity.green_primary.x;
4617 *y=wand->images->chromaticity.green_primary.y;
4622 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4626 % M a g i c k G e t I m a g e H e i g h t %
4630 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4632 % MagickGetImageHeight() returns the image height.
4634 % The format of the MagickGetImageHeight method is:
4636 % size_t MagickGetImageHeight(MagickWand *wand)
4638 % A description of each parameter follows:
4640 % o wand: the magick wand.
4643 WandExport size_t MagickGetImageHeight(MagickWand *wand)
4645 assert(wand != (MagickWand *) NULL);
4646 assert(wand->signature == WandSignature);
4647 if (wand->debug != MagickFalse)
4648 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4649 if (wand->images == (Image *) NULL)
4650 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4651 return(wand->images->rows);
4655 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4659 % M a g i c k G e t I m a g e H i s t o g r a m %
4663 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4665 % MagickGetImageHistogram() returns the image histogram as an array of
4668 % The format of the MagickGetImageHistogram method is:
4670 % PixelWand **MagickGetImageHistogram(MagickWand *wand,
4671 % size_t *number_colors)
4673 % A description of each parameter follows:
4675 % o wand: the magick wand.
4677 % o number_colors: the number of unique colors in the image and the number
4678 % of pixel wands returned.
4681 WandExport PixelWand **MagickGetImageHistogram(MagickWand *wand,
4682 size_t *number_colors)
4693 assert(wand != (MagickWand *) NULL);
4694 assert(wand->signature == WandSignature);
4695 if (wand->debug != MagickFalse)
4696 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4697 if (wand->images == (Image *) NULL)
4699 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4700 "ContainsNoImages","`%s'",wand->name);
4701 return((PixelWand **) NULL);
4703 histogram=GetImageHistogram(wand->images,number_colors,wand->exception);
4704 if (histogram == (PixelPacket *) NULL)
4705 return((PixelWand **) NULL);
4706 pixel_wands=NewPixelWands(*number_colors);
4707 for (i=0; i < (ssize_t) *number_colors; i++)
4709 PixelSetQuantumPacket(pixel_wands[i],&histogram[i]);
4710 PixelSetColorCount(pixel_wands[i],(size_t) histogram[i].count);
4712 histogram=(PixelPacket *) RelinquishMagickMemory(histogram);
4713 return(pixel_wands);
4717 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4721 % 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 %
4725 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4727 % MagickGetImageInterlaceScheme() gets the image interlace scheme.
4729 % The format of the MagickGetImageInterlaceScheme method is:
4731 % InterlaceType MagickGetImageInterlaceScheme(MagickWand *wand)
4733 % A description of each parameter follows:
4735 % o wand: the magick wand.
4738 WandExport InterlaceType MagickGetImageInterlaceScheme(MagickWand *wand)
4740 assert(wand != (MagickWand *) NULL);
4741 assert(wand->signature == WandSignature);
4742 if (wand->debug != MagickFalse)
4743 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4744 if (wand->images == (Image *) NULL)
4746 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4747 "ContainsNoImages","`%s'",wand->name);
4748 return(UndefinedInterlace);
4750 return(wand->images->interlace);
4754 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4758 % 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 %
4762 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4764 % MagickGetImageInterpolateMethod() returns the interpolation method for the
4767 % The format of the MagickGetImageInterpolateMethod method is:
4769 % InterpolatePixelMethod MagickGetImageInterpolateMethod(MagickWand *wand)
4771 % A description of each parameter follows:
4773 % o wand: the magick wand.
4776 WandExport InterpolatePixelMethod MagickGetImageInterpolateMethod(
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(UndefinedInterpolatePixel);
4789 return(wand->images->interpolate);
4793 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4797 % M a g i c k G e t I m a g e I t e r a t i o n s %
4801 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4803 % MagickGetImageIterations() gets the image iterations.
4805 % The format of the MagickGetImageIterations method is:
4807 % size_t MagickGetImageIterations(MagickWand *wand)
4809 % A description of each parameter follows:
4811 % o wand: the magick wand.
4814 WandExport size_t MagickGetImageIterations(MagickWand *wand)
4816 assert(wand != (MagickWand *) NULL);
4817 assert(wand->signature == WandSignature);
4818 if (wand->debug != MagickFalse)
4819 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4820 if (wand->images == (Image *) NULL)
4821 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4822 return(wand->images->iterations);
4826 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4830 % M a g i c k G e t I m a g e L e n g t h %
4834 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4836 % MagickGetImageLength() returns the image length in bytes.
4838 % The format of the MagickGetImageLength method is:
4840 % MagickBooleanType MagickGetImageLength(MagickWand *wand,
4841 % MagickSizeType *length)
4843 % A description of each parameter follows:
4845 % o wand: the magick wand.
4847 % o length: the image length in bytes.
4850 WandExport MagickBooleanType MagickGetImageLength(MagickWand *wand,
4851 MagickSizeType *length)
4853 assert(wand != (MagickWand *) NULL);
4854 assert(wand->signature == WandSignature);
4855 if (wand->debug != MagickFalse)
4856 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4857 if (wand->images == (Image *) NULL)
4858 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4859 *length=GetBlobSize(wand->images);
4864 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4868 % M a g i c k G e t I m a g e M a t t e C o l o r %
4872 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4874 % MagickGetImageMatteColor() returns the image matte color.
4876 % The format of the MagickGetImageMatteColor method is:
4878 % MagickBooleanType MagickGetImagematteColor(MagickWand *wand,
4879 % PixelWand *matte_color)
4881 % A description of each parameter follows:
4883 % o wand: the magick wand.
4885 % o matte_color: Return the matte color.
4888 WandExport MagickBooleanType MagickGetImageMatteColor(MagickWand *wand,
4889 PixelWand *matte_color)
4891 assert(wand != (MagickWand *) NULL);
4892 assert(wand->signature == WandSignature);
4893 if (wand->debug != MagickFalse)
4894 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4895 if (wand->images == (Image *) NULL)
4896 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4897 PixelSetQuantumPacket(matte_color,&wand->images->matte_color);
4902 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4906 % 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 %
4910 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4912 % MagickGetImageOrientation() returns the image orientation.
4914 % The format of the MagickGetImageOrientation method is:
4916 % OrientationType MagickGetImageOrientation(MagickWand *wand)
4918 % A description of each parameter follows:
4920 % o wand: the magick wand.
4923 WandExport OrientationType MagickGetImageOrientation(MagickWand *wand)
4925 assert(wand != (MagickWand *) NULL);
4926 assert(wand->signature == WandSignature);
4927 if (wand->debug != MagickFalse)
4928 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4929 if (wand->images == (Image *) NULL)
4931 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4932 "ContainsNoImages","`%s'",wand->name);
4933 return(UndefinedOrientation);
4935 return(wand->images->orientation);
4939 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4943 % M a g i c k G e t I m a g e P a g e %
4947 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4949 % MagickGetImagePage() returns the page geometry associated with the image.
4951 % The format of the MagickGetImagePage method is:
4953 % MagickBooleanType MagickGetImagePage(MagickWand *wand,
4954 % size_t *width,size_t *height,ssize_t *x,ssize_t *y)
4956 % A description of each parameter follows:
4958 % o wand: the magick wand.
4960 % o width: the page width.
4962 % o height: the page height.
4964 % o x: the page x-offset.
4966 % o y: the page y-offset.
4969 WandExport MagickBooleanType MagickGetImagePage(MagickWand *wand,
4970 size_t *width,size_t *height,ssize_t *x,ssize_t *y)
4972 assert(wand != (const MagickWand *) NULL);
4973 assert(wand->signature == WandSignature);
4974 if (wand->debug != MagickFalse)
4975 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4976 if (wand->images == (Image *) NULL)
4977 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4978 *width=wand->images->page.width;
4979 *height=wand->images->page.height;
4980 *x=wand->images->page.x;
4981 *y=wand->images->page.y;
4986 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4990 % M a g i c k G e t I m a g e P i x e l C o l o r %
4994 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4996 % MagickGetImagePixelColor() returns the color of the specified pixel.
4998 % The format of the MagickGetImagePixelColor method is:
5000 % MagickBooleanType MagickGetImagePixelColor(MagickWand *wand,
5001 % const ssize_t x,const ssize_t y,PixelWand *color)
5003 % A description of each parameter follows:
5005 % o wand: the magick wand.
5007 % o x,y: the pixel offset into the image.
5009 % o color: Return the colormap color in this wand.
5012 WandExport MagickBooleanType MagickGetImagePixelColor(MagickWand *wand,
5013 const ssize_t x,const ssize_t y,PixelWand *color)
5015 register const Quantum
5021 assert(wand != (MagickWand *) NULL);
5022 assert(wand->signature == WandSignature);
5023 if (wand->debug != MagickFalse)
5024 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5025 if (wand->images == (Image *) NULL)
5026 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5027 image_view=AcquireCacheView(wand->images);
5028 p=GetCacheViewVirtualPixels(image_view,x,y,1,1,wand->exception);
5029 if (p == (const Quantum *) NULL)
5031 image_view=DestroyCacheView(image_view);
5032 return(MagickFalse);
5034 PixelSetQuantumPixel(wand->images,p,color);
5035 image_view=DestroyCacheView(image_view);
5040 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5044 % M a g i c k G e t I m a g e R e d P r i m a r y %
5048 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5050 % MagickGetImageRedPrimary() returns the chromaticy red primary point.
5052 % The format of the MagickGetImageRedPrimary method is:
5054 % MagickBooleanType MagickGetImageRedPrimary(MagickWand *wand,double *x,
5057 % A description of each parameter follows:
5059 % o wand: the magick wand.
5061 % o x: the chromaticity red primary x-point.
5063 % o y: the chromaticity red primary y-point.
5066 WandExport MagickBooleanType MagickGetImageRedPrimary(MagickWand *wand,
5067 double *x,double *y)
5069 assert(wand != (MagickWand *) NULL);
5070 assert(wand->signature == WandSignature);
5071 if (wand->debug != MagickFalse)
5072 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5073 if (wand->images == (Image *) NULL)
5074 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5075 *x=wand->images->chromaticity.red_primary.x;
5076 *y=wand->images->chromaticity.red_primary.y;
5081 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5085 % M a g i c k G e t I m a g e R e g i o n %
5089 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5091 % MagickGetImageRegion() extracts a region of the image and returns it as a
5094 % The format of the MagickGetImageRegion method is:
5096 % MagickWand *MagickGetImageRegion(MagickWand *wand,
5097 % const size_t width,const size_t height,const ssize_t x,
5100 % A description of each parameter follows:
5102 % o wand: the magick wand.
5104 % o width: the region width.
5106 % o height: the region height.
5108 % o x: the region x offset.
5110 % o y: the region y offset.
5113 WandExport MagickWand *MagickGetImageRegion(MagickWand *wand,
5114 const size_t width,const size_t height,const ssize_t x,
5123 assert(wand != (MagickWand *) NULL);
5124 assert(wand->signature == WandSignature);
5125 if (wand->debug != MagickFalse)
5126 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5127 if (wand->images == (Image *) NULL)
5128 return((MagickWand *) NULL);
5130 region.height=height;
5133 region_image=CropImage(wand->images,®ion,wand->exception);
5134 if (region_image == (Image *) NULL)
5135 return((MagickWand *) NULL);
5136 return(CloneMagickWandFromImages(wand,region_image));
5140 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5144 % 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 %
5148 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5150 % MagickGetImageRenderingIntent() gets the image rendering intent.
5152 % The format of the MagickGetImageRenderingIntent method is:
5154 % RenderingIntent MagickGetImageRenderingIntent(MagickWand *wand)
5156 % A description of each parameter follows:
5158 % o wand: the magick wand.
5161 WandExport RenderingIntent MagickGetImageRenderingIntent(MagickWand *wand)
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)
5169 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5170 "ContainsNoImages","`%s'",wand->name);
5171 return(UndefinedIntent);
5173 return((RenderingIntent) wand->images->rendering_intent);
5177 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5181 % M a g i c k G e t I m a g e R e s o l u t i o n %
5185 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5187 % MagickGetImageResolution() gets the image X and Y resolution.
5189 % The format of the MagickGetImageResolution method is:
5191 % MagickBooleanType MagickGetImageResolution(MagickWand *wand,double *x,
5194 % A description of each parameter follows:
5196 % o wand: the magick wand.
5198 % o x: the image x-resolution.
5200 % o y: the image y-resolution.
5203 WandExport MagickBooleanType MagickGetImageResolution(MagickWand *wand,
5204 double *x,double *y)
5206 assert(wand != (MagickWand *) NULL);
5207 assert(wand->signature == WandSignature);
5208 if (wand->debug != MagickFalse)
5209 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5210 if (wand->images == (Image *) NULL)
5211 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5212 *x=wand->images->x_resolution;
5213 *y=wand->images->y_resolution;
5218 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5222 % M a g i c k G e t I m a g e S c e n e %
5226 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5228 % MagickGetImageScene() gets the image scene.
5230 % The format of the MagickGetImageScene method is:
5232 % size_t MagickGetImageScene(MagickWand *wand)
5234 % A description of each parameter follows:
5236 % o wand: the magick wand.
5239 WandExport size_t MagickGetImageScene(MagickWand *wand)
5241 assert(wand != (MagickWand *) NULL);
5242 assert(wand->signature == WandSignature);
5243 if (wand->debug != MagickFalse)
5244 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5245 if (wand->images == (Image *) NULL)
5246 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5247 return(wand->images->scene);
5251 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5255 % M a g i c k G e t I m a g e S i g n a t u r e %
5259 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5261 % MagickGetImageSignature() generates an SHA-256 message digest for the image
5264 % The format of the MagickGetImageSignature method is:
5266 % const char MagickGetImageSignature(MagickWand *wand)
5268 % A description of each parameter follows:
5270 % o wand: the magick wand.
5273 WandExport char *MagickGetImageSignature(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)
5287 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5288 "ContainsNoImages","`%s'",wand->name);
5289 return((char *) NULL);
5291 status=SignatureImage(wand->images);
5292 if (status == MagickFalse)
5293 InheritException(wand->exception,&wand->images->exception);
5294 value=GetImageProperty(wand->images,"signature");
5295 if (value != (const char *) NULL)
5296 return(AcquireString(value));
5297 InheritException(wand->exception,&wand->images->exception);
5298 return((char *) NULL);
5302 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5306 % 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 %
5310 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5312 % MagickGetImageTicksPerSecond() gets the image ticks-per-second.
5314 % The format of the MagickGetImageTicksPerSecond method is:
5316 % size_t MagickGetImageTicksPerSecond(MagickWand *wand)
5318 % A description of each parameter follows:
5320 % o wand: the magick wand.
5323 WandExport size_t MagickGetImageTicksPerSecond(MagickWand *wand)
5325 assert(wand != (MagickWand *) NULL);
5326 assert(wand->signature == WandSignature);
5327 if (wand->debug != MagickFalse)
5328 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5329 if (wand->images == (Image *) NULL)
5330 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5331 return((size_t) wand->images->ticks_per_second);
5335 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5339 % M a g i c k G e t I m a g e T y p e %
5343 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5345 % MagickGetImageType() gets the potential image type:
5347 % Bilevel Grayscale GrayscaleMatte
5348 % Palette PaletteMatte TrueColor
5349 % TrueColorMatte ColorSeparation ColorSeparationMatte
5351 % To ensure the image type matches its potential, use MagickSetImageType():
5353 % (void) MagickSetImageType(wand,MagickGetImageType(wand));
5355 % The format of the MagickGetImageType method is:
5357 % ImageType MagickGetImageType(MagickWand *wand)
5359 % A description of each parameter follows:
5361 % o wand: the magick wand.
5364 WandExport ImageType MagickGetImageType(MagickWand *wand)
5366 assert(wand != (MagickWand *) NULL);
5367 assert(wand->signature == WandSignature);
5368 if (wand->debug != MagickFalse)
5369 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5370 if (wand->images == (Image *) NULL)
5372 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5373 "ContainsNoImages","`%s'",wand->name);
5374 return(UndefinedType);
5376 return(GetImageType(wand->images,wand->exception));
5380 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5384 % M a g i c k G e t I m a g e U n i t s %
5388 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5390 % MagickGetImageUnits() gets the image units of resolution.
5392 % The format of the MagickGetImageUnits method is:
5394 % ResolutionType MagickGetImageUnits(MagickWand *wand)
5396 % A description of each parameter follows:
5398 % o wand: the magick wand.
5401 WandExport ResolutionType MagickGetImageUnits(MagickWand *wand)
5403 assert(wand != (MagickWand *) NULL);
5404 assert(wand->signature == WandSignature);
5405 if (wand->debug != MagickFalse)
5406 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5407 if (wand->images == (Image *) NULL)
5409 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5410 "ContainsNoImages","`%s'",wand->name);
5411 return(UndefinedResolution);
5413 return(wand->images->units);
5417 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5421 % 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 %
5425 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5427 % MagickGetImageVirtualPixelMethod() returns the virtual pixel method for the
5430 % The format of the MagickGetImageVirtualPixelMethod method is:
5432 % VirtualPixelMethod MagickGetImageVirtualPixelMethod(MagickWand *wand)
5434 % A description of each parameter follows:
5436 % o wand: the magick wand.
5439 WandExport VirtualPixelMethod MagickGetImageVirtualPixelMethod(MagickWand *wand)
5441 assert(wand != (MagickWand *) NULL);
5442 assert(wand->signature == WandSignature);
5443 if (wand->debug != MagickFalse)
5444 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5445 if (wand->images == (Image *) NULL)
5447 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5448 "ContainsNoImages","`%s'",wand->name);
5449 return(UndefinedVirtualPixelMethod);
5451 return(GetImageVirtualPixelMethod(wand->images));
5455 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5459 % M a g i c k G e t I m a g e W h i t e P o i n t %
5463 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5465 % MagickGetImageWhitePoint() returns the chromaticy white point.
5467 % The format of the MagickGetImageWhitePoint method is:
5469 % MagickBooleanType MagickGetImageWhitePoint(MagickWand *wand,double *x,
5472 % A description of each parameter follows:
5474 % o wand: the magick wand.
5476 % o x: the chromaticity white x-point.
5478 % o y: the chromaticity white y-point.
5481 WandExport MagickBooleanType MagickGetImageWhitePoint(MagickWand *wand,
5482 double *x,double *y)
5484 assert(wand != (MagickWand *) NULL);
5485 assert(wand->signature == WandSignature);
5486 if (wand->debug != MagickFalse)
5487 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5488 if (wand->images == (Image *) NULL)
5489 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5490 *x=wand->images->chromaticity.white_point.x;
5491 *y=wand->images->chromaticity.white_point.y;
5496 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5500 % M a g i c k G e t I m a g e W i d t h %
5504 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5506 % MagickGetImageWidth() returns the image width.
5508 % The format of the MagickGetImageWidth method is:
5510 % size_t MagickGetImageWidth(MagickWand *wand)
5512 % A description of each parameter follows:
5514 % o wand: the magick wand.
5517 WandExport size_t MagickGetImageWidth(MagickWand *wand)
5519 assert(wand != (MagickWand *) NULL);
5520 assert(wand->signature == WandSignature);
5521 if (wand->debug != MagickFalse)
5522 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5523 if (wand->images == (Image *) NULL)
5524 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5525 return(wand->images->columns);
5529 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5533 % M a g i c k G e t N u m b e r I m a g e s %
5537 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5539 % MagickGetNumberImages() returns the number of images associated with a
5542 % The format of the MagickGetNumberImages method is:
5544 % size_t MagickGetNumberImages(MagickWand *wand)
5546 % A description of each parameter follows:
5548 % o wand: the magick wand.
5551 WandExport size_t MagickGetNumberImages(MagickWand *wand)
5553 assert(wand != (MagickWand *) NULL);
5554 assert(wand->signature == WandSignature);
5555 if (wand->debug != MagickFalse)
5556 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5557 return(GetImageListLength(wand->images));
5561 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5565 % 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 %
5569 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5571 % MagickGetImageTotalInkDensity() gets the image total ink density.
5573 % The format of the MagickGetImageTotalInkDensity method is:
5575 % double MagickGetImageTotalInkDensity(MagickWand *wand)
5577 % A description of each parameter follows:
5579 % o wand: the magick wand.
5582 WandExport double MagickGetImageTotalInkDensity(MagickWand *wand)
5584 assert(wand != (MagickWand *) NULL);
5585 assert(wand->signature == WandSignature);
5586 if (wand->debug != MagickFalse)
5587 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5588 if (wand->images == (Image *) NULL)
5590 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5591 "ContainsNoImages","`%s'",wand->name);
5594 return(GetImageTotalInkDensity(wand->images));
5598 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5602 % M a g i c k H a l d C l u t I m a g e %
5606 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5608 % MagickHaldClutImage() replaces colors in the image from a Hald color lookup
5609 % table. A Hald color lookup table is a 3-dimensional color cube mapped to 2
5610 % dimensions. Create it with the HALD coder. You can apply any color
5611 % transformation to the Hald image and then use this method to apply the
5612 % transform to the image.
5614 % The format of the MagickHaldClutImage method is:
5616 % MagickBooleanType MagickHaldClutImage(MagickWand *wand,
5617 % const MagickWand *hald_wand)
5619 % A description of each parameter follows:
5621 % o wand: the magick wand.
5623 % o hald_image: the hald CLUT image.
5626 WandExport MagickBooleanType MagickHaldClutImage(MagickWand *wand,
5627 const MagickWand *hald_wand)
5632 assert(wand != (MagickWand *) NULL);
5633 assert(wand->signature == WandSignature);
5634 if (wand->debug != MagickFalse)
5635 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5636 if ((wand->images == (Image *) NULL) || (hald_wand->images == (Image *) NULL))
5637 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5638 status=HaldClutImage(wand->images,hald_wand->images);
5639 if (status == MagickFalse)
5640 InheritException(wand->exception,&wand->images->exception);
5645 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5649 % M a g i c k H a s N e x t I m a g e %
5653 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5655 % MagickHasNextImage() returns MagickTrue if the wand has more images when
5656 % traversing the list in the forward direction
5658 % The format of the MagickHasNextImage method is:
5660 % MagickBooleanType MagickHasNextImage(MagickWand *wand)
5662 % A description of each parameter follows:
5664 % o wand: the magick wand.
5667 WandExport MagickBooleanType MagickHasNextImage(MagickWand *wand)
5669 assert(wand != (MagickWand *) NULL);
5670 assert(wand->signature == WandSignature);
5671 if (wand->debug != MagickFalse)
5672 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5673 if (wand->images == (Image *) NULL)
5674 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5675 if (GetNextImageInList(wand->images) == (Image *) NULL)
5676 return(MagickFalse);
5681 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5685 % M a g i c k H a s P r e v i o u s I m a g e %
5689 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5691 % MagickHasPreviousImage() returns MagickTrue if the wand has more images when
5692 % traversing the list in the reverse direction
5694 % The format of the MagickHasPreviousImage method is:
5696 % MagickBooleanType MagickHasPreviousImage(MagickWand *wand)
5698 % A description of each parameter follows:
5700 % o wand: the magick wand.
5703 WandExport MagickBooleanType MagickHasPreviousImage(MagickWand *wand)
5705 assert(wand != (MagickWand *) NULL);
5706 assert(wand->signature == WandSignature);
5707 if (wand->debug != MagickFalse)
5708 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5709 if (wand->images == (Image *) NULL)
5710 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5711 if (GetPreviousImageInList(wand->images) == (Image *) NULL)
5712 return(MagickFalse);
5717 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5721 % M a g i c k I d e n t i f y I m a g e %
5725 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5727 % MagickIdentifyImage() identifies an image by printing its attributes to the
5728 % file. Attributes include the image width, height, size, and others.
5730 % The format of the MagickIdentifyImage method is:
5732 % const char *MagickIdentifyImage(MagickWand *wand)
5734 % A description of each parameter follows:
5736 % o wand: the magick wand.
5739 WandExport char *MagickIdentifyImage(MagickWand *wand)
5743 filename[MaxTextExtent];
5751 assert(wand != (MagickWand *) NULL);
5752 assert(wand->signature == WandSignature);
5753 if (wand->debug != MagickFalse)
5754 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5755 if (wand->images == (Image *) NULL)
5757 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5758 "ContainsNoImages","`%s'",wand->name);
5759 return((char *) NULL);
5761 description=(char *) NULL;
5762 unique_file=AcquireUniqueFileResource(filename);
5764 if (unique_file != -1)
5765 file=fdopen(unique_file,"wb");
5766 if ((unique_file == -1) || (file == (FILE *) NULL))
5768 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5769 "UnableToCreateTemporaryFile","`%s'",wand->name);
5770 return((char *) NULL);
5772 (void) IdentifyImage(wand->images,file,MagickTrue);
5773 (void) fclose(file);
5774 description=FileToString(filename,~0,wand->exception);
5775 (void) RelinquishUniqueFileResource(filename);
5776 return(description);
5780 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5784 % M a g i c k I m p l o d e I m a g e %
5788 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5790 % MagickImplodeImage() creates a new image that is a copy of an existing
5791 % one with the image pixels "implode" by the specified percentage. It
5792 % allocates the memory necessary for the new Image structure and returns a
5793 % pointer to the new image.
5795 % The format of the MagickImplodeImage method is:
5797 % MagickBooleanType MagickImplodeImage(MagickWand *wand,
5798 % const double radius)
5800 % A description of each parameter follows:
5802 % o wand: the magick wand.
5804 % o amount: Define the extent of the implosion.
5807 WandExport MagickBooleanType MagickImplodeImage(MagickWand *wand,
5808 const double amount)
5813 assert(wand != (MagickWand *) NULL);
5814 assert(wand->signature == WandSignature);
5815 if (wand->debug != MagickFalse)
5816 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5817 if (wand->images == (Image *) NULL)
5818 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5819 implode_image=ImplodeImage(wand->images,amount,wand->exception);
5820 if (implode_image == (Image *) NULL)
5821 return(MagickFalse);
5822 ReplaceImageInList(&wand->images,implode_image);
5827 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5831 % M a g i c k I m p o r t I m a g e P i x e l s %
5835 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5837 % MagickImportImagePixels() accepts pixel datand stores it in the image at the
5838 % location you specify. The method returns MagickFalse on success otherwise
5839 % MagickTrue if an error is encountered. The pixel data can be either char,
5840 % short int, int, ssize_t, float, or double in the order specified by map.
5842 % Suppose your want to upload the first scanline of a 640x480 image from
5843 % character data in red-green-blue order:
5845 % MagickImportImagePixels(wand,0,0,640,1,"RGB",CharPixel,pixels);
5847 % The format of the MagickImportImagePixels method is:
5849 % MagickBooleanType MagickImportImagePixels(MagickWand *wand,
5850 % const ssize_t x,const ssize_t y,const size_t columns,
5851 % const size_t rows,const char *map,const StorageType storage,
5852 % const void *pixels)
5854 % A description of each parameter follows:
5856 % o wand: the magick wand.
5858 % o x, y, columns, rows: These values define the perimeter of a region
5859 % of pixels you want to define.
5861 % o map: This string reflects the expected ordering of the pixel array.
5862 % It can be any combination or order of R = red, G = green, B = blue,
5863 % A = alpha (0 is transparent), O = opacity (0 is opaque), C = cyan,
5864 % Y = yellow, M = magenta, K = black, I = intensity (for grayscale),
5867 % o storage: Define the data type of the pixels. Float and double types are
5868 % expected to be normalized [0..1] otherwise [0..QuantumRange]. Choose from
5869 % these types: CharPixel, ShortPixel, IntegerPixel, LongPixel, FloatPixel,
5872 % o pixels: This array of values contain the pixel components as defined by
5873 % map and type. You must preallocate this array where the expected
5874 % length varies depending on the values of width, height, map, and type.
5877 WandExport MagickBooleanType MagickImportImagePixels(MagickWand *wand,
5878 const ssize_t x,const ssize_t y,const size_t columns,
5879 const size_t rows,const char *map,const StorageType storage,
5885 assert(wand != (MagickWand *) NULL);
5886 assert(wand->signature == WandSignature);
5887 if (wand->debug != MagickFalse)
5888 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5889 if (wand->images == (Image *) NULL)
5890 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5891 status=ImportImagePixels(wand->images,x,y,columns,rows,map,storage,pixels);
5892 if (status == MagickFalse)
5893 InheritException(wand->exception,&wand->images->exception);
5898 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5902 % 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 %
5906 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5908 % MagickInverseFourierTransformImage() implements the inverse discrete
5909 % Fourier transform (DFT) of the image either as a magnitude / phase or real /
5910 % imaginary image pair.
5912 % The format of the MagickInverseFourierTransformImage method is:
5914 % MagickBooleanType MagickInverseFourierTransformImage(
5915 % MagickWand *magnitude_wand,MagickWand *phase_wand,
5916 % const MagickBooleanType magnitude)
5918 % A description of each parameter follows:
5920 % o magnitude_wand: the magnitude or real wand.
5922 % o phase_wand: the phase or imaginary wand.
5924 % o magnitude: if true, return as magnitude / phase pair otherwise a real /
5925 % imaginary image pair.
5928 WandExport MagickBooleanType MagickInverseFourierTransformImage(
5929 MagickWand *magnitude_wand,MagickWand *phase_wand,
5930 const MagickBooleanType magnitude)
5938 assert(magnitude_wand != (MagickWand *) NULL);
5939 assert(magnitude_wand->signature == WandSignature);
5940 if (magnitude_wand->debug != MagickFalse)
5941 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",
5942 magnitude_wand->name);
5943 wand=magnitude_wand;
5944 if (magnitude_wand->images == (Image *) NULL)
5945 ThrowWandException(WandError,"ContainsNoImages",
5946 magnitude_wand->name);
5947 assert(phase_wand != (MagickWand *) NULL);
5948 assert(phase_wand->signature == WandSignature);
5949 inverse_image=InverseFourierTransformImage(magnitude_wand->images,
5950 phase_wand->images,magnitude,wand->exception);
5951 if (inverse_image == (Image *) NULL)
5952 return(MagickFalse);
5953 ReplaceImageInList(&wand->images,inverse_image);
5958 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5962 % M a g i c k L a b e l I m a g e %
5966 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5968 % MagickLabelImage() adds a label to your image.
5970 % The format of the MagickLabelImage method is:
5972 % MagickBooleanType MagickLabelImage(MagickWand *wand,const char *label)
5974 % A description of each parameter follows:
5976 % o wand: the magick wand.
5978 % o label: the image label.
5981 WandExport MagickBooleanType MagickLabelImage(MagickWand *wand,
5987 assert(wand != (MagickWand *) NULL);
5988 assert(wand->signature == WandSignature);
5989 if (wand->debug != MagickFalse)
5990 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5991 if (wand->images == (Image *) NULL)
5992 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5993 status=SetImageProperty(wand->images,"label",label);
5994 if (status == MagickFalse)
5995 InheritException(wand->exception,&wand->images->exception);
6000 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6004 % M a g i c k L e v e l I m a g e %
6008 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6010 % MagickLevelImage() adjusts the levels of an image by scaling the colors
6011 % falling between specified white and black points to the full available
6012 % quantum range. The parameters provided represent the black, mid, and white
6013 % points. The black point specifies the darkest color in the image. Colors
6014 % darker than the black point are set to zero. Mid point specifies a gamma
6015 % correction to apply to the image. White point specifies the lightest color
6016 % in the image. Colors brighter than the white point are set to the maximum
6019 % The format of the MagickLevelImage method is:
6021 % MagickBooleanType MagickLevelImage(MagickWand *wand,
6022 % const double black_point,const double gamma,const double white_point)
6023 % MagickBooleanType MagickLevelImage(MagickWand *wand,
6024 % const ChannelType channel,const double black_point,const double gamma,
6025 % const double white_point)
6027 % A description of each parameter follows:
6029 % o wand: the magick wand.
6031 % o channel: Identify which channel to level: RedChannel, GreenChannel,
6033 % o black_point: the black point.
6035 % o gamma: the gamma.
6037 % o white_point: the white point.
6040 WandExport MagickBooleanType MagickLevelImage(MagickWand *wand,
6041 const double black_point,const double gamma,const double white_point)
6046 assert(wand != (MagickWand *) NULL);
6047 assert(wand->signature == WandSignature);
6048 if (wand->debug != MagickFalse)
6049 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6050 if (wand->images == (Image *) NULL)
6051 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6052 status=LevelImage(wand->images,black_point,white_point,gamma,
6053 &wand->images->exception);
6058 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6062 % M a g i c k L i n e a r S t r e t c h I m a g e %
6066 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6068 % MagickLinearStretchImage() stretches with saturation the image intensity.
6070 % You can also reduce the influence of a particular channel with a gamma
6073 % The format of the MagickLinearStretchImage method is:
6075 % MagickBooleanType MagickLinearStretchImage(MagickWand *wand,
6076 % const double black_point,const double white_point)
6078 % A description of each parameter follows:
6080 % o wand: the magick wand.
6082 % o black_point: the black point.
6084 % o white_point: the white point.
6087 WandExport MagickBooleanType MagickLinearStretchImage(MagickWand *wand,
6088 const double black_point,const double white_point)
6093 assert(wand != (MagickWand *) NULL);
6094 assert(wand->signature == WandSignature);
6095 if (wand->debug != MagickFalse)
6096 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6097 if (wand->images == (Image *) NULL)
6098 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6099 status=LinearStretchImage(wand->images,black_point,white_point);
6100 if (status == MagickFalse)
6101 InheritException(wand->exception,&wand->images->exception);
6106 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6110 % M a g i c k L i q u i d R e s c a l e I m a g e %
6114 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6116 % MagickLiquidRescaleImage() rescales image with seam carving.
6118 % MagickBooleanType MagickLiquidRescaleImage(MagickWand *wand,
6119 % const size_t columns,const size_t rows,
6120 % const double delta_x,const double rigidity)
6122 % A description of each parameter follows:
6124 % o wand: the magick wand.
6126 % o columns: the number of columns in the scaled image.
6128 % o rows: the number of rows in the scaled image.
6130 % o delta_x: maximum seam transversal step (0 means straight seams).
6132 % o rigidity: introduce a bias for non-straight seams (typically 0).
6135 WandExport MagickBooleanType MagickLiquidRescaleImage(MagickWand *wand,
6136 const size_t columns,const size_t rows,const double delta_x,
6137 const double rigidity)
6142 assert(wand != (MagickWand *) NULL);
6143 assert(wand->signature == WandSignature);
6144 if (wand->debug != MagickFalse)
6145 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6146 if (wand->images == (Image *) NULL)
6147 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6148 rescale_image=LiquidRescaleImage(wand->images,columns,rows,delta_x,
6149 rigidity,wand->exception);
6150 if (rescale_image == (Image *) NULL)
6151 return(MagickFalse);
6152 ReplaceImageInList(&wand->images,rescale_image);
6157 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6161 % M a g i c k M a g n i f y I m a g e %
6165 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6167 % MagickMagnifyImage() is a convenience method that scales an image
6168 % proportionally to twice its original size.
6170 % The format of the MagickMagnifyImage method is:
6172 % MagickBooleanType MagickMagnifyImage(MagickWand *wand)
6174 % A description of each parameter follows:
6176 % o wand: the magick wand.
6179 WandExport MagickBooleanType MagickMagnifyImage(MagickWand *wand)
6184 assert(wand != (MagickWand *) NULL);
6185 assert(wand->signature == WandSignature);
6186 if (wand->debug != MagickFalse)
6187 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6188 if (wand->images == (Image *) NULL)
6189 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6190 magnify_image=MagnifyImage(wand->images,wand->exception);
6191 if (magnify_image == (Image *) NULL)
6192 return(MagickFalse);
6193 ReplaceImageInList(&wand->images,magnify_image);
6198 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6202 % M a g i c k M e r g e I m a g e L a y e r s %
6206 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6208 % MagickMergeImageLayers() composes all the image layers from the current
6209 % given image onward to produce a single image of the merged layers.
6211 % The inital canvas's size depends on the given ImageLayerMethod, and is
6212 % initialized using the first images background color. The images
6213 % are then compositied onto that image in sequence using the given
6214 % composition that has been assigned to each individual image.
6216 % The format of the MagickMergeImageLayers method is:
6218 % MagickWand *MagickMergeImageLayers(MagickWand *wand,
6219 % const ImageLayerMethod method)
6221 % A description of each parameter follows:
6223 % o wand: the magick wand.
6225 % o method: the method of selecting the size of the initial canvas.
6227 % MergeLayer: Merge all layers onto a canvas just large enough
6228 % to hold all the actual images. The virtual canvas of the
6229 % first image is preserved but otherwise ignored.
6231 % FlattenLayer: Use the virtual canvas size of first image.
6232 % Images which fall outside this canvas is clipped.
6233 % This can be used to 'fill out' a given virtual canvas.
6235 % MosaicLayer: Start with the virtual canvas of the first image,
6236 % enlarging left and right edges to contain all images.
6237 % Images with negative offsets will be clipped.
6240 WandExport MagickWand *MagickMergeImageLayers(MagickWand *wand,
6241 const ImageLayerMethod method)
6246 assert(wand != (MagickWand *) NULL);
6247 assert(wand->signature == WandSignature);
6248 if (wand->debug != MagickFalse)
6249 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6250 if (wand->images == (Image *) NULL)
6251 return((MagickWand *) NULL);
6252 mosaic_image=MergeImageLayers(wand->images,method,wand->exception);
6253 if (mosaic_image == (Image *) NULL)
6254 return((MagickWand *) NULL);
6255 return(CloneMagickWandFromImages(wand,mosaic_image));
6259 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6263 % M a g i c k M i n i f y I m a g e %
6267 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6269 % MagickMinifyImage() is a convenience method that scales an image
6270 % proportionally to one-half its original size
6272 % The format of the MagickMinifyImage method is:
6274 % MagickBooleanType MagickMinifyImage(MagickWand *wand)
6276 % A description of each parameter follows:
6278 % o wand: the magick wand.
6281 WandExport MagickBooleanType MagickMinifyImage(MagickWand *wand)
6286 assert(wand != (MagickWand *) NULL);
6287 assert(wand->signature == WandSignature);
6288 if (wand->debug != MagickFalse)
6289 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6290 if (wand->images == (Image *) NULL)
6291 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6292 minify_image=MinifyImage(wand->images,wand->exception);
6293 if (minify_image == (Image *) NULL)
6294 return(MagickFalse);
6295 ReplaceImageInList(&wand->images,minify_image);
6300 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6304 % M a g i c k M o d u l a t e I m a g e %
6308 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6310 % MagickModulateImage() lets you control the brightness, saturation, and hue
6311 % of an image. Hue is the percentage of absolute rotation from the current
6312 % position. For example 50 results in a counter-clockwise rotation of 90
6313 % degrees, 150 results in a clockwise rotation of 90 degrees, with 0 and 200
6314 % both resulting in a rotation of 180 degrees.
6316 % To increase the color brightness by 20% and decrease the color saturation by
6317 % 10% and leave the hue unchanged, use: 120,90,100.
6319 % The format of the MagickModulateImage method is:
6321 % MagickBooleanType MagickModulateImage(MagickWand *wand,
6322 % const double brightness,const double saturation,const double hue)
6324 % A description of each parameter follows:
6326 % o wand: the magick wand.
6328 % o brightness: the percent change in brighness.
6330 % o saturation: the percent change in saturation.
6332 % o hue: the percent change in hue.
6335 WandExport MagickBooleanType MagickModulateImage(MagickWand *wand,
6336 const double brightness,const double saturation,const double hue)
6339 modulate[MaxTextExtent];
6344 assert(wand != (MagickWand *) NULL);
6345 assert(wand->signature == WandSignature);
6346 if (wand->debug != MagickFalse)
6347 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6348 if (wand->images == (Image *) NULL)
6349 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6350 (void) FormatLocaleString(modulate,MaxTextExtent,"%g,%g,%g",
6351 brightness,saturation,hue);
6352 status=ModulateImage(wand->images,modulate);
6353 if (status == MagickFalse)
6354 InheritException(wand->exception,&wand->images->exception);
6359 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6363 % M a g i c k M o n t a g e I m a g e %
6367 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6369 % MagickMontageImage() creates a composite image by combining several
6370 % separate images. The images are tiled on the composite image with the name
6371 % of the image optionally appearing just below the individual tile.
6373 % The format of the MagickMontageImage method is:
6375 % MagickWand *MagickMontageImage(MagickWand *wand,
6376 % const DrawingWand drawing_wand,const char *tile_geometry,
6377 % const char *thumbnail_geometry,const MontageMode mode,
6378 % const char *frame)
6380 % A description of each parameter follows:
6382 % o wand: the magick wand.
6384 % o drawing_wand: the drawing wand. The font name, size, and color are
6385 % obtained from this wand.
6387 % o tile_geometry: the number of tiles per row and page (e.g. 6x4+0+0).
6389 % o thumbnail_geometry: Preferred image size and border size of each
6390 % thumbnail (e.g. 120x120+4+3>).
6392 % o mode: Thumbnail framing mode: Frame, Unframe, or Concatenate.
6394 % o frame: Surround the image with an ornamental border (e.g. 15x15+3+3).
6395 % The frame color is that of the thumbnail's matte color.
6398 WandExport MagickWand *MagickMontageImage(MagickWand *wand,
6399 const DrawingWand *drawing_wand,const char *tile_geometry,
6400 const char *thumbnail_geometry,const MontageMode mode,const char *frame)
6414 assert(wand != (MagickWand *) NULL);
6415 assert(wand->signature == WandSignature);
6416 if (wand->debug != MagickFalse)
6417 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6418 if (wand->images == (Image *) NULL)
6419 return((MagickWand *) NULL);
6420 montage_info=CloneMontageInfo(wand->image_info,(MontageInfo *) NULL);
6425 (void) CloneString(&montage_info->frame,"15x15+3+3");
6426 montage_info->shadow=MagickTrue;
6431 montage_info->frame=(char *) NULL;
6432 montage_info->shadow=MagickFalse;
6433 montage_info->border_width=0;
6436 case ConcatenateMode:
6438 montage_info->frame=(char *) NULL;
6439 montage_info->shadow=MagickFalse;
6440 (void) CloneString(&montage_info->geometry,"+0+0");
6441 montage_info->border_width=0;
6447 font=DrawGetFont(drawing_wand);
6448 if (font != (char *) NULL)
6449 (void) CloneString(&montage_info->font,font);
6450 if (frame != (char *) NULL)
6451 (void) CloneString(&montage_info->frame,frame);
6452 montage_info->pointsize=DrawGetFontSize(drawing_wand);
6453 pixel_wand=NewPixelWand();
6454 DrawGetFillColor(drawing_wand,pixel_wand);
6455 PixelGetQuantumPacket(pixel_wand,&montage_info->fill);
6456 DrawGetStrokeColor(drawing_wand,pixel_wand);
6457 PixelGetQuantumPacket(pixel_wand,&montage_info->stroke);
6458 pixel_wand=DestroyPixelWand(pixel_wand);
6459 if (thumbnail_geometry != (char *) NULL)
6460 (void) CloneString(&montage_info->geometry,thumbnail_geometry);
6461 if (tile_geometry != (char *) NULL)
6462 (void) CloneString(&montage_info->tile,tile_geometry);
6463 montage_image=MontageImageList(wand->image_info,montage_info,wand->images,
6465 montage_info=DestroyMontageInfo(montage_info);
6466 if (montage_image == (Image *) NULL)
6467 return((MagickWand *) NULL);
6468 return(CloneMagickWandFromImages(wand,montage_image));
6472 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6476 % M a g i c k M o r p h I m a g e s %
6480 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6482 % MagickMorphImages() method morphs a set of images. Both the image pixels
6483 % and size are linearly interpolated to give the appearance of a
6484 % meta-morphosis from one image to the next.
6486 % The format of the MagickMorphImages method is:
6488 % MagickWand *MagickMorphImages(MagickWand *wand,
6489 % const size_t number_frames)
6491 % A description of each parameter follows:
6493 % o wand: the magick wand.
6495 % o number_frames: the number of in-between images to generate.
6498 WandExport MagickWand *MagickMorphImages(MagickWand *wand,
6499 const size_t number_frames)
6504 assert(wand != (MagickWand *) NULL);
6505 assert(wand->signature == WandSignature);
6506 if (wand->debug != MagickFalse)
6507 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6508 if (wand->images == (Image *) NULL)
6509 return((MagickWand *) NULL);
6510 morph_image=MorphImages(wand->images,number_frames,wand->exception);
6511 if (morph_image == (Image *) NULL)
6512 return((MagickWand *) NULL);
6513 return(CloneMagickWandFromImages(wand,morph_image));
6517 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6521 % M a g i c k M o r p h o l o g y I m a g e %
6525 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6527 % MagickMorphologyImage() applies a user supplied kernel to the image
6528 % according to the given mophology method.
6530 % The format of the MagickMorphologyImage method is:
6532 % MagickBooleanType MagickMorphologyImage(MagickWand *wand,
6533 % MorphologyMethod method,const ssize_t iterations,KernelInfo *kernel)
6535 % A description of each parameter follows:
6537 % o wand: the magick wand.
6539 % o method: the morphology method to be applied.
6541 % o iterations: apply the operation this many times (or no change).
6542 % A value of -1 means loop until no change found. How this is applied
6543 % may depend on the morphology method. Typically this is a value of 1.
6545 % o kernel: An array of doubles representing the morphology kernel.
6548 WandExport MagickBooleanType MagickMorphologyImage(MagickWand *wand,
6549 MorphologyMethod method,const ssize_t iterations,KernelInfo *kernel)
6554 assert(wand != (MagickWand *) NULL);
6555 assert(wand->signature == WandSignature);
6556 if (wand->debug != MagickFalse)
6557 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6558 if (kernel == (const KernelInfo *) NULL)
6559 return(MagickFalse);
6560 if (wand->images == (Image *) NULL)
6561 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6562 morphology_image=MorphologyImage(wand->images,method,iterations,kernel,
6564 if (morphology_image == (Image *) NULL)
6565 return(MagickFalse);
6566 ReplaceImageInList(&wand->images,morphology_image);
6571 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6575 % M a g i c k M o t i o n B l u r I m a g e %
6579 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6581 % MagickMotionBlurImage() simulates motion blur. We convolve the image with a
6582 % Gaussian operator of the given radius and standard deviation (sigma).
6583 % For reasonable results, radius should be larger than sigma. Use a
6584 % radius of 0 and MotionBlurImage() selects a suitable radius for you.
6585 % Angle gives the angle of the blurring motion.
6587 % The format of the MagickMotionBlurImage method is:
6589 % MagickBooleanType MagickMotionBlurImage(MagickWand *wand,
6590 % const double radius,const double sigma,const double angle)
6592 % A description of each parameter follows:
6594 % o wand: the magick wand.
6596 % o radius: the radius of the Gaussian, in pixels, not counting
6599 % o sigma: the standard deviation of the Gaussian, in pixels.
6601 % o angle: Apply the effect along this angle.
6604 WandExport MagickBooleanType MagickMotionBlurImage(MagickWand *wand,
6605 const double radius,const double sigma,const double angle)
6610 assert(wand != (MagickWand *) NULL);
6611 assert(wand->signature == WandSignature);
6612 if (wand->debug != MagickFalse)
6613 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6614 if (wand->images == (Image *) NULL)
6615 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6616 blur_image=MotionBlurImage(wand->images,radius,sigma,angle,wand->exception);
6617 if (blur_image == (Image *) NULL)
6618 return(MagickFalse);
6619 ReplaceImageInList(&wand->images,blur_image);
6624 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6628 % M a g i c k N e g a t e I m a g e %
6632 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6634 % MagickNegateImage() negates the colors in the reference image. The
6635 % Grayscale option means that only grayscale values within the image are
6638 % You can also reduce the influence of a particular channel with a gamma
6641 % The format of the MagickNegateImage method is:
6643 % MagickBooleanType MagickNegateImage(MagickWand *wand,
6644 % const MagickBooleanType gray)
6646 % A description of each parameter follows:
6648 % o wand: the magick wand.
6650 % o gray: If MagickTrue, only negate grayscale pixels within the image.
6653 WandExport MagickBooleanType MagickNegateImage(MagickWand *wand,
6654 const MagickBooleanType gray)
6659 assert(wand != (MagickWand *) NULL);
6660 assert(wand->signature == WandSignature);
6661 if (wand->debug != MagickFalse)
6662 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6663 if (wand->images == (Image *) NULL)
6664 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6665 status=NegateImage(wand->images,gray,wand->exception);
6670 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6674 % M a g i c k N e w I m a g e %
6678 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6680 % MagickNewImage() adds a blank image canvas of the specified size and
6681 % background color to the wand.
6683 % The format of the MagickNewImage method is:
6685 % MagickBooleanType MagickNewImage(MagickWand *wand,
6686 % const size_t columns,const size_t rows,
6687 % const PixelWand *background)
6689 % A description of each parameter follows:
6691 % o wand: the magick wand.
6693 % o width: the image width.
6695 % o height: the image height.
6697 % o background: the image color.
6700 WandExport MagickBooleanType MagickNewImage(MagickWand *wand,
6701 const size_t width,const size_t height,
6702 const PixelWand *background)
6710 assert(wand != (MagickWand *) NULL);
6711 assert(wand->signature == WandSignature);
6712 if (wand->debug != MagickFalse)
6713 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6714 PixelGetMagickColor(background,&pixel);
6715 images=NewMagickImage(wand->image_info,width,height,&pixel);
6716 if (images == (Image *) NULL)
6717 return(MagickFalse);
6718 if (images->exception.severity != UndefinedException)
6719 InheritException(wand->exception,&images->exception);
6720 return(InsertImageInWand(wand,images));
6724 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6728 % M a g i c k N e x t I m a g e %
6732 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6734 % MagickNextImage() associates the next image in the image list with a magick
6737 % The format of the MagickNextImage method is:
6739 % MagickBooleanType MagickNextImage(MagickWand *wand)
6741 % A description of each parameter follows:
6743 % o wand: the magick wand.
6746 WandExport MagickBooleanType MagickNextImage(MagickWand *wand)
6748 assert(wand != (MagickWand *) NULL);
6749 assert(wand->signature == WandSignature);
6750 if (wand->debug != MagickFalse)
6751 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6752 if (wand->images == (Image *) NULL)
6753 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6754 if (wand->pend != MagickFalse)
6756 wand->pend=MagickFalse;
6759 if (GetNextImageInList(wand->images) == (Image *) NULL)
6761 wand->pend=MagickTrue;
6762 return(MagickFalse);
6764 wand->images=GetNextImageInList(wand->images);
6769 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6773 % M a g i c k N o r m a l i z e I m a g e %
6777 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6779 % MagickNormalizeImage() enhances the contrast of a color image by adjusting
6780 % the pixels color to span the entire range of colors available
6782 % You can also reduce the influence of a particular channel with a gamma
6785 % The format of the MagickNormalizeImage method is:
6787 % MagickBooleanType MagickNormalizeImage(MagickWand *wand)
6789 % A description of each parameter follows:
6791 % o wand: the magick wand.
6794 WandExport MagickBooleanType MagickNormalizeImage(MagickWand *wand)
6799 assert(wand != (MagickWand *) NULL);
6800 assert(wand->signature == WandSignature);
6801 if (wand->debug != MagickFalse)
6802 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6803 if (wand->images == (Image *) NULL)
6804 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6805 status=NormalizeImage(wand->images);
6806 if (status == MagickFalse)
6807 InheritException(wand->exception,&wand->images->exception);
6812 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6816 % M a g i c k O i l P a i n t I m a g e %
6820 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6822 % MagickOilPaintImage() applies a special effect filter that simulates an oil
6823 % painting. Each pixel is replaced by the most frequent color occurring
6824 % in a circular region defined by radius.
6826 % The format of the MagickOilPaintImage method is:
6828 % MagickBooleanType MagickOilPaintImage(MagickWand *wand,
6829 % const double radius)
6831 % A description of each parameter follows:
6833 % o wand: the magick wand.
6835 % o radius: the radius of the circular neighborhood.
6838 WandExport MagickBooleanType MagickOilPaintImage(MagickWand *wand,
6839 const double radius)
6844 assert(wand != (MagickWand *) NULL);
6845 assert(wand->signature == WandSignature);
6846 if (wand->debug != MagickFalse)
6847 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6848 if (wand->images == (Image *) NULL)
6849 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6850 paint_image=OilPaintImage(wand->images,radius,wand->exception);
6851 if (paint_image == (Image *) NULL)
6852 return(MagickFalse);
6853 ReplaceImageInList(&wand->images,paint_image);
6858 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6862 % M a g i c k O p a q u e P a i n t I m a g e %
6866 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6868 % MagickOpaquePaintImage() changes any pixel that matches color with the color
6871 % The format of the MagickOpaquePaintImage method is:
6873 % MagickBooleanType MagickOpaquePaintImage(MagickWand *wand,
6874 % const PixelWand *target,const PixelWand *fill,const double fuzz,
6875 % const MagickBooleanType invert)
6877 % A description of each parameter follows:
6879 % o wand: the magick wand.
6881 % o target: Change this target color to the fill color within the image.
6883 % o fill: the fill pixel wand.
6885 % o fuzz: By default target must match a particular pixel color
6886 % exactly. However, in many cases two colors may differ by a small amount.
6887 % The fuzz member of image defines how much tolerance is acceptable to
6888 % consider two colors as the same. For example, set fuzz to 10 and the
6889 % color red at intensities of 100 and 102 respectively are now interpreted
6890 % as the same color for the purposes of the floodfill.
6892 % o invert: paint any pixel that does not match the target color.
6895 WandExport MagickBooleanType MagickOpaquePaintImage(MagickWand *wand,
6896 const PixelWand *target,const PixelWand *fill,const double fuzz,
6897 const MagickBooleanType invert)
6906 assert(wand != (MagickWand *) NULL);
6907 assert(wand->signature == WandSignature);
6908 if (wand->debug != MagickFalse)
6909 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6910 if (wand->images == (Image *) NULL)
6911 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6912 PixelGetMagickColor(target,&target_pixel);
6913 PixelGetMagickColor(fill,&fill_pixel);
6914 wand->images->fuzz=fuzz;
6915 status=OpaquePaintImage(wand->images,&target_pixel,&fill_pixel,invert);
6916 if (status == MagickFalse)
6917 InheritException(wand->exception,&wand->images->exception);
6922 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6926 % 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 %
6930 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6932 % MagickOptimizeImageLayers() compares each image the GIF disposed forms of the
6933 % previous image in the sequence. From this it attempts to select the
6934 % smallest cropped image to replace each frame, while preserving the results
6937 % The format of the MagickOptimizeImageLayers method is:
6939 % MagickWand *MagickOptimizeImageLayers(MagickWand *wand)
6941 % A description of each parameter follows:
6943 % o wand: the magick wand.
6946 WandExport MagickWand *MagickOptimizeImageLayers(MagickWand *wand)
6951 assert(wand != (MagickWand *) NULL);
6952 assert(wand->signature == WandSignature);
6953 if (wand->debug != MagickFalse)
6954 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6955 if (wand->images == (Image *) NULL)
6956 return((MagickWand *) NULL);
6957 optimize_image=OptimizeImageLayers(wand->images,wand->exception);
6958 if (optimize_image == (Image *) NULL)
6959 return((MagickWand *) NULL);
6960 return(CloneMagickWandFromImages(wand,optimize_image));
6964 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6968 % 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 %
6972 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6974 % MagickOrderedPosterizeImage() performs an ordered dither based on a number
6975 % of pre-defined dithering threshold maps, but over multiple intensity levels,
6976 % which can be different for different channels, according to the input
6979 % The format of the MagickOrderedPosterizeImage method is:
6981 % MagickBooleanType MagickOrderedPosterizeImage(MagickWand *wand,
6982 % const char *threshold_map)
6984 % A description of each parameter follows:
6986 % o image: the image.
6988 % o threshold_map: A string containing the name of the threshold dither
6989 % map to use, followed by zero or more numbers representing the number of
6990 % color levels tho dither between.
6992 % Any level number less than 2 is equivalent to 2, and means only binary
6993 % dithering will be applied to each color channel.
6995 % No numbers also means a 2 level (bitmap) dither will be applied to all
6996 % channels, while a single number is the number of levels applied to each
6997 % channel in sequence. More numbers will be applied in turn to each of
6998 % the color channels.
7000 % For example: "o3x3,6" generates a 6 level posterization of the image
7001 % with a ordered 3x3 diffused pixel dither being applied between each
7002 % level. While checker,8,8,4 will produce a 332 colormaped image with
7003 % only a single checkerboard hash pattern (50% grey) between each color
7004 % level, to basically double the number of color levels with a bare
7005 % minimim of dithering.
7008 WandExport MagickBooleanType MagickOrderedPosterizeImage(MagickWand *wand,
7009 const char *threshold_map)
7014 assert(wand != (MagickWand *) NULL);
7015 assert(wand->signature == WandSignature);
7016 if (wand->debug != MagickFalse)
7017 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7018 if (wand->images == (Image *) NULL)
7019 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7020 status=OrderedPosterizeImage(wand->images,threshold_map,wand->exception);
7025 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7029 % M a g i c k P i n g I m a g e %
7033 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7035 % MagickPingImage() is like MagickReadImage() except the only valid
7036 % information returned is the image width, height, size, and format. It
7037 % is designed to efficiently obtain this information from a file without
7038 % reading the entire image sequence into memory.
7040 % The format of the MagickPingImage method is:
7042 % MagickBooleanType MagickPingImage(MagickWand *wand,const char *filename)
7044 % A description of each parameter follows:
7046 % o wand: the magick wand.
7048 % o filename: the image filename.
7051 WandExport MagickBooleanType MagickPingImage(MagickWand *wand,
7052 const char *filename)
7060 assert(wand != (MagickWand *) NULL);
7061 assert(wand->signature == WandSignature);
7062 if (wand->debug != MagickFalse)
7063 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7064 ping_info=CloneImageInfo(wand->image_info);
7065 if (filename != (const char *) NULL)
7066 (void) CopyMagickString(ping_info->filename,filename,MaxTextExtent);
7067 images=PingImage(ping_info,wand->exception);
7068 ping_info=DestroyImageInfo(ping_info);
7069 if (images == (Image *) NULL)
7070 return(MagickFalse);
7071 return(InsertImageInWand(wand,images));
7075 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7079 % M a g i c k P i n g I m a g e B l o b %
7083 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7085 % MagickPingImageBlob() pings an image or image sequence from a blob.
7087 % The format of the MagickPingImageBlob method is:
7089 % MagickBooleanType MagickPingImageBlob(MagickWand *wand,
7090 % const void *blob,const size_t length)
7092 % A description of each parameter follows:
7094 % o wand: the magick wand.
7098 % o length: the blob length.
7101 WandExport MagickBooleanType MagickPingImageBlob(MagickWand *wand,
7102 const void *blob,const size_t length)
7110 assert(wand != (MagickWand *) NULL);
7111 assert(wand->signature == WandSignature);
7112 if (wand->debug != MagickFalse)
7113 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7114 read_info=CloneImageInfo(wand->image_info);
7115 SetImageInfoBlob(read_info,blob,length);
7116 images=PingImage(read_info,wand->exception);
7117 read_info=DestroyImageInfo(read_info);
7118 if (images == (Image *) NULL)
7119 return(MagickFalse);
7120 return(InsertImageInWand(wand,images));
7124 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7128 % M a g i c k P i n g I m a g e F i l e %
7132 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7134 % MagickPingImageFile() pings an image or image sequence from an open file
7137 % The format of the MagickPingImageFile method is:
7139 % MagickBooleanType MagickPingImageFile(MagickWand *wand,FILE *file)
7141 % A description of each parameter follows:
7143 % o wand: the magick wand.
7145 % o file: the file descriptor.
7148 WandExport MagickBooleanType MagickPingImageFile(MagickWand *wand,FILE *file)
7156 assert(wand != (MagickWand *) NULL);
7157 assert(wand->signature == WandSignature);
7158 assert(file != (FILE *) NULL);
7159 if (wand->debug != MagickFalse)
7160 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7161 read_info=CloneImageInfo(wand->image_info);
7162 SetImageInfoFile(read_info,file);
7163 images=PingImage(read_info,wand->exception);
7164 read_info=DestroyImageInfo(read_info);
7165 if (images == (Image *) NULL)
7166 return(MagickFalse);
7167 return(InsertImageInWand(wand,images));
7171 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7175 % M a g i c k P o l a r o i d I m a g e %
7179 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7181 % MagickPolaroidImage() simulates a Polaroid picture.
7183 % The format of the MagickPolaroidImage method is:
7185 % MagickBooleanType MagickPolaroidImage(MagickWand *wand,
7186 % const DrawingWand *drawing_wand,const double angle)
7188 % A description of each parameter follows:
7190 % o wand: the magick wand.
7192 % o drawing_wand: the draw wand.
7194 % o angle: Apply the effect along this angle.
7197 WandExport MagickBooleanType MagickPolaroidImage(MagickWand *wand,
7198 const DrawingWand *drawing_wand,const double angle)
7206 assert(wand != (MagickWand *) NULL);
7207 assert(wand->signature == WandSignature);
7208 if (wand->debug != MagickFalse)
7209 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7210 if (wand->images == (Image *) NULL)
7211 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7212 draw_info=PeekDrawingWand(drawing_wand);
7213 if (draw_info == (DrawInfo *) NULL)
7214 return(MagickFalse);
7215 polaroid_image=PolaroidImage(wand->images,draw_info,angle,wand->exception);
7216 if (polaroid_image == (Image *) NULL)
7217 return(MagickFalse);
7218 ReplaceImageInList(&wand->images,polaroid_image);
7223 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7227 % M a g i c k P o s t e r i z e I m a g e %
7231 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7233 % MagickPosterizeImage() reduces the image to a limited number of color level.
7235 % The format of the MagickPosterizeImage method is:
7237 % MagickBooleanType MagickPosterizeImage(MagickWand *wand,
7238 % const unsigned levels,const MagickBooleanType dither)
7240 % A description of each parameter follows:
7242 % o wand: the magick wand.
7244 % o levels: Number of color levels allowed in each channel. Very low values
7245 % (2, 3, or 4) have the most visible effect.
7247 % o dither: Set this integer value to something other than zero to dither
7251 WandExport MagickBooleanType MagickPosterizeImage(MagickWand *wand,
7252 const size_t levels,const MagickBooleanType dither)
7257 assert(wand != (MagickWand *) NULL);
7258 assert(wand->signature == WandSignature);
7259 if (wand->debug != MagickFalse)
7260 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7261 if (wand->images == (Image *) NULL)
7262 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7263 status=PosterizeImage(wand->images,levels,dither);
7264 if (status == MagickFalse)
7265 InheritException(wand->exception,&wand->images->exception);
7270 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7274 % M a g i c k P r e v i e w I m a g e s %
7278 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7280 % MagickPreviewImages() tiles 9 thumbnails of the specified image with an
7281 % image processing operation applied at varying strengths. This helpful
7282 % to quickly pin-point an appropriate parameter for an image processing
7285 % The format of the MagickPreviewImages method is:
7287 % MagickWand *MagickPreviewImages(MagickWand *wand,
7288 % const PreviewType preview)
7290 % A description of each parameter follows:
7292 % o wand: the magick wand.
7294 % o preview: the preview type.
7297 WandExport MagickWand *MagickPreviewImages(MagickWand *wand,
7298 const PreviewType preview)
7303 assert(wand != (MagickWand *) NULL);
7304 assert(wand->signature == WandSignature);
7305 if (wand->debug != MagickFalse)
7306 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7307 if (wand->images == (Image *) NULL)
7308 return((MagickWand *) NULL);
7309 preview_image=PreviewImage(wand->images,preview,wand->exception);
7310 if (preview_image == (Image *) NULL)
7311 return((MagickWand *) NULL);
7312 return(CloneMagickWandFromImages(wand,preview_image));
7316 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7320 % M a g i c k P r e v i o u s I m a g e %
7324 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7326 % MagickPreviousImage() assocates the previous image in an image list with
7329 % The format of the MagickPreviousImage method is:
7331 % MagickBooleanType MagickPreviousImage(MagickWand *wand)
7333 % A description of each parameter follows:
7335 % o wand: the magick wand.
7338 WandExport MagickBooleanType MagickPreviousImage(MagickWand *wand)
7340 assert(wand != (MagickWand *) NULL);
7341 assert(wand->signature == WandSignature);
7342 if (wand->debug != MagickFalse)
7343 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7344 if (wand->images == (Image *) NULL)
7345 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7346 if (wand->pend != MagickFalse)
7348 wand->pend=MagickFalse;
7351 if (GetPreviousImageInList(wand->images) == (Image *) NULL)
7353 wand->pend=MagickTrue;
7354 return(MagickFalse);
7356 wand->images=GetPreviousImageInList(wand->images);
7361 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7365 % M a g i c k Q u a n t i z e I m a g e %
7369 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7371 % MagickQuantizeImage() analyzes the colors within a reference image and
7372 % chooses a fixed number of colors to represent the image. The goal of the
7373 % algorithm is to minimize the color difference between the input and output
7374 % image while minimizing the processing time.
7376 % The format of the MagickQuantizeImage method is:
7378 % MagickBooleanType MagickQuantizeImage(MagickWand *wand,
7379 % const size_t number_colors,const ColorspaceType colorspace,
7380 % const size_t treedepth,const MagickBooleanType dither,
7381 % const MagickBooleanType measure_error)
7383 % A description of each parameter follows:
7385 % o wand: the magick wand.
7387 % o number_colors: the number of colors.
7389 % o colorspace: Perform color reduction in this colorspace, typically
7392 % o treedepth: Normally, this integer value is zero or one. A zero or
7393 % 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
7394 % reference image with the least amount of memory and the fastest
7395 % computational speed. In some cases, such as an image with low color
7396 % dispersion (a few number of colors), a value other than
7397 % Log4(number_colors) is required. To expand the color tree completely,
7400 % o dither: A value other than zero distributes the difference between an
7401 % original image and the corresponding color reduced image to
7402 % neighboring pixels along a Hilbert curve.
7404 % o measure_error: A value other than zero measures the difference between
7405 % the original and quantized images. This difference is the total
7406 % quantization error. The error is computed by summing over all pixels
7407 % in an image the distance squared in RGB space between each reference
7408 % pixel value and its quantized value.
7411 WandExport MagickBooleanType MagickQuantizeImage(MagickWand *wand,
7412 const size_t number_colors,const ColorspaceType colorspace,
7413 const size_t treedepth,const MagickBooleanType dither,
7414 const MagickBooleanType measure_error)
7422 assert(wand != (MagickWand *) NULL);
7423 assert(wand->signature == WandSignature);
7424 if (wand->debug != MagickFalse)
7425 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7426 if (wand->images == (Image *) NULL)
7427 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7428 quantize_info=CloneQuantizeInfo((QuantizeInfo *) NULL);
7429 quantize_info->number_colors=number_colors;
7430 quantize_info->dither=dither;
7431 quantize_info->tree_depth=treedepth;
7432 quantize_info->colorspace=colorspace;
7433 quantize_info->measure_error=measure_error;
7434 status=QuantizeImage(quantize_info,wand->images);
7435 if (status == MagickFalse)
7436 InheritException(wand->exception,&wand->images->exception);
7437 quantize_info=DestroyQuantizeInfo(quantize_info);
7442 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7446 % M a g i c k Q u a n t i z e I m a g e s %
7450 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7452 % MagickQuantizeImages() analyzes the colors within a sequence of images and
7453 % chooses a fixed number of colors to represent the image. The goal of the
7454 % algorithm is to minimize the color difference between the input and output
7455 % image while minimizing the processing time.
7457 % The format of the MagickQuantizeImages method is:
7459 % MagickBooleanType MagickQuantizeImages(MagickWand *wand,
7460 % const size_t number_colors,const ColorspaceType colorspace,
7461 % const size_t treedepth,const MagickBooleanType dither,
7462 % const MagickBooleanType measure_error)
7464 % A description of each parameter follows:
7466 % o wand: the magick wand.
7468 % o number_colors: the number of colors.
7470 % o colorspace: Perform color reduction in this colorspace, typically
7473 % o treedepth: Normally, this integer value is zero or one. A zero or
7474 % 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
7475 % reference image with the least amount of memory and the fastest
7476 % computational speed. In some cases, such as an image with low color
7477 % dispersion (a few number of colors), a value other than
7478 % Log4(number_colors) is required. To expand the color tree completely,
7481 % o dither: A value other than zero distributes the difference between an
7482 % original image and the corresponding color reduced algorithm to
7483 % neighboring pixels along a Hilbert curve.
7485 % o measure_error: A value other than zero measures the difference between
7486 % the original and quantized images. This difference is the total
7487 % quantization error. The error is computed by summing over all pixels
7488 % in an image the distance squared in RGB space between each reference
7489 % pixel value and its quantized value.
7492 WandExport MagickBooleanType MagickQuantizeImages(MagickWand *wand,
7493 const size_t number_colors,const ColorspaceType colorspace,
7494 const size_t treedepth,const MagickBooleanType dither,
7495 const MagickBooleanType measure_error)
7503 assert(wand != (MagickWand *) NULL);
7504 assert(wand->signature == WandSignature);
7505 if (wand->debug != MagickFalse)
7506 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7507 if (wand->images == (Image *) NULL)
7508 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7509 quantize_info=CloneQuantizeInfo((QuantizeInfo *) NULL);
7510 quantize_info->number_colors=number_colors;
7511 quantize_info->dither=dither;
7512 quantize_info->tree_depth=treedepth;
7513 quantize_info->colorspace=colorspace;
7514 quantize_info->measure_error=measure_error;
7515 status=QuantizeImages(quantize_info,wand->images);
7516 if (status == MagickFalse)
7517 InheritException(wand->exception,&wand->images->exception);
7518 quantize_info=DestroyQuantizeInfo(quantize_info);
7523 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7527 % M a g i c k R a d i a l B l u r I m a g e %
7531 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7533 % MagickRadialBlurImage() radial blurs an image.
7535 % The format of the MagickRadialBlurImage method is:
7537 % MagickBooleanType MagickRadialBlurImage(MagickWand *wand,
7538 % const double angle)
7540 % A description of each parameter follows:
7542 % o wand: the magick wand.
7544 % o angle: the angle of the blur in degrees.
7547 WandExport MagickBooleanType MagickRadialBlurImage(MagickWand *wand,
7553 assert(wand != (MagickWand *) NULL);
7554 assert(wand->signature == WandSignature);
7555 if (wand->debug != MagickFalse)
7556 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7557 if (wand->images == (Image *) NULL)
7558 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7559 blur_image=RadialBlurImage(wand->images,angle,wand->exception);
7560 if (blur_image == (Image *) NULL)
7561 return(MagickFalse);
7562 ReplaceImageInList(&wand->images,blur_image);
7567 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7571 % M a g i c k R a i s e I m a g e %
7575 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7577 % MagickRaiseImage() creates a simulated three-dimensional button-like effect
7578 % by lightening and darkening the edges of the image. Members width and
7579 % height of raise_info define the width of the vertical and horizontal
7580 % edge of the effect.
7582 % The format of the MagickRaiseImage method is:
7584 % MagickBooleanType MagickRaiseImage(MagickWand *wand,
7585 % const size_t width,const size_t height,const ssize_t x,
7586 % const ssize_t y,const MagickBooleanType raise)
7588 % A description of each parameter follows:
7590 % o wand: the magick wand.
7592 % o width,height,x,y: Define the dimensions of the area to raise.
7594 % o raise: A value other than zero creates a 3-D raise effect,
7595 % otherwise it has a lowered effect.
7598 WandExport MagickBooleanType MagickRaiseImage(MagickWand *wand,
7599 const size_t width,const size_t height,const ssize_t x,
7600 const ssize_t y,const MagickBooleanType raise)
7608 assert(wand != (MagickWand *) NULL);
7609 assert(wand->signature == WandSignature);
7610 if (wand->debug != MagickFalse)
7611 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7612 if (wand->images == (Image *) NULL)
7613 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7614 raise_info.width=width;
7615 raise_info.height=height;
7618 status=RaiseImage(wand->images,&raise_info,raise);
7619 if (status == MagickFalse)
7620 InheritException(wand->exception,&wand->images->exception);
7625 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7629 % 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 %
7633 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7635 % MagickRandomThresholdImage() changes the value of individual pixels based on
7636 % the intensity of each pixel compared to threshold. The result is a
7637 % high-contrast, two color image.
7639 % The format of the MagickRandomThresholdImage method is:
7641 % MagickBooleanType MagickRandomThresholdImage(MagickWand *wand,
7642 % const double low,const double high)
7644 % A description of each parameter follows:
7646 % o wand: the magick wand.
7648 % o low,high: Specify the high and low thresholds. These values range from
7649 % 0 to QuantumRange.
7652 WandExport MagickBooleanType MagickRandomThresholdImage(MagickWand *wand,
7653 const double low,const double high)
7656 threshold[MaxTextExtent];
7661 assert(wand != (MagickWand *) NULL);
7662 assert(wand->signature == WandSignature);
7663 if (wand->debug != MagickFalse)
7664 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7665 if (wand->images == (Image *) NULL)
7666 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7667 (void) FormatLocaleString(threshold,MaxTextExtent,"%gx%g",low,high);
7668 status=RandomThresholdImage(wand->images,threshold,wand->exception);
7669 if (status == MagickFalse)
7670 InheritException(wand->exception,&wand->images->exception);
7675 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7679 % M a g i c k R e a d I m a g e %
7683 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7685 % MagickReadImage() reads an image or image sequence. The images are inserted
7686 % at the current image pointer position. Use MagickSetFirstIterator(),
7687 % MagickSetLastIterator, or MagickSetImageIndex() to specify the current
7688 % image pointer position at the beginning of the image list, the end, or
7689 % anywhere in-between respectively.
7691 % The format of the MagickReadImage method is:
7693 % MagickBooleanType MagickReadImage(MagickWand *wand,const char *filename)
7695 % A description of each parameter follows:
7697 % o wand: the magick wand.
7699 % o filename: the image filename.
7702 WandExport MagickBooleanType MagickReadImage(MagickWand *wand,
7703 const char *filename)
7711 assert(wand != (MagickWand *) NULL);
7712 assert(wand->signature == WandSignature);
7713 if (wand->debug != MagickFalse)
7714 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7715 read_info=CloneImageInfo(wand->image_info);
7716 if (filename != (const char *) NULL)
7717 (void) CopyMagickString(read_info->filename,filename,MaxTextExtent);
7718 images=ReadImage(read_info,wand->exception);
7719 read_info=DestroyImageInfo(read_info);
7720 if (images == (Image *) NULL)
7721 return(MagickFalse);
7722 return(InsertImageInWand(wand,images));
7726 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7730 % M a g i c k R e a d I m a g e B l o b %
7734 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7736 % MagickReadImageBlob() reads an image or image sequence from a blob.
7738 % The format of the MagickReadImageBlob method is:
7740 % MagickBooleanType MagickReadImageBlob(MagickWand *wand,
7741 % const void *blob,const size_t length)
7743 % A description of each parameter follows:
7745 % o wand: the magick wand.
7749 % o length: the blob length.
7752 WandExport MagickBooleanType MagickReadImageBlob(MagickWand *wand,
7753 const void *blob,const size_t length)
7758 assert(wand != (MagickWand *) NULL);
7759 assert(wand->signature == WandSignature);
7760 if (wand->debug != MagickFalse)
7761 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7762 images=BlobToImage(wand->image_info,blob,length,wand->exception);
7763 if (images == (Image *) NULL)
7764 return(MagickFalse);
7765 return(InsertImageInWand(wand,images));
7769 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7773 % M a g i c k R e a d I m a g e F i l e %
7777 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7779 % MagickReadImageFile() reads an image or image sequence from an open file
7782 % The format of the MagickReadImageFile method is:
7784 % MagickBooleanType MagickReadImageFile(MagickWand *wand,FILE *file)
7786 % A description of each parameter follows:
7788 % o wand: the magick wand.
7790 % o file: the file descriptor.
7793 WandExport MagickBooleanType MagickReadImageFile(MagickWand *wand,FILE *file)
7801 assert(wand != (MagickWand *) NULL);
7802 assert(wand->signature == WandSignature);
7803 assert(file != (FILE *) NULL);
7804 if (wand->debug != MagickFalse)
7805 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7806 read_info=CloneImageInfo(wand->image_info);
7807 SetImageInfoFile(read_info,file);
7808 images=ReadImage(read_info,wand->exception);
7809 read_info=DestroyImageInfo(read_info);
7810 if (images == (Image *) NULL)
7811 return(MagickFalse);
7812 return(InsertImageInWand(wand,images));
7816 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7820 % M a g i c k R e m a p I m a g e %
7824 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7826 % MagickRemapImage() replaces the colors of an image with the closest color
7827 % from a reference image.
7829 % The format of the MagickRemapImage method is:
7831 % MagickBooleanType MagickRemapImage(MagickWand *wand,
7832 % const MagickWand *remap_wand,const DitherMethod method)
7834 % A description of each parameter follows:
7836 % o wand: the magick wand.
7838 % o affinity: the affinity wand.
7840 % o method: choose from these dither methods: NoDitherMethod,
7841 % RiemersmaDitherMethod, or FloydSteinbergDitherMethod.
7844 WandExport MagickBooleanType MagickRemapImage(MagickWand *wand,
7845 const MagickWand *remap_wand,const DitherMethod method)
7853 assert(wand != (MagickWand *) NULL);
7854 assert(wand->signature == WandSignature);
7855 if (wand->debug != MagickFalse)
7856 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7857 if ((wand->images == (Image *) NULL) ||
7858 (remap_wand->images == (Image *) NULL))
7859 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7860 quantize_info=AcquireQuantizeInfo(wand->image_info);
7861 quantize_info->dither_method=method;
7862 if (method == NoDitherMethod)
7863 quantize_info->dither=MagickFalse;
7864 status=RemapImage(quantize_info,wand->images,remap_wand->images);
7865 quantize_info=DestroyQuantizeInfo(quantize_info);
7866 if (status == MagickFalse)
7867 InheritException(wand->exception,&wand->images->exception);
7872 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7876 % M a g i c k R e m o v e I m a g e %
7880 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7882 % MagickRemoveImage() removes an image from the image list.
7884 % The format of the MagickRemoveImage method is:
7886 % MagickBooleanType MagickRemoveImage(MagickWand *wand)
7888 % A description of each parameter follows:
7890 % o wand: the magick wand.
7892 % o insert: the splice wand.
7895 WandExport MagickBooleanType MagickRemoveImage(MagickWand *wand)
7897 assert(wand != (MagickWand *) NULL);
7898 assert(wand->signature == WandSignature);
7899 if (wand->debug != MagickFalse)
7900 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7901 if (wand->images == (Image *) NULL)
7902 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7903 DeleteImageFromList(&wand->images);
7908 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7912 % M a g i c k R e s a m p l e I m a g e %
7916 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7918 % MagickResampleImage() resample image to desired resolution.
7920 % Bessel Blackman Box
7921 % Catrom Cubic Gaussian
7922 % Hanning Hermite Lanczos
7923 % Mitchell Point Quandratic
7926 % Most of the filters are FIR (finite impulse response), however, Bessel,
7927 % Gaussian, and Sinc are IIR (infinite impulse response). Bessel and Sinc
7928 % are windowed (brought down to zero) with the Blackman filter.
7930 % The format of the MagickResampleImage method is:
7932 % MagickBooleanType MagickResampleImage(MagickWand *wand,
7933 % const double x_resolution,const double y_resolution,
7934 % const FilterTypes filter,const double blur)
7936 % A description of each parameter follows:
7938 % o wand: the magick wand.
7940 % o x_resolution: the new image x resolution.
7942 % o y_resolution: the new image y resolution.
7944 % o filter: Image filter to use.
7946 % o blur: the blur factor where > 1 is blurry, < 1 is sharp.
7949 WandExport MagickBooleanType MagickResampleImage(MagickWand *wand,
7950 const double x_resolution,const double y_resolution,const FilterTypes filter,
7956 assert(wand != (MagickWand *) NULL);
7957 assert(wand->signature == WandSignature);
7958 if (wand->debug != MagickFalse)
7959 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7960 if (wand->images == (Image *) NULL)
7961 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7962 resample_image=ResampleImage(wand->images,x_resolution,y_resolution,filter,
7963 blur,wand->exception);
7964 if (resample_image == (Image *) NULL)
7965 return(MagickFalse);
7966 ReplaceImageInList(&wand->images,resample_image);
7971 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7975 % M a g i c k R e s e t I m a g e P a g e %
7979 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7981 % MagickResetImagePage() resets the Wand page canvas and position.
7983 % The format of the MagickResetImagePage method is:
7985 % MagickBooleanType MagickResetImagePage(MagickWand *wand,
7988 % A description of each parameter follows:
7990 % o wand: the magick wand.
7992 % o page: the relative page specification.
7995 WandExport MagickBooleanType MagickResetImagePage(MagickWand *wand,
7998 assert(wand != (MagickWand *) NULL);
7999 assert(wand->signature == WandSignature);
8000 if (wand->debug != MagickFalse)
8001 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8002 if (wand->images == (Image *) NULL)
8003 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8004 if ((page == (char *) NULL) || (*page == '\0'))
8006 (void) ParseAbsoluteGeometry("0x0+0+0",&wand->images->page);
8009 return(ResetImagePage(wand->images,page));
8013 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8017 % M a g i c k R e s i z e I m a g e %
8021 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8023 % MagickResizeImage() scales an image to the desired dimensions with one of
8026 % Bessel Blackman Box
8027 % Catrom Cubic Gaussian
8028 % Hanning Hermite Lanczos
8029 % Mitchell Point Quandratic
8032 % Most of the filters are FIR (finite impulse response), however, Bessel,
8033 % Gaussian, and Sinc are IIR (infinite impulse response). Bessel and Sinc
8034 % are windowed (brought down to zero) with the Blackman filter.
8036 % The format of the MagickResizeImage method is:
8038 % MagickBooleanType MagickResizeImage(MagickWand *wand,
8039 % const size_t columns,const size_t rows,
8040 % const FilterTypes filter,const double blur)
8042 % A description of each parameter follows:
8044 % o wand: the magick wand.
8046 % o columns: the number of columns in the scaled image.
8048 % o rows: the number of rows in the scaled image.
8050 % o filter: Image filter to use.
8052 % o blur: the blur factor where > 1 is blurry, < 1 is sharp.
8055 WandExport MagickBooleanType MagickResizeImage(MagickWand *wand,
8056 const size_t columns,const size_t rows,const FilterTypes filter,
8062 assert(wand != (MagickWand *) NULL);
8063 assert(wand->signature == WandSignature);
8064 if (wand->debug != MagickFalse)
8065 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8066 if (wand->images == (Image *) NULL)
8067 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8068 resize_image=ResizeImage(wand->images,columns,rows,filter,blur,
8070 if (resize_image == (Image *) NULL)
8071 return(MagickFalse);
8072 ReplaceImageInList(&wand->images,resize_image);
8077 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8081 % M a g i c k R o l l I m a g e %
8085 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8087 % MagickRollImage() offsets an image as defined by x and y.
8089 % The format of the MagickRollImage method is:
8091 % MagickBooleanType MagickRollImage(MagickWand *wand,const ssize_t x,
8094 % A description of each parameter follows:
8096 % o wand: the magick wand.
8098 % o x: the x offset.
8100 % o y: the y offset.
8104 WandExport MagickBooleanType MagickRollImage(MagickWand *wand,
8105 const ssize_t x,const ssize_t y)
8110 assert(wand != (MagickWand *) NULL);
8111 assert(wand->signature == WandSignature);
8112 if (wand->debug != MagickFalse)
8113 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8114 if (wand->images == (Image *) NULL)
8115 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8116 roll_image=RollImage(wand->images,x,y,wand->exception);
8117 if (roll_image == (Image *) NULL)
8118 return(MagickFalse);
8119 ReplaceImageInList(&wand->images,roll_image);
8124 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8128 % M a g i c k R o t a t e I m a g e %
8132 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8134 % MagickRotateImage() rotates an image the specified number of degrees. Empty
8135 % triangles left over from rotating the image are filled with the
8138 % The format of the MagickRotateImage method is:
8140 % MagickBooleanType MagickRotateImage(MagickWand *wand,
8141 % const PixelWand *background,const double degrees)
8143 % A description of each parameter follows:
8145 % o wand: the magick wand.
8147 % o background: the background pixel wand.
8149 % o degrees: the number of degrees to rotate the image.
8153 WandExport MagickBooleanType MagickRotateImage(MagickWand *wand,
8154 const PixelWand *background,const double degrees)
8159 assert(wand != (MagickWand *) NULL);
8160 assert(wand->signature == WandSignature);
8161 if (wand->debug != MagickFalse)
8162 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8163 if (wand->images == (Image *) NULL)
8164 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8165 PixelGetQuantumPacket(background,&wand->images->background_color);
8166 rotate_image=RotateImage(wand->images,degrees,wand->exception);
8167 if (rotate_image == (Image *) NULL)
8168 return(MagickFalse);
8169 ReplaceImageInList(&wand->images,rotate_image);
8174 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8178 % M a g i c k S a m p l e I m a g e %
8182 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8184 % MagickSampleImage() scales an image to the desired dimensions with pixel
8185 % sampling. Unlike other scaling methods, this method does not introduce
8186 % any additional color into the scaled image.
8188 % The format of the MagickSampleImage method is:
8190 % MagickBooleanType MagickSampleImage(MagickWand *wand,
8191 % const size_t columns,const size_t rows)
8193 % A description of each parameter follows:
8195 % o wand: the magick wand.
8197 % o columns: the number of columns in the scaled image.
8199 % o rows: the number of rows in the scaled image.
8203 WandExport MagickBooleanType MagickSampleImage(MagickWand *wand,
8204 const size_t columns,const size_t rows)
8209 assert(wand != (MagickWand *) NULL);
8210 assert(wand->signature == WandSignature);
8211 if (wand->debug != MagickFalse)
8212 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8213 if (wand->images == (Image *) NULL)
8214 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8215 sample_image=SampleImage(wand->images,columns,rows,wand->exception);
8216 if (sample_image == (Image *) NULL)
8217 return(MagickFalse);
8218 ReplaceImageInList(&wand->images,sample_image);
8223 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8227 % M a g i c k S c a l e I m a g e %
8231 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8233 % MagickScaleImage() scales the size of an image to the given dimensions.
8235 % The format of the MagickScaleImage method is:
8237 % MagickBooleanType MagickScaleImage(MagickWand *wand,
8238 % const size_t columns,const size_t rows)
8240 % A description of each parameter follows:
8242 % o wand: the magick wand.
8244 % o columns: the number of columns in the scaled image.
8246 % o rows: the number of rows in the scaled image.
8250 WandExport MagickBooleanType MagickScaleImage(MagickWand *wand,
8251 const size_t columns,const size_t rows)
8256 assert(wand != (MagickWand *) NULL);
8257 assert(wand->signature == WandSignature);
8258 if (wand->debug != MagickFalse)
8259 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8260 if (wand->images == (Image *) NULL)
8261 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8262 scale_image=ScaleImage(wand->images,columns,rows,wand->exception);
8263 if (scale_image == (Image *) NULL)
8264 return(MagickFalse);
8265 ReplaceImageInList(&wand->images,scale_image);
8270 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8274 % M a g i c k S e g m e n t I m a g e %
8278 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8280 % MagickSegmentImage() segments an image by analyzing the histograms of the
8281 % color components and identifying units that are homogeneous with the fuzzy
8282 % C-means technique.
8284 % The format of the SegmentImage method is:
8286 % MagickBooleanType MagickSegmentImage(MagickWand *wand,
8287 % const ColorspaceType colorspace,const MagickBooleanType verbose,
8288 % const double cluster_threshold,const double smooth_threshold)
8290 % A description of each parameter follows.
8294 % o colorspace: the image colorspace.
8296 % o verbose: Set to MagickTrue to print detailed information about the
8297 % identified classes.
8299 % o cluster_threshold: This represents the minimum number of pixels
8300 % contained in a hexahedra before it can be considered valid (expressed as
8303 % o smooth_threshold: the smoothing threshold eliminates noise in the second
8304 % derivative of the histogram. As the value is increased, you can expect a
8305 % smoother second derivative.
8308 MagickExport MagickBooleanType MagickSegmentImage(MagickWand *wand,
8309 const ColorspaceType colorspace,const MagickBooleanType verbose,
8310 const double cluster_threshold,const double smooth_threshold)
8315 assert(wand != (MagickWand *) NULL);
8316 assert(wand->signature == WandSignature);
8317 if (wand->debug != MagickFalse)
8318 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8319 if (wand->images == (Image *) NULL)
8320 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8321 status=SegmentImage(wand->images,colorspace,verbose,cluster_threshold,
8323 if (status == MagickFalse)
8324 InheritException(wand->exception,&wand->images->exception);
8329 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8333 % M a g i c k S e l e c t i v e B l u r I m a g e %
8337 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8339 % MagickSelectiveBlurImage() selectively blur an image within a contrast
8340 % threshold. It is similar to the unsharpen mask that sharpens everything with
8341 % contrast above a certain threshold.
8343 % The format of the MagickSelectiveBlurImage method is:
8345 % MagickBooleanType MagickSelectiveBlurImage(MagickWand *wand,
8346 % const double radius,const double sigma,const double threshold)
8348 % A description of each parameter follows:
8350 % o wand: the magick wand.
8352 % o radius: the radius of the gaussian, in pixels, not counting the center
8355 % o sigma: the standard deviation of the gaussian, in pixels.
8357 % o threshold: only pixels within this contrast threshold are included
8358 % in the blur operation.
8361 WandExport MagickBooleanType MagickSelectiveBlurImage(MagickWand *wand,
8362 const double radius,const double sigma,const double threshold)
8367 assert(wand != (MagickWand *) NULL);
8368 assert(wand->signature == WandSignature);
8369 if (wand->debug != MagickFalse)
8370 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8371 if (wand->images == (Image *) NULL)
8372 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8373 blur_image=SelectiveBlurImage(wand->images,radius,sigma,threshold,
8375 if (blur_image == (Image *) NULL)
8376 return(MagickFalse);
8377 ReplaceImageInList(&wand->images,blur_image);
8382 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8386 % 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 %
8390 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8392 % MagickSeparateImage() separates a channel from the image and returns a
8393 % grayscale image. A channel is a particular color component of each pixel
8396 % The format of the MagickSeparateImage method is:
8398 % MagickBooleanType MagickSeparateImage(MagickWand *wand)
8400 % A description of each parameter follows:
8402 % o wand: the magick wand.
8405 WandExport MagickBooleanType MagickSeparateImage(MagickWand *wand)
8410 assert(wand != (MagickWand *) NULL);
8411 assert(wand->signature == WandSignature);
8412 if (wand->debug != MagickFalse)
8413 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8414 if (wand->images == (Image *) NULL)
8415 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8416 status=SeparateImage(wand->images);
8417 if (status == MagickFalse)
8418 InheritException(wand->exception,&wand->images->exception);
8423 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8427 % M a g i c k S e p i a T o n e I m a g e %
8431 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8433 % MagickSepiaToneImage() applies a special effect to the image, similar to the
8434 % effect achieved in a photo darkroom by sepia toning. Threshold ranges from
8435 % 0 to QuantumRange and is a measure of the extent of the sepia toning. A
8436 % threshold of 80% is a good starting point for a reasonable tone.
8438 % The format of the MagickSepiaToneImage method is:
8440 % MagickBooleanType MagickSepiaToneImage(MagickWand *wand,
8441 % const double threshold)
8443 % A description of each parameter follows:
8445 % o wand: the magick wand.
8447 % o threshold: Define the extent of the sepia toning.
8450 WandExport MagickBooleanType MagickSepiaToneImage(MagickWand *wand,
8451 const double threshold)
8456 assert(wand != (MagickWand *) NULL);
8457 assert(wand->signature == WandSignature);
8458 if (wand->debug != MagickFalse)
8459 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8460 if (wand->images == (Image *) NULL)
8461 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8462 sepia_image=SepiaToneImage(wand->images,threshold,wand->exception);
8463 if (sepia_image == (Image *) NULL)
8464 return(MagickFalse);
8465 ReplaceImageInList(&wand->images,sepia_image);
8470 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8474 % M a g i c k S e t I m a g e %
8478 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8480 % MagickSetImage() replaces the last image returned by MagickSetImageIndex(),
8481 % MagickNextImage(), MagickPreviousImage() with the images from the specified
8484 % The format of the MagickSetImage method is:
8486 % MagickBooleanType MagickSetImage(MagickWand *wand,
8487 % const MagickWand *set_wand)
8489 % A description of each parameter follows:
8491 % o wand: the magick wand.
8493 % o set_wand: the set_wand wand.
8496 WandExport MagickBooleanType MagickSetImage(MagickWand *wand,
8497 const MagickWand *set_wand)
8502 assert(wand != (MagickWand *) NULL);
8503 assert(wand->signature == WandSignature);
8504 if (wand->debug != MagickFalse)
8505 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8506 assert(set_wand != (MagickWand *) NULL);
8507 assert(set_wand->signature == WandSignature);
8508 if (wand->debug != MagickFalse)
8509 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",set_wand->name);
8510 if (set_wand->images == (Image *) NULL)
8511 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8512 images=CloneImageList(set_wand->images,wand->exception);
8513 if (images == (Image *) NULL)
8514 return(MagickFalse);
8515 ReplaceImageInList(&wand->images,images);
8520 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8524 % 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 %
8528 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8530 % MagickSetImageAlphaChannel() activates, deactivates, resets, or sets the
8533 % The format of the MagickSetImageAlphaChannel method is:
8535 % MagickBooleanType MagickSetImageAlphaChannel(MagickWand *wand,
8536 % const AlphaChannelType alpha_type)
8538 % A description of each parameter follows:
8540 % o wand: the magick wand.
8542 % o alpha_type: the alpha channel type: ActivateAlphaChannel,
8543 % DeactivateAlphaChannel, OpaqueAlphaChannel, or SetAlphaChannel.
8546 WandExport MagickBooleanType MagickSetImageAlphaChannel(MagickWand *wand,
8547 const AlphaChannelType alpha_type)
8549 assert(wand != (MagickWand *) NULL);
8550 assert(wand->signature == WandSignature);
8551 if (wand->debug != MagickFalse)
8552 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8553 if (wand->images == (Image *) NULL)
8554 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8555 return(SetImageAlphaChannel(wand->images,alpha_type,&wand->images->exception));
8559 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8563 % 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 %
8567 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8569 % MagickSetImageBackgroundColor() sets the image background color.
8571 % The format of the MagickSetImageBackgroundColor method is:
8573 % MagickBooleanType MagickSetImageBackgroundColor(MagickWand *wand,
8574 % const PixelWand *background)
8576 % A description of each parameter follows:
8578 % o wand: the magick wand.
8580 % o background: the background pixel wand.
8583 WandExport MagickBooleanType MagickSetImageBackgroundColor(MagickWand *wand,
8584 const PixelWand *background)
8586 assert(wand != (MagickWand *) NULL);
8587 assert(wand->signature == WandSignature);
8588 if (wand->debug != MagickFalse)
8589 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8590 if (wand->images == (Image *) NULL)
8591 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8592 PixelGetQuantumPacket(background,&wand->images->background_color);
8597 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8601 % M a g i c k S e t I m a g e B i a s %
8605 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8607 % MagickSetImageBias() sets the image bias for any method that convolves an
8608 % image (e.g. MagickConvolveImage()).
8610 % The format of the MagickSetImageBias method is:
8612 % MagickBooleanType MagickSetImageBias(MagickWand *wand,
8613 % const double bias)
8615 % A description of each parameter follows:
8617 % o wand: the magick wand.
8619 % o bias: the image bias.
8622 WandExport MagickBooleanType MagickSetImageBias(MagickWand *wand,
8625 assert(wand != (MagickWand *) NULL);
8626 assert(wand->signature == WandSignature);
8627 if (wand->debug != MagickFalse)
8628 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8629 if (wand->images == (Image *) NULL)
8630 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8631 wand->images->bias=bias;
8636 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8640 % 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 %
8644 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8646 % MagickSetImageBluePrimary() sets the image chromaticity blue primary point.
8648 % The format of the MagickSetImageBluePrimary method is:
8650 % MagickBooleanType MagickSetImageBluePrimary(MagickWand *wand,
8651 % const double x,const double y)
8653 % A description of each parameter follows:
8655 % o wand: the magick wand.
8657 % o x: the blue primary x-point.
8659 % o y: the blue primary y-point.
8662 WandExport MagickBooleanType MagickSetImageBluePrimary(MagickWand *wand,
8663 const double x,const double y)
8665 assert(wand != (MagickWand *) NULL);
8666 assert(wand->signature == WandSignature);
8667 if (wand->debug != MagickFalse)
8668 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8669 if (wand->images == (Image *) NULL)
8670 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8671 wand->images->chromaticity.blue_primary.x=x;
8672 wand->images->chromaticity.blue_primary.y=y;
8677 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8681 % 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 %
8685 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8687 % MagickSetImageBorderColor() sets the image border color.
8689 % The format of the MagickSetImageBorderColor method is:
8691 % MagickBooleanType MagickSetImageBorderColor(MagickWand *wand,
8692 % const PixelWand *border)
8694 % A description of each parameter follows:
8696 % o wand: the magick wand.
8698 % o border: the border pixel wand.
8701 WandExport MagickBooleanType MagickSetImageBorderColor(MagickWand *wand,
8702 const PixelWand *border)
8704 assert(wand != (MagickWand *) NULL);
8705 assert(wand->signature == WandSignature);
8706 if (wand->debug != MagickFalse)
8707 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8708 if (wand->images == (Image *) NULL)
8709 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8710 PixelGetQuantumPacket(border,&wand->images->border_color);
8715 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8719 % M a g i c k S e t I m a g e C l i p M a s k %
8723 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8725 % MagickSetImageClipMask() sets image clip mask.
8727 % The format of the MagickSetImageClipMask method is:
8729 % MagickBooleanType MagickSetImageClipMask(MagickWand *wand,
8730 % const MagickWand *clip_mask)
8732 % A description of each parameter follows:
8734 % o wand: the magick wand.
8736 % o clip_mask: the clip_mask wand.
8739 WandExport MagickBooleanType MagickSetImageClipMask(MagickWand *wand,
8740 const MagickWand *clip_mask)
8742 assert(wand != (MagickWand *) NULL);
8743 assert(wand->signature == WandSignature);
8744 if (wand->debug != MagickFalse)
8745 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8746 assert(clip_mask != (MagickWand *) NULL);
8747 assert(clip_mask->signature == WandSignature);
8748 if (wand->debug != MagickFalse)
8749 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",clip_mask->name);
8750 if (clip_mask->images == (Image *) NULL)
8751 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8752 return(SetImageClipMask(wand->images,clip_mask->images));
8756 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8760 % M a g i c k S e t I m a g e C o l o r %
8764 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8766 % MagickSetImageColor() set the entire wand canvas to the specified color.
8768 % The format of the MagickSetImageColor method is:
8770 % MagickBooleanType MagickSetImageColor(MagickWand *wand,
8771 % const PixelWand *color)
8773 % A description of each parameter follows:
8775 % o wand: the magick wand.
8777 % o background: the image color.
8780 WandExport MagickBooleanType MagickSetImageColor(MagickWand *wand,
8781 const PixelWand *color)
8789 assert(wand != (MagickWand *) NULL);
8790 assert(wand->signature == WandSignature);
8791 if (wand->debug != MagickFalse)
8792 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8793 PixelGetMagickColor(color,&pixel);
8794 status=SetImageColor(wand->images,&pixel);
8795 if (status == MagickFalse)
8796 InheritException(wand->exception,&wand->images->exception);
8801 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8805 % 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 %
8809 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8811 % MagickSetImageColormapColor() sets the color of the specified colormap
8814 % The format of the MagickSetImageColormapColor method is:
8816 % MagickBooleanType MagickSetImageColormapColor(MagickWand *wand,
8817 % const size_t index,const PixelWand *color)
8819 % A description of each parameter follows:
8821 % o wand: the magick wand.
8823 % o index: the offset into the image colormap.
8825 % o color: Return the colormap color in this wand.
8828 WandExport MagickBooleanType MagickSetImageColormapColor(MagickWand *wand,
8829 const size_t index,const PixelWand *color)
8831 assert(wand != (MagickWand *) NULL);
8832 assert(wand->signature == WandSignature);
8833 if (wand->debug != MagickFalse)
8834 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8835 if (wand->images == (Image *) NULL)
8836 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8837 if ((wand->images->colormap == (PixelPacket *) NULL) ||
8838 (index >= wand->images->colors))
8839 ThrowWandException(WandError,"InvalidColormapIndex",wand->name);
8840 PixelGetQuantumPacket(color,wand->images->colormap+index);
8841 return(SyncImage(wand->images));
8845 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8849 % M a g i c k S e t I m a g e C o l o r s p a c e %
8853 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8855 % MagickSetImageColorspace() sets the image colorspace.
8857 % The format of the MagickSetImageColorspace method is:
8859 % MagickBooleanType MagickSetImageColorspace(MagickWand *wand,
8860 % const ColorspaceType colorspace)
8862 % A description of each parameter follows:
8864 % o wand: the magick wand.
8866 % o colorspace: the image colorspace: UndefinedColorspace, RGBColorspace,
8867 % GRAYColorspace, TransparentColorspace, OHTAColorspace, XYZColorspace,
8868 % YCbCrColorspace, YCCColorspace, YIQColorspace, YPbPrColorspace,
8869 % YPbPrColorspace, YUVColorspace, CMYKColorspace, sRGBColorspace,
8870 % HSLColorspace, or HWBColorspace.
8873 WandExport MagickBooleanType MagickSetImageColorspace(MagickWand *wand,
8874 const ColorspaceType colorspace)
8876 assert(wand != (MagickWand *) NULL);
8877 assert(wand->signature == WandSignature);
8878 if (wand->debug != MagickFalse)
8879 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8880 if (wand->images == (Image *) NULL)
8881 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8882 return(SetImageColorspace(wand->images,colorspace,&wand->images->exception));
8886 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8890 % M a g i c k S e t I m a g e C o m p o s e %
8894 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8896 % MagickSetImageCompose() sets the image composite operator, useful for
8897 % specifying how to composite the image thumbnail when using the
8898 % MagickMontageImage() method.
8900 % The format of the MagickSetImageCompose method is:
8902 % MagickBooleanType MagickSetImageCompose(MagickWand *wand,
8903 % const CompositeOperator compose)
8905 % A description of each parameter follows:
8907 % o wand: the magick wand.
8909 % o compose: the image composite operator.
8912 WandExport MagickBooleanType MagickSetImageCompose(MagickWand *wand,
8913 const CompositeOperator compose)
8915 assert(wand != (MagickWand *) NULL);
8916 assert(wand->signature == WandSignature);
8917 if (wand->debug != MagickFalse)
8918 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8919 if (wand->images == (Image *) NULL)
8920 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8921 wand->images->compose=compose;
8926 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8930 % 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 %
8934 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8936 % MagickSetImageCompression() sets the image compression.
8938 % The format of the MagickSetImageCompression method is:
8940 % MagickBooleanType MagickSetImageCompression(MagickWand *wand,
8941 % const CompressionType compression)
8943 % A description of each parameter follows:
8945 % o wand: the magick wand.
8947 % o compression: the image compression type.
8950 WandExport MagickBooleanType MagickSetImageCompression(MagickWand *wand,
8951 const CompressionType compression)
8953 assert(wand != (MagickWand *) NULL);
8954 assert(wand->signature == WandSignature);
8955 if (wand->debug != MagickFalse)
8956 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8957 if (wand->images == (Image *) NULL)
8958 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8959 wand->images->compression=compression;
8964 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8968 % 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 %
8972 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8974 % MagickSetImageCompressionQuality() sets the image compression quality.
8976 % The format of the MagickSetImageCompressionQuality method is:
8978 % MagickBooleanType MagickSetImageCompressionQuality(MagickWand *wand,
8979 % const size_t quality)
8981 % A description of each parameter follows:
8983 % o wand: the magick wand.
8985 % o quality: the image compression tlityype.
8988 WandExport MagickBooleanType MagickSetImageCompressionQuality(MagickWand *wand,
8989 const size_t quality)
8991 assert(wand != (MagickWand *) NULL);
8992 assert(wand->signature == WandSignature);
8993 if (wand->debug != MagickFalse)
8994 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8995 if (wand->images == (Image *) NULL)
8996 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8997 wand->images->quality=quality;
9002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9006 % M a g i c k S e t I m a g e D e l a y %
9010 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9012 % MagickSetImageDelay() sets the image delay.
9014 % The format of the MagickSetImageDelay method is:
9016 % MagickBooleanType MagickSetImageDelay(MagickWand *wand,
9017 % const size_t delay)
9019 % A description of each parameter follows:
9021 % o wand: the magick wand.
9023 % o delay: the image delay in ticks-per-second units.
9026 WandExport MagickBooleanType MagickSetImageDelay(MagickWand *wand,
9029 assert(wand != (MagickWand *) NULL);
9030 assert(wand->signature == WandSignature);
9031 if (wand->debug != MagickFalse)
9032 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9033 if (wand->images == (Image *) NULL)
9034 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9035 wand->images->delay=delay;
9040 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9044 % M a g i c k S e t I m a g e D e p t h %
9048 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9050 % MagickSetImageDepth() sets the image depth.
9052 % The format of the MagickSetImageDepth method is:
9054 % MagickBooleanType MagickSetImageDepth(MagickWand *wand,
9055 % const size_t depth)
9057 % A description of each parameter follows:
9059 % o wand: the magick wand.
9061 % o depth: the image depth in bits: 8, 16, or 32.
9064 WandExport MagickBooleanType MagickSetImageDepth(MagickWand *wand,
9067 assert(wand != (MagickWand *) NULL);
9068 assert(wand->signature == WandSignature);
9069 if (wand->debug != MagickFalse)
9070 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9071 if (wand->images == (Image *) NULL)
9072 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9073 return(SetImageDepth(wand->images,depth));
9077 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9081 % M a g i c k S e t I m a g e D i s p o s e %
9085 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9087 % MagickSetImageDispose() sets the image disposal method.
9089 % The format of the MagickSetImageDispose method is:
9091 % MagickBooleanType MagickSetImageDispose(MagickWand *wand,
9092 % const DisposeType dispose)
9094 % A description of each parameter follows:
9096 % o wand: the magick wand.
9098 % o dispose: the image disposeal type.
9101 WandExport MagickBooleanType MagickSetImageDispose(MagickWand *wand,
9102 const DisposeType dispose)
9104 assert(wand != (MagickWand *) NULL);
9105 assert(wand->signature == WandSignature);
9106 if (wand->debug != MagickFalse)
9107 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9108 if (wand->images == (Image *) NULL)
9109 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9110 wand->images->dispose=dispose;
9115 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9119 % M a g i c k S e t I m a g e E x t e n t %
9123 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9125 % MagickSetImageExtent() sets the image size (i.e. columns & rows).
9127 % The format of the MagickSetImageExtent method is:
9129 % MagickBooleanType MagickSetImageExtent(MagickWand *wand,
9130 % const size_t columns,const unsigned rows)
9132 % A description of each parameter follows:
9134 % o wand: the magick wand.
9136 % o columns: The image width in pixels.
9138 % o rows: The image height in pixels.
9141 WandExport MagickBooleanType MagickSetImageExtent(MagickWand *wand,
9142 const size_t columns,const size_t rows)
9144 assert(wand != (MagickWand *) NULL);
9145 assert(wand->signature == WandSignature);
9146 if (wand->debug != MagickFalse)
9147 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9148 if (wand->images == (Image *) NULL)
9149 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9150 return(SetImageExtent(wand->images,columns,rows,&wand->images->exception));
9154 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9158 % M a g i c k S e t I m a g e F i l e n a m e %
9162 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9164 % MagickSetImageFilename() sets the filename of a particular image in a
9167 % The format of the MagickSetImageFilename method is:
9169 % MagickBooleanType MagickSetImageFilename(MagickWand *wand,
9170 % const char *filename)
9172 % A description of each parameter follows:
9174 % o wand: the magick wand.
9176 % o filename: the image filename.
9179 WandExport MagickBooleanType MagickSetImageFilename(MagickWand *wand,
9180 const char *filename)
9182 assert(wand != (MagickWand *) NULL);
9183 assert(wand->signature == WandSignature);
9184 if (wand->debug != MagickFalse)
9185 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9186 if (wand->images == (Image *) NULL)
9187 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9188 if (filename != (const char *) NULL)
9189 (void) CopyMagickString(wand->images->filename,filename,MaxTextExtent);
9194 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9198 % M a g i c k S e t I m a g e F o r m a t %
9202 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9204 % MagickSetImageFormat() sets the format of a particular image in a
9207 % The format of the MagickSetImageFormat method is:
9209 % MagickBooleanType MagickSetImageFormat(MagickWand *wand,
9210 % const char *format)
9212 % A description of each parameter follows:
9214 % o wand: the magick wand.
9216 % o format: the image format.
9219 WandExport MagickBooleanType MagickSetImageFormat(MagickWand *wand,
9225 assert(wand != (MagickWand *) NULL);
9226 assert(wand->signature == WandSignature);
9227 if (wand->debug != MagickFalse)
9228 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9229 if (wand->images == (Image *) NULL)
9230 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9231 if ((format == (char *) NULL) || (*format == '\0'))
9233 *wand->images->magick='\0';
9236 magick_info=GetMagickInfo(format,wand->exception);
9237 if (magick_info == (const MagickInfo *) NULL)
9238 return(MagickFalse);
9239 ClearMagickException(wand->exception);
9240 (void) CopyMagickString(wand->images->magick,format,MaxTextExtent);
9245 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9249 % M a g i c k S e t I m a g e F u z z %
9253 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9255 % MagickSetImageFuzz() sets the image fuzz.
9257 % The format of the MagickSetImageFuzz method is:
9259 % MagickBooleanType MagickSetImageFuzz(MagickWand *wand,
9260 % const double fuzz)
9262 % A description of each parameter follows:
9264 % o wand: the magick wand.
9266 % o fuzz: the image fuzz.
9269 WandExport MagickBooleanType MagickSetImageFuzz(MagickWand *wand,
9272 assert(wand != (MagickWand *) NULL);
9273 assert(wand->signature == WandSignature);
9274 if (wand->debug != MagickFalse)
9275 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9276 if (wand->images == (Image *) NULL)
9277 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9278 wand->images->fuzz=fuzz;
9283 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9287 % M a g i c k S e t I m a g e G a m m a %
9291 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9293 % MagickSetImageGamma() sets the image gamma.
9295 % The format of the MagickSetImageGamma method is:
9297 % MagickBooleanType MagickSetImageGamma(MagickWand *wand,
9298 % const double gamma)
9300 % A description of each parameter follows:
9302 % o wand: the magick wand.
9304 % o gamma: the image gamma.
9307 WandExport MagickBooleanType MagickSetImageGamma(MagickWand *wand,
9310 assert(wand != (MagickWand *) NULL);
9311 assert(wand->signature == WandSignature);
9312 if (wand->debug != MagickFalse)
9313 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9314 if (wand->images == (Image *) NULL)
9315 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9316 wand->images->gamma=gamma;
9321 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9325 % M a g i c k S e t I m a g e G r a v i t y %
9329 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9331 % MagickSetImageGravity() sets the image gravity type.
9333 % The format of the MagickSetImageGravity method is:
9335 % MagickBooleanType MagickSetImageGravity(MagickWand *wand,
9336 % const GravityType gravity)
9338 % A description of each parameter follows:
9340 % o wand: the magick wand.
9342 % o gravity: the image interlace scheme: NoInterlace, LineInterlace,
9343 % PlaneInterlace, PartitionInterlace.
9346 WandExport MagickBooleanType MagickSetImageGravity(MagickWand *wand,
9347 const GravityType gravity)
9349 assert(wand != (MagickWand *) NULL);
9350 assert(wand->signature == WandSignature);
9351 if (wand->debug != MagickFalse)
9352 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9353 if (wand->images == (Image *) NULL)
9354 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9355 wand->images->gravity=gravity;
9360 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9364 % 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 %
9368 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9370 % MagickSetImageGreenPrimary() sets the image chromaticity green primary
9373 % The format of the MagickSetImageGreenPrimary method is:
9375 % MagickBooleanType MagickSetImageGreenPrimary(MagickWand *wand,
9376 % const double x,const double y)
9378 % A description of each parameter follows:
9380 % o wand: the magick wand.
9382 % o x: the green primary x-point.
9384 % o y: the green primary y-point.
9388 WandExport MagickBooleanType MagickSetImageGreenPrimary(MagickWand *wand,
9389 const double x,const double y)
9391 assert(wand != (MagickWand *) NULL);
9392 assert(wand->signature == WandSignature);
9393 if (wand->debug != MagickFalse)
9394 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9395 if (wand->images == (Image *) NULL)
9396 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9397 wand->images->chromaticity.green_primary.x=x;
9398 wand->images->chromaticity.green_primary.y=y;
9403 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9407 % 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 %
9411 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9413 % MagickSetImageInterlaceScheme() sets the image interlace scheme.
9415 % The format of the MagickSetImageInterlaceScheme method is:
9417 % MagickBooleanType MagickSetImageInterlaceScheme(MagickWand *wand,
9418 % const InterlaceType interlace)
9420 % A description of each parameter follows:
9422 % o wand: the magick wand.
9424 % o interlace: the image interlace scheme: NoInterlace, LineInterlace,
9425 % PlaneInterlace, PartitionInterlace.
9428 WandExport MagickBooleanType MagickSetImageInterlaceScheme(MagickWand *wand,
9429 const InterlaceType interlace)
9431 assert(wand != (MagickWand *) NULL);
9432 assert(wand->signature == WandSignature);
9433 if (wand->debug != MagickFalse)
9434 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9435 if (wand->images == (Image *) NULL)
9436 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9437 wand->images->interlace=interlace;
9442 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9446 % 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 %
9450 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9452 % MagickSetImageInterpolateMethod() sets the image interpolate pixel method.
9454 % The format of the MagickSetImageInterpolateMethod method is:
9456 % MagickBooleanType MagickSetImageInterpolateMethod(MagickWand *wand,
9457 % const InterpolatePixelMethod method)
9459 % A description of each parameter follows:
9461 % o wand: the magick wand.
9463 % o method: the image interpole pixel methods: choose from Undefined,
9464 % Average, Bicubic, Bilinear, Filter, Integer, Mesh, NearestNeighbor.
9467 WandExport MagickBooleanType MagickSetImageInterpolateMethod(MagickWand *wand,
9468 const InterpolatePixelMethod method)
9470 assert(wand != (MagickWand *) NULL);
9471 assert(wand->signature == WandSignature);
9472 if (wand->debug != MagickFalse)
9473 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9474 if (wand->images == (Image *) NULL)
9475 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9476 wand->images->interpolate=method;
9481 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9485 % M a g i c k S e t I m a g e I t e r a t i o n s %
9489 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9491 % MagickSetImageIterations() sets the image iterations.
9493 % The format of the MagickSetImageIterations method is:
9495 % MagickBooleanType MagickSetImageIterations(MagickWand *wand,
9496 % const size_t iterations)
9498 % A description of each parameter follows:
9500 % o wand: the magick wand.
9502 % o delay: the image delay in 1/100th of a second.
9505 WandExport MagickBooleanType MagickSetImageIterations(MagickWand *wand,
9506 const size_t iterations)
9508 assert(wand != (MagickWand *) NULL);
9509 assert(wand->signature == WandSignature);
9510 if (wand->debug != MagickFalse)
9511 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9512 if (wand->images == (Image *) NULL)
9513 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9514 wand->images->iterations=iterations;
9519 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9523 % M a g i c k S e t I m a g e M a t t e %
9527 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9529 % MagickSetImageMatte() sets the image matte channel.
9531 % The format of the MagickSetImageMatteColor method is:
9533 % MagickBooleanType MagickSetImageMatteColor(MagickWand *wand,
9534 % const MagickBooleanType *matte)
9536 % A description of each parameter follows:
9538 % o wand: the magick wand.
9540 % o matte: Set to MagickTrue to enable the image matte channel otherwise
9544 WandExport MagickBooleanType MagickSetImageMatte(MagickWand *wand,
9545 const MagickBooleanType matte)
9547 assert(wand != (MagickWand *) NULL);
9548 assert(wand->signature == WandSignature);
9549 if (wand->debug != MagickFalse)
9550 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9551 if (wand->images == (Image *) NULL)
9552 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9553 if ((wand->images->matte == MagickFalse) && (matte != MagickFalse))
9554 (void) SetImageOpacity(wand->images,OpaqueAlpha);
9555 wand->images->matte=matte;
9560 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9564 % M a g i c k S e t I m a g e M a t t e C o l o r %
9568 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9570 % MagickSetImageMatteColor() sets the image matte color.
9572 % The format of the MagickSetImageMatteColor method is:
9574 % MagickBooleanType MagickSetImageMatteColor(MagickWand *wand,
9575 % const PixelWand *matte)
9577 % A description of each parameter follows:
9579 % o wand: the magick wand.
9581 % o matte: the matte pixel wand.
9584 WandExport MagickBooleanType MagickSetImageMatteColor(MagickWand *wand,
9585 const PixelWand *matte)
9587 assert(wand != (MagickWand *) NULL);
9588 assert(wand->signature == WandSignature);
9589 if (wand->debug != MagickFalse)
9590 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9591 if (wand->images == (Image *) NULL)
9592 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9593 PixelGetQuantumPacket(matte,&wand->images->matte_color);
9598 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9602 % M a g i c k S e t I m a g e O p a c i t y %
9606 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9608 % MagickSetImageOpacity() sets the image to the specified opacity level.
9610 % The format of the MagickSetImageOpacity method is:
9612 % MagickBooleanType MagickSetImageOpacity(MagickWand *wand,
9613 % const double alpha)
9615 % A description of each parameter follows:
9617 % o wand: the magick wand.
9619 % o alpha: the level of transparency: 1.0 is fully opaque and 0.0 is fully
9623 WandExport MagickBooleanType MagickSetImageOpacity(MagickWand *wand,
9629 assert(wand != (MagickWand *) NULL);
9630 assert(wand->signature == WandSignature);
9631 if (wand->debug != MagickFalse)
9632 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9633 if (wand->images == (Image *) NULL)
9634 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9635 status=SetImageOpacity(wand->images,ClampToQuantum(QuantumRange*alpha));
9636 if (status == MagickFalse)
9637 InheritException(wand->exception,&wand->images->exception);
9642 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9646 % 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 %
9650 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9652 % MagickSetImageOrientation() sets the image orientation.
9654 % The format of the MagickSetImageOrientation method is:
9656 % MagickBooleanType MagickSetImageOrientation(MagickWand *wand,
9657 % const OrientationType orientation)
9659 % A description of each parameter follows:
9661 % o wand: the magick wand.
9663 % o orientation: the image orientation type.
9666 WandExport MagickBooleanType MagickSetImageOrientation(MagickWand *wand,
9667 const OrientationType orientation)
9669 assert(wand != (MagickWand *) NULL);
9670 assert(wand->signature == WandSignature);
9671 if (wand->debug != MagickFalse)
9672 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9673 if (wand->images == (Image *) NULL)
9674 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9675 wand->images->orientation=orientation;
9680 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9684 % M a g i c k S e t I m a g e P a g e %
9688 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9690 % MagickSetImagePage() sets the page geometry of the image.
9692 % The format of the MagickSetImagePage method is:
9694 % MagickBooleanType MagickSetImagePage(MagickWand *wand,
9695 % const size_t width,const size_t height,const ssize_t x,
9698 % A description of each parameter follows:
9700 % o wand: the magick wand.
9702 % o width: the page width.
9704 % o height: the page height.
9706 % o x: the page x-offset.
9708 % o y: the page y-offset.
9711 WandExport MagickBooleanType MagickSetImagePage(MagickWand *wand,
9712 const size_t width,const size_t height,const ssize_t x,
9715 assert(wand != (MagickWand *) NULL);
9716 assert(wand->signature == WandSignature);
9717 if (wand->debug != MagickFalse)
9718 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9719 if (wand->images == (Image *) NULL)
9720 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9721 wand->images->page.width=width;
9722 wand->images->page.height=height;
9723 wand->images->page.x=x;
9724 wand->images->page.y=y;
9729 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9733 % 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 %
9737 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9739 % MagickSetImageProgressMonitor() sets the wand image progress monitor to the
9740 % specified method and returns the previous progress monitor if any. The
9741 % progress monitor method looks like this:
9743 % MagickBooleanType MagickProgressMonitor(const char *text,
9744 % const MagickOffsetType offset,const MagickSizeType span,
9745 % void *client_data)
9747 % If the progress monitor returns MagickFalse, the current operation is
9750 % The format of the MagickSetImageProgressMonitor method is:
9752 % MagickProgressMonitor MagickSetImageProgressMonitor(MagickWand *wand
9753 % const MagickProgressMonitor progress_monitor,void *client_data)
9755 % A description of each parameter follows:
9757 % o wand: the magick wand.
9759 % o progress_monitor: Specifies a pointer to a method to monitor progress
9760 % of an image operation.
9762 % o client_data: Specifies a pointer to any client data.
9765 WandExport MagickProgressMonitor MagickSetImageProgressMonitor(MagickWand *wand,
9766 const MagickProgressMonitor progress_monitor,void *client_data)
9768 MagickProgressMonitor
9771 assert(wand != (MagickWand *) NULL);
9772 assert(wand->signature == WandSignature);
9773 if (wand->debug != MagickFalse)
9774 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9775 if (wand->images == (Image *) NULL)
9777 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
9778 "ContainsNoImages","`%s'",wand->name);
9779 return((MagickProgressMonitor) NULL);
9781 previous_monitor=SetImageProgressMonitor(wand->images,
9782 progress_monitor,client_data);
9783 return(previous_monitor);
9787 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9791 % M a g i c k S e t I m a g e R e d P r i m a r y %
9795 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9797 % MagickSetImageRedPrimary() sets the image chromaticity red primary point.
9799 % The format of the MagickSetImageRedPrimary method is:
9801 % MagickBooleanType MagickSetImageRedPrimary(MagickWand *wand,
9802 % const double x,const double y)
9804 % A description of each parameter follows:
9806 % o wand: the magick wand.
9808 % o x: the red primary x-point.
9810 % o y: the red primary y-point.
9813 WandExport MagickBooleanType MagickSetImageRedPrimary(MagickWand *wand,
9814 const double x,const double y)
9816 assert(wand != (MagickWand *) NULL);
9817 assert(wand->signature == WandSignature);
9818 if (wand->debug != MagickFalse)
9819 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9820 if (wand->images == (Image *) NULL)
9821 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9822 wand->images->chromaticity.red_primary.x=x;
9823 wand->images->chromaticity.red_primary.y=y;
9828 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9832 % 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 %
9836 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9838 % MagickSetImageRenderingIntent() sets the image rendering intent.
9840 % The format of the MagickSetImageRenderingIntent method is:
9842 % MagickBooleanType MagickSetImageRenderingIntent(MagickWand *wand,
9843 % const RenderingIntent rendering_intent)
9845 % A description of each parameter follows:
9847 % o wand: the magick wand.
9849 % o rendering_intent: the image rendering intent: UndefinedIntent,
9850 % SaturationIntent, PerceptualIntent, AbsoluteIntent, or RelativeIntent.
9853 WandExport MagickBooleanType MagickSetImageRenderingIntent(MagickWand *wand,
9854 const RenderingIntent rendering_intent)
9856 assert(wand != (MagickWand *) NULL);
9857 assert(wand->signature == WandSignature);
9858 if (wand->debug != MagickFalse)
9859 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9860 if (wand->images == (Image *) NULL)
9861 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9862 wand->images->rendering_intent=rendering_intent;
9867 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9871 % M a g i c k S e t I m a g e R e s o l u t i o n %
9875 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9877 % MagickSetImageResolution() sets the image resolution.
9879 % The format of the MagickSetImageResolution method is:
9881 % MagickBooleanType MagickSetImageResolution(MagickWand *wand,
9882 % const double x_resolution,const doubtl y_resolution)
9884 % A description of each parameter follows:
9886 % o wand: the magick wand.
9888 % o x_resolution: the image x resolution.
9890 % o y_resolution: the image y resolution.
9893 WandExport MagickBooleanType MagickSetImageResolution(MagickWand *wand,
9894 const double x_resolution,const double y_resolution)
9896 assert(wand != (MagickWand *) NULL);
9897 assert(wand->signature == WandSignature);
9898 if (wand->debug != MagickFalse)
9899 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9900 if (wand->images == (Image *) NULL)
9901 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9902 wand->images->x_resolution=x_resolution;
9903 wand->images->y_resolution=y_resolution;
9908 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9912 % M a g i c k S e t I m a g e S c e n e %
9916 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9918 % MagickSetImageScene() sets the image scene.
9920 % The format of the MagickSetImageScene method is:
9922 % MagickBooleanType MagickSetImageScene(MagickWand *wand,
9923 % const size_t scene)
9925 % A description of each parameter follows:
9927 % o wand: the magick wand.
9929 % o delay: the image scene number.
9932 WandExport MagickBooleanType MagickSetImageScene(MagickWand *wand,
9935 assert(wand != (MagickWand *) NULL);
9936 assert(wand->signature == WandSignature);
9937 if (wand->debug != MagickFalse)
9938 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9939 if (wand->images == (Image *) NULL)
9940 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9941 wand->images->scene=scene;
9946 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9950 % 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 %
9954 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9956 % MagickSetImageTicksPerSecond() sets the image ticks-per-second.
9958 % The format of the MagickSetImageTicksPerSecond method is:
9960 % MagickBooleanType MagickSetImageTicksPerSecond(MagickWand *wand,
9961 % const ssize_t ticks_per-second)
9963 % A description of each parameter follows:
9965 % o wand: the magick wand.
9967 % o ticks_per_second: the units to use for the image delay.
9970 WandExport MagickBooleanType MagickSetImageTicksPerSecond(MagickWand *wand,
9971 const ssize_t ticks_per_second)
9973 assert(wand != (MagickWand *) NULL);
9974 assert(wand->signature == WandSignature);
9975 if (wand->debug != MagickFalse)
9976 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9977 if (wand->images == (Image *) NULL)
9978 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9979 wand->images->ticks_per_second=ticks_per_second;
9984 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9988 % M a g i c k S e t I m a g e T y p e %
9992 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9994 % MagickSetImageType() sets the image type.
9996 % The format of the MagickSetImageType method is:
9998 % MagickBooleanType MagickSetImageType(MagickWand *wand,
9999 % const ImageType image_type)
10001 % A description of each parameter follows:
10003 % o wand: the magick wand.
10005 % o image_type: the image type: UndefinedType, BilevelType, GrayscaleType,
10006 % GrayscaleMatteType, PaletteType, PaletteMatteType, TrueColorType,
10007 % TrueColorMatteType, ColorSeparationType, ColorSeparationMatteType,
10011 WandExport MagickBooleanType MagickSetImageType(MagickWand *wand,
10012 const ImageType image_type)
10014 assert(wand != (MagickWand *) NULL);
10015 assert(wand->signature == WandSignature);
10016 if (wand->debug != MagickFalse)
10017 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10018 if (wand->images == (Image *) NULL)
10019 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10020 return(SetImageType(wand->images,image_type));
10024 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10028 % M a g i c k S e t I m a g e U n i t s %
10032 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10034 % MagickSetImageUnits() sets the image units of resolution.
10036 % The format of the MagickSetImageUnits method is:
10038 % MagickBooleanType MagickSetImageUnits(MagickWand *wand,
10039 % const ResolutionType units)
10041 % A description of each parameter follows:
10043 % o wand: the magick wand.
10045 % o units: the image units of resolution : UndefinedResolution,
10046 % PixelsPerInchResolution, or PixelsPerCentimeterResolution.
10049 WandExport MagickBooleanType MagickSetImageUnits(MagickWand *wand,
10050 const ResolutionType units)
10052 assert(wand != (MagickWand *) NULL);
10053 assert(wand->signature == WandSignature);
10054 if (wand->debug != MagickFalse)
10055 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10056 if (wand->images == (Image *) NULL)
10057 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10058 wand->images->units=units;
10059 return(MagickTrue);
10063 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10067 % 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 %
10071 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10073 % MagickSetImageVirtualPixelMethod() sets the image virtual pixel method.
10075 % The format of the MagickSetImageVirtualPixelMethod method is:
10077 % VirtualPixelMethod MagickSetImageVirtualPixelMethod(MagickWand *wand,
10078 % const VirtualPixelMethod method)
10080 % A description of each parameter follows:
10082 % o wand: the magick wand.
10084 % o method: the image virtual pixel method : UndefinedVirtualPixelMethod,
10085 % ConstantVirtualPixelMethod, EdgeVirtualPixelMethod,
10086 % MirrorVirtualPixelMethod, or TileVirtualPixelMethod.
10089 WandExport VirtualPixelMethod MagickSetImageVirtualPixelMethod(MagickWand *wand,
10090 const VirtualPixelMethod method)
10092 assert(wand != (MagickWand *) NULL);
10093 assert(wand->signature == WandSignature);
10094 if (wand->debug != MagickFalse)
10095 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10096 if (wand->images == (Image *) NULL)
10097 return(UndefinedVirtualPixelMethod);
10098 return(SetImageVirtualPixelMethod(wand->images,method));
10102 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10106 % M a g i c k S e t I m a g e W h i t e P o i n t %
10110 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10112 % MagickSetImageWhitePoint() sets the image chromaticity white point.
10114 % The format of the MagickSetImageWhitePoint method is:
10116 % MagickBooleanType MagickSetImageWhitePoint(MagickWand *wand,
10117 % const double x,const double y)
10119 % A description of each parameter follows:
10121 % o wand: the magick wand.
10123 % o x: the white x-point.
10125 % o y: the white y-point.
10128 WandExport MagickBooleanType MagickSetImageWhitePoint(MagickWand *wand,
10129 const double x,const double y)
10131 assert(wand != (MagickWand *) NULL);
10132 assert(wand->signature == WandSignature);
10133 if (wand->debug != MagickFalse)
10134 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10135 if (wand->images == (Image *) NULL)
10136 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10137 wand->images->chromaticity.white_point.x=x;
10138 wand->images->chromaticity.white_point.y=y;
10139 return(MagickTrue);
10143 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10147 % M a g i c k S h a d e I m a g e C h a n n e l %
10151 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10153 % MagickShadeImage() shines a distant light on an image to create a
10154 % three-dimensional effect. You control the positioning of the light with
10155 % azimuth and elevation; azimuth is measured in degrees off the x axis
10156 % and elevation is measured in pixels above the Z axis.
10158 % The format of the MagickShadeImage method is:
10160 % MagickBooleanType MagickShadeImage(MagickWand *wand,
10161 % const MagickBooleanType gray,const double azimuth,
10162 % const double elevation)
10164 % A description of each parameter follows:
10166 % o wand: the magick wand.
10168 % o gray: A value other than zero shades the intensity of each pixel.
10170 % o azimuth, elevation: Define the light source direction.
10173 WandExport MagickBooleanType MagickShadeImage(MagickWand *wand,
10174 const MagickBooleanType gray,const double asimuth,const double elevation)
10179 assert(wand != (MagickWand *) NULL);
10180 assert(wand->signature == WandSignature);
10181 if (wand->debug != MagickFalse)
10182 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10183 if (wand->images == (Image *) NULL)
10184 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10185 shade_image=ShadeImage(wand->images,gray,asimuth,elevation,wand->exception);
10186 if (shade_image == (Image *) NULL)
10187 return(MagickFalse);
10188 ReplaceImageInList(&wand->images,shade_image);
10189 return(MagickTrue);
10193 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10197 % M a g i c k S h a d o w I m a g e %
10201 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10203 % MagickShadowImage() simulates an image shadow.
10205 % The format of the MagickShadowImage method is:
10207 % MagickBooleanType MagickShadowImage(MagickWand *wand,
10208 % const double opacity,const double sigma,const ssize_t x,const ssize_t y)
10210 % A description of each parameter follows:
10212 % o wand: the magick wand.
10214 % o opacity: percentage transparency.
10216 % o sigma: the standard deviation of the Gaussian, in pixels.
10218 % o x: the shadow x-offset.
10220 % o y: the shadow y-offset.
10223 WandExport MagickBooleanType MagickShadowImage(MagickWand *wand,
10224 const double opacity,const double sigma,const ssize_t x,const ssize_t y)
10229 assert(wand != (MagickWand *) NULL);
10230 assert(wand->signature == WandSignature);
10231 if (wand->debug != MagickFalse)
10232 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10233 if (wand->images == (Image *) NULL)
10234 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10235 shadow_image=ShadowImage(wand->images,opacity,sigma,x,y,wand->exception);
10236 if (shadow_image == (Image *) NULL)
10237 return(MagickFalse);
10238 ReplaceImageInList(&wand->images,shadow_image);
10239 return(MagickTrue);
10243 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10247 % M a g i c k S h a r p e n I m a g e %
10251 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10253 % MagickSharpenImage() sharpens an image. We convolve the image with a
10254 % Gaussian operator of the given radius and standard deviation (sigma).
10255 % For reasonable results, the radius should be larger than sigma. Use a
10256 % radius of 0 and MagickSharpenImage() selects a suitable radius for you.
10258 % The format of the MagickSharpenImage method is:
10260 % MagickBooleanType MagickSharpenImage(MagickWand *wand,
10261 % const double radius,const double sigma)
10263 % A description of each parameter follows:
10265 % o wand: the magick wand.
10267 % o radius: the radius of the Gaussian, in pixels, not counting the center
10270 % o sigma: the standard deviation of the Gaussian, in pixels.
10273 WandExport MagickBooleanType MagickSharpenImage(MagickWand *wand,
10274 const double radius,const double sigma)
10279 assert(wand != (MagickWand *) NULL);
10280 assert(wand->signature == WandSignature);
10281 if (wand->debug != MagickFalse)
10282 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10283 if (wand->images == (Image *) NULL)
10284 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10285 sharp_image=SharpenImage(wand->images,radius,sigma,wand->exception);
10286 if (sharp_image == (Image *) NULL)
10287 return(MagickFalse);
10288 ReplaceImageInList(&wand->images,sharp_image);
10289 return(MagickTrue);
10293 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10297 % M a g i c k S h a v e I m a g e %
10301 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10303 % MagickShaveImage() shaves pixels from the image edges. It allocates the
10304 % memory necessary for the new Image structure and returns a pointer to the
10307 % The format of the MagickShaveImage method is:
10309 % MagickBooleanType MagickShaveImage(MagickWand *wand,
10310 % const size_t columns,const size_t rows)
10312 % A description of each parameter follows:
10314 % o wand: the magick wand.
10316 % o columns: the number of columns in the scaled image.
10318 % o rows: the number of rows in the scaled image.
10322 WandExport MagickBooleanType MagickShaveImage(MagickWand *wand,
10323 const size_t columns,const size_t rows)
10331 assert(wand != (MagickWand *) NULL);
10332 assert(wand->signature == WandSignature);
10333 if (wand->debug != MagickFalse)
10334 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10335 if (wand->images == (Image *) NULL)
10336 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10337 shave_info.width=columns;
10338 shave_info.height=rows;
10341 shave_image=ShaveImage(wand->images,&shave_info,wand->exception);
10342 if (shave_image == (Image *) NULL)
10343 return(MagickFalse);
10344 ReplaceImageInList(&wand->images,shave_image);
10345 return(MagickTrue);
10349 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10353 % M a g i c k S h e a r I m a g e %
10357 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10359 % MagickShearImage() slides one edge of an image along the X or Y axis,
10360 % creating a parallelogram. An X direction shear slides an edge along the X
10361 % axis, while a Y direction shear slides an edge along the Y axis. The amount
10362 % of the shear is controlled by a shear angle. For X direction shears, x_shear
10363 % is measured relative to the Y axis, and similarly, for Y direction shears
10364 % y_shear is measured relative to the X axis. Empty triangles left over from
10365 % shearing the image are filled with the background color.
10367 % The format of the MagickShearImage method is:
10369 % MagickBooleanType MagickShearImage(MagickWand *wand,
10370 % const PixelWand *background,const double x_shear,onst double y_shear)
10372 % A description of each parameter follows:
10374 % o wand: the magick wand.
10376 % o background: the background pixel wand.
10378 % o x_shear: the number of degrees to shear the image.
10380 % o y_shear: the number of degrees to shear the image.
10383 WandExport MagickBooleanType MagickShearImage(MagickWand *wand,
10384 const PixelWand *background,const double x_shear,const double y_shear)
10389 assert(wand != (MagickWand *) NULL);
10390 assert(wand->signature == WandSignature);
10391 if (wand->debug != MagickFalse)
10392 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10393 if (wand->images == (Image *) NULL)
10394 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10395 PixelGetQuantumPacket(background,&wand->images->background_color);
10396 shear_image=ShearImage(wand->images,x_shear,y_shear,wand->exception);
10397 if (shear_image == (Image *) NULL)
10398 return(MagickFalse);
10399 ReplaceImageInList(&wand->images,shear_image);
10400 return(MagickTrue);
10404 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10408 % 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 %
10412 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10414 % MagickSigmoidalContrastImage() adjusts the contrast of an image with a
10415 % non-linear sigmoidal contrast algorithm. Increase the contrast of the
10416 % image using a sigmoidal transfer function without saturating highlights or
10417 % shadows. Contrast indicates how much to increase the contrast (0 is none;
10418 % 3 is typical; 20 is pushing it); mid-point indicates where midtones fall in
10419 % the resultant image (0 is white; 50% is middle-gray; 100% is black). Set
10420 % sharpen to MagickTrue to increase the image contrast otherwise the contrast
10423 % The format of the MagickSigmoidalContrastImage method is:
10425 % MagickBooleanType MagickSigmoidalContrastImage(MagickWand *wand,
10426 % const MagickBooleanType sharpen,const double alpha,const double beta)
10428 % A description of each parameter follows:
10430 % o wand: the magick wand.
10432 % o sharpen: Increase or decrease image contrast.
10434 % o alpha: strength of the contrast, the larger the number the more
10435 % 'threshold-like' it becomes.
10437 % o beta: midpoint of the function as a color value 0 to QuantumRange.
10440 WandExport MagickBooleanType MagickSigmoidalContrastImage(
10441 MagickWand *wand,const MagickBooleanType sharpen,const double alpha,
10447 assert(wand != (MagickWand *) NULL);
10448 assert(wand->signature == WandSignature);
10449 if (wand->debug != MagickFalse)
10450 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10451 if (wand->images == (Image *) NULL)
10452 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10453 status=SigmoidalContrastImage(wand->images,sharpen,alpha,beta);
10454 if (status == MagickFalse)
10455 InheritException(wand->exception,&wand->images->exception);
10460 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10464 % M a g i c k S i m i l a r i t y I m a g e %
10468 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10470 % MagickSimilarityImage() compares the reference image of the image and
10471 % returns the best match offset. In addition, it returns a similarity image
10472 % such that an exact match location is completely white and if none of the
10473 % pixels match, black, otherwise some gray level in-between.
10475 % The format of the MagickSimilarityImage method is:
10477 % MagickWand *MagickSimilarityImage(MagickWand *wand,
10478 % const MagickWand *reference,RectangeInfo *offset,double *similarity)
10480 % A description of each parameter follows:
10482 % o wand: the magick wand.
10484 % o reference: the reference wand.
10486 % o offset: the best match offset of the reference image within the image.
10488 % o similarity: the computed similarity between the images.
10491 WandExport MagickWand *MagickSimilarityImage(MagickWand *wand,
10492 const MagickWand *reference,RectangleInfo *offset,double *similarity)
10497 assert(wand != (MagickWand *) NULL);
10498 assert(wand->signature == WandSignature);
10499 if (wand->debug != MagickFalse)
10500 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10501 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
10503 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
10504 "ContainsNoImages","`%s'",wand->name);
10505 return((MagickWand *) NULL);
10507 similarity_image=SimilarityImage(wand->images,reference->images,offset,
10508 similarity,&wand->images->exception);
10509 if (similarity_image == (Image *) NULL)
10510 return((MagickWand *) NULL);
10511 return(CloneMagickWandFromImages(wand,similarity_image));
10515 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10519 % M a g i c k S k e t c h I m a g e %
10523 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10525 % MagickSketchImage() simulates a pencil sketch. We convolve the image with
10526 % a Gaussian operator of the given radius and standard deviation (sigma).
10527 % For reasonable results, radius should be larger than sigma. Use a
10528 % radius of 0 and SketchImage() selects a suitable radius for you.
10529 % Angle gives the angle of the blurring motion.
10531 % The format of the MagickSketchImage method is:
10533 % MagickBooleanType MagickSketchImage(MagickWand *wand,
10534 % const double radius,const double sigma,const double angle)
10536 % A description of each parameter follows:
10538 % o wand: the magick wand.
10540 % o radius: the radius of the Gaussian, in pixels, not counting
10541 % the center pixel.
10543 % o sigma: the standard deviation of the Gaussian, in pixels.
10545 % o angle: Apply the effect along this angle.
10548 WandExport MagickBooleanType MagickSketchImage(MagickWand *wand,
10549 const double radius,const double sigma,const double angle)
10554 assert(wand != (MagickWand *) NULL);
10555 assert(wand->signature == WandSignature);
10556 if (wand->debug != MagickFalse)
10557 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10558 if (wand->images == (Image *) NULL)
10559 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10560 sketch_image=SketchImage(wand->images,radius,sigma,angle,wand->exception);
10561 if (sketch_image == (Image *) NULL)
10562 return(MagickFalse);
10563 ReplaceImageInList(&wand->images,sketch_image);
10564 return(MagickTrue);
10568 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10572 % M a g i c k S m u s h I m a g e s %
10576 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10578 % MagickSmushImages() takes all images from the current image pointer to the
10579 % end of the image list and smushs them to each other top-to-bottom if the
10580 % stack parameter is true, otherwise left-to-right.
10582 % The format of the MagickSmushImages method is:
10584 % MagickWand *MagickSmushImages(MagickWand *wand,
10585 % const MagickBooleanType stack,const ssize_t offset)
10587 % A description of each parameter follows:
10589 % o wand: the magick wand.
10591 % o stack: By default, images are stacked left-to-right. Set stack to
10592 % MagickTrue to stack them top-to-bottom.
10594 % o offset: minimum distance in pixels between images.
10597 WandExport MagickWand *MagickSmushImages(MagickWand *wand,
10598 const MagickBooleanType stack,const ssize_t offset)
10603 assert(wand != (MagickWand *) NULL);
10604 assert(wand->signature == WandSignature);
10605 if (wand->debug != MagickFalse)
10606 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10607 if (wand->images == (Image *) NULL)
10608 return((MagickWand *) NULL);
10609 smush_image=SmushImages(wand->images,stack,offset,wand->exception);
10610 if (smush_image == (Image *) NULL)
10611 return((MagickWand *) NULL);
10612 return(CloneMagickWandFromImages(wand,smush_image));
10616 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10620 % M a g i c k S o l a r i z e I m a g e %
10624 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10626 % MagickSolarizeImage() applies a special effect to the image, similar to the
10627 % effect achieved in a photo darkroom by selectively exposing areas of photo
10628 % sensitive paper to light. Threshold ranges from 0 to QuantumRange and is a
10629 % measure of the extent of the solarization.
10631 % The format of the MagickSolarizeImage method is:
10633 % MagickBooleanType MagickSolarizeImage(MagickWand *wand,
10634 % const double threshold)
10636 % A description of each parameter follows:
10638 % o wand: the magick wand.
10640 % o threshold: Define the extent of the solarization.
10643 WandExport MagickBooleanType MagickSolarizeImage(MagickWand *wand,
10644 const double threshold)
10649 assert(wand != (MagickWand *) NULL);
10650 assert(wand->signature == WandSignature);
10651 if (wand->debug != MagickFalse)
10652 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10653 if (wand->images == (Image *) NULL)
10654 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10655 status=SolarizeImage(wand->images,threshold);
10656 if (status == MagickFalse)
10657 InheritException(wand->exception,&wand->images->exception);
10662 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10666 % M a g i c k S p a r s e C o l o r I m a g e %
10670 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10672 % MagickSparseColorImage(), given a set of coordinates, interpolates the
10673 % colors found at those coordinates, across the whole image, using various
10676 % The format of the MagickSparseColorImage method is:
10678 % MagickBooleanType MagickSparseColorImage(MagickWand *wand,
10679 % const SparseColorMethod method,const size_t number_arguments,
10680 % const double *arguments)
10682 % A description of each parameter follows:
10684 % o image: the image to be sparseed.
10686 % o method: the method of image sparseion.
10688 % ArcSparseColorion will always ignore source image offset, and always
10689 % 'bestfit' the destination image with the top left corner offset
10690 % relative to the polar mapping center.
10692 % Bilinear has no simple inverse mapping so will not allow 'bestfit'
10693 % style of image sparseion.
10695 % Affine, Perspective, and Bilinear, will do least squares fitting of
10696 % the distrotion when more than the minimum number of control point
10697 % pairs are provided.
10699 % Perspective, and Bilinear, will fall back to a Affine sparseion when
10700 % less than 4 control point pairs are provided. While Affine sparseions
10701 % will let you use any number of control point pairs, that is Zero pairs
10702 % is a No-Op (viewport only) distrotion, one pair is a translation and
10703 % two pairs of control points will do a scale-rotate-translate, without
10706 % o number_arguments: the number of arguments given for this sparseion
10709 % o arguments: the arguments for this sparseion method.
10712 WandExport MagickBooleanType MagickSparseColorImage(MagickWand *wand,
10713 const SparseColorMethod method,const size_t number_arguments,
10714 const double *arguments)
10719 assert(wand != (MagickWand *) NULL);
10720 assert(wand->signature == WandSignature);
10721 if (wand->debug != MagickFalse)
10722 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10723 if (wand->images == (Image *) NULL)
10724 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10725 sparse_image=SparseColorImage(wand->images,method,number_arguments,arguments,
10727 if (sparse_image == (Image *) NULL)
10728 return(MagickFalse);
10729 ReplaceImageInList(&wand->images,sparse_image);
10730 return(MagickTrue);
10734 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10738 % M a g i c k S p l i c e I m a g e %
10742 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10744 % MagickSpliceImage() splices a solid color into the image.
10746 % The format of the MagickSpliceImage method is:
10748 % MagickBooleanType MagickSpliceImage(MagickWand *wand,
10749 % const size_t width,const size_t height,const ssize_t x,
10752 % A description of each parameter follows:
10754 % o wand: the magick wand.
10756 % o width: the region width.
10758 % o height: the region height.
10760 % o x: the region x offset.
10762 % o y: the region y offset.
10765 WandExport MagickBooleanType MagickSpliceImage(MagickWand *wand,
10766 const size_t width,const size_t height,const ssize_t x,
10775 assert(wand != (MagickWand *) NULL);
10776 assert(wand->signature == WandSignature);
10777 if (wand->debug != MagickFalse)
10778 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10779 if (wand->images == (Image *) NULL)
10780 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10781 splice.width=width;
10782 splice.height=height;
10785 splice_image=SpliceImage(wand->images,&splice,wand->exception);
10786 if (splice_image == (Image *) NULL)
10787 return(MagickFalse);
10788 ReplaceImageInList(&wand->images,splice_image);
10789 return(MagickTrue);
10793 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10797 % M a g i c k S p r e a d I m a g e %
10801 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10803 % MagickSpreadImage() is a special effects method that randomly displaces each
10804 % pixel in a block defined by the radius parameter.
10806 % The format of the MagickSpreadImage method is:
10808 % MagickBooleanType MagickSpreadImage(MagickWand *wand,const double radius)
10810 % A description of each parameter follows:
10812 % o wand: the magick wand.
10814 % o radius: Choose a random pixel in a neighborhood of this extent.
10817 WandExport MagickBooleanType MagickSpreadImage(MagickWand *wand,
10818 const double radius)
10823 assert(wand != (MagickWand *) NULL);
10824 assert(wand->signature == WandSignature);
10825 if (wand->debug != MagickFalse)
10826 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10827 if (wand->images == (Image *) NULL)
10828 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10829 spread_image=SpreadImage(wand->images,radius,wand->exception);
10830 if (spread_image == (Image *) NULL)
10831 return(MagickFalse);
10832 ReplaceImageInList(&wand->images,spread_image);
10833 return(MagickTrue);
10837 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10841 % M a g i c k S t a t i s t i c I m a g e %
10845 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10847 % MagickStatisticImage() replace each pixel with corresponding statistic from
10848 % the neighborhood of the specified width and height.
10850 % The format of the MagickStatisticImage method is:
10852 % MagickBooleanType MagickStatisticImage(MagickWand *wand,
10853 % const StatisticType type,const double width,const size_t height)
10855 % A description of each parameter follows:
10857 % o wand: the magick wand.
10859 % o type: the statistic type (e.g. median, mode, etc.).
10861 % o width: the width of the pixel neighborhood.
10863 % o height: the height of the pixel neighborhood.
10866 WandExport MagickBooleanType MagickStatisticImage(MagickWand *wand,
10867 const StatisticType type,const size_t width,const size_t height)
10872 assert(wand != (MagickWand *) NULL);
10873 assert(wand->signature == WandSignature);
10874 if (wand->debug != MagickFalse)
10875 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10876 if (wand->images == (Image *) NULL)
10877 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10878 statistic_image=StatisticImage(wand->images,type,width,height,
10880 if (statistic_image == (Image *) NULL)
10881 return(MagickFalse);
10882 ReplaceImageInList(&wand->images,statistic_image);
10883 return(MagickTrue);
10887 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10891 % M a g i c k S t e g a n o I m a g e %
10895 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10897 % MagickSteganoImage() hides a digital watermark within the image.
10898 % Recover the hidden watermark later to prove that the authenticity of
10899 % an image. Offset defines the start position within the image to hide
10902 % The format of the MagickSteganoImage method is:
10904 % MagickWand *MagickSteganoImage(MagickWand *wand,
10905 % const MagickWand *watermark_wand,const ssize_t offset)
10907 % A description of each parameter follows:
10909 % o wand: the magick wand.
10911 % o watermark_wand: the watermark wand.
10913 % o offset: Start hiding at this offset into the image.
10916 WandExport MagickWand *MagickSteganoImage(MagickWand *wand,
10917 const MagickWand *watermark_wand,const ssize_t offset)
10922 assert(wand != (MagickWand *) NULL);
10923 assert(wand->signature == WandSignature);
10924 if (wand->debug != MagickFalse)
10925 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10926 if ((wand->images == (Image *) NULL) ||
10927 (watermark_wand->images == (Image *) NULL))
10929 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
10930 "ContainsNoImages","`%s'",wand->name);
10931 return((MagickWand *) NULL);
10933 wand->images->offset=offset;
10934 stegano_image=SteganoImage(wand->images,watermark_wand->images,
10936 if (stegano_image == (Image *) NULL)
10937 return((MagickWand *) NULL);
10938 return(CloneMagickWandFromImages(wand,stegano_image));
10942 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10946 % M a g i c k S t e r e o I m a g e %
10950 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10952 % MagickStereoImage() composites two images and produces a single image that
10953 % is the composite of a left and right image of a stereo pair
10955 % The format of the MagickStereoImage method is:
10957 % MagickWand *MagickStereoImage(MagickWand *wand,
10958 % const MagickWand *offset_wand)
10960 % A description of each parameter follows:
10962 % o wand: the magick wand.
10964 % o offset_wand: Another image wand.
10967 WandExport MagickWand *MagickStereoImage(MagickWand *wand,
10968 const MagickWand *offset_wand)
10973 assert(wand != (MagickWand *) NULL);
10974 assert(wand->signature == WandSignature);
10975 if (wand->debug != MagickFalse)
10976 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10977 if ((wand->images == (Image *) NULL) ||
10978 (offset_wand->images == (Image *) NULL))
10980 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
10981 "ContainsNoImages","`%s'",wand->name);
10982 return((MagickWand *) NULL);
10984 stereo_image=StereoImage(wand->images,offset_wand->images,wand->exception);
10985 if (stereo_image == (Image *) NULL)
10986 return((MagickWand *) NULL);
10987 return(CloneMagickWandFromImages(wand,stereo_image));
10991 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10995 % M a g i c k S t r i p I m a g e %
10999 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11001 % MagickStripImage() strips an image of all profiles and comments.
11003 % The format of the MagickStripImage method is:
11005 % MagickBooleanType MagickStripImage(MagickWand *wand)
11007 % A description of each parameter follows:
11009 % o wand: the magick wand.
11012 WandExport MagickBooleanType MagickStripImage(MagickWand *wand)
11017 assert(wand != (MagickWand *) NULL);
11018 assert(wand->signature == WandSignature);
11019 if (wand->debug != MagickFalse)
11020 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11021 if (wand->images == (Image *) NULL)
11022 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11023 status=StripImage(wand->images);
11024 if (status == MagickFalse)
11025 InheritException(wand->exception,&wand->images->exception);
11030 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11034 % M a g i c k S w i r l I m a g e %
11038 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11040 % MagickSwirlImage() swirls the pixels about the center of the image, where
11041 % degrees indicates the sweep of the arc through which each pixel is moved.
11042 % You get a more dramatic effect as the degrees move from 1 to 360.
11044 % The format of the MagickSwirlImage method is:
11046 % MagickBooleanType MagickSwirlImage(MagickWand *wand,const double degrees)
11048 % A description of each parameter follows:
11050 % o wand: the magick wand.
11052 % o degrees: Define the tightness of the swirling effect.
11055 WandExport MagickBooleanType MagickSwirlImage(MagickWand *wand,
11056 const double degrees)
11061 assert(wand != (MagickWand *) NULL);
11062 assert(wand->signature == WandSignature);
11063 if (wand->debug != MagickFalse)
11064 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11065 if (wand->images == (Image *) NULL)
11066 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11067 swirl_image=SwirlImage(wand->images,degrees,wand->exception);
11068 if (swirl_image == (Image *) NULL)
11069 return(MagickFalse);
11070 ReplaceImageInList(&wand->images,swirl_image);
11071 return(MagickTrue);
11075 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11079 % M a g i c k T e x t u r e I m a g e %
11083 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11085 % MagickTextureImage() repeatedly tiles the texture image across and down the
11088 % The format of the MagickTextureImage method is:
11090 % MagickWand *MagickTextureImage(MagickWand *wand,
11091 % const MagickWand *texture_wand)
11093 % A description of each parameter follows:
11095 % o wand: the magick wand.
11097 % o texture_wand: the texture wand
11100 WandExport MagickWand *MagickTextureImage(MagickWand *wand,
11101 const MagickWand *texture_wand)
11109 assert(wand != (MagickWand *) NULL);
11110 assert(wand->signature == WandSignature);
11111 if (wand->debug != MagickFalse)
11112 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11113 if ((wand->images == (Image *) NULL) ||
11114 (texture_wand->images == (Image *) NULL))
11116 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
11117 "ContainsNoImages","`%s'",wand->name);
11118 return((MagickWand *) NULL);
11120 texture_image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
11121 if (texture_image == (Image *) NULL)
11122 return((MagickWand *) NULL);
11123 status=TextureImage(texture_image,texture_wand->images);
11124 if (status == MagickFalse)
11126 InheritException(wand->exception,&texture_image->exception);
11127 texture_image=DestroyImage(texture_image);
11128 return((MagickWand *) NULL);
11130 return(CloneMagickWandFromImages(wand,texture_image));
11134 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11138 % M a g i c k T h r e s h o l d I m a g e %
11142 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11144 % MagickThresholdImage() changes the value of individual pixels based on
11145 % the intensity of each pixel compared to threshold. The result is a
11146 % high-contrast, two color image.
11148 % The format of the MagickThresholdImage method is:
11150 % MagickBooleanType MagickThresholdImage(MagickWand *wand,
11151 % const double threshold)
11152 % MagickBooleanType MagickThresholdImageChannel(MagickWand *wand,
11153 % const ChannelType channel,const double threshold)
11155 % A description of each parameter follows:
11157 % o wand: the magick wand.
11159 % o channel: the image channel(s).
11161 % o threshold: Define the threshold value.
11164 WandExport MagickBooleanType MagickThresholdImage(MagickWand *wand,
11165 const double threshold)
11170 status=MagickThresholdImageChannel(wand,DefaultChannels,threshold);
11174 WandExport MagickBooleanType MagickThresholdImageChannel(MagickWand *wand,
11175 const ChannelType channel,const double threshold)
11180 assert(wand != (MagickWand *) NULL);
11181 assert(wand->signature == WandSignature);
11182 if (wand->debug != MagickFalse)
11183 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11184 if (wand->images == (Image *) NULL)
11185 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11186 status=BilevelImage(wand->images,threshold);
11187 if (status == MagickFalse)
11188 InheritException(wand->exception,&wand->images->exception);
11193 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11197 % M a g i c k T h u m b n a i l I m a g e %
11201 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11203 % MagickThumbnailImage() changes the size of an image to the given dimensions
11204 % and removes any associated profiles. The goal is to produce small low cost
11205 % thumbnail images suited for display on the Web.
11207 % The format of the MagickThumbnailImage method is:
11209 % MagickBooleanType MagickThumbnailImage(MagickWand *wand,
11210 % const size_t columns,const size_t rows)
11212 % A description of each parameter follows:
11214 % o wand: the magick wand.
11216 % o columns: the number of columns in the scaled image.
11218 % o rows: the number of rows in the scaled image.
11221 WandExport MagickBooleanType MagickThumbnailImage(MagickWand *wand,
11222 const size_t columns,const size_t rows)
11227 assert(wand != (MagickWand *) NULL);
11228 assert(wand->signature == WandSignature);
11229 if (wand->debug != MagickFalse)
11230 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11231 if (wand->images == (Image *) NULL)
11232 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11233 thumbnail_image=ThumbnailImage(wand->images,columns,rows,wand->exception);
11234 if (thumbnail_image == (Image *) NULL)
11235 return(MagickFalse);
11236 ReplaceImageInList(&wand->images,thumbnail_image);
11237 return(MagickTrue);
11241 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11245 % M a g i c k T i n t I m a g e %
11249 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11251 % MagickTintImage() applies a color vector to each pixel in the image. The
11252 % length of the vector is 0 for black and white and at its maximum for the
11253 % midtones. The vector weighting function is
11254 % f(x)=(1-(4.0*((x-0.5)*(x-0.5)))).
11256 % The format of the MagickTintImage method is:
11258 % MagickBooleanType MagickTintImage(MagickWand *wand,
11259 % const PixelWand *tint,const PixelWand *opacity)
11261 % A description of each parameter follows:
11263 % o wand: the magick wand.
11265 % o tint: the tint pixel wand.
11267 % o opacity: the opacity pixel wand.
11270 WandExport MagickBooleanType MagickTintImage(MagickWand *wand,
11271 const PixelWand *tint,const PixelWand *opacity)
11274 percent_opaque[MaxTextExtent];
11282 assert(wand != (MagickWand *) NULL);
11283 assert(wand->signature == WandSignature);
11284 if (wand->debug != MagickFalse)
11285 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11286 if (wand->images == (Image *) NULL)
11287 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11288 (void) FormatLocaleString(percent_opaque,MaxTextExtent,
11289 "%g,%g,%g,%g",(double) (100.0*QuantumScale*
11290 PixelGetRedQuantum(opacity)),(double) (100.0*QuantumScale*
11291 PixelGetGreenQuantum(opacity)),(double) (100.0*QuantumScale*
11292 PixelGetBlueQuantum(opacity)),(double) (100.0*QuantumScale*
11293 PixelGetOpacityQuantum(opacity)));
11294 PixelGetQuantumPacket(tint,&target);
11295 tint_image=TintImage(wand->images,percent_opaque,target,wand->exception);
11296 if (tint_image == (Image *) NULL)
11297 return(MagickFalse);
11298 ReplaceImageInList(&wand->images,tint_image);
11299 return(MagickTrue);
11303 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11307 % M a g i c k T r a n s f o r m I m a g e %
11311 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11313 % MagickTransformImage() is a convenience method that behaves like
11314 % MagickResizeImage() or MagickCropImage() but accepts scaling and/or cropping
11315 % information as a region geometry specification. If the operation fails,
11316 % a NULL image handle is returned.
11318 % The format of the MagickTransformImage method is:
11320 % MagickWand *MagickTransformImage(MagickWand *wand,const char *crop,
11321 % const char *geometry)
11323 % A description of each parameter follows:
11325 % o wand: the magick wand.
11327 % o crop: A crop geometry string. This geometry defines a subregion of the
11330 % o geometry: An image geometry string. This geometry defines the final
11331 % size of the image.
11334 WandExport MagickWand *MagickTransformImage(MagickWand *wand,
11335 const char *crop,const char *geometry)
11343 assert(wand != (MagickWand *) NULL);
11344 assert(wand->signature == WandSignature);
11345 if (wand->debug != MagickFalse)
11346 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11347 if (wand->images == (Image *) NULL)
11348 return((MagickWand *) NULL);
11349 transform_image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
11350 if (transform_image == (Image *) NULL)
11351 return((MagickWand *) NULL);
11352 status=TransformImage(&transform_image,crop,geometry);
11353 if (status == MagickFalse)
11355 InheritException(wand->exception,&transform_image->exception);
11356 transform_image=DestroyImage(transform_image);
11357 return((MagickWand *) NULL);
11359 return(CloneMagickWandFromImages(wand,transform_image));
11363 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11367 % 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 %
11371 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11373 % MagickTransformImageColorspace() transform the image colorspace.
11375 % The format of the MagickTransformImageColorspace method is:
11377 % MagickBooleanType MagickTransformImageColorspace(MagickWand *wand,
11378 % const ColorspaceType colorspace)
11380 % A description of each parameter follows:
11382 % o wand: the magick wand.
11384 % o colorspace: the image colorspace: UndefinedColorspace, RGBColorspace,
11385 % GRAYColorspace, TransparentColorspace, OHTAColorspace, XYZColorspace,
11386 % YCbCrColorspace, YCCColorspace, YIQColorspace, YPbPrColorspace,
11387 % YPbPrColorspace, YUVColorspace, CMYKColorspace, sRGBColorspace,
11388 % HSLColorspace, or HWBColorspace.
11391 WandExport MagickBooleanType MagickTransformImageColorspace(MagickWand *wand,
11392 const ColorspaceType colorspace)
11394 assert(wand != (MagickWand *) NULL);
11395 assert(wand->signature == WandSignature);
11396 if (wand->debug != MagickFalse)
11397 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11398 if (wand->images == (Image *) NULL)
11399 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11400 return(TransformImageColorspace(wand->images,colorspace));
11404 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11408 % 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 %
11412 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11414 % MagickTransparentPaintImage() changes any pixel that matches color with the
11415 % color defined by fill.
11417 % The format of the MagickTransparentPaintImage method is:
11419 % MagickBooleanType MagickTransparentPaintImage(MagickWand *wand,
11420 % const PixelWand *target,const double alpha,const double fuzz,
11421 % const MagickBooleanType invert)
11423 % A description of each parameter follows:
11425 % o wand: the magick wand.
11427 % o target: Change this target color to specified opacity value within
11430 % o alpha: the level of transparency: 1.0 is fully opaque and 0.0 is fully
11433 % o fuzz: By default target must match a particular pixel color
11434 % exactly. However, in many cases two colors may differ by a small amount.
11435 % The fuzz member of image defines how much tolerance is acceptable to
11436 % consider two colors as the same. For example, set fuzz to 10 and the
11437 % color red at intensities of 100 and 102 respectively are now interpreted
11438 % as the same color for the purposes of the floodfill.
11440 % o invert: paint any pixel that does not match the target color.
11443 WandExport MagickBooleanType MagickTransparentPaintImage(MagickWand *wand,
11444 const PixelWand *target,const double alpha,const double fuzz,
11445 const MagickBooleanType invert)
11453 assert(wand != (MagickWand *) NULL);
11454 assert(wand->signature == WandSignature);
11455 if (wand->debug != MagickFalse)
11456 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11457 if (wand->images == (Image *) NULL)
11458 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11459 PixelGetMagickColor(target,&target_pixel);
11460 wand->images->fuzz=fuzz;
11461 status=TransparentPaintImage(wand->images,&target_pixel,ClampToQuantum(
11462 QuantumRange*alpha),invert);
11463 if (status == MagickFalse)
11464 InheritException(wand->exception,&wand->images->exception);
11469 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11473 % M a g i c k T r a n s p o s e I m a g e %
11477 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11479 % MagickTransposeImage() creates a vertical mirror image by reflecting the
11480 % pixels around the central x-axis while rotating them 90-degrees.
11482 % The format of the MagickTransposeImage method is:
11484 % MagickBooleanType MagickTransposeImage(MagickWand *wand)
11486 % A description of each parameter follows:
11488 % o wand: the magick wand.
11491 WandExport MagickBooleanType MagickTransposeImage(MagickWand *wand)
11496 assert(wand != (MagickWand *) NULL);
11497 assert(wand->signature == WandSignature);
11498 if (wand->debug != MagickFalse)
11499 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11500 if (wand->images == (Image *) NULL)
11501 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11502 transpose_image=TransposeImage(wand->images,wand->exception);
11503 if (transpose_image == (Image *) NULL)
11504 return(MagickFalse);
11505 ReplaceImageInList(&wand->images,transpose_image);
11506 return(MagickTrue);
11510 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11514 % M a g i c k T r a n s v e r s e I m a g e %
11518 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11520 % MagickTransverseImage() creates a horizontal mirror image by reflecting the
11521 % pixels around the central y-axis while rotating them 270-degrees.
11523 % The format of the MagickTransverseImage method is:
11525 % MagickBooleanType MagickTransverseImage(MagickWand *wand)
11527 % A description of each parameter follows:
11529 % o wand: the magick wand.
11532 WandExport MagickBooleanType MagickTransverseImage(MagickWand *wand)
11537 assert(wand != (MagickWand *) NULL);
11538 assert(wand->signature == WandSignature);
11539 if (wand->debug != MagickFalse)
11540 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11541 if (wand->images == (Image *) NULL)
11542 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11543 transverse_image=TransverseImage(wand->images,wand->exception);
11544 if (transverse_image == (Image *) NULL)
11545 return(MagickFalse);
11546 ReplaceImageInList(&wand->images,transverse_image);
11547 return(MagickTrue);
11551 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11555 % M a g i c k T r i m I m a g e %
11559 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11561 % MagickTrimImage() remove edges that are the background color from the image.
11563 % The format of the MagickTrimImage method is:
11565 % MagickBooleanType MagickTrimImage(MagickWand *wand,const double fuzz)
11567 % A description of each parameter follows:
11569 % o wand: the magick wand.
11571 % o fuzz: By default target must match a particular pixel color
11572 % exactly. However, in many cases two colors may differ by a small amount.
11573 % The fuzz member of image defines how much tolerance is acceptable to
11574 % consider two colors as the same. For example, set fuzz to 10 and the
11575 % color red at intensities of 100 and 102 respectively are now interpreted
11576 % as the same color for the purposes of the floodfill.
11579 WandExport MagickBooleanType MagickTrimImage(MagickWand *wand,const double fuzz)
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 wand->images->fuzz=fuzz;
11591 trim_image=TrimImage(wand->images,wand->exception);
11592 if (trim_image == (Image *) NULL)
11593 return(MagickFalse);
11594 ReplaceImageInList(&wand->images,trim_image);
11595 return(MagickTrue);
11599 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11603 % M a g i c k U n i q u e I m a g e C o l o r s %
11607 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11609 % MagickUniqueImageColors() discards all but one of any pixel color.
11611 % The format of the MagickUniqueImageColors method is:
11613 % MagickBooleanType MagickUniqueImageColors(MagickWand *wand)
11615 % A description of each parameter follows:
11617 % o wand: the magick wand.
11620 WandExport MagickBooleanType MagickUniqueImageColors(MagickWand *wand)
11625 assert(wand != (MagickWand *) NULL);
11626 assert(wand->signature == WandSignature);
11627 if (wand->debug != MagickFalse)
11628 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11629 if (wand->images == (Image *) NULL)
11630 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11631 unique_image=UniqueImageColors(wand->images,wand->exception);
11632 if (unique_image == (Image *) NULL)
11633 return(MagickFalse);
11634 ReplaceImageInList(&wand->images,unique_image);
11635 return(MagickTrue);
11639 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11643 % M a g i c k U n s h a r p M a s k I m a g e %
11647 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11649 % MagickUnsharpMaskImage() sharpens an image. We convolve the image with a
11650 % Gaussian operator of the given radius and standard deviation (sigma).
11651 % For reasonable results, radius should be larger than sigma. Use a radius
11652 % of 0 and UnsharpMaskImage() selects a suitable radius for you.
11654 % The format of the MagickUnsharpMaskImage method is:
11656 % MagickBooleanType MagickUnsharpMaskImage(MagickWand *wand,
11657 % const double radius,const double sigma,const double amount,
11658 % const double threshold)
11660 % A description of each parameter follows:
11662 % o wand: the magick wand.
11664 % o radius: the radius of the Gaussian, in pixels, not counting the center
11667 % o sigma: the standard deviation of the Gaussian, in pixels.
11669 % o amount: the percentage of the difference between the original and the
11670 % blur image that is added back into the original.
11672 % o threshold: the threshold in pixels needed to apply the diffence amount.
11675 WandExport MagickBooleanType MagickUnsharpMaskImage(MagickWand *wand,
11676 const double radius,const double sigma,const double amount,
11677 const double threshold)
11682 assert(wand != (MagickWand *) NULL);
11683 assert(wand->signature == WandSignature);
11684 if (wand->debug != MagickFalse)
11685 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11686 if (wand->images == (Image *) NULL)
11687 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11688 unsharp_image=UnsharpMaskImage(wand->images,radius,sigma,amount,threshold,
11690 if (unsharp_image == (Image *) NULL)
11691 return(MagickFalse);
11692 ReplaceImageInList(&wand->images,unsharp_image);
11693 return(MagickTrue);
11697 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11701 % M a g i c k V i g n e t t e I m a g e %
11705 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11707 % MagickVignetteImage() softens the edges of the image in vignette style.
11709 % The format of the MagickVignetteImage method is:
11711 % MagickBooleanType MagickVignetteImage(MagickWand *wand,
11712 % const double black_point,const double white_point,const ssize_t x,
11715 % A description of each parameter follows:
11717 % o wand: the magick wand.
11719 % o black_point: the black point.
11721 % o white_point: the white point.
11723 % o x, y: Define the x and y ellipse offset.
11726 WandExport MagickBooleanType MagickVignetteImage(MagickWand *wand,
11727 const double black_point,const double white_point,const ssize_t x,const ssize_t y)
11732 assert(wand != (MagickWand *) NULL);
11733 assert(wand->signature == WandSignature);
11734 if (wand->debug != MagickFalse)
11735 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11736 if (wand->images == (Image *) NULL)
11737 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11738 vignette_image=VignetteImage(wand->images,black_point,white_point,x,y,
11740 if (vignette_image == (Image *) NULL)
11741 return(MagickFalse);
11742 ReplaceImageInList(&wand->images,vignette_image);
11743 return(MagickTrue);
11747 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11751 % M a g i c k W a v e I m a g e %
11755 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11757 % MagickWaveImage() creates a "ripple" effect in the image by shifting
11758 % the pixels vertically along a sine wave whose amplitude and wavelength
11759 % is specified by the given parameters.
11761 % The format of the MagickWaveImage method is:
11763 % MagickBooleanType MagickWaveImage(MagickWand *wand,const double amplitude,
11764 % const double wave_length)
11766 % A description of each parameter follows:
11768 % o wand: the magick wand.
11770 % o amplitude, wave_length: Define the amplitude and wave length of the
11774 WandExport MagickBooleanType MagickWaveImage(MagickWand *wand,
11775 const double amplitude,const double wave_length)
11780 assert(wand != (MagickWand *) NULL);
11781 assert(wand->signature == WandSignature);
11782 if (wand->debug != MagickFalse)
11783 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11784 if (wand->images == (Image *) NULL)
11785 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11786 wave_image=WaveImage(wand->images,amplitude,wave_length,wand->exception);
11787 if (wave_image == (Image *) NULL)
11788 return(MagickFalse);
11789 ReplaceImageInList(&wand->images,wave_image);
11790 return(MagickTrue);
11794 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11798 % 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 %
11802 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11804 % MagickWhiteThresholdImage() is like ThresholdImage() but force all pixels
11805 % above the threshold into white while leaving all pixels below the threshold
11808 % The format of the MagickWhiteThresholdImage method is:
11810 % MagickBooleanType MagickWhiteThresholdImage(MagickWand *wand,
11811 % const PixelWand *threshold)
11813 % A description of each parameter follows:
11815 % o wand: the magick wand.
11817 % o threshold: the pixel wand.
11820 WandExport MagickBooleanType MagickWhiteThresholdImage(MagickWand *wand,
11821 const PixelWand *threshold)
11824 thresholds[MaxTextExtent];
11829 assert(wand != (MagickWand *) NULL);
11830 assert(wand->signature == WandSignature);
11831 if (wand->debug != MagickFalse)
11832 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11833 if (wand->images == (Image *) NULL)
11834 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11835 (void) FormatLocaleString(thresholds,MaxTextExtent,
11836 QuantumFormat "," QuantumFormat "," QuantumFormat "," QuantumFormat,
11837 PixelGetRedQuantum(threshold),PixelGetGreenQuantum(threshold),
11838 PixelGetBlueQuantum(threshold),PixelGetOpacityQuantum(threshold));
11839 status=WhiteThresholdImage(wand->images,thresholds,&wand->images->exception);
11840 if (status == MagickFalse)
11841 InheritException(wand->exception,&wand->images->exception);
11846 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11850 % M a g i c k W r i t e I m a g e %
11854 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11856 % MagickWriteImage() writes an image to the specified filename. If the
11857 % filename parameter is NULL, the image is written to the filename set
11858 % by MagickReadImage() or MagickSetImageFilename().
11860 % The format of the MagickWriteImage method is:
11862 % MagickBooleanType MagickWriteImage(MagickWand *wand,
11863 % const char *filename)
11865 % A description of each parameter follows:
11867 % o wand: the magick wand.
11869 % o filename: the image filename.
11873 WandExport MagickBooleanType MagickWriteImage(MagickWand *wand,
11874 const char *filename)
11885 assert(wand != (MagickWand *) NULL);
11886 assert(wand->signature == WandSignature);
11887 if (wand->debug != MagickFalse)
11888 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11889 if (wand->images == (Image *) NULL)
11890 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11891 if (filename != (const char *) NULL)
11892 (void) CopyMagickString(wand->images->filename,filename,MaxTextExtent);
11893 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
11894 if (image == (Image *) NULL)
11895 return(MagickFalse);
11896 write_info=CloneImageInfo(wand->image_info);
11897 write_info->adjoin=MagickTrue;
11898 status=WriteImage(write_info,image);
11899 if (status == MagickFalse)
11900 InheritException(wand->exception,&image->exception);
11901 image=DestroyImage(image);
11902 write_info=DestroyImageInfo(write_info);
11907 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11911 % M a g i c k W r i t e I m a g e F i l e %
11915 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11917 % MagickWriteImageFile() writes an image to an open file descriptor.
11919 % The format of the MagickWriteImageFile method is:
11921 % MagickBooleanType MagickWriteImageFile(MagickWand *wand,FILE *file)
11923 % A description of each parameter follows:
11925 % o wand: the magick wand.
11927 % o file: the file descriptor.
11930 WandExport MagickBooleanType MagickWriteImageFile(MagickWand *wand,FILE *file)
11941 assert(wand != (MagickWand *) NULL);
11942 assert(wand->signature == WandSignature);
11943 assert(file != (FILE *) NULL);
11944 if (wand->debug != MagickFalse)
11945 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11946 if (wand->images == (Image *) NULL)
11947 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11948 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
11949 if (image == (Image *) NULL)
11950 return(MagickFalse);
11951 write_info=CloneImageInfo(wand->image_info);
11952 SetImageInfoFile(write_info,file);
11953 write_info->adjoin=MagickTrue;
11954 status=WriteImage(write_info,image);
11955 write_info=DestroyImageInfo(write_info);
11956 if (status == MagickFalse)
11957 InheritException(wand->exception,&image->exception);
11958 image=DestroyImage(image);
11963 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11967 % M a g i c k W r i t e I m a g e s %
11971 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11973 % MagickWriteImages() writes an image or image sequence.
11975 % The format of the MagickWriteImages method is:
11977 % MagickBooleanType MagickWriteImages(MagickWand *wand,
11978 % const char *filename,const MagickBooleanType adjoin)
11980 % A description of each parameter follows:
11982 % o wand: the magick wand.
11984 % o filename: the image filename.
11986 % o adjoin: join images into a single multi-image file.
11989 WandExport MagickBooleanType MagickWriteImages(MagickWand *wand,
11990 const char *filename,const MagickBooleanType adjoin)
11998 assert(wand != (MagickWand *) NULL);
11999 assert(wand->signature == WandSignature);
12000 if (wand->debug != MagickFalse)
12001 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12002 if (wand->images == (Image *) NULL)
12003 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12004 write_info=CloneImageInfo(wand->image_info);
12005 write_info->adjoin=adjoin;
12006 status=WriteImages(write_info,wand->images,filename,wand->exception);
12007 if (status == MagickFalse)
12008 InheritException(wand->exception,&wand->images->exception);
12009 write_info=DestroyImageInfo(write_info);
12014 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12018 % M a g i c k W r i t e I m a g e s F i l e %
12022 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12024 % MagickWriteImagesFile() writes an image sequence to an open file descriptor.
12026 % The format of the MagickWriteImagesFile method is:
12028 % MagickBooleanType MagickWriteImagesFile(MagickWand *wand,FILE *file)
12030 % A description of each parameter follows:
12032 % o wand: the magick wand.
12034 % o file: the file descriptor.
12037 WandExport MagickBooleanType MagickWriteImagesFile(MagickWand *wand,FILE *file)
12045 assert(wand != (MagickWand *) NULL);
12046 assert(wand->signature == WandSignature);
12047 if (wand->debug != MagickFalse)
12048 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12049 if (wand->images == (Image *) NULL)
12050 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12051 write_info=CloneImageInfo(wand->image_info);
12052 SetImageInfoFile(write_info,file);
12053 write_info->adjoin=MagickTrue;
12054 status=WriteImages(write_info,wand->images,(const char *) NULL,
12056 write_info=DestroyImageInfo(write_info);
12057 if (status == MagickFalse)
12058 InheritException(wand->exception,&wand->images->exception);