File: c-api-reference.tex

package info (click to toggle)
imagemagick 6:6.0.6.2-2.9
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 33,284 kB
  • ctags: 14,844
  • sloc: ansic: 190,790; cpp: 17,203; sh: 8,740; perl: 4,190; makefile: 1,740; tcl: 459
file content (4139 lines) | stat: -rw-r--r-- 120,899 bytes parent folder | download
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
\title{C API Methods}
\toctitle{C API Methods}
\titlerunning{C API Methods}
\maketitle

\section{Methods to Constitute an Image}

\subsubsection{ConstituteImage()}
create an image from pixel data.

\begin{quote}
\hspace*{-0.25in}
Image *ConstituteImage (const unsigned long width,  const unsigned
long height,  const char *map,  const StorageType type,  const void *pixels, 
ExceptionInfo *exception) 
\end{quote}

ConstituteImage() returns an image from the pixel data you supply.
The pixel data must be in scanline order top-to-bottom.
The data can be of type \var{char}, \var{short int}, \var{int}, \var{long},
\var{float}, or \var{double}.  \var{Float} and \var{double} require the
pixels to be normalized [0..1] otherwise [0..MaxRGB].   For example, to
create a 640 x 480 image from unsigned red-green-blue character data, use

{\small
\begin{verbatim}
    image = ConstituteImage(640, 480, "RGB", CharPixel, pixels,
            exception);
\end{verbatim}
}

A description of each parameter follows:

\begin{description}
\item[width] Width in pixels of the image.
\item[height] Height in pixels of the image.
\item[map] This string reflects the expected ordering of the pixel array.  It
can be any combination or order of R = red, G = green, B = blue, A = alpha,
C = cyan, Y = yellow, M = magenta, K = black, or I = intensity (for grayscale).
\item[type] Define the data type of the pixels.  Float and double types are
expected to be normalized [0..1] otherwise [0..MaxRGB].  Choose from these
types:

\begin{tabbing}
0000\=1111111111111111\=2222222222222222\=3333333333333333\kill
\> CharPixel \> ShortPixel \> IntegerPixel \\
\> LongPixel \> FloatPixel \> DoublePixel 
\end{tabbing}
\item[pixels] This array of values contain the pixel components as defined by
\texttt{map} and \texttt{type}.  The expected length of the array varies
depending on the values of \texttt{width}, \texttt{height}, \texttt{map},
and \texttt{type}.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{DispatchImage()}
extract pixel data from an image.

\begin{quote}
\hspace*{-0.25in}
unsigned int DispatchImage(Image *image, const long x, const long y, 
const unsigned long columns, const unsigned long rows, const char *map, 
const StorageType type, void *pixels, ExceptionInfo *exception) 
\end{quote}

DispatchImage() extracts pixel data from an image and returns it to
you.  The method returns False on success otherwise
True if an error is encountered.  The data is returned as \var{char},
\var{short int}, \var{int},  \var{long}, \var{float}, or \var{double} in the
order specified by \texttt{map}.

Suppose we want want to extract the first scanline of a 640x480 image
as character data in red-green-blue order:

{\small
\begin{verbatim}
    status = DispatchImage(image, 0, 0, 640, 1, "RGB", 0, pixels,
             exception);
\end{verbatim}
}

A description of each parameter follows:

\begin{description}

\item[image] The image.
\item[x, y, columns, rows] These values define the perimeter of a region of
pixels you want to extract.
\item[map] This string reflects the expected ordering of the pixel array.  It
can be any combination or order of R = red, G = green, B = blue, A = alpha,
C = cyan, Y = yellow, M = magenta, K = black, or I = intensity (for grayscale).
\item[type] Define the data type of the pixels.  Float and double types are
normalized to [0..1] otherwise [0..MaxRGB].  Choose from these types:

\begin{tabbing}
0000\=1111111111111111\=2222222222222222\=3333333333333333\kill
\> CharPixel \> ShortPixel \> IntegerPixel \\
\> LongPixel \> FloatPixel \> DoublePixel
\end{tabbing}
\item[pixels] This array of values contain the pixel components as defined by
\texttt{map} and \texttt{type}.  You must preallocate this array where the
expected length varies depending on the values of \texttt{width},
\texttt{height}, \texttt{map}, and \texttt{type}.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{PingImage()}
get information about an image.

\begin{quote}
\hspace*{-0.25in}
Image *PingImage(const ImageInfo *image\_info, ExceptionInfo *exception)
\end{quote}

PingImage() returns all the attributes of an image or image sequence
except for the pixels.  It is much faster and consumes far less
memory than ReadImage().  On failure, a NULL image is returned and
\texttt{exception} describes the reason for the failure.

A description of each parameter follows:

\begin{description}
\item[image\_info] Ping the image defined by the \texttt{file} or
\texttt{filename} members of this structure.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{ReadImage()}
read one or more image files.

\begin{quote}
\hspace*{-0.25in}
Image *ReadImage(const ImageInfo *image\_info, ExceptionInfo *exception) 
\end{quote}

ReadImage() reads an image or image sequence from a file or file handle.
On failure, a NULL image is returned and \texttt{exception} describes
the reason for the failure.

A description of each parameter follows:

\begin{description}
\item[image\_info] Read the image defined by the \texttt{file} or
\texttt{filename} members of this structure.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{WriteImage()}
write one or more image files.

\begin{quote}
\hspace*{-0.25in}
unsigned int WriteImage(const ImageInfo *image\_info, Image *image) 
\end{quote}

Use Write() to write an image or an image sequence to a file or
filehandle.  
If writing to a file on disk, the name is defined by the
filename member of the image structure.
Write() returns 0 is there is a memory shortage or if the
image cannot be written.  Check the \texttt{exception} member of
\texttt{image} to determine the cause for any failure.

A description of each parameter follows:

\begin{description}
\item[image\_info] The image info.
\item[image] The image.
\end{description}

\section{ImageMagick Image Methods}

\subsubsection{AllocateImage()}
allocate an image.

\begin{quote}
\hspace*{-0.25in}
Image *AllocateImage(const ImageInfo *image\_info)
\end{quote}

AllocateImage() returns a pointer to an image structure initialized to
default values. 

A description of each parameter follows:

\begin{description}
\item[image\_info] Many of the image default values are set from this structure.
For example, filename, compression, depth, background color, and others.
\end{description}

\subsubsection{AllocateImageColormap()}
allocate an image colormap.

\begin{quote}
\hspace*{-0.25in}
unsigned int AllocateImageColormap(Image *image, const unsigned long colors) 
\end{quote}

AllocateImageColormap() allocates an image colormap and initializes
it to a linear gray colorspace.  If the image already has a colormap,
it is replaced.  AllocateImageColormap() returns True if successful,
otherwise False if there is not enough memory.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[colors] The number of colors in the image colormap.
\end{description}

\subsubsection{AllocateNextImage()}
allocate the next image in a sequence.

\begin{quote}
\hspace*{-0.25in}
void AllocateNextImage(const ImageInfo *image\_info, Image *image)
\end{quote}

Use AllocateNextImage() to initialize the next image in a sequence to
default values.  The \texttt{next} member of \texttt{image} points to
the newly allocated image.  If there is a memory shortage, \texttt{next}
is assigned NULL.

A description of each parameter follows:

\begin{description}

\item[image\_info] Many of the image default values are set from this
structure.  For example, filename, compression, depth, background color,
and others.
\item[image] The image.
\end{description}

\subsubsection{AnimateImages()}
animate an image sequence.

\begin{quote}
\hspace*{-0.25in}
unsigned int AnimateImages(const ImageInfo *image\_info, Image *image) 
\end{quote}

AnimateImages() repeatedly displays an image sequence to any X window
screen.  It returns a value other than 0 if successful.  Check the
\texttt{exception} member of \texttt{image} to determine the cause for
any failure.

A description of each parameter follows:

\begin{description}

\item[image\_info] The image info.
\item[image] The image.
\end{description}

\subsubsection{AppendImages()}
append a set of images.

\begin{quote}
\hspace*{-0.25in}
Image *AppendImages (Image *image, const unsigned int stack,
  ExceptionInfo *exception) 
\end{quote}

The Append() method takes a set of images and appends them to each other.
Each image in the set must have the same width or height (or both).
Append() returns a single image where each image in the original set
is side-by-side if all the heights the same or stacked on top of each
other if all widths are the same.  On failure, a NULL image is returned
and \texttt{exception} describes the reason for the failure.

A description of each parameter follows:

\begin{description}
\item[image] The image sequence.
\item[stack] An unsigned value other than stacks rectangular image top-to-bottom
otherwise left-to-right.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{AverageImages()}
average a set of images.

\begin{quote}
\hspace*{-0.25in}
Image *AverageImages (const Image *image,  ExceptionInfo *exception)
\end{quote}

The Average() method takes a set of images and averages them together.
Each image in the set must have the same width and height.  Average()
returns a single image with each corresponding pixel component of
each image averaged.   On failure, a NULL image is returned and
\texttt{exception} describes the reason for the failure.

A description of each parameter follows:

\begin{description}

\item[image] The image sequence.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{ChannelImage()}
extract a channel from the image.

\begin{quote}
\hspace*{-0.25in}
unsigned int ChannelImage (Image *image,  const ChannelType channel)
\end{quote}

Extract a channel from the image.  A channel is a particular color
component of each pixel in the image.  Choose from these components:

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[channel] Identify which channel to extract:

\begin{tabbing}
0000\=111111\kill
\> Red \\
\> Cyan \\
\> Green \\
\> Magenta \\
\> Blue \\
\> Yellow \\
\> Opacity \\
\> Black
\end{tabbing}
\end{description}

\subsubsection{CloneImage()}
create a new copy of an image.

\begin{quote}
\hspace*{-0.25in}
Image *CloneImage(Image *image, const unsigned long columns, const
unsigned long rows, const unsigned int orphan, ExceptionInfo *exception)
\end{quote}

CloneImage() copies an image and returns the copy as a new image object.
If the specified columns and rows is 0, an exact copy of the image is
returned, otherwise the pixel data is undefined and must be initialized
with the SetImagePixels() and SyncImagePixels() methods.  On failure,
a NULL image is returned and \texttt{exception} describes the reason
for the failure.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[columns] The number of columns in the cloned image.
\item[rows] The number of rows in the cloned image.
\item[orphan] With a value other than 0, the cloned image is an orphan.  An
orphan is a stand-alone image that is not assocated with an image list.  In
effect, the \texttt{next} and \texttt{previous} members of the cloned image
is set to NULL.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{CloneImageInfo()}
clone an image info structure.

\begin{quote}
\hspace*{-0.25in}
ImageInfo *CloneImageInfo(const ImageInfo *image\_info)
\end{quote}

CloneImageInfo() makes a copy of the given image info structure.  If
NULL is specified, a new image info structure is created initialized to
default values.

A description of each parameter follows:

\begin{description}
\item[image\_info] The image info.
\end{description}

\subsubsection{CompositeImage()}
composite one image to another.

\begin{quote}
\hspace*{-0.25in}
unsigned int CompositeImage(Image *image, const CompositeOperator compose,
   const Image *composite\_image, const long x\_offset, const long y\_offset) 
\end{quote}

CompositeImage() returns the second image composited onto the
first at the specified offsets.

A description of each parameter follows:

\begin{description}

\item[image] The image.
\item[compose] This operator affects how the composite is applied to
the image.  The default is Over.  Choose from these operators:

\begin{tabbing}
0000\=111111111111111111\=2222222222222222222222\=333333333333333333333\kill
\> OverCompositeOP \> DifferenceCompositeOP \> XorCompositeOP \\
\> AtopCompositeOP \> DisplaceCompositeOP \> PlusCompositeOP \\
\> MinusCompositeOP \> SubtractCompositeOP \> AddCompositeOP \\
\> InCompositeOP \> BumpmapCompositeOP \> CopyCompositeOP \\
\> OutCompositeOP
\end{tabbing}
\item[composite\_image] The composite image.
\item[x\_offset] The column offset of the composited image.  If the offset
is negative, it is measured between the right edges of the images.
\item[y\_offset] The row offset of the composited image.  If it is
negative, it is measured between the bottom edges of the images.
\end{description}

\subsubsection{CycleColormapImage()}
displace a colormap.

\begin{quote}
\hspace*{-0.25in}
CycleColormapImage(Image *image, const int amount)
\end{quote}

CycleColormap() displaces an image's colormap by a given number of
positions.  If you cycle the colormap a number of times you can produce
a psychodelic effect.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[amount] Offset the colormap this much.
\end{description}

\subsubsection{DescribeImage()}
describe an image.

\begin{quote}
\hspace*{-0.25in}
void DescribeImage (Image *image, FILE *file, const unsigned int verbose)
\end{quote}

DescribeImage() describes an image by printing its attributes to the file.
Attributes include the image width, height, size, and others.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[file] The file, typically stdout.
\item[verbose] A value other than zero prints additional detailed information
about the image.
\end{description}

\subsubsection{DestroyImage()}
destroy an image.

\begin{quote}
\hspace*{-0.25in}
void DestroyImage(Image *image)
\end{quote}

DestroyImage() dereferences an image, deallocating memory associated
with the image if the reference count becomes zero.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\end{description}

\subsubsection{DestroyImageInfo()}
destroy image info.

\begin{quote}
\hspace*{-0.25in}
void DestroyImageInfo(ImageInfo *image\_info)
\end{quote}

DestroyImageInfo() deallocates memory associated with \texttt{image\_Info}.

A description of each parameter follows:

\begin{description}
\item[image\_info] The image info.
\end{description}


\subsubsection{DisplayImages()}
display an image sequence.

\begin{quote}
\hspace*{-0.25in}
unsigned int DisplayImages(const ImageInfo *image\_info, Image *image)
\end{quote}

DisplayImages() displays an image sequence to any X window screen.  It
returns a value other than 0 if successful.  Check the \texttt{exception}
member of \texttt{image} to determine the reason for any failure.

A description of each parameter follows:

\begin{description}
\item[image\_info] The image info.
\item[image] The image.
\end{description}

\subsubsection{GetImageDepth()}
get image depth.

\begin{quote}
\hspace*{-0.25in}
unsigned int GetImageDepth(Image *image)
\end{quote}

GetImageDepth() returns the depth of the image, either 8 or 16 bits.  By
default, pixel components are stored as 16-bit two byte unsigned short
integers that range in value from 0 to 65535.  However, if all the pixels
have lower-order bytes that are identical to their higher-order bytes, the
image depth is 8-bit.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\end{description}

\subsubsection{GetImageInfo()}
get image info.

\begin{quote}
\hspace*{-0.25in}
void GetImageInfo(ImageInfo *image\_info)
\end{quote}

GetImageInfo() initializes \texttt{image\_info}  to default values.

A description of each parameter follows:

\begin{description}

\item[image\_info] The image info.
\end{description}

\subsubsection{GetImageType()}
get image type.

\begin{quote}
\hspace*{-0.25in}
ImageType GetImageType(const Image *image,ExceptionInfo *exception)
\end{quote}

GetImageType() returns the type of image:

\begin{tabbing}
0000\=1111111111111111\=2222222222222222\=3333333333333333\kill
\> Bilevel \> Grayscale \> GrayscaleMatte \\
\> Palette \> PaletteMatte \> TrueColor\\ 
\> TrueColorMatte \>  ColorSeparation \>  ColorSeparationMatte\\
\> Optimize
\end{tabbing}

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{IsImagesEqual()}
measure the pixel differences between two images.

\begin{quote}
\hspace*{-0.25in}
unsigned int IsImagesEqual(Image *image, Image *reference)
\end{quote}

IsImagesEqual() measures the difference between colors at each pixel
location of two images.  A value other than 0 means the colors match
exactly.  Otherwise an error measure is computed by summing over all
pixels in an image the distance squared in RGB space between each image
pixel and its corresponding pixel in the reference image.  The error
measure is assigned to these image members:

\begin{description}
\item[mean\_error\_per\_pixel] The mean error for any single pixel in
the image.
\item[normalized\_mean\_error] The normalized mean quantization error for
any single pixel in the image.  This distance measure is normalized to
a range between 0 and 1.  It is independent of the range of red, green,
and blue values in the image.
\item[normalized\_maximum\_error] The normalized maximum quantization
error for any single pixel in the image.  This distance measure is
normalized to a range between 0 and 1.  It is independent of the range
of red, green,  and blue values in your image.
\end{description}

Accessed as
\code{image->normalized\_mean\_error},
a small normalized mean square error,
suggests the images are very
similiar in spatial layout and color.

A description of each parameter follows:
\begin{description}

\item[image] The image.
\item[reference] The reference image.
\end{description}

\subsubsection{IsTaintImage()}
tell if an image has been altered.

\begin{quote}
\hspace*{-0.25in}
 unsigned int IsTaintImage(const Image *image)
\end{quote}

IsTaintImage() returns a value other than 0 if any pixel in the image
has been altered since it was first constituted.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\end{description}

\subsubsection{ProfileImage()}
add or remove a profile.

\begin{quote}
\hspace*{-0.25in}
unsigned int ProfileImage(Image *image, const char *profile\_name, 
  const char *filename)
\end{quote}

ProfileImage() adds or removes a ICM, IPTC, or generic profile from an
image.  If the profile name is defined it is deleted from the image.
If a filename is given, one or more profiles are read and added to the
image.  ProfileImage() returns a value other than 0 if the profile is
successfully added or removed from the image.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[profile\_name] The type of profile to add or remove.
\item[filename] The filename of the ICM, IPTC, or generic profile.
\end{description}

\subsubsection{SetImage()}
set image pixels to the background color.

\begin{quote}
\hspace*{-0.25in}
void SetImage(Image *image, const Quantum opacity)
\end{quote}

SetImage() sets the red, green, and blue components of each pixel to
the image background color and the opacity component to the specified
level of transparency.  The background color is defined by the
\texttt{background\_color} member of the image.

A description of each parameter follows:
\begin{description}

\item[image] The image.
\item[opacity] Set each pixel to this level of transparency.
\end{description}

\subsubsection{SetImageClipMask()}

\begin{quote}
\hspace*{-0.25in}
unsigned int SetImageClipMask(Image *image,Image *clip\_mask)
\end{quote}

SetImageClipMask() associates a clip mask with the image.  The clip mask
must be the same dimensions as the image.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[clip\_mask] The clip mask.
\end{description}

\subsubsection{SetImageDepth()}

\begin{quote}
\hspace*{-0.25in}
unsigned int SetImageDepth(Image *image,const unsigned long depth)
\end{quote}

SetImageDepth() sets the depth of the image, either 8 or 16.  Some image
formats support both 8 and 16-bits per color component (e.g. PNG).  Use
SetImageDepth() to specify your preference.  A value other than 0 is
returned if the depth is set.  Check the \texttt{exception} member of
\texttt{image} to determine the cause for any failure.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[depth] The image depth.
\end{description}

\subsubsection{SetImageOpacity()}
set image pixels transparency level.

\begin{quote}
\hspace*{-0.25in}
void SetImageOpacity(Image *image, const unsigned long opacity)
\end{quote}

SetImageOpacity() attenuates the opacity channel of an image.  If the
image pixels are opaque, they are set to the specified opacity level.
Otherwise, the pixel opacity values are blended with the supplied
transparency value.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[opacity] The level of transparency: 0 is fully opaque and MaxRGB is
fully transparent.
\end{description}

\subsubsection{SetImageType()}
set image type.

\begin{quote}
\hspace*{-0.25in}
void SetImageType(Image *image, const ImageType image\_type)
\end{quote}

SetImageType() sets the type of image.  Choose from these types:

\begin{tabbing}
0000\=1111111111111111\=2222222222222222\=3333333333333333\kill
\> Bilevel \> Grayscale \> GrayscaleMatte \\
\> Palette \> PaletteMatte \> TrueColor\\ 
\> TrueColorMatte \>  ColorSeparation \>  ColorSeparationMatte
\end{tabbing}

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[image\_type] Image type.
\end{description}

\subsubsection{TextureImage()}
tile a texture on image background.

\begin{quote}
\hspace*{-0.25in}
void TextureImage(Image *image, Image *texture)
\end{quote}

TextureImage() repeatedly tiles the texture image across and down the image
canvas.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[texture] This image is the texture to layer on the background.
\end{description}

\section{Working With Image Lists}

In the ImageMagick API, image lists and sequences are managed by using
the ``next'' and ``previous'' pointers in the Image structure.

Every image is a member of a doubly-linked image list,
as illustrated below:

{\small
\begin{verbatim}
          +-----+      +-----+      +-----+      +-----+
NULL<prev-|image|<prev-|image|<prev-|image|<prev-|image|
          |  0  |-next>|  1  |-next>|  2  |-next>|  3  |-next>NULL
          +-----+      +-----+      +-----+      +-----+

                            +-------+
              NULL<previous-|orphan |
                            |image  |-next>NULL
                            +-------+
\end{verbatim}
}

If the ``previous'' and ``next'' pointers are both are NULL,
the image is called an ``orphan''.  Each ``orphan'' is in effect a
single-image list.  Applications can maintain any number of image lists.
Each image belongs to only one image list.

An {\bf image sequence} is that part of an {\bf image list}
beginning with a specific image, plus the remainder of the {\bf image list}
pointed to by its {\bf next} pointer.  The image pointed to by the specific
image's ``previous'' pointer and other images in the list prior to the specific
image in the {\bf image list} do not form a part of the {\bf image sequence}.

Each image, image sequence, and image list is
referenced by pointing to an image structure of type {\tt Image *}.  In the
illustration above, a reference to the structure for Image 2 refers
to image 2 itself, to the image sequence consisting of images 2 and 3,
and to the image list consisting of all images 0 through 3.
In the C API, functions that operate on an image list contain the words
``ImageList'' as a part of the function name, and are described in this
section.  In general, functions that operate on an image sequence
contain the word ``Images'', although for legacy reasons some, such
as ReadImage(), WriteImage(), and PingImage(), do not.  In general,
functions that contain the word ``Image'' work on a single image.

\subsubsection{CloneImageList()}
duplicate an image list.

\begin{quote}
\hspace*{-0.25in}
Image *CloneImageList(const Image *images, ExceptionInfo *exception) 
\end{quote}

CloneImageList() returns a duplicate of the specified image list.

A description of each parameter follows:

\begin{description}
\item[images] The image list.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{DeleteImageFromList()}
delete an image from the list.

\begin{quote}
\hspace*{-0.25in}
unsigned int DeleteImageFromList(Image *images, const long offset)
\end{quote}

DeleteImageFromList() deletes an image at the specified position in the list..

A description of each parameter follows:

\begin{description}
\item[images] The image list.
\item[offset] The position within the list.
\end{description}

\subsubsection{DestroyImageList()}
destroy an image list.

\begin{quote}
\hspace*{-0.25in}
DestroyImageList(Image *images)
\end{quote}

DestroyImageList() destroys an image list.

A description of each parameter follows:

\begin{description}
\item[images] The image list.
\end{description}

\subsubsection{GetImageFromList()}
get an image from an image list.

\begin{quote}
\hspace*{-0.25in}
Image *GetImageFromList(const Image *images, const long offset,
  ExceptionInfo *exception) 
\end{quote}

GetImageFromList() returns a clone of the image at the specified position
in the image list.  The clone is an ``orphan'', not linked to the list.

A description of each parameter follows:

\begin{description}
\item[images] The image list.
\item[offset] The position in the image list.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{GetImageIndexInList()}
the position in the list of the specified image.

\begin{quote}
\hspace*{-0.25in}
unsigned long *GetImageIndexInList(const Image *images)
\end{quote}

GetImageIndexInList() returns the position of the specified image in the
image list.

A description of each parameter follows:

\begin{description}
\item[images] The image list.
\end{description}


\subsubsection{GetImageListLength()}
the number of images in the image list.

\begin{quote}
\hspace*{-0.25in}
unsigned long GetImageListLength(const Image *images)
\end{quote}

GetImageListLength() returns the number of images in the image list.

A description of each parameter follows:

\begin{description}
\item[images] The image list.
\end{description}

\subsubsection{GetPreviousImageInList()}
get the previous image in an image list.

\begin{quote}
\hspace*{-0.25in}
Image *GetPreviousImageInList(Image *images)
\end{quote}

GetPreviousImageInList() returns a pointer to the previous image in an
image list after the image pointed to by *images.

A description of each parameter follows:

\begin{description}
\item[images] The image list.
\end{description}

\subsubsection{GetNextImageInList()}
get the next image in an image list.

\begin{quote}
\hspace*{-0.25in}
Image *GetNextImageInList(Image *images)
\end{quote}

GetNextImageInList() returns a pointer to the next image in an image list after
the image pointed to by *images.

A description of each parameter follows:

\begin{description}
\item[images] The image list.
\end{description}

\subsubsection{ImageListToArray()}
convert an image list to an array.

\begin{quote}
\hspace*{-0.25in}
Image **ImageListToArray(const Image *images, ExceptionInfo *exception) 
\end{quote}

ImageListToArray() is a convenience method that converts a linked list of
images to a sequential array.  For example,

{\small
\begin{verbatim}
    Image **group;
    group = ImageListToArray(images, exception);
    n = GetImageListLength(images);
    for (i=0; i < n; i++)
      puts(group[i]->filename);
    LiberateMemory((void **) &group);
\end{verbatim}
}

A description of each parameter follows:
\begin{description}
\item[image] The image list.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{NewImageList()}
create an empty image list.

\begin{quote}
\hspace*{-0.25in}
Image *NewImageList(void)
\end{quote}

NewImageList() creates an empty image list.

\subsubsection{RemoveLastImageFromList()}
remove the last image from an image list.

\begin{quote}
\hspace*{-0.25in}
Image *RemoveLastImageFromList(Image **images)
\end{quote}

RemoveLastImageFromList() removes the last image in the list and returns it.

A description of each parameter follows:

\begin{description}
\item[images] The image list.
\end{description}

\subsubsection{AppendImageToList()}
adds an image list to the end of an image list.

\begin{quote}
\hspace*{-0.25in}
unsigned int *AppendImageToList(Image **images, const Image *image,
  ExceptionInfo *exception) 
\end{quote}

 AppendImageToList() adds the image list to the end of the image list.

A description of each parameter follows:

\begin{description}
\item[images] The image list.
\item[image] The image list to be added.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{ReverseImageList()}
reverse an image list.

\begin{quote}
\hspace*{-0.25in}
Image *ReverseImageList(Image *images, ExceptionInfo *exception) 
\end{quote}

ReverseImageList() returns a new list with the order of images reversed
from those in the specified image list.

A description of each parameter follows:

\begin{description}
\item[images] The image list.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{InsertImageInList()}
adds an image to the end of an image list.

\begin{quote}
\hspace*{-0.25in}
unsigned int InsertImageInList(Image **images,const Image *image,
  const long offset,ExceptionInfo *exception)
\end{quote}

InsertImageInList() inserts an image into the list at the specified position.

A description of each parameter follows:

\begin{description}
\item[images] The image list.
\item[image] The image.
\item[offset] The position within the list.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{RemoveFirstImageFromList()}
remove and return the first image in the list.

\begin{quote}
\hspace*{-0.25in}
Image *RemoveFirstImageFromList(Image **images) 
\end{quote}

RemoveFirstImageFromList() removes an image from the beginning of the specified image list.

A description of each parameter follows:

\begin{description}
\item[images] The image list.
\end{description}

\subsubsection{SpliceImageIntoList()}
splice an image list.

\begin{quote}
\hspace*{-0.25in}
Image *SpliceImageIntoList(Image *images, const long offset,
  const unsigned long length, const Image *splices, ExceptionInfo *exception) 
\end{quote}

SpliceImageIntoList() removes the images designated by offset and length from
the list and replaces them with the specified list.  The "splices" list
is not necessarily of the same length.

A description of each parameter follows:

\begin{description}
\item[images] The image list.
\item[offset] The position in the image list.
\item[length] The length of the image list to remove.
\item[splices] Replace the removed image list with this list.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{PrependImageToList()}
add an image list to the beginning of the specified list.

\begin{quote}
\hspace*{-0.25in}
unsigned int *PrependImageToList(Image **images, const Image *image,
ExceptionInfo *exception) 
\end{quote}

PrependImageToList() adds an image list to the beginning of the specified
image list.

A description of each parameter follows:

\begin{description}
\item[images] The image list.
\item[image] The image list to be added.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\section{Methods to Count the Colors in an Image}

\subsubsection{CompressColormap()}
remove duplicate or unused colormap entries.

\begin{quote}
\hspace*{-0.25in}
void CompressColormap(Image *image)
\end{quote}

CompressColormap() compresses an image colormap by removing any duplicate or
unused color entries.

A description of each parameter follows:
\begin{description}
\item[image] The image.
\end{description}

\subsubsection{GetNumberColors()}
count the number of unique colors.

\begin{quote}
\hspace*{-0.25in}
unsigned long GetNumberColors(const Image *image, FILE *file,
  ExceptionInfo *exception)
\end{quote}

GetNumberColors() returns the number of unique colors in an image.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[file] Write a histogram of the color distribution to this file handle.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{IsGrayImage()}
is the image grayscale?

\begin{quote}
\hspace*{-0.25in}
unsigned int IsGrayImage(Image *image, ExceptionInfo *exception)
\end{quote}

IsGrayImage() returns True if all the pixels in the image have the same
red, green, and blue intensities.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{IsMonochromeImage()}
is the image monochrome?

\begin{quote}
\hspace*{-0.25in}
unsigned int IsMonochromeImage(Image *image, ExceptionInfo *exception)
\end{quote}

IsMonochromeImage() returns True if all the pixels in the image have
the same red, green, and blue intensities and the intensity is either
0 or MaxRGB.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{IsOpaqueImage()}
does the image have transparent pixels?

\begin{quote}
\hspace*{-0.25in}
unsigned int IsOpaqueImage(Image *image, ExceptionInfo *exception)
\end{quote}

IsOpaqueImage() returns True if none of the pixels in the image have an
opacity value other than opaque (0).

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{IsPaletteImage()}
does the image have less than 256 unique colors?

\begin{quote}
\hspace*{-0.25in}
unsigned int IsPaletteImage(Image *image, ExceptionInfo *exception)
\end{quote}

IsPaletteImage() returns True if the image is colormapped and has 256
unique colors or less.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{ListColorsInfo}
list color names.

\begin{quote}
\hspace*{-0.25in}
unsigned int ListColorInfo(FILE *file, ExceptionInfo *exception)
\end{quote}

ListColorInfo() lists color names to the specified file.  Color names
are a convenience.  Rather than defining a color by its red, green, and
blue intensities just use a color name such as \texttt{white}, \texttt{blue},
or \texttt{yellow}.

A description of each parameter follows:
\begin{description}
\item[file] List color names to this file handle.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{QueryColorDatabase()}
return numerical values corresponding to a color name.

\begin{quote}
\hspace*{-0.25in}
unsigned int QueryColorDatabase(const char *name, PixelPacket *color,
ExceptionInfo *exception)
\end{quote}

QueryColorDatabase() returns the red, green, blue, and opacity intensities
for a given color name.

A description of each parameter follows:

\begin{description}
\item[name] The color name (e.g. white, blue, yellow).
\item[color] The red, green, blue, and opacity intensities values of
the named color in this structure.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{QueryColorname()}
return a color name for the corresponding numerical values.

\begin{quote}
\hspace*{-0.25in}
unsigned int QueryColorname(const Image *image, const PixelPacket *color,
  ComplianceType compliance, char *name, ExceptionInfo *exception)
\end{quote}

QueryColorname() returns a named color for the given color intensity.  If
an exact match is not found, a hex value is return instead.  For example
an intensity of rgb:(0,0,0) returns \texttt{black} whereas rgb:(223,223,223)
returns \#dfdfdf.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[color] The color intensities.
\item[compliance] Adhere to this color standard: SVG or X11.
\item[name] Return the color name or hex value.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\section{Methods to Reduce the Number of Unique Colors in an Image}

\subsubsection{CloneQuantizeInfo()}

\begin{quote}
\hspace*{-0.25in}
QuantizeInfo *CloneQuantizeInfo(const QuantizeInfo *quantize\_info)
\end{quote}

Method CloneQuantizeInfo() makes a duplicate of the given quantize info
structure, or if quantize info is NULL,  a new one.
A description of each parameter follows:

\begin{description}
\item[quantize\_info] a structure of type info.
\end{description}

\subsubsection{DestroyQuantizeInfo()}

\begin{quote}
\hspace*{-0.25in}
DestroyQuantizeInfo(QuantizeInfo *quantize\_info)
\end{quote}

Method DestroyQuantizeInfo() deallocates memory associated with an
QuantizeInfo structure.

A description of each parameter follows:

\begin{description}
\item[quantize\_info] Specifies a pointer to an QuantizeInfo structure.
\end{description}

\subsubsection{GetQuantizeInfo()}

\begin{quote}
\hspace*{-0.25in}
GetQuantizeInfo(QuantizeInfo *quantize\_info)
\end{quote}

Method GetQuantizeInfo() initializes the QuantizeInfo structure.

A description of each parameter follows:

\begin{description}
\item[quantize\_info] Specifies a pointer to a QuantizeInfo structure.
\end{description}

\subsubsection{MapImage()}

\begin{quote}
\hspace*{-0.25in}
unsigned int MapImage(Image *image, Image *map\_image,
  const unsigned int dither)
\end{quote}

MapImage replaces the colors of an image with the closest color from a
reference image.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[map\_image] Specifies a pointer to a Image structure.  Reduce image to a
set of colors represented by this image.
\item[dither] Set this integer value to something other than zero to dither the
quantized image.
\end{description}

\subsubsection{MapImages()}

\begin{quote}
\hspace*{-0.25in}
unsigned int MapImages(Image *images, Image *map\_image, 
  const unsigned int dither)
\end{quote}

MapImages replaces the colors of a sequence of images with the closest
color from a reference image.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[map\_image] Specifies a pointer to a Image structure.  Reduce image to a
set of colors represented by this image.
\item[dither] Set this integer value to something other than zero to dither
the quantized image.
\end{description}

\subsubsection{GetImageQuantizeError()}

\begin{quote}
\hspace*{-0.25in}
unsigned int GetImageQuantizeError(Image *image)
\end{quote}

Method GetImageQuantizeError() measures the difference between the original
and quantized images.  This difference is the total quantization error.
The error is computed by summing over all pixels in an image the distance
squared in RGB space between each reference pixel value and its quantized
value.  These values are computed:

A description of each parameter follows:

\begin{description}

\item[mean\_error\_per\_pixel]

This value is the mean error for any single pixel in the image.

\item[normalized\_mean\_square\_error]

This value is the normalized mean quantization error for any single pixel
in the image.  This distance measure is normalized to a range between
0 and 1.  It is independent of the range of red, green,  and blue values
in the image.

\item[normalized\_maximum\_square\_error]

This value is the normalized maximum quantization error for any single
pixel in the image.  This distance measure is normalized to a range
between 0 and 1.  It is independent of the range of red, green,  and blue
values in your image.

\end{description}

A description of each parameter follows:

\begin{description}
\item[image] The image.
\end{description}

\subsubsection{QuantizeImage()}

\begin{quote}
\hspace*{-0.25in}
unsigned int QuantizeImage(const QuantizeInfo *quantize\_info, Image *image)
\end{quote}

Method QuantizeImage() analyzes the colors within a reference image and
chooses a fixed number of colors to represent the image.  The goal of
the algorithm is to minimize the difference between the input and output
image while minimizing the processing time.

A description of each parameter follows:

\begin{description}
\item[quantize\_info] Specifies a pointer to an QuantizeInfo structure.
\item[image] Specifies a pointer to a Image structure.
\end{description}

\subsubsection{QuantizeImages()}

\begin{quote}
\hspace*{-0.25in}
unsigned int QuantizeImages(const QuantizeInfo *quantize\_info, Image *images)
\end{quote}

QuantizeImages analyzes the colors within a set of reference images and
chooses a fixed number of colors to represent the set.  The goal of the
algorithm is to minimize the difference between the input and output
images while minimizing the processing time.

A description of each parameter follows:

\begin{description}
\item[quantize\_info] Specifies a pointer to an QuantizeInfo structure.
\item[images] Specifies a pointer to a list of Image structures.
\end{description}

\section{Methods to Segment an Image with Thresholding Fuzzy c-Means}

\subsubsection{SegmentImage()}

\begin{quote}
\hspace*{-0.25in}
unsigned int SegmentImage(Image *image, const ColorspaceType colorspace,
  const unsigned int verbose,  const double cluster\_threshold, 
  const double smoothing\_threshold)
\end{quote}

Method SegmentImage() segments an image by analyzing the histograms of the
color components and identifying units that are homogeneous with the
fuzzy c-means technique.

Specify cluster threshold as the number of pixels in each cluster must
exceed the the cluster threshold to be considered valid.  Smoothing
threshold eliminates noise in the second derivative of the histogram.
As the value is increased, you can expect a smoother second derivative.
The default is 1.5.

A description of each parameter follows:

\begin{description}
\item[image] Specifies a pointer to an Image structure returned from ReadImage.
\item[colorspace] An unsigned integer value that indicates the colorspace.
Empirical evidence suggests that distances in YUV or YIQ correspond to perceptual
color differences more closely than do distances in RGB space.  The image
is then returned to RGB colorspace after color reduction.
\item[verbose] A value greater than zero prints detailed information about the
identified classes.
\end{description}

\section{Methods to Resize an Image}

\subsubsection{MagnifyImage()}
scale the image to twice its size.

\begin{quote}
\hspace*{-0.25in}
Image *MagnifyImage(image, ExceptionInfo *exception)
\end{quote}

MagnifyImage() is a convenience method that scales an image proportionally
to twice its size.

\begin{description}

\item[image] The image.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{MinifyImage()}
scale the image to half its size.

\begin{quote}
\hspace*{-0.25in}
Image *MinifyImage(Image *image, ExceptionInfo *exception)
\end{quote}

MinifyImage() is a convenience method that scales an image proportionally
to half its size.

A description of each parameter follows:
\begin{description}
\item[image] The image.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{ResizeImage()}
scale an image with a filter.

\begin{quote}
\hspace*{-0.25in}
Image *ResizeImage(Image *image, const unsigned long columns,
  const unsigned long rows, const FilterType filter,  const double blur, 
  ExceptionInfo *exception)
\end{quote}

ResizeImage() scales an image to the desired dimensions with one of these
filters:

\begin{tabbing}
0000\=1111111111111111\=2222222222222222\=3333333333333333\kill
\> Bessel \> Blackman \> Box \\
\> Catrom \> Cubic \> Gaussian \\
\> Hanning \> Hermite \> Lanczos \\
\> Mitchell \> Point \> Quadratic \\
\> Sinc \>  Triangle \>
\end{tabbing}

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[columns] The number of columns in the scaled image.
\item[rows] The number of rows in the scaled image.
\item[filter] Image filter to use.
\item[blur] The blur factor where > 1 is blurry, < 1 is sharp.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{SampleImage()}

\begin{quote}
\hspace*{-0.25in}
Image *SampleImage(Image *image, const unsigned long columns, 
  const unsigned long rows, ExceptionInfo *exception)
\end{quote}

SampleImage() scales an image to the desired dimensions with pixel
sampling.  Unlike other scaling methods, this method does not introduce
any additional color into the scaled image.

A description of each parameter follows:
\begin{description}

\item[image] The image.
\item[columns] The number of columns in the sampled image.
\item[rows] The number of rows in the sampled image.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{ScaleImage()}
scale an image to given dimensions.

\begin{quote}
\hspace*{-0.25in}
Image *ScaleImage(Image *image, const unsigned long columns,
   const unsigned long rows, ExceptionInfo *exception)
\end{quote}

ScaleImage() changes the size of an image to the given dimensions.

A description of each parameter follows:
\begin{description}
\item[image] The image.
\item[columns] The number of columns in the scaled image.
\item[rows] The number of rows in the scaled image.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\section{Methods to Transform an Image}

\subsubsection{ChopImage()}
chop an image.

\begin{quote}
\hspace*{-0.25in}
Image *ChopImage(Image *image, const RectangleInfo *chop\_info,
  ExceptionInfo *exception)
\end{quote}

Chop() removes a region of an image and collapses the image to occupy the
removed portion.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[chop\_info] Define the region of the image to chop with members
\texttt{x}, \texttt{y}, \texttt{width}, and \texttt{height}.
If the image gravity is \texttt{Northeast}, \texttt{East},
or \texttt{SouthEast}, the offset \texttt{x} specifies the distance from
the right edge of the region to the right edge of the chopping region.
Similarly, if the image gravity is \texttt{SouthEast}, \texttt{South},
or \texttt{SouthWest}, \texttt{y} is the distance between the bottom edges.

\item[exception] Return any errors or warnings in this structure.
\end{description}


\subsubsection{CoalesceImages()}
coalesce a set of images.

\begin{quote}
\hspace*{-0.25in}
Image *CoalesceImages(Image *image, ExceptionInfo *exception)
\end{quote}

CoalesceImages() composites a set of images while respecting any page
offsets and disposal methods.  GIF, MIFF, and MNG animation sequences
typically start with an image background and each subsequent image
varies in size and offset.  Coalesce() returns a new sequence
where each image in the sequence is the same size as the first and
composited over the previous images in the sequence.

Offsets are measured from the top left
corner of the composition to the top left corner of each image.  Positive
offsets represent a location of the image to the right and downward from
the corner of the composition.

A description of each parameter follows:

\begin{description}
\item[image] The image sequence.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{CropImage()}
crop an image.

\begin{quote}
\hspace*{-0.25in}
Image *CropImage(Image *image, const RectangleInfo *crop\_info, 
  ExceptionInfo *exception)
\end{quote}

Use CropImage() to extract a region of the image starting at the offset
defined by \texttt{crop\_info}.

A description of each parameter follows:
\begin{description}
\item[image] The image.
\item[crop\_info] Define the region of the image to crop with members
\texttt{x}, \texttt{y}, \texttt{width}, and \texttt{height}.
If the image gravity is \texttt{Northeast}, \texttt{East},
or \texttt{SouthEast}, the offset \texttt{x} specifies the distance from
the right edge of the region to the right edge of the cropping region.
Similarly, if the image gravity is \texttt{SouthEast}, \texttt{South},
or \texttt{SouthWest}, \texttt{y} is the distance between the bottom edges.
If the offset \texttt{x} is negative, it specifies the distance from
the right edge of the region to the right edge of the chopping region.

\item[exception] Return any errors or warnings in this structure.

\end{description}

\subsubsection{DeconstructImages()}
return the constituent parts of an image sequence

\begin{quote}
\hspace*{-0.25in}
Image *DeconstructImages(Image *image, ExceptionInfo *exception)
\end{quote}

DeconstructImages() compares each image with the next in a sequence and
returns the maximum bounding region of any pixel differences it discovers.
This method can undo a coalesced sequence returned by CoalesceImages(),
and is useful for removing redundant information
from a GIF or MNG animation.

A description of each parameter follows:
\begin{description}
\item[image] The image.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{FlipImage()}
reflect an image vertically.

\begin{quote}
\hspace*{-0.25in}
Image *FlipImage(Image *image, ExceptionInfo *exception)
\end{quote}

FlipImage() creates a vertical mirror image by reflecting the pixels
around the central x-axis.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{FlopImage()}
reflect an image horizontally.

\begin{quote}
\hspace*{-0.25in}
Image *FlopImage(Image *image, ExceptionInfo *exception)
\end{quote}

FlopImage() creates a horizontal mirror image by reflecting the pixels
around the central y-axis.

A description of each parameter follows:
\begin{description}
\item[image] The image.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{MosaicImages()}
inlay an image sequence to form a single coherent picture.

\begin{quote}
\hspace*{-0.25in}
Image *MosaicImages(const Image *image, ExceptionInfo *exception)
\end{quote}

MosaicImages() inlays an image sequence to form a single coherent picture.
It returns a single image with each image in the sequence composited at
the location defined by the \texttt{page} member of \texttt{image}.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{RollImage()}
offset and roll over an image.

\begin{quote}
\hspace*{-0.25in}
Image *RollImage(Image *image, const int x\_offset, const int y\_offset,
   ExceptionInfo *exception)
\end{quote}

RollImage() offsets an image as defined by \texttt{x\_offset} and
\texttt{y\_offset}.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[x\_offset] The number of columns to roll in the horizontal direction,
right-to-left (left-to-right if x\_offset is negative).
\item[y\_offset] The number of rows to roll in the vertical direction,
bottom-to-top (top-to-bottom if y\_offset is negative).
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{ShaveImage()}

\begin{quote}
\hspace*{-0.25in}
Image *ShaveImage(const Image *image, const RectangleInfo *shave\_info,
  ExceptionInfo *exception)
\end{quote}

Method ShaveImage() shaves pixels from the image edges.
It allocates the memory necessary for the new Image
structure and returns a pointer to the new image.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[shave\_info] Specifies a pointer to a structure of type Rectangle which
defines the shave region.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{TransformImage()}
resize or crop an image.

\begin{quote}
\hspace*{-0.25in}
void TransformImage(Image **image, const char *crop\_geometry, 
  const char *image\_geometry)
\end{quote}

TransformImage() is a convenience method that behaves like ResizeImage() or
CropImage() but accepts scaling and/or cropping information as a region
geometry specification.  If the operation fails, the original image handle
is returned.

A description of each parameter follows:

\begin{description}
\item[image] The image.  The transformed image is returned as this parameter.

\item[crop\_geometry] A crop geometry string.  This geometry defines
a subregion of the image to crop.

\item[image\_geometry] An image geometry string.  This geometry defines
the final size of the image.
\end{description}

\section{Methods to Shear or Rotate an Image by an Arbitrary Angle}

\subsubsection{RotateImage}

\begin{quote}
\hspace*{-0.25in}
Image *RotateImage(Image *image, const double degrees,
  ExceptionInfo *exception)
\end{quote}

Method RotateImage() creates a new image that is a rotated copy of an
existing one.  Positive angles rotate counter-clockwise(right-hand rule), 
while negative angles rotate clockwise.  Rotated images are usually
larger than the originals and have 'empty' triangular corners.  X axis.
Empty triangles left over from shearing the image are filled with the
color defined by the pixel at location(0, 0). RotateImage allocates the
memory necessary for the new Image structure and returns a pointer to
the new image.

Method RotateImage() is based on the paper "A Fast Algorithm for General
Raster Rotatation" by Alan W.  Paeth.  RotateImage is adapted from a
similar method based on the Paeth paper written by Michael Halle of the
Spatial Imaging Group, MIT Media Lab.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[degrees] Specifies the number of degrees to rotate the image.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{ShearImage()}

\begin{quote}
\hspace*{-0.25in}
Image *ShearImage(Image *image, const double x\_shear,  const double y\_shear,
  ExceptionInfo *exception)
\end{quote}

Method ShearImage() creates a new image that is a shear\_image copy of an
existing one.  Shearing slides one edge of an image along the X or Y axis, 
creating a parallelogram.  An X direction shear slides an edge along
the X axis, while a Y direction shear slides an edge along the Y axis.
The amount of the shear is controlled by a shear angle.  For X direction
shears, x\_shear is measured relative to the Y axis,  and similarly, 
for Y direction shears y\_shear is measured relative to the X axis.
Empty triangles left over from shearing the image are filled with the
color defined by the pixel at location(0, 0). ShearImage allocates the
memory necessary for the new Image structure and returns a pointer to
the new image.

Method ShearImage() is based on the paper "A Fast Algorithm for General
Raster Rotatation" by Alan W.  Paeth.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[x\_shear, y\_shear] Specifies the number of degrees to shear the image.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\section{Methods to Enhance an Image}

\subsubsection{ContrastImage()}
enhance or reduce the image contrast.

\begin{quote}
\hspace*{-0.25in}
unsigned int ContrastImage(Image *image, const unsigned int sharpen)
\end{quote}

Contrast() enhances the intensity differences between the lighter and
darker elements of the image.  Set \texttt{sharpen} to a value other than
0 to increase the image contrast otherwise the contrast is reduced.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[sharpen] Increase or decrease image contrast.
\end{description}

\subsubsection{EqualizeImage()}
equalize an image.

\begin{quote}
\hspace*{-0.25in}
unsigned int EqualizeImage(Image *image)
\end{quote}

EqualizeImage() applies a histogram equalization to the image.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\end{description}

\subsubsection{GammaImage()}
gamma-correct the image.

\begin{quote}
\hspace*{-0.25in}
unsigned int GammaImage(Image *image, const char *gamma)
\end{quote}

Use GammaImage() to gamma-correct an image.  The same image viewed on
different devices will have perceptual differences in the way the
image's intensities are represented on the screen.  Specify individual
gamma levels for the red, green, and blue channels, or adjust all three
with the \texttt{gamma} parameter.  Values typically range from 0.8 to
2.3.

You can also reduce the influence of a particular channel with a gamma value
of 0.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[gamma] Define the level of gamma correction.
\end{description}

\subsubsection{LevelImage()}
adjust the level of image contrast.

\begin{quote}
\hspace*{-0.25in}
unsigned int LevelImage(Image *image, const char *levels)
\end{quote}

Give three values delineated with commas: black, gamma, and white
(e.g. 10,1.0,65000 or 2,0.5,98%).  The white and black points range from
0 to MaxRGB or from 0 to 100% and gamma is an exponent that ranges
from 0.1 to 10.  If a "%" sign
is present, the black and white points are percentages of MaxRGB.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[levels] Define the image black and white levels and gamma.
\end{description}

\subsubsection{ModulateImage()}
adjust the brightness, saturation, and hue.

\begin{quote}
\hspace*{-0.25in}
unsigned int ModulateImage(Image *image, const char *modulate)
\end{quote}

ModulateImage() lets you control the brightness, saturation, and hue
of an image.  \texttt{Modulate} represents the brightness, saturation,
and hue as one parameter (e.g. 90,150,100).

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[modulate] Define the percent change in brightness, saturation, and hue.
\end{description}

\subsubsection{NormalizeImage()}
enhance image contrast.

\begin{quote}
\hspace*{-0.25in}
unsigned int NormalizeImage(Image *image)
\end{quote}

The NormalizeImage() method enhances the contrast of a color image by
adjusting the pixels color to span the entire range of colors available.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\end{description}

\section{ImageMagick Image Effects Methods}

\subsubsection{AddNoiseImage()}
add noise to an image.

\begin{quote}
\hspace*{-0.25in}
Image *AddNoiseImage(const Image *image, const NoiseType noise\_type, 
  ExceptionInfo *exception)
\end{quote}


AddNoiseImage() adds random noise to the image.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[noise\_type] The type of noise: Uniform, Gaussian, Multiplicative,
  Impulse, Laplacian, or Poisson.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{BlurImage()}
blur the image.

\begin{quote}
\hspace*{-0.25in}
Image *BlurImage(const Image *image, const double radius,
  const double sigma, ExceptionInfo *exception)
\end{quote}

BlurImage() blurs an image.  We convolve the image with a Gaussian
operator of the given radius and standard deviation (sigma).
For reasonable results, the radius should be larger than sigma.  Use a
radius of 0 and BlurImage() selects a suitable radius for you.

A description of each parameter follows:
\begin{description}
\item[radius] The radius of the Gaussian, in pixels,  not counting the center
pixel.
\item[sigma] The standard deviation of the Gaussian, in pixels.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{ColorizeImage()}
colorize an image.

\begin{quote}
\hspace*{-0.25in}
Image *ColorizeImage(const Image *image, const char *opacity,
  const PixelPacket target, ExceptionInfo *exception)
\end{quote}

ColorizeImage() blends the fill color with each pixel in the image.  A
percentage blend is specified with \texttt{opacity}.  Control the
application of different color components by specifying a different
percentage for each component (e.g. 90/100/10 is 90\% red, 100\% green,
and 10\% blue).

A description of each parameter follows:

\begin{description}

\item[image] The image.
\item[opacity] A character string indicating the level of opacity as a
percentage.
\item[target] A color value.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{ConvolveImage()}
apply a convolution kernel to the image.

\begin{quote}
\hspace*{-0.25in}
Image *ConvolveImage(const Image *image, const unsigned int order, 
  const double *kernel, ExceptionInfo *exception)
\end{quote}

ConvolveImage() applies a custom convolution kernel to the image.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[order] The number of columns and rows in the filter kernel.
\item[kernel] An array of double representing the convolution kernel.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{DespeckleImage()}
filter speckles.

\begin{quote}
\hspace*{-0.25in}
Image *DespeckleImage(const Image *image, ExceptionInfo *exception)
\end{quote}

DespeckleImage() reduces the {\em speckle} noise in an image while perserving
the edges of the original image.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{EdgeImage()}
detect edges within an image.

\begin{quote}
\hspace*{-0.25in}
Image *EdgeImage(const Image *image, const double radius,
  ExceptionInfo *exception)
\end{quote}

EdgeImage() finds edges in an image.  \texttt{Radius} defines the radius of
the convolution filter.  Use a radius of 0 and Edge() selects a suitable
radius for you.

A description of each parameter follows:

\begin{description}
\item[image]  The image.
\item[radius] the radius of the pixel neighborhood.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{EmbossImage}
emboss the image.

\begin{quote}
\hspace*{-0.25in}
Image *EmbossImage(const Image *image, const double radius,
  const double sigma, ExceptionInfo *exception)
\end{quote}

EmbossImage() returns a grayscale image with a three-dimensional effect.
We convolve the image with a Gaussian operator of the given radius and
standard deviation (sigma).  For reasonable results, radius should be
larger than sigma.  Use a radius of 0 and Emboss() selects a suitable
radius for you.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[radius] the radius of the pixel neighborhood.
\item[sigma] The standard deviation of the Gaussian, in pixels.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{EnhanceImage()}
filter a noisy image.

\begin{quote}
\hspace*{-0.25in}
Image *EnhanceImage(const Image *image, ExceptionInfo *exception)
\end{quote}

EnhanceImage() applies a digital filter that improves the quality of a noisy
image.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{GaussianBlurImage()}
blur an image.

\begin{quote}
\hspace*{-0.25in}
Image *GaussianBlurImage(const Image *image, const double radius,
  const double sigma, ExceptionInfo *exception)
\end{quote}

GaussianBlurImage() blurs an image.  We convolve the image with a
Gaussian operator of the given radius and standard deviation (sigma).
For reasonable results, the radius should be larger than sigma.  Use a
radius of 0 and GaussianBlurImage() selects a suitable radius for you.

A description of each parameter follows:
\begin{description}
\item[image] The image.
\item[radius] the radius of the Gaussian, in pixels,  not counting the
  center pixel.
\item[sigma] the standard deviation of the Gaussian, in pixels.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{ImplodeImage()}
apply an implosion/explosion filter.

\begin{quote}
\hspace*{-0.25in}
Image *ImplodeImage(const Image *image, const double amount, 
  ExceptionInfo *exception)
\end{quote}

ImplodeImage() applies a special effects filter to the image where
\texttt{amount} determines the amount of implosion.  Use a negative
amount for an explosive effect.


A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[amount] Define the extent of the implosion.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{MedianFilterImage()}
filter a noisy image.

\begin{quote}
\hspace*{-0.25in}
Image *MedianFilterImage(const Image *image, const double radius, 
  ExceptionInfo *exception)
\end{quote}

MedianFilterImage() applies a digital filter that improves the quality
of a noisy image.  Each pixel is replaced by the median in a set of
neighboring pixels as defined by \texttt{radius}.

A description of each parameter follows:

\begin{description}

\item[image]  The image.
\item[radius] The radius of the pixel neighborhood.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{MorphImages()}
morph a set of images.

\begin{quote}
\hspace*{-0.25in}
Image *MorphImages(const Image *image, const unsigned long number\_frames,
  ExceptionInfo *exception)
\end{quote}

The MorphImages() method requires a minimum of two images.  The first image is
transformed into the second by a number of intervening images as specified by
\texttt{frames}.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[number\_frames] Define the number of in-between image to generate.
The more in-between frames, the smoother the morph.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{MotionBlurImage()}
simulate motion blur.

\begin{quote}
\hspace*{-0.25in}
Image *MotionBlurImage(const Image *image, const double radius,
  const double sigma, ExceptionInfo *exception)
\end{quote}

MotionBlurImage() simulates motion blur.  We convolve the image with a
Gaussian operator of the given radius and standard deviation (sigma).
For reasonable results, radius should be larger than sigma.  Use a radius
of 0 and MotionBlurImage()selects a suitable radius for you.  \texttt{Angle}
gives the angle of the blurring motion.

A description of each parameter follows:

\begin{description}
\item[image]  The image.
\item[radius] The radius of the Gaussian, in pixels, not counting the center
pixel. 
\item[sigma] The standard deviation of the Motion, in pixels.
\item[angle] Apply the effect along this angle.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{NegateImage()}

\begin{quote}
\hspace*{-0.25in}
unsigned int NegateImage(Image *image, const unsigned int grayscale)
\end{quote}

Method NegateImage() negates the colors in the reference image.
The Grayscale option means that only grayscale values within the image
are negated.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\end{description}

\subsubsection{OilPaintImage()}
simulate an oil painting.

\begin{quote}
\hspace*{-0.25in}
Image *OilPaintImage(const Image *image, const double radius, 
  ExceptionInfo *exception)
\end{quote}

OilPaintImage() applies a special effect filter that simulates an oil
painting.  Each pixel is replaced by the most frequent color occurring
in a circular region defined by \texttt{radius}.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[radius] The radius of the circular neighborhood.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{PlasmaImage()}
initialize an image with plasma fractal values.

\begin{quote}
\hspace*{-0.25in}
unsigned int PlasmaImage(const Image *image, const SegmentInfo *segment, 
  int attenuate, int depth)
\end{quote}

PlasmaImage() initializes an image with plasma fractal values.  The image
must be initialized with a base color and the random number generator
seeded before this method is called.

A description of each parameter follows:

\begin{description}

\item[image] The image.
\item[segment] Define the region to apply plasma fractals values.
\item[attenuate] Define the plasma attenuation factor.
\item[depth] Limit the plasma recursion depth.
\end{description}

\subsubsection{ReduceNoiseImage()}
smooth an image.

\begin{quote}
\hspace*{-0.25in}
Image *ReduceNoiseImage(Image *image, const double radius,  ExceptionInfo
*exception)
\end{quote}

ReduceNoiseImage() smooths the contours of an image while still preserving
edge information.  The algorithm works by replacing each pixel with its
neighbor closest in value.  A neighbor is defined by \texttt{radius}.
Use a radius of 0 and ReduceNoise() selects a suitable radius for you.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[radius] The radius of the pixel neighborhood.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{ShadeImage}
shade the image with light source.

\begin{quote}
\hspace*{-0.25in}
Image *ShadeImage(const Image *image, const unsigned int color\_shading, 
  double azimuth, double elevation,  ExceptionInfo *exception)
\end{quote}

ShadeImage() shines a distant light on an image to create a
three-dimensional effect. You control the positioning of the light with
\var{azimuth} and \var{elevation}; azimuth is measured in degrees off
the x axis and elevation is measured in pixels above the Z axis.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[color\_shading] A value other than zero shades the red, green, and blue
components of the image.
\item[azimuth, elevation] Define the light source direction.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{SharpenImage()}
sharpen an image.

\begin{quote}
\hspace*{-0.25in}
Image *SharpenImage(Image *image, const double radius,  const double sigma,
  ExceptionInfo *exception)
\end{quote}

SharpenImage() sharpens an image.  We convolve the image with a
Gaussian operator of the given radius and standard deviation (sigma).
For reasonable results, radius should be larger than sigma.  Use a
radius of 0 and SharpenImage() selects a suitable radius for you.

A description of each parameter follows:

\begin{description}
\item[radius] The radius of the Gaussian, in pixels,  not counting the center
pixel.
\item[sigma] The standard deviation of the Laplacian, in pixels.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{SolarizeImage()}
apply solorization special effect.

\begin{quote}
\hspace*{-0.25in}
void SolarizeImage(Image *image, const double threshold)
\end{quote}

SolarizeImage() applies a special effect to the image, similar to the effect
achieved in a photo darkroom by selectively exposing areas of photo
sensitive paper to light.  \texttt{Threshold} ranges from 0 to MaxRGB
and is a measure of the extent of the solarization.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[threshold] Define the extent of the solarization.
\end{description}

\subsubsection{SpreadImage()}
randomly displace pixels.

\begin{quote}
\hspace*{-0.25in}
Image *SpreadImage(const Image *image, const unsigned int amount, 
  ExceptionInfo *exception)
\end{quote}

SpreadImage() is a special effects method that randomly displaces each
pixel in a block defined by the amount parameter.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[radius] An unsigned value constraining the "vicinity" for choosing a
random pixel to swap.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{SteganoImage()}
hide a digital watermark.

\begin{quote}
\hspace*{-0.25in}
Image *SteganoImage(const Image *image, Image *watermark,
  ExceptionInfo *exception)
\end{quote}

Use SteganoImage() to hide a digital watermark within the image.
Recover the hidden watermark later to prove that the authenticity of
an image.  texttt{Offset} defines the start position within the image
to hide the watermark.


A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[watermark] The watermark image.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{StereoImage()}
create a stereo special effect.

\begin{quote}
\hspace*{-0.25in}
Image *StereoImage(cosnt Image *image, Image *offset\_image, 
  ExceptionInfo *exception)
\end{quote}

StereoImage() combines two images and produces a single image that is the
composite of a left and right image of a stereo pair.  Special red-green
stereo glasses are required to view this effect.

A description of each parameter follows:

\begin{description}
\item[image] The left-hand image.
\item[offset\_image] The right-hand image.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{SwirlImage()}
swirl pixels about image center.

\begin{quote}
\hspace*{-0.25in}
Image *SwirlImage(const Image *image, double degrees,
  ExceptionInfo *exception)
\end{quote}

SwirlImage() swirls the pixels about the center of the image, where
\texttt{degrees} indicates the sweep of the arc through which each pixel
is moved.  You get a more dramatic effect as the degrees move from 1
to 360.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[degrees] Define the tightness of the swirling effect.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{ThresholdImage()}
divide pixels based on intensity values.

\begin{quote}
\hspace*{-0.25in}
unsigned int ThresholdImage(Image *image, const double threshold)
\end{quote}

ThresholdImage() changes the value of individual pixels based on the
intensity of each pixel compared to \texttt{threshold}.  The result is
a high-contrast, two color image.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[threshold] Define the threshold value.
\end{description}

\subsubsection{UnsharpMaskImage()}
sharpen an image.

\begin{quote}
\hspace*{-0.25in}
Image *UnsharpMaskImage(const Image *image, const double radius,
  const double sigma, const double amount,  const double threshold, 
  ExceptionInfo *exception)
\end{quote}

UnsharpMaskImage() sharpens an image.  We convolve the image with a
Gaussian operator of the given radius and standard deviation (sigma).
For reasonable results, radius should be larger than sigma.  Use a radius
of 0 and UnsharpMaskImage() selects a suitable radius for you.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[radius] The radius of the Gaussian, in pixels,  not counting the center
pixel.
\item[sigma] The standard deviation of the Gaussian, in pixels.
\item[amount] The percentage of the difference between the original and the
blur image that is added back into the original.
\item[threshold] The threshold, as a fraction of MaxRGB, needed to apply
the difference amount.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{WaveImage()}
special effects filter.

\begin{quote}
\hspace*{-0.25in}
Image *WaveImage(const Image *image, const double amplitude,
  const double wave\_length, ExceptionInfo *exception)
\end{quote}

The WaveImage() filter creates a "ripple" effect in the image by shifting
the pixels vertically along a sine wave whose amplitude and wavelength
is specified by the given parameters.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[amplitude, frequency] Define the amplitude and wavelength of the sine
wave.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\section{ImageMagick Image Decoration Methods}

\subsubsection{BorderImage()}
frame the image with a border.

\begin{quote}
\hspace*{-0.25in}
Image *BorderImage(const Image *image, const RectangleInfo *border\_info,
  ExceptionInfo *exception)
\end{quote}

BorderImage() surrounds the image with a border of the color defined
by the \texttt{border\_color} member of the \texttt{image} structure.
The width and height of the border are defined by the corresponding
members of the \texttt{border\_info} structure.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[border\_info] Define the width and height of the border.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{FrameImage()}
surround the image with a decorative border.

\begin{quote}
\hspace*{-0.25in}
Image *FrameImage(const Image *image, const FrameInfo *frame\_info, 
  ExceptionInfo *exception)
\end{quote}

FrameImage() adds a simulated three-dimensional border around the
image.  The color of the border is defined by the \texttt{matte\_color}
member of \texttt{image}.  Members \texttt{width} and \texttt{height}
of \texttt{frame\_info} specify the border width of the vertical and
horizontal sides of the frame.  Members \texttt{inner} and \texttt{outer}
indicate the width of the inner and outer \texttt{shadows} of the frame.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[frame\_info] Define the width and height of the frame and its bevels.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{RaiseImage()}
lighten or darken edges to create a 3-D effect.

\begin{quote}
\hspace*{-0.25in}
unsigned int RaiseImage(Image *image, const RectangleInfo *raise\_info,
  const int raised)
\end{quote}

RaiseImage() creates a simulated three-dimensional button-like effect by
lightening and darkening the edges of the image.  Members \texttt{width} and
\texttt{height} of \texttt{raise\_info} define the width of the vertical and
horizontal edge of the effect.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[raise\_info] Define the width and height of the raised area.
region.
\item[raised] A value other than zero creates a 3-D raised effect,
otherwise it has a lowered effect.
\end{description}

\section{Methods to Annotate an Image}

\subsubsection{AnnotateImage()}
annotate an image with text.

\begin{quote}
\hspace*{-0.25in}
 unsigned int AnnotateImage(Image *image, DrawInfo *draw\_info)
\end{quote}

Annotate() allows you to scribble text across an image.  The text may be
represented as a string or filename.  Precede the filename with an
``at'' sign (\texttt{@}) and the contents of the file are drawn on the
image.  Your text can optionally embed any of these special characters:

\begin{tabbing}
0000\=1111\=222222222222222\kill
\> \%b \>  file size in bytes. \\
\> \%c \>  comment. \\
\> \%d \>  directory in which the image resides. \\
\> \%e \>  extension of the image file. \\
\> \%f \>  original filename of the image. \\
\> \%h \>  height of image. \\
\> \%i \>  filename of the image. \\
\> \%k \>  number of unique colors. \\
\> \%l \>  image label. \\
\> \%m \>  image file format. \\
\> \%n \>  number of images in a image sequence. \\
\> \%o \>  output image filename. \\
\> \%p \>  page number of the image. \\
\> \%q \>  image depth (8 or 16). \\
\> \%s \>  image scene number. \\
\> \%t \>  image filename without any extension. \\
\> \%u \>  a unique temporary filename. \\
\> \%w \>  image width. \\
\> \%x \>  x resolution of the image. \\
\> \%y \>  y resolution of the image.
\end{tabbing}

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[draw\_info] The draw info.
\end{description}

\subsubsection{GetTypeMetrics()}
get font attributes.

\begin{quote}
\hspace*{-0.25in}
unsigned int GetTypeMetrics(Image *image, const DrawInfo *draw\_info,
   TypeMetric *metrics)
\end{quote}

GetTypeMetrics() returns the following information for the supplied font
and text:

\begin{itemize}
\item character width
\item character height
\item ascender
\item descender
\item text width
\item text height
\item maximum horizontal advance
\end{itemize}


A description of each parameter follows:

\begin{description}

\item[image] The image.
\item[draw\_info] The draw info.
\item[metrics] Return the font metrics in this structure.
\end{description}

\section{Methods to Draw on an Image}

\subsubsection{CloneDrawInfo}
clone a draw info structure.

\begin{quote}
\hspace*{-0.25in}
DrawInfo *CloneDrawInfo(const ImageInfo *image\_info,
  const DrawInfo *draw\_info)
\end{quote}

CloneDrawInfo() makes a copy of the given draw info structure.  If NULL
is specified, a new image info structure is created initialized to
default values.

A description of each parameter follows:

\begin{description}
\item[image\_info] The image info.
\item[draw\_info] The draw info.
\end{description}

\subsubsection{ColorFloodfillImage()}
floodfill the designed area with color.

\begin{quote}
\hspace*{-0.25in}
unsigned int ColorFloodfillImage(Image *image, const DrawInfo *draw\_info,
  const PixelPacket target,  const long x,  const long y,
  const PaintMethod method)
\end{quote}

ColorFloodfill() changes the color value of any pixel that matches
\texttt{target} and is an immediate neighbor.  If the method
\texttt{FillToBorderMethod} is specified, the color value is changed
for any neighbor pixel that does not match the \texttt{bordercolor}
member of \texttt{image}.

By default \texttt{target} must match a particular pixel color
exactly.  However, in many cases two colors may differ by a small
amount.  The \texttt{fuzz} member of \texttt{image} defines how much
tolerance is acceptable to consider two colors as the same.  For
example, set fuzz to 10 and the color red at intensities of 100 and 102
respectively are now interpreted as the same color for the purposes of
the floodfill.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[draw\_info] The draw info.
\item[target] The RGB value of the target color.
\item[x, y] The starting location of the operation.
\item[method] Choose either \texttt{FloodfillMethod} or
   \texttt{FillToBorderMethod}.
\end{description}

\subsubsection{DestroyDrawInfo()}
destroy draw info.

\begin{quote}
\hspace*{-0.25in}
void DestroyDrawInfo(DrawInfo *draw\_info)
\end{quote}

DestroyDrawInfo() deallocates memory associated with \texttt{draw\_info}.

A description of each parameter follows:

\begin{description}
\item[draw\_info] The draw info.
\end{description}

\subsubsection{DrawImage}
annotate an image with a graphic primitive.

\begin{quote}
\hspace*{-0.25in}
unsigned int DrawImage(Image *image, const DrawInfo *draw\_info)
\end{quote}

Use DrawImage() to draw a graphic primitive on your image.  The
primitive may be represented as a string or filename.  Precede the
filename with an ``at'' sign (\texttt{@}) and the contents of the file
are drawn on the image.   You can affect how text is drawn by setting
one or more members of the draw info structure:

\begin{description}
\item[primitive]  The primitive describes the type of graphic to draw.
Choose from these primitives:
\begin{tabbing}
0000\=11111111111111111111111\=22222222222222222\=3333333333333333333333\kill
\> PointPrimitive \> LinePrimitive  \> RectanglePrimitive \\
\> roundRectanglePrimitive  \> ArcPrimitive  \> EllipsePrimitive \\
\> CirclePrimitive  \> PolylinePrimitive  \> PolygonPrimitive \\
\> BezierPrimitive  \> PathPrimitive  \> ColorPrimitive \\
\> MattePrimitive \> TextPrimitive \> ImagePrimitive
\end{tabbing}
\item[antialias] The visible effect of antialias is to smooth out the
rounded corners of the drawn shape.  Set to 0 to keep crisp edges.
\item[bordercolor] The Color primitive with a method of FloodFill
changes the color value of any pixel that matches \texttt{fill} and is an
immediate neighbor.  If \texttt{bordercolor} is specified, the color
value is changed for any neighbor pixel that is not \texttt{fill}.
\item[density] This parameter sets the vertical and horizontal resolution of
the font.  The default is 72 pixels/inch.
\item[fill] The fill color paints any areas inside the outline of drawn shape.
\item[font] A font can be a Truetype (arial.ttf), Postscript (Helvetica), or a
fully-qualified X11 font (-*-helvetica-medium-r-*-*-12-*-*-*-*-*-iso8859-*).
\item[geometry] Geometry defines the baseline position where the graphic
primitive is rendered (e.g. +100+50).
\item[method] Primitives Matte and Image behavior depends on the painting
method you choose:

\begin{tabbing}
0000\=1111111111111111\=2222222222222222\=3333333333333333\kill
\> Point \> Replace  \> Floodfull \\
\> FillToBorder \> Reset 
\end{tabbing}
\item[points] List one or more sets of coordinates as required by
the graphic primitive you selected.
\item[pointsize] The font pointsize.  The default is 12.
\item[rotate] Specifies a rotation of \var{rotate-angle} degrees about a given
point. 
\item[scale] Specifies a scale operation by \var{sx} and \var{sy}.
\item[skewX] Specifies a skew transformation along the x-axis.
\item[skewY] Specifies a skew transformation along the y-axis.
\item[stroke] A stroke color paints along the outline of the shape.
\item[stroke\_width] The width of the stroke of the shape.  A zero value
means no stroke is painted.
\item[translate] Specifies a translation by \var{tx} and \var{ty}.
\end{description}


A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[draw\_info] The draw info.
\end{description}

\subsubsection{MatteFloodfillImage()}
floodfill an area with transparency.

\begin{quote}
\hspace*{-0.25in}
unsigned int MatteFloodfillImage(Image *image, const PixelPacket target,
  const unsigned int opacity, const long x, const long y,
  const PaintMethod method)
\end{quote}

MatteFloodfill() changes the transparency value of any pixel that
matches \texttt{target} and is an immediate neighbor.  If the method 
\texttt{FillToBorderMethod} is specified, the transparency value is
changed for any neighbor pixel that does not match the
\texttt{bordercolor} member of \texttt{image}.

By default \texttt{target} must match a particular pixel transparency
exactly.  However, in many cases two transparency values may differ by
a small amount.  The \texttt{fuzz} member of \texttt{image} defines how
much tolerance is acceptable to consider two transparency values as the
same.  For example, set fuzz to 10 and the opacity values of 100 and
102 respectively are now interpreted as the same value for the purposes
of the floodfill.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[target] The RGB value of the target color.
\item[opacity] The level of transparency: 0 is fully opaque and MaxRGB is
fully transparent.
\item[x, y] The starting location of the operation.
\item[method] Choose either \texttt{FloodfillMethod} or
   \texttt{FillToBorderMethod}.
\end{description}

\subsubsection{OpaqueImage}
globally change a color.

\begin{quote}
\hspace*{-0.25in}
unsigned int OpaqueImage(Image *image, const PixelPacket target, 
  const PixelPacket fill)
\end{quote}

OpaqueImage() changes any pixel that matches \texttt{color} with the
color defined by \texttt{fill}.

By default \texttt{color} must match a particular pixel color exactly.
However, in many cases two colors may differ by a small amount.
\texttt{Fuzz} defines how much tolerance is acceptable to consider two
colors as the same.  For example, set fuzz to 10 and the color red at
intensities of 100 and 102 respectively are now interpreted as the same
color.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[target] The RGB value of the target color.
\item[fill] The replacement color.
\end{description}

\subsubsection{TransparentImage()}
make color transparent.

\begin{quote}
\hspace*{-0.25in}
unsigned int TransparentImage(Image *image, const PixelPacket target,
  const unsigned int opacity)
\end{quote}

TransparentImage() changes the opacity value associated with any pixel that
matches \texttt{color} to the value defined by \texttt{opacity}.

By default \texttt{color} must match a particular pixel color exactly.
However, in many cases two colors may differ by a small amount.
\texttt{Fuzz} defines how much tolerance is acceptable to consider
two colors as the same.  For example, set fuzz to 10 and the color red
at intensities of 100 and 102 respectively are now interpreted as the
same color.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[target] The RGB value of the target color.
\item[fill] The replacement opacity value.
\end{description}

\section{Methods to Create a Montage}

\subsubsection{CloneMontageInfo()}
clone a montage info structure.

\begin{quote}
\hspace*{-0.25in}
MontageInfo *CloneMontageInfo(const ImageInfo *image\_info, 
  const MontageInfo *montage\_info)
\end{quote}

CloneMontageInfo() makes a copy of the given montage info structure.  If
NULL is specified, a new image info structure is created initialized to
default values.

A description of each parameter follows:

\begin{description}
\item[image\_info] The image info.
\item[montage\_info] The montage info.
\end{description}

\subsubsection{DestroyMontageInfo()}
destroy montage info.

\begin{quote}
\hspace*{-0.25in}
void DestroyMontageInfo(MontageInfo *montage\_info)
\end{quote}

DestroyMontageInfo() deallocates memory associated with \texttt{montage\_info}.

A description of each parameter follows:

\begin{description}
\item[montage\_info] The montage info.
\end{description}

\subsubsection{GetMontageInfo()}
get montage info.

\begin{quote}
\hspace*{-0.25in}
void GetMontageInfo(const ImageInfo *image\_info, MontageInfo *montage\_info)
\end{quote}

GetMontageInfo() initializes \texttt{montage\_info} to default values.

A description of each parameter follows:

\begin{description}
\item[image\_info] The image info.
\item[montage\_info] The montage info.
\end{description}

\subsubsection{MontageImages()}
uniformly tile thumbnails across an image canvas.

\begin{quote}
\hspace*{-0.25in}
Image *MontageImages(const Image *image, const MontageInfo *montage\_info,
  ExceptionInfo *exception)
\end{quote}

Montageimages() is a layout manager that lets you tile one or more
thumbnails across an image canvas.

A description of each parameter follows:

\begin{description}

\item[image] The image.
\item[montage\_info] The montage info.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\section{Image Text Attributes Methods}

\subsubsection{DestroyImageAttributes()}
destroy an image attribute.

\begin{quote}
\hspace*{-0.25in}
DestroyImageAttributes(Image *image)
\end{quote}

DestroyImageAttributes() deallocates memory associated with the
image attribute list.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\end{description}

\subsubsection{GetImageAttribute()}
get an image attribute.

\begin{quote}
\hspace*{-0.25in}
ImageAttribute *GetImageAttribute(const Image *image, const char *key)
\end{quote}

GetImageAttribute() searches the list of image attributes and returns
a pointer to attribute if it exists otherwise NULL.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[key] These character strings are the name of an image attribute to return.
\end{description}

\subsubsection{SetImageAttribute()}
set an image attribute.

\begin{quote}
\hspace*{-0.25in}
unsigned int SetImageAttribute(Image *image, const char *key,
  const char *value)
\end{quote}

SetImageAttribute searches the list of image attributes and replaces the
attribute value.  If it is not found in the list, the attribute name
and value is added to the list.  If the attribute exists in the list,
the value is concatenated to the attribute.  SetImageAttribute returns
True if the attribute is successfully concatenated or added to the list,
otherwise False.  If the value is NULL,  the matching key is deleted
from the list.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[key, value] These character strings are the name and value of an image
attribute to replace or add to the list.
\end{description}

\section{Methods to Compute a Digital Signature for an Image}

\subsubsection{SignatureImage()}

\begin{quote}
\hspace*{-0.25in}
unsigned int SignatureImage(Image *image)
\end{quote}

SignatureImage() computes a message digest from an image pixel stream
with an implementation of the NIST SHA-256 Message Digest algorithm.  This
signature uniquely identifies the image and is convenient for determining
whether two images are identical.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\end{description}

\section{Methods to Interactively Animate an Image Sequence}

\subsubsection{XAnimateBackgroundImage}

\begin{quote}
\hspace*{-0.25in}
void XAnimateBackgroundImage(Display *display, XResourceInfo *resource\_info,
  Image *image)
\end{quote}

XAnimateBackgroundImage() animates an image sequence in the background
of a window.

A description of each parameter follows:

\begin{description}
\item[display] Specifies a connection to an X server returned from XOpenDisplay.
\item[resource\_info] Specifies a pointer to a X11 XResourceInfo structure.
\item[image] Specifies a pointer to a Image structure returned from ReadImage.
\end{description}

\subsubsection{XAnimateImage}
animate an image in an X window.

\begin{quote}
\hspace*{-0.25in}
Image *XAnimateImages(Display *display, XResourceInfo *resource\_info, 
  char **argv, const int argc, Image *image)
\end{quote}

XAnimateImages() displays an image via X11.

A description of each parameter follows:
\begin{description}
\item[display] Specifies a connection to an X server returned from XOpenDisplay.
\item[resource\_info] Specifies a pointer to a X11 XResourceInfo structure.
\item[argv] Specifies the application's argument list.
\item[argc] Specifies the number of arguments.
\item[image] Specifies a pointer to a Image structure returned from ReadImage.
\end{description}

\section{Methods to Interactively Display and Edit an Image}

\subsubsection{XDisplayBackgroundImage}
display an image to the background of an X window.

\begin{quote}
\hspace*{-0.25in}
unsigned int XDisplayBackgroundImage(Display *display,
  XResourceInfo *resource\_info, Image *image)
\end{quote}

XDisplayBackgroundImage() displays an image in the background of
a window.

A description of each parameter follows:

\begin{description}
\item[display] Specifies a connection to an X server returned from XOpenDisplay.
\item[resource\_info]
Specifies a pointer to a X11 XResourceInfo structure.
\item[image]
Specifies a pointer to a Image structure returned from ReadImage.
\end{description}

\subsubsection{XDisplayImage}
display an image on an X window.

\begin{quote}
\hspace*{-0.25in}
Image *XDisplayImage(Display *display, XResourceInfo *resource\_info,
  char **argv,  int argc,  Image **image,  unsigned long *state)
\end{quote}

XDisplayImage() displays an image via X11.  A new image is created and
returned if the user interactively transforms the displayed image.

A description of each parameter follows:

\begin{description}
\item[display] Specifies a connection to an X server returned from XOpenDisplay.
\item[resource\_info] Specifies a pointer to a X11 XResourceInfo structure.
\item[argv] Specifies the application's argument list.
\item[argc] Specifies the number of arguments.
\item[image] The image.
\end{description}

\section{Methods to Get or Set Image Pixels}

\subsubsection{AcquirePixelCache()}
acquire image pixels.

\begin{quote}
\hspace*{-0.25in}
PixelPacket *AcquirePixelCache(Image *image, const int x,  const int y, 
  const unsigned long columns, const unsigned long rows,
  ExceptionInfo *exception) 
\end{quote}

AcquirePixelCache() acquires pixels from the in-memory or disk pixel
cache as defined by the geometry parameters.  A pointer to the pixels
is returned if the pixels are transferred, otherwise a NULL is returned.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[x, y, columns, rows] These values define the perimeter of a region of
\item[exception] Return any errors or warnings in this structure.
pixels.
\end{description}

\subsubsection{GetIndexes()}
get indexes.

\begin{quote}
\hspace*{-0.25in}
IndexPacket *GetIndexes(const Image *image)
\end{quote}

GetIndexes() returns the colormap indexes associated with
the last call to the SetPixelCache() or GetPixelCache() methods.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\end{description}

\subsubsection{GetOnePixel()}
get one pixel from cache.

\begin{quote}
\hspace*{-0.25in}
PixelPacket *GetOnePixel(const Image image, const int x, const int y)
\end{quote}

GetOnePixelFromCache() returns a single pixel at the specified(x, y)
location.  The image background color is returned if an error occurs.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[x, y] These values define the location of the pixel to return.
\end{description}

\subsubsection{GetPixelCache()}
get pixels from cache.

\begin{quote}
\hspace*{-0.25in}
PixelPacket *GetPixelCache(Image *image, const int x,  const int y, 
  const unsigned long columns, const unsigned long rows)
\end{quote}

GetPixelCache() gets pixels from the in-memory or disk pixel cache as
defined by the geometry parameters.  A pointer to the pixels is returned
if the pixels are transferred, otherwise a NULL is returned.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[x, y, columns, rows]
These values define the perimeter of a region of
pixels.
\end{description}

\subsubsection{SetPixelCache()}
set pixel cache.

\begin{quote}
\hspace*{-0.25in}
PixelPacket *SetPixelCache(Image *image, const int x,  const int y, 
  const unsigned long columns, const unsigned long rows)
\end{quote}

SetPixelCache() allocates an area to store image pixels as defined by
the region rectangle and returns a pointer to the area.  This area is
subsequently transferred from the pixel cache with method SyncPixelCache.
A pointer to the pixels is returned if the pixels are transferred,
otherwise a NULL is returned.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\item[x, y, columns, rows]
These values define the perimeter of a region of
pixels.
\end{description}

\subsubsection{SyncPixelCache()}
synchronize pixel cache.

\begin{quote}
\hspace*{-0.25in}
unsigned int SyncPixelCache(Image *image)
\end{quote}

SyncPixelCache() saves the image pixels to the in-memory or disk cache.
The method returns True if the pixel region is synced, otherwise False.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\end{description}

\section{ImageMagick Cache Views Methods}

\subsubsection{CloseCacheView}
close cache view.

\begin{quote}
\hspace*{-0.25in}
 void CloseCacheView(ViewInfo *view)
\end{quote}

CloseCacheView() closes the specified view returned by a previous call
to OpenCacheView().

A description of each parameter follows:

\begin{description}
\item[view]
The address of a structure of type ViewInfo.
\end{description}

\subsubsection{GetCacheView}
get cache view.

\begin{quote}
\hspace*{-0.25in}
PixelPacket *GetCacheView(ViewInfo *view, const int x,  const int y,
  const unsigned long columns,  const unsigned long rows)
\end{quote}

GetCacheView() gets pixels from the in-memory or disk pixel cache as
defined by the geometry parameters.  A pointer to the pixels is returned
if the pixels are transferred, otherwise a NULL is returned.

A description of each parameter follows:

\begin{description}
\item[view] The address of a structure of type ViewInfo.
\item[x, y, columns, rows]
These values define the perimeter of a region of pixels.
\end{description}

\subsubsection{GetCacheViewIndexes}
get cache view indexes.

\begin{quote}
\hspace*{-0.25in}
IndexPacket *GetCacheViewIndexes(const ViewInfo *view)
\end{quote}

GetCacheViewIndexes() returns the colormap indexes associated with
the specified view.

A description of each parameter follows:

\begin{description}
\item[view] The address of a structure of type ViewInfo.
\end{description}

\subsubsection{GetCacheViewPixels}
get cache view.

\begin{quote}
\hspace*{-0.25in}
PixelPacket *GetCacheViewPixels(const ViewInfo *view)
\end{quote}

GetCacheViewPixels() returns the pixels associated with the specified
specified view.

A description of each parameter follows:

\begin{description}
\item[view] The address of a structure of type ViewInfo.
\end{description}

\subsubsection{OpenCacheView}
open a cache view.

\begin{quote}
\hspace*{-0.25in}
 ViewInfo *OpenCacheView(Image *image)
\end{quote}

OpenCacheView() opens a view into the pixel cache.

A description of each parameter follows:

\begin{description}
\item[image] The image.
\end{description}

\subsubsection{SetCacheView}
set a cache view.

\begin{quote}
\hspace*{-0.25in}
PixelPacket *SetCacheView(ViewInfo *view, const long x,  const long y,
  const unsigned long columns,  const unsigned long rows)
\end{quote}

SetCacheView() gets pixels from the in-memory or disk pixel cache as
defined by the geometry parameters.  A pointer to the pixels is returned
if the pixels are transferred, otherwise a NULL is returned.

A description of each parameter follows:
\begin{description}

\item[view] The address of a structure of type ViewInfo.
\item[x, y, columns, rows] 
These values define the perimeter of a region of pixels.
\end{description}

\subsubsection{SyncCacheView}
synchronize a cache view.

\begin{quote}
\hspace*{-0.25in}
 unsigned int SyncCacheView(ViewInfo *view)
\end{quote}

SyncCacheView() saves the view pixels to the in-memory or disk cache.
The method returns True if the pixel region is synced, otherwise False.

A description of each parameter follows:
\begin{description}
\item[view] The address of a structure of type ViewInfo.
\end{description}

\section{Image Pixel FIFO}

\subsubsection{ReadStream()}
read a stream.

\begin{quote}
\hspace*{-0.25in}
unsigned int ReadStream(const ImageInfo *image\_info,
  void (*Stream)(const Image *, const void *,  const size\_t),
  ExceptionInfo *exception)
\end{quote}

ReadStream() makes the image pixels available to a user supplied callback
method immediately upon reading a scanline with the ReadImage() method.

A description of each parameter follows:

\begin{description}
\item[image\_info] The image info.
\item[stream] A callback method.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{WriteStream()}
write a stream.

\begin{quote}
\hspace*{-0.25in}
unsigned int WriteStream(const ImageInfo *image\_info,
  Image *, int(*Stream) (const Image *, const void *, const size\_t))
\end{quote}

WriteStream() makes the image pixels available to a user supplied
callback method immediately upon writing pixel data with the WriteImage()
method.

A description of each parameter follows:

\begin{description}
\item[image\_info] The image info.
\item[stream] A callback method.
\end{description}

\section{Methods to Read or Write Binary Large Objects}

\subsubsection{BlobToImage()}
convert a blob to an image.

\begin{quote}
\hspace*{-0.25in}
Image *BlobToImage(const ImageInfo *image\_info, const void
*blob, const size\_t length,  ExceptionInfo *exception)
\end{quote}

BlobToImage() implements direct to memory image formats.  It returns
the blob as an image.

A description of each parameter follows:

\begin{description}
\item[image\_info] The image info.
\item[blob] The address of a character stream in one of the image formats
understood by ImageMagick.
\item[length] This size\_t integer reflects the length in bytes of the blob.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{DestroyBlobInfo()}
destroy a blob.

\begin{quote}
\hspace*{-0.25in}
 void DestroyBlobInfo(BlobInfo *blob)
\end{quote}

DestroyBlobInfo() deallocates memory associated with an BlobInfo structure.

A description of each parameter follows:

\begin{description}
\item[blob] Specifies a pointer to a BlobInfo structure.
\end{description}

\subsubsection{GetBlobInfo()}
initialize a blob.

\begin{quote}
\hspace*{-0.25in}
void GetBlobInfo(BlobInfo *blob)
\end{quote}

GetBlobInfo() initializes the BlobInfo structure.

A description of each parameter follows:

\begin{description}
\item[blob] Specifies a pointer to a BlobInfo structure.
\end{description}

\subsubsection{ImageToBlob()}
convert image to a blob.

\begin{quote}
\hspace*{-0.25in}
void *ImageToBlob(const ImageInfo *image\_info, Image *image,
  size\_t *length, ExceptionInfo *exception)
\end{quote}

ImageToBlob() implements direct to memory image formats.  It returns the
image as a blob and its length.  The magick member of the Image structure
determines the format of the returned blob(GIG, JPEG,  PNG, etc.).

A description of each parameter follows:

\begin{description}
\item[image\_info] Specifies a pointer to an ImageInfo structure.
\item[image] The image.
\item[length] This pointer to a size\_t integer sets the initial length of the
blob.  On return, it reflects the actual length of the blob.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\section{ImageMagick Registry Methods}

\subsubsection{DeleteMagickRegistry}
delete a blob from the registry.


\begin{quote}
\hspace*{-0.25in}
 unsigned int DeleteMagickRegistry(const long id)
\end{quote}

DeleteMagickRegistry() deletes an entry in the registry as defined by the id.
It returns True if the entry is deleted otherwise False if no entry is
found in the registry that matches the id.

A description of each parameter follows:
\begin{description}
\item[id] The registry id.
\end{description}

\subsubsection{GetImageFromMagickRegistry}
get an image from the registry by name.

\begin{quote}
\hspace*{-0.25in}
Image *GetImageFromMagickRegistry(const char *name, ExceptionInfo *exception)
\end{quote}

GetImageFromMagickRegistry() gets an image from the registry as defined by
its name.  If the blob that matches the name is not found, NULL is returned.

A description of each parameter follows:
\begin{description}

\item[name] The image name.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{GetMagickRegistry}
get a blob from the registry.

\begin{quote}
\hspace*{-0.25in}
const void *GetMagickRegistry(const long id,RegistryType *type,
  size\_t *length, ExceptionInfo *exception)
\end{quote}

GetMagickRegistry() gets a blob from the registry as defined by the id.  If
the blob that matches the id is not found, NULL is returned.

A description of each parameter follows:
\begin{description}

\item[id] The registry id.
\item[type] The registry type.
\item[length] The blob length in number of bytes.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{SetMagickRegistry}
save a blob to the registry.


\begin{quote}
\hspace*{-0.25in}
long SetMagickRegistry(const void *blob,const size\_t length,
  ExceptionInfo *exception)
\end{quote}

SetMagickRegistry() sets a blob into the registry and returns a unique ID.
If an error occurs, -1 is returned.


A description of each parameter follows:
\begin{description}
\item[type] The registry type.
\item[blob] The address of a Binary Large OBject.
\item[length]
The blob length in number of bytes.

\item[exception]
Return any errors or warnings in this structure.
\end{description}

\section{Methods to Read or List ImageMagick Image formats}

\subsubsection{DestroyMagickInfo()}
destroy magick info.

\begin{quote}
\hspace*{-0.25in}
void DestroyMagickInfo()
\end{quote}

DestroyMagickInfo() deallocates memory associated MagickInfo list.

\subsubsection{GetImageMagick()}
return an image format that matches the magic number.

\begin{quote}
\hspace*{-0.25in}
char *GetImageMagick(const unsigned char *magick, const size\_t length)
\end{quote}

Method GetImageMagick() searches for an image format that matches the
specified magick string.  If one is found the tag is returned otherwise
NULL.

A description of each parameter follows:

\begin{description}
\item[magick] The image format we are searching for.
\item[length] The length of the binary string.
\end{description}

\subsubsection{GetMagickConfigurePath()}
get the path of a configuration file.

\begin{quote}
\hspace*{-0.25in}
char *GetMagickConfigurePath(const char *filename)
\end{quote}

GetMagickConfigurePath() searches a number of pre-defined locations
for the specified ImageMagick configuration file and returns the path.
The search order follows:

\begin{verbatim}
<current directory>/
<client path>/
$MAGICK_HOME/
$HOME/.magick/
MagickLibPath
MagickModulesPath
MagickSharePath
\end{verbatim}

A description of each parameter follows:

\begin{description}
\item[filename] The desired configuration file.
\end{description}

\subsubsection{GetMagickInfo()}
get image format attributes.

\begin{quote}
\hspace*{-0.25in}
MagickInfo *GetMagickInfo(const char *tag)
\end{quote}

GetMagickInfo() returns a pointer MagickInfo structure that matches
the specified tag.  If tag is NULL, the head of the image format list
is returned.

A description of each parameter follows:

\begin{description}
\item[tag] The image format we are looking for.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{GetMagickVersion()}
get the ImageMagick version.

\begin{quote}
\hspace*{-0.25in}
 char *GetMagickVersion(unsigned int *version)
\end{quote}

GetMagickVersion() returns the ImageMagick API version as a string and as a
number.

A description of each parameter follows:

\begin{description}
\item[version] The ImageMagick version is returned as a number.
\end{description}

\subsubsection{InitializeMagick()}
initialize the ImageMagick API.

\begin{quote}
\hspace*{-0.25in}
InitializeMagick(const char *path)
\end{quote}

InitializeMagick() initializes the ImageMagick environment.

A description of each parameter follows:

\begin{description}
\item[path] The execution path of the current ImageMagick client.
\end{description}

\subsubsection{ListMagickInfo()}
list the recognized image formats.

\begin{quote}
\hspace*{-0.25in}
void ListMagickInfo(FILE *file)
\end{quote}

ListMagickInfo() lists the image formats to a file.

A description of each parameter follows:

\begin{description}
\item[file] A file handle.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{RegisterMagickInfo()}
register a new image format.

\begin{quote}
\hspace*{-0.25in}
MagickInfo *RegisterMagickInfo(MagickInfo *entry)
\end{quote}

RegisterMagickInfo() adds attributes for a particular image format to the
list of supported formats.  The attributes include the image format tag,
a method to read and/or write the format,  whether the format supports the
saving of more than one frame to the same file or blob, whether the format
supports native in-memory I/O, and a brief description of the format.

A description of each parameter follows:

\begin{description}
\item[entry] The magick info.
\end{description}

\subsubsection{SetMagickInfo()}

\begin{quote}
\hspace*{-0.25in}
MagickInfo *SetMagickInfo(const char *tag)
\end{quote}

Method SetMagickInfo() allocates a MagickInfo structure and initializes
the members to default values.

A description of each parameter follows:

\begin{description}
\item[tag] a character string that represents the image format associated with the
MagickInfo structure.
\end{description}

\subsubsection{UnregisterMagickInfo()}

\begin{quote}
\hspace*{-0.25in}
unsigned int UnregisterMagickInfo(const char *tag)
\end{quote}

Method UnregisterMagickInfo() removes a tag from the magick info list.
It returns False if the tag does not exist in the list otherwise True.

A description of each parameter follows:

\begin{description}
\item[tag] a character string that represents the image format we are looking for.
\end{description}

\section{ImageMagick Error Methods}

\subsubsection{CatchImageException()}

\begin{quote}
\hspace*{-0.25in}
CatchImageException(Image *image)
\end{quote}

CatchImageException() returns if no exceptions are found in the image
sequence, otherwise it determines the most severe exception and reports
it as a warning or error depending on the severity.

A description of each parameter follows:

\begin{description}
\item[image] An image sequence.
\end{description}

\subsubsection{DestroyExceptionInfo()}
destroy exception info.

\begin{quote}
\hspace*{-0.25in}
void DestroyExceptionInfo(ExceptionInfo *exception)
\end{quote}

DestroyExceptionInfo() deallocates memory associated with \texttt{exception}.

A description of each parameter follows:

\begin{description}
\item[exception] The exception info.
\end{description}

\subsubsection{GetExceptionInfo}
get exception info.

\begin{quote}
\hspace*{-0.25in}
GetExceptionInfo(ExceptionInfo *exception)
\end{quote}

GetExceptionInfo() initializes \texttt{exception}  to default values.

A description of each parameter follows:

\begin{description}
\item[exception] The exception info.
\end{description}

\subsubsection{GetImageException()}
get the severest error.

\begin{quote}
\hspace*{-0.25in}
GetImageException(Image *image, ExceptionInfo *exception)
\end{quote}

GetImageException() traverses an image sequence and returns any error
more severe than noted by the exception parameter.

A description of each parameter follows:

\begin{description}
\item[image] An image sequence.
\item[exception] Return the highest severity exception in the seqeunce.
\end{description}

\subsubsection{MagickError()}
declare an error.

\begin{quote}
\hspace*{-0.25in}
void MagickError(const ExceptionType error, const char *reason, 
  const char *description)
\end{quote}

MagickError() calls the error handler method with an error reason.

A description of each parameter follows:

\begin{description}
\item[exception] The error severity.
\item[reason] Define the reason for the error.
\item[description] Describe the error.
\end{description}

\subsubsection{MagickWarning()}
declare a warning.

\begin{quote}
\hspace*{-0.25in}
void MagickWarning(const ExceptionType warning, const char *reason, 
  const char *description)
\end{quote}

MagickWarning() calls the warning handler method with a warning reason.

A description of each parameter follows:

\begin{description}
\item[warning] The warning severity.
\item[reason] Define the reason for the warning.
\item[description] Describe the warning.
\end{description}

\subsubsection{SetErrorHandler()}
set the warning handler.

\begin{quote}
\hspace*{-0.25in}
ErrorHandler SetErrorHandler(ErrorHandler handler)
\end{quote}

SetErrorHandler() sets the error handler to the specified method
and returns the previous error handler.

A description of each parameter follows:

\begin{description}
\item[handler] The method to handle errors.
\end{description}

\subsubsection{SetWarningHandler()}
set the warning handler.

\begin{quote}
\hspace*{-0.25in}
ErrorHandler SetWarningHandler(ErrorHandler handler)
\end{quote}

SetWarningHandler() sets the warning handler to the specified method
and returns the previous warning handler.

A description of each parameter follows:

\begin{description}
\item[handler] The method to handle warnings.
\end{description}

\subsubsection{ThrowException()}
throw an exception.

\begin{quote}
\hspace*{-0.25in}
void ThrowException(ExceptionInfo *exception, const ExceptionType severity,
  const char *reason,  const char *description)
\end{quote}

ThrowException() throws an exception with the specified severity code,
reason, and optional description.

A description of each parameter follows:

\begin{description}
\item[exception] The exception.
\item[severity] Define the severity of the exception.
\item[reason] Define the reason for the exception.
\item[description] Describe the exception.
\end{description}

\section{ImageMagick Memory Allocation Methods}

\subsubsection{AcquireMemory}
allocate memory.


\begin{quote}
\hspace*{-0.25in}
 void *AcquireMemory(const size\_t size)
\end{quote}

AcquireMemory() returns a pointer to a block of memory at least size
bytes suitably aligned for any use.

A description of each parameter follows:
\begin{description}
\item[size] The size of the memory in bytes to allocate.

\end{description}

\subsubsection{LiberateMemory}
free allocated memory.

\begin{quote}
\hspace*{-0.25in}
void LiberateMemory(void **memory)
\end{quote}

LiberateMemory() frees memory that has already been allocated.

A description of each parameter follows:
\begin{description}
\item[span] A pointer to a block memory to free for reuse.

\end{description}

\subsubsection{ReacquireMemory}
change the size of allocated memory.

\begin{quote}
\hspace*{-0.25in}
void ReacquireMemory(void **memory, const size\_t size)
\end{quote}

ReacquireMemory() changes the size of allocated memory and returns a
pointer to the (possibly moved) block.  The contents will be unchanged
up to the lesser of the new and old sizes.

A description of each parameter follows:

\begin{description}
\item[memory] A pointer to a memory allocation.  On return the pointer
may change but the contents of the original allocation will not.
\item[size] The new size of the allocated memory.
\end{description}

\section{ImageMagick Progress Monitor Methods}

\subsubsection{MagickMonitor}
measure progress toward completion of a task.


\begin{quote}
\hspace*{-0.25in}
MagickExport unsigned int MagickMonitor(const char *text,const off\_t quantum,
  const size\_t span,ExceptionInfo *exception)
\end{quote}

MagickMonitor() calls the monitor handler method with a text string that
describes the task and a measure of completion.
The method returns False on success otherwise
True if an error is encountered, e.g. if there was a user interrupt.

A description of each parameter follows:

\begin{description}
\item[quantum] The position relative to the span parameter which
represents how much progress has been made toward completing a task.
\item[span] The span relative to completing a task.
\item[exception] Return any errors or warnings in this structure.
\end{description}

\subsubsection{SetMonitorHandler}
define a custom progress monitor.

\begin{quote}
\hspace*{-0.25in}
MonitorHandler SetMonitorHandler(MonitorHandler handler)
\end{quote}

SetMonitorHandler() sets the monitor handler to the specified method
and returns the previous monitor handler.

A description of each parameter follows:

\begin{description}
\item[handler] The progress monitor handler method.
\end{description}