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,&wand->images->exception);
607 draw_info=DestroyDrawInfo(draw_info);
612 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
616 % M a g i c k A n i m a t e I m a g e s %
620 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
622 % MagickAnimateImages() animates an image or image sequence.
624 % The format of the MagickAnimateImages method is:
626 % MagickBooleanType MagickAnimateImages(MagickWand *wand,
627 % const char *server_name)
629 % A description of each parameter follows:
631 % o wand: the magick wand.
633 % o server_name: the X server name.
636 WandExport MagickBooleanType MagickAnimateImages(MagickWand *wand,
637 const char *server_name)
642 assert(wand != (MagickWand *) NULL);
643 assert(wand->signature == WandSignature);
644 if (wand->debug != MagickFalse)
645 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
646 (void) CloneString(&wand->image_info->server_name,server_name);
647 status=AnimateImages(wand->image_info,wand->images,&wand->images->exception);
652 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
656 % M a g i c k A p p e n d I m a g e s %
660 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
662 % MagickAppendImages() append a set of images.
664 % The format of the MagickAppendImages method is:
666 % MagickWand *MagickAppendImages(MagickWand *wand,
667 % const MagickBooleanType stack)
669 % A description of each parameter follows:
671 % o wand: the magick wand.
673 % o stack: By default, images are stacked left-to-right. Set stack to
674 % MagickTrue to stack them top-to-bottom.
677 WandExport MagickWand *MagickAppendImages(MagickWand *wand,
678 const MagickBooleanType stack)
683 assert(wand != (MagickWand *) NULL);
684 assert(wand->signature == WandSignature);
685 if (wand->debug != MagickFalse)
686 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
687 if (wand->images == (Image *) NULL)
688 return((MagickWand *) NULL);
689 append_image=AppendImages(wand->images,stack,wand->exception);
690 if (append_image == (Image *) NULL)
691 return((MagickWand *) NULL);
692 return(CloneMagickWandFromImages(wand,append_image));
696 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
700 % M a g i c k A u t o G a m m a I m a g e %
704 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
706 % MagickAutoGammaImage() extracts the 'mean' from the image and adjust the
707 % image to try make set its gamma appropriatally.
709 % The format of the MagickAutoGammaImage method is:
711 % MagickBooleanType MagickAutoGammaImage(MagickWand *wand)
713 % A description of each parameter follows:
715 % o wand: the magick wand.
718 WandExport MagickBooleanType MagickAutoGammaImage(MagickWand *wand)
723 assert(wand != (MagickWand *) NULL);
724 assert(wand->signature == WandSignature);
725 if (wand->debug != MagickFalse)
726 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
727 if (wand->images == (Image *) NULL)
728 ThrowWandException(WandError,"ContainsNoImages",wand->name);
729 status=AutoGammaImage(wand->images,&wand->images->exception);
734 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
738 % M a g i c k A u t o L e v e l I m a g e %
742 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
744 % MagickAutoLevelImage() adjusts the levels of a particular image channel by
745 % scaling the minimum and maximum values to the full quantum range.
747 % The format of the MagickAutoLevelImage method is:
749 % MagickBooleanType MagickAutoLevelImage(MagickWand *wand)
751 % A description of each parameter follows:
753 % o wand: the magick wand.
756 WandExport MagickBooleanType MagickAutoLevelImage(MagickWand *wand)
761 assert(wand != (MagickWand *) NULL);
762 assert(wand->signature == WandSignature);
763 if (wand->debug != MagickFalse)
764 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
765 if (wand->images == (Image *) NULL)
766 ThrowWandException(WandError,"ContainsNoImages",wand->name);
767 status=AutoLevelImage(wand->images,&wand->images->exception);
772 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
776 % 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 %
780 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
782 % MagickBlackThresholdImage() is like MagickThresholdImage() but forces all
783 % pixels below the threshold into black while leaving all pixels above the
784 % threshold unchanged.
786 % The format of the MagickBlackThresholdImage method is:
788 % MagickBooleanType MagickBlackThresholdImage(MagickWand *wand,
789 % const PixelWand *threshold)
791 % A description of each parameter follows:
793 % o wand: the magick wand.
795 % o threshold: the pixel wand.
798 WandExport MagickBooleanType MagickBlackThresholdImage(MagickWand *wand,
799 const PixelWand *threshold)
802 thresholds[MaxTextExtent];
807 assert(wand != (MagickWand *) NULL);
808 assert(wand->signature == WandSignature);
809 if (wand->debug != MagickFalse)
810 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
811 if (wand->images == (Image *) NULL)
812 ThrowWandException(WandError,"ContainsNoImages",wand->name);
813 (void) FormatLocaleString(thresholds,MaxTextExtent,
814 QuantumFormat "," QuantumFormat "," QuantumFormat "," QuantumFormat,
815 PixelGetRedQuantum(threshold),PixelGetGreenQuantum(threshold),
816 PixelGetBlueQuantum(threshold),PixelGetOpacityQuantum(threshold));
817 status=BlackThresholdImage(wand->images,thresholds,&wand->images->exception);
818 if (status == MagickFalse)
819 InheritException(wand->exception,&wand->images->exception);
824 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
828 % M a g i c k B l u e S h i f t I m a g e %
832 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
834 % MagickBlueShiftImage() mutes the colors of the image to simulate a scene at
835 % nighttime in the moonlight.
837 % The format of the MagickBlueShiftImage method is:
839 % MagickBooleanType MagickBlueShiftImage(MagickWand *wand,
840 % const double factor)
842 % A description of each parameter follows:
844 % o wand: the magick wand.
846 % o factor: the blue shift factor (default 1.5)
849 WandExport MagickBooleanType MagickBlueShiftImage(MagickWand *wand,
855 assert(wand != (MagickWand *) NULL);
856 assert(wand->signature == WandSignature);
857 if (wand->debug != MagickFalse)
858 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
859 if (wand->images == (Image *) NULL)
860 ThrowWandException(WandError,"ContainsNoImages",wand->name);
861 shift_image=BlueShiftImage(wand->images,factor,wand->exception);
862 if (shift_image == (Image *) NULL)
864 ReplaceImageInList(&wand->images,shift_image);
869 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
873 % M a g i c k B l u r I m a g e %
877 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
879 % MagickBlurImage() blurs an image. We convolve the image with a
880 % gaussian operator of the given radius and standard deviation (sigma).
881 % For reasonable results, the radius should be larger than sigma. Use a
882 % radius of 0 and BlurImage() selects a suitable radius for you.
884 % The format of the MagickBlurImage method is:
886 % MagickBooleanType MagickBlurImage(MagickWand *wand,const double radius,
887 % const double sigma)
889 % A description of each parameter follows:
891 % o wand: the magick wand.
893 % o radius: the radius of the , in pixels, not counting the center
896 % o sigma: the standard deviation of the , in pixels.
899 WandExport MagickBooleanType MagickBlurImage(MagickWand *wand,
900 const double radius,const double sigma)
905 assert(wand != (MagickWand *) NULL);
906 assert(wand->signature == WandSignature);
907 if (wand->debug != MagickFalse)
908 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
909 if (wand->images == (Image *) NULL)
910 ThrowWandException(WandError,"ContainsNoImages",wand->name);
911 blur_image=BlurImage(wand->images,radius,sigma,wand->exception);
912 if (blur_image == (Image *) NULL)
914 ReplaceImageInList(&wand->images,blur_image);
919 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
923 % M a g i c k B o r d e r I m a g e %
927 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
929 % MagickBorderImage() surrounds the image with a border of the color defined
930 % by the bordercolor pixel wand.
932 % The format of the MagickBorderImage method is:
934 % MagickBooleanType MagickBorderImage(MagickWand *wand,
935 % const PixelWand *bordercolor,const size_t width,
936 % const size_t height)
938 % A description of each parameter follows:
940 % o wand: the magick wand.
942 % o bordercolor: the border color pixel wand.
944 % o width: the border width.
946 % o height: the border height.
949 WandExport MagickBooleanType MagickBorderImage(MagickWand *wand,
950 const PixelWand *bordercolor,const size_t width,
959 assert(wand != (MagickWand *) NULL);
960 assert(wand->signature == WandSignature);
961 if (wand->debug != MagickFalse)
962 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
963 if (wand->images == (Image *) NULL)
964 ThrowWandException(WandError,"ContainsNoImages",wand->name);
965 border_info.width=width;
966 border_info.height=height;
969 PixelGetQuantumPacket(bordercolor,&wand->images->border_color);
970 border_image=BorderImage(wand->images,&border_info,wand->exception);
971 if (border_image == (Image *) NULL)
973 ReplaceImageInList(&wand->images,border_image);
978 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
982 % 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 %
986 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
988 % Use MagickBrightnessContrastImage() to change the brightness and/or contrast
989 % of an image. It converts the brightness and contrast parameters into slope
990 % and intercept and calls a polynomical function to apply to the image.
993 % The format of the MagickBrightnessContrastImage method is:
995 % MagickBooleanType MagickBrightnessContrastImage(MagickWand *wand,
996 % const double brightness,const double contrast)
998 % A description of each parameter follows:
1000 % o wand: the magick wand.
1002 % o brightness: the brightness percent (-100 .. 100).
1004 % o contrast: the contrast percent (-100 .. 100).
1007 WandExport MagickBooleanType MagickBrightnessContrastImage(
1008 MagickWand *wand,const double brightness,const double contrast)
1013 assert(wand != (MagickWand *) NULL);
1014 assert(wand->signature == WandSignature);
1015 if (wand->debug != MagickFalse)
1016 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1017 if (wand->images == (Image *) NULL)
1018 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1019 status=BrightnessContrastImage(wand->images,brightness,contrast,
1020 &wand->images->exception);
1025 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1029 % M a g i c k C h a r c o a l I m a g e %
1033 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1035 % MagickCharcoalImage() simulates a charcoal drawing.
1037 % The format of the MagickCharcoalImage method is:
1039 % MagickBooleanType MagickCharcoalImage(MagickWand *wand,
1040 % const double radius,const double sigma)
1042 % A description of each parameter follows:
1044 % o wand: the magick wand.
1046 % o radius: the radius of the Gaussian, in pixels, not counting the center
1049 % o sigma: the standard deviation of the Gaussian, in pixels.
1052 WandExport MagickBooleanType MagickCharcoalImage(MagickWand *wand,
1053 const double radius,const double sigma)
1058 assert(wand != (MagickWand *) NULL);
1059 assert(wand->signature == WandSignature);
1060 if (wand->debug != MagickFalse)
1061 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1062 if (wand->images == (Image *) NULL)
1063 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1064 charcoal_image=CharcoalImage(wand->images,radius,sigma,wand->exception);
1065 if (charcoal_image == (Image *) NULL)
1066 return(MagickFalse);
1067 ReplaceImageInList(&wand->images,charcoal_image);
1072 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1076 % M a g i c k C h o p I m a g e %
1080 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1082 % MagickChopImage() removes a region of an image and collapses the image to
1083 % occupy the removed portion
1085 % The format of the MagickChopImage method is:
1087 % MagickBooleanType MagickChopImage(MagickWand *wand,
1088 % const size_t width,const size_t height,const ssize_t x,
1091 % A description of each parameter follows:
1093 % o wand: the magick wand.
1095 % o width: the region width.
1097 % o height: the region height.
1099 % o x: the region x offset.
1101 % o y: the region y offset.
1105 WandExport MagickBooleanType MagickChopImage(MagickWand *wand,
1106 const size_t width,const size_t height,const ssize_t x,
1115 assert(wand != (MagickWand *) NULL);
1116 assert(wand->signature == WandSignature);
1117 if (wand->debug != MagickFalse)
1118 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1119 if (wand->images == (Image *) NULL)
1120 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1125 chop_image=ChopImage(wand->images,&chop,wand->exception);
1126 if (chop_image == (Image *) NULL)
1127 return(MagickFalse);
1128 ReplaceImageInList(&wand->images,chop_image);
1133 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1137 % M a g i c k C l a m p I m a g e %
1141 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1143 % MagickClampImage() restricts the color range from 0 to the quantum depth.
1145 % The format of the MagickClampImage method is:
1147 % MagickBooleanType MagickClampImage(MagickWand *wand)
1149 % A description of each parameter follows:
1151 % o wand: the magick wand.
1153 % o channel: the channel.
1156 WandExport MagickBooleanType MagickClampImage(MagickWand *wand)
1161 assert(wand != (MagickWand *) NULL);
1162 assert(wand->signature == WandSignature);
1163 if (wand->debug != MagickFalse)
1164 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1165 if (wand->images == (Image *) NULL)
1166 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1167 status=ClampImage(wand->images);
1168 if (status == MagickFalse)
1169 InheritException(wand->exception,&wand->images->exception);
1174 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1178 % M a g i c k C l i p I m a g e %
1182 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1184 % MagickClipImage() clips along the first path from the 8BIM profile, if
1187 % The format of the MagickClipImage method is:
1189 % MagickBooleanType MagickClipImage(MagickWand *wand)
1191 % A description of each parameter follows:
1193 % o wand: the magick wand.
1196 WandExport MagickBooleanType MagickClipImage(MagickWand *wand)
1201 assert(wand != (MagickWand *) NULL);
1202 assert(wand->signature == WandSignature);
1203 if (wand->debug != MagickFalse)
1204 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1205 if (wand->images == (Image *) NULL)
1206 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1207 status=ClipImage(wand->images);
1208 if (status == MagickFalse)
1209 InheritException(wand->exception,&wand->images->exception);
1214 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1218 % M a g i c k C l i p I m a g e P a t h %
1222 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1224 % MagickClipImagePath() clips along the named paths from the 8BIM profile, if
1225 % present. Later operations take effect inside the path. Id may be a number
1226 % if preceded with #, to work on a numbered path, e.g., "#1" to use the first
1229 % The format of the MagickClipImagePath method is:
1231 % MagickBooleanType MagickClipImagePath(MagickWand *wand,
1232 % const char *pathname,const MagickBooleanType inside)
1234 % A description of each parameter follows:
1236 % o wand: the magick wand.
1238 % o pathname: name of clipping path resource. If name is preceded by #, use
1239 % clipping path numbered by name.
1241 % o inside: if non-zero, later operations take effect inside clipping path.
1242 % Otherwise later operations take effect outside clipping path.
1245 WandExport MagickBooleanType MagickClipImagePath(MagickWand *wand,
1246 const char *pathname,const MagickBooleanType inside)
1251 assert(wand != (MagickWand *) NULL);
1252 assert(wand->signature == WandSignature);
1253 if (wand->debug != MagickFalse)
1254 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1255 if (wand->images == (Image *) NULL)
1256 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1257 status=ClipImagePath(wand->images,pathname,inside);
1258 if (status == MagickFalse)
1259 InheritException(wand->exception,&wand->images->exception);
1264 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1268 % M a g i c k C l u t I m a g e %
1272 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1274 % MagickClutImage() replaces colors in the image from a color lookup table.
1276 % The format of the MagickClutImage method is:
1278 % MagickBooleanType MagickClutImage(MagickWand *wand,
1279 % const MagickWand *clut_wand)
1281 % A description of each parameter follows:
1283 % o wand: the magick wand.
1285 % o clut_image: the clut image.
1288 WandExport MagickBooleanType MagickClutImage(MagickWand *wand,
1289 const MagickWand *clut_wand)
1294 assert(wand != (MagickWand *) NULL);
1295 assert(wand->signature == WandSignature);
1296 if (wand->debug != MagickFalse)
1297 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1298 if ((wand->images == (Image *) NULL) || (clut_wand->images == (Image *) NULL))
1299 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1300 status=ClutImage(wand->images,clut_wand->images,&wand->images->exception);
1305 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1309 % M a g i c k C o a l e s c e I m a g e s %
1313 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1315 % MagickCoalesceImages() composites a set of images while respecting any page
1316 % offsets and disposal methods. GIF, MIFF, and MNG animation sequences
1317 % typically start with an image background and each subsequent image
1318 % varies in size and offset. MagickCoalesceImages() returns a new sequence
1319 % where each image in the sequence is the same size as the first and
1320 % composited with the next image in the sequence.
1322 % The format of the MagickCoalesceImages method is:
1324 % MagickWand *MagickCoalesceImages(MagickWand *wand)
1326 % A description of each parameter follows:
1328 % o wand: the magick wand.
1331 WandExport MagickWand *MagickCoalesceImages(MagickWand *wand)
1336 assert(wand != (MagickWand *) NULL);
1337 assert(wand->signature == WandSignature);
1338 if (wand->debug != MagickFalse)
1339 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1340 if (wand->images == (Image *) NULL)
1341 return((MagickWand *) NULL);
1342 coalesce_image=CoalesceImages(wand->images,wand->exception);
1343 if (coalesce_image == (Image *) NULL)
1344 return((MagickWand *) NULL);
1345 return(CloneMagickWandFromImages(wand,coalesce_image));
1349 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1353 % M a g i c k C o l o r D e c i s i o n I m a g e %
1357 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1359 % MagickColorDecisionListImage() accepts a lightweight Color Correction
1360 % Collection (CCC) file which solely contains one or more color corrections
1361 % and applies the color correction to the image. Here is a sample CCC file:
1363 % <ColorCorrectionCollection xmlns="urn:ASC:CDL:v1.2">
1364 % <ColorCorrection id="cc03345">
1366 % <Slope> 0.9 1.2 0.5 </Slope>
1367 % <Offset> 0.4 -0.5 0.6 </Offset>
1368 % <Power> 1.0 0.8 1.5 </Power>
1371 % <Saturation> 0.85 </Saturation>
1373 % </ColorCorrection>
1374 % </ColorCorrectionCollection>
1376 % which includes the offset, slope, and power for each of the RGB channels
1377 % as well as the saturation.
1379 % The format of the MagickColorDecisionListImage method is:
1381 % MagickBooleanType MagickColorDecisionListImage(MagickWand *wand,
1382 % const double gamma)
1384 % A description of each parameter follows:
1386 % o wand: the magick wand.
1388 % o color_correction_collection: the color correction collection in XML.
1391 WandExport MagickBooleanType MagickColorDecisionListImage(MagickWand *wand,
1392 const char *color_correction_collection)
1397 assert(wand != (MagickWand *) NULL);
1398 assert(wand->signature == WandSignature);
1399 if (wand->debug != MagickFalse)
1400 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1401 if (wand->images == (Image *) NULL)
1402 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1403 status=ColorDecisionListImage(wand->images,color_correction_collection,
1404 &wand->images->exception);
1409 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1413 % M a g i c k C o l o r i z e I m a g e %
1417 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1419 % MagickColorizeImage() blends the fill color with each pixel in the image.
1421 % The format of the MagickColorizeImage method is:
1423 % MagickBooleanType MagickColorizeImage(MagickWand *wand,
1424 % const PixelWand *colorize,const PixelWand *opacity)
1426 % A description of each parameter follows:
1428 % o wand: the magick wand.
1430 % o colorize: the colorize pixel wand.
1432 % o opacity: the opacity pixel wand.
1435 WandExport MagickBooleanType MagickColorizeImage(MagickWand *wand,
1436 const PixelWand *colorize,const PixelWand *opacity)
1439 percent_opaque[MaxTextExtent];
1447 assert(wand != (MagickWand *) NULL);
1448 assert(wand->signature == WandSignature);
1449 if (wand->debug != MagickFalse)
1450 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1451 if (wand->images == (Image *) NULL)
1452 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1453 (void) FormatLocaleString(percent_opaque,MaxTextExtent,
1454 "%g,%g,%g,%g",(double) (100.0*QuantumScale*
1455 PixelGetRedQuantum(opacity)),(double) (100.0*QuantumScale*
1456 PixelGetGreenQuantum(opacity)),(double) (100.0*QuantumScale*
1457 PixelGetBlueQuantum(opacity)),(double) (100.0*QuantumScale*
1458 PixelGetOpacityQuantum(opacity)));
1459 PixelGetQuantumPacket(colorize,&target);
1460 colorize_image=ColorizeImage(wand->images,percent_opaque,target,
1462 if (colorize_image == (Image *) NULL)
1463 return(MagickFalse);
1464 ReplaceImageInList(&wand->images,colorize_image);
1469 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1473 % M a g i c k C o l o r M a t r i x I m a g e %
1477 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1479 % MagickColorMatrixImage() apply color transformation to an image. The method
1480 % permits saturation changes, hue rotation, luminance to alpha, and various
1481 % other effects. Although variable-sized transformation matrices can be used,
1482 % typically one uses a 5x5 matrix for an RGBA image and a 6x6 for CMYKA
1483 % (or RGBA with offsets). The matrix is similar to those used by Adobe Flash
1484 % except offsets are in column 6 rather than 5 (in support of CMYKA images)
1485 % and offsets are normalized (divide Flash offset by 255).
1487 % The format of the MagickColorMatrixImage method is:
1489 % MagickBooleanType MagickColorMatrixImage(MagickWand *wand,
1490 % const KernelInfo *color_matrix)
1492 % A description of each parameter follows:
1494 % o wand: the magick wand.
1496 % o color_matrix: the color matrix.
1499 WandExport MagickBooleanType MagickColorMatrixImage(MagickWand *wand,
1500 const KernelInfo *color_matrix)
1505 assert(wand != (MagickWand *) NULL);
1506 assert(wand->signature == WandSignature);
1507 if (wand->debug != MagickFalse)
1508 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1509 if (color_matrix == (const KernelInfo *) NULL)
1510 return(MagickFalse);
1511 if (wand->images == (Image *) NULL)
1512 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1513 color_image=ColorMatrixImage(wand->images,color_matrix,wand->exception);
1514 if (color_image == (Image *) NULL)
1515 return(MagickFalse);
1516 ReplaceImageInList(&wand->images,color_image);
1521 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1525 % M a g i c k C o m b i n e I m a g e s %
1529 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1531 % MagickCombineImages() combines one or more images into a single image. The
1532 % grayscale value of the pixels of each image in the sequence is assigned in
1533 % order to the specified hannels of the combined image. The typical
1534 % ordering would be image 1 => Red, 2 => Green, 3 => Blue, etc.
1536 % The format of the MagickCombineImages method is:
1538 % MagickWand *MagickCombineImages(MagickWand *wand)
1540 % A description of each parameter follows:
1542 % o wand: the magick wand.
1545 WandExport MagickWand *MagickCombineImages(MagickWand *wand)
1550 assert(wand != (MagickWand *) NULL);
1551 assert(wand->signature == WandSignature);
1552 if (wand->debug != MagickFalse)
1553 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1554 if (wand->images == (Image *) NULL)
1555 return((MagickWand *) NULL);
1556 combine_image=CombineImages(wand->images,wand->exception);
1557 if (combine_image == (Image *) NULL)
1558 return((MagickWand *) NULL);
1559 return(CloneMagickWandFromImages(wand,combine_image));
1563 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1567 % M a g i c k C o m m e n t I m a g e %
1571 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1573 % MagickCommentImage() adds a comment to your image.
1575 % The format of the MagickCommentImage method is:
1577 % MagickBooleanType MagickCommentImage(MagickWand *wand,
1578 % const char *comment)
1580 % A description of each parameter follows:
1582 % o wand: the magick wand.
1584 % o comment: the image comment.
1587 WandExport MagickBooleanType MagickCommentImage(MagickWand *wand,
1588 const char *comment)
1593 assert(wand != (MagickWand *) NULL);
1594 assert(wand->signature == WandSignature);
1595 if (wand->debug != MagickFalse)
1596 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1597 if (wand->images == (Image *) NULL)
1598 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1599 status=SetImageProperty(wand->images,"comment",comment);
1600 if (status == MagickFalse)
1601 InheritException(wand->exception,&wand->images->exception);
1606 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1610 % M a g i c k C o m p a r e I m a g e L a y e r s %
1614 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1616 % MagickCompareImagesLayers() compares each image with the next in a sequence
1617 % and returns the maximum bounding region of any pixel differences it
1620 % The format of the MagickCompareImagesLayers method is:
1622 % MagickWand *MagickCompareImagesLayers(MagickWand *wand,
1623 % const ImageLayerMethod method)
1625 % A description of each parameter follows:
1627 % o wand: the magick wand.
1629 % o method: the compare method.
1632 WandExport MagickWand *MagickCompareImagesLayers(MagickWand *wand,
1633 const ImageLayerMethod method)
1638 assert(wand != (MagickWand *) NULL);
1639 assert(wand->signature == WandSignature);
1640 if (wand->debug != MagickFalse)
1641 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1642 if (wand->images == (Image *) NULL)
1643 return((MagickWand *) NULL);
1644 layers_image=CompareImagesLayers(wand->images,method,wand->exception);
1645 if (layers_image == (Image *) NULL)
1646 return((MagickWand *) NULL);
1647 return(CloneMagickWandFromImages(wand,layers_image));
1651 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1655 % M a g i c k C o m p a r e I m a g e s %
1659 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1661 % MagickCompareImages() compares an image to a reconstructed image and returns
1662 % the specified difference image.
1664 % The format of the MagickCompareImages method is:
1666 % MagickWand *MagickCompareImages(MagickWand *wand,
1667 % const MagickWand *reference,const MetricType metric,
1668 % double *distortion)
1670 % A description of each parameter follows:
1672 % o wand: the magick wand.
1674 % o reference: the reference wand.
1676 % o metric: the metric.
1678 % o distortion: the computed distortion between the images.
1681 WandExport MagickWand *MagickCompareImages(MagickWand *wand,
1682 const MagickWand *reference,const MetricType metric,double *distortion)
1688 assert(wand != (MagickWand *) NULL);
1689 assert(wand->signature == WandSignature);
1690 if (wand->debug != MagickFalse)
1691 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1692 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
1694 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
1695 "ContainsNoImages","`%s'",wand->name);
1696 return((MagickWand *) NULL);
1698 compare_image=CompareImages(wand->images,reference->images,metric,distortion,
1699 &wand->images->exception);
1700 if (compare_image == (Image *) NULL)
1701 return((MagickWand *) NULL);
1702 return(CloneMagickWandFromImages(wand,compare_image));
1706 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1710 % M a g i c k C o m p o s i t e I m a g e %
1714 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1716 % MagickCompositeImage() composite one image onto another at the specified
1719 % The format of the MagickCompositeImage method is:
1721 % MagickBooleanType MagickCompositeImage(MagickWand *wand,
1722 % const MagickWand *composite_wand,const CompositeOperator compose,
1723 % const ssize_t x,const ssize_t y)
1725 % A description of each parameter follows:
1727 % o wand: the magick wand.
1729 % o composite_image: the composite image.
1731 % o compose: This operator affects how the composite is applied to the
1732 % image. The default is Over. Choose from these operators:
1734 % OverCompositeOp InCompositeOp OutCompositeOp
1735 % AtopCompositeOp XorCompositeOp PlusCompositeOp
1736 % MinusCompositeOp AddCompositeOp SubtractCompositeOp
1737 % DifferenceCompositeOp BumpmapCompositeOp CopyCompositeOp
1738 % DisplaceCompositeOp
1740 % o x: the column offset of the composited image.
1742 % o y: the row offset of the composited image.
1745 WandExport MagickBooleanType MagickCompositeImage(MagickWand *wand,
1746 const MagickWand *composite_wand,const CompositeOperator compose,
1747 const ssize_t x,const ssize_t y)
1752 assert(wand != (MagickWand *) NULL);
1753 assert(wand->signature == WandSignature);
1754 if (wand->debug != MagickFalse)
1755 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1756 if ((wand->images == (Image *) NULL) ||
1757 (composite_wand->images == (Image *) NULL))
1758 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1759 status=CompositeImage(wand->images,compose,composite_wand->images,x,y);
1760 if (status == MagickFalse)
1761 InheritException(wand->exception,&wand->images->exception);
1766 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1770 % M a g i c k C o n t r a s t I m a g e %
1774 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1776 % MagickContrastImage() enhances the intensity differences between the lighter
1777 % and darker elements of the image. Set sharpen to a value other than 0 to
1778 % increase the image contrast otherwise the contrast is reduced.
1780 % The format of the MagickContrastImage method is:
1782 % MagickBooleanType MagickContrastImage(MagickWand *wand,
1783 % const MagickBooleanType sharpen)
1785 % A description of each parameter follows:
1787 % o wand: the magick wand.
1789 % o sharpen: Increase or decrease image contrast.
1793 WandExport MagickBooleanType MagickContrastImage(MagickWand *wand,
1794 const MagickBooleanType sharpen)
1799 assert(wand != (MagickWand *) NULL);
1800 assert(wand->signature == WandSignature);
1801 if (wand->debug != MagickFalse)
1802 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1803 if (wand->images == (Image *) NULL)
1804 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1805 status=ContrastImage(wand->images,sharpen,&wand->images->exception);
1810 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1814 % 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 %
1818 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1820 % MagickContrastStretchImage() enhances the contrast of a color image by
1821 % adjusting the pixels color to span the entire range of colors available.
1822 % You can also reduce the influence of a particular channel with a gamma
1825 % The format of the MagickContrastStretchImage method is:
1827 % MagickBooleanType MagickContrastStretchImage(MagickWand *wand,
1828 % const double black_point,const double white_point)
1830 % A description of each parameter follows:
1832 % o wand: the magick wand.
1834 % o black_point: the black point.
1836 % o white_point: the white point.
1839 WandExport MagickBooleanType MagickContrastStretchImage(MagickWand *wand,
1840 const double black_point,const double white_point)
1845 assert(wand != (MagickWand *) NULL);
1846 assert(wand->signature == WandSignature);
1847 if (wand->debug != MagickFalse)
1848 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1849 if (wand->images == (Image *) NULL)
1850 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1851 status=ContrastStretchImage(wand->images,black_point,white_point,
1852 &wand->images->exception);
1857 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1861 % M a g i c k C o n v o l v e I m a g e %
1865 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1867 % MagickConvolveImage() applies a custom convolution kernel to the image.
1869 % The format of the MagickConvolveImage method is:
1871 % MagickBooleanType MagickConvolveImage(MagickWand *wand,
1872 % const KernelInfo *kernel)
1874 % A description of each parameter follows:
1876 % o wand: the magick wand.
1878 % o kernel: An array of doubles representing the convolution kernel.
1881 WandExport MagickBooleanType MagickConvolveImage(MagickWand *wand,
1882 const KernelInfo *kernel)
1887 assert(wand != (MagickWand *) NULL);
1888 assert(wand->signature == WandSignature);
1889 if (wand->debug != MagickFalse)
1890 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1891 if (kernel == (const KernelInfo *) NULL)
1892 return(MagickFalse);
1893 if (wand->images == (Image *) NULL)
1894 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1895 filter_image=ConvolveImage(wand->images,kernel,wand->exception);
1896 if (filter_image == (Image *) NULL)
1897 return(MagickFalse);
1898 ReplaceImageInList(&wand->images,filter_image);
1903 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1907 % M a g i c k C r o p I m a g e %
1911 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1913 % MagickCropImage() extracts a region of the image.
1915 % The format of the MagickCropImage method is:
1917 % MagickBooleanType MagickCropImage(MagickWand *wand,
1918 % const size_t width,const size_t height,const ssize_t x,const ssize_t y)
1920 % A description of each parameter follows:
1922 % o wand: the magick wand.
1924 % o width: the region width.
1926 % o height: the region height.
1928 % o x: the region x-offset.
1930 % o y: the region y-offset.
1933 WandExport MagickBooleanType MagickCropImage(MagickWand *wand,
1934 const size_t width,const size_t height,const ssize_t x,const ssize_t y)
1942 assert(wand != (MagickWand *) NULL);
1943 assert(wand->signature == WandSignature);
1944 if (wand->debug != MagickFalse)
1945 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1946 if (wand->images == (Image *) NULL)
1947 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1952 crop_image=CropImage(wand->images,&crop,wand->exception);
1953 if (crop_image == (Image *) NULL)
1954 return(MagickFalse);
1955 ReplaceImageInList(&wand->images,crop_image);
1960 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1964 % M a g i c k C y c l e C o l o r m a p I m a g e %
1968 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1970 % MagickCycleColormapImage() displaces an image's colormap by a given number
1971 % of positions. If you cycle the colormap a number of times you can produce
1972 % a psychodelic effect.
1974 % The format of the MagickCycleColormapImage method is:
1976 % MagickBooleanType MagickCycleColormapImage(MagickWand *wand,
1977 % const ssize_t displace)
1979 % A description of each parameter follows:
1981 % o wand: the magick wand.
1983 % o pixel_wand: the pixel wand.
1986 WandExport MagickBooleanType MagickCycleColormapImage(MagickWand *wand,
1987 const ssize_t displace)
1992 assert(wand != (MagickWand *) NULL);
1993 assert(wand->signature == WandSignature);
1994 if (wand->debug != MagickFalse)
1995 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1996 if (wand->images == (Image *) NULL)
1997 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1998 status=CycleColormapImage(wand->images,displace);
1999 if (status == MagickFalse)
2000 InheritException(wand->exception,&wand->images->exception);
2005 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2009 % M a g i c k C o n s t i t u t e I m a g e %
2013 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2015 % MagickConstituteImage() adds an image to the wand comprised of the pixel
2016 % data you supply. The pixel data must be in scanline order top-to-bottom.
2017 % The data can be char, short int, int, float, or double. Float and double
2018 % require the pixels to be normalized [0..1], otherwise [0..Max], where Max
2019 % is the maximum value the type can accomodate (e.g. 255 for char). For
2020 % example, to create a 640x480 image from unsigned red-green-blue character
2023 % MagickConstituteImage(wand,640,640,"RGB",CharPixel,pixels);
2025 % The format of the MagickConstituteImage method is:
2027 % MagickBooleanType MagickConstituteImage(MagickWand *wand,
2028 % const size_t columns,const size_t rows,const char *map,
2029 % const StorageType storage,void *pixels)
2031 % A description of each parameter follows:
2033 % o wand: the magick wand.
2035 % o columns: width in pixels of the image.
2037 % o rows: height in pixels of the image.
2039 % o map: This string reflects the expected ordering of the pixel array.
2040 % It can be any combination or order of R = red, G = green, B = blue,
2041 % A = alpha (0 is transparent), O = opacity (0 is opaque), C = cyan,
2042 % Y = yellow, M = magenta, K = black, I = intensity (for grayscale),
2045 % o storage: Define the data type of the pixels. Float and double types are
2046 % expected to be normalized [0..1] otherwise [0..QuantumRange]. Choose from
2047 % these types: CharPixel, DoublePixel, FloatPixel, IntegerPixel,
2048 % LongPixel, QuantumPixel, or ShortPixel.
2050 % o pixels: This array of values contain the pixel components as defined by
2051 % map and type. You must preallocate this array where the expected
2052 % length varies depending on the values of width, height, map, and type.
2056 WandExport MagickBooleanType MagickConstituteImage(MagickWand *wand,
2057 const size_t columns,const size_t rows,const char *map,
2058 const StorageType storage,const void *pixels)
2063 assert(wand != (MagickWand *) NULL);
2064 assert(wand->signature == WandSignature);
2065 if (wand->debug != MagickFalse)
2066 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2067 images=ConstituteImage(columns,rows,map,storage,pixels,wand->exception);
2068 if (images == (Image *) NULL)
2069 return(MagickFalse);
2070 return(InsertImageInWand(wand,images));
2074 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2078 % M a g i c k D e c i p h e r I m a g e %
2082 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2084 % MagickDecipherImage() converts cipher pixels to plain pixels.
2086 % The format of the MagickDecipherImage method is:
2088 % MagickBooleanType MagickDecipherImage(MagickWand *wand,
2089 % const char *passphrase)
2091 % A description of each parameter follows:
2093 % o wand: the magick wand.
2095 % o passphrase: the passphrase.
2098 WandExport MagickBooleanType MagickDecipherImage(MagickWand *wand,
2099 const char *passphrase)
2101 assert(wand != (MagickWand *) NULL);
2102 assert(wand->signature == WandSignature);
2103 if (wand->debug != MagickFalse)
2104 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2105 if (wand->images == (Image *) NULL)
2106 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2107 return(DecipherImage(wand->images,passphrase,&wand->images->exception));
2111 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2115 % M a g i c k D e c o n s t r u c t I m a g e s %
2119 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2121 % MagickDeconstructImages() compares each image with the next in a sequence
2122 % and returns the maximum bounding region of any pixel differences it
2125 % The format of the MagickDeconstructImages method is:
2127 % MagickWand *MagickDeconstructImages(MagickWand *wand)
2129 % A description of each parameter follows:
2131 % o wand: the magick wand.
2134 WandExport MagickWand *MagickDeconstructImages(MagickWand *wand)
2139 assert(wand != (MagickWand *) NULL);
2140 assert(wand->signature == WandSignature);
2141 if (wand->debug != MagickFalse)
2142 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2143 if (wand->images == (Image *) NULL)
2144 return((MagickWand *) NULL);
2145 deconstruct_image=CompareImagesLayers(wand->images,CompareAnyLayer,
2147 if (deconstruct_image == (Image *) NULL)
2148 return((MagickWand *) NULL);
2149 return(CloneMagickWandFromImages(wand,deconstruct_image));
2153 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2157 % M a g i c k D e s k e w I m a g e %
2161 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2163 % MagickDeskewImage() removes skew from the image. Skew is an artifact that
2164 % occurs in scanned images because of the camera being misaligned,
2165 % imperfections in the scanning or surface, or simply because the paper was
2166 % not placed completely flat when scanned.
2168 % The format of the MagickDeskewImage method is:
2170 % MagickBooleanType MagickDeskewImage(MagickWand *wand,
2171 % const double threshold)
2173 % A description of each parameter follows:
2175 % o wand: the magick wand.
2177 % o threshold: separate background from foreground.
2180 WandExport MagickBooleanType MagickDeskewImage(MagickWand *wand,
2181 const double threshold)
2186 assert(wand != (MagickWand *) NULL);
2187 assert(wand->signature == WandSignature);
2188 if (wand->debug != MagickFalse)
2189 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2190 if (wand->images == (Image *) NULL)
2191 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2192 sepia_image=DeskewImage(wand->images,threshold,wand->exception);
2193 if (sepia_image == (Image *) NULL)
2194 return(MagickFalse);
2195 ReplaceImageInList(&wand->images,sepia_image);
2200 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2204 % M a g i c k D e s p e c k l e I m a g e %
2208 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2210 % MagickDespeckleImage() reduces the speckle noise in an image while
2211 % perserving the edges of the original image.
2213 % The format of the MagickDespeckleImage method is:
2215 % MagickBooleanType MagickDespeckleImage(MagickWand *wand)
2217 % A description of each parameter follows:
2219 % o wand: the magick wand.
2222 WandExport MagickBooleanType MagickDespeckleImage(MagickWand *wand)
2227 assert(wand != (MagickWand *) NULL);
2228 assert(wand->signature == WandSignature);
2229 if (wand->debug != MagickFalse)
2230 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2231 if (wand->images == (Image *) NULL)
2232 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2233 despeckle_image=DespeckleImage(wand->images,wand->exception);
2234 if (despeckle_image == (Image *) NULL)
2235 return(MagickFalse);
2236 ReplaceImageInList(&wand->images,despeckle_image);
2241 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2245 % M a g i c k D e s t r o y I m a g e %
2249 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2251 % MagickDestroyImage() dereferences an image, deallocating memory associated
2252 % with the image if the reference count becomes zero.
2254 % The format of the MagickDestroyImage method is:
2256 % Image *MagickDestroyImage(Image *image)
2258 % A description of each parameter follows:
2260 % o image: the image.
2263 WandExport Image *MagickDestroyImage(Image *image)
2265 return(DestroyImage(image));
2269 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2273 % M a g i c k D i s p l a y I m a g e %
2277 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2279 % MagickDisplayImage() displays an image.
2281 % The format of the MagickDisplayImage method is:
2283 % MagickBooleanType MagickDisplayImage(MagickWand *wand,
2284 % const char *server_name)
2286 % A description of each parameter follows:
2288 % o wand: the magick wand.
2290 % o server_name: the X server name.
2293 WandExport MagickBooleanType MagickDisplayImage(MagickWand *wand,
2294 const char *server_name)
2302 assert(wand != (MagickWand *) NULL);
2303 assert(wand->signature == WandSignature);
2304 if (wand->debug != MagickFalse)
2305 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2306 if (wand->images == (Image *) NULL)
2307 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2308 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
2309 if (image == (Image *) NULL)
2310 return(MagickFalse);
2311 (void) CloneString(&wand->image_info->server_name,server_name);
2312 status=DisplayImages(wand->image_info,image,&image->exception);
2313 image=DestroyImage(image);
2318 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2322 % M a g i c k D i s p l a y I m a g e s %
2326 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2328 % MagickDisplayImages() displays an image or image sequence.
2330 % The format of the MagickDisplayImages method is:
2332 % MagickBooleanType MagickDisplayImages(MagickWand *wand,
2333 % const char *server_name)
2335 % A description of each parameter follows:
2337 % o wand: the magick wand.
2339 % o server_name: the X server name.
2342 WandExport MagickBooleanType MagickDisplayImages(MagickWand *wand,
2343 const char *server_name)
2348 assert(wand != (MagickWand *) NULL);
2349 assert(wand->signature == WandSignature);
2350 if (wand->debug != MagickFalse)
2351 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2352 (void) CloneString(&wand->image_info->server_name,server_name);
2353 status=DisplayImages(wand->image_info,wand->images,&wand->images->exception);
2358 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2362 % M a g i c k D i s t o r t I m a g e %
2366 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2368 % MagickDistortImage() distorts an image using various distortion methods, by
2369 % mapping color lookups of the source image to a new destination image
2370 % usally of the same size as the source image, unless 'bestfit' is set to
2373 % If 'bestfit' is enabled, and distortion allows it, the destination image is
2374 % adjusted to ensure the whole source 'image' will just fit within the final
2375 % destination image, which will be sized and offset accordingly. Also in
2376 % many cases the virtual offset of the source image will be taken into
2377 % account in the mapping.
2379 % The format of the MagickDistortImage method is:
2381 % MagickBooleanType MagickDistortImage(MagickWand *wand,
2382 % const DistortImageMethod method,const size_t number_arguments,
2383 % const double *arguments,const MagickBooleanType bestfit)
2385 % A description of each parameter follows:
2387 % o image: the image to be distorted.
2389 % o method: the method of image distortion.
2391 % ArcDistortion always ignores the source image offset, and always
2392 % 'bestfit' the destination image with the top left corner offset
2393 % relative to the polar mapping center.
2395 % Bilinear has no simple inverse mapping so it does not allow 'bestfit'
2396 % style of image distortion.
2398 % Affine, Perspective, and Bilinear, do least squares fitting of the
2399 % distortion when more than the minimum number of control point pairs
2402 % Perspective, and Bilinear, falls back to a Affine distortion when less
2403 % that 4 control point pairs are provided. While Affine distortions let
2404 % you use any number of control point pairs, that is Zero pairs is a
2405 % no-Op (viewport only) distrotion, one pair is a translation and two
2406 % pairs of control points do a scale-rotate-translate, without any
2409 % o number_arguments: the number of arguments given for this distortion
2412 % o arguments: the arguments for this distortion method.
2414 % o bestfit: Attempt to resize destination to fit distorted source.
2417 WandExport MagickBooleanType MagickDistortImage(MagickWand *wand,
2418 const DistortImageMethod method,const size_t number_arguments,
2419 const double *arguments,const MagickBooleanType bestfit)
2424 assert(wand != (MagickWand *) NULL);
2425 assert(wand->signature == WandSignature);
2426 if (wand->debug != MagickFalse)
2427 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2428 if (wand->images == (Image *) NULL)
2429 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2430 distort_image=DistortImage(wand->images,method,number_arguments,arguments,
2431 bestfit,wand->exception);
2432 if (distort_image == (Image *) NULL)
2433 return(MagickFalse);
2434 ReplaceImageInList(&wand->images,distort_image);
2439 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2443 % M a g i c k D r a w I m a g e %
2447 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2449 % MagickDrawImage() renders the drawing wand on the current image.
2451 % The format of the MagickDrawImage method is:
2453 % MagickBooleanType MagickDrawImage(MagickWand *wand,
2454 % const DrawingWand *drawing_wand)
2456 % A description of each parameter follows:
2458 % o wand: the magick wand.
2460 % o drawing_wand: the draw wand.
2463 WandExport MagickBooleanType MagickDrawImage(MagickWand *wand,
2464 const DrawingWand *drawing_wand)
2475 assert(wand != (MagickWand *) NULL);
2476 assert(wand->signature == WandSignature);
2477 if (wand->debug != MagickFalse)
2478 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2479 if (wand->images == (Image *) NULL)
2480 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2481 draw_info=PeekDrawingWand(drawing_wand);
2482 if ((draw_info == (DrawInfo *) NULL) ||
2483 (draw_info->primitive == (char *) NULL))
2484 return(MagickFalse);
2485 primitive=AcquireString(draw_info->primitive);
2486 draw_info=DestroyDrawInfo(draw_info);
2487 draw_info=CloneDrawInfo(wand->image_info,(DrawInfo *) NULL);
2488 draw_info->primitive=primitive;
2489 status=DrawImage(wand->images,draw_info);
2490 if (status == MagickFalse)
2491 InheritException(wand->exception,&wand->images->exception);
2492 draw_info=DestroyDrawInfo(draw_info);
2497 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2501 % M a g i c k E d g e I m a g e %
2505 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2507 % MagickEdgeImage() enhance edges within the image with a convolution filter
2508 % of the given radius. Use a radius of 0 and Edge() selects a suitable
2511 % The format of the MagickEdgeImage method is:
2513 % MagickBooleanType MagickEdgeImage(MagickWand *wand,const double radius)
2515 % A description of each parameter follows:
2517 % o wand: the magick wand.
2519 % o radius: the radius of the pixel neighborhood.
2522 WandExport MagickBooleanType MagickEdgeImage(MagickWand *wand,
2523 const double radius)
2528 assert(wand != (MagickWand *) NULL);
2529 assert(wand->signature == WandSignature);
2530 if (wand->debug != MagickFalse)
2531 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2532 if (wand->images == (Image *) NULL)
2533 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2534 edge_image=EdgeImage(wand->images,radius,wand->exception);
2535 if (edge_image == (Image *) NULL)
2536 return(MagickFalse);
2537 ReplaceImageInList(&wand->images,edge_image);
2542 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2546 % M a g i c k E m b o s s I m a g e %
2550 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2552 % MagickEmbossImage() returns a grayscale image with a three-dimensional
2553 % effect. We convolve the image with a Gaussian operator of the given radius
2554 % and standard deviation (sigma). For reasonable results, radius should be
2555 % larger than sigma. Use a radius of 0 and Emboss() selects a suitable
2558 % The format of the MagickEmbossImage method is:
2560 % MagickBooleanType MagickEmbossImage(MagickWand *wand,const double radius,
2561 % const double sigma)
2563 % A description of each parameter follows:
2565 % o wand: the magick wand.
2567 % o radius: the radius of the Gaussian, in pixels, not counting the center
2570 % o sigma: the standard deviation of the Gaussian, in pixels.
2573 WandExport MagickBooleanType MagickEmbossImage(MagickWand *wand,
2574 const double radius,const double sigma)
2579 assert(wand != (MagickWand *) NULL);
2580 assert(wand->signature == WandSignature);
2581 if (wand->debug != MagickFalse)
2582 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2583 if (wand->images == (Image *) NULL)
2584 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2585 emboss_image=EmbossImage(wand->images,radius,sigma,wand->exception);
2586 if (emboss_image == (Image *) NULL)
2587 return(MagickFalse);
2588 ReplaceImageInList(&wand->images,emboss_image);
2593 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2597 % M a g i c k E n c i p h e r I m a g e %
2601 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2603 % MagickEncipherImage() converts plaint pixels to cipher pixels.
2605 % The format of the MagickEncipherImage method is:
2607 % MagickBooleanType MagickEncipherImage(MagickWand *wand,
2608 % const char *passphrase)
2610 % A description of each parameter follows:
2612 % o wand: the magick wand.
2614 % o passphrase: the passphrase.
2617 WandExport MagickBooleanType MagickEncipherImage(MagickWand *wand,
2618 const char *passphrase)
2620 assert(wand != (MagickWand *) NULL);
2621 assert(wand->signature == WandSignature);
2622 if (wand->debug != MagickFalse)
2623 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2624 if (wand->images == (Image *) NULL)
2625 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2626 return(EncipherImage(wand->images,passphrase,&wand->images->exception));
2630 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2634 % M a g i c k E n h a n c e I m a g e %
2638 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2640 % MagickEnhanceImage() applies a digital filter that improves the quality of a
2643 % The format of the MagickEnhanceImage method is:
2645 % MagickBooleanType MagickEnhanceImage(MagickWand *wand)
2647 % A description of each parameter follows:
2649 % o wand: the magick wand.
2652 WandExport MagickBooleanType MagickEnhanceImage(MagickWand *wand)
2657 assert(wand != (MagickWand *) NULL);
2658 assert(wand->signature == WandSignature);
2659 if (wand->debug != MagickFalse)
2660 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2661 if (wand->images == (Image *) NULL)
2662 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2663 enhance_image=EnhanceImage(wand->images,wand->exception);
2664 if (enhance_image == (Image *) NULL)
2665 return(MagickFalse);
2666 ReplaceImageInList(&wand->images,enhance_image);
2671 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2675 % M a g i c k E q u a l i z e I m a g e %
2679 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2681 % MagickEqualizeImage() equalizes the image histogram.
2683 % The format of the MagickEqualizeImage method is:
2685 % MagickBooleanType MagickEqualizeImage(MagickWand *wand)
2687 % A description of each parameter follows:
2689 % o wand: the magick wand.
2691 % o channel: the image channel(s).
2694 WandExport MagickBooleanType MagickEqualizeImage(MagickWand *wand)
2699 assert(wand != (MagickWand *) NULL);
2700 assert(wand->signature == WandSignature);
2701 if (wand->debug != MagickFalse)
2702 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2703 if (wand->images == (Image *) NULL)
2704 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2705 status=EqualizeImage(wand->images,&wand->images->exception);
2710 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2714 % M a g i c k E v a l u a t e I m a g e %
2718 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2720 % MagickEvaluateImage() applys an arithmetic, relational, or logical
2721 % expression to an image. Use these operators to lighten or darken an image,
2722 % to increase or decrease contrast in an image, or to produce the "negative"
2725 % The format of the MagickEvaluateImage method is:
2727 % MagickBooleanType MagickEvaluateImage(MagickWand *wand,
2728 % const MagickEvaluateOperator operator,const double value)
2729 % MagickBooleanType MagickEvaluateImages(MagickWand *wand,
2730 % const MagickEvaluateOperator operator)
2732 % A description of each parameter follows:
2734 % o wand: the magick wand.
2736 % o op: A channel operator.
2738 % o value: A value value.
2742 WandExport MagickWand *MagickEvaluateImages(MagickWand *wand,
2743 const MagickEvaluateOperator op)
2748 assert(wand != (MagickWand *) NULL);
2749 assert(wand->signature == WandSignature);
2750 if (wand->debug != MagickFalse)
2751 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2752 if (wand->images == (Image *) NULL)
2753 return((MagickWand *) NULL);
2754 evaluate_image=EvaluateImages(wand->images,op,wand->exception);
2755 if (evaluate_image == (Image *) NULL)
2756 return((MagickWand *) NULL);
2757 return(CloneMagickWandFromImages(wand,evaluate_image));
2760 WandExport MagickBooleanType MagickEvaluateImage(MagickWand *wand,
2761 const MagickEvaluateOperator op,const double value)
2766 assert(wand != (MagickWand *) NULL);
2767 assert(wand->signature == WandSignature);
2768 if (wand->debug != MagickFalse)
2769 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2770 if (wand->images == (Image *) NULL)
2771 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2772 status=EvaluateImage(wand->images,op,value,&wand->images->exception);
2777 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2781 % M a g i c k E x p o r t I m a g e P i x e l s %
2785 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2787 % MagickExportImagePixels() extracts pixel data from an image and returns it
2788 % to you. The method returns MagickTrue on success otherwise MagickFalse if
2789 % an error is encountered. The data is returned as char, short int, int,
2790 % ssize_t, float, or double in the order specified by map.
2792 % Suppose you want to extract the first scanline of a 640x480 image as
2793 % character data in red-green-blue order:
2795 % MagickExportImagePixels(wand,0,0,640,1,"RGB",CharPixel,pixels);
2797 % The format of the MagickExportImagePixels method is:
2799 % MagickBooleanType MagickExportImagePixels(MagickWand *wand,
2800 % const ssize_t x,const ssize_t y,const size_t columns,
2801 % const size_t rows,const char *map,const StorageType storage,
2804 % A description of each parameter follows:
2806 % o wand: the magick wand.
2808 % o x, y, columns, rows: These values define the perimeter
2809 % of a region of pixels you want to extract.
2811 % o map: This string reflects the expected ordering of the pixel array.
2812 % It can be any combination or order of R = red, G = green, B = blue,
2813 % A = alpha (0 is transparent), O = opacity (0 is opaque), C = cyan,
2814 % Y = yellow, M = magenta, K = black, I = intensity (for grayscale),
2817 % o storage: Define the data type of the pixels. Float and double types are
2818 % expected to be normalized [0..1] otherwise [0..QuantumRange]. Choose from
2819 % these types: CharPixel, DoublePixel, FloatPixel, IntegerPixel,
2820 % LongPixel, QuantumPixel, or ShortPixel.
2822 % o pixels: This array of values contain the pixel components as defined by
2823 % map and type. You must preallocate this array where the expected
2824 % length varies depending on the values of width, height, map, and type.
2827 WandExport MagickBooleanType MagickExportImagePixels(MagickWand *wand,
2828 const ssize_t x,const ssize_t y,const size_t columns,
2829 const size_t rows,const char *map,const StorageType storage,
2835 assert(wand != (MagickWand *) NULL);
2836 assert(wand->signature == WandSignature);
2837 if (wand->debug != MagickFalse)
2838 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2839 if (wand->images == (Image *) NULL)
2840 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2841 status=ExportImagePixels(wand->images,x,y,columns,rows,map,
2842 storage,pixels,wand->exception);
2843 if (status == MagickFalse)
2844 InheritException(wand->exception,&wand->images->exception);
2849 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2853 % M a g i c k E x t e n t I m a g e %
2857 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2859 % MagickExtentImage() extends the image as defined by the geometry, gravity,
2860 % and wand background color. Set the (x,y) offset of the geometry to move
2861 % the original wand relative to the extended wand.
2863 % The format of the MagickExtentImage method is:
2865 % MagickBooleanType MagickExtentImage(MagickWand *wand,
2866 % const size_t width,const size_t height,const ssize_t x,
2869 % A description of each parameter follows:
2871 % o wand: the magick wand.
2873 % o width: the region width.
2875 % o height: the region height.
2877 % o x: the region x offset.
2879 % o y: the region y offset.
2882 WandExport MagickBooleanType MagickExtentImage(MagickWand *wand,
2883 const size_t width,const size_t height,const ssize_t x,
2892 assert(wand != (MagickWand *) NULL);
2893 assert(wand->signature == WandSignature);
2894 if (wand->debug != MagickFalse)
2895 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2896 if (wand->images == (Image *) NULL)
2897 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2899 extent.height=height;
2902 extent_image=ExtentImage(wand->images,&extent,wand->exception);
2903 if (extent_image == (Image *) NULL)
2904 return(MagickFalse);
2905 ReplaceImageInList(&wand->images,extent_image);
2910 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2914 % M a g i c k F l i p I m a g e %
2918 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2920 % MagickFlipImage() creates a vertical mirror image by reflecting the pixels
2921 % around the central x-axis.
2923 % The format of the MagickFlipImage method is:
2925 % MagickBooleanType MagickFlipImage(MagickWand *wand)
2927 % A description of each parameter follows:
2929 % o wand: the magick wand.
2932 WandExport MagickBooleanType MagickFlipImage(MagickWand *wand)
2937 assert(wand != (MagickWand *) NULL);
2938 assert(wand->signature == WandSignature);
2939 if (wand->debug != MagickFalse)
2940 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2941 if (wand->images == (Image *) NULL)
2942 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2943 flip_image=FlipImage(wand->images,wand->exception);
2944 if (flip_image == (Image *) NULL)
2945 return(MagickFalse);
2946 ReplaceImageInList(&wand->images,flip_image);
2951 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2955 % 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 %
2959 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2961 % MagickFloodfillPaintImage() changes the color value of any pixel that matches
2962 % target and is an immediate neighbor. If the method FillToBorderMethod is
2963 % specified, the color value is changed for any neighbor pixel that does not
2964 % match the bordercolor member of image.
2966 % The format of the MagickFloodfillPaintImage method is:
2968 % MagickBooleanType MagickFloodfillPaintImage(MagickWand *wand,
2969 % const PixelWand *fill,const double fuzz,const PixelWand *bordercolor,
2970 % const ssize_t x,const ssize_t y,const MagickBooleanType invert)
2972 % A description of each parameter follows:
2974 % o wand: the magick wand.
2976 % o fill: the floodfill color pixel wand.
2978 % o fuzz: By default target must match a particular pixel color
2979 % exactly. However, in many cases two colors may differ by a small amount.
2980 % The fuzz member of image defines how much tolerance is acceptable to
2981 % consider two colors as the same. For example, set fuzz to 10 and the
2982 % color red at intensities of 100 and 102 respectively are now interpreted
2983 % as the same color for the purposes of the floodfill.
2985 % o bordercolor: the border color pixel wand.
2987 % o x,y: the starting location of the operation.
2989 % o invert: paint any pixel that does not match the target color.
2992 WandExport MagickBooleanType MagickFloodfillPaintImage(MagickWand *wand,
2993 const PixelWand *fill,const double fuzz,const PixelWand *bordercolor,
2994 const ssize_t x,const ssize_t y,const MagickBooleanType invert)
3005 assert(wand != (MagickWand *) NULL);
3006 assert(wand->signature == WandSignature);
3007 if (wand->debug != MagickFalse)
3008 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3009 if (wand->images == (Image *) NULL)
3010 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3011 draw_info=CloneDrawInfo(wand->image_info,(DrawInfo *) NULL);
3012 PixelGetQuantumPacket(fill,&draw_info->fill);
3013 (void) GetOneVirtualMagickPixel(wand->images,x % wand->images->columns,
3014 y % wand->images->rows,&target,wand->exception);
3015 if (bordercolor != (PixelWand *) NULL)
3016 PixelGetMagickColor(bordercolor,&target);
3017 wand->images->fuzz=fuzz;
3018 status=FloodfillPaintImage(wand->images,draw_info,&target,x,y,invert,
3019 &wand->images->exception);
3020 draw_info=DestroyDrawInfo(draw_info);
3025 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3029 % M a g i c k F l o p I m a g e %
3033 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3035 % MagickFlopImage() creates a horizontal mirror image by reflecting the pixels
3036 % around the central y-axis.
3038 % The format of the MagickFlopImage method is:
3040 % MagickBooleanType MagickFlopImage(MagickWand *wand)
3042 % A description of each parameter follows:
3044 % o wand: the magick wand.
3047 WandExport MagickBooleanType MagickFlopImage(MagickWand *wand)
3052 assert(wand != (MagickWand *) NULL);
3053 assert(wand->signature == WandSignature);
3054 if (wand->debug != MagickFalse)
3055 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3056 if (wand->images == (Image *) NULL)
3057 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3058 flop_image=FlopImage(wand->images,wand->exception);
3059 if (flop_image == (Image *) NULL)
3060 return(MagickFalse);
3061 ReplaceImageInList(&wand->images,flop_image);
3066 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3070 % 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 %
3074 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3076 % MagickForwardFourierTransformImage() implements the discrete Fourier
3077 % transform (DFT) of the image either as a magnitude / phase or real /
3078 % imaginary image pair.
3080 % The format of the MagickForwardFourierTransformImage method is:
3082 % MagickBooleanType MagickForwardFourierTransformImage(MagickWand *wand,
3083 % const MagickBooleanType magnitude)
3085 % A description of each parameter follows:
3087 % o wand: the magick wand.
3089 % o magnitude: if true, return as magnitude / phase pair otherwise a real /
3090 % imaginary image pair.
3093 WandExport MagickBooleanType MagickForwardFourierTransformImage(
3094 MagickWand *wand,const MagickBooleanType magnitude)
3099 assert(wand != (MagickWand *) NULL);
3100 assert(wand->signature == WandSignature);
3101 if (wand->debug != MagickFalse)
3102 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3103 if (wand->images == (Image *) NULL)
3104 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3105 forward_image=ForwardFourierTransformImage(wand->images,magnitude,
3107 if (forward_image == (Image *) NULL)
3108 return(MagickFalse);
3109 ReplaceImageInList(&wand->images,forward_image);
3114 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3118 % M a g i c k F r a m e I m a g e %
3122 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3124 % MagickFrameImage() adds a simulated three-dimensional border around the
3125 % image. The width and height specify the border width of the vertical and
3126 % horizontal sides of the frame. The inner and outer bevels indicate the
3127 % width of the inner and outer shadows of the frame.
3129 % The format of the MagickFrameImage method is:
3131 % MagickBooleanType MagickFrameImage(MagickWand *wand,
3132 % const PixelWand *matte_color,const size_t width,
3133 % const size_t height,const ssize_t inner_bevel,
3134 % const ssize_t outer_bevel)
3136 % A description of each parameter follows:
3138 % o wand: the magick wand.
3140 % o matte_color: the frame color pixel wand.
3142 % o width: the border width.
3144 % o height: the border height.
3146 % o inner_bevel: the inner bevel width.
3148 % o outer_bevel: the outer bevel width.
3151 WandExport MagickBooleanType MagickFrameImage(MagickWand *wand,
3152 const PixelWand *matte_color,const size_t width,
3153 const size_t height,const ssize_t inner_bevel,const ssize_t outer_bevel)
3161 assert(wand != (MagickWand *) NULL);
3162 assert(wand->signature == WandSignature);
3163 if (wand->debug != MagickFalse)
3164 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3165 if (wand->images == (Image *) NULL)
3166 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3167 (void) ResetMagickMemory(&frame_info,0,sizeof(frame_info));
3168 frame_info.width=wand->images->columns+2*width;
3169 frame_info.height=wand->images->rows+2*height;
3170 frame_info.x=(ssize_t) width;
3171 frame_info.y=(ssize_t) height;
3172 frame_info.inner_bevel=inner_bevel;
3173 frame_info.outer_bevel=outer_bevel;
3174 PixelGetQuantumPacket(matte_color,&wand->images->matte_color);
3175 frame_image=FrameImage(wand->images,&frame_info,wand->exception);
3176 if (frame_image == (Image *) NULL)
3177 return(MagickFalse);
3178 ReplaceImageInList(&wand->images,frame_image);
3183 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3187 % M a g i c k F u n c t i o n I m a g e %
3191 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3193 % MagickFunctionImage() applys an arithmetic, relational, or logical
3194 % expression to an image. Use these operators to lighten or darken an image,
3195 % to increase or decrease contrast in an image, or to produce the "negative"
3198 % The format of the MagickFunctionImage method is:
3200 % MagickBooleanType MagickFunctionImage(MagickWand *wand,
3201 % const MagickFunction function,const size_t number_arguments,
3202 % const double *arguments)
3204 % A description of each parameter follows:
3206 % o wand: the magick wand.
3208 % o function: the image function.
3210 % o number_arguments: the number of function arguments.
3212 % o arguments: the function arguments.
3215 WandExport MagickBooleanType MagickFunctionImage(MagickWand *wand,
3216 const MagickFunction function,const size_t number_arguments,
3217 const double *arguments)
3222 assert(wand != (MagickWand *) NULL);
3223 assert(wand->signature == WandSignature);
3224 if (wand->debug != MagickFalse)
3225 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3226 if (wand->images == (Image *) NULL)
3227 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3228 status=FunctionImage(wand->images,function,number_arguments,arguments,
3229 &wand->images->exception);
3234 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3238 % M a g i c k F x I m a g e %
3242 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3244 % MagickFxImage() evaluate expression for each pixel in the image.
3246 % The format of the MagickFxImage method is:
3248 % MagickWand *MagickFxImage(MagickWand *wand,const char *expression)
3250 % A description of each parameter follows:
3252 % o wand: the magick wand.
3254 % o expression: the expression.
3257 WandExport MagickWand *MagickFxImage(MagickWand *wand,const char *expression)
3262 assert(wand != (MagickWand *) NULL);
3263 assert(wand->signature == WandSignature);
3264 if (wand->debug != MagickFalse)
3265 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3266 if (wand->images == (Image *) NULL)
3267 return((MagickWand *) NULL);
3268 fx_image=FxImage(wand->images,expression,wand->exception);
3269 if (fx_image == (Image *) NULL)
3270 return((MagickWand *) NULL);
3271 return(CloneMagickWandFromImages(wand,fx_image));
3275 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3279 % M a g i c k G a m m a I m a g e %
3283 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3285 % MagickGammaImage() gamma-corrects an image. The same image viewed on
3286 % different devices will have perceptual differences in the way the image's
3287 % intensities are represented on the screen. Specify individual gamma levels
3288 % for the red, green, and blue channels, or adjust all three with the gamma
3289 % parameter. Values typically range from 0.8 to 2.3.
3291 % You can also reduce the influence of a particular channel with a gamma
3294 % The format of the MagickGammaImage method is:
3296 % MagickBooleanType MagickGammaImage(MagickWand *wand,const double gamma)
3298 % A description of each parameter follows:
3300 % o wand: the magick wand.
3302 % o level: Define the level of gamma correction.
3305 WandExport MagickBooleanType MagickGammaImage(MagickWand *wand,
3311 assert(wand != (MagickWand *) NULL);
3312 assert(wand->signature == WandSignature);
3313 if (wand->debug != MagickFalse)
3314 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3315 if (wand->images == (Image *) NULL)
3316 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3317 status=GammaImage(wand->images,gamma,wand->exception);
3322 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3326 % M a g i c k G a u s s i a n B l u r I m a g e %
3330 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3332 % MagickGaussianBlurImage() blurs an image. We convolve the image with a
3333 % Gaussian operator of the given radius and standard deviation (sigma).
3334 % For reasonable results, the radius should be larger than sigma. Use a
3335 % radius of 0 and MagickGaussianBlurImage() selects a suitable radius for you.
3337 % The format of the MagickGaussianBlurImage method is:
3339 % MagickBooleanType MagickGaussianBlurImage(MagickWand *wand,
3340 % const double radius,const double sigma)
3342 % A description of each parameter follows:
3344 % o wand: the magick wand.
3346 % o radius: the radius of the Gaussian, in pixels, not counting the center
3349 % o sigma: the standard deviation of the Gaussian, in pixels.
3352 WandExport MagickBooleanType MagickGaussianBlurImage(MagickWand *wand,
3353 const double radius,const double sigma)
3358 assert(wand != (MagickWand *) NULL);
3359 assert(wand->signature == WandSignature);
3360 if (wand->debug != MagickFalse)
3361 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3362 if (wand->images == (Image *) NULL)
3363 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3364 blur_image=GaussianBlurImage(wand->images,radius,sigma,wand->exception);
3365 if (blur_image == (Image *) NULL)
3366 return(MagickFalse);
3367 ReplaceImageInList(&wand->images,blur_image);
3372 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3376 % M a g i c k G e t I m a g e %
3380 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3382 % MagickGetImage() gets the image at the current image index.
3384 % The format of the MagickGetImage method is:
3386 % MagickWand *MagickGetImage(MagickWand *wand)
3388 % A description of each parameter follows:
3390 % o wand: the magick wand.
3393 WandExport MagickWand *MagickGetImage(MagickWand *wand)
3398 assert(wand != (MagickWand *) NULL);
3399 assert(wand->signature == WandSignature);
3400 if (wand->debug != MagickFalse)
3401 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3402 if (wand->images == (Image *) NULL)
3404 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3405 "ContainsNoImages","`%s'",wand->name);
3406 return((MagickWand *) NULL);
3408 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
3409 if (image == (Image *) NULL)
3410 return((MagickWand *) NULL);
3411 return(CloneMagickWandFromImages(wand,image));
3415 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3419 % 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 %
3423 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3425 % MagickGetImageAlphaChannel() returns MagickFalse if the image alpha channel
3426 % is not activated. That is, the image is RGB rather than RGBA or CMYK rather
3429 % The format of the MagickGetImageAlphaChannel method is:
3431 % size_t MagickGetImageAlphaChannel(MagickWand *wand)
3433 % A description of each parameter follows:
3435 % o wand: the magick wand.
3438 WandExport MagickBooleanType MagickGetImageAlphaChannel(MagickWand *wand)
3440 assert(wand != (MagickWand *) NULL);
3441 assert(wand->signature == WandSignature);
3442 if (wand->debug != MagickFalse)
3443 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3444 if (wand->images == (Image *) NULL)
3445 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3446 return(GetImageAlphaChannel(wand->images));
3450 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3454 % M a g i c k G e t I m a g e C l i p M a s k %
3458 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3460 % MagickGetImageClipMask() gets the image clip mask at the current image index.
3462 % The format of the MagickGetImageClipMask method is:
3464 % MagickWand *MagickGetImageClipMask(MagickWand *wand)
3466 % A description of each parameter follows:
3468 % o wand: the magick wand.
3471 WandExport MagickWand *MagickGetImageClipMask(MagickWand *wand)
3476 assert(wand != (MagickWand *) NULL);
3477 assert(wand->signature == WandSignature);
3478 if (wand->debug != MagickFalse)
3479 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3480 if (wand->images == (Image *) NULL)
3482 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3483 "ContainsNoImages","`%s'",wand->name);
3484 return((MagickWand *) NULL);
3486 image=GetImageClipMask(wand->images,wand->exception);
3487 if (image == (Image *) NULL)
3488 return((MagickWand *) NULL);
3489 return(CloneMagickWandFromImages(wand,image));
3493 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3497 % 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 %
3501 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3503 % MagickGetImageBackgroundColor() returns the image background color.
3505 % The format of the MagickGetImageBackgroundColor method is:
3507 % MagickBooleanType MagickGetImageBackgroundColor(MagickWand *wand,
3508 % PixelWand *background_color)
3510 % A description of each parameter follows:
3512 % o wand: the magick wand.
3514 % o background_color: Return the background color.
3517 WandExport MagickBooleanType MagickGetImageBackgroundColor(MagickWand *wand,
3518 PixelWand *background_color)
3520 assert(wand != (MagickWand *) NULL);
3521 assert(wand->signature == WandSignature);
3522 if (wand->debug != MagickFalse)
3523 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3524 if (wand->images == (Image *) NULL)
3525 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3526 PixelSetQuantumPacket(background_color,&wand->images->background_color);
3531 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3535 % M a g i c k G e t I m a g e B l o b %
3539 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3541 % MagickGetImageBlob() implements direct to memory image formats. It returns
3542 % the image as a blob (a formatted "file" in memory) and its length, starting
3543 % from the current position in the image sequence. Use MagickSetImageFormat()
3544 % to set the format to write to the blob (GIF, JPEG, PNG, etc.).
3546 % Utilize MagickResetIterator() to ensure the write is from the beginning of
3547 % the image sequence.
3549 % Use MagickRelinquishMemory() to free the blob when you are done with it.
3551 % The format of the MagickGetImageBlob method is:
3553 % unsigned char *MagickGetImageBlob(MagickWand *wand,size_t *length)
3555 % A description of each parameter follows:
3557 % o wand: the magick wand.
3559 % o length: the length of the blob.
3562 WandExport unsigned char *MagickGetImageBlob(MagickWand *wand,size_t *length)
3564 assert(wand != (MagickWand *) NULL);
3565 assert(wand->signature == WandSignature);
3566 if (wand->debug != MagickFalse)
3567 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3568 if (wand->images == (Image *) NULL)
3570 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3571 "ContainsNoImages","`%s'",wand->name);
3572 return((unsigned char *) NULL);
3574 return(ImageToBlob(wand->image_info,wand->images,length,wand->exception));
3578 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3582 % M a g i c k G e t I m a g e s B l o b %
3586 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3588 % MagickGetImageBlob() implements direct to memory image formats. It
3589 % returns the image sequence as a blob and its length. The format of the image
3590 % determines the format of the returned blob (GIF, JPEG, PNG, etc.). To
3591 % return a different image format, use MagickSetImageFormat().
3593 % Note, some image formats do not permit multiple images to the same image
3594 % stream (e.g. JPEG). in this instance, just the first image of the
3595 % sequence is returned as a blob.
3597 % The format of the MagickGetImagesBlob method is:
3599 % unsigned char *MagickGetImagesBlob(MagickWand *wand,size_t *length)
3601 % A description of each parameter follows:
3603 % o wand: the magick wand.
3605 % o length: the length of the blob.
3608 WandExport unsigned char *MagickGetImagesBlob(MagickWand *wand,size_t *length)
3613 assert(wand != (MagickWand *) NULL);
3614 assert(wand->signature == WandSignature);
3615 if (wand->debug != MagickFalse)
3616 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3617 if (wand->images == (Image *) NULL)
3619 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3620 "ContainsNoImages","`%s'",wand->name);
3621 return((unsigned char *) NULL);
3623 blob=ImagesToBlob(wand->image_info,GetFirstImageInList(wand->images),length,
3629 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3633 % 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 %
3637 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3639 % MagickGetImageBluePrimary() returns the chromaticy blue primary point for the
3642 % The format of the MagickGetImageBluePrimary method is:
3644 % MagickBooleanType MagickGetImageBluePrimary(MagickWand *wand,double *x,
3647 % A description of each parameter follows:
3649 % o wand: the magick wand.
3651 % o x: the chromaticity blue primary x-point.
3653 % o y: the chromaticity blue primary y-point.
3656 WandExport MagickBooleanType MagickGetImageBluePrimary(MagickWand *wand,
3657 double *x,double *y)
3659 assert(wand != (MagickWand *) NULL);
3660 assert(wand->signature == WandSignature);
3661 if (wand->debug != MagickFalse)
3662 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3663 if (wand->images == (Image *) NULL)
3664 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3665 *x=wand->images->chromaticity.blue_primary.x;
3666 *y=wand->images->chromaticity.blue_primary.y;
3671 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3675 % 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 %
3679 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3681 % MagickGetImageBorderColor() returns the image border color.
3683 % The format of the MagickGetImageBorderColor method is:
3685 % MagickBooleanType MagickGetImageBorderColor(MagickWand *wand,
3686 % PixelWand *border_color)
3688 % A description of each parameter follows:
3690 % o wand: the magick wand.
3692 % o border_color: Return the border color.
3695 WandExport MagickBooleanType MagickGetImageBorderColor(MagickWand *wand,
3696 PixelWand *border_color)
3698 assert(wand != (MagickWand *) NULL);
3699 assert(wand->signature == WandSignature);
3700 if (wand->debug != MagickFalse)
3701 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3702 if (wand->images == (Image *) NULL)
3703 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3704 PixelSetQuantumPacket(border_color,&wand->images->border_color);
3709 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3713 % M a g i c k G e t I m a g e F e a t u r e s %
3717 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3719 % MagickGetImageFeatures() returns features for each channel in the
3720 % image in each of four directions (horizontal, vertical, left and right
3721 % diagonals) for the specified distance. The features include the angular
3722 % second moment, contrast, correlation, sum of squares: variance, inverse
3723 % difference moment, sum average, sum varience, sum entropy, entropy,
3724 % difference variance, difference entropy, information measures of
3725 % correlation 1, information measures of correlation 2, and maximum
3726 % correlation coefficient. You can access the red channel contrast, for
3727 % example, like this:
3729 % channel_features=MagickGetImageFeatures(wand,1);
3730 % contrast=channel_features[RedChannel].contrast[0];
3732 % Use MagickRelinquishMemory() to free the statistics buffer.
3734 % The format of the MagickGetImageFeatures method is:
3736 % ChannelFeatures *MagickGetImageFeatures(MagickWand *wand,
3737 % const size_t distance)
3739 % A description of each parameter follows:
3741 % o wand: the magick wand.
3743 % o distance: the distance.
3746 WandExport ChannelFeatures *MagickGetImageFeatures(MagickWand *wand,
3747 const size_t distance)
3749 assert(wand != (MagickWand *) NULL);
3750 assert(wand->signature == WandSignature);
3751 if (wand->debug != MagickFalse)
3752 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3753 if (wand->images == (Image *) NULL)
3755 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3756 "ContainsNoImages","`%s'",wand->name);
3757 return((ChannelFeatures *) NULL);
3759 return(GetImageFeatures(wand->images,distance,wand->exception));
3763 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3767 % M a g i c k G e t I m a g e K u r t o s i s %
3771 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3773 % MagickGetImageKurtosis() gets the kurtosis and skewness of one or
3774 % more image channels.
3776 % The format of the MagickGetImageKurtosis method is:
3778 % MagickBooleanType MagickGetImageKurtosis(MagickWand *wand,
3779 % double *kurtosis,double *skewness)
3781 % A description of each parameter follows:
3783 % o wand: the magick wand.
3785 % o kurtosis: The kurtosis for the specified channel(s).
3787 % o skewness: The skewness for the specified channel(s).
3790 WandExport MagickBooleanType MagickGetImageKurtosis(MagickWand *wand,
3791 double *kurtosis,double *skewness)
3796 assert(wand != (MagickWand *) NULL);
3797 assert(wand->signature == WandSignature);
3798 if (wand->debug != MagickFalse)
3799 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3800 if (wand->images == (Image *) NULL)
3801 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3802 status=GetImageKurtosis(wand->images,kurtosis,skewness,wand->exception);
3807 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3811 % M a g i c k G e t I m a g e M e a n %
3815 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3817 % MagickGetImageMean() gets the mean and standard deviation of one or more
3820 % The format of the MagickGetImageMean method is:
3822 % MagickBooleanType MagickGetImageMean(MagickWand *wand,double *mean,
3823 % double *standard_deviation)
3825 % A description of each parameter follows:
3827 % o wand: the magick wand.
3829 % o channel: the image channel(s).
3831 % o mean: The mean pixel value for the specified channel(s).
3833 % o standard_deviation: The standard deviation for the specified channel(s).
3836 WandExport MagickBooleanType MagickGetImageMean(MagickWand *wand,double *mean,
3837 double *standard_deviation)
3842 assert(wand != (MagickWand *) NULL);
3843 assert(wand->signature == WandSignature);
3844 if (wand->debug != MagickFalse)
3845 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3846 if (wand->images == (Image *) NULL)
3847 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3848 status=GetImageMean(wand->images,mean,standard_deviation,wand->exception);
3853 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3857 % M a g i c k G e t I m a g e R a n g e %
3861 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3863 % MagickGetImageRange() gets the range for one or more image channels.
3865 % The format of the MagickGetImageRange method is:
3867 % MagickBooleanType MagickGetImageRange(MagickWand *wand,double *minima,
3870 % A description of each parameter follows:
3872 % o wand: the magick wand.
3874 % o minima: The minimum pixel value for the specified channel(s).
3876 % o maxima: The maximum pixel value for the specified channel(s).
3879 WandExport MagickBooleanType MagickGetImageRange(MagickWand *wand,
3880 double *minima,double *maxima)
3885 assert(wand != (MagickWand *) NULL);
3886 assert(wand->signature == WandSignature);
3887 if (wand->debug != MagickFalse)
3888 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3889 if (wand->images == (Image *) NULL)
3890 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3891 status=GetImageRange(wand->images,minima,maxima,wand->exception);
3896 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3900 % M a g i c k G e t I m a g e S t a t i s t i c s %
3904 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3906 % MagickGetImageStatistics() returns statistics for each channel in the
3907 % image. The statistics include the channel depth, its minima and
3908 % maxima, the mean, the standard deviation, the kurtosis and the skewness.
3909 % You can access the red channel mean, for example, like this:
3911 % channel_statistics=MagickGetImageStatistics(wand);
3912 % red_mean=channel_statistics[RedChannel].mean;
3914 % Use MagickRelinquishMemory() to free the statistics buffer.
3916 % The format of the MagickGetImageStatistics method is:
3918 % ChannelStatistics *MagickGetImageStatistics(MagickWand *wand)
3920 % A description of each parameter follows:
3922 % o wand: the magick wand.
3925 WandExport ChannelStatistics *MagickGetImageStatistics(MagickWand *wand)
3927 assert(wand != (MagickWand *) NULL);
3928 assert(wand->signature == WandSignature);
3929 if (wand->debug != MagickFalse)
3930 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3931 if (wand->images == (Image *) NULL)
3933 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3934 "ContainsNoImages","`%s'",wand->name);
3935 return((ChannelStatistics *) NULL);
3937 return(GetImageStatistics(wand->images,wand->exception));
3941 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3945 % 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 %
3949 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3951 % MagickGetImageColormapColor() returns the color of the specified colormap
3954 % The format of the MagickGetImageColormapColor method is:
3956 % MagickBooleanType MagickGetImageColormapColor(MagickWand *wand,
3957 % const size_t index,PixelWand *color)
3959 % A description of each parameter follows:
3961 % o wand: the magick wand.
3963 % o index: the offset into the image colormap.
3965 % o color: Return the colormap color in this wand.
3968 WandExport MagickBooleanType MagickGetImageColormapColor(MagickWand *wand,
3969 const size_t index,PixelWand *color)
3971 assert(wand != (MagickWand *) NULL);
3972 assert(wand->signature == WandSignature);
3973 if (wand->debug != MagickFalse)
3974 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3975 if (wand->images == (Image *) NULL)
3976 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3977 if ((wand->images->colormap == (PixelPacket *) NULL) ||
3978 (index >= wand->images->colors))
3980 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
3981 "InvalidColormapIndex","`%s'",wand->name);
3982 return(MagickFalse);
3984 PixelSetQuantumPacket(color,wand->images->colormap+index);
3989 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3993 % M a g i c k G e t I m a g e C o l o r s %
3997 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3999 % MagickGetImageColors() gets the number of unique colors in the image.
4001 % The format of the MagickGetImageColors method is:
4003 % size_t MagickGetImageColors(MagickWand *wand)
4005 % A description of each parameter follows:
4007 % o wand: the magick wand.
4010 WandExport size_t MagickGetImageColors(MagickWand *wand)
4012 assert(wand != (MagickWand *) NULL);
4013 assert(wand->signature == WandSignature);
4014 if (wand->debug != MagickFalse)
4015 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4016 if (wand->images == (Image *) NULL)
4018 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4019 "ContainsNoImages","`%s'",wand->name);
4022 return(GetNumberColors(wand->images,(FILE *) NULL,wand->exception));
4026 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4030 % M a g i c k G e t I m a g e C o l o r s p a c e %
4034 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4036 % MagickGetImageColorspace() gets the image colorspace.
4038 % The format of the MagickGetImageColorspace method is:
4040 % ColorspaceType MagickGetImageColorspace(MagickWand *wand)
4042 % A description of each parameter follows:
4044 % o wand: the magick wand.
4047 WandExport ColorspaceType MagickGetImageColorspace(MagickWand *wand)
4049 assert(wand != (MagickWand *) NULL);
4050 assert(wand->signature == WandSignature);
4051 if (wand->debug != MagickFalse)
4052 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4053 if (wand->images == (Image *) NULL)
4055 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4056 "ContainsNoImages","`%s'",wand->name);
4057 return(UndefinedColorspace);
4059 return(wand->images->colorspace);
4063 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4067 % M a g i c k G e t I m a g e C o m p o s e %
4071 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4073 % MagickGetImageCompose() returns the composite operator associated with the
4076 % The format of the MagickGetImageCompose method is:
4078 % CompositeOperator MagickGetImageCompose(MagickWand *wand)
4080 % A description of each parameter follows:
4082 % o wand: the magick wand.
4085 WandExport CompositeOperator MagickGetImageCompose(MagickWand *wand)
4087 assert(wand != (MagickWand *) NULL);
4088 assert(wand->signature == WandSignature);
4089 if (wand->debug != MagickFalse)
4090 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4091 if (wand->images == (Image *) NULL)
4093 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4094 "ContainsNoImages","`%s'",wand->name);
4095 return(UndefinedCompositeOp);
4097 return(wand->images->compose);
4101 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4105 % 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 %
4109 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4111 % MagickGetImageCompression() gets the image compression.
4113 % The format of the MagickGetImageCompression method is:
4115 % CompressionType MagickGetImageCompression(MagickWand *wand)
4117 % A description of each parameter follows:
4119 % o wand: the magick wand.
4122 WandExport CompressionType MagickGetImageCompression(MagickWand *wand)
4124 assert(wand != (MagickWand *) NULL);
4125 assert(wand->signature == WandSignature);
4126 if (wand->debug != MagickFalse)
4127 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4128 if (wand->images == (Image *) NULL)
4130 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4131 "ContainsNoImages","`%s'",wand->name);
4132 return(UndefinedCompression);
4134 return(wand->images->compression);
4138 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4142 % 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 %
4146 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4148 % MagickGetImageCompression() gets the image compression quality.
4150 % The format of the MagickGetImageCompression method is:
4152 % size_t MagickGetImageCompression(MagickWand *wand)
4154 % A description of each parameter follows:
4156 % o wand: the magick wand.
4159 WandExport size_t MagickGetImageCompressionQuality(MagickWand *wand)
4161 assert(wand != (MagickWand *) NULL);
4162 assert(wand->signature == WandSignature);
4163 if (wand->debug != MagickFalse)
4164 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4165 if (wand->images == (Image *) NULL)
4167 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4168 "ContainsNoImages","`%s'",wand->name);
4171 return(wand->images->quality);
4175 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4179 % M a g i c k G e t I m a g e D e l a y %
4183 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4185 % MagickGetImageDelay() gets the image delay.
4187 % The format of the MagickGetImageDelay method is:
4189 % size_t MagickGetImageDelay(MagickWand *wand)
4191 % A description of each parameter follows:
4193 % o wand: the magick wand.
4196 WandExport size_t MagickGetImageDelay(MagickWand *wand)
4198 assert(wand != (MagickWand *) NULL);
4199 assert(wand->signature == WandSignature);
4200 if (wand->debug != MagickFalse)
4201 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4202 if (wand->images == (Image *) NULL)
4203 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4204 return(wand->images->delay);
4208 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4212 % M a g i c k G e t I m a g e D e p t h %
4216 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4218 % MagickGetImageDepth() gets the image depth.
4220 % The format of the MagickGetImageDepth method is:
4222 % size_t MagickGetImageDepth(MagickWand *wand)
4224 % A description of each parameter follows:
4226 % o wand: the magick wand.
4229 WandExport size_t MagickGetImageDepth(MagickWand *wand)
4231 assert(wand != (MagickWand *) NULL);
4232 assert(wand->signature == WandSignature);
4233 if (wand->debug != MagickFalse)
4234 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4235 if (wand->images == (Image *) NULL)
4236 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4237 return(GetImageDepth(wand->images,wand->exception));
4241 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4245 % M a g i c k G e t I m a g e D i s p o s e %
4249 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4251 % MagickGetImageDispose() gets the image disposal method.
4253 % The format of the MagickGetImageDispose method is:
4255 % DisposeType MagickGetImageDispose(MagickWand *wand)
4257 % A description of each parameter follows:
4259 % o wand: the magick wand.
4262 WandExport DisposeType MagickGetImageDispose(MagickWand *wand)
4264 assert(wand != (MagickWand *) NULL);
4265 assert(wand->signature == WandSignature);
4266 if (wand->debug != MagickFalse)
4267 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4268 if (wand->images == (Image *) NULL)
4270 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4271 "ContainsNoImages","`%s'",wand->name);
4272 return(UndefinedDispose);
4274 return((DisposeType) wand->images->dispose);
4278 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4282 % M a g i c k G e t I m a g e D i s t o r t i o n %
4286 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4288 % MagickGetImageDistortion() compares an image to a reconstructed image and
4289 % returns the specified distortion metric.
4291 % The format of the MagickGetImageDistortion method is:
4293 % MagickBooleanType MagickGetImageDistortion(MagickWand *wand,
4294 % const MagickWand *reference,const MetricType metric,
4295 % double *distortion)
4297 % A description of each parameter follows:
4299 % o wand: the magick wand.
4301 % o reference: the reference wand.
4303 % o metric: the metric.
4305 % o distortion: the computed distortion between the images.
4308 WandExport MagickBooleanType MagickGetImageDistortion(MagickWand *wand,
4309 const MagickWand *reference,const MetricType metric,double *distortion)
4314 assert(wand != (MagickWand *) NULL);
4315 assert(wand->signature == WandSignature);
4316 if (wand->debug != MagickFalse)
4317 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4318 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
4319 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4320 status=GetImageDistortion(wand->images,reference->images,metric,distortion,
4321 &wand->images->exception);
4326 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4330 % 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 %
4334 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4336 % MagickGetImageDistortions() compares one or more pixel channels of an
4337 % image to a reconstructed image and returns the specified distortion metrics.
4339 % Use MagickRelinquishMemory() to free the metrics when you are done with them.
4341 % The format of the MagickGetImageDistortion method is:
4343 % double *MagickGetImageDistortion(MagickWand *wand,
4344 % const MagickWand *reference,const MetricType metric)
4346 % A description of each parameter follows:
4348 % o wand: the magick wand.
4350 % o reference: the reference wand.
4352 % o metric: the metric.
4355 WandExport double *MagickGetImageDistortions(MagickWand *wand,
4356 const MagickWand *reference,const MetricType metric)
4359 *channel_distortion;
4361 assert(wand != (MagickWand *) NULL);
4362 assert(wand->signature == WandSignature);
4363 if (wand->debug != MagickFalse)
4364 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4365 assert(reference != (MagickWand *) NULL);
4366 assert(reference->signature == WandSignature);
4367 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
4369 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4370 "ContainsNoImages","`%s'",wand->name);
4371 return((double *) NULL);
4373 channel_distortion=GetImageDistortions(wand->images,reference->images,
4374 metric,&wand->images->exception);
4375 return(channel_distortion);
4379 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4383 % M a g i c k G e t I m a g e F i l e n a m e %
4387 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4389 % MagickGetImageFilename() returns the filename of a particular image in a
4392 % The format of the MagickGetImageFilename method is:
4394 % char *MagickGetImageFilename(MagickWand *wand)
4396 % A description of each parameter follows:
4398 % o wand: the magick wand.
4401 WandExport char *MagickGetImageFilename(MagickWand *wand)
4403 assert(wand != (MagickWand *) NULL);
4404 assert(wand->signature == WandSignature);
4405 if (wand->debug != MagickFalse)
4406 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4407 if (wand->images == (Image *) NULL)
4409 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4410 "ContainsNoImages","`%s'",wand->name);
4411 return((char *) NULL);
4413 return(AcquireString(wand->images->filename));
4417 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4421 % M a g i c k G e t I m a g e F o r m a t %
4425 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4427 % MagickGetImageFormat() returns the format of a particular image in a
4430 % The format of the MagickGetImageFormat method is:
4432 % const char *MagickGetImageFormat(MagickWand *wand)
4434 % A description of each parameter follows:
4436 % o wand: the magick wand.
4439 WandExport char *MagickGetImageFormat(MagickWand *wand)
4441 assert(wand != (MagickWand *) NULL);
4442 assert(wand->signature == WandSignature);
4443 if (wand->debug != MagickFalse)
4444 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4445 if (wand->images == (Image *) NULL)
4447 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4448 "ContainsNoImages","`%s'",wand->name);
4449 return((char *) NULL);
4451 return(AcquireString(wand->images->magick));
4455 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4459 % M a g i c k G e t I m a g e F u z z %
4463 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4465 % MagickGetImageFuzz() gets the image fuzz.
4467 % The format of the MagickGetImageFuzz method is:
4469 % double MagickGetImageFuzz(MagickWand *wand)
4471 % A description of each parameter follows:
4473 % o wand: the magick wand.
4476 WandExport double MagickGetImageFuzz(MagickWand *wand)
4478 assert(wand != (MagickWand *) NULL);
4479 assert(wand->signature == WandSignature);
4480 if (wand->debug != MagickFalse)
4481 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4482 if (wand->images == (Image *) NULL)
4484 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4485 "ContainsNoImages","`%s'",wand->name);
4488 return(wand->images->fuzz);
4492 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4496 % M a g i c k G e t I m a g e G a m m a %
4500 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4502 % MagickGetImageGamma() gets the image gamma.
4504 % The format of the MagickGetImageGamma method is:
4506 % double MagickGetImageGamma(MagickWand *wand)
4508 % A description of each parameter follows:
4510 % o wand: the magick wand.
4513 WandExport double MagickGetImageGamma(MagickWand *wand)
4515 assert(wand != (MagickWand *) NULL);
4516 assert(wand->signature == WandSignature);
4517 if (wand->debug != MagickFalse)
4518 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4519 if (wand->images == (Image *) NULL)
4521 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4522 "ContainsNoImages","`%s'",wand->name);
4525 return(wand->images->gamma);
4529 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4533 % 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 %
4537 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4539 % MagickGetImageGravity() gets the image gravity.
4541 % The format of the MagickGetImageGravity method is:
4543 % GravityType MagickGetImageGravity(MagickWand *wand)
4545 % A description of each parameter follows:
4547 % o wand: the magick wand.
4550 WandExport GravityType MagickGetImageGravity(MagickWand *wand)
4552 assert(wand != (MagickWand *) NULL);
4553 assert(wand->signature == WandSignature);
4554 if (wand->debug != MagickFalse)
4555 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4556 if (wand->images == (Image *) NULL)
4558 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4559 "ContainsNoImages","`%s'",wand->name);
4560 return(UndefinedGravity);
4562 return(wand->images->gravity);
4566 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4570 % 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 %
4574 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4576 % MagickGetImageGreenPrimary() returns the chromaticy green primary point.
4578 % The format of the MagickGetImageGreenPrimary method is:
4580 % MagickBooleanType MagickGetImageGreenPrimary(MagickWand *wand,double *x,
4583 % A description of each parameter follows:
4585 % o wand: the magick wand.
4587 % o x: the chromaticity green primary x-point.
4589 % o y: the chromaticity green primary y-point.
4592 WandExport MagickBooleanType MagickGetImageGreenPrimary(MagickWand *wand,
4593 double *x,double *y)
4595 assert(wand != (MagickWand *) NULL);
4596 assert(wand->signature == WandSignature);
4597 if (wand->debug != MagickFalse)
4598 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4599 if (wand->images == (Image *) NULL)
4600 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4601 *x=wand->images->chromaticity.green_primary.x;
4602 *y=wand->images->chromaticity.green_primary.y;
4607 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4611 % M a g i c k G e t I m a g e H e i g h t %
4615 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4617 % MagickGetImageHeight() returns the image height.
4619 % The format of the MagickGetImageHeight method is:
4621 % size_t MagickGetImageHeight(MagickWand *wand)
4623 % A description of each parameter follows:
4625 % o wand: the magick wand.
4628 WandExport size_t MagickGetImageHeight(MagickWand *wand)
4630 assert(wand != (MagickWand *) NULL);
4631 assert(wand->signature == WandSignature);
4632 if (wand->debug != MagickFalse)
4633 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4634 if (wand->images == (Image *) NULL)
4635 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4636 return(wand->images->rows);
4640 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4644 % M a g i c k G e t I m a g e H i s t o g r a m %
4648 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4650 % MagickGetImageHistogram() returns the image histogram as an array of
4653 % The format of the MagickGetImageHistogram method is:
4655 % PixelWand **MagickGetImageHistogram(MagickWand *wand,
4656 % size_t *number_colors)
4658 % A description of each parameter follows:
4660 % o wand: the magick wand.
4662 % o number_colors: the number of unique colors in the image and the number
4663 % of pixel wands returned.
4666 WandExport PixelWand **MagickGetImageHistogram(MagickWand *wand,
4667 size_t *number_colors)
4678 assert(wand != (MagickWand *) NULL);
4679 assert(wand->signature == WandSignature);
4680 if (wand->debug != MagickFalse)
4681 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4682 if (wand->images == (Image *) NULL)
4684 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4685 "ContainsNoImages","`%s'",wand->name);
4686 return((PixelWand **) NULL);
4688 histogram=GetImageHistogram(wand->images,number_colors,wand->exception);
4689 if (histogram == (PixelPacket *) NULL)
4690 return((PixelWand **) NULL);
4691 pixel_wands=NewPixelWands(*number_colors);
4692 for (i=0; i < (ssize_t) *number_colors; i++)
4694 PixelSetQuantumPacket(pixel_wands[i],&histogram[i]);
4695 PixelSetColorCount(pixel_wands[i],(size_t) histogram[i].count);
4697 histogram=(PixelPacket *) RelinquishMagickMemory(histogram);
4698 return(pixel_wands);
4702 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4706 % 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 %
4710 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4712 % MagickGetImageInterlaceScheme() gets the image interlace scheme.
4714 % The format of the MagickGetImageInterlaceScheme method is:
4716 % InterlaceType MagickGetImageInterlaceScheme(MagickWand *wand)
4718 % A description of each parameter follows:
4720 % o wand: the magick wand.
4723 WandExport InterlaceType MagickGetImageInterlaceScheme(MagickWand *wand)
4725 assert(wand != (MagickWand *) NULL);
4726 assert(wand->signature == WandSignature);
4727 if (wand->debug != MagickFalse)
4728 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4729 if (wand->images == (Image *) NULL)
4731 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4732 "ContainsNoImages","`%s'",wand->name);
4733 return(UndefinedInterlace);
4735 return(wand->images->interlace);
4739 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4743 % 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 %
4747 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4749 % MagickGetImageInterpolateMethod() returns the interpolation method for the
4752 % The format of the MagickGetImageInterpolateMethod method is:
4754 % InterpolatePixelMethod MagickGetImageInterpolateMethod(MagickWand *wand)
4756 % A description of each parameter follows:
4758 % o wand: the magick wand.
4761 WandExport InterpolatePixelMethod MagickGetImageInterpolateMethod(
4764 assert(wand != (MagickWand *) NULL);
4765 assert(wand->signature == WandSignature);
4766 if (wand->debug != MagickFalse)
4767 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4768 if (wand->images == (Image *) NULL)
4770 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4771 "ContainsNoImages","`%s'",wand->name);
4772 return(UndefinedInterpolatePixel);
4774 return(wand->images->interpolate);
4778 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4782 % M a g i c k G e t I m a g e I t e r a t i o n s %
4786 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4788 % MagickGetImageIterations() gets the image iterations.
4790 % The format of the MagickGetImageIterations method is:
4792 % size_t MagickGetImageIterations(MagickWand *wand)
4794 % A description of each parameter follows:
4796 % o wand: the magick wand.
4799 WandExport size_t MagickGetImageIterations(MagickWand *wand)
4801 assert(wand != (MagickWand *) NULL);
4802 assert(wand->signature == WandSignature);
4803 if (wand->debug != MagickFalse)
4804 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4805 if (wand->images == (Image *) NULL)
4806 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4807 return(wand->images->iterations);
4811 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4815 % M a g i c k G e t I m a g e L e n g t h %
4819 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4821 % MagickGetImageLength() returns the image length in bytes.
4823 % The format of the MagickGetImageLength method is:
4825 % MagickBooleanType MagickGetImageLength(MagickWand *wand,
4826 % MagickSizeType *length)
4828 % A description of each parameter follows:
4830 % o wand: the magick wand.
4832 % o length: the image length in bytes.
4835 WandExport MagickBooleanType MagickGetImageLength(MagickWand *wand,
4836 MagickSizeType *length)
4838 assert(wand != (MagickWand *) NULL);
4839 assert(wand->signature == WandSignature);
4840 if (wand->debug != MagickFalse)
4841 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4842 if (wand->images == (Image *) NULL)
4843 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4844 *length=GetBlobSize(wand->images);
4849 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4853 % M a g i c k G e t I m a g e M a t t e C o l o r %
4857 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4859 % MagickGetImageMatteColor() returns the image matte color.
4861 % The format of the MagickGetImageMatteColor method is:
4863 % MagickBooleanType MagickGetImagematteColor(MagickWand *wand,
4864 % PixelWand *matte_color)
4866 % A description of each parameter follows:
4868 % o wand: the magick wand.
4870 % o matte_color: Return the matte color.
4873 WandExport MagickBooleanType MagickGetImageMatteColor(MagickWand *wand,
4874 PixelWand *matte_color)
4876 assert(wand != (MagickWand *) NULL);
4877 assert(wand->signature == WandSignature);
4878 if (wand->debug != MagickFalse)
4879 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4880 if (wand->images == (Image *) NULL)
4881 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4882 PixelSetQuantumPacket(matte_color,&wand->images->matte_color);
4887 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4891 % 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 %
4895 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4897 % MagickGetImageOrientation() returns the image orientation.
4899 % The format of the MagickGetImageOrientation method is:
4901 % OrientationType MagickGetImageOrientation(MagickWand *wand)
4903 % A description of each parameter follows:
4905 % o wand: the magick wand.
4908 WandExport OrientationType MagickGetImageOrientation(MagickWand *wand)
4910 assert(wand != (MagickWand *) NULL);
4911 assert(wand->signature == WandSignature);
4912 if (wand->debug != MagickFalse)
4913 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4914 if (wand->images == (Image *) NULL)
4916 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4917 "ContainsNoImages","`%s'",wand->name);
4918 return(UndefinedOrientation);
4920 return(wand->images->orientation);
4924 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4928 % M a g i c k G e t I m a g e P a g e %
4932 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4934 % MagickGetImagePage() returns the page geometry associated with the image.
4936 % The format of the MagickGetImagePage method is:
4938 % MagickBooleanType MagickGetImagePage(MagickWand *wand,
4939 % size_t *width,size_t *height,ssize_t *x,ssize_t *y)
4941 % A description of each parameter follows:
4943 % o wand: the magick wand.
4945 % o width: the page width.
4947 % o height: the page height.
4949 % o x: the page x-offset.
4951 % o y: the page y-offset.
4954 WandExport MagickBooleanType MagickGetImagePage(MagickWand *wand,
4955 size_t *width,size_t *height,ssize_t *x,ssize_t *y)
4957 assert(wand != (const MagickWand *) NULL);
4958 assert(wand->signature == WandSignature);
4959 if (wand->debug != MagickFalse)
4960 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4961 if (wand->images == (Image *) NULL)
4962 ThrowWandException(WandError,"ContainsNoImages",wand->name);
4963 *width=wand->images->page.width;
4964 *height=wand->images->page.height;
4965 *x=wand->images->page.x;
4966 *y=wand->images->page.y;
4971 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4975 % M a g i c k G e t I m a g e P i x e l C o l o r %
4979 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4981 % MagickGetImagePixelColor() returns the color of the specified pixel.
4983 % The format of the MagickGetImagePixelColor method is:
4985 % MagickBooleanType MagickGetImagePixelColor(MagickWand *wand,
4986 % const ssize_t x,const ssize_t y,PixelWand *color)
4988 % A description of each parameter follows:
4990 % o wand: the magick wand.
4992 % o x,y: the pixel offset into the image.
4994 % o color: Return the colormap color in this wand.
4997 WandExport MagickBooleanType MagickGetImagePixelColor(MagickWand *wand,
4998 const ssize_t x,const ssize_t y,PixelWand *color)
5000 register const Quantum
5006 assert(wand != (MagickWand *) NULL);
5007 assert(wand->signature == WandSignature);
5008 if (wand->debug != MagickFalse)
5009 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5010 if (wand->images == (Image *) NULL)
5011 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5012 image_view=AcquireCacheView(wand->images);
5013 p=GetCacheViewVirtualPixels(image_view,x,y,1,1,wand->exception);
5014 if (p == (const Quantum *) NULL)
5016 image_view=DestroyCacheView(image_view);
5017 return(MagickFalse);
5019 PixelSetQuantumPixel(wand->images,p,color);
5020 image_view=DestroyCacheView(image_view);
5025 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5029 % M a g i c k G e t I m a g e R e d P r i m a r y %
5033 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5035 % MagickGetImageRedPrimary() returns the chromaticy red primary point.
5037 % The format of the MagickGetImageRedPrimary method is:
5039 % MagickBooleanType MagickGetImageRedPrimary(MagickWand *wand,double *x,
5042 % A description of each parameter follows:
5044 % o wand: the magick wand.
5046 % o x: the chromaticity red primary x-point.
5048 % o y: the chromaticity red primary y-point.
5051 WandExport MagickBooleanType MagickGetImageRedPrimary(MagickWand *wand,
5052 double *x,double *y)
5054 assert(wand != (MagickWand *) NULL);
5055 assert(wand->signature == WandSignature);
5056 if (wand->debug != MagickFalse)
5057 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5058 if (wand->images == (Image *) NULL)
5059 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5060 *x=wand->images->chromaticity.red_primary.x;
5061 *y=wand->images->chromaticity.red_primary.y;
5066 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5070 % M a g i c k G e t I m a g e R e g i o n %
5074 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5076 % MagickGetImageRegion() extracts a region of the image and returns it as a
5079 % The format of the MagickGetImageRegion method is:
5081 % MagickWand *MagickGetImageRegion(MagickWand *wand,
5082 % const size_t width,const size_t height,const ssize_t x,
5085 % A description of each parameter follows:
5087 % o wand: the magick wand.
5089 % o width: the region width.
5091 % o height: the region height.
5093 % o x: the region x offset.
5095 % o y: the region y offset.
5098 WandExport MagickWand *MagickGetImageRegion(MagickWand *wand,
5099 const size_t width,const size_t height,const ssize_t x,
5108 assert(wand != (MagickWand *) NULL);
5109 assert(wand->signature == WandSignature);
5110 if (wand->debug != MagickFalse)
5111 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5112 if (wand->images == (Image *) NULL)
5113 return((MagickWand *) NULL);
5115 region.height=height;
5118 region_image=CropImage(wand->images,®ion,wand->exception);
5119 if (region_image == (Image *) NULL)
5120 return((MagickWand *) NULL);
5121 return(CloneMagickWandFromImages(wand,region_image));
5125 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5129 % 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 %
5133 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5135 % MagickGetImageRenderingIntent() gets the image rendering intent.
5137 % The format of the MagickGetImageRenderingIntent method is:
5139 % RenderingIntent MagickGetImageRenderingIntent(MagickWand *wand)
5141 % A description of each parameter follows:
5143 % o wand: the magick wand.
5146 WandExport RenderingIntent MagickGetImageRenderingIntent(MagickWand *wand)
5148 assert(wand != (MagickWand *) NULL);
5149 assert(wand->signature == WandSignature);
5150 if (wand->debug != MagickFalse)
5151 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5152 if (wand->images == (Image *) NULL)
5154 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5155 "ContainsNoImages","`%s'",wand->name);
5156 return(UndefinedIntent);
5158 return((RenderingIntent) wand->images->rendering_intent);
5162 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5166 % M a g i c k G e t I m a g e R e s o l u t i o n %
5170 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5172 % MagickGetImageResolution() gets the image X and Y resolution.
5174 % The format of the MagickGetImageResolution method is:
5176 % MagickBooleanType MagickGetImageResolution(MagickWand *wand,double *x,
5179 % A description of each parameter follows:
5181 % o wand: the magick wand.
5183 % o x: the image x-resolution.
5185 % o y: the image y-resolution.
5188 WandExport MagickBooleanType MagickGetImageResolution(MagickWand *wand,
5189 double *x,double *y)
5191 assert(wand != (MagickWand *) NULL);
5192 assert(wand->signature == WandSignature);
5193 if (wand->debug != MagickFalse)
5194 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5195 if (wand->images == (Image *) NULL)
5196 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5197 *x=wand->images->x_resolution;
5198 *y=wand->images->y_resolution;
5203 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5207 % M a g i c k G e t I m a g e S c e n e %
5211 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5213 % MagickGetImageScene() gets the image scene.
5215 % The format of the MagickGetImageScene method is:
5217 % size_t MagickGetImageScene(MagickWand *wand)
5219 % A description of each parameter follows:
5221 % o wand: the magick wand.
5224 WandExport size_t MagickGetImageScene(MagickWand *wand)
5226 assert(wand != (MagickWand *) NULL);
5227 assert(wand->signature == WandSignature);
5228 if (wand->debug != MagickFalse)
5229 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5230 if (wand->images == (Image *) NULL)
5231 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5232 return(wand->images->scene);
5236 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5240 % M a g i c k G e t I m a g e S i g n a t u r e %
5244 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5246 % MagickGetImageSignature() generates an SHA-256 message digest for the image
5249 % The format of the MagickGetImageSignature method is:
5251 % const char MagickGetImageSignature(MagickWand *wand)
5253 % A description of each parameter follows:
5255 % o wand: the magick wand.
5258 WandExport char *MagickGetImageSignature(MagickWand *wand)
5266 assert(wand != (MagickWand *) NULL);
5267 assert(wand->signature == WandSignature);
5268 if (wand->debug != MagickFalse)
5269 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5270 if (wand->images == (Image *) NULL)
5272 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5273 "ContainsNoImages","`%s'",wand->name);
5274 return((char *) NULL);
5276 status=SignatureImage(wand->images);
5277 if (status == MagickFalse)
5278 InheritException(wand->exception,&wand->images->exception);
5279 value=GetImageProperty(wand->images,"signature");
5280 if (value != (const char *) NULL)
5281 return(AcquireString(value));
5282 InheritException(wand->exception,&wand->images->exception);
5283 return((char *) NULL);
5287 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5291 % 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 %
5295 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5297 % MagickGetImageTicksPerSecond() gets the image ticks-per-second.
5299 % The format of the MagickGetImageTicksPerSecond method is:
5301 % size_t MagickGetImageTicksPerSecond(MagickWand *wand)
5303 % A description of each parameter follows:
5305 % o wand: the magick wand.
5308 WandExport size_t MagickGetImageTicksPerSecond(MagickWand *wand)
5310 assert(wand != (MagickWand *) NULL);
5311 assert(wand->signature == WandSignature);
5312 if (wand->debug != MagickFalse)
5313 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5314 if (wand->images == (Image *) NULL)
5315 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5316 return((size_t) wand->images->ticks_per_second);
5320 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5324 % M a g i c k G e t I m a g e T y p e %
5328 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5330 % MagickGetImageType() gets the potential image type:
5332 % Bilevel Grayscale GrayscaleMatte
5333 % Palette PaletteMatte TrueColor
5334 % TrueColorMatte ColorSeparation ColorSeparationMatte
5336 % To ensure the image type matches its potential, use MagickSetImageType():
5338 % (void) MagickSetImageType(wand,MagickGetImageType(wand));
5340 % The format of the MagickGetImageType method is:
5342 % ImageType MagickGetImageType(MagickWand *wand)
5344 % A description of each parameter follows:
5346 % o wand: the magick wand.
5349 WandExport ImageType MagickGetImageType(MagickWand *wand)
5351 assert(wand != (MagickWand *) NULL);
5352 assert(wand->signature == WandSignature);
5353 if (wand->debug != MagickFalse)
5354 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5355 if (wand->images == (Image *) NULL)
5357 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5358 "ContainsNoImages","`%s'",wand->name);
5359 return(UndefinedType);
5361 return(GetImageType(wand->images,wand->exception));
5365 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5369 % M a g i c k G e t I m a g e U n i t s %
5373 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5375 % MagickGetImageUnits() gets the image units of resolution.
5377 % The format of the MagickGetImageUnits method is:
5379 % ResolutionType MagickGetImageUnits(MagickWand *wand)
5381 % A description of each parameter follows:
5383 % o wand: the magick wand.
5386 WandExport ResolutionType MagickGetImageUnits(MagickWand *wand)
5388 assert(wand != (MagickWand *) NULL);
5389 assert(wand->signature == WandSignature);
5390 if (wand->debug != MagickFalse)
5391 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5392 if (wand->images == (Image *) NULL)
5394 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5395 "ContainsNoImages","`%s'",wand->name);
5396 return(UndefinedResolution);
5398 return(wand->images->units);
5402 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5406 % 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 %
5410 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5412 % MagickGetImageVirtualPixelMethod() returns the virtual pixel method for the
5415 % The format of the MagickGetImageVirtualPixelMethod method is:
5417 % VirtualPixelMethod MagickGetImageVirtualPixelMethod(MagickWand *wand)
5419 % A description of each parameter follows:
5421 % o wand: the magick wand.
5424 WandExport VirtualPixelMethod MagickGetImageVirtualPixelMethod(MagickWand *wand)
5426 assert(wand != (MagickWand *) NULL);
5427 assert(wand->signature == WandSignature);
5428 if (wand->debug != MagickFalse)
5429 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5430 if (wand->images == (Image *) NULL)
5432 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5433 "ContainsNoImages","`%s'",wand->name);
5434 return(UndefinedVirtualPixelMethod);
5436 return(GetImageVirtualPixelMethod(wand->images));
5440 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5444 % M a g i c k G e t I m a g e W h i t e P o i n t %
5448 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5450 % MagickGetImageWhitePoint() returns the chromaticy white point.
5452 % The format of the MagickGetImageWhitePoint method is:
5454 % MagickBooleanType MagickGetImageWhitePoint(MagickWand *wand,double *x,
5457 % A description of each parameter follows:
5459 % o wand: the magick wand.
5461 % o x: the chromaticity white x-point.
5463 % o y: the chromaticity white y-point.
5466 WandExport MagickBooleanType MagickGetImageWhitePoint(MagickWand *wand,
5467 double *x,double *y)
5469 assert(wand != (MagickWand *) NULL);
5470 assert(wand->signature == WandSignature);
5471 if (wand->debug != MagickFalse)
5472 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5473 if (wand->images == (Image *) NULL)
5474 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5475 *x=wand->images->chromaticity.white_point.x;
5476 *y=wand->images->chromaticity.white_point.y;
5481 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5485 % M a g i c k G e t I m a g e W i d t h %
5489 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5491 % MagickGetImageWidth() returns the image width.
5493 % The format of the MagickGetImageWidth method is:
5495 % size_t MagickGetImageWidth(MagickWand *wand)
5497 % A description of each parameter follows:
5499 % o wand: the magick wand.
5502 WandExport size_t MagickGetImageWidth(MagickWand *wand)
5504 assert(wand != (MagickWand *) NULL);
5505 assert(wand->signature == WandSignature);
5506 if (wand->debug != MagickFalse)
5507 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5508 if (wand->images == (Image *) NULL)
5509 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5510 return(wand->images->columns);
5514 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5518 % M a g i c k G e t N u m b e r I m a g e s %
5522 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5524 % MagickGetNumberImages() returns the number of images associated with a
5527 % The format of the MagickGetNumberImages method is:
5529 % size_t MagickGetNumberImages(MagickWand *wand)
5531 % A description of each parameter follows:
5533 % o wand: the magick wand.
5536 WandExport size_t MagickGetNumberImages(MagickWand *wand)
5538 assert(wand != (MagickWand *) NULL);
5539 assert(wand->signature == WandSignature);
5540 if (wand->debug != MagickFalse)
5541 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5542 return(GetImageListLength(wand->images));
5546 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5550 % 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 %
5554 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5556 % MagickGetImageTotalInkDensity() gets the image total ink density.
5558 % The format of the MagickGetImageTotalInkDensity method is:
5560 % double MagickGetImageTotalInkDensity(MagickWand *wand)
5562 % A description of each parameter follows:
5564 % o wand: the magick wand.
5567 WandExport double MagickGetImageTotalInkDensity(MagickWand *wand)
5569 assert(wand != (MagickWand *) NULL);
5570 assert(wand->signature == WandSignature);
5571 if (wand->debug != MagickFalse)
5572 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5573 if (wand->images == (Image *) NULL)
5575 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5576 "ContainsNoImages","`%s'",wand->name);
5579 return(GetImageTotalInkDensity(wand->images));
5583 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5587 % M a g i c k H a l d C l u t I m a g e %
5591 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5593 % MagickHaldClutImage() replaces colors in the image from a Hald color lookup
5594 % table. A Hald color lookup table is a 3-dimensional color cube mapped to 2
5595 % dimensions. Create it with the HALD coder. You can apply any color
5596 % transformation to the Hald image and then use this method to apply the
5597 % transform to the image.
5599 % The format of the MagickHaldClutImage method is:
5601 % MagickBooleanType MagickHaldClutImage(MagickWand *wand,
5602 % const MagickWand *hald_wand)
5604 % A description of each parameter follows:
5606 % o wand: the magick wand.
5608 % o hald_image: the hald CLUT image.
5611 WandExport MagickBooleanType MagickHaldClutImage(MagickWand *wand,
5612 const MagickWand *hald_wand)
5617 assert(wand != (MagickWand *) NULL);
5618 assert(wand->signature == WandSignature);
5619 if (wand->debug != MagickFalse)
5620 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5621 if ((wand->images == (Image *) NULL) || (hald_wand->images == (Image *) NULL))
5622 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5623 status=HaldClutImage(wand->images,hald_wand->images,&wand->images->exception);
5628 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5632 % M a g i c k H a s N e x t I m a g e %
5636 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5638 % MagickHasNextImage() returns MagickTrue if the wand has more images when
5639 % traversing the list in the forward direction
5641 % The format of the MagickHasNextImage method is:
5643 % MagickBooleanType MagickHasNextImage(MagickWand *wand)
5645 % A description of each parameter follows:
5647 % o wand: the magick wand.
5650 WandExport MagickBooleanType MagickHasNextImage(MagickWand *wand)
5652 assert(wand != (MagickWand *) NULL);
5653 assert(wand->signature == WandSignature);
5654 if (wand->debug != MagickFalse)
5655 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5656 if (wand->images == (Image *) NULL)
5657 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5658 if (GetNextImageInList(wand->images) == (Image *) NULL)
5659 return(MagickFalse);
5664 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5668 % M a g i c k H a s P r e v i o u s I m a g e %
5672 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5674 % MagickHasPreviousImage() returns MagickTrue if the wand has more images when
5675 % traversing the list in the reverse direction
5677 % The format of the MagickHasPreviousImage method is:
5679 % MagickBooleanType MagickHasPreviousImage(MagickWand *wand)
5681 % A description of each parameter follows:
5683 % o wand: the magick wand.
5686 WandExport MagickBooleanType MagickHasPreviousImage(MagickWand *wand)
5688 assert(wand != (MagickWand *) NULL);
5689 assert(wand->signature == WandSignature);
5690 if (wand->debug != MagickFalse)
5691 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5692 if (wand->images == (Image *) NULL)
5693 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5694 if (GetPreviousImageInList(wand->images) == (Image *) NULL)
5695 return(MagickFalse);
5700 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5704 % M a g i c k I d e n t i f y I m a g e %
5708 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5710 % MagickIdentifyImage() identifies an image by printing its attributes to the
5711 % file. Attributes include the image width, height, size, and others.
5713 % The format of the MagickIdentifyImage method is:
5715 % const char *MagickIdentifyImage(MagickWand *wand)
5717 % A description of each parameter follows:
5719 % o wand: the magick wand.
5722 WandExport char *MagickIdentifyImage(MagickWand *wand)
5726 filename[MaxTextExtent];
5734 assert(wand != (MagickWand *) NULL);
5735 assert(wand->signature == WandSignature);
5736 if (wand->debug != MagickFalse)
5737 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5738 if (wand->images == (Image *) NULL)
5740 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5741 "ContainsNoImages","`%s'",wand->name);
5742 return((char *) NULL);
5744 description=(char *) NULL;
5745 unique_file=AcquireUniqueFileResource(filename);
5747 if (unique_file != -1)
5748 file=fdopen(unique_file,"wb");
5749 if ((unique_file == -1) || (file == (FILE *) NULL))
5751 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5752 "UnableToCreateTemporaryFile","`%s'",wand->name);
5753 return((char *) NULL);
5755 (void) IdentifyImage(wand->images,file,MagickTrue,wand->exception);
5756 (void) fclose(file);
5757 description=FileToString(filename,~0,wand->exception);
5758 (void) RelinquishUniqueFileResource(filename);
5759 return(description);
5763 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5767 % M a g i c k I m p l o d e I m a g e %
5771 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5773 % MagickImplodeImage() creates a new image that is a copy of an existing
5774 % one with the image pixels "implode" by the specified percentage. It
5775 % allocates the memory necessary for the new Image structure and returns a
5776 % pointer to the new image.
5778 % The format of the MagickImplodeImage method is:
5780 % MagickBooleanType MagickImplodeImage(MagickWand *wand,
5781 % const double radius)
5783 % A description of each parameter follows:
5785 % o wand: the magick wand.
5787 % o amount: Define the extent of the implosion.
5790 WandExport MagickBooleanType MagickImplodeImage(MagickWand *wand,
5791 const double amount)
5796 assert(wand != (MagickWand *) NULL);
5797 assert(wand->signature == WandSignature);
5798 if (wand->debug != MagickFalse)
5799 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5800 if (wand->images == (Image *) NULL)
5801 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5802 implode_image=ImplodeImage(wand->images,amount,wand->exception);
5803 if (implode_image == (Image *) NULL)
5804 return(MagickFalse);
5805 ReplaceImageInList(&wand->images,implode_image);
5810 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5814 % M a g i c k I m p o r t I m a g e P i x e l s %
5818 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5820 % MagickImportImagePixels() accepts pixel datand stores it in the image at the
5821 % location you specify. The method returns MagickFalse on success otherwise
5822 % MagickTrue if an error is encountered. The pixel data can be either char,
5823 % short int, int, ssize_t, float, or double in the order specified by map.
5825 % Suppose your want to upload the first scanline of a 640x480 image from
5826 % character data in red-green-blue order:
5828 % MagickImportImagePixels(wand,0,0,640,1,"RGB",CharPixel,pixels);
5830 % The format of the MagickImportImagePixels method is:
5832 % MagickBooleanType MagickImportImagePixels(MagickWand *wand,
5833 % const ssize_t x,const ssize_t y,const size_t columns,
5834 % const size_t rows,const char *map,const StorageType storage,
5835 % const void *pixels)
5837 % A description of each parameter follows:
5839 % o wand: the magick wand.
5841 % o x, y, columns, rows: These values define the perimeter of a region
5842 % of pixels you want to define.
5844 % o map: This string reflects the expected ordering of the pixel array.
5845 % It can be any combination or order of R = red, G = green, B = blue,
5846 % A = alpha (0 is transparent), O = opacity (0 is opaque), C = cyan,
5847 % Y = yellow, M = magenta, K = black, I = intensity (for grayscale),
5850 % o storage: Define the data type of the pixels. Float and double types are
5851 % expected to be normalized [0..1] otherwise [0..QuantumRange]. Choose from
5852 % these types: CharPixel, ShortPixel, IntegerPixel, LongPixel, FloatPixel,
5855 % o pixels: This array of values contain the pixel components as defined by
5856 % map and type. You must preallocate this array where the expected
5857 % length varies depending on the values of width, height, map, and type.
5860 WandExport MagickBooleanType MagickImportImagePixels(MagickWand *wand,
5861 const ssize_t x,const ssize_t y,const size_t columns,
5862 const size_t rows,const char *map,const StorageType storage,
5868 assert(wand != (MagickWand *) NULL);
5869 assert(wand->signature == WandSignature);
5870 if (wand->debug != MagickFalse)
5871 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5872 if (wand->images == (Image *) NULL)
5873 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5874 status=ImportImagePixels(wand->images,x,y,columns,rows,map,storage,pixels);
5875 if (status == MagickFalse)
5876 InheritException(wand->exception,&wand->images->exception);
5881 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5885 % 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 %
5889 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5891 % MagickInverseFourierTransformImage() implements the inverse discrete
5892 % Fourier transform (DFT) of the image either as a magnitude / phase or real /
5893 % imaginary image pair.
5895 % The format of the MagickInverseFourierTransformImage method is:
5897 % MagickBooleanType MagickInverseFourierTransformImage(
5898 % MagickWand *magnitude_wand,MagickWand *phase_wand,
5899 % const MagickBooleanType magnitude)
5901 % A description of each parameter follows:
5903 % o magnitude_wand: the magnitude or real wand.
5905 % o phase_wand: the phase or imaginary wand.
5907 % o magnitude: if true, return as magnitude / phase pair otherwise a real /
5908 % imaginary image pair.
5911 WandExport MagickBooleanType MagickInverseFourierTransformImage(
5912 MagickWand *magnitude_wand,MagickWand *phase_wand,
5913 const MagickBooleanType magnitude)
5921 assert(magnitude_wand != (MagickWand *) NULL);
5922 assert(magnitude_wand->signature == WandSignature);
5923 if (magnitude_wand->debug != MagickFalse)
5924 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",
5925 magnitude_wand->name);
5926 wand=magnitude_wand;
5927 if (magnitude_wand->images == (Image *) NULL)
5928 ThrowWandException(WandError,"ContainsNoImages",
5929 magnitude_wand->name);
5930 assert(phase_wand != (MagickWand *) NULL);
5931 assert(phase_wand->signature == WandSignature);
5932 inverse_image=InverseFourierTransformImage(magnitude_wand->images,
5933 phase_wand->images,magnitude,wand->exception);
5934 if (inverse_image == (Image *) NULL)
5935 return(MagickFalse);
5936 ReplaceImageInList(&wand->images,inverse_image);
5941 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5945 % M a g i c k L a b e l I m a g e %
5949 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5951 % MagickLabelImage() adds a label to your image.
5953 % The format of the MagickLabelImage method is:
5955 % MagickBooleanType MagickLabelImage(MagickWand *wand,const char *label)
5957 % A description of each parameter follows:
5959 % o wand: the magick wand.
5961 % o label: the image label.
5964 WandExport MagickBooleanType MagickLabelImage(MagickWand *wand,
5970 assert(wand != (MagickWand *) NULL);
5971 assert(wand->signature == WandSignature);
5972 if (wand->debug != MagickFalse)
5973 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5974 if (wand->images == (Image *) NULL)
5975 ThrowWandException(WandError,"ContainsNoImages",wand->name);
5976 status=SetImageProperty(wand->images,"label",label);
5977 if (status == MagickFalse)
5978 InheritException(wand->exception,&wand->images->exception);
5983 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5987 % M a g i c k L e v e l I m a g e %
5991 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5993 % MagickLevelImage() adjusts the levels of an image by scaling the colors
5994 % falling between specified white and black points to the full available
5995 % quantum range. The parameters provided represent the black, mid, and white
5996 % points. The black point specifies the darkest color in the image. Colors
5997 % darker than the black point are set to zero. Mid point specifies a gamma
5998 % correction to apply to the image. White point specifies the lightest color
5999 % in the image. Colors brighter than the white point are set to the maximum
6002 % The format of the MagickLevelImage method is:
6004 % MagickBooleanType MagickLevelImage(MagickWand *wand,
6005 % const double black_point,const double gamma,const double white_point)
6006 % MagickBooleanType MagickLevelImage(MagickWand *wand,
6007 % const ChannelType channel,const double black_point,const double gamma,
6008 % const double white_point)
6010 % A description of each parameter follows:
6012 % o wand: the magick wand.
6014 % o channel: Identify which channel to level: RedChannel, GreenChannel,
6016 % o black_point: the black point.
6018 % o gamma: the gamma.
6020 % o white_point: the white point.
6023 WandExport MagickBooleanType MagickLevelImage(MagickWand *wand,
6024 const double black_point,const double gamma,const double white_point)
6029 assert(wand != (MagickWand *) NULL);
6030 assert(wand->signature == WandSignature);
6031 if (wand->debug != MagickFalse)
6032 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6033 if (wand->images == (Image *) NULL)
6034 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6035 status=LevelImage(wand->images,black_point,white_point,gamma,
6036 &wand->images->exception);
6041 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6045 % M a g i c k L i n e a r S t r e t c h I m a g e %
6049 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6051 % MagickLinearStretchImage() stretches with saturation the image intensity.
6053 % You can also reduce the influence of a particular channel with a gamma
6056 % The format of the MagickLinearStretchImage method is:
6058 % MagickBooleanType MagickLinearStretchImage(MagickWand *wand,
6059 % const double black_point,const double white_point)
6061 % A description of each parameter follows:
6063 % o wand: the magick wand.
6065 % o black_point: the black point.
6067 % o white_point: the white point.
6070 WandExport MagickBooleanType MagickLinearStretchImage(MagickWand *wand,
6071 const double black_point,const double white_point)
6076 assert(wand != (MagickWand *) NULL);
6077 assert(wand->signature == WandSignature);
6078 if (wand->debug != MagickFalse)
6079 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6080 if (wand->images == (Image *) NULL)
6081 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6082 status=LinearStretchImage(wand->images,black_point,white_point,
6083 &wand->images->exception);
6088 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6092 % M a g i c k L i q u i d R e s c a l e I m a g e %
6096 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6098 % MagickLiquidRescaleImage() rescales image with seam carving.
6100 % MagickBooleanType MagickLiquidRescaleImage(MagickWand *wand,
6101 % const size_t columns,const size_t rows,
6102 % const double delta_x,const double rigidity)
6104 % A description of each parameter follows:
6106 % o wand: the magick wand.
6108 % o columns: the number of columns in the scaled image.
6110 % o rows: the number of rows in the scaled image.
6112 % o delta_x: maximum seam transversal step (0 means straight seams).
6114 % o rigidity: introduce a bias for non-straight seams (typically 0).
6117 WandExport MagickBooleanType MagickLiquidRescaleImage(MagickWand *wand,
6118 const size_t columns,const size_t rows,const double delta_x,
6119 const double rigidity)
6124 assert(wand != (MagickWand *) NULL);
6125 assert(wand->signature == WandSignature);
6126 if (wand->debug != MagickFalse)
6127 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6128 if (wand->images == (Image *) NULL)
6129 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6130 rescale_image=LiquidRescaleImage(wand->images,columns,rows,delta_x,
6131 rigidity,wand->exception);
6132 if (rescale_image == (Image *) NULL)
6133 return(MagickFalse);
6134 ReplaceImageInList(&wand->images,rescale_image);
6139 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6143 % M a g i c k M a g n i f y I m a g e %
6147 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6149 % MagickMagnifyImage() is a convenience method that scales an image
6150 % proportionally to twice its original size.
6152 % The format of the MagickMagnifyImage method is:
6154 % MagickBooleanType MagickMagnifyImage(MagickWand *wand)
6156 % A description of each parameter follows:
6158 % o wand: the magick wand.
6161 WandExport MagickBooleanType MagickMagnifyImage(MagickWand *wand)
6166 assert(wand != (MagickWand *) NULL);
6167 assert(wand->signature == WandSignature);
6168 if (wand->debug != MagickFalse)
6169 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6170 if (wand->images == (Image *) NULL)
6171 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6172 magnify_image=MagnifyImage(wand->images,wand->exception);
6173 if (magnify_image == (Image *) NULL)
6174 return(MagickFalse);
6175 ReplaceImageInList(&wand->images,magnify_image);
6180 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6184 % M a g i c k M e r g e I m a g e L a y e r s %
6188 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6190 % MagickMergeImageLayers() composes all the image layers from the current
6191 % given image onward to produce a single image of the merged layers.
6193 % The inital canvas's size depends on the given ImageLayerMethod, and is
6194 % initialized using the first images background color. The images
6195 % are then compositied onto that image in sequence using the given
6196 % composition that has been assigned to each individual image.
6198 % The format of the MagickMergeImageLayers method is:
6200 % MagickWand *MagickMergeImageLayers(MagickWand *wand,
6201 % const ImageLayerMethod method)
6203 % A description of each parameter follows:
6205 % o wand: the magick wand.
6207 % o method: the method of selecting the size of the initial canvas.
6209 % MergeLayer: Merge all layers onto a canvas just large enough
6210 % to hold all the actual images. The virtual canvas of the
6211 % first image is preserved but otherwise ignored.
6213 % FlattenLayer: Use the virtual canvas size of first image.
6214 % Images which fall outside this canvas is clipped.
6215 % This can be used to 'fill out' a given virtual canvas.
6217 % MosaicLayer: Start with the virtual canvas of the first image,
6218 % enlarging left and right edges to contain all images.
6219 % Images with negative offsets will be clipped.
6222 WandExport MagickWand *MagickMergeImageLayers(MagickWand *wand,
6223 const ImageLayerMethod method)
6228 assert(wand != (MagickWand *) NULL);
6229 assert(wand->signature == WandSignature);
6230 if (wand->debug != MagickFalse)
6231 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6232 if (wand->images == (Image *) NULL)
6233 return((MagickWand *) NULL);
6234 mosaic_image=MergeImageLayers(wand->images,method,wand->exception);
6235 if (mosaic_image == (Image *) NULL)
6236 return((MagickWand *) NULL);
6237 return(CloneMagickWandFromImages(wand,mosaic_image));
6241 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6245 % M a g i c k M i n i f y I m a g e %
6249 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6251 % MagickMinifyImage() is a convenience method that scales an image
6252 % proportionally to one-half its original size
6254 % The format of the MagickMinifyImage method is:
6256 % MagickBooleanType MagickMinifyImage(MagickWand *wand)
6258 % A description of each parameter follows:
6260 % o wand: the magick wand.
6263 WandExport MagickBooleanType MagickMinifyImage(MagickWand *wand)
6268 assert(wand != (MagickWand *) NULL);
6269 assert(wand->signature == WandSignature);
6270 if (wand->debug != MagickFalse)
6271 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6272 if (wand->images == (Image *) NULL)
6273 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6274 minify_image=MinifyImage(wand->images,wand->exception);
6275 if (minify_image == (Image *) NULL)
6276 return(MagickFalse);
6277 ReplaceImageInList(&wand->images,minify_image);
6282 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6286 % M a g i c k M o d u l a t e I m a g e %
6290 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6292 % MagickModulateImage() lets you control the brightness, saturation, and hue
6293 % of an image. Hue is the percentage of absolute rotation from the current
6294 % position. For example 50 results in a counter-clockwise rotation of 90
6295 % degrees, 150 results in a clockwise rotation of 90 degrees, with 0 and 200
6296 % both resulting in a rotation of 180 degrees.
6298 % To increase the color brightness by 20% and decrease the color saturation by
6299 % 10% and leave the hue unchanged, use: 120,90,100.
6301 % The format of the MagickModulateImage method is:
6303 % MagickBooleanType MagickModulateImage(MagickWand *wand,
6304 % const double brightness,const double saturation,const double hue)
6306 % A description of each parameter follows:
6308 % o wand: the magick wand.
6310 % o brightness: the percent change in brighness.
6312 % o saturation: the percent change in saturation.
6314 % o hue: the percent change in hue.
6317 WandExport MagickBooleanType MagickModulateImage(MagickWand *wand,
6318 const double brightness,const double saturation,const double hue)
6321 modulate[MaxTextExtent];
6326 assert(wand != (MagickWand *) NULL);
6327 assert(wand->signature == WandSignature);
6328 if (wand->debug != MagickFalse)
6329 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6330 if (wand->images == (Image *) NULL)
6331 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6332 (void) FormatLocaleString(modulate,MaxTextExtent,"%g,%g,%g",
6333 brightness,saturation,hue);
6334 status=ModulateImage(wand->images,modulate,&wand->images->exception);
6339 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6343 % M a g i c k M o n t a g e I m a g e %
6347 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6349 % MagickMontageImage() creates a composite image by combining several
6350 % separate images. The images are tiled on the composite image with the name
6351 % of the image optionally appearing just below the individual tile.
6353 % The format of the MagickMontageImage method is:
6355 % MagickWand *MagickMontageImage(MagickWand *wand,
6356 % const DrawingWand drawing_wand,const char *tile_geometry,
6357 % const char *thumbnail_geometry,const MontageMode mode,
6358 % const char *frame)
6360 % A description of each parameter follows:
6362 % o wand: the magick wand.
6364 % o drawing_wand: the drawing wand. The font name, size, and color are
6365 % obtained from this wand.
6367 % o tile_geometry: the number of tiles per row and page (e.g. 6x4+0+0).
6369 % o thumbnail_geometry: Preferred image size and border size of each
6370 % thumbnail (e.g. 120x120+4+3>).
6372 % o mode: Thumbnail framing mode: Frame, Unframe, or Concatenate.
6374 % o frame: Surround the image with an ornamental border (e.g. 15x15+3+3).
6375 % The frame color is that of the thumbnail's matte color.
6378 WandExport MagickWand *MagickMontageImage(MagickWand *wand,
6379 const DrawingWand *drawing_wand,const char *tile_geometry,
6380 const char *thumbnail_geometry,const MontageMode mode,const char *frame)
6394 assert(wand != (MagickWand *) NULL);
6395 assert(wand->signature == WandSignature);
6396 if (wand->debug != MagickFalse)
6397 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6398 if (wand->images == (Image *) NULL)
6399 return((MagickWand *) NULL);
6400 montage_info=CloneMontageInfo(wand->image_info,(MontageInfo *) NULL);
6405 (void) CloneString(&montage_info->frame,"15x15+3+3");
6406 montage_info->shadow=MagickTrue;
6411 montage_info->frame=(char *) NULL;
6412 montage_info->shadow=MagickFalse;
6413 montage_info->border_width=0;
6416 case ConcatenateMode:
6418 montage_info->frame=(char *) NULL;
6419 montage_info->shadow=MagickFalse;
6420 (void) CloneString(&montage_info->geometry,"+0+0");
6421 montage_info->border_width=0;
6427 font=DrawGetFont(drawing_wand);
6428 if (font != (char *) NULL)
6429 (void) CloneString(&montage_info->font,font);
6430 if (frame != (char *) NULL)
6431 (void) CloneString(&montage_info->frame,frame);
6432 montage_info->pointsize=DrawGetFontSize(drawing_wand);
6433 pixel_wand=NewPixelWand();
6434 DrawGetFillColor(drawing_wand,pixel_wand);
6435 PixelGetQuantumPacket(pixel_wand,&montage_info->fill);
6436 DrawGetStrokeColor(drawing_wand,pixel_wand);
6437 PixelGetQuantumPacket(pixel_wand,&montage_info->stroke);
6438 pixel_wand=DestroyPixelWand(pixel_wand);
6439 if (thumbnail_geometry != (char *) NULL)
6440 (void) CloneString(&montage_info->geometry,thumbnail_geometry);
6441 if (tile_geometry != (char *) NULL)
6442 (void) CloneString(&montage_info->tile,tile_geometry);
6443 montage_image=MontageImageList(wand->image_info,montage_info,wand->images,
6445 montage_info=DestroyMontageInfo(montage_info);
6446 if (montage_image == (Image *) NULL)
6447 return((MagickWand *) NULL);
6448 return(CloneMagickWandFromImages(wand,montage_image));
6452 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6456 % M a g i c k M o r p h I m a g e s %
6460 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6462 % MagickMorphImages() method morphs a set of images. Both the image pixels
6463 % and size are linearly interpolated to give the appearance of a
6464 % meta-morphosis from one image to the next.
6466 % The format of the MagickMorphImages method is:
6468 % MagickWand *MagickMorphImages(MagickWand *wand,
6469 % const size_t number_frames)
6471 % A description of each parameter follows:
6473 % o wand: the magick wand.
6475 % o number_frames: the number of in-between images to generate.
6478 WandExport MagickWand *MagickMorphImages(MagickWand *wand,
6479 const size_t number_frames)
6484 assert(wand != (MagickWand *) NULL);
6485 assert(wand->signature == WandSignature);
6486 if (wand->debug != MagickFalse)
6487 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6488 if (wand->images == (Image *) NULL)
6489 return((MagickWand *) NULL);
6490 morph_image=MorphImages(wand->images,number_frames,wand->exception);
6491 if (morph_image == (Image *) NULL)
6492 return((MagickWand *) NULL);
6493 return(CloneMagickWandFromImages(wand,morph_image));
6497 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6501 % M a g i c k M o r p h o l o g y I m a g e %
6505 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6507 % MagickMorphologyImage() applies a user supplied kernel to the image
6508 % according to the given mophology method.
6510 % The format of the MagickMorphologyImage method is:
6512 % MagickBooleanType MagickMorphologyImage(MagickWand *wand,
6513 % MorphologyMethod method,const ssize_t iterations,KernelInfo *kernel)
6515 % A description of each parameter follows:
6517 % o wand: the magick wand.
6519 % o method: the morphology method to be applied.
6521 % o iterations: apply the operation this many times (or no change).
6522 % A value of -1 means loop until no change found. How this is applied
6523 % may depend on the morphology method. Typically this is a value of 1.
6525 % o kernel: An array of doubles representing the morphology kernel.
6528 WandExport MagickBooleanType MagickMorphologyImage(MagickWand *wand,
6529 MorphologyMethod method,const ssize_t iterations,KernelInfo *kernel)
6534 assert(wand != (MagickWand *) NULL);
6535 assert(wand->signature == WandSignature);
6536 if (wand->debug != MagickFalse)
6537 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6538 if (kernel == (const KernelInfo *) NULL)
6539 return(MagickFalse);
6540 if (wand->images == (Image *) NULL)
6541 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6542 morphology_image=MorphologyImage(wand->images,method,iterations,kernel,
6544 if (morphology_image == (Image *) NULL)
6545 return(MagickFalse);
6546 ReplaceImageInList(&wand->images,morphology_image);
6551 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6555 % M a g i c k M o t i o n B l u r I m a g e %
6559 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6561 % MagickMotionBlurImage() simulates motion blur. We convolve the image with a
6562 % Gaussian operator of the given radius and standard deviation (sigma).
6563 % For reasonable results, radius should be larger than sigma. Use a
6564 % radius of 0 and MotionBlurImage() selects a suitable radius for you.
6565 % Angle gives the angle of the blurring motion.
6567 % The format of the MagickMotionBlurImage method is:
6569 % MagickBooleanType MagickMotionBlurImage(MagickWand *wand,
6570 % const double radius,const double sigma,const double angle)
6572 % A description of each parameter follows:
6574 % o wand: the magick wand.
6576 % o radius: the radius of the Gaussian, in pixels, not counting
6579 % o sigma: the standard deviation of the Gaussian, in pixels.
6581 % o angle: Apply the effect along this angle.
6584 WandExport MagickBooleanType MagickMotionBlurImage(MagickWand *wand,
6585 const double radius,const double sigma,const double angle)
6590 assert(wand != (MagickWand *) NULL);
6591 assert(wand->signature == WandSignature);
6592 if (wand->debug != MagickFalse)
6593 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6594 if (wand->images == (Image *) NULL)
6595 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6596 blur_image=MotionBlurImage(wand->images,radius,sigma,angle,wand->exception);
6597 if (blur_image == (Image *) NULL)
6598 return(MagickFalse);
6599 ReplaceImageInList(&wand->images,blur_image);
6604 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6608 % M a g i c k N e g a t e I m a g e %
6612 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6614 % MagickNegateImage() negates the colors in the reference image. The
6615 % Grayscale option means that only grayscale values within the image are
6618 % You can also reduce the influence of a particular channel with a gamma
6621 % The format of the MagickNegateImage method is:
6623 % MagickBooleanType MagickNegateImage(MagickWand *wand,
6624 % const MagickBooleanType gray)
6626 % A description of each parameter follows:
6628 % o wand: the magick wand.
6630 % o gray: If MagickTrue, only negate grayscale pixels within the image.
6633 WandExport MagickBooleanType MagickNegateImage(MagickWand *wand,
6634 const MagickBooleanType gray)
6639 assert(wand != (MagickWand *) NULL);
6640 assert(wand->signature == WandSignature);
6641 if (wand->debug != MagickFalse)
6642 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6643 if (wand->images == (Image *) NULL)
6644 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6645 status=NegateImage(wand->images,gray,wand->exception);
6650 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6654 % M a g i c k N e w I m a g e %
6658 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6660 % MagickNewImage() adds a blank image canvas of the specified size and
6661 % background color to the wand.
6663 % The format of the MagickNewImage method is:
6665 % MagickBooleanType MagickNewImage(MagickWand *wand,
6666 % const size_t columns,const size_t rows,
6667 % const PixelWand *background)
6669 % A description of each parameter follows:
6671 % o wand: the magick wand.
6673 % o width: the image width.
6675 % o height: the image height.
6677 % o background: the image color.
6680 WandExport MagickBooleanType MagickNewImage(MagickWand *wand,
6681 const size_t width,const size_t height,
6682 const PixelWand *background)
6690 assert(wand != (MagickWand *) NULL);
6691 assert(wand->signature == WandSignature);
6692 if (wand->debug != MagickFalse)
6693 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6694 PixelGetMagickColor(background,&pixel);
6695 images=NewMagickImage(wand->image_info,width,height,&pixel);
6696 if (images == (Image *) NULL)
6697 return(MagickFalse);
6698 if (images->exception.severity != UndefinedException)
6699 InheritException(wand->exception,&images->exception);
6700 return(InsertImageInWand(wand,images));
6704 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6708 % M a g i c k N e x t I m a g e %
6712 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6714 % MagickNextImage() associates the next image in the image list with a magick
6717 % The format of the MagickNextImage method is:
6719 % MagickBooleanType MagickNextImage(MagickWand *wand)
6721 % A description of each parameter follows:
6723 % o wand: the magick wand.
6726 WandExport MagickBooleanType MagickNextImage(MagickWand *wand)
6728 assert(wand != (MagickWand *) NULL);
6729 assert(wand->signature == WandSignature);
6730 if (wand->debug != MagickFalse)
6731 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6732 if (wand->images == (Image *) NULL)
6733 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6734 if (wand->pend != MagickFalse)
6736 wand->pend=MagickFalse;
6739 if (GetNextImageInList(wand->images) == (Image *) NULL)
6741 wand->pend=MagickTrue;
6742 return(MagickFalse);
6744 wand->images=GetNextImageInList(wand->images);
6749 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6753 % M a g i c k N o r m a l i z e I m a g e %
6757 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6759 % MagickNormalizeImage() enhances the contrast of a color image by adjusting
6760 % the pixels color to span the entire range of colors available
6762 % You can also reduce the influence of a particular channel with a gamma
6765 % The format of the MagickNormalizeImage method is:
6767 % MagickBooleanType MagickNormalizeImage(MagickWand *wand)
6769 % A description of each parameter follows:
6771 % o wand: the magick wand.
6774 WandExport MagickBooleanType MagickNormalizeImage(MagickWand *wand)
6779 assert(wand != (MagickWand *) NULL);
6780 assert(wand->signature == WandSignature);
6781 if (wand->debug != MagickFalse)
6782 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6783 if (wand->images == (Image *) NULL)
6784 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6785 status=NormalizeImage(wand->images,&wand->images->exception);
6790 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6794 % M a g i c k O i l P a i n t I m a g e %
6798 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6800 % MagickOilPaintImage() applies a special effect filter that simulates an oil
6801 % painting. Each pixel is replaced by the most frequent color occurring
6802 % in a circular region defined by radius.
6804 % The format of the MagickOilPaintImage method is:
6806 % MagickBooleanType MagickOilPaintImage(MagickWand *wand,
6807 % const double radius,const double sigma)
6809 % A description of each parameter follows:
6811 % o wand: the magick wand.
6813 % o radius: the radius of the circular neighborhood.
6815 % o sigma: the standard deviation of the Gaussian, in pixels.
6818 WandExport MagickBooleanType MagickOilPaintImage(MagickWand *wand,
6819 const double radius,const double sigma)
6824 assert(wand != (MagickWand *) NULL);
6825 assert(wand->signature == WandSignature);
6826 if (wand->debug != MagickFalse)
6827 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6828 if (wand->images == (Image *) NULL)
6829 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6830 paint_image=OilPaintImage(wand->images,radius,sigma,wand->exception);
6831 if (paint_image == (Image *) NULL)
6832 return(MagickFalse);
6833 ReplaceImageInList(&wand->images,paint_image);
6838 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6842 % M a g i c k O p a q u e P a i n t I m a g e %
6846 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6848 % MagickOpaquePaintImage() changes any pixel that matches color with the color
6851 % The format of the MagickOpaquePaintImage method is:
6853 % MagickBooleanType MagickOpaquePaintImage(MagickWand *wand,
6854 % const PixelWand *target,const PixelWand *fill,const double fuzz,
6855 % const MagickBooleanType invert)
6857 % A description of each parameter follows:
6859 % o wand: the magick wand.
6861 % o target: Change this target color to the fill color within the image.
6863 % o fill: the fill pixel wand.
6865 % o fuzz: By default target must match a particular pixel color
6866 % exactly. However, in many cases two colors may differ by a small amount.
6867 % The fuzz member of image defines how much tolerance is acceptable to
6868 % consider two colors as the same. For example, set fuzz to 10 and the
6869 % color red at intensities of 100 and 102 respectively are now interpreted
6870 % as the same color for the purposes of the floodfill.
6872 % o invert: paint any pixel that does not match the target color.
6875 WandExport MagickBooleanType MagickOpaquePaintImage(MagickWand *wand,
6876 const PixelWand *target,const PixelWand *fill,const double fuzz,
6877 const MagickBooleanType invert)
6886 assert(wand != (MagickWand *) NULL);
6887 assert(wand->signature == WandSignature);
6888 if (wand->debug != MagickFalse)
6889 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6890 if (wand->images == (Image *) NULL)
6891 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6892 PixelGetMagickColor(target,&target_pixel);
6893 PixelGetMagickColor(fill,&fill_pixel);
6894 wand->images->fuzz=fuzz;
6895 status=OpaquePaintImage(wand->images,&target_pixel,&fill_pixel,invert,
6896 &wand->images->exception);
6901 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6905 % 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 %
6909 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6911 % MagickOptimizeImageLayers() compares each image the GIF disposed forms of the
6912 % previous image in the sequence. From this it attempts to select the
6913 % smallest cropped image to replace each frame, while preserving the results
6916 % The format of the MagickOptimizeImageLayers method is:
6918 % MagickWand *MagickOptimizeImageLayers(MagickWand *wand)
6920 % A description of each parameter follows:
6922 % o wand: the magick wand.
6925 WandExport MagickWand *MagickOptimizeImageLayers(MagickWand *wand)
6930 assert(wand != (MagickWand *) NULL);
6931 assert(wand->signature == WandSignature);
6932 if (wand->debug != MagickFalse)
6933 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6934 if (wand->images == (Image *) NULL)
6935 return((MagickWand *) NULL);
6936 optimize_image=OptimizeImageLayers(wand->images,wand->exception);
6937 if (optimize_image == (Image *) NULL)
6938 return((MagickWand *) NULL);
6939 return(CloneMagickWandFromImages(wand,optimize_image));
6943 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6947 % 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 %
6951 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6953 % MagickOrderedPosterizeImage() performs an ordered dither based on a number
6954 % of pre-defined dithering threshold maps, but over multiple intensity levels,
6955 % which can be different for different channels, according to the input
6958 % The format of the MagickOrderedPosterizeImage method is:
6960 % MagickBooleanType MagickOrderedPosterizeImage(MagickWand *wand,
6961 % const char *threshold_map)
6963 % A description of each parameter follows:
6965 % o image: the image.
6967 % o threshold_map: A string containing the name of the threshold dither
6968 % map to use, followed by zero or more numbers representing the number of
6969 % color levels tho dither between.
6971 % Any level number less than 2 is equivalent to 2, and means only binary
6972 % dithering will be applied to each color channel.
6974 % No numbers also means a 2 level (bitmap) dither will be applied to all
6975 % channels, while a single number is the number of levels applied to each
6976 % channel in sequence. More numbers will be applied in turn to each of
6977 % the color channels.
6979 % For example: "o3x3,6" generates a 6 level posterization of the image
6980 % with a ordered 3x3 diffused pixel dither being applied between each
6981 % level. While checker,8,8,4 will produce a 332 colormaped image with
6982 % only a single checkerboard hash pattern (50% grey) between each color
6983 % level, to basically double the number of color levels with a bare
6984 % minimim of dithering.
6987 WandExport MagickBooleanType MagickOrderedPosterizeImage(MagickWand *wand,
6988 const char *threshold_map)
6993 assert(wand != (MagickWand *) NULL);
6994 assert(wand->signature == WandSignature);
6995 if (wand->debug != MagickFalse)
6996 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6997 if (wand->images == (Image *) NULL)
6998 ThrowWandException(WandError,"ContainsNoImages",wand->name);
6999 status=OrderedPosterizeImage(wand->images,threshold_map,wand->exception);
7004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7008 % M a g i c k P i n g I m a g e %
7012 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7014 % MagickPingImage() is like MagickReadImage() except the only valid
7015 % information returned is the image width, height, size, and format. It
7016 % is designed to efficiently obtain this information from a file without
7017 % reading the entire image sequence into memory.
7019 % The format of the MagickPingImage method is:
7021 % MagickBooleanType MagickPingImage(MagickWand *wand,const char *filename)
7023 % A description of each parameter follows:
7025 % o wand: the magick wand.
7027 % o filename: the image filename.
7030 WandExport MagickBooleanType MagickPingImage(MagickWand *wand,
7031 const char *filename)
7039 assert(wand != (MagickWand *) NULL);
7040 assert(wand->signature == WandSignature);
7041 if (wand->debug != MagickFalse)
7042 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7043 ping_info=CloneImageInfo(wand->image_info);
7044 if (filename != (const char *) NULL)
7045 (void) CopyMagickString(ping_info->filename,filename,MaxTextExtent);
7046 images=PingImage(ping_info,wand->exception);
7047 ping_info=DestroyImageInfo(ping_info);
7048 if (images == (Image *) NULL)
7049 return(MagickFalse);
7050 return(InsertImageInWand(wand,images));
7054 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7058 % M a g i c k P i n g I m a g e B l o b %
7062 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7064 % MagickPingImageBlob() pings an image or image sequence from a blob.
7066 % The format of the MagickPingImageBlob method is:
7068 % MagickBooleanType MagickPingImageBlob(MagickWand *wand,
7069 % const void *blob,const size_t length)
7071 % A description of each parameter follows:
7073 % o wand: the magick wand.
7077 % o length: the blob length.
7080 WandExport MagickBooleanType MagickPingImageBlob(MagickWand *wand,
7081 const void *blob,const size_t length)
7089 assert(wand != (MagickWand *) NULL);
7090 assert(wand->signature == WandSignature);
7091 if (wand->debug != MagickFalse)
7092 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7093 read_info=CloneImageInfo(wand->image_info);
7094 SetImageInfoBlob(read_info,blob,length);
7095 images=PingImage(read_info,wand->exception);
7096 read_info=DestroyImageInfo(read_info);
7097 if (images == (Image *) NULL)
7098 return(MagickFalse);
7099 return(InsertImageInWand(wand,images));
7103 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7107 % M a g i c k P i n g I m a g e F i l e %
7111 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7113 % MagickPingImageFile() pings an image or image sequence from an open file
7116 % The format of the MagickPingImageFile method is:
7118 % MagickBooleanType MagickPingImageFile(MagickWand *wand,FILE *file)
7120 % A description of each parameter follows:
7122 % o wand: the magick wand.
7124 % o file: the file descriptor.
7127 WandExport MagickBooleanType MagickPingImageFile(MagickWand *wand,FILE *file)
7135 assert(wand != (MagickWand *) NULL);
7136 assert(wand->signature == WandSignature);
7137 assert(file != (FILE *) NULL);
7138 if (wand->debug != MagickFalse)
7139 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7140 read_info=CloneImageInfo(wand->image_info);
7141 SetImageInfoFile(read_info,file);
7142 images=PingImage(read_info,wand->exception);
7143 read_info=DestroyImageInfo(read_info);
7144 if (images == (Image *) NULL)
7145 return(MagickFalse);
7146 return(InsertImageInWand(wand,images));
7150 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7154 % M a g i c k P o l a r o i d I m a g e %
7158 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7160 % MagickPolaroidImage() simulates a Polaroid picture.
7162 % The format of the MagickPolaroidImage method is:
7164 % MagickBooleanType MagickPolaroidImage(MagickWand *wand,
7165 % const DrawingWand *drawing_wand,const double angle)
7167 % A description of each parameter follows:
7169 % o wand: the magick wand.
7171 % o drawing_wand: the draw wand.
7173 % o angle: Apply the effect along this angle.
7176 WandExport MagickBooleanType MagickPolaroidImage(MagickWand *wand,
7177 const DrawingWand *drawing_wand,const double angle)
7185 assert(wand != (MagickWand *) NULL);
7186 assert(wand->signature == WandSignature);
7187 if (wand->debug != MagickFalse)
7188 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7189 if (wand->images == (Image *) NULL)
7190 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7191 draw_info=PeekDrawingWand(drawing_wand);
7192 if (draw_info == (DrawInfo *) NULL)
7193 return(MagickFalse);
7194 polaroid_image=PolaroidImage(wand->images,draw_info,angle,wand->exception);
7195 if (polaroid_image == (Image *) NULL)
7196 return(MagickFalse);
7197 ReplaceImageInList(&wand->images,polaroid_image);
7202 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7206 % M a g i c k P o s t e r i z e I m a g e %
7210 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7212 % MagickPosterizeImage() reduces the image to a limited number of color level.
7214 % The format of the MagickPosterizeImage method is:
7216 % MagickBooleanType MagickPosterizeImage(MagickWand *wand,
7217 % const unsigned levels,const MagickBooleanType dither)
7219 % A description of each parameter follows:
7221 % o wand: the magick wand.
7223 % o levels: Number of color levels allowed in each channel. Very low values
7224 % (2, 3, or 4) have the most visible effect.
7226 % o dither: Set this integer value to something other than zero to dither
7230 WandExport MagickBooleanType MagickPosterizeImage(MagickWand *wand,
7231 const size_t levels,const MagickBooleanType dither)
7236 assert(wand != (MagickWand *) NULL);
7237 assert(wand->signature == WandSignature);
7238 if (wand->debug != MagickFalse)
7239 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7240 if (wand->images == (Image *) NULL)
7241 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7242 status=PosterizeImage(wand->images,levels,dither);
7243 if (status == MagickFalse)
7244 InheritException(wand->exception,&wand->images->exception);
7249 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7253 % M a g i c k P r e v i e w I m a g e s %
7257 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7259 % MagickPreviewImages() tiles 9 thumbnails of the specified image with an
7260 % image processing operation applied at varying strengths. This helpful
7261 % to quickly pin-point an appropriate parameter for an image processing
7264 % The format of the MagickPreviewImages method is:
7266 % MagickWand *MagickPreviewImages(MagickWand *wand,
7267 % const PreviewType preview)
7269 % A description of each parameter follows:
7271 % o wand: the magick wand.
7273 % o preview: the preview type.
7276 WandExport MagickWand *MagickPreviewImages(MagickWand *wand,
7277 const PreviewType preview)
7282 assert(wand != (MagickWand *) NULL);
7283 assert(wand->signature == WandSignature);
7284 if (wand->debug != MagickFalse)
7285 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7286 if (wand->images == (Image *) NULL)
7287 return((MagickWand *) NULL);
7288 preview_image=PreviewImage(wand->images,preview,wand->exception);
7289 if (preview_image == (Image *) NULL)
7290 return((MagickWand *) NULL);
7291 return(CloneMagickWandFromImages(wand,preview_image));
7295 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7299 % M a g i c k P r e v i o u s I m a g e %
7303 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7305 % MagickPreviousImage() assocates the previous image in an image list with
7308 % The format of the MagickPreviousImage method is:
7310 % MagickBooleanType MagickPreviousImage(MagickWand *wand)
7312 % A description of each parameter follows:
7314 % o wand: the magick wand.
7317 WandExport MagickBooleanType MagickPreviousImage(MagickWand *wand)
7319 assert(wand != (MagickWand *) NULL);
7320 assert(wand->signature == WandSignature);
7321 if (wand->debug != MagickFalse)
7322 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7323 if (wand->images == (Image *) NULL)
7324 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7325 if (wand->pend != MagickFalse)
7327 wand->pend=MagickFalse;
7330 if (GetPreviousImageInList(wand->images) == (Image *) NULL)
7332 wand->pend=MagickTrue;
7333 return(MagickFalse);
7335 wand->images=GetPreviousImageInList(wand->images);
7340 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7344 % M a g i c k Q u a n t i z e I m a g e %
7348 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7350 % MagickQuantizeImage() analyzes the colors within a reference image and
7351 % chooses a fixed number of colors to represent the image. The goal of the
7352 % algorithm is to minimize the color difference between the input and output
7353 % image while minimizing the processing time.
7355 % The format of the MagickQuantizeImage method is:
7357 % MagickBooleanType MagickQuantizeImage(MagickWand *wand,
7358 % const size_t number_colors,const ColorspaceType colorspace,
7359 % const size_t treedepth,const MagickBooleanType dither,
7360 % const MagickBooleanType measure_error)
7362 % A description of each parameter follows:
7364 % o wand: the magick wand.
7366 % o number_colors: the number of colors.
7368 % o colorspace: Perform color reduction in this colorspace, typically
7371 % o treedepth: Normally, this integer value is zero or one. A zero or
7372 % 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
7373 % reference image with the least amount of memory and the fastest
7374 % computational speed. In some cases, such as an image with low color
7375 % dispersion (a few number of colors), a value other than
7376 % Log4(number_colors) is required. To expand the color tree completely,
7379 % o dither: A value other than zero distributes the difference between an
7380 % original image and the corresponding color reduced image to
7381 % neighboring pixels along a Hilbert curve.
7383 % o measure_error: A value other than zero measures the difference between
7384 % the original and quantized images. This difference is the total
7385 % quantization error. The error is computed by summing over all pixels
7386 % in an image the distance squared in RGB space between each reference
7387 % pixel value and its quantized value.
7390 WandExport MagickBooleanType MagickQuantizeImage(MagickWand *wand,
7391 const size_t number_colors,const ColorspaceType colorspace,
7392 const size_t treedepth,const MagickBooleanType dither,
7393 const MagickBooleanType measure_error)
7401 assert(wand != (MagickWand *) NULL);
7402 assert(wand->signature == WandSignature);
7403 if (wand->debug != MagickFalse)
7404 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7405 if (wand->images == (Image *) NULL)
7406 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7407 quantize_info=CloneQuantizeInfo((QuantizeInfo *) NULL);
7408 quantize_info->number_colors=number_colors;
7409 quantize_info->dither=dither;
7410 quantize_info->tree_depth=treedepth;
7411 quantize_info->colorspace=colorspace;
7412 quantize_info->measure_error=measure_error;
7413 status=QuantizeImage(quantize_info,wand->images);
7414 if (status == MagickFalse)
7415 InheritException(wand->exception,&wand->images->exception);
7416 quantize_info=DestroyQuantizeInfo(quantize_info);
7421 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7425 % M a g i c k Q u a n t i z e I m a g e s %
7429 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7431 % MagickQuantizeImages() analyzes the colors within a sequence of images and
7432 % chooses a fixed number of colors to represent the image. The goal of the
7433 % algorithm is to minimize the color difference between the input and output
7434 % image while minimizing the processing time.
7436 % The format of the MagickQuantizeImages method is:
7438 % MagickBooleanType MagickQuantizeImages(MagickWand *wand,
7439 % const size_t number_colors,const ColorspaceType colorspace,
7440 % const size_t treedepth,const MagickBooleanType dither,
7441 % const MagickBooleanType measure_error)
7443 % A description of each parameter follows:
7445 % o wand: the magick wand.
7447 % o number_colors: the number of colors.
7449 % o colorspace: Perform color reduction in this colorspace, typically
7452 % o treedepth: Normally, this integer value is zero or one. A zero or
7453 % 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
7454 % reference image with the least amount of memory and the fastest
7455 % computational speed. In some cases, such as an image with low color
7456 % dispersion (a few number of colors), a value other than
7457 % Log4(number_colors) is required. To expand the color tree completely,
7460 % o dither: A value other than zero distributes the difference between an
7461 % original image and the corresponding color reduced algorithm to
7462 % neighboring pixels along a Hilbert curve.
7464 % o measure_error: A value other than zero measures the difference between
7465 % the original and quantized images. This difference is the total
7466 % quantization error. The error is computed by summing over all pixels
7467 % in an image the distance squared in RGB space between each reference
7468 % pixel value and its quantized value.
7471 WandExport MagickBooleanType MagickQuantizeImages(MagickWand *wand,
7472 const size_t number_colors,const ColorspaceType colorspace,
7473 const size_t treedepth,const MagickBooleanType dither,
7474 const MagickBooleanType measure_error)
7482 assert(wand != (MagickWand *) NULL);
7483 assert(wand->signature == WandSignature);
7484 if (wand->debug != MagickFalse)
7485 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7486 if (wand->images == (Image *) NULL)
7487 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7488 quantize_info=CloneQuantizeInfo((QuantizeInfo *) NULL);
7489 quantize_info->number_colors=number_colors;
7490 quantize_info->dither=dither;
7491 quantize_info->tree_depth=treedepth;
7492 quantize_info->colorspace=colorspace;
7493 quantize_info->measure_error=measure_error;
7494 status=QuantizeImages(quantize_info,wand->images);
7495 if (status == MagickFalse)
7496 InheritException(wand->exception,&wand->images->exception);
7497 quantize_info=DestroyQuantizeInfo(quantize_info);
7502 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7506 % M a g i c k R a d i a l B l u r I m a g e %
7510 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7512 % MagickRadialBlurImage() radial blurs an image.
7514 % The format of the MagickRadialBlurImage method is:
7516 % MagickBooleanType MagickRadialBlurImage(MagickWand *wand,
7517 % const double angle)
7519 % A description of each parameter follows:
7521 % o wand: the magick wand.
7523 % o angle: the angle of the blur in degrees.
7526 WandExport MagickBooleanType MagickRadialBlurImage(MagickWand *wand,
7532 assert(wand != (MagickWand *) NULL);
7533 assert(wand->signature == WandSignature);
7534 if (wand->debug != MagickFalse)
7535 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7536 if (wand->images == (Image *) NULL)
7537 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7538 blur_image=RadialBlurImage(wand->images,angle,wand->exception);
7539 if (blur_image == (Image *) NULL)
7540 return(MagickFalse);
7541 ReplaceImageInList(&wand->images,blur_image);
7546 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7550 % M a g i c k R a i s e I m a g e %
7554 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7556 % MagickRaiseImage() creates a simulated three-dimensional button-like effect
7557 % by lightening and darkening the edges of the image. Members width and
7558 % height of raise_info define the width of the vertical and horizontal
7559 % edge of the effect.
7561 % The format of the MagickRaiseImage method is:
7563 % MagickBooleanType MagickRaiseImage(MagickWand *wand,
7564 % const size_t width,const size_t height,const ssize_t x,
7565 % const ssize_t y,const MagickBooleanType raise)
7567 % A description of each parameter follows:
7569 % o wand: the magick wand.
7571 % o width,height,x,y: Define the dimensions of the area to raise.
7573 % o raise: A value other than zero creates a 3-D raise effect,
7574 % otherwise it has a lowered effect.
7577 WandExport MagickBooleanType MagickRaiseImage(MagickWand *wand,
7578 const size_t width,const size_t height,const ssize_t x,
7579 const ssize_t y,const MagickBooleanType raise)
7587 assert(wand != (MagickWand *) NULL);
7588 assert(wand->signature == WandSignature);
7589 if (wand->debug != MagickFalse)
7590 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7591 if (wand->images == (Image *) NULL)
7592 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7593 raise_info.width=width;
7594 raise_info.height=height;
7597 status=RaiseImage(wand->images,&raise_info,raise,&wand->images->exception);
7602 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7606 % 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 %
7610 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7612 % MagickRandomThresholdImage() changes the value of individual pixels based on
7613 % the intensity of each pixel compared to threshold. The result is a
7614 % high-contrast, two color image.
7616 % The format of the MagickRandomThresholdImage method is:
7618 % MagickBooleanType MagickRandomThresholdImage(MagickWand *wand,
7619 % const double low,const double high)
7621 % A description of each parameter follows:
7623 % o wand: the magick wand.
7625 % o low,high: Specify the high and low thresholds. These values range from
7626 % 0 to QuantumRange.
7629 WandExport MagickBooleanType MagickRandomThresholdImage(MagickWand *wand,
7630 const double low,const double high)
7633 threshold[MaxTextExtent];
7638 assert(wand != (MagickWand *) NULL);
7639 assert(wand->signature == WandSignature);
7640 if (wand->debug != MagickFalse)
7641 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7642 if (wand->images == (Image *) NULL)
7643 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7644 (void) FormatLocaleString(threshold,MaxTextExtent,"%gx%g",low,high);
7645 status=RandomThresholdImage(wand->images,threshold,wand->exception);
7646 if (status == MagickFalse)
7647 InheritException(wand->exception,&wand->images->exception);
7652 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7656 % M a g i c k R e a d I m a g e %
7660 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7662 % MagickReadImage() reads an image or image sequence. The images are inserted
7663 % at the current image pointer position. Use MagickSetFirstIterator(),
7664 % MagickSetLastIterator, or MagickSetImageIndex() to specify the current
7665 % image pointer position at the beginning of the image list, the end, or
7666 % anywhere in-between respectively.
7668 % The format of the MagickReadImage method is:
7670 % MagickBooleanType MagickReadImage(MagickWand *wand,const char *filename)
7672 % A description of each parameter follows:
7674 % o wand: the magick wand.
7676 % o filename: the image filename.
7679 WandExport MagickBooleanType MagickReadImage(MagickWand *wand,
7680 const char *filename)
7688 assert(wand != (MagickWand *) NULL);
7689 assert(wand->signature == WandSignature);
7690 if (wand->debug != MagickFalse)
7691 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7692 read_info=CloneImageInfo(wand->image_info);
7693 if (filename != (const char *) NULL)
7694 (void) CopyMagickString(read_info->filename,filename,MaxTextExtent);
7695 images=ReadImage(read_info,wand->exception);
7696 read_info=DestroyImageInfo(read_info);
7697 if (images == (Image *) NULL)
7698 return(MagickFalse);
7699 return(InsertImageInWand(wand,images));
7703 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7707 % M a g i c k R e a d I m a g e B l o b %
7711 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7713 % MagickReadImageBlob() reads an image or image sequence from a blob.
7715 % The format of the MagickReadImageBlob method is:
7717 % MagickBooleanType MagickReadImageBlob(MagickWand *wand,
7718 % const void *blob,const size_t length)
7720 % A description of each parameter follows:
7722 % o wand: the magick wand.
7726 % o length: the blob length.
7729 WandExport MagickBooleanType MagickReadImageBlob(MagickWand *wand,
7730 const void *blob,const size_t length)
7735 assert(wand != (MagickWand *) NULL);
7736 assert(wand->signature == WandSignature);
7737 if (wand->debug != MagickFalse)
7738 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7739 images=BlobToImage(wand->image_info,blob,length,wand->exception);
7740 if (images == (Image *) NULL)
7741 return(MagickFalse);
7742 return(InsertImageInWand(wand,images));
7746 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7750 % M a g i c k R e a d I m a g e F i l e %
7754 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7756 % MagickReadImageFile() reads an image or image sequence from an open file
7759 % The format of the MagickReadImageFile method is:
7761 % MagickBooleanType MagickReadImageFile(MagickWand *wand,FILE *file)
7763 % A description of each parameter follows:
7765 % o wand: the magick wand.
7767 % o file: the file descriptor.
7770 WandExport MagickBooleanType MagickReadImageFile(MagickWand *wand,FILE *file)
7778 assert(wand != (MagickWand *) NULL);
7779 assert(wand->signature == WandSignature);
7780 assert(file != (FILE *) NULL);
7781 if (wand->debug != MagickFalse)
7782 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7783 read_info=CloneImageInfo(wand->image_info);
7784 SetImageInfoFile(read_info,file);
7785 images=ReadImage(read_info,wand->exception);
7786 read_info=DestroyImageInfo(read_info);
7787 if (images == (Image *) NULL)
7788 return(MagickFalse);
7789 return(InsertImageInWand(wand,images));
7793 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7797 % M a g i c k R e m a p I m a g e %
7801 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7803 % MagickRemapImage() replaces the colors of an image with the closest color
7804 % from a reference image.
7806 % The format of the MagickRemapImage method is:
7808 % MagickBooleanType MagickRemapImage(MagickWand *wand,
7809 % const MagickWand *remap_wand,const DitherMethod method)
7811 % A description of each parameter follows:
7813 % o wand: the magick wand.
7815 % o affinity: the affinity wand.
7817 % o method: choose from these dither methods: NoDitherMethod,
7818 % RiemersmaDitherMethod, or FloydSteinbergDitherMethod.
7821 WandExport MagickBooleanType MagickRemapImage(MagickWand *wand,
7822 const MagickWand *remap_wand,const DitherMethod method)
7830 assert(wand != (MagickWand *) NULL);
7831 assert(wand->signature == WandSignature);
7832 if (wand->debug != MagickFalse)
7833 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7834 if ((wand->images == (Image *) NULL) ||
7835 (remap_wand->images == (Image *) NULL))
7836 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7837 quantize_info=AcquireQuantizeInfo(wand->image_info);
7838 quantize_info->dither_method=method;
7839 if (method == NoDitherMethod)
7840 quantize_info->dither=MagickFalse;
7841 status=RemapImage(quantize_info,wand->images,remap_wand->images);
7842 quantize_info=DestroyQuantizeInfo(quantize_info);
7843 if (status == MagickFalse)
7844 InheritException(wand->exception,&wand->images->exception);
7849 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7853 % M a g i c k R e m o v e I m a g e %
7857 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7859 % MagickRemoveImage() removes an image from the image list.
7861 % The format of the MagickRemoveImage method is:
7863 % MagickBooleanType MagickRemoveImage(MagickWand *wand)
7865 % A description of each parameter follows:
7867 % o wand: the magick wand.
7869 % o insert: the splice wand.
7872 WandExport MagickBooleanType MagickRemoveImage(MagickWand *wand)
7874 assert(wand != (MagickWand *) NULL);
7875 assert(wand->signature == WandSignature);
7876 if (wand->debug != MagickFalse)
7877 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7878 if (wand->images == (Image *) NULL)
7879 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7880 DeleteImageFromList(&wand->images);
7885 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7889 % M a g i c k R e s a m p l e I m a g e %
7893 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7895 % MagickResampleImage() resample image to desired resolution.
7897 % Bessel Blackman Box
7898 % Catrom Cubic Gaussian
7899 % Hanning Hermite Lanczos
7900 % Mitchell Point Quandratic
7903 % Most of the filters are FIR (finite impulse response), however, Bessel,
7904 % Gaussian, and Sinc are IIR (infinite impulse response). Bessel and Sinc
7905 % are windowed (brought down to zero) with the Blackman filter.
7907 % The format of the MagickResampleImage method is:
7909 % MagickBooleanType MagickResampleImage(MagickWand *wand,
7910 % const double x_resolution,const double y_resolution,
7911 % const FilterTypes filter,const double blur)
7913 % A description of each parameter follows:
7915 % o wand: the magick wand.
7917 % o x_resolution: the new image x resolution.
7919 % o y_resolution: the new image y resolution.
7921 % o filter: Image filter to use.
7923 % o blur: the blur factor where > 1 is blurry, < 1 is sharp.
7926 WandExport MagickBooleanType MagickResampleImage(MagickWand *wand,
7927 const double x_resolution,const double y_resolution,const FilterTypes filter,
7933 assert(wand != (MagickWand *) NULL);
7934 assert(wand->signature == WandSignature);
7935 if (wand->debug != MagickFalse)
7936 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7937 if (wand->images == (Image *) NULL)
7938 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7939 resample_image=ResampleImage(wand->images,x_resolution,y_resolution,filter,
7940 blur,wand->exception);
7941 if (resample_image == (Image *) NULL)
7942 return(MagickFalse);
7943 ReplaceImageInList(&wand->images,resample_image);
7948 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7952 % M a g i c k R e s e t I m a g e P a g e %
7956 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7958 % MagickResetImagePage() resets the Wand page canvas and position.
7960 % The format of the MagickResetImagePage method is:
7962 % MagickBooleanType MagickResetImagePage(MagickWand *wand,
7965 % A description of each parameter follows:
7967 % o wand: the magick wand.
7969 % o page: the relative page specification.
7972 WandExport MagickBooleanType MagickResetImagePage(MagickWand *wand,
7975 assert(wand != (MagickWand *) NULL);
7976 assert(wand->signature == WandSignature);
7977 if (wand->debug != MagickFalse)
7978 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
7979 if (wand->images == (Image *) NULL)
7980 ThrowWandException(WandError,"ContainsNoImages",wand->name);
7981 if ((page == (char *) NULL) || (*page == '\0'))
7983 (void) ParseAbsoluteGeometry("0x0+0+0",&wand->images->page);
7986 return(ResetImagePage(wand->images,page));
7990 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7994 % M a g i c k R e s i z e I m a g e %
7998 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8000 % MagickResizeImage() scales an image to the desired dimensions with one of
8003 % Bessel Blackman Box
8004 % Catrom Cubic Gaussian
8005 % Hanning Hermite Lanczos
8006 % Mitchell Point Quandratic
8009 % Most of the filters are FIR (finite impulse response), however, Bessel,
8010 % Gaussian, and Sinc are IIR (infinite impulse response). Bessel and Sinc
8011 % are windowed (brought down to zero) with the Blackman filter.
8013 % The format of the MagickResizeImage method is:
8015 % MagickBooleanType MagickResizeImage(MagickWand *wand,
8016 % const size_t columns,const size_t rows,
8017 % const FilterTypes filter,const double blur)
8019 % A description of each parameter follows:
8021 % o wand: the magick wand.
8023 % o columns: the number of columns in the scaled image.
8025 % o rows: the number of rows in the scaled image.
8027 % o filter: Image filter to use.
8029 % o blur: the blur factor where > 1 is blurry, < 1 is sharp.
8032 WandExport MagickBooleanType MagickResizeImage(MagickWand *wand,
8033 const size_t columns,const size_t rows,const FilterTypes filter,
8039 assert(wand != (MagickWand *) NULL);
8040 assert(wand->signature == WandSignature);
8041 if (wand->debug != MagickFalse)
8042 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8043 if (wand->images == (Image *) NULL)
8044 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8045 resize_image=ResizeImage(wand->images,columns,rows,filter,blur,
8047 if (resize_image == (Image *) NULL)
8048 return(MagickFalse);
8049 ReplaceImageInList(&wand->images,resize_image);
8054 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8058 % M a g i c k R o l l I m a g e %
8062 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8064 % MagickRollImage() offsets an image as defined by x and y.
8066 % The format of the MagickRollImage method is:
8068 % MagickBooleanType MagickRollImage(MagickWand *wand,const ssize_t x,
8071 % A description of each parameter follows:
8073 % o wand: the magick wand.
8075 % o x: the x offset.
8077 % o y: the y offset.
8081 WandExport MagickBooleanType MagickRollImage(MagickWand *wand,
8082 const ssize_t x,const ssize_t y)
8087 assert(wand != (MagickWand *) NULL);
8088 assert(wand->signature == WandSignature);
8089 if (wand->debug != MagickFalse)
8090 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8091 if (wand->images == (Image *) NULL)
8092 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8093 roll_image=RollImage(wand->images,x,y,wand->exception);
8094 if (roll_image == (Image *) NULL)
8095 return(MagickFalse);
8096 ReplaceImageInList(&wand->images,roll_image);
8101 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8105 % M a g i c k R o t a t e I m a g e %
8109 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8111 % MagickRotateImage() rotates an image the specified number of degrees. Empty
8112 % triangles left over from rotating the image are filled with the
8115 % The format of the MagickRotateImage method is:
8117 % MagickBooleanType MagickRotateImage(MagickWand *wand,
8118 % const PixelWand *background,const double degrees)
8120 % A description of each parameter follows:
8122 % o wand: the magick wand.
8124 % o background: the background pixel wand.
8126 % o degrees: the number of degrees to rotate the image.
8130 WandExport MagickBooleanType MagickRotateImage(MagickWand *wand,
8131 const PixelWand *background,const double degrees)
8136 assert(wand != (MagickWand *) NULL);
8137 assert(wand->signature == WandSignature);
8138 if (wand->debug != MagickFalse)
8139 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8140 if (wand->images == (Image *) NULL)
8141 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8142 PixelGetQuantumPacket(background,&wand->images->background_color);
8143 rotate_image=RotateImage(wand->images,degrees,wand->exception);
8144 if (rotate_image == (Image *) NULL)
8145 return(MagickFalse);
8146 ReplaceImageInList(&wand->images,rotate_image);
8151 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8155 % M a g i c k S a m p l e I m a g e %
8159 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8161 % MagickSampleImage() scales an image to the desired dimensions with pixel
8162 % sampling. Unlike other scaling methods, this method does not introduce
8163 % any additional color into the scaled image.
8165 % The format of the MagickSampleImage method is:
8167 % MagickBooleanType MagickSampleImage(MagickWand *wand,
8168 % const size_t columns,const size_t rows)
8170 % A description of each parameter follows:
8172 % o wand: the magick wand.
8174 % o columns: the number of columns in the scaled image.
8176 % o rows: the number of rows in the scaled image.
8180 WandExport MagickBooleanType MagickSampleImage(MagickWand *wand,
8181 const size_t columns,const size_t rows)
8186 assert(wand != (MagickWand *) NULL);
8187 assert(wand->signature == WandSignature);
8188 if (wand->debug != MagickFalse)
8189 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8190 if (wand->images == (Image *) NULL)
8191 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8192 sample_image=SampleImage(wand->images,columns,rows,wand->exception);
8193 if (sample_image == (Image *) NULL)
8194 return(MagickFalse);
8195 ReplaceImageInList(&wand->images,sample_image);
8200 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8204 % M a g i c k S c a l e I m a g e %
8208 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8210 % MagickScaleImage() scales the size of an image to the given dimensions.
8212 % The format of the MagickScaleImage method is:
8214 % MagickBooleanType MagickScaleImage(MagickWand *wand,
8215 % const size_t columns,const size_t rows)
8217 % A description of each parameter follows:
8219 % o wand: the magick wand.
8221 % o columns: the number of columns in the scaled image.
8223 % o rows: the number of rows in the scaled image.
8227 WandExport MagickBooleanType MagickScaleImage(MagickWand *wand,
8228 const size_t columns,const size_t rows)
8233 assert(wand != (MagickWand *) NULL);
8234 assert(wand->signature == WandSignature);
8235 if (wand->debug != MagickFalse)
8236 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8237 if (wand->images == (Image *) NULL)
8238 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8239 scale_image=ScaleImage(wand->images,columns,rows,wand->exception);
8240 if (scale_image == (Image *) NULL)
8241 return(MagickFalse);
8242 ReplaceImageInList(&wand->images,scale_image);
8247 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8251 % M a g i c k S e g m e n t I m a g e %
8255 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8257 % MagickSegmentImage() segments an image by analyzing the histograms of the
8258 % color components and identifying units that are homogeneous with the fuzzy
8259 % C-means technique.
8261 % The format of the SegmentImage method is:
8263 % MagickBooleanType MagickSegmentImage(MagickWand *wand,
8264 % const ColorspaceType colorspace,const MagickBooleanType verbose,
8265 % const double cluster_threshold,const double smooth_threshold)
8267 % A description of each parameter follows.
8271 % o colorspace: the image colorspace.
8273 % o verbose: Set to MagickTrue to print detailed information about the
8274 % identified classes.
8276 % o cluster_threshold: This represents the minimum number of pixels
8277 % contained in a hexahedra before it can be considered valid (expressed as
8280 % o smooth_threshold: the smoothing threshold eliminates noise in the second
8281 % derivative of the histogram. As the value is increased, you can expect a
8282 % smoother second derivative.
8285 MagickExport MagickBooleanType MagickSegmentImage(MagickWand *wand,
8286 const ColorspaceType colorspace,const MagickBooleanType verbose,
8287 const double cluster_threshold,const double smooth_threshold)
8292 assert(wand != (MagickWand *) NULL);
8293 assert(wand->signature == WandSignature);
8294 if (wand->debug != MagickFalse)
8295 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8296 if (wand->images == (Image *) NULL)
8297 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8298 status=SegmentImage(wand->images,colorspace,verbose,cluster_threshold,
8300 if (status == MagickFalse)
8301 InheritException(wand->exception,&wand->images->exception);
8306 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8310 % M a g i c k S e l e c t i v e B l u r I m a g e %
8314 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8316 % MagickSelectiveBlurImage() selectively blur an image within a contrast
8317 % threshold. It is similar to the unsharpen mask that sharpens everything with
8318 % contrast above a certain threshold.
8320 % The format of the MagickSelectiveBlurImage method is:
8322 % MagickBooleanType MagickSelectiveBlurImage(MagickWand *wand,
8323 % const double radius,const double sigma,const double threshold)
8325 % A description of each parameter follows:
8327 % o wand: the magick wand.
8329 % o radius: the radius of the gaussian, in pixels, not counting the center
8332 % o sigma: the standard deviation of the gaussian, in pixels.
8334 % o threshold: only pixels within this contrast threshold are included
8335 % in the blur operation.
8338 WandExport MagickBooleanType MagickSelectiveBlurImage(MagickWand *wand,
8339 const double radius,const double sigma,const double threshold)
8344 assert(wand != (MagickWand *) NULL);
8345 assert(wand->signature == WandSignature);
8346 if (wand->debug != MagickFalse)
8347 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8348 if (wand->images == (Image *) NULL)
8349 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8350 blur_image=SelectiveBlurImage(wand->images,radius,sigma,threshold,
8352 if (blur_image == (Image *) NULL)
8353 return(MagickFalse);
8354 ReplaceImageInList(&wand->images,blur_image);
8359 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8363 % 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 %
8367 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8369 % MagickSeparateImage() separates a channel from the image and returns a
8370 % grayscale image. A channel is a particular color component of each pixel
8373 % The format of the MagickSeparateImage method is:
8375 % MagickBooleanType MagickSeparateImage(MagickWand *wand)
8377 % A description of each parameter follows:
8379 % o wand: the magick wand.
8382 WandExport MagickBooleanType MagickSeparateImage(MagickWand *wand)
8387 assert(wand != (MagickWand *) NULL);
8388 assert(wand->signature == WandSignature);
8389 if (wand->debug != MagickFalse)
8390 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8391 if (wand->images == (Image *) NULL)
8392 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8393 status=SeparateImage(wand->images);
8394 if (status == MagickFalse)
8395 InheritException(wand->exception,&wand->images->exception);
8400 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8404 % M a g i c k S e p i a T o n e I m a g e %
8408 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8410 % MagickSepiaToneImage() applies a special effect to the image, similar to the
8411 % effect achieved in a photo darkroom by sepia toning. Threshold ranges from
8412 % 0 to QuantumRange and is a measure of the extent of the sepia toning. A
8413 % threshold of 80% is a good starting point for a reasonable tone.
8415 % The format of the MagickSepiaToneImage method is:
8417 % MagickBooleanType MagickSepiaToneImage(MagickWand *wand,
8418 % const double threshold)
8420 % A description of each parameter follows:
8422 % o wand: the magick wand.
8424 % o threshold: Define the extent of the sepia toning.
8427 WandExport MagickBooleanType MagickSepiaToneImage(MagickWand *wand,
8428 const double threshold)
8433 assert(wand != (MagickWand *) NULL);
8434 assert(wand->signature == WandSignature);
8435 if (wand->debug != MagickFalse)
8436 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8437 if (wand->images == (Image *) NULL)
8438 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8439 sepia_image=SepiaToneImage(wand->images,threshold,wand->exception);
8440 if (sepia_image == (Image *) NULL)
8441 return(MagickFalse);
8442 ReplaceImageInList(&wand->images,sepia_image);
8447 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8451 % M a g i c k S e t I m a g e %
8455 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8457 % MagickSetImage() replaces the last image returned by MagickSetImageIndex(),
8458 % MagickNextImage(), MagickPreviousImage() with the images from the specified
8461 % The format of the MagickSetImage method is:
8463 % MagickBooleanType MagickSetImage(MagickWand *wand,
8464 % const MagickWand *set_wand)
8466 % A description of each parameter follows:
8468 % o wand: the magick wand.
8470 % o set_wand: the set_wand wand.
8473 WandExport MagickBooleanType MagickSetImage(MagickWand *wand,
8474 const MagickWand *set_wand)
8479 assert(wand != (MagickWand *) NULL);
8480 assert(wand->signature == WandSignature);
8481 if (wand->debug != MagickFalse)
8482 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8483 assert(set_wand != (MagickWand *) NULL);
8484 assert(set_wand->signature == WandSignature);
8485 if (wand->debug != MagickFalse)
8486 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",set_wand->name);
8487 if (set_wand->images == (Image *) NULL)
8488 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8489 images=CloneImageList(set_wand->images,wand->exception);
8490 if (images == (Image *) NULL)
8491 return(MagickFalse);
8492 ReplaceImageInList(&wand->images,images);
8497 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8501 % 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 %
8505 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8507 % MagickSetImageAlphaChannel() activates, deactivates, resets, or sets the
8510 % The format of the MagickSetImageAlphaChannel method is:
8512 % MagickBooleanType MagickSetImageAlphaChannel(MagickWand *wand,
8513 % const AlphaChannelType alpha_type)
8515 % A description of each parameter follows:
8517 % o wand: the magick wand.
8519 % o alpha_type: the alpha channel type: ActivateAlphaChannel,
8520 % DeactivateAlphaChannel, OpaqueAlphaChannel, or SetAlphaChannel.
8523 WandExport MagickBooleanType MagickSetImageAlphaChannel(MagickWand *wand,
8524 const AlphaChannelType alpha_type)
8526 assert(wand != (MagickWand *) NULL);
8527 assert(wand->signature == WandSignature);
8528 if (wand->debug != MagickFalse)
8529 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8530 if (wand->images == (Image *) NULL)
8531 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8532 return(SetImageAlphaChannel(wand->images,alpha_type,&wand->images->exception));
8536 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8540 % 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 %
8544 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8546 % MagickSetImageBackgroundColor() sets the image background color.
8548 % The format of the MagickSetImageBackgroundColor method is:
8550 % MagickBooleanType MagickSetImageBackgroundColor(MagickWand *wand,
8551 % const PixelWand *background)
8553 % A description of each parameter follows:
8555 % o wand: the magick wand.
8557 % o background: the background pixel wand.
8560 WandExport MagickBooleanType MagickSetImageBackgroundColor(MagickWand *wand,
8561 const PixelWand *background)
8563 assert(wand != (MagickWand *) NULL);
8564 assert(wand->signature == WandSignature);
8565 if (wand->debug != MagickFalse)
8566 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8567 if (wand->images == (Image *) NULL)
8568 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8569 PixelGetQuantumPacket(background,&wand->images->background_color);
8574 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8578 % M a g i c k S e t I m a g e B i a s %
8582 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8584 % MagickSetImageBias() sets the image bias for any method that convolves an
8585 % image (e.g. MagickConvolveImage()).
8587 % The format of the MagickSetImageBias method is:
8589 % MagickBooleanType MagickSetImageBias(MagickWand *wand,
8590 % const double bias)
8592 % A description of each parameter follows:
8594 % o wand: the magick wand.
8596 % o bias: the image bias.
8599 WandExport MagickBooleanType MagickSetImageBias(MagickWand *wand,
8602 assert(wand != (MagickWand *) NULL);
8603 assert(wand->signature == WandSignature);
8604 if (wand->debug != MagickFalse)
8605 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8606 if (wand->images == (Image *) NULL)
8607 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8608 wand->images->bias=bias;
8613 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8617 % 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 %
8621 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8623 % MagickSetImageBluePrimary() sets the image chromaticity blue primary point.
8625 % The format of the MagickSetImageBluePrimary method is:
8627 % MagickBooleanType MagickSetImageBluePrimary(MagickWand *wand,
8628 % const double x,const double y)
8630 % A description of each parameter follows:
8632 % o wand: the magick wand.
8634 % o x: the blue primary x-point.
8636 % o y: the blue primary y-point.
8639 WandExport MagickBooleanType MagickSetImageBluePrimary(MagickWand *wand,
8640 const double x,const double y)
8642 assert(wand != (MagickWand *) NULL);
8643 assert(wand->signature == WandSignature);
8644 if (wand->debug != MagickFalse)
8645 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8646 if (wand->images == (Image *) NULL)
8647 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8648 wand->images->chromaticity.blue_primary.x=x;
8649 wand->images->chromaticity.blue_primary.y=y;
8654 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8658 % 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 %
8662 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8664 % MagickSetImageBorderColor() sets the image border color.
8666 % The format of the MagickSetImageBorderColor method is:
8668 % MagickBooleanType MagickSetImageBorderColor(MagickWand *wand,
8669 % const PixelWand *border)
8671 % A description of each parameter follows:
8673 % o wand: the magick wand.
8675 % o border: the border pixel wand.
8678 WandExport MagickBooleanType MagickSetImageBorderColor(MagickWand *wand,
8679 const PixelWand *border)
8681 assert(wand != (MagickWand *) NULL);
8682 assert(wand->signature == WandSignature);
8683 if (wand->debug != MagickFalse)
8684 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8685 if (wand->images == (Image *) NULL)
8686 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8687 PixelGetQuantumPacket(border,&wand->images->border_color);
8692 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8696 % M a g i c k S e t I m a g e C l i p M a s k %
8700 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8702 % MagickSetImageClipMask() sets image clip mask.
8704 % The format of the MagickSetImageClipMask method is:
8706 % MagickBooleanType MagickSetImageClipMask(MagickWand *wand,
8707 % const MagickWand *clip_mask)
8709 % A description of each parameter follows:
8711 % o wand: the magick wand.
8713 % o clip_mask: the clip_mask wand.
8716 WandExport MagickBooleanType MagickSetImageClipMask(MagickWand *wand,
8717 const MagickWand *clip_mask)
8719 assert(wand != (MagickWand *) NULL);
8720 assert(wand->signature == WandSignature);
8721 if (wand->debug != MagickFalse)
8722 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8723 assert(clip_mask != (MagickWand *) NULL);
8724 assert(clip_mask->signature == WandSignature);
8725 if (wand->debug != MagickFalse)
8726 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",clip_mask->name);
8727 if (clip_mask->images == (Image *) NULL)
8728 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8729 return(SetImageClipMask(wand->images,clip_mask->images));
8733 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8737 % M a g i c k S e t I m a g e C o l o r %
8741 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8743 % MagickSetImageColor() set the entire wand canvas to the specified color.
8745 % The format of the MagickSetImageColor method is:
8747 % MagickBooleanType MagickSetImageColor(MagickWand *wand,
8748 % const PixelWand *color)
8750 % A description of each parameter follows:
8752 % o wand: the magick wand.
8754 % o background: the image color.
8757 WandExport MagickBooleanType MagickSetImageColor(MagickWand *wand,
8758 const PixelWand *color)
8766 assert(wand != (MagickWand *) NULL);
8767 assert(wand->signature == WandSignature);
8768 if (wand->debug != MagickFalse)
8769 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8770 PixelGetMagickColor(color,&pixel);
8771 status=SetImageColor(wand->images,&pixel);
8772 if (status == MagickFalse)
8773 InheritException(wand->exception,&wand->images->exception);
8778 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8782 % 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 %
8786 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8788 % MagickSetImageColormapColor() sets the color of the specified colormap
8791 % The format of the MagickSetImageColormapColor method is:
8793 % MagickBooleanType MagickSetImageColormapColor(MagickWand *wand,
8794 % const size_t index,const PixelWand *color)
8796 % A description of each parameter follows:
8798 % o wand: the magick wand.
8800 % o index: the offset into the image colormap.
8802 % o color: Return the colormap color in this wand.
8805 WandExport MagickBooleanType MagickSetImageColormapColor(MagickWand *wand,
8806 const size_t index,const PixelWand *color)
8808 assert(wand != (MagickWand *) NULL);
8809 assert(wand->signature == WandSignature);
8810 if (wand->debug != MagickFalse)
8811 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8812 if (wand->images == (Image *) NULL)
8813 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8814 if ((wand->images->colormap == (PixelPacket *) NULL) ||
8815 (index >= wand->images->colors))
8816 ThrowWandException(WandError,"InvalidColormapIndex",wand->name);
8817 PixelGetQuantumPacket(color,wand->images->colormap+index);
8818 return(SyncImage(wand->images));
8822 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8826 % M a g i c k S e t I m a g e C o l o r s p a c e %
8830 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8832 % MagickSetImageColorspace() sets the image colorspace.
8834 % The format of the MagickSetImageColorspace method is:
8836 % MagickBooleanType MagickSetImageColorspace(MagickWand *wand,
8837 % const ColorspaceType colorspace)
8839 % A description of each parameter follows:
8841 % o wand: the magick wand.
8843 % o colorspace: the image colorspace: UndefinedColorspace, RGBColorspace,
8844 % GRAYColorspace, TransparentColorspace, OHTAColorspace, XYZColorspace,
8845 % YCbCrColorspace, YCCColorspace, YIQColorspace, YPbPrColorspace,
8846 % YPbPrColorspace, YUVColorspace, CMYKColorspace, sRGBColorspace,
8847 % HSLColorspace, or HWBColorspace.
8850 WandExport MagickBooleanType MagickSetImageColorspace(MagickWand *wand,
8851 const ColorspaceType colorspace)
8853 assert(wand != (MagickWand *) NULL);
8854 assert(wand->signature == WandSignature);
8855 if (wand->debug != MagickFalse)
8856 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8857 if (wand->images == (Image *) NULL)
8858 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8859 return(SetImageColorspace(wand->images,colorspace,&wand->images->exception));
8863 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8867 % M a g i c k S e t I m a g e C o m p o s e %
8871 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8873 % MagickSetImageCompose() sets the image composite operator, useful for
8874 % specifying how to composite the image thumbnail when using the
8875 % MagickMontageImage() method.
8877 % The format of the MagickSetImageCompose method is:
8879 % MagickBooleanType MagickSetImageCompose(MagickWand *wand,
8880 % const CompositeOperator compose)
8882 % A description of each parameter follows:
8884 % o wand: the magick wand.
8886 % o compose: the image composite operator.
8889 WandExport MagickBooleanType MagickSetImageCompose(MagickWand *wand,
8890 const CompositeOperator compose)
8892 assert(wand != (MagickWand *) NULL);
8893 assert(wand->signature == WandSignature);
8894 if (wand->debug != MagickFalse)
8895 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8896 if (wand->images == (Image *) NULL)
8897 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8898 wand->images->compose=compose;
8903 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8907 % 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 %
8911 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8913 % MagickSetImageCompression() sets the image compression.
8915 % The format of the MagickSetImageCompression method is:
8917 % MagickBooleanType MagickSetImageCompression(MagickWand *wand,
8918 % const CompressionType compression)
8920 % A description of each parameter follows:
8922 % o wand: the magick wand.
8924 % o compression: the image compression type.
8927 WandExport MagickBooleanType MagickSetImageCompression(MagickWand *wand,
8928 const CompressionType compression)
8930 assert(wand != (MagickWand *) NULL);
8931 assert(wand->signature == WandSignature);
8932 if (wand->debug != MagickFalse)
8933 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8934 if (wand->images == (Image *) NULL)
8935 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8936 wand->images->compression=compression;
8941 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8945 % 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 %
8949 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8951 % MagickSetImageCompressionQuality() sets the image compression quality.
8953 % The format of the MagickSetImageCompressionQuality method is:
8955 % MagickBooleanType MagickSetImageCompressionQuality(MagickWand *wand,
8956 % const size_t quality)
8958 % A description of each parameter follows:
8960 % o wand: the magick wand.
8962 % o quality: the image compression tlityype.
8965 WandExport MagickBooleanType MagickSetImageCompressionQuality(MagickWand *wand,
8966 const size_t quality)
8968 assert(wand != (MagickWand *) NULL);
8969 assert(wand->signature == WandSignature);
8970 if (wand->debug != MagickFalse)
8971 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
8972 if (wand->images == (Image *) NULL)
8973 ThrowWandException(WandError,"ContainsNoImages",wand->name);
8974 wand->images->quality=quality;
8979 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8983 % M a g i c k S e t I m a g e D e l a y %
8987 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8989 % MagickSetImageDelay() sets the image delay.
8991 % The format of the MagickSetImageDelay method is:
8993 % MagickBooleanType MagickSetImageDelay(MagickWand *wand,
8994 % const size_t delay)
8996 % A description of each parameter follows:
8998 % o wand: the magick wand.
9000 % o delay: the image delay in ticks-per-second units.
9003 WandExport MagickBooleanType MagickSetImageDelay(MagickWand *wand,
9006 assert(wand != (MagickWand *) NULL);
9007 assert(wand->signature == WandSignature);
9008 if (wand->debug != MagickFalse)
9009 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9010 if (wand->images == (Image *) NULL)
9011 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9012 wand->images->delay=delay;
9017 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9021 % M a g i c k S e t I m a g e D e p t h %
9025 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9027 % MagickSetImageDepth() sets the image depth.
9029 % The format of the MagickSetImageDepth method is:
9031 % MagickBooleanType MagickSetImageDepth(MagickWand *wand,
9032 % const size_t depth)
9034 % A description of each parameter follows:
9036 % o wand: the magick wand.
9038 % o depth: the image depth in bits: 8, 16, or 32.
9041 WandExport MagickBooleanType MagickSetImageDepth(MagickWand *wand,
9044 assert(wand != (MagickWand *) NULL);
9045 assert(wand->signature == WandSignature);
9046 if (wand->debug != MagickFalse)
9047 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9048 if (wand->images == (Image *) NULL)
9049 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9050 return(SetImageDepth(wand->images,depth));
9054 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9058 % M a g i c k S e t I m a g e D i s p o s e %
9062 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9064 % MagickSetImageDispose() sets the image disposal method.
9066 % The format of the MagickSetImageDispose method is:
9068 % MagickBooleanType MagickSetImageDispose(MagickWand *wand,
9069 % const DisposeType dispose)
9071 % A description of each parameter follows:
9073 % o wand: the magick wand.
9075 % o dispose: the image disposeal type.
9078 WandExport MagickBooleanType MagickSetImageDispose(MagickWand *wand,
9079 const DisposeType dispose)
9081 assert(wand != (MagickWand *) NULL);
9082 assert(wand->signature == WandSignature);
9083 if (wand->debug != MagickFalse)
9084 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9085 if (wand->images == (Image *) NULL)
9086 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9087 wand->images->dispose=dispose;
9092 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9096 % M a g i c k S e t I m a g e E x t e n t %
9100 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9102 % MagickSetImageExtent() sets the image size (i.e. columns & rows).
9104 % The format of the MagickSetImageExtent method is:
9106 % MagickBooleanType MagickSetImageExtent(MagickWand *wand,
9107 % const size_t columns,const unsigned rows)
9109 % A description of each parameter follows:
9111 % o wand: the magick wand.
9113 % o columns: The image width in pixels.
9115 % o rows: The image height in pixels.
9118 WandExport MagickBooleanType MagickSetImageExtent(MagickWand *wand,
9119 const size_t columns,const size_t rows)
9121 assert(wand != (MagickWand *) NULL);
9122 assert(wand->signature == WandSignature);
9123 if (wand->debug != MagickFalse)
9124 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9125 if (wand->images == (Image *) NULL)
9126 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9127 return(SetImageExtent(wand->images,columns,rows,&wand->images->exception));
9131 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9135 % M a g i c k S e t I m a g e F i l e n a m e %
9139 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9141 % MagickSetImageFilename() sets the filename of a particular image in a
9144 % The format of the MagickSetImageFilename method is:
9146 % MagickBooleanType MagickSetImageFilename(MagickWand *wand,
9147 % const char *filename)
9149 % A description of each parameter follows:
9151 % o wand: the magick wand.
9153 % o filename: the image filename.
9156 WandExport MagickBooleanType MagickSetImageFilename(MagickWand *wand,
9157 const char *filename)
9159 assert(wand != (MagickWand *) NULL);
9160 assert(wand->signature == WandSignature);
9161 if (wand->debug != MagickFalse)
9162 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9163 if (wand->images == (Image *) NULL)
9164 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9165 if (filename != (const char *) NULL)
9166 (void) CopyMagickString(wand->images->filename,filename,MaxTextExtent);
9171 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9175 % M a g i c k S e t I m a g e F o r m a t %
9179 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9181 % MagickSetImageFormat() sets the format of a particular image in a
9184 % The format of the MagickSetImageFormat method is:
9186 % MagickBooleanType MagickSetImageFormat(MagickWand *wand,
9187 % const char *format)
9189 % A description of each parameter follows:
9191 % o wand: the magick wand.
9193 % o format: the image format.
9196 WandExport MagickBooleanType MagickSetImageFormat(MagickWand *wand,
9202 assert(wand != (MagickWand *) NULL);
9203 assert(wand->signature == WandSignature);
9204 if (wand->debug != MagickFalse)
9205 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9206 if (wand->images == (Image *) NULL)
9207 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9208 if ((format == (char *) NULL) || (*format == '\0'))
9210 *wand->images->magick='\0';
9213 magick_info=GetMagickInfo(format,wand->exception);
9214 if (magick_info == (const MagickInfo *) NULL)
9215 return(MagickFalse);
9216 ClearMagickException(wand->exception);
9217 (void) CopyMagickString(wand->images->magick,format,MaxTextExtent);
9222 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9226 % M a g i c k S e t I m a g e F u z z %
9230 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9232 % MagickSetImageFuzz() sets the image fuzz.
9234 % The format of the MagickSetImageFuzz method is:
9236 % MagickBooleanType MagickSetImageFuzz(MagickWand *wand,
9237 % const double fuzz)
9239 % A description of each parameter follows:
9241 % o wand: the magick wand.
9243 % o fuzz: the image fuzz.
9246 WandExport MagickBooleanType MagickSetImageFuzz(MagickWand *wand,
9249 assert(wand != (MagickWand *) NULL);
9250 assert(wand->signature == WandSignature);
9251 if (wand->debug != MagickFalse)
9252 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9253 if (wand->images == (Image *) NULL)
9254 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9255 wand->images->fuzz=fuzz;
9260 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9264 % M a g i c k S e t I m a g e G a m m a %
9268 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9270 % MagickSetImageGamma() sets the image gamma.
9272 % The format of the MagickSetImageGamma method is:
9274 % MagickBooleanType MagickSetImageGamma(MagickWand *wand,
9275 % const double gamma)
9277 % A description of each parameter follows:
9279 % o wand: the magick wand.
9281 % o gamma: the image gamma.
9284 WandExport MagickBooleanType MagickSetImageGamma(MagickWand *wand,
9287 assert(wand != (MagickWand *) NULL);
9288 assert(wand->signature == WandSignature);
9289 if (wand->debug != MagickFalse)
9290 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9291 if (wand->images == (Image *) NULL)
9292 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9293 wand->images->gamma=gamma;
9298 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9302 % M a g i c k S e t I m a g e G r a v i t y %
9306 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9308 % MagickSetImageGravity() sets the image gravity type.
9310 % The format of the MagickSetImageGravity method is:
9312 % MagickBooleanType MagickSetImageGravity(MagickWand *wand,
9313 % const GravityType gravity)
9315 % A description of each parameter follows:
9317 % o wand: the magick wand.
9319 % o gravity: the image interlace scheme: NoInterlace, LineInterlace,
9320 % PlaneInterlace, PartitionInterlace.
9323 WandExport MagickBooleanType MagickSetImageGravity(MagickWand *wand,
9324 const GravityType gravity)
9326 assert(wand != (MagickWand *) NULL);
9327 assert(wand->signature == WandSignature);
9328 if (wand->debug != MagickFalse)
9329 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9330 if (wand->images == (Image *) NULL)
9331 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9332 wand->images->gravity=gravity;
9337 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9341 % 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 %
9345 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9347 % MagickSetImageGreenPrimary() sets the image chromaticity green primary
9350 % The format of the MagickSetImageGreenPrimary method is:
9352 % MagickBooleanType MagickSetImageGreenPrimary(MagickWand *wand,
9353 % const double x,const double y)
9355 % A description of each parameter follows:
9357 % o wand: the magick wand.
9359 % o x: the green primary x-point.
9361 % o y: the green primary y-point.
9365 WandExport MagickBooleanType MagickSetImageGreenPrimary(MagickWand *wand,
9366 const double x,const double y)
9368 assert(wand != (MagickWand *) NULL);
9369 assert(wand->signature == WandSignature);
9370 if (wand->debug != MagickFalse)
9371 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9372 if (wand->images == (Image *) NULL)
9373 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9374 wand->images->chromaticity.green_primary.x=x;
9375 wand->images->chromaticity.green_primary.y=y;
9380 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9384 % 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 %
9388 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9390 % MagickSetImageInterlaceScheme() sets the image interlace scheme.
9392 % The format of the MagickSetImageInterlaceScheme method is:
9394 % MagickBooleanType MagickSetImageInterlaceScheme(MagickWand *wand,
9395 % const InterlaceType interlace)
9397 % A description of each parameter follows:
9399 % o wand: the magick wand.
9401 % o interlace: the image interlace scheme: NoInterlace, LineInterlace,
9402 % PlaneInterlace, PartitionInterlace.
9405 WandExport MagickBooleanType MagickSetImageInterlaceScheme(MagickWand *wand,
9406 const InterlaceType interlace)
9408 assert(wand != (MagickWand *) NULL);
9409 assert(wand->signature == WandSignature);
9410 if (wand->debug != MagickFalse)
9411 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9412 if (wand->images == (Image *) NULL)
9413 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9414 wand->images->interlace=interlace;
9419 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9423 % 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 %
9427 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9429 % MagickSetImageInterpolateMethod() sets the image interpolate pixel method.
9431 % The format of the MagickSetImageInterpolateMethod method is:
9433 % MagickBooleanType MagickSetImageInterpolateMethod(MagickWand *wand,
9434 % const InterpolatePixelMethod method)
9436 % A description of each parameter follows:
9438 % o wand: the magick wand.
9440 % o method: the image interpole pixel methods: choose from Undefined,
9441 % Average, Bicubic, Bilinear, Filter, Integer, Mesh, NearestNeighbor.
9444 WandExport MagickBooleanType MagickSetImageInterpolateMethod(MagickWand *wand,
9445 const InterpolatePixelMethod method)
9447 assert(wand != (MagickWand *) NULL);
9448 assert(wand->signature == WandSignature);
9449 if (wand->debug != MagickFalse)
9450 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9451 if (wand->images == (Image *) NULL)
9452 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9453 wand->images->interpolate=method;
9458 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9462 % M a g i c k S e t I m a g e I t e r a t i o n s %
9466 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9468 % MagickSetImageIterations() sets the image iterations.
9470 % The format of the MagickSetImageIterations method is:
9472 % MagickBooleanType MagickSetImageIterations(MagickWand *wand,
9473 % const size_t iterations)
9475 % A description of each parameter follows:
9477 % o wand: the magick wand.
9479 % o delay: the image delay in 1/100th of a second.
9482 WandExport MagickBooleanType MagickSetImageIterations(MagickWand *wand,
9483 const size_t iterations)
9485 assert(wand != (MagickWand *) NULL);
9486 assert(wand->signature == WandSignature);
9487 if (wand->debug != MagickFalse)
9488 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9489 if (wand->images == (Image *) NULL)
9490 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9491 wand->images->iterations=iterations;
9496 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9500 % M a g i c k S e t I m a g e M a t t e %
9504 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9506 % MagickSetImageMatte() sets the image matte channel.
9508 % The format of the MagickSetImageMatteColor method is:
9510 % MagickBooleanType MagickSetImageMatteColor(MagickWand *wand,
9511 % const MagickBooleanType *matte)
9513 % A description of each parameter follows:
9515 % o wand: the magick wand.
9517 % o matte: Set to MagickTrue to enable the image matte channel otherwise
9521 WandExport MagickBooleanType MagickSetImageMatte(MagickWand *wand,
9522 const MagickBooleanType matte)
9524 assert(wand != (MagickWand *) NULL);
9525 assert(wand->signature == WandSignature);
9526 if (wand->debug != MagickFalse)
9527 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9528 if (wand->images == (Image *) NULL)
9529 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9530 if ((wand->images->matte == MagickFalse) && (matte != MagickFalse))
9531 (void) SetImageOpacity(wand->images,OpaqueAlpha);
9532 wand->images->matte=matte;
9537 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9541 % M a g i c k S e t I m a g e M a t t e C o l o r %
9545 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9547 % MagickSetImageMatteColor() sets the image matte color.
9549 % The format of the MagickSetImageMatteColor method is:
9551 % MagickBooleanType MagickSetImageMatteColor(MagickWand *wand,
9552 % const PixelWand *matte)
9554 % A description of each parameter follows:
9556 % o wand: the magick wand.
9558 % o matte: the matte pixel wand.
9561 WandExport MagickBooleanType MagickSetImageMatteColor(MagickWand *wand,
9562 const PixelWand *matte)
9564 assert(wand != (MagickWand *) NULL);
9565 assert(wand->signature == WandSignature);
9566 if (wand->debug != MagickFalse)
9567 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9568 if (wand->images == (Image *) NULL)
9569 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9570 PixelGetQuantumPacket(matte,&wand->images->matte_color);
9575 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9579 % M a g i c k S e t I m a g e O p a c i t y %
9583 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9585 % MagickSetImageOpacity() sets the image to the specified opacity level.
9587 % The format of the MagickSetImageOpacity method is:
9589 % MagickBooleanType MagickSetImageOpacity(MagickWand *wand,
9590 % const double alpha)
9592 % A description of each parameter follows:
9594 % o wand: the magick wand.
9596 % o alpha: the level of transparency: 1.0 is fully opaque and 0.0 is fully
9600 WandExport MagickBooleanType MagickSetImageOpacity(MagickWand *wand,
9606 assert(wand != (MagickWand *) NULL);
9607 assert(wand->signature == WandSignature);
9608 if (wand->debug != MagickFalse)
9609 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9610 if (wand->images == (Image *) NULL)
9611 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9612 status=SetImageOpacity(wand->images,ClampToQuantum(QuantumRange*alpha));
9613 if (status == MagickFalse)
9614 InheritException(wand->exception,&wand->images->exception);
9619 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9623 % 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 %
9627 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9629 % MagickSetImageOrientation() sets the image orientation.
9631 % The format of the MagickSetImageOrientation method is:
9633 % MagickBooleanType MagickSetImageOrientation(MagickWand *wand,
9634 % const OrientationType orientation)
9636 % A description of each parameter follows:
9638 % o wand: the magick wand.
9640 % o orientation: the image orientation type.
9643 WandExport MagickBooleanType MagickSetImageOrientation(MagickWand *wand,
9644 const OrientationType orientation)
9646 assert(wand != (MagickWand *) NULL);
9647 assert(wand->signature == WandSignature);
9648 if (wand->debug != MagickFalse)
9649 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9650 if (wand->images == (Image *) NULL)
9651 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9652 wand->images->orientation=orientation;
9657 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9661 % M a g i c k S e t I m a g e P a g e %
9665 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9667 % MagickSetImagePage() sets the page geometry of the image.
9669 % The format of the MagickSetImagePage method is:
9671 % MagickBooleanType MagickSetImagePage(MagickWand *wand,
9672 % const size_t width,const size_t height,const ssize_t x,
9675 % A description of each parameter follows:
9677 % o wand: the magick wand.
9679 % o width: the page width.
9681 % o height: the page height.
9683 % o x: the page x-offset.
9685 % o y: the page y-offset.
9688 WandExport MagickBooleanType MagickSetImagePage(MagickWand *wand,
9689 const size_t width,const size_t height,const ssize_t x,
9692 assert(wand != (MagickWand *) NULL);
9693 assert(wand->signature == WandSignature);
9694 if (wand->debug != MagickFalse)
9695 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9696 if (wand->images == (Image *) NULL)
9697 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9698 wand->images->page.width=width;
9699 wand->images->page.height=height;
9700 wand->images->page.x=x;
9701 wand->images->page.y=y;
9706 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9710 % 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 %
9714 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9716 % MagickSetImageProgressMonitor() sets the wand image progress monitor to the
9717 % specified method and returns the previous progress monitor if any. The
9718 % progress monitor method looks like this:
9720 % MagickBooleanType MagickProgressMonitor(const char *text,
9721 % const MagickOffsetType offset,const MagickSizeType span,
9722 % void *client_data)
9724 % If the progress monitor returns MagickFalse, the current operation is
9727 % The format of the MagickSetImageProgressMonitor method is:
9729 % MagickProgressMonitor MagickSetImageProgressMonitor(MagickWand *wand
9730 % const MagickProgressMonitor progress_monitor,void *client_data)
9732 % A description of each parameter follows:
9734 % o wand: the magick wand.
9736 % o progress_monitor: Specifies a pointer to a method to monitor progress
9737 % of an image operation.
9739 % o client_data: Specifies a pointer to any client data.
9742 WandExport MagickProgressMonitor MagickSetImageProgressMonitor(MagickWand *wand,
9743 const MagickProgressMonitor progress_monitor,void *client_data)
9745 MagickProgressMonitor
9748 assert(wand != (MagickWand *) NULL);
9749 assert(wand->signature == WandSignature);
9750 if (wand->debug != MagickFalse)
9751 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9752 if (wand->images == (Image *) NULL)
9754 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
9755 "ContainsNoImages","`%s'",wand->name);
9756 return((MagickProgressMonitor) NULL);
9758 previous_monitor=SetImageProgressMonitor(wand->images,
9759 progress_monitor,client_data);
9760 return(previous_monitor);
9764 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9768 % M a g i c k S e t I m a g e R e d P r i m a r y %
9772 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9774 % MagickSetImageRedPrimary() sets the image chromaticity red primary point.
9776 % The format of the MagickSetImageRedPrimary method is:
9778 % MagickBooleanType MagickSetImageRedPrimary(MagickWand *wand,
9779 % const double x,const double y)
9781 % A description of each parameter follows:
9783 % o wand: the magick wand.
9785 % o x: the red primary x-point.
9787 % o y: the red primary y-point.
9790 WandExport MagickBooleanType MagickSetImageRedPrimary(MagickWand *wand,
9791 const double x,const double y)
9793 assert(wand != (MagickWand *) NULL);
9794 assert(wand->signature == WandSignature);
9795 if (wand->debug != MagickFalse)
9796 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9797 if (wand->images == (Image *) NULL)
9798 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9799 wand->images->chromaticity.red_primary.x=x;
9800 wand->images->chromaticity.red_primary.y=y;
9805 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9809 % 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 %
9813 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9815 % MagickSetImageRenderingIntent() sets the image rendering intent.
9817 % The format of the MagickSetImageRenderingIntent method is:
9819 % MagickBooleanType MagickSetImageRenderingIntent(MagickWand *wand,
9820 % const RenderingIntent rendering_intent)
9822 % A description of each parameter follows:
9824 % o wand: the magick wand.
9826 % o rendering_intent: the image rendering intent: UndefinedIntent,
9827 % SaturationIntent, PerceptualIntent, AbsoluteIntent, or RelativeIntent.
9830 WandExport MagickBooleanType MagickSetImageRenderingIntent(MagickWand *wand,
9831 const RenderingIntent rendering_intent)
9833 assert(wand != (MagickWand *) NULL);
9834 assert(wand->signature == WandSignature);
9835 if (wand->debug != MagickFalse)
9836 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9837 if (wand->images == (Image *) NULL)
9838 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9839 wand->images->rendering_intent=rendering_intent;
9844 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9848 % M a g i c k S e t I m a g e R e s o l u t i o n %
9852 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9854 % MagickSetImageResolution() sets the image resolution.
9856 % The format of the MagickSetImageResolution method is:
9858 % MagickBooleanType MagickSetImageResolution(MagickWand *wand,
9859 % const double x_resolution,const doubtl y_resolution)
9861 % A description of each parameter follows:
9863 % o wand: the magick wand.
9865 % o x_resolution: the image x resolution.
9867 % o y_resolution: the image y resolution.
9870 WandExport MagickBooleanType MagickSetImageResolution(MagickWand *wand,
9871 const double x_resolution,const double y_resolution)
9873 assert(wand != (MagickWand *) NULL);
9874 assert(wand->signature == WandSignature);
9875 if (wand->debug != MagickFalse)
9876 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9877 if (wand->images == (Image *) NULL)
9878 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9879 wand->images->x_resolution=x_resolution;
9880 wand->images->y_resolution=y_resolution;
9885 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9889 % M a g i c k S e t I m a g e S c e n e %
9893 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9895 % MagickSetImageScene() sets the image scene.
9897 % The format of the MagickSetImageScene method is:
9899 % MagickBooleanType MagickSetImageScene(MagickWand *wand,
9900 % const size_t scene)
9902 % A description of each parameter follows:
9904 % o wand: the magick wand.
9906 % o delay: the image scene number.
9909 WandExport MagickBooleanType MagickSetImageScene(MagickWand *wand,
9912 assert(wand != (MagickWand *) NULL);
9913 assert(wand->signature == WandSignature);
9914 if (wand->debug != MagickFalse)
9915 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9916 if (wand->images == (Image *) NULL)
9917 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9918 wand->images->scene=scene;
9923 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9927 % 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 %
9931 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9933 % MagickSetImageTicksPerSecond() sets the image ticks-per-second.
9935 % The format of the MagickSetImageTicksPerSecond method is:
9937 % MagickBooleanType MagickSetImageTicksPerSecond(MagickWand *wand,
9938 % const ssize_t ticks_per-second)
9940 % A description of each parameter follows:
9942 % o wand: the magick wand.
9944 % o ticks_per_second: the units to use for the image delay.
9947 WandExport MagickBooleanType MagickSetImageTicksPerSecond(MagickWand *wand,
9948 const ssize_t ticks_per_second)
9950 assert(wand != (MagickWand *) NULL);
9951 assert(wand->signature == WandSignature);
9952 if (wand->debug != MagickFalse)
9953 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9954 if (wand->images == (Image *) NULL)
9955 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9956 wand->images->ticks_per_second=ticks_per_second;
9961 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9965 % M a g i c k S e t I m a g e T y p e %
9969 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9971 % MagickSetImageType() sets the image type.
9973 % The format of the MagickSetImageType method is:
9975 % MagickBooleanType MagickSetImageType(MagickWand *wand,
9976 % const ImageType image_type)
9978 % A description of each parameter follows:
9980 % o wand: the magick wand.
9982 % o image_type: the image type: UndefinedType, BilevelType, GrayscaleType,
9983 % GrayscaleMatteType, PaletteType, PaletteMatteType, TrueColorType,
9984 % TrueColorMatteType, ColorSeparationType, ColorSeparationMatteType,
9988 WandExport MagickBooleanType MagickSetImageType(MagickWand *wand,
9989 const ImageType image_type)
9991 assert(wand != (MagickWand *) NULL);
9992 assert(wand->signature == WandSignature);
9993 if (wand->debug != MagickFalse)
9994 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
9995 if (wand->images == (Image *) NULL)
9996 ThrowWandException(WandError,"ContainsNoImages",wand->name);
9997 return(SetImageType(wand->images,image_type));
10001 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10005 % M a g i c k S e t I m a g e U n i t s %
10009 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10011 % MagickSetImageUnits() sets the image units of resolution.
10013 % The format of the MagickSetImageUnits method is:
10015 % MagickBooleanType MagickSetImageUnits(MagickWand *wand,
10016 % const ResolutionType units)
10018 % A description of each parameter follows:
10020 % o wand: the magick wand.
10022 % o units: the image units of resolution : UndefinedResolution,
10023 % PixelsPerInchResolution, or PixelsPerCentimeterResolution.
10026 WandExport MagickBooleanType MagickSetImageUnits(MagickWand *wand,
10027 const ResolutionType units)
10029 assert(wand != (MagickWand *) NULL);
10030 assert(wand->signature == WandSignature);
10031 if (wand->debug != MagickFalse)
10032 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10033 if (wand->images == (Image *) NULL)
10034 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10035 wand->images->units=units;
10036 return(MagickTrue);
10040 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10044 % 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 %
10048 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10050 % MagickSetImageVirtualPixelMethod() sets the image virtual pixel method.
10052 % The format of the MagickSetImageVirtualPixelMethod method is:
10054 % VirtualPixelMethod MagickSetImageVirtualPixelMethod(MagickWand *wand,
10055 % const VirtualPixelMethod method)
10057 % A description of each parameter follows:
10059 % o wand: the magick wand.
10061 % o method: the image virtual pixel method : UndefinedVirtualPixelMethod,
10062 % ConstantVirtualPixelMethod, EdgeVirtualPixelMethod,
10063 % MirrorVirtualPixelMethod, or TileVirtualPixelMethod.
10066 WandExport VirtualPixelMethod MagickSetImageVirtualPixelMethod(MagickWand *wand,
10067 const VirtualPixelMethod method)
10069 assert(wand != (MagickWand *) NULL);
10070 assert(wand->signature == WandSignature);
10071 if (wand->debug != MagickFalse)
10072 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10073 if (wand->images == (Image *) NULL)
10074 return(UndefinedVirtualPixelMethod);
10075 return(SetImageVirtualPixelMethod(wand->images,method));
10079 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10083 % M a g i c k S e t I m a g e W h i t e P o i n t %
10087 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10089 % MagickSetImageWhitePoint() sets the image chromaticity white point.
10091 % The format of the MagickSetImageWhitePoint method is:
10093 % MagickBooleanType MagickSetImageWhitePoint(MagickWand *wand,
10094 % const double x,const double y)
10096 % A description of each parameter follows:
10098 % o wand: the magick wand.
10100 % o x: the white x-point.
10102 % o y: the white y-point.
10105 WandExport MagickBooleanType MagickSetImageWhitePoint(MagickWand *wand,
10106 const double x,const double y)
10108 assert(wand != (MagickWand *) NULL);
10109 assert(wand->signature == WandSignature);
10110 if (wand->debug != MagickFalse)
10111 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10112 if (wand->images == (Image *) NULL)
10113 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10114 wand->images->chromaticity.white_point.x=x;
10115 wand->images->chromaticity.white_point.y=y;
10116 return(MagickTrue);
10120 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10124 % M a g i c k S h a d e I m a g e C h a n n e l %
10128 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10130 % MagickShadeImage() shines a distant light on an image to create a
10131 % three-dimensional effect. You control the positioning of the light with
10132 % azimuth and elevation; azimuth is measured in degrees off the x axis
10133 % and elevation is measured in pixels above the Z axis.
10135 % The format of the MagickShadeImage method is:
10137 % MagickBooleanType MagickShadeImage(MagickWand *wand,
10138 % const MagickBooleanType gray,const double azimuth,
10139 % const double elevation)
10141 % A description of each parameter follows:
10143 % o wand: the magick wand.
10145 % o gray: A value other than zero shades the intensity of each pixel.
10147 % o azimuth, elevation: Define the light source direction.
10150 WandExport MagickBooleanType MagickShadeImage(MagickWand *wand,
10151 const MagickBooleanType gray,const double asimuth,const double elevation)
10156 assert(wand != (MagickWand *) NULL);
10157 assert(wand->signature == WandSignature);
10158 if (wand->debug != MagickFalse)
10159 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10160 if (wand->images == (Image *) NULL)
10161 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10162 shade_image=ShadeImage(wand->images,gray,asimuth,elevation,wand->exception);
10163 if (shade_image == (Image *) NULL)
10164 return(MagickFalse);
10165 ReplaceImageInList(&wand->images,shade_image);
10166 return(MagickTrue);
10170 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10174 % M a g i c k S h a d o w I m a g e %
10178 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10180 % MagickShadowImage() simulates an image shadow.
10182 % The format of the MagickShadowImage method is:
10184 % MagickBooleanType MagickShadowImage(MagickWand *wand,
10185 % const double opacity,const double sigma,const ssize_t x,const ssize_t y)
10187 % A description of each parameter follows:
10189 % o wand: the magick wand.
10191 % o opacity: percentage transparency.
10193 % o sigma: the standard deviation of the Gaussian, in pixels.
10195 % o x: the shadow x-offset.
10197 % o y: the shadow y-offset.
10200 WandExport MagickBooleanType MagickShadowImage(MagickWand *wand,
10201 const double opacity,const double sigma,const ssize_t x,const ssize_t y)
10206 assert(wand != (MagickWand *) NULL);
10207 assert(wand->signature == WandSignature);
10208 if (wand->debug != MagickFalse)
10209 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10210 if (wand->images == (Image *) NULL)
10211 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10212 shadow_image=ShadowImage(wand->images,opacity,sigma,x,y,wand->exception);
10213 if (shadow_image == (Image *) NULL)
10214 return(MagickFalse);
10215 ReplaceImageInList(&wand->images,shadow_image);
10216 return(MagickTrue);
10220 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10224 % M a g i c k S h a r p e n I m a g e %
10228 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10230 % MagickSharpenImage() sharpens an image. We convolve the image with a
10231 % Gaussian operator of the given radius and standard deviation (sigma).
10232 % For reasonable results, the radius should be larger than sigma. Use a
10233 % radius of 0 and MagickSharpenImage() selects a suitable radius for you.
10235 % The format of the MagickSharpenImage method is:
10237 % MagickBooleanType MagickSharpenImage(MagickWand *wand,
10238 % const double radius,const double sigma)
10240 % A description of each parameter follows:
10242 % o wand: the magick wand.
10244 % o radius: the radius of the Gaussian, in pixels, not counting the center
10247 % o sigma: the standard deviation of the Gaussian, in pixels.
10250 WandExport MagickBooleanType MagickSharpenImage(MagickWand *wand,
10251 const double radius,const double sigma)
10256 assert(wand != (MagickWand *) NULL);
10257 assert(wand->signature == WandSignature);
10258 if (wand->debug != MagickFalse)
10259 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10260 if (wand->images == (Image *) NULL)
10261 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10262 sharp_image=SharpenImage(wand->images,radius,sigma,wand->exception);
10263 if (sharp_image == (Image *) NULL)
10264 return(MagickFalse);
10265 ReplaceImageInList(&wand->images,sharp_image);
10266 return(MagickTrue);
10270 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10274 % M a g i c k S h a v e I m a g e %
10278 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10280 % MagickShaveImage() shaves pixels from the image edges. It allocates the
10281 % memory necessary for the new Image structure and returns a pointer to the
10284 % The format of the MagickShaveImage method is:
10286 % MagickBooleanType MagickShaveImage(MagickWand *wand,
10287 % const size_t columns,const size_t rows)
10289 % A description of each parameter follows:
10291 % o wand: the magick wand.
10293 % o columns: the number of columns in the scaled image.
10295 % o rows: the number of rows in the scaled image.
10299 WandExport MagickBooleanType MagickShaveImage(MagickWand *wand,
10300 const size_t columns,const size_t rows)
10308 assert(wand != (MagickWand *) NULL);
10309 assert(wand->signature == WandSignature);
10310 if (wand->debug != MagickFalse)
10311 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10312 if (wand->images == (Image *) NULL)
10313 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10314 shave_info.width=columns;
10315 shave_info.height=rows;
10318 shave_image=ShaveImage(wand->images,&shave_info,wand->exception);
10319 if (shave_image == (Image *) NULL)
10320 return(MagickFalse);
10321 ReplaceImageInList(&wand->images,shave_image);
10322 return(MagickTrue);
10326 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10330 % M a g i c k S h e a r I m a g e %
10334 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10336 % MagickShearImage() slides one edge of an image along the X or Y axis,
10337 % creating a parallelogram. An X direction shear slides an edge along the X
10338 % axis, while a Y direction shear slides an edge along the Y axis. The amount
10339 % of the shear is controlled by a shear angle. For X direction shears, x_shear
10340 % is measured relative to the Y axis, and similarly, for Y direction shears
10341 % y_shear is measured relative to the X axis. Empty triangles left over from
10342 % shearing the image are filled with the background color.
10344 % The format of the MagickShearImage method is:
10346 % MagickBooleanType MagickShearImage(MagickWand *wand,
10347 % const PixelWand *background,const double x_shear,onst double y_shear)
10349 % A description of each parameter follows:
10351 % o wand: the magick wand.
10353 % o background: the background pixel wand.
10355 % o x_shear: the number of degrees to shear the image.
10357 % o y_shear: the number of degrees to shear the image.
10360 WandExport MagickBooleanType MagickShearImage(MagickWand *wand,
10361 const PixelWand *background,const double x_shear,const double y_shear)
10366 assert(wand != (MagickWand *) NULL);
10367 assert(wand->signature == WandSignature);
10368 if (wand->debug != MagickFalse)
10369 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10370 if (wand->images == (Image *) NULL)
10371 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10372 PixelGetQuantumPacket(background,&wand->images->background_color);
10373 shear_image=ShearImage(wand->images,x_shear,y_shear,wand->exception);
10374 if (shear_image == (Image *) NULL)
10375 return(MagickFalse);
10376 ReplaceImageInList(&wand->images,shear_image);
10377 return(MagickTrue);
10381 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10385 % 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 %
10389 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10391 % MagickSigmoidalContrastImage() adjusts the contrast of an image with a
10392 % non-linear sigmoidal contrast algorithm. Increase the contrast of the
10393 % image using a sigmoidal transfer function without saturating highlights or
10394 % shadows. Contrast indicates how much to increase the contrast (0 is none;
10395 % 3 is typical; 20 is pushing it); mid-point indicates where midtones fall in
10396 % the resultant image (0 is white; 50% is middle-gray; 100% is black). Set
10397 % sharpen to MagickTrue to increase the image contrast otherwise the contrast
10400 % The format of the MagickSigmoidalContrastImage method is:
10402 % MagickBooleanType MagickSigmoidalContrastImage(MagickWand *wand,
10403 % const MagickBooleanType sharpen,const double alpha,const double beta)
10405 % A description of each parameter follows:
10407 % o wand: the magick wand.
10409 % o sharpen: Increase or decrease image contrast.
10411 % o alpha: strength of the contrast, the larger the number the more
10412 % 'threshold-like' it becomes.
10414 % o beta: midpoint of the function as a color value 0 to QuantumRange.
10417 WandExport MagickBooleanType MagickSigmoidalContrastImage(
10418 MagickWand *wand,const MagickBooleanType sharpen,const double alpha,
10424 assert(wand != (MagickWand *) NULL);
10425 assert(wand->signature == WandSignature);
10426 if (wand->debug != MagickFalse)
10427 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10428 if (wand->images == (Image *) NULL)
10429 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10430 status=SigmoidalContrastImage(wand->images,sharpen,alpha,beta,
10431 &wand->images->exception);
10436 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10440 % M a g i c k S i m i l a r i t y I m a g e %
10444 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10446 % MagickSimilarityImage() compares the reference image of the image and
10447 % returns the best match offset. In addition, it returns a similarity image
10448 % such that an exact match location is completely white and if none of the
10449 % pixels match, black, otherwise some gray level in-between.
10451 % The format of the MagickSimilarityImage method is:
10453 % MagickWand *MagickSimilarityImage(MagickWand *wand,
10454 % const MagickWand *reference,RectangeInfo *offset,double *similarity)
10456 % A description of each parameter follows:
10458 % o wand: the magick wand.
10460 % o reference: the reference wand.
10462 % o offset: the best match offset of the reference image within the image.
10464 % o similarity: the computed similarity between the images.
10467 WandExport MagickWand *MagickSimilarityImage(MagickWand *wand,
10468 const MagickWand *reference,RectangleInfo *offset,double *similarity)
10473 assert(wand != (MagickWand *) NULL);
10474 assert(wand->signature == WandSignature);
10475 if (wand->debug != MagickFalse)
10476 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10477 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
10479 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
10480 "ContainsNoImages","`%s'",wand->name);
10481 return((MagickWand *) NULL);
10483 similarity_image=SimilarityImage(wand->images,reference->images,offset,
10484 similarity,&wand->images->exception);
10485 if (similarity_image == (Image *) NULL)
10486 return((MagickWand *) NULL);
10487 return(CloneMagickWandFromImages(wand,similarity_image));
10491 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10495 % M a g i c k S k e t c h I m a g e %
10499 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10501 % MagickSketchImage() simulates a pencil sketch. We convolve the image with
10502 % a Gaussian operator of the given radius and standard deviation (sigma).
10503 % For reasonable results, radius should be larger than sigma. Use a
10504 % radius of 0 and SketchImage() selects a suitable radius for you.
10505 % Angle gives the angle of the blurring motion.
10507 % The format of the MagickSketchImage method is:
10509 % MagickBooleanType MagickSketchImage(MagickWand *wand,
10510 % const double radius,const double sigma,const double angle)
10512 % A description of each parameter follows:
10514 % o wand: the magick wand.
10516 % o radius: the radius of the Gaussian, in pixels, not counting
10517 % the center pixel.
10519 % o sigma: the standard deviation of the Gaussian, in pixels.
10521 % o angle: Apply the effect along this angle.
10524 WandExport MagickBooleanType MagickSketchImage(MagickWand *wand,
10525 const double radius,const double sigma,const double angle)
10530 assert(wand != (MagickWand *) NULL);
10531 assert(wand->signature == WandSignature);
10532 if (wand->debug != MagickFalse)
10533 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10534 if (wand->images == (Image *) NULL)
10535 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10536 sketch_image=SketchImage(wand->images,radius,sigma,angle,wand->exception);
10537 if (sketch_image == (Image *) NULL)
10538 return(MagickFalse);
10539 ReplaceImageInList(&wand->images,sketch_image);
10540 return(MagickTrue);
10544 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10548 % M a g i c k S m u s h I m a g e s %
10552 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10554 % MagickSmushImages() takes all images from the current image pointer to the
10555 % end of the image list and smushs them to each other top-to-bottom if the
10556 % stack parameter is true, otherwise left-to-right.
10558 % The format of the MagickSmushImages method is:
10560 % MagickWand *MagickSmushImages(MagickWand *wand,
10561 % const MagickBooleanType stack,const ssize_t offset)
10563 % A description of each parameter follows:
10565 % o wand: the magick wand.
10567 % o stack: By default, images are stacked left-to-right. Set stack to
10568 % MagickTrue to stack them top-to-bottom.
10570 % o offset: minimum distance in pixels between images.
10573 WandExport MagickWand *MagickSmushImages(MagickWand *wand,
10574 const MagickBooleanType stack,const ssize_t offset)
10579 assert(wand != (MagickWand *) NULL);
10580 assert(wand->signature == WandSignature);
10581 if (wand->debug != MagickFalse)
10582 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10583 if (wand->images == (Image *) NULL)
10584 return((MagickWand *) NULL);
10585 smush_image=SmushImages(wand->images,stack,offset,wand->exception);
10586 if (smush_image == (Image *) NULL)
10587 return((MagickWand *) NULL);
10588 return(CloneMagickWandFromImages(wand,smush_image));
10592 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10596 % M a g i c k S o l a r i z e I m a g e %
10600 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10602 % MagickSolarizeImage() applies a special effect to the image, similar to the
10603 % effect achieved in a photo darkroom by selectively exposing areas of photo
10604 % sensitive paper to light. Threshold ranges from 0 to QuantumRange and is a
10605 % measure of the extent of the solarization.
10607 % The format of the MagickSolarizeImage method is:
10609 % MagickBooleanType MagickSolarizeImage(MagickWand *wand,
10610 % const double threshold)
10612 % A description of each parameter follows:
10614 % o wand: the magick wand.
10616 % o threshold: Define the extent of the solarization.
10619 WandExport MagickBooleanType MagickSolarizeImage(MagickWand *wand,
10620 const double threshold)
10625 assert(wand != (MagickWand *) NULL);
10626 assert(wand->signature == WandSignature);
10627 if (wand->debug != MagickFalse)
10628 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10629 if (wand->images == (Image *) NULL)
10630 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10631 status=SolarizeImage(wand->images,threshold,&wand->images->exception);
10636 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10640 % M a g i c k S p a r s e C o l o r I m a g e %
10644 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10646 % MagickSparseColorImage(), given a set of coordinates, interpolates the
10647 % colors found at those coordinates, across the whole image, using various
10650 % The format of the MagickSparseColorImage method is:
10652 % MagickBooleanType MagickSparseColorImage(MagickWand *wand,
10653 % const SparseColorMethod method,const size_t number_arguments,
10654 % const double *arguments)
10656 % A description of each parameter follows:
10658 % o image: the image to be sparseed.
10660 % o method: the method of image sparseion.
10662 % ArcSparseColorion will always ignore source image offset, and always
10663 % 'bestfit' the destination image with the top left corner offset
10664 % relative to the polar mapping center.
10666 % Bilinear has no simple inverse mapping so will not allow 'bestfit'
10667 % style of image sparseion.
10669 % Affine, Perspective, and Bilinear, will do least squares fitting of
10670 % the distrotion when more than the minimum number of control point
10671 % pairs are provided.
10673 % Perspective, and Bilinear, will fall back to a Affine sparseion when
10674 % less than 4 control point pairs are provided. While Affine sparseions
10675 % will let you use any number of control point pairs, that is Zero pairs
10676 % is a No-Op (viewport only) distrotion, one pair is a translation and
10677 % two pairs of control points will do a scale-rotate-translate, without
10680 % o number_arguments: the number of arguments given for this sparseion
10683 % o arguments: the arguments for this sparseion method.
10686 WandExport MagickBooleanType MagickSparseColorImage(MagickWand *wand,
10687 const SparseColorMethod method,const size_t number_arguments,
10688 const double *arguments)
10693 assert(wand != (MagickWand *) NULL);
10694 assert(wand->signature == WandSignature);
10695 if (wand->debug != MagickFalse)
10696 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10697 if (wand->images == (Image *) NULL)
10698 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10699 sparse_image=SparseColorImage(wand->images,method,number_arguments,arguments,
10701 if (sparse_image == (Image *) NULL)
10702 return(MagickFalse);
10703 ReplaceImageInList(&wand->images,sparse_image);
10704 return(MagickTrue);
10708 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10712 % M a g i c k S p l i c e I m a g e %
10716 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10718 % MagickSpliceImage() splices a solid color into the image.
10720 % The format of the MagickSpliceImage method is:
10722 % MagickBooleanType MagickSpliceImage(MagickWand *wand,
10723 % const size_t width,const size_t height,const ssize_t x,
10726 % A description of each parameter follows:
10728 % o wand: the magick wand.
10730 % o width: the region width.
10732 % o height: the region height.
10734 % o x: the region x offset.
10736 % o y: the region y offset.
10739 WandExport MagickBooleanType MagickSpliceImage(MagickWand *wand,
10740 const size_t width,const size_t height,const ssize_t x,
10749 assert(wand != (MagickWand *) NULL);
10750 assert(wand->signature == WandSignature);
10751 if (wand->debug != MagickFalse)
10752 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10753 if (wand->images == (Image *) NULL)
10754 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10755 splice.width=width;
10756 splice.height=height;
10759 splice_image=SpliceImage(wand->images,&splice,wand->exception);
10760 if (splice_image == (Image *) NULL)
10761 return(MagickFalse);
10762 ReplaceImageInList(&wand->images,splice_image);
10763 return(MagickTrue);
10767 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10771 % M a g i c k S p r e a d I m a g e %
10775 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10777 % MagickSpreadImage() is a special effects method that randomly displaces each
10778 % pixel in a block defined by the radius parameter.
10780 % The format of the MagickSpreadImage method is:
10782 % MagickBooleanType MagickSpreadImage(MagickWand *wand,const double radius)
10784 % A description of each parameter follows:
10786 % o wand: the magick wand.
10788 % o radius: Choose a random pixel in a neighborhood of this extent.
10791 WandExport MagickBooleanType MagickSpreadImage(MagickWand *wand,
10792 const double radius)
10797 assert(wand != (MagickWand *) NULL);
10798 assert(wand->signature == WandSignature);
10799 if (wand->debug != MagickFalse)
10800 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10801 if (wand->images == (Image *) NULL)
10802 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10803 spread_image=SpreadImage(wand->images,radius,wand->exception);
10804 if (spread_image == (Image *) NULL)
10805 return(MagickFalse);
10806 ReplaceImageInList(&wand->images,spread_image);
10807 return(MagickTrue);
10811 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10815 % M a g i c k S t a t i s t i c I m a g e %
10819 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10821 % MagickStatisticImage() replace each pixel with corresponding statistic from
10822 % the neighborhood of the specified width and height.
10824 % The format of the MagickStatisticImage method is:
10826 % MagickBooleanType MagickStatisticImage(MagickWand *wand,
10827 % const StatisticType type,const double width,const size_t height)
10829 % A description of each parameter follows:
10831 % o wand: the magick wand.
10833 % o type: the statistic type (e.g. median, mode, etc.).
10835 % o width: the width of the pixel neighborhood.
10837 % o height: the height of the pixel neighborhood.
10840 WandExport MagickBooleanType MagickStatisticImage(MagickWand *wand,
10841 const StatisticType type,const size_t width,const size_t height)
10846 assert(wand != (MagickWand *) NULL);
10847 assert(wand->signature == WandSignature);
10848 if (wand->debug != MagickFalse)
10849 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10850 if (wand->images == (Image *) NULL)
10851 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10852 statistic_image=StatisticImage(wand->images,type,width,height,
10854 if (statistic_image == (Image *) NULL)
10855 return(MagickFalse);
10856 ReplaceImageInList(&wand->images,statistic_image);
10857 return(MagickTrue);
10861 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10865 % M a g i c k S t e g a n o I m a g e %
10869 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10871 % MagickSteganoImage() hides a digital watermark within the image.
10872 % Recover the hidden watermark later to prove that the authenticity of
10873 % an image. Offset defines the start position within the image to hide
10876 % The format of the MagickSteganoImage method is:
10878 % MagickWand *MagickSteganoImage(MagickWand *wand,
10879 % const MagickWand *watermark_wand,const ssize_t offset)
10881 % A description of each parameter follows:
10883 % o wand: the magick wand.
10885 % o watermark_wand: the watermark wand.
10887 % o offset: Start hiding at this offset into the image.
10890 WandExport MagickWand *MagickSteganoImage(MagickWand *wand,
10891 const MagickWand *watermark_wand,const ssize_t offset)
10896 assert(wand != (MagickWand *) NULL);
10897 assert(wand->signature == WandSignature);
10898 if (wand->debug != MagickFalse)
10899 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10900 if ((wand->images == (Image *) NULL) ||
10901 (watermark_wand->images == (Image *) NULL))
10903 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
10904 "ContainsNoImages","`%s'",wand->name);
10905 return((MagickWand *) NULL);
10907 wand->images->offset=offset;
10908 stegano_image=SteganoImage(wand->images,watermark_wand->images,
10910 if (stegano_image == (Image *) NULL)
10911 return((MagickWand *) NULL);
10912 return(CloneMagickWandFromImages(wand,stegano_image));
10916 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10920 % M a g i c k S t e r e o I m a g e %
10924 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10926 % MagickStereoImage() composites two images and produces a single image that
10927 % is the composite of a left and right image of a stereo pair
10929 % The format of the MagickStereoImage method is:
10931 % MagickWand *MagickStereoImage(MagickWand *wand,
10932 % const MagickWand *offset_wand)
10934 % A description of each parameter follows:
10936 % o wand: the magick wand.
10938 % o offset_wand: Another image wand.
10941 WandExport MagickWand *MagickStereoImage(MagickWand *wand,
10942 const MagickWand *offset_wand)
10947 assert(wand != (MagickWand *) NULL);
10948 assert(wand->signature == WandSignature);
10949 if (wand->debug != MagickFalse)
10950 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10951 if ((wand->images == (Image *) NULL) ||
10952 (offset_wand->images == (Image *) NULL))
10954 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
10955 "ContainsNoImages","`%s'",wand->name);
10956 return((MagickWand *) NULL);
10958 stereo_image=StereoImage(wand->images,offset_wand->images,wand->exception);
10959 if (stereo_image == (Image *) NULL)
10960 return((MagickWand *) NULL);
10961 return(CloneMagickWandFromImages(wand,stereo_image));
10965 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10969 % M a g i c k S t r i p I m a g e %
10973 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10975 % MagickStripImage() strips an image of all profiles and comments.
10977 % The format of the MagickStripImage method is:
10979 % MagickBooleanType MagickStripImage(MagickWand *wand)
10981 % A description of each parameter follows:
10983 % o wand: the magick wand.
10986 WandExport MagickBooleanType MagickStripImage(MagickWand *wand)
10991 assert(wand != (MagickWand *) NULL);
10992 assert(wand->signature == WandSignature);
10993 if (wand->debug != MagickFalse)
10994 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10995 if (wand->images == (Image *) NULL)
10996 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10997 status=StripImage(wand->images);
10998 if (status == MagickFalse)
10999 InheritException(wand->exception,&wand->images->exception);
11004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11008 % M a g i c k S w i r l I m a g e %
11012 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11014 % MagickSwirlImage() swirls the pixels about the center of the image, where
11015 % degrees indicates the sweep of the arc through which each pixel is moved.
11016 % You get a more dramatic effect as the degrees move from 1 to 360.
11018 % The format of the MagickSwirlImage method is:
11020 % MagickBooleanType MagickSwirlImage(MagickWand *wand,const double degrees)
11022 % A description of each parameter follows:
11024 % o wand: the magick wand.
11026 % o degrees: Define the tightness of the swirling effect.
11029 WandExport MagickBooleanType MagickSwirlImage(MagickWand *wand,
11030 const double degrees)
11035 assert(wand != (MagickWand *) NULL);
11036 assert(wand->signature == WandSignature);
11037 if (wand->debug != MagickFalse)
11038 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11039 if (wand->images == (Image *) NULL)
11040 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11041 swirl_image=SwirlImage(wand->images,degrees,wand->exception);
11042 if (swirl_image == (Image *) NULL)
11043 return(MagickFalse);
11044 ReplaceImageInList(&wand->images,swirl_image);
11045 return(MagickTrue);
11049 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11053 % M a g i c k T e x t u r e I m a g e %
11057 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11059 % MagickTextureImage() repeatedly tiles the texture image across and down the
11062 % The format of the MagickTextureImage method is:
11064 % MagickWand *MagickTextureImage(MagickWand *wand,
11065 % const MagickWand *texture_wand)
11067 % A description of each parameter follows:
11069 % o wand: the magick wand.
11071 % o texture_wand: the texture wand
11074 WandExport MagickWand *MagickTextureImage(MagickWand *wand,
11075 const MagickWand *texture_wand)
11083 assert(wand != (MagickWand *) NULL);
11084 assert(wand->signature == WandSignature);
11085 if (wand->debug != MagickFalse)
11086 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11087 if ((wand->images == (Image *) NULL) ||
11088 (texture_wand->images == (Image *) NULL))
11090 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
11091 "ContainsNoImages","`%s'",wand->name);
11092 return((MagickWand *) NULL);
11094 texture_image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
11095 if (texture_image == (Image *) NULL)
11096 return((MagickWand *) NULL);
11097 status=TextureImage(texture_image,texture_wand->images);
11098 if (status == MagickFalse)
11100 InheritException(wand->exception,&texture_image->exception);
11101 texture_image=DestroyImage(texture_image);
11102 return((MagickWand *) NULL);
11104 return(CloneMagickWandFromImages(wand,texture_image));
11108 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11112 % M a g i c k T h r e s h o l d I m a g e %
11116 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11118 % MagickThresholdImage() changes the value of individual pixels based on
11119 % the intensity of each pixel compared to threshold. The result is a
11120 % high-contrast, two color image.
11122 % The format of the MagickThresholdImage method is:
11124 % MagickBooleanType MagickThresholdImage(MagickWand *wand,
11125 % const double threshold)
11126 % MagickBooleanType MagickThresholdImageChannel(MagickWand *wand,
11127 % const ChannelType channel,const double threshold)
11129 % A description of each parameter follows:
11131 % o wand: the magick wand.
11133 % o channel: the image channel(s).
11135 % o threshold: Define the threshold value.
11138 WandExport MagickBooleanType MagickThresholdImage(MagickWand *wand,
11139 const double threshold)
11144 status=MagickThresholdImageChannel(wand,DefaultChannels,threshold);
11148 WandExport MagickBooleanType MagickThresholdImageChannel(MagickWand *wand,
11149 const ChannelType channel,const double threshold)
11154 assert(wand != (MagickWand *) NULL);
11155 assert(wand->signature == WandSignature);
11156 if (wand->debug != MagickFalse)
11157 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11158 if (wand->images == (Image *) NULL)
11159 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11160 status=BilevelImage(wand->images,threshold);
11161 if (status == MagickFalse)
11162 InheritException(wand->exception,&wand->images->exception);
11167 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11171 % M a g i c k T h u m b n a i l I m a g e %
11175 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11177 % MagickThumbnailImage() changes the size of an image to the given dimensions
11178 % and removes any associated profiles. The goal is to produce small low cost
11179 % thumbnail images suited for display on the Web.
11181 % The format of the MagickThumbnailImage method is:
11183 % MagickBooleanType MagickThumbnailImage(MagickWand *wand,
11184 % const size_t columns,const size_t rows)
11186 % A description of each parameter follows:
11188 % o wand: the magick wand.
11190 % o columns: the number of columns in the scaled image.
11192 % o rows: the number of rows in the scaled image.
11195 WandExport MagickBooleanType MagickThumbnailImage(MagickWand *wand,
11196 const size_t columns,const size_t rows)
11201 assert(wand != (MagickWand *) NULL);
11202 assert(wand->signature == WandSignature);
11203 if (wand->debug != MagickFalse)
11204 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11205 if (wand->images == (Image *) NULL)
11206 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11207 thumbnail_image=ThumbnailImage(wand->images,columns,rows,wand->exception);
11208 if (thumbnail_image == (Image *) NULL)
11209 return(MagickFalse);
11210 ReplaceImageInList(&wand->images,thumbnail_image);
11211 return(MagickTrue);
11215 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11219 % M a g i c k T i n t I m a g e %
11223 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11225 % MagickTintImage() applies a color vector to each pixel in the image. The
11226 % length of the vector is 0 for black and white and at its maximum for the
11227 % midtones. The vector weighting function is
11228 % f(x)=(1-(4.0*((x-0.5)*(x-0.5)))).
11230 % The format of the MagickTintImage method is:
11232 % MagickBooleanType MagickTintImage(MagickWand *wand,
11233 % const PixelWand *tint,const PixelWand *opacity)
11235 % A description of each parameter follows:
11237 % o wand: the magick wand.
11239 % o tint: the tint pixel wand.
11241 % o opacity: the opacity pixel wand.
11244 WandExport MagickBooleanType MagickTintImage(MagickWand *wand,
11245 const PixelWand *tint,const PixelWand *opacity)
11248 percent_opaque[MaxTextExtent];
11256 assert(wand != (MagickWand *) NULL);
11257 assert(wand->signature == WandSignature);
11258 if (wand->debug != MagickFalse)
11259 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11260 if (wand->images == (Image *) NULL)
11261 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11262 (void) FormatLocaleString(percent_opaque,MaxTextExtent,
11263 "%g,%g,%g,%g",(double) (100.0*QuantumScale*
11264 PixelGetRedQuantum(opacity)),(double) (100.0*QuantumScale*
11265 PixelGetGreenQuantum(opacity)),(double) (100.0*QuantumScale*
11266 PixelGetBlueQuantum(opacity)),(double) (100.0*QuantumScale*
11267 PixelGetOpacityQuantum(opacity)));
11268 PixelGetQuantumPacket(tint,&target);
11269 tint_image=TintImage(wand->images,percent_opaque,target,wand->exception);
11270 if (tint_image == (Image *) NULL)
11271 return(MagickFalse);
11272 ReplaceImageInList(&wand->images,tint_image);
11273 return(MagickTrue);
11277 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11281 % M a g i c k T r a n s f o r m I m a g e %
11285 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11287 % MagickTransformImage() is a convenience method that behaves like
11288 % MagickResizeImage() or MagickCropImage() but accepts scaling and/or cropping
11289 % information as a region geometry specification. If the operation fails,
11290 % a NULL image handle is returned.
11292 % The format of the MagickTransformImage method is:
11294 % MagickWand *MagickTransformImage(MagickWand *wand,const char *crop,
11295 % const char *geometry)
11297 % A description of each parameter follows:
11299 % o wand: the magick wand.
11301 % o crop: A crop geometry string. This geometry defines a subregion of the
11304 % o geometry: An image geometry string. This geometry defines the final
11305 % size of the image.
11308 WandExport MagickWand *MagickTransformImage(MagickWand *wand,
11309 const char *crop,const char *geometry)
11317 assert(wand != (MagickWand *) NULL);
11318 assert(wand->signature == WandSignature);
11319 if (wand->debug != MagickFalse)
11320 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11321 if (wand->images == (Image *) NULL)
11322 return((MagickWand *) NULL);
11323 transform_image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
11324 if (transform_image == (Image *) NULL)
11325 return((MagickWand *) NULL);
11326 status=TransformImage(&transform_image,crop,geometry);
11327 if (status == MagickFalse)
11329 InheritException(wand->exception,&transform_image->exception);
11330 transform_image=DestroyImage(transform_image);
11331 return((MagickWand *) NULL);
11333 return(CloneMagickWandFromImages(wand,transform_image));
11337 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11341 % 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 %
11345 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11347 % MagickTransformImageColorspace() transform the image colorspace.
11349 % The format of the MagickTransformImageColorspace method is:
11351 % MagickBooleanType MagickTransformImageColorspace(MagickWand *wand,
11352 % const ColorspaceType colorspace)
11354 % A description of each parameter follows:
11356 % o wand: the magick wand.
11358 % o colorspace: the image colorspace: UndefinedColorspace, RGBColorspace,
11359 % GRAYColorspace, TransparentColorspace, OHTAColorspace, XYZColorspace,
11360 % YCbCrColorspace, YCCColorspace, YIQColorspace, YPbPrColorspace,
11361 % YPbPrColorspace, YUVColorspace, CMYKColorspace, sRGBColorspace,
11362 % HSLColorspace, or HWBColorspace.
11365 WandExport MagickBooleanType MagickTransformImageColorspace(MagickWand *wand,
11366 const ColorspaceType colorspace)
11368 assert(wand != (MagickWand *) NULL);
11369 assert(wand->signature == WandSignature);
11370 if (wand->debug != MagickFalse)
11371 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11372 if (wand->images == (Image *) NULL)
11373 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11374 return(TransformImageColorspace(wand->images,colorspace));
11378 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11382 % 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 %
11386 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11388 % MagickTransparentPaintImage() changes any pixel that matches color with the
11389 % color defined by fill.
11391 % The format of the MagickTransparentPaintImage method is:
11393 % MagickBooleanType MagickTransparentPaintImage(MagickWand *wand,
11394 % const PixelWand *target,const double alpha,const double fuzz,
11395 % const MagickBooleanType invert)
11397 % A description of each parameter follows:
11399 % o wand: the magick wand.
11401 % o target: Change this target color to specified opacity value within
11404 % o alpha: the level of transparency: 1.0 is fully opaque and 0.0 is fully
11407 % o fuzz: By default target must match a particular pixel color
11408 % exactly. However, in many cases two colors may differ by a small amount.
11409 % The fuzz member of image defines how much tolerance is acceptable to
11410 % consider two colors as the same. For example, set fuzz to 10 and the
11411 % color red at intensities of 100 and 102 respectively are now interpreted
11412 % as the same color for the purposes of the floodfill.
11414 % o invert: paint any pixel that does not match the target color.
11417 WandExport MagickBooleanType MagickTransparentPaintImage(MagickWand *wand,
11418 const PixelWand *target,const double alpha,const double fuzz,
11419 const MagickBooleanType invert)
11427 assert(wand != (MagickWand *) NULL);
11428 assert(wand->signature == WandSignature);
11429 if (wand->debug != MagickFalse)
11430 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11431 if (wand->images == (Image *) NULL)
11432 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11433 PixelGetMagickColor(target,&target_pixel);
11434 wand->images->fuzz=fuzz;
11435 status=TransparentPaintImage(wand->images,&target_pixel,ClampToQuantum(
11436 QuantumRange*alpha),invert,&wand->images->exception);
11441 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11445 % M a g i c k T r a n s p o s e I m a g e %
11449 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11451 % MagickTransposeImage() creates a vertical mirror image by reflecting the
11452 % pixels around the central x-axis while rotating them 90-degrees.
11454 % The format of the MagickTransposeImage method is:
11456 % MagickBooleanType MagickTransposeImage(MagickWand *wand)
11458 % A description of each parameter follows:
11460 % o wand: the magick wand.
11463 WandExport MagickBooleanType MagickTransposeImage(MagickWand *wand)
11468 assert(wand != (MagickWand *) NULL);
11469 assert(wand->signature == WandSignature);
11470 if (wand->debug != MagickFalse)
11471 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11472 if (wand->images == (Image *) NULL)
11473 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11474 transpose_image=TransposeImage(wand->images,wand->exception);
11475 if (transpose_image == (Image *) NULL)
11476 return(MagickFalse);
11477 ReplaceImageInList(&wand->images,transpose_image);
11478 return(MagickTrue);
11482 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11486 % M a g i c k T r a n s v e r s e I m a g e %
11490 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11492 % MagickTransverseImage() creates a horizontal mirror image by reflecting the
11493 % pixels around the central y-axis while rotating them 270-degrees.
11495 % The format of the MagickTransverseImage method is:
11497 % MagickBooleanType MagickTransverseImage(MagickWand *wand)
11499 % A description of each parameter follows:
11501 % o wand: the magick wand.
11504 WandExport MagickBooleanType MagickTransverseImage(MagickWand *wand)
11509 assert(wand != (MagickWand *) NULL);
11510 assert(wand->signature == WandSignature);
11511 if (wand->debug != MagickFalse)
11512 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11513 if (wand->images == (Image *) NULL)
11514 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11515 transverse_image=TransverseImage(wand->images,wand->exception);
11516 if (transverse_image == (Image *) NULL)
11517 return(MagickFalse);
11518 ReplaceImageInList(&wand->images,transverse_image);
11519 return(MagickTrue);
11523 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11527 % M a g i c k T r i m I m a g e %
11531 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11533 % MagickTrimImage() remove edges that are the background color from the image.
11535 % The format of the MagickTrimImage method is:
11537 % MagickBooleanType MagickTrimImage(MagickWand *wand,const double fuzz)
11539 % A description of each parameter follows:
11541 % o wand: the magick wand.
11543 % o fuzz: By default target must match a particular pixel color
11544 % exactly. However, in many cases two colors may differ by a small amount.
11545 % The fuzz member of image defines how much tolerance is acceptable to
11546 % consider two colors as the same. For example, set fuzz to 10 and the
11547 % color red at intensities of 100 and 102 respectively are now interpreted
11548 % as the same color for the purposes of the floodfill.
11551 WandExport MagickBooleanType MagickTrimImage(MagickWand *wand,const double fuzz)
11556 assert(wand != (MagickWand *) NULL);
11557 assert(wand->signature == WandSignature);
11558 if (wand->debug != MagickFalse)
11559 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11560 if (wand->images == (Image *) NULL)
11561 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11562 wand->images->fuzz=fuzz;
11563 trim_image=TrimImage(wand->images,wand->exception);
11564 if (trim_image == (Image *) NULL)
11565 return(MagickFalse);
11566 ReplaceImageInList(&wand->images,trim_image);
11567 return(MagickTrue);
11571 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11575 % M a g i c k U n i q u e I m a g e C o l o r s %
11579 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11581 % MagickUniqueImageColors() discards all but one of any pixel color.
11583 % The format of the MagickUniqueImageColors method is:
11585 % MagickBooleanType MagickUniqueImageColors(MagickWand *wand)
11587 % A description of each parameter follows:
11589 % o wand: the magick wand.
11592 WandExport MagickBooleanType MagickUniqueImageColors(MagickWand *wand)
11597 assert(wand != (MagickWand *) NULL);
11598 assert(wand->signature == WandSignature);
11599 if (wand->debug != MagickFalse)
11600 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11601 if (wand->images == (Image *) NULL)
11602 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11603 unique_image=UniqueImageColors(wand->images,wand->exception);
11604 if (unique_image == (Image *) NULL)
11605 return(MagickFalse);
11606 ReplaceImageInList(&wand->images,unique_image);
11607 return(MagickTrue);
11611 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11615 % M a g i c k U n s h a r p M a s k I m a g e %
11619 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11621 % MagickUnsharpMaskImage() sharpens an image. We convolve the image with a
11622 % Gaussian operator of the given radius and standard deviation (sigma).
11623 % For reasonable results, radius should be larger than sigma. Use a radius
11624 % of 0 and UnsharpMaskImage() selects a suitable radius for you.
11626 % The format of the MagickUnsharpMaskImage method is:
11628 % MagickBooleanType MagickUnsharpMaskImage(MagickWand *wand,
11629 % const double radius,const double sigma,const double amount,
11630 % const double threshold)
11632 % A description of each parameter follows:
11634 % o wand: the magick wand.
11636 % o radius: the radius of the Gaussian, in pixels, not counting the center
11639 % o sigma: the standard deviation of the Gaussian, in pixels.
11641 % o amount: the percentage of the difference between the original and the
11642 % blur image that is added back into the original.
11644 % o threshold: the threshold in pixels needed to apply the diffence amount.
11647 WandExport MagickBooleanType MagickUnsharpMaskImage(MagickWand *wand,
11648 const double radius,const double sigma,const double amount,
11649 const double threshold)
11654 assert(wand != (MagickWand *) NULL);
11655 assert(wand->signature == WandSignature);
11656 if (wand->debug != MagickFalse)
11657 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11658 if (wand->images == (Image *) NULL)
11659 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11660 unsharp_image=UnsharpMaskImage(wand->images,radius,sigma,amount,threshold,
11662 if (unsharp_image == (Image *) NULL)
11663 return(MagickFalse);
11664 ReplaceImageInList(&wand->images,unsharp_image);
11665 return(MagickTrue);
11669 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11673 % M a g i c k V i g n e t t e I m a g e %
11677 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11679 % MagickVignetteImage() softens the edges of the image in vignette style.
11681 % The format of the MagickVignetteImage method is:
11683 % MagickBooleanType MagickVignetteImage(MagickWand *wand,
11684 % const double black_point,const double white_point,const ssize_t x,
11687 % A description of each parameter follows:
11689 % o wand: the magick wand.
11691 % o black_point: the black point.
11693 % o white_point: the white point.
11695 % o x, y: Define the x and y ellipse offset.
11698 WandExport MagickBooleanType MagickVignetteImage(MagickWand *wand,
11699 const double black_point,const double white_point,const ssize_t x,const ssize_t y)
11704 assert(wand != (MagickWand *) NULL);
11705 assert(wand->signature == WandSignature);
11706 if (wand->debug != MagickFalse)
11707 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11708 if (wand->images == (Image *) NULL)
11709 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11710 vignette_image=VignetteImage(wand->images,black_point,white_point,x,y,
11712 if (vignette_image == (Image *) NULL)
11713 return(MagickFalse);
11714 ReplaceImageInList(&wand->images,vignette_image);
11715 return(MagickTrue);
11719 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11723 % M a g i c k W a v e I m a g e %
11727 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11729 % MagickWaveImage() creates a "ripple" effect in the image by shifting
11730 % the pixels vertically along a sine wave whose amplitude and wavelength
11731 % is specified by the given parameters.
11733 % The format of the MagickWaveImage method is:
11735 % MagickBooleanType MagickWaveImage(MagickWand *wand,const double amplitude,
11736 % const double wave_length)
11738 % A description of each parameter follows:
11740 % o wand: the magick wand.
11742 % o amplitude, wave_length: Define the amplitude and wave length of the
11746 WandExport MagickBooleanType MagickWaveImage(MagickWand *wand,
11747 const double amplitude,const double wave_length)
11752 assert(wand != (MagickWand *) NULL);
11753 assert(wand->signature == WandSignature);
11754 if (wand->debug != MagickFalse)
11755 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11756 if (wand->images == (Image *) NULL)
11757 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11758 wave_image=WaveImage(wand->images,amplitude,wave_length,wand->exception);
11759 if (wave_image == (Image *) NULL)
11760 return(MagickFalse);
11761 ReplaceImageInList(&wand->images,wave_image);
11762 return(MagickTrue);
11766 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11770 % 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 %
11774 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11776 % MagickWhiteThresholdImage() is like ThresholdImage() but force all pixels
11777 % above the threshold into white while leaving all pixels below the threshold
11780 % The format of the MagickWhiteThresholdImage method is:
11782 % MagickBooleanType MagickWhiteThresholdImage(MagickWand *wand,
11783 % const PixelWand *threshold)
11785 % A description of each parameter follows:
11787 % o wand: the magick wand.
11789 % o threshold: the pixel wand.
11792 WandExport MagickBooleanType MagickWhiteThresholdImage(MagickWand *wand,
11793 const PixelWand *threshold)
11796 thresholds[MaxTextExtent];
11801 assert(wand != (MagickWand *) NULL);
11802 assert(wand->signature == WandSignature);
11803 if (wand->debug != MagickFalse)
11804 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11805 if (wand->images == (Image *) NULL)
11806 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11807 (void) FormatLocaleString(thresholds,MaxTextExtent,
11808 QuantumFormat "," QuantumFormat "," QuantumFormat "," QuantumFormat,
11809 PixelGetRedQuantum(threshold),PixelGetGreenQuantum(threshold),
11810 PixelGetBlueQuantum(threshold),PixelGetOpacityQuantum(threshold));
11811 status=WhiteThresholdImage(wand->images,thresholds,&wand->images->exception);
11812 if (status == MagickFalse)
11813 InheritException(wand->exception,&wand->images->exception);
11818 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11822 % M a g i c k W r i t e I m a g e %
11826 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11828 % MagickWriteImage() writes an image to the specified filename. If the
11829 % filename parameter is NULL, the image is written to the filename set
11830 % by MagickReadImage() or MagickSetImageFilename().
11832 % The format of the MagickWriteImage method is:
11834 % MagickBooleanType MagickWriteImage(MagickWand *wand,
11835 % const char *filename)
11837 % A description of each parameter follows:
11839 % o wand: the magick wand.
11841 % o filename: the image filename.
11845 WandExport MagickBooleanType MagickWriteImage(MagickWand *wand,
11846 const char *filename)
11857 assert(wand != (MagickWand *) NULL);
11858 assert(wand->signature == WandSignature);
11859 if (wand->debug != MagickFalse)
11860 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11861 if (wand->images == (Image *) NULL)
11862 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11863 if (filename != (const char *) NULL)
11864 (void) CopyMagickString(wand->images->filename,filename,MaxTextExtent);
11865 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
11866 if (image == (Image *) NULL)
11867 return(MagickFalse);
11868 write_info=CloneImageInfo(wand->image_info);
11869 write_info->adjoin=MagickTrue;
11870 status=WriteImage(write_info,image,&image->exception);
11871 image=DestroyImage(image);
11872 write_info=DestroyImageInfo(write_info);
11877 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11881 % M a g i c k W r i t e I m a g e F i l e %
11885 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11887 % MagickWriteImageFile() writes an image to an open file descriptor.
11889 % The format of the MagickWriteImageFile method is:
11891 % MagickBooleanType MagickWriteImageFile(MagickWand *wand,FILE *file)
11893 % A description of each parameter follows:
11895 % o wand: the magick wand.
11897 % o file: the file descriptor.
11900 WandExport MagickBooleanType MagickWriteImageFile(MagickWand *wand,FILE *file)
11911 assert(wand != (MagickWand *) NULL);
11912 assert(wand->signature == WandSignature);
11913 assert(file != (FILE *) NULL);
11914 if (wand->debug != MagickFalse)
11915 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11916 if (wand->images == (Image *) NULL)
11917 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11918 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
11919 if (image == (Image *) NULL)
11920 return(MagickFalse);
11921 write_info=CloneImageInfo(wand->image_info);
11922 SetImageInfoFile(write_info,file);
11923 write_info->adjoin=MagickTrue;
11924 status=WriteImage(write_info,image,&image->exception);
11925 write_info=DestroyImageInfo(write_info);
11926 image=DestroyImage(image);
11931 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11935 % M a g i c k W r i t e I m a g e s %
11939 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11941 % MagickWriteImages() writes an image or image sequence.
11943 % The format of the MagickWriteImages method is:
11945 % MagickBooleanType MagickWriteImages(MagickWand *wand,
11946 % const char *filename,const MagickBooleanType adjoin)
11948 % A description of each parameter follows:
11950 % o wand: the magick wand.
11952 % o filename: the image filename.
11954 % o adjoin: join images into a single multi-image file.
11957 WandExport MagickBooleanType MagickWriteImages(MagickWand *wand,
11958 const char *filename,const MagickBooleanType adjoin)
11966 assert(wand != (MagickWand *) NULL);
11967 assert(wand->signature == WandSignature);
11968 if (wand->debug != MagickFalse)
11969 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11970 if (wand->images == (Image *) NULL)
11971 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11972 write_info=CloneImageInfo(wand->image_info);
11973 write_info->adjoin=adjoin;
11974 status=WriteImages(write_info,wand->images,filename,wand->exception);
11975 if (status == MagickFalse)
11976 InheritException(wand->exception,&wand->images->exception);
11977 write_info=DestroyImageInfo(write_info);
11982 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11986 % M a g i c k W r i t e I m a g e s F i l e %
11990 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11992 % MagickWriteImagesFile() writes an image sequence to an open file descriptor.
11994 % The format of the MagickWriteImagesFile method is:
11996 % MagickBooleanType MagickWriteImagesFile(MagickWand *wand,FILE *file)
11998 % A description of each parameter follows:
12000 % o wand: the magick wand.
12002 % o file: the file descriptor.
12005 WandExport MagickBooleanType MagickWriteImagesFile(MagickWand *wand,FILE *file)
12013 assert(wand != (MagickWand *) NULL);
12014 assert(wand->signature == WandSignature);
12015 if (wand->debug != MagickFalse)
12016 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12017 if (wand->images == (Image *) NULL)
12018 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12019 write_info=CloneImageInfo(wand->image_info);
12020 SetImageInfoFile(write_info,file);
12021 write_info->adjoin=MagickTrue;
12022 status=WriteImages(write_info,wand->images,(const char *) NULL,
12024 write_info=DestroyImageInfo(write_info);
12025 if (status == MagickFalse)
12026 InheritException(wand->exception,&wand->images->exception);