forked from ImageMagick/Website
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathImage++.html
More file actions
4524 lines (4516 loc) · 217 KB
/
Copy pathImage++.html
File metadata and controls
4524 lines (4516 loc) · 217 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Magick++ API: Working with Images</title>
<link rel="stylesheet" href="magick.css" type="text/css" />
</head>
<body>
<div class="doc-section">
<center>
<h1> Magick::Image Class</h1>
</center>
<h4> Quick Contents</h4>
<ul>
<li> <a href="#BLOBs">BLOBs</a> </li>
<li> <a href="#Constructors">Constructors</a> </li>
<li>
<a href="#Image%20Manipulation%20Methods">
Image Manipulation
Methods
</a>
</li>
<li> <a href="#Image%20Attributes">Image Attributes</a> </li>
<li>
<a href="#Raw%20Image%20Pixel%20Access">
Low-Level Image Pixel
Access
</a>
</li>
</ul>
<p>
Image is the primary object in Magick++ and represents
a single image frame (see <a href="ImageDesign.html">design</a> ). The
<a href="STL.html">STL interface</a> <b>must</b> be used to operate on
image sequences or images (e.g. of format GIF, TIFF, MIFF, Postscript,
& MNG) which are comprised of multiple image frames. Individual
frames of a multi-frame image may be requested by adding array-style
notation to the end of the file name (e.g. "animation.gif[3]" retrieves
the fourth frame of a GIF animation.  Various image manipulation
operations may be applied to the image. Attributes may be set on the
image to influence the operation of the manipulation operations. The <a href="Pixels.html">Pixels</a> class provides low-level access to
image
pixels. As a convenience, including <tt><font color="#663366"><Magick++.h></font></tt>
is sufficient in order to use the complete Magick++ API. The Magick++
API is enclosed within the <i>Magick</i> namespace so you must either
add the prefix "<tt> Magick::</tt> " to each class/enumeration name or
add
the statement "<tt> using namespace Magick;</tt>" after including the <tt>Magick++.h</tt>
header.
</p>
<p>
The preferred way to allocate Image objects is via automatic
allocation (on the stack). There is no concern that allocating Image
objects on the stack will excessively enlarge the stack since Magick++
allocates all large data objects (such as the actual image data) from
the heap. Use of automatic allocation is preferred over explicit
allocation (via <i>new</i>) since it is much less error prone and
allows use of C++ scoping rules to avoid memory leaks. Use of automatic
allocation allows Magick++ objects to be assigned and copied just like
the C++ intrinsic data types (e.g. '<i>int</i> '), leading to clear and
easy to read code. Use of automatic allocation leads to naturally
exception-safe code since if an exception is thrown, the object is
automagically deallocated once the stack unwinds past the scope of the
allocation (not the case for objects allocated via <i>new</i> ).
</p>
<p>
Image is very easy to use. For example, here is a the source to a
program which reads an image, crops it, and writes it to a new file
(the
exception handling is optional but strongly recommended):
</p>
<pre class="code">
#include <Magick++.h>
#include <iostream>
using namespace std;
using namespace Magick;
int main(int argc,char **argv)
{
InitializeMagick(*argv);
// Construct the image object. Separating image construction from the
// the read operation ensures that a failure to read the image file
// doesn't render the image object useless.
Image image;
try {
// Read a file into image object
image.read( "girl.gif" );
// Crop the image to specified size (width, height, xOffset, yOffset)
image.crop( Geometry(100,100, 100, 100) );
// Write the image to a file
image.write( "x.gif" );
}
catch( Exception &error_ )
{
cout << "Caught exception: " << error_.what() << endl;
return 1;
}
return 0;
}
</pre>
The following is the source to a program which illustrates the use of
Magick++'s efficient reference-counted assignment and copy-constructor
operations which minimize use of memory and eliminate unnecessary copy
operations (allowing Image objects to be efficiently assigned, and
copied into containers).  The program accomplishes the
following:
<ol>
<li> Read master image.</li>
<li> Assign master image to second image.</li>
<li> Resize second image to the size 640x480.</li>
<li> Assign master image to a third image.</li>
<li> Resize third image to the size 800x600.</li>
<li> Write the second image to a file.</li>
<li> Write the third image to a file.</li>
</ol>
<pre class="code">
#include <Magick++.h>
#include <iostream>
using namespace std;
using namespace Magick;
int main(int argc,char **argv)
{
InitializeMagick(*argv);
Image master("horse.jpg");
Image second = master;
second.resize("640x480");
Image third = master;
third.resize("800x600");
second.write("horse640x480.jpg");
third.write("horse800x600.jpg");
return 0;
}
</pre>
During the entire operation, a maximum of three images exist in memory
and the image data is never copied.
<p>
The following is the source for another simple program which creates
a 100 by 100 pixel white image with a red pixel in the center and
writes it to a file:
</p>
<pre class="code">
#include <Magick++.h>
using namespace std;
using namespace Magick;
int main(int argc,char **argv)
{
InitializeMagick(*argv);
Image image( "100x100", "white" );
image.pixelColor( 49, 49, "red" );
image.write( "red_pixel.png" );
return 0;
}
</pre>
If you wanted to change the color image to grayscale, you could add the
lines:
<pre class="code">
image.quantizeColorSpace( GRAYColorspace );
image.quantizeColors( 256 );
image.quantize( );
</pre>
<p>or, more simply: </p>
<pre class="code">
image.type( GrayscaleType );
</pre>
<p>prior to writing the image. </p>
<center>
<h3> <a name="BLOBs"></a> BLOBs</h3>
</center>
While encoded images (e.g. JPEG) are most often written-to and
read-from a disk file, encoded images may also reside in memory.
Encoded
images in memory are known as BLOBs (Binary Large OBjects) and may be
represented using the <a href="Blob.html">Blob</a> class. The encoded
image may be initially placed in memory by reading it directly from a
file, reading the image from a database, memory-mapped from a disk
file, or could be written to memory by Magick++. Once the encoded image
has been placed within a Blob, it may be read into a Magick++ Image via
a <a href="#constructor_blob">constructor</a> or <a href="#read">read()</a>
. Likewise, a Magick++ image may be written to a Blob via <a href="#write">write()</a> .
<p>
An example of using Image to write to a Blob follows: <br />
 
</p>
<pre class="code">
#include >Magick++.h>
using namespace std;
using namespace Magick;
int main(int argc,char **argv)
{
InitializeMagick(*argv);
// Read GIF file from disk
Image image( "giraffe.gif" );
// Write to BLOB in JPEG format
Blob blob;
image.magick( "JPEG" ) // Set JPEG output format
image.write( &blob );
[ Use BLOB data (in JPEG format) here ]
return 0;
}
</pre>
<p>
<br />
likewise, to read an image from a Blob, you could use one of the
following examples:
</p>
<p>
[ <font color="#000000">
Entry condition for the following examples
is that <i>data</i> is pointer to encoded image data and <i>length</i>
represents the size of the data
</font> ]
</p>
<pre class="code">
Blob blob( data, length );
Image image( blob );
</pre>
or
<pre class="code">
Blob blob( data, length );
Image image;
image.read( blob);
</pre>
some images do not contain their size or format so the size and format must be specified in advance:
<pre class="code">
Blob blob( data, length );
Image image;
image.size( "640x480")
image.magick( "RGBA" );
image.read( blob);
</pre>
<center>
<h3> <a name="Constructors"></a> Constructors</h3>
</center>
Image may be constructed in a number of ways. It may be constructed
from a file, a URL, or an encoded image (e.g. JPEG) contained in an
in-memory <a href="Blob.html"> BLOB</a> . The available Image
constructors are shown in the following table: <br />
  <br />
 
<table bgcolor="#ffffff" border="1" width="100%">
<caption><b>Image Constructors</b></caption>
<tbody>
<tr>
<td>
<center><b>Signature</b></center>
</td>
<td>
<center><b>Description</b></center>
</td>
</tr>
<tr>
<td><font size="-1">const std::string &imageSpec_</font></td>
<td>
<font size="-1">
Construct Image by reading from file or URL
specified by <i>imageSpec_</i>. Use array notation (e.g. filename[9])
to select a specific scene from a multi-frame image.
</font>
</td>
</tr>
<tr>
<td>
<font size="-1">
const Geometry &size_, const <a href="Color.html">Color</a> &color_
</font>
</td>
<td>
<font size="-1">
Construct a blank image canvas of specified
size and color
</font>
</td>
</tr>
<tr>
<td>
<a name="constructor_blob"></a> <font size="-1">
const <a href="Blob.html">Blob</a> &blob_
</font>
</td>
<td rowspan="5">
<font size="-1">
Construct Image by reading from
encoded image data contained in an in-memory <a href="Blob.html">BLOB</a>
. Depending on the constructor arguments, the Blob <a href="#size">size</a>
, <a href="#depth">depth</a> , <a href="#magick">magick</a> (format)
may
also be specified. Some image formats require that size be specified.
The default ImageMagick uses for depth depends on the compiled-in
Quantum size (8 or 16).  If ImageMagick's Quantum size does not
match that of the image, the depth may need to be specified.
ImageMagick can usually automagically detect the image's format.
When a format can't be automagically detected, the format (<a href="#magick">magick</a> ) must be specified.
</font>
</td>
</tr>
<tr>
<td>
<font size="-1">
const <a href="Blob.html">Blob</a>
&blob_, const <a href="Geometry.html">Geometry</a> &size_
</font>
</td>
</tr>
<tr>
<td>
<font size="-1">
const <a href="Blob.html">Blob</a>
&blob_, const <a href="Geometry.html">Geometry</a> &size,
size_t depth
</font>
</td>
</tr>
<tr>
<td>
<font size="-1">
const <a href="Blob.html">Blob</a>
&blob_, const <a href="Geometry.html">Geometry</a> &size,
size_t depth_, const string &magick_
</font>
</td>
</tr>
<tr>
<td>
<font size="-1">
const <a href="Blob.html">Blob</a>
&blob_, const <a href="Geometry.html">Geometry</a> &size,
const
string &magick_
</font>
</td>
</tr>
<tr>
<td>
<font size="-1">const size_t width_, </font> <br />
<font size="-1">const size_t height_,</font> <br />
<font size="-1">std::string map_,</font> <br />
<font size="-1">
const <a href="Enumerations.html#StorageType">
StorageType
</a> type_,
</font> <br />
<font size="-1">const void *pixels_</font>
</td>
<td>
<font size="-1">
Construct a new Image based on an array of
image pixels. The pixel data must be in scanline order top-to-bottom.
The data can be character, short int, integer, float, or double. Float
and double require the pixels to be normalized [0..1]. The other types
are [0..MaxRGB].  For example, to create a 640x480 image from
unsigned red-green-blue character data, use
</font>
<p>
<font size="-1">
   Image image( 640, 480, "RGB",
0, pixels );
</font>
</p>
<p>
<font size="-1">The parameters are as follows:</font> <br />
 
</p>
<table border="0" width="100%">
<tbody>
<tr>
<td><font size="-1">width_</font></td>
<td><font size="-1">Width in pixels of the image.</font></td>
</tr>
<tr>
<td><font size="-1">height_</font></td>
<td><font size="-1">Height in pixels of the image.</font></td>
</tr>
<tr>
<td><font size="-1">map_</font></td>
<td>
<font size="-1">
This character string can be any combination or order of R = red, G =
green, B = blue, A = alpha, O = opacity, C = cyan, Y = yellow, M =
magenta, K = black, I = intensity, and P = pad. The ordering reflects
the order of the pixels in the supplied pixel array.
</font>
</td>
</tr>
<tr>
<td><font size="-1">type_</font></td>
<td>
<font size="-1">
<a href="Enumerations.html#StorageType">Pixelstorage type</a> (CharPixel,
ShortPixel, LongPixel, LongLongPixel, FloatPixel, or DoublePixel)
</font>
</td>
</tr>
<tr>
<td><font size="-1">pixels_</font></td>
<td>
<font size="-1">
This array of values contain the pixel
components as defined by the map_ and type_ parameters. The length of
the arrays must equal the area specified by the width_ and height_
values and type_ parameters.
</font>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<center>
<h3>
<a name="Image Manipulation Methods"></a> Image Manipulation
Methods
</h3>
</center>
<i>Image</i> supports access to all the single-image (versus
image-list) manipulation operations provided by the ImageMagick
library. If you
must process a multi-image file (such as an animation), the <a href="STL.html">STL interface</a> , which provides a multi-image
abstraction on top of <i>Image</i>, must be used.
<p>Image manipulation methods are very easy to use.  For example: </p>
<pre class="code">
Image image;
image.read("myImage.tiff");
image.addNoise(GaussianNoise);
image.write("myImage.tiff");
</pre>
adds gaussian noise to the image file "myImage.tiff".
<p>
The operations supported by Image are shown in the following table: <br />
 
</p>
<table border="1">
<caption><b>Image Image Manipulation Methods</b></caption>
<tbody>
<tr align="center">
<td><b>Method</b></td>
<td><b>Signature(s)</b></td>
<td><b>Description</b></td>
</tr>
<tr>
<td style="text-align: center;" valign="middle">
<div style="text-align:center">
<a name="adaptiveThreshold"></a> <font size="-1">
adaptiveThreshold<br />
</font>
</div>
</td>
<td valign="middle">
<font size="-1">
size_t width, size_t
height, size_t offset = 0<br />
</font>
</td>
<td valign="top">
<font size="-1">
Apply adaptive thresholding to
the image. Adaptive thresholding is useful if the ideal threshold level
is not known in advance, or if the illumination gradient is not
constant
across the image. Adaptive thresholding works by evaluating the mean
(average) of a pixel region (size specified by <i>width</i> and <i>height</i>)
and using the mean as the thresholding value. In order to remove
residual noise from the background, the threshold may be adjusted by
subtracting a constant <i>offset</i> (default zero) from the mean to
compute the threshold.
</font><br />
</td>
</tr>
<tr>
<td style="text-align: center;">
<center><a name="addNoise"></a> <font size="-1">addNoise</font></center>
</td>
<td>
<font size="-1">
<a href="Enumerations.html#NoiseType">NoiseType</a>
noiseType_
</font>
</td>
<td><font size="-1">Add noise to image with specified noise type.</font></td>
</tr>
<tr>
<td style="vertical-align: middle; text-align: center;">
<small>
<a name="addNoiseChannel"></a>addNoiseChannel<br />
</small>
</td>
<td style="vertical-align: middle;">
<small>
const ChannelType
channel_, const NoiseType noiseType_<br />
</small>
</td>
<td style="vertical-align: middle;">
<small>
Add noise to an image
channel with the specified noise type.
</small><font size="-1">
The <span style="font-style: italic;">channel_</span> parameter specifies the
channel to add noise to.  The
</font><small>
noiseType_ parameter
specifies the type of noise.<br />
</small>
</td>
</tr>
<tr>
<td style="vertical-align: middle; text-align: center;">
<small>
<a name="affineTransform"></a>affineTransform<br />
</small>
</td>
<td style="vertical-align: middle;">
<small>
const DrawableAffine
&affine<br />
</small>
</td>
<td style="vertical-align: middle;">
<small>
Transform image by
specified affine (or free transform) matrix.<br />
</small>
</td>
</tr>
<tr>
<td style="text-align: center;" rowspan="4">
<center><a name="annotate"></a> <font size="-1">annotate</font></center>
</td>
<td>
<font size="-1">
const std::string &text_, const <a href="Geometry.html">Geometry</a> &location_
</font>
</td>
<td>
<font size="-1">
Annotate using specified text, and placement
location
</font>
</td>
</tr>
<tr>
<td>
<font size="-1">
string text_, const <a href="Geometry.html">Geometry</a>
&boundingArea_, <a href="Enumerations.html#GravityType">GravityType</a>
gravity_
</font>
</td>
<td>
<font size="-1">
Annotate using specified text, bounding area,
and placement gravity. If <i>boundingArea_</i> is invalid, then
bounding area is entire image.
</font>
</td>
</tr>
<tr>
<td>
<font size="-1">
const std::string &text_, const <a href="Geometry.html">Geometry</a> &boundingArea_, <a href="Enumerations.html#GravityType">GravityType</a> gravity_, double
degrees_, 
</font>
</td>
<td>
<font size="-1">
Annotate with text using specified text,
bounding area, placement gravity, and rotation. If <i>boundingArea_</i>
is invalid, then bounding area is entire image.
</font>
</td>
</tr>
<tr>
<td>
<font size="-1">
const std::string &text_, <a href="Enumerations.html#GravityType">GravityType</a> gravity_
</font>
</td>
<td>
<font size="-1">
Annotate with text (bounding area is entire
image) and placement gravity.
</font>
</td>
</tr>
<tr>
<td style="text-align: center;">
<center><a name="blur"></a> <font size="-1">blur</font></center>
</td>
<td>
<font size="-1">
const double radius_ = 1, const double sigma_
= 0.5
</font>
</td>
<td>
<font size="-1">
Blur image. The <i>radius_ </i>parameter
specifies the radius of the Gaussian, in pixels, not counting the
center
pixel.  The <i>sigma_</i> parameter specifies the standard
deviation of the Laplacian, in pixels.
</font>
</td>
</tr>
<tr>
<td style="vertical-align: middle; text-align: center;">
<small>
<a name="blurChannel"></a>blurChannel<br />
</small>
</td>
<td style="vertical-align: middle;">
<small>
const ChannelType
channel_, const double radius_ = 0.0, const double sigma_ = 1.0<br />
</small>
</td>
<td style="vertical-align: middle;">
<font size="-1">
Blur an image
channel. The <span style="font-style: italic;">channel_</span>
parameter specifies the channel to blur. The <i>radius_ </i>parameter
specifies the radius of the Gaussian, in pixels, not counting the
center
pixel.  The <i>sigma_</i> parameter specifies the standard
deviation of the Laplacian, in pixels.
</font>
</td>
</tr>
<tr>
<td style="text-align: center;">
<center><a name="border"></a> <font size="-1">border</font></center>
</td>
<td>
<font size="-1">
const <a href="Geometry.html">Geometry</a>
&geometry_ = "6x6+0+0"
</font>
</td>
<td>
<font size="-1">
Border image (add border to image).  The
color of the border is specified by the <i>borderColor</i> attribute.
</font>
</td>
</tr>
<tr>
<td style="text-align: center;">
<center><a name="cdl"></a> <font size="-1">cdl</font></center>
</td>
<td><font size="-1">const std::string &cdl_</font></td>
<td><font size="-1">color correct with a color decision list. See <a href="http://en.wikipedia.org/wiki/ASC_CDL">http://en.wikipedia.org/wiki/ASC_CDL</a> for details.</font></td>
</tr>
<tr>
<td style="text-align: center;">
<center><a name="channel"></a> <font size="-1">channel</font></center>
</td>
<td>
<font size="-1">
<a href="Enumerations.html#ChannelType">ChannelType</a>
layer_
</font>
</td>
<td>
<font size="-1">
Extract channel from image. Use this option
to extract a particular channel from  the image.  <i>alphaChannel</i>
  for  example, is useful for extracting the opacity values
from an image.
</font>
</td>
</tr>
<tr>
<td style="text-align: center;">
<center><a name="charcoal"></a> <font size="-1">charcoal</font></center>
</td>
<td>
<font size="-1">
const double radius_ = 1, const double sigma_
= 0.5
</font>
</td>
<td>
<font size="-1">
Charcoal effect image (looks like charcoal
sketch). The <i>radius_</i> parameter specifies the radius of the
Gaussian, in pixels, not counting the center pixel.  The <i>sigma_</i>
parameter specifies the standard deviation of the Laplacian, in pixels.
</font>
</td>
</tr>
<tr>
<td style="text-align: center;">
<center><a name="chop"></a> <font size="-1">chop</font></center>
</td>
<td>
<font size="-1">
const <a href="Geometry.html">Geometry</a>
&geometry_
</font>
</td>
<td>
<font size="-1">
Chop image (remove vertical or horizontal
subregion of image)
</font>
</td>
</tr>
<tr>
<td style="text-align: center;">
<center><a name="colorize"></a> <font size="-1">colorize</font></center>
</td>
<td>
<font size="-1">
const unsigned int opacityRed_, const
unsigned int opacityGreen_, const unsigned int opacityBlue_, const
Color &penColor_
</font>
</td>
<td>
<font size="-1">
Colorize image with pen color, using
specified percent opacity for red, green, and blue quantums.
</font>
</td>
</tr>
<tr>
<td style="text-align: center;">
<center><a name="colorMatrix"></a> <font size="-1">colorMatrix</font></center>
</td>
<td><font size="-1">const size_t order_, const double *color_matrix_</font></td>
<td><font size="-1">apply color correction to the image.</font></td>
</tr>
<tr>
<td style="text-align: center;">
<center><a name="comment"></a> <font size="-1">comment</font></center>
</td>
<td><font size="-1">const std::string &comment_</font></td>
<td>
<font size="-1">
Comment image (add comment string to
image).  By default, each image is commented with its file name.
Use  this  method to  assign a specific comment to the
image.  Optionally you can include the image filename, type,
width, height, or other  image  attributes by embedding <a href="FormatCharacters.html">special format characters.</a>
</font>
</td>
</tr>
<tr>
<td style="text-align: center;" valign="middle">
<font size="-1">
<a name="compare"></a> compare<br />
</font>
</td>
<td valign="middle">
<font size="-1">
const Image &reference_<br />
</font>
</td>
<td valign="top">
<font size="-1">
Compare current image with
another image. Sets <a href="#meanErrorPerPixel">meanErrorPerPixel</a>
, <a href="#normalizedMaxError">normalizedMaxError</a> , and <a href="#normalizedMeanError">normalizedMeanError</a> in the current
image. False is returned if the images are identical. An ErrorOption
exception is thrown if the reference image columns, rows, colorspace,
or
matte differ from the current image.
</font><br />
</td>
</tr>
<tr>
<td style="text-align: center;" rowspan="3">
<center><a name="composite"></a> <font size="-1">composite</font></center>
</td>
<td>
<font size="-1">
const <a href="Image++.html">Image</a>
&compositeImage_, ssize_t xOffset_, ssize_t yOffset_, <a href="Enumerations.html#CompositeOperator">CompositeOperator</a>
compose_ = <i>InCompositeOp</i>
</font>
</td>
<td>
<font size="-1">
Compose an image onto the current image at
offset specified by <i>xOffset_</i>, <i>yOffset_ </i>using the
composition algorithm specified by <i>compose_</i>. 
</font>
</td>
</tr>
<tr>
<td>
<font size="-1">
const <a href="Image++.html">Image</a>
&compositeImage_, const <a href="Geometry.html">Geometry</a>
&offset_, <a href="Enumerations.html#CompositeOperator">CompositeOperator</a>
compose_ = <i>InCompositeOp</i>
</font>
</td>
<td>
<font size="-1">
Compose an image onto the current image at
offset specified by <i>offset_</i> using the composition algorithm
specified by <i>compose_</i> . 
</font>
</td>
</tr>
<tr>
<td>
<font size="-1">
const <a href="Image++.html">Image</a>
&compositeImage_, <a href="Enumerations.html#GravityType">GravityType</a>
gravity_, <a href="Enumerations.html#CompositeOperator">CompositeOperator</a>
compose_ = <i>InCompositeOp</i>
</font>
</td>
<td>
<font size="-1">
Compose an image onto the current image with
placement specified by <i>gravity_ </i>using the composition
algorithm
specified by <i>compose_</i>. 
</font>
</td>
</tr>
<tr>
<td style="text-align: center;">
<center><a name="contrast"></a> <font size="-1">contrast</font></center>
</td>
<td><font size="-1">size_t sharpen_</font></td>
<td>
<font size="-1">
Contrast image (enhance intensity differences
in image)
</font>
</td>
</tr>
<tr>
<td style="text-align: center;">
<center><a name="convolve"></a> <font size="-1">convolve</font></center>
</td>
<td><font size="-1">size_t order_, const double *kernel_</font></td>
<td>
<font size="-1">
Convolve image.  Applies a user-specified
convolution to the image. The <i>order_</i> parameter represents the
number of columns and rows in the filter kernel, and <i>kernel_</i>
is a two-dimensional array of doubles representing the convolution
kernel to apply.
</font>
</td>
</tr>
<tr>
<td style="text-align: center;">
<center><a name="crop"></a> <font size="-1">crop</font></center>
</td>
<td>
<font size="-1">
const <a href="Geometry.html">Geometry</a>
&geometry_
</font>
</td>
<td><font size="-1">Crop image (subregion of original image)</font></td>
</tr>
<tr>
<td style="text-align: center;">
<center><a name="cycleColormap"></a> <font size="-1">cycleColormap</font></center>
</td>
<td><font size="-1">int amount_</font></td>
<td><font size="-1">Cycle image colormap</font></td>
</tr>
<tr>
<td style="text-align: center;">
<center><a name="despeckle"></a> <font size="-1">despeckle</font></center>
</td>
<td><font size="-1">void</font></td>
<td><font size="-1">Despeckle image (reduce speckle noise)</font></td>
</tr>
<tr>
<td style="text-align: center;">
<center><a name="display"></a> <font size="-1">display</font></center>
</td>
<td><font size="-1">void</font></td>
<td>
<font size="-1">Display image on screen.</font> <br />
<font size="-1">
<b><font color="#ff0000">Caution: </font></b> if
an image format is not compatible with the display visual (e.g.
JPEG on a colormapped display) then the original image will be
altered. Use a copy of the original if this is a problem.
</font>
</td>
</tr>
<tr>
<td>
<center><a name="distort"></a> <font size="-1">distort</font></center>
</td>
<td><font size="-1">const DistortImageMethod method, const size_t number_arguments, const double *arguments, const bool bestfit = false </font></td>
<td>
<font size="-1">
Distort image.  Applies a user-specified
distortion to the image.
</font>
</td>
</tr>
<tr>
<td style="text-align: center;" rowspan="2">
<center><a name="draw"></a> <font size="-1">draw</font></center>
</td>
<td>
<font size="-1">
const <a href="Drawable.html">Drawable</a>
&drawable_
</font>
</td>
<td><font size="-1">Draw shape or text on image.</font></td>
</tr>
<tr>
<td>
<font size="-1">
const std::list<<a href="Drawable.html">Drawable</a>
> &drawable_
</font>
</td>
<td>
<font size="-1">
Draw shapes or text on image using a set of
Drawable objects contained in an STL list. Use of this method improves
drawing performance and allows batching draw objects together in a
list for repeated use.
</font>
</td>
</tr>
<tr>
<td style="text-align: center;">
<center><a name="edge"></a> <font size="-1">edge</font></center>
</td>
<td><font size="-1">size_t radius_ = 0.0</font></td>
<td>
<font size="-1">
Edge image (hilight edges in image). 
The radius is the radius of the pixel neighborhood.. Specify a radius
of zero for automatic radius selection.
</font>
</td>
</tr>
<tr>
<td style="text-align: center;">
<center><a name="emboss"></a> <font size="-1">emboss</font></center>
</td>
<td>
<font size="-1">
const double radius_ = 1, const double sigma_
= 0.5
</font>
</td>
<td>
<font size="-1">
Emboss image (hilight edges with 3D effect).
The <i> radius_</i> parameter specifies the radius of the Gaussian, in
pixels, not counting the center pixel.  The <i>sigma_</i>
parameter specifies the standard deviation of the Laplacian, in pixels.
</font>
</td>
</tr>
<tr>
<td style="text-align: center;">
<center><a name="enhance"></a> <font size="-1">enhance</font></center>
</td>
<td><font size="-1">void</font></td>
<td><font size="-1">Enhance image (minimize noise)</font></td>
</tr>
<tr>
<td style="text-align: center;">
<center><a name="equalize"></a> <font size="-1">equalize</font></center>
</td>
<td><font size="-1">void</font></td>
<td><font size="-1">Equalize image (histogram equalization)</font></td>
</tr>
<tr>
<td style="text-align: center;">
<center><a name="erase"></a> <font size="-1">erase</font></center>
</td>
<td><font size="-1">void</font></td>
<td>
<font size="-1">
Set all image pixels to the current
background color.
</font>
</td>
</tr>
<tr>
<td style="text-align: center;" rowspan="4">