File: image1.html

package info (click to toggle)
librmagick-ruby 2.13.1-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 4,444 kB
  • ctags: 1,716
  • sloc: ansic: 16,755; ruby: 9,730; makefile: 16; sh: 12
file content (4680 lines) | stat: -rw-r--r-- 130,410 bytes parent folder | download | duplicates (2)
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
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta name="generator" content=
  "HTML Tidy for Linux/x86 (vers 7 December 2008), see www.w3.org" />

  <title>RMagick 2.13.1: class Image (class methods and instance
  methods a-d)</title>
  <meta http-equiv="Content-Type" content=
  "text/html; charset=us-ascii" />
  <meta name="GENERATOR" content="Quanta Plus" />
  <meta name="Copyright" content=
  "Copyright (C) 2006 by Timothy P. Hunter" />
  <link rel="stylesheet" type="text/css" href="css/doc.css" />
  <script type="text/javascript" src="scripts/doc.js">
</script>
  <script type="text/javascript">
//<![CDATA[
  <!-- Pre-load this image so that the browser knows how big it is. -->
  flower_hat = new Image();
  flower_hat.src = "ex/images/Flower_Hat.jpg";
  function show_noise(type)
  {
  if (type == null)
  {
  document.getElementById("add_noise_example").src = "ex/images/Flower_Hat.jpg";
  }
  else
  {
  document.getElementById("add_noise_example").src = "ex/add_noise_" + type + ".jpg";
  }
  }
  //]]>
  </script>
  <style type="text/css">
/*<![CDATA[*/
  .noise_example_wrapper img {
  float: left;
  }
  .noise_example_wrapper p, .noise_example_wrapper ul {
  margin-left: 4px;
  float: left;
  }
  /*]]>*/
  </style>
</head>

<body>
  <h6 id="header">RMagick 2.13.1 User's Guide and Reference</h6>

  <div class="nav">
    &laquo;&nbsp;<a href="imageattrs.html">Prev</a> | <a href=
    "index.html">Contents</a> | <a href=
    "image2.html">Next</a>&nbsp;&raquo;
  </div>

  <h1>class Image <span class="superclass">&lt; Object</span>
  (class methods and instance methods a-d)<br />
  <span class="mixin">mixes in Comparable</span></h1>

  <div id="toc">
    <h2>Table of Contents</h2>

    <h3>class methods</h3>

    <div>
      <div class="toccol">
        <ul>
          <li><a href="#capture">capture</a></li>

          <li><a href="#combine">combine</a></li>

          <li><a href="#constitute">constitute</a></li>
        </ul>
      </div>

      <div class="toccol">
        <ul>
          <li><a href="#from_blob">from_blob</a></li>

          <li><a href="#new">new</a></li>

          <li><a href="#ping">ping</a></li>
        </ul>
      </div>

      <div class="toccol">
        <ul>
          <li><a href="#read">read</a></li>

          <li><a href="#read_inline">read_inline</a></li>
        </ul>
      </div>
    </div>

    <h3>instance methods</h3>

    <div>
      <div class="toccol">
        <ul>
          <li><a href="#aref">[&nbsp;]</a></li>

          <li><a href="#aset">[&nbsp;]=</a></li>

          <li><a href="#spaceship">&lt;=&gt;</a></li>

          <li><a href="#adaptive_blur">adaptive_blur</a></li>

          <li><a href=
          "#adaptive_blur_channel">adaptive_blur_channel</a></li>

          <li><a href="#adaptive_resize">adaptive_resize</a></li>

          <li><a href="#adaptive_sharpen">adaptive_sharpen</a></li>

          <li><a href=
          "#adaptive_sharpen_channel">adaptive_sharpen_channel</a></li>

          <li><a href=
          "#adaptive_threshold">adaptive_threshold</a></li>

          <li><a href="#add_compose_mask">add_compose_mask</a></li>

          <li><a href="#add_noise">add_noise</a></li>

          <li><a href=
          "#add_noise_channel">add_noise_channel</a></li>

          <li><a href="#add_profile">add_profile</a></li>

          <li><a href="#affine_transform">affine_transform</a></li>

          <li><a href="#alpha">alpha</a></li>

          <li><a href="#alpha_q">alpha?</a></li>

          <li><a href="#annotate">annotate</a></li>

          <li><a href=
          "#auto_gamma_channel">auto_gamma_channel</a></li>

          <li><a href=
          "#auto_level_channel">auto_level_channel</a></li>

          <li><a href="#auto_orient">auto_orient</a></li>

          <li><a href="#auto_orient_bang">auto_orient!</a></li>

          <li><a href="#bilevel_channel">bilevel_channel</a></li>

          <li><a href="#black_threshold">black_threshold</a></li>

          <li><a href="#blend">blend</a></li>

          <li><a href="#blue_shift">blue_shift</a></li>

          <li><a href="#blur_channel">blur_channel</a></li>

          <li><a href="#blur_image">blur_image</a></li>
        </ul>
      </div>

      <div class="toccol">
        <ul>
          <li><a href="#border">border</a></li>

          <li><a href="#border_bang">border!</a></li>

          <li><a href="#bounding_box">bounding_box</a></li>

          <li><a href="#change_geometry">change_geometry</a></li>

          <li><a href="#changed_q">changed?</a></li>

          <li><a href="#channel">channel</a></li>

          <li><a href="#channel_depth">channel_depth</a></li>

          <li><a href="#channel_extrema">channel_extrema</a></li>

          <li><a href="#channel_mean">channel_mean</a></li>

          <li><a href="#charcoal">charcoal</a></li>

          <li><a href="#check_destroyed">check_destroyed</a></li>

          <li><a href="#chop">chop</a></li>

          <li><a href="#clone">clone</a></li>

          <li><a href="#clut_channel">clut_channel</a></li>

          <li><a href=
          "#color_fill_to_border">color_fill_to_border</a></li>

          <li><a href="#color_floodfill">color_floodfill</a></li>

          <li><a href="#color_histogram">color_histogram</a></li>

          <li><a href="#colorize">colorize</a></li>

          <li><a href="#colormap">colormap</a></li>

          <li><a href="#color_point">color_point</a></li>

          <li><a href="#color_reset_bang">color_reset!</a></li>

          <li><a href="#compare_channel">compare_channel</a></li>

          <li><a href="#composite">composite</a></li>

          <li><a href="#composite_bang">composite!</a></li>

          <li><a href="#composite_affine">composite_affine</a></li>

          <li><a href=
          "#composite_mathematics">composite_mathematics</a></li>

          <li><a href="#composite_tiled">composite_tiled</a></li>
        </ul>
      </div>

      <div class="toccol">
        <ul>
          <li><a href=
          "#composite_tiled_bang">composite_tiled!</a></li>

          <li><a href=
          "#compress_colormap_bang">compress_colormap!</a></li>

          <li><a href="#contrast">contrast</a></li>

          <li><a href=
          "#contrast_stretch_channel">contrast_stretch_channel</a></li>

          <li><a href="#convolve">convolve</a></li>

          <li><a href="#convolve_channel">convolve_channel</a></li>

          <li><a href="#copy">copy</a></li>

          <li><a href="#crop">crop</a></li>

          <li><a href="#crop_bang">crop!</a></li>

          <li><a href="#crop_resized">crop_resized</a></li>

          <li><a href="#cycle_colormap">cycle_colormap</a></li>

          <li><a href="#decipher">decipher</a></li>

          <li><a href=
          "#delete_compose_mask">delete_compose_mask</a></li>

          <li><a href="#delete_profile">delete_profile</a></li>

          <li><a href="#deskew">deskew</a></li>

          <li><a href="#despeckle">despeckle</a></li>

          <li><a href="#destroy_bang">destroy!</a></li>

          <li><a href="#destroyed_q">destroyed?</a></li>

          <li><a href="#difference">difference</a></li>

          <li><a href="#dispatch">dispatch</a></li>

          <li><a href="#displace">displace</a></li>

          <li><a href="#display">display</a></li>

          <li><a href="#dissolve">dissolve</a></li>

          <li><a href="#distort">distort</a></li>

          <li><a href=
          "#distortion_channel">distortion_channel</a></li>

          <li><a href="#dup">dup</a></li>
        </ul>
      </div>
    </div>
  </div>

  <h2 class="methods">class methods</h2>

  <div class="sig">
    <h3 id="capture">capture</h3>

    <p>Image.capture(<span class=
    "arg">silent=</span><code>false</code>, <span class=
    "arg">frame=</span><code>false</code>, <span class=
    "arg">descend=</span><code>false</code>, <span class=
    "arg">screen=</span><code>false</code>, <span class=
    "arg">borders=</span><code>false</code>) [ <span class=
    "arg">{&nbsp;optional arguments&nbsp;}</span> ] -&gt;
    <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Reads an image from an X window. Unless you identify a
    window to capture via the <em>optional arguments</em> block,
    when <code>capture</code> is invoked the cursor will turn into
    a cross. Click the cursor on the window to be captured.</p>

    <p>Within the optional arguments block, specify
    <code>self.filename = "root"</code> to capture the entire
    desktop. To programatically specify the window to be captured,
    use <code>self.filename = window_id</code>, where window_id is
    the id displayed by xwininfo(1).</p>

    <h4>Arguments</h4>

    <dl>
      <dt>silent</dt>

      <dd>If <code>true</code>, suppress the beeps that signal the
      start and finish of the capture process. The bell rings once
      to signal the start of the capture and twice to signal the
      finish.</dd>

      <dt>frame</dt>

      <dd>If <code>true</code>, include the window frame.</dd>

      <dt>descend</dt>

      <dd>If <code>true</code>, <span class="imquote">obtain image
      by descending window hierarchy.</span></dd>

      <dt>screen</dt>

      <dd>If <code>true</code>, specifies that <span class=
      "imquote">the GetImage request used to obtain the image
      should be done on the root window, rather than directly on
      the specified window. In this way, you can obtain pieces of
      other windows that overlap the specified window, and more
      importantly, you can capture menus or other popups that are
      independent windows but appear over the specified
      window.</span></dd>

      <dt>borders</dt>

      <dd>If <code>true</code>, include the border in the
      image.</dd>

      <dt>optional arguments</dt>

      <dd>You can specify any of these Image::Info attributes in
      the <em>optional arguments</em> block: <a href=
      "info.html#colorspace">colorspace</a>, <a href=
      "info.html#depth">depth</a>, <a href=
      "info.html#dither">dither</a>, <a href=
      "info.html#interlace">interlace</a>, and <a href=
      "info.html#type">type</a>.</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image.</p>

    <h4>Example</h4>
    <pre>
img = Image.capture {
 self.filename = "root"
 }
</pre>
  </div>

  <div class="sig">
    <h3 id="combine">combine</h3>

    <p>Image.combine(<span class="arg">red_ch</span>=nil,
    <span class="arg">green_ch</span>=nil, <span class=
    "arg">blue_ch</span>=nil<span class="arg">,
    opacity_ch</span>=nil) -&gt;<em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Combines the grayscale value of the pixels in each image to
    form a new image.</p>

    <h4>Arguments</h4>

    <p>The red channel of the image specified in the first argument
    is used as the red channel in the new image. The green channel
    of the image specified in the second argument is used as the
    green channel in the new image. The blue channel of the image
    specified in the third argument is used as the blue channel in
    the new image. The opacity channel of the image specified in
    the fourth argument is used as the opacity channel in the new
    image.</p>

    <p>Any of the arguments may be nil. Trailing nil arguments may
    be omitted. You must specify at least one image argument.</p>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>See also</h4>

    <p>The same results can be obtained using the <a href=
    "#composite">composite</a> method and the
    CopyRed/Green/Blue/OpacityCompositeOp <a href=
    "constants.html#CompositeOperator">CompositeOperator</a> enum
    values.</p>

    <h4>Magick API</h4>

    <p>CombineImages</p>
  </div>

  <div class="sig">
    <h3 id="constitute">constitute</h3>

    <p>Image.constitute(<span class="arg">width</span>,
    <span class="arg">height</span>, <span class="arg">map</span>,
    <span class="arg">pixels</span>) -&gt; <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Creates an image from an array of pixels. This method is the
    reverse of <a href="#dispatch"><code>dispatch</code></a>.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>width</dt>

      <dd>The number of columns in the image</dd>

      <dt>height</dt>

      <dd>The number of rows in the image</dd>

      <dt>map</dt>

      <dd>A string describing <span class="imquote">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).</span></dd>

      <dt>pixels</dt>

      <dd>The pixel data. The pixel data in the array must be
      stored in scanline order, left-to-right and top-to-bottom.
      The elements in the array must be either all
      <code>Integers</code> or all <code>Floats</code>. If the
      elements are <code>Integers</code>, the <code>Integers</code>
      must be in the range [0..QuantumRange]. If the elements are
      <code>Floats</code>, they must be in the range [0..1].</dd>
    </dl>

    <h4>Returns</h4>

    <p>An image constructed from the pixel data.</p>

    <h4>Example</h4>
    <pre>
image = Image.constitute(width, height, "RGB", pixels)
</pre>

    <h4>See also</h4>

    <p><a href=
    "image2.html#import_pixels"><code>import_pixels</code></a>,
    <a href=
    "image3.html#store_pixels"><code>store_pixels</code></a></p>

    <h4>Magick API</h4>

    <p>ConstituteImage</p>
  </div>

  <div class="sig">
    <h3 id="from_blob">from_blob</h3>

    <p>Image.from_blob(<span class="arg">string</span>) [
    <span class="arg">{ optional arguments }</span> ] -&gt;
    <em>array</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Creates an array of images from a BLOB, that is, a
    <em>B</em>inary <em>L</em>arge <em>OB</em>ject. In RMagick, a
    BLOB is a string.</p>

    <h4>Arguments</h4>

    <p>A blob can be a string containing an image file such as a
    JPEG or GIF. The string can contain a multi-image file such as
    an animated GIF or a Photoshop image with multiple layers. A
    blob can also be one of the strings produced by <a href=
    "image3.html#to_blob">to_blob</a>. Control the format of the
    created image(s) by setting additional <a href=
    "info.html">Image::Info</a> attributes in the optional block
    argument.</p>

    <h4>Returns</h4>

    <p>An array of one or more images constructed from the
    BLOB.</p>

    <h4>Example</h4>

    <p>See <a href=
    "image3.html#to_blob"><code>to_blob</code></a>.</p>

    <h4>Magick API</h4>

    <p>BlobToImage</p>
  </div>

  <div class="sig">
    <h3 id="new">new</h3>

    <p>Image.new(<span class="arg">columns</span>, <span class=
    "arg">rows</span> [, <span class="arg">fill</span>]) [
    <span class="arg">{ optional arguments }</span> ] -&gt;
    <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>Creates a new instance with the specified
    number of columns and rows. You can specify other arguments by
    setting <a href="info.html">Image::Info</a> attributes in the
    optional block. If the optional <span class="arg">fill</span>
    argument is not specified, the image is set to the background
    color.

    <h4>Arguments</h4>

    <dl>
      <dt>columns</dt>

      <dd>The number of columns</dd>

      <dt>rows</dt>

      <dd>The number of rows</dd>

      <dt>fill</dt>

      <dd>A <a href="struct.html#fill"><code>Fill</code></a>
      object</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image.</p>

    <h4>Example</h4>
    <pre>
img = Image.new(256, 64) {
 self.background_color = 'red'
 }
</pre>

    <h4>See also</h4>

    <p><a href=
    "ilist.html#new_image"><code>ImageList.new_image</code></a></p>

    <h4>Magick API</h4>

    <p>AllocateImage</p>
  </div>

  <div class="sig">
    <h3 id="ping">ping</h3>

    <p>Image.ping(<span class="arg">filename</span>) [ <span class=
    "arg">{ optional arguments }</span> ] -&gt;
    <em>array</em><br />
    Image.ping(<span class="arg">file</span>) [ <span class="arg">{
    optional arguments }</span> ] -&gt; <em>array</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Creates one or more images from the image file, omitting the
    pixel data. Only the attributes are stored in the images. This
    method is faster than <code><a href="#read">read</a></code> and
    uses less memory.</p>

    <h4>Arguments</h4>

    <p>An image file name or open file object. You can specify
    other arguments by setting <a href="info.html">Image::Info</a>
    attributes in the optional block.</p>

    <h4>Returns</h4>

    <p>An array containing 0 or more images.</p>

    <h4>Example</h4>
    <pre>
cheetah = Image.ping("Cheetah.jpg") &raquo;
 [Cheetah.jpg JPEG 1024x768 DirectClass 8-bit 101684b]
p cheetah[0].rows &raquo; 768
p cheetah[0].columns &raquo; 1024
</pre>

    <h4>See also</h4>

    <p><a href="#read"><code>read</code></a></p>

    <h4>Magick API</h4>

    <p>PingImage</p>
  </div>

  <div class="sig">
    <h3 id="read">read</h3>

    <p>Image.read(<span class="arg">filename</span>) [ <span class=
    "arg">{ optional arguments }</span> ] -&gt;
    <em>array</em><br />
    Image.read(<span class="arg">file</span>) [ <span class="arg">{
    optional arguments }</span> ] -&gt; <em>array</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Reads all the images from the specified file.</p>

    <p><span style="font-style:italic">Note:</span> Because an
    image file can contain multiple images or multiple image
    layers, <code>read</code> always returns an array containing 0
    or more elements, one element for each image or image layer in
    the file.</p>

    <h4>Arguments</h4>

    <p>An image file name or open file object. You can specify
    other arguments by setting <a href="info.html">Image::Info</a>
    attributes in the optional block.</p>

    <h4>Returns</h4>

    <p>An array containing 0 or more Image objects. If the file is
    a multi-image file such as an animated GIF or a Photoshop PSD
    file with multiple layers, the array contains an Image object
    for each image or layer in the file.</p>

    <h4>Example</h4>
    <pre>
animated = Image.read("animated.gif") &raquo;
[animated.gif GIF 127x120+0+0 PseudoClass 256c 8-bit 54395b
animated.gif[1] GIF 127x120+0+0 PseudoClass 256c 8-bit 54395b,
animated.gif[2] GIF 127x120+0+0 PseudoClass 256c 8-bit 54395b]
</pre>

    <h4>See also</h4>

    <p><a href="#ping"><code>ping</code></a></p>

    <h4>Note</h4>

    <p>The read method does not accept a StringIO object. If you
    want to create an image from a string buffer, use <a href=
    "image1.html#from_blob">from_blob</a>.</p>

    <h4>Magick API</h4>

    <p>ReadImage</p>
  </div>

  <div class="sig">
    <h3 id="read_inline">read_inline</h3>

    <p>Image.read_inline(<span class="arg">content</span>) [
    <span class="arg">{ optional arguments }</span> ] -&gt;
    <em>array</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Converts a Base64-encoded image or multi-image sequence to
    an array of Image objects.</p>

    <h4>Arguments</h4>

    <p>A Base64-encoded string. Generally no optional arguments are
    required. If the image format cannot be deduced from the image
    data, you can use the <a href="info.html#format">format</a>
    attribute. If you want to extract a subset of an image
    sequence, see <a href="imusage.html#frames">here</a>.</p>

    <h4>Returns</h4>

    <p>An array containing 0 or more Image objects. If the content
    is a multi-image sequence such as an animated GIF or a
    Photoshop PSD file with multiple layers, the array contains an
    Image object for each image or layer in the file.</p>

    <h4>Example</h4>
    <pre>
content = "R0lGODlhnAEuAferAAAAAAcIBggJBgw..."
img = Image.read_inline(content)
</pre>

    <h4>See also</h4>

    <p><a href="#read"><code>read</code></a></p>
  </div>

  <h2 class="methods">instance methods</h2>

  <div class="sig">
    <h3 id="aref">[&nbsp;]</h3>

    <p><span class="arg">img</span>[<span class="arg">key</span>]
    -&gt; <em>string</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Returns the value of the image property identified by
    <span class="arg">key</span>. An image may have any number of
    properties. Each property is identified by a string (or symbol)
    key. The property value is a string. ImageMagick predefines
    some properties, including <code>Label</code>,
    <code>Comment</code>, <code>Signature</code>, and in some cases
    <code>EXIF</code>.</p>

    <h4>Arguments</h4>The key may be a <code>String</code> or a
    <code>Symbol</code>.

    <h4>Returns</h4>

    <p>The value of the property.</p>

    <h4>Example</h4>
    <pre>
 mom['Label'] = 'My Mother'
</pre>

    <h4>See also</h4>

    <p><a href="#aset"><code>[ ]=</code></a>, <a href=
    "image3.html#properties"><code>properties</code></a></p>

    <h4>Magick API</h4>

    <p>GetImageAttribute</p>

    <h4>Note</h4>

    <p>ImageMagick calls properties "attributes." I use the word
    "properties" to reduce the confusion with image object
    attributes such as <code>rows</code> and
    <code>columns</code>.</p>
  </div>

  <div class="sig">
    <h3 id="aset">[&nbsp;]=</h3>

    <p><span class="arg">img</span>[<span class="arg">key</span>] =
    <span class="arg">string</span> -&gt; <em>self</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Sets the value of an image property. An image may have any
    number of properties.</p>

    <h4>Arguments</h4>The <span class="arg">key</span> may be a
    string or a symbol. The value can be any string.

    <h4>Returns</h4><code>self</code>

    <h4>Example</h4>See <a href=
    "javascript:popup('demo.rb.html')">demo.rb</a> for an example
    of the use of the Label property.

    <h4>See also</h4>

    <p><a href="#aref">[<code>&nbsp;]</code></a>, <a href=
    "image3.html#properties"><code>properties</code></a></p>

    <h4>Magick API</h4>

    <p>SetImageAttribute</p>
  </div>

  <div class="sig">
    <h3 id="spaceship">&lt;=&gt;</h3>

    <p><span class="arg">img</span> &lt;=&gt; <span class=
    "arg">other_image</span> -&gt; -1, 0, 1</p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Compares two images and returns -1, 0, or 1 if <span class=
    "arg">img</span> is less than, equal to, or greater than
    <span class="arg">other_image</span> as determined by comparing
    the signatures of the images. If one of the arguments is not an
    image, this method raises a TypeError exception (in Ruby 1.6)
    or returns <code>nil</code> (in Ruby 1.8)</p>

    <p>In addition to &lt;=&gt;, <code>Image</code> mixes in the
    <code>Comparable</code> module, which defines the &lt;, &lt;=,
    == &gt;=, &gt;, and <code>between?</code> methods.</p>

    <p>The <code>difference</code> method compares images (for
    equality only) but also returns information about the amount
    two images differ, which may be more useful.</p>

    <h4>Returns</h4>

    <p>The value of <span class=
    "arg">img</span>.<code>signature</code> &lt;=&gt; <span class=
    "arg">other_image</span>.<code>signature</code>.</p>

    <h4>See also</h4>

    <p><a href="image3.html#signature">signature</a>, <a href=
    "#difference">difference</a>, <a href=
    "#compare_channel">compare_channel</a></p>

    <h4>Magick API</h4>

    <p>SignatureImage</p>
  </div>

  <div class="sig">
    <h3 id="adaptive_blur">adaptive_blur</h3>

    <p><span class="arg">img</span>.adaptive_blur(<span class=
    "arg">radius</span>=0.0, <span class="arg">sigma</span>=1.0)
    -&gt; <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p><span class="imquote">Adaptively blurs the image by blurring
    more intensely near image edges and less intensely far from
    edges.</span> The adaptive_blur method blurs <span class=
    "imquote">the image with a Gaussian operator of the
    given</span> <span class="arg">radius</span> <span class=
    "imquote">and standard deviation</span> (<span class=
    "arg">sigma</span>). <span class="imquote">For reasonable
    results,</span> <span class="arg">radius</span> <span class=
    "imquote">should be larger than</span> <span class=
    "arg">sigma</span>. <span class="imquote">Use a</span>
    <span class="arg">radius</span> <span class="imquote">of 0 and
    adaptive_blur selects a suitable</span> <span class=
    "arg">radius</span> <span class="imquote">for you.</span></p>

    <h4>Arguments</h4>

    <dl>
      <dt>radius</dt>

      <dd><span class="imquote">The radius of the Gaussian in
      pixels, not counting the center pixel.</span> The default is
      0.0.</dd>

      <dt>sigma</dt>

      <dd><span class="imquote">The standard deviation of the
      Laplacian, in pixels.</span> The default is 1.0.</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>See also</h4>

    <p><a href=
    "#adaptive_blur_channel">adaptive_blur_channel</a></p>

    <h4>Magick API</h4>

    <p>AdaptiveBlurImage</p>
  </div>

  <div class="sig">
    <h3 id="adaptive_blur_channel">adaptive_blur_channel</h3>

    <p><span class="arg">img</span>.adaptive_blur(<span class=
    "arg">radius</span>=0.0, <span class="arg">sigma</span>=1.0
    [,<span class="arg">channel</span>...]) -&gt;
    <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>The same as <code>adaptive_blur</code> except only the
    specified channels are blurred.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>radius</dt>

      <dd><span class="imquote">The radius of the Gaussian in
      pixels, not counting the center pixel.</span> The default is
      0.0.</dd>

      <dt>sigma</dt>

      <dd><span class="imquote">The standard deviation of the
      Laplacian, in pixels.</span> The default is 1.0.</dd>

      <dt>channel...</dt>

      <dd>0 or more <a href=
      "constants.html#ChannelType">ChannelType</a> arguments. If no
      channels are specified, blurs all the channels. Specifying no
      channel arguments has the same effect as the
      <code>adaptive_blur</code> method, above.</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>See also</h4>

    <p><a href="#adaptive_blur">adaptive_blur</a></p>

    <h4>Magick API</h4>

    <p>AdaptiveBlurImageChannel</p>
  </div>

  <div class="sig">
    <h3 id="adaptive_resize">adaptive_resize</h3>

    <p><span class="arg">img</span>.adaptive_resize(<span class=
    "arg">new_width</span>, <span class="arg">new_height</span>)
    -&gt; <em>image</em><br />
    <span class="arg">img</span>.adaptive_resize(<span class=
    "arg">scale_factor</span>) -&gt; <span class=
    "arg">image</span></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Resizes the image with data dependent triangulation.</p>

    <h4>Arguments</h4>

    <p>You can specify the new size in two ways. Either specify the
    new width and height explicitly, or specify a <em>scale
    factor</em>, a number that represents the percentage
    change.</p>

    <p>Use the <a href="#change_geometry">change_geometry</a>
    method to compute new dimensions for an image with constraints
    such as "maintain the current proportions."</p>

    <dl>
      <dt>new_width, new_height</dt>

      <dd>The desired width and height.</dd>

      <dt>scale_factor</dt>

      <dd>You can use this argument instead of specifying the
      desired width and height. The percentage size change. For
      example, 1.25 makes the new image 125% of the size of the
      receiver. The scale factor 0.5 makes the new image 50% of the
      size of the receiver.</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>See also</h4>

    <p><a href="image3.html#resize">resize</a></p>

    <h4>Magick API</h4>

    <p>AdaptiveResizeImage</p>
  </div>

  <div class="sig">
    <h3 id="adaptive_sharpen">adaptive_sharpen</h3>

    <p><span class="arg">img</span>.adaptive_sharpen(<span class=
    "arg">radius</span>=0.0, <span class="arg">sigma</span>=1.0)
    -&gt; <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p><span class="imquote">Adaptively sharpens the image by
    sharpening more intensely near image edges and less intensely
    far from edges.</span> The adaptive_sharpen method sharpens
    <span class="imquote">the image with a Gaussian operator of the
    given</span> <span class="arg">radius</span> <span class=
    "imquote">and standard deviation</span> (<span class=
    "arg">sigma</span>). <span class="imquote">For reasonable
    results,</span> <span class="arg">radius</span> <span class=
    "imquote">should be larger than</span> <span class=
    "arg">sigma</span>. <span class="imquote">Use a</span>
    <span class="arg">radius</span> <span class="imquote">of 0 and
    adaptive_sharpen selects a suitable</span> <span class=
    "arg">radius</span> <span class="imquote">for you.</span></p>

    <h4>Arguments</h4>

    <dl>
      <dt>radius</dt>

      <dd><span class="imquote">The radius of the Gaussian in
      pixels, not counting the center pixel.</span> The default is
      0.0.</dd>

      <dt>sigma</dt>

      <dd><span class="imquote">The standard deviation of the
      Laplacian, in pixels.</span> The default is 1.0.</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>See also</h4>

    <p><a href=
    "#adaptive_sharpen_channel">adaptive_sharpen_channel</a></p>

    <h4>Magick API</h4>

    <p>AdaptiveSharpenImage</p>
  </div>

  <div class="sig">
    <h3 id="adaptive_sharpen_channel">adaptive_sharpen_channel</h3>

    <p><span class="arg">img</span>.adaptive_sharpen(<span class=
    "arg">radius</span>=0.0, <span class="arg">sigma</span>=1.0
    [,<span class="arg">channel</span>...]) -&gt;
    <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>The same as <code>adaptive_sharpen</code> except only the
    specified channels are sharpened.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>radius</dt>

      <dd><span class="imquote">The radius of the Gaussian in
      pixels, not counting the center pixel.</span> The default is
      0.0.</dd>

      <dt>sigma</dt>

      <dd><span class="imquote">The standard deviation of the
      Laplacian, in pixels.</span> The default is 1.0.</dd>

      <dt>channel...</dt>

      <dd>0 or more <a href=
      "constants.html#ChannelType">ChannelType</a> arguments. If no
      channels are specified, sharpens all the channels. Specifying
      no channel arguments has the same effect as the
      <code>adaptive_sharpen</code> method, above.</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>See also</h4>

    <p><a href="#adaptive_sharpen">adaptive_sharpen</a></p>

    <h4>Magick API</h4>

    <p>AdaptiveSharpenImageChannel</p>
  </div>

  <div class="sig">
    <h3 id="adaptive_threshold">adaptive_threshold</h3>

    <p><span class="arg">img</span>.adaptive_threshold(<span class=
    "arg">width</span>=3, <span class="arg">height</span>=3,
    <span class="arg">offset</span>=0) -&gt; <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p class="imquote">Selects an individual threshold for each
    pixel based on the range of intensity values in its local
    neighborhood. This allows for thresholding of an image whose
    global intensity histogram doesn't contain distinctive
    peaks.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>width, height</dt>

      <dd>define the width and height of the local
      neighborhood</dd>

      <dt>offset</dt>

      <dd>constant to subtract from pixel neighborhood mean</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Example</h4>

    <p class="rollover"><a href=
    "javascript:popup('adaptive_threshold.rb.html')"><img src=
    "ex/adaptive_threshold.jpg" onmouseover=
    "this.src='ex/images/Flower_Hat.jpg'" onmouseout=
    "this.src='ex/adaptive_threshold.jpg'" alt=
    "adaptive_threshold example" title=
    "Click to see the example script" /></a> <img src=
    "ex/images/spin.gif" alt="" class="spin" title=
    "Mouse over the example to see the original image" /></p>

    <h4>See also</h4>

    <p><a href="#bilevel_channel">bilevel_channel</a>, <a href=
    "image3.html#random_threshold_channel">random_threshold_channel</a>,
    <a href="image3.html#threshold">threshold</a></p>

    <h4>Magick API</h4>

    <p>AdaptiveThresholdImage</p>
  </div>

  <div class="sig">
    <h3 id="add_compose_mask">add_compose_mask</h3>

    <p><span class="arg">img</span>.add_compose_mask(<span class=
    "arg">mask</span>) -&gt; <em>self</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Associates a mask with an image that will be used as the
    destination image in a <a href="#composite">composite</a>
    operation. The areas of the destination image that are masked
    by white pixels will be modified by the <a href=
    "#composite">composite</a> method, while areas masked by black
    pixels are unchanged.</p>

    <p>See <a href=
    "http://www.imagemagick.org/Usage/compose/#mask">Using a
    Compose Mask to Limit the Composed Area</a> in Anthony
    Thyssen's <a href="http://www.imagemagick.org/Usage/">Examples
    of ImageMagick Usage</a>.</p>

    <h4>Arguments</h4>

    <p>The mask image must have the same dimensions as the
    destination image.</p>

    <h4>Returns</h4>

    <p>self</p>

    <h4>Example</h4>

    <div>
      <table summary="compose_mask example">
        <tr>
          <td><a href=
          "javascript:add_popup('compose_mask.rb.html')"><img src=
          "ex/images/Flower_Hat.jpg" width="100" height="125" alt=
          "Source image for add_compose_mask example" title=
          "Click to see the example script" /></a></td>

          <td><a href=
          "javascript:add_popup('compose_mask.rb.html')"><img src=
          "ex/compose_mask_source.gif" width="100" height="125"
          alt="Background image for add_compose_mask example"
          title="Click to see the example script" /></a></td>

          <td><a href=
          "javascript:add_popup('compose_mask.rb.html')"><img src=
          "ex/compose_mask.gif" width="100" height="125" alt=
          "Mask image for compose_mask example" title=
          "Click to see the example script" /></a></td>

          <td><a href=
          "javascript:add_popup('compose_mask.rb.html')"><img src=
          "ex/compose_mask_example.jpg" width="93" height="125"
          alt="Result image for compose_mask example" title=
          "Click to see the example script" /></a></td>
        </tr>

        <tr>
          <td align="center">Background</td>

          <td align="center">Source</td>

          <td align="center">Mask</td>

          <td align="center">Result</td>
        </tr>
      </table>
    </div>

    <h4>See also</h4>

    <p><a href="#composite">composite</a>, <a href=
    "#delete_compose_mask">delete_compose_mask</a></p>

    <h4>Notes</h4>

    <p>This method uses a <em>copy</em> of the argument as the
    mask. If you change the mask image you must call this method
    again to update the mask.</p>

    <h4>Magick API</h4>

    <p>SetImageMask</p>
  </div>

  <div class="sig">
    <h3 id="add_noise">add_noise</h3>

    <p><span class="arg">img</span>.add_noise(<span class=
    "arg">noise_type</span>) -&gt; <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Adds random noise to the image. The amount of time
    <code>add_noise</code> requires depends on the NoiseType
    argument.</p>

    <h4>Arguments</h4>

    <p>A <a href="constants.html#NoiseType">NoiseType</a>
    value.</p>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Example</h4>

    <div class="noise_example_wrapper">
      <a href="javascript:popup('add_noise.rb.html')"><img src=
      "ex/images/Flower_Hat.jpg" alt="add_noise example" id=
      "add_noise_example" title=
      "Click to see the example script" /></a>

      <p>Click the NoiseType to see the effect.</p>

      <ul>
        <li><a href="javascript:show_noise(null)">No noise</a></li>

        <li><a href=
        "javascript:show_noise('UniformNoise');">UniformNoise</a></li>

        <li><a href=
        "javascript:show_noise('GaussianNoise');">GaussianNoise</a></li>

        <li><a href=
        "javascript:show_noise('MultiplicativeGaussianNoise');">MultiplicativeGaussianNoise</a></li>

        <li><a href=
        "javascript:show_noise('ImpulseNoise');">ImpulseNoise</a></li>

        <li><a href=
        "javascript:show_noise('LaplacianNoise');">LaplacianNoise</a></li>

        <li><a href=
        "javascript:show_noise('PoissonNoise');">PoissonNoise</a></li>
      </ul>
    </div>

    <div style="clear: both;"></div>

    <h4>Notes</h4>

    <p>The RandomNoise type was added in ImageMagick 6.3.5.</p>

    <h4>Magick API</h4>

    <p>AddNoiseImage</p>

    <h4>See also</h4>

    <p><a href="#add_noise_channel">add_noise_channel</a></p>
  </div>

  <div class="sig">
    <h3 id="add_profile">add_profile</h3>

    <p><span class="arg">img</span>.add_profile(<span class=
    "arg">filename</span>) -&gt; <span class="arg">self</span></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Adds an ICC (a.k.a. ICM), IPTC, or generic profile. If the
    file contains more than one profile all the profiles are
    added.</p>

    <h4>Arguments</h4>

    <p>The filename of a file containing the profile.</p>

    <h4>Returns</h4>

    <p>self</p>

    <h4>Example</h4>
    <pre>
    img.add_profile('my_cmyk.icm')
</pre>

    <h4>See also</h4>

    <p>The <a href="imageattrs.html#iptc_profile">iptc_profile</a>
    and <a href="imageattrs.html#color_profile">color_profile</a>
    attributes provide very similar functionality, except that
    these attributes accept the profile data in the form of a
    string. The <a href="image3.html#profile_bang">profile!</a>
    method can also be used to add a profile. The type of profile
    must be specified and the profile data must be in the form of a
    string. Also see <a href="#delete_profile">delete_profile</a>
    and <a href="image2.html#each_profile">each_profile</a>.</p>

    <h4>Magick API</h4>

    <p>ProfileImage</p>
  </div>

  <div class="sig">
    <h3 id="add_noise_channel">add_noise_channel</h3>

    <p><span class="arg">img</span>.add_noise_channel(<span class=
    "arg">noise_type</span> [,<span class="arg">channel</span>...])
    -&gt; <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Adds random noise to the specified channel or channels in
    the image.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>noise_type</dt>

      <dd>A <a href="constants.html#NoiseType">NoiseType</a>
      value.</dd>

      <dt>channel...</dt>

      <dd>0 or more <a href=
      "constants.html#ChannelType">ChannelType</a> arguments. If no
      channels are specified, adds noise to all the channels.
      Specifying no channel arguments has the same effect as the
      <code>add_noise</code> method, above.</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Magick API</h4>

    <p>AddNoiseImageChannel</p>

    <h4>See also</h4>

    <p><a href="#add_noise">add_noise</a></p>
  </div>

  <div class="sig">
    <h3 id="affine_transform">affine_transform</h3>

    <p><span class="arg">img</span>.affine_transform(<span class=
    "arg">matrix</span>) -&gt; <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Transforms the image as specified by the affine matrix.</p>

    <p>See <a href=
    "http://www.w3.org/TR/SVG/coords.html#EstablishingANewUserSpace">
    <b>Coordinate system transformations</b></a> in the
    <cite>Scalable Vector Graphics (SVG) 1.0 Specification</cite>
    for more information about transformation matrices.</p>

    <h4>Arguments</h4>

    <p>An <a href=
    "struct.html#AffineMatrix"><code>AffineMatrix</code></a>
    object.</p>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Example</h4>

    <p>The affine matrix in this example skews the receiver by
    &pi;/6 radians along both axes.</p>

    <p class="rollover"><a href=
    "javascript:popup('affine_transform.rb.html')"><img onmouseover="this.src='ex/images/Flower_Hat.jpg'"
    onmouseout="this.src='ex/affine_transform.jpg'" src=
    "ex/affine_transform.jpg" alt="affine_transform example" title=
    "Click to see the example script" /></a> <img src=
    "ex/images/spin.gif" alt="" class="spin" style="left: 235px;"
    title="Mouse over the example to see the original image" /></p>

    <h4>See also</h4>

    <p><a href="image3.html#rotate">rotate</a>, <a href=
    "#shear">shear</a></p>

    <h4>Magick API</h4>

    <p>AffineTransformImage</p>
  </div>

  <div class="sig">
    <h3 id="alpha">alpha</h3>

    <p><span class="arg">img</span>.alpha(<span class=
    "arg">type</span>) -&gt; <em>type</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Set a flag to indicate whether or not to use alpha channel
    data.</p>

    <h4>Arguments</h4>

    <p>One of the following values of the AlphaChannelType
    enumeration:</p>

    <dl>
      <dt>ActivateAlphaChannel</dt>

      <dd class="imquote">Enable the images use of transparency. If
      transparency data did not exist, allocate the data and set to
      opaque. If the image previously had transparency data, the
      data is again enable as it was when turned off. The
      transparency data is not changed or modified in any way.</dd>

      <dt>BackgroundAlphaChannel</dt>

      <dd>Set fully transparent pixels to the background color.
      (Available in IM 6.5.2-5.)</dd>

      <dt>CopyAlphaChannel</dt>

      <dd class="imquote">Turns on the alpha/matte channel, then
      copies the gray-scale intensity of the image, as an alpha
      mask, into the alpha channel, converting a gray-scale mask
      into a transparent shaped image ready to be colored
      appropriately. The color channels are not modified.</dd>

      <dt>DeactivateAlphaChannel</dt>

      <dd class="imquote">Disables the image's transparency
      channel. Does not delete or change the existing data, just
      turns of the use of that data. This is the same as assigning
      false to the old matte= attribute.</dd>

      <dt>ExtractAlphaChannel</dt>

      <dd>Creates a grayscale mask of the image's shape by copying
      the alpha channel values into all the color channels, and
      then turning off the image's transparency. The inverse of
      CopyAlphaChannel</dd>

      <dt>OpaqueAlphaChannel</dt>

      <dd class="imquote">Turns on the alpha/matte channel and
      forces it to be fully opaque.</dd>

      <dt>ResetAlphaChannel</dt>

      <dd>(Deprecated as of IM 6.4.3-7.) Set the alpha channel to
      fully opaque.</dd>

      <dt>SetAlphaChannel</dt>

      <dd class="imquote">Turns on the alpha/matte channel and if
      it was previously turned off resets the channel to opaque. If
      the image already had the alpha channel turned on, it will
      have no effect.</dd>

      <dt>ShapeAlphaChannel</dt>

      <dd class="imquote">As CopyAlphaChannel but also colors the
      resulting shape mask with the current background color.</dd>

      <dt>TransparentAlphaChannel</dt>

      <dd class="imquote">Turns on the alpha/matte channel and
      forces it to be fully transparent. This effectivally creates
      a transparent image the same size as the original, with all
      its meta-data still attached.</dd>
    </dl>

    <h4>Returns</h4>

    <p>The argument.</p>

    <h4>See also</h4>

    <p><a href="#alpha_q">alpha?</a></p>

    <h4>Notes</h4>

    <p>Available in ImageMagick 6.3.5 and later.</p>

    <h4>Magick API</h4>

    <p>SetImageAlphaChannel</p>
  </div>

  <div class="sig">
    <h3 id="alpha_q">alpha?</h3>

    <p><span class="arg">img</span>.alpha? -&gt; <code>true</code>
    or <code>false</code></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Returns <code>true</code> if the alpha channel will be used,
    <code>false</code> otherwise.</p>

    <h4>See also</h4>

    <p><a href="#alpha">alpha</a></p>

    <h4>Magick API</h4>

    <p>GetImageAlphaChannel</p>
  </div>

  <div class="sig">
    <h3 id="annotate">annotate</h3>

    <p><span class="arg">img.</span>annotate(<span class=
    "arg">draw, width, height, x, y, text</span>) <span class=
    "arg">[&nbsp;{ additional parameters }&nbsp;]</span> -&gt;
    <em>self</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>This is the same method as the <code>annotate</code> method
    in the Draw class, except that the first argument is a Draw
    object. Refer to the documentation for <a href=
    "draw.html#annotate">Draw#annotate</a> for more information.
    Some users feel like <code>annotate</code> is better placed in
    Image than in Draw. Okay, here it is!</p>

    <h4>Returns</h4>

    <p>self</p>
  </div>

  <div class="sig">
    <h3 id="auto_gamma_channel">auto_gamma_channel</h3>

    <p><span class=
    "arg">img</span>.auto_gamma_channel([<span class="arg">channel</span>...])
    -&gt; <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>"Automagically" adjust the gamma level of an image.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>channel...</dt>

      <dd>0 or more <a href=
      "constants.html#ChannelType">ChannelType</a> arguments. If no
      channels are specified, automagically adjusts the gamma level
      of all the channels.</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>
  </div>

  <div class="sig">
    <h3 id="auto_level_channel">auto_level_channel</h3>

    <p><span class=
    "arg">img</span>.auto_level_channel([<span class="arg">channel</span>...])
    -&gt; <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>"Automagically" adjust the color levels of an image.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>channel...</dt>

      <dd>0 or more <a href=
      "constants.html#ChannelType">ChannelType</a> arguments. If no
      channels are specified, automagically adjusts the color level
      of all the channels.</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>
  </div>

  <div class="sig">
    <h3 id="auto_orient">auto_orient</h3>

    <p><span class="arg">img</span>.auto_orient -&gt;
    <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Rotates or flips the image based on the image's EXIF
    orientation tag. Note that only some models of modern digital
    cameras can tag an image with the orientation. If the image
    does not have an orientation tag, or the image is already
    properly oriented, then <code>auto_orient</code> returns an
    exact copy of the image.</p>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>See also</h4>

    <p><a href="#auto_orient_bang">auto_orient!</a></p>

    <h4>Magick API</h4>

    <p>FlipImage, FlopImage, RotateImage, TransposeImage,
    TransverseImage</p>
  </div>

  <div class="sig">
    <h3 id="auto_orient_bang">auto_orient!</h3>

    <p><span class="arg">img</span>.auto_orient! -&gt;
    <em>self</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Rotates or flips the image based on the image's EXIF
    orientation tag. Note that only some models of modern digital
    cameras can tag an image with the orientation. If the image
    does not have an orientation tag, or the image is already
    properly oriented, then <code>auto_orient!</code> returns
    <code>nil</code>.</p>

    <h4>Returns</h4>

    <p>self. or <code>nil</code> if the image is already properly
    oriented</p>

    <h4>See also</h4>

    <p><a href="#auto_orient">auto_orient</a></p>
  </div>

  <div class="sig">
    <h3 id="bilevel_channel">bilevel_channel</h3>

    <p><span class="arg">img</span>.bilevel_channel(<span class=
    "arg">threshold</span> [,<span class="arg">channel...</span>])
    -&gt; <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p class="imquote">Changes the value of individual pixels based
    on the intensity of each pixel channel. The result is a
    high-contrast image.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>threshold</dt>

      <dd>The threshold value, a number between 0 and
      QuantumRange.</dd>

      <dt>channel...</dt>

      <dd>0 or more <a href=
      "constants.html#ChannelType">ChannelType</a> arguments. If no
      channels are specified, all the channels are
      thresholded.</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Example</h4>

    <p><code>bilevel_channel(2*QuantumRange/3,
    RedChannel)</code></p>

    <p class="rollover"><a href=
    "javascript:popup('bilevel_channel.rb.html')"><img onmouseover=
    "this.src='ex/images/Flower_Hat.jpg'" onmouseout=
    "this.src='ex/bilevel_channel.jpg'" src=
    "ex/bilevel_channel.jpg" alt="bilevel_channel example" title=
    "Click to see the example script" /></a> <img src=
    "ex/images/spin.gif" alt="" class="spin" title=
    "Mouse over the example to see the original image" /></p>

    <h4>See also</h4>

    <p><a href="#adaptive_threshold">adaptive_threshold</a>,
    <a href=
    "image3.html#random_threshold_channel">random_threshold_channel</a></p>

    <h4>Magick API</h4>

    <p>BilevelImageChannel</p>
  </div>

  <div class="sig">
    <h3 id="black_threshold">black_threshold</h3>

    <p><span class="arg">img</span>.black_threshold(<span class=
    "arg">red_channel</span> [, <span class=
    "arg">green_channel</span> [, <span class=
    "arg">blue_channel</span> [, <span class=
    "arg">opacity_channel</span>]]]) -&gt; <em>image</em></p>
  </div><!-- this example is larger than normal -->

  <div class="desc">
    <h4>Description</h4>

    <p class="imquote">Forces all pixels below the threshold into
    black while leaving all pixels above the threshold
    unchanged.</p>

    <h4>Arguments</h4>

    <p>Each channel argument is a number between 0 and
    QuantumRange. All arguments except the first may be omitted. If
    the <span class="arg">green_channel</span> or <span class=
    "arg">blue_channel</span> argument is omitted, the default
    value is the <span class="arg">red_channel</span> value. If the
    <span class="arg">opacity_channel</span> argument is omitted,
    the default value is <a href=
    "constants.html#Opacity">OpaqueOpacity</a>.</p>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>See also</h4>

    <p><a href="image3.html#white_threshold">white_threshold</a>,
    <a href="#bilevel_channel">bilevel_channel</a></p>

    <h4>Magick API</h4>

    <p>BlackThresholdImage</p>
  </div>

  <div class="sig">
    <h3 id="blend">blend</h3>

    <p><span class="arg">img</span>.blend(<span class=
    "arg">overlay</span>, <span class="arg">src_percentage</span>,
    <span class="arg">dst_percentage</span>, <span class=
    "arg">x_offset</span>=0, <span class="arg">y_offset</span>=0)
    -&gt; <em>image</em><br />
    <span class="arg">img</span>.blend(<span class=
    "arg">overlay</span>, <span class="arg">src_percentage</span>,
    <span class="arg">dst_percentage</span>, <span class=
    "arg">gravity</span>, <span class="arg">x_offset</span>=0,
    <span class="arg">y_offset</span>=0) -&gt; <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Adds the <span class="arg">overlay</span> image to the
    target image according to <span class="arg">src_percent</span>
    and <span class="arg">dst_percent</span>.</p>

    <p>This method corresponds to the -blend option of
    ImageMagick's <code>composite</code> command.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>overlay</dt>

      <dd>The source image for the composite operation. Either an
      imagelist or an image. If an imagelist, uses the current
      image.</dd>

      <dt>src_percentage</dt>

      <dd>Either a non-negative number a string in the form "NN%".
      If <span class="arg">src_percentage</span> is a number it is
      interpreted as a percentage. Both 0.25 and "25%" mean 25%.
      This argument is required.</dd>

      <dt>dst_percentage</dt>

      <dd>Either a non-negative number a string in the form "NN%".
      If <span class="arg">src_percentage</span> is a number it is
      interpreted as a percentage. Both 0.25 and "25%" mean 25%.
      This argument may omitted if no other arguments follow it. In
      this case the default is 100%-<span class=
      "arg">src_percentage</span>.</dd>
    </dl>

    <p>The <code>blend</code> method can be called with or without
    a <span class="arg">gravity</span> argument. The <span class=
    "arg">gravity</span>, <span class="arg">x_offset</span>, and
    <span class="arg">y_offset</span> arguments are described in
    the documentation for <a href=
    "image3.html#watermark">watermark</a>.</p>

    <h4>Example</h4>

    <p>See <a href=
    "http://www.cit.gu.edu.au/~anthony/graphics/imagick6/compose/#blend">
    "Blend Two Images Together"</a> in Anthony Thyssen's
    <cite><a href=
    "http://www.cit.gu.edu.au/~anthony/graphics/imagick6/">Examples
    of ImageMagick Usage</a></cite>.</p>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>See also</h4>

    <p><a href="#dissolve">dissolve</a>, <a href=
    "#composite">composite</a></p>
  </div>

  <div class="sig">
    <h3 id="blue_shift">blue_shift</h3>

    <p><span class="arg">img</span>.blue_shift(<span class=
    "arg">factor</span>=1.5) -&gt; <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p class="imquote">Simulate a scene at nighttime in the
    moonlight.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>factor</dt>

      <dd>Larger values increase the effect. The default is
      1.5.</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Notes</h4>

    <p>Available in ImageMagick 6.5.4-3 and later.</p>

    <h4>Magick API</h4>

    <p>BlueShiftImage</p>
  </div>

  <div class="sig">
    <h3 id="blur_channel">blur_channel</h3>

    <p><span class="arg">img</span>.blur_channel(<span class=
    "arg">radius=0.0</span>, <span class=
    "arg">sigma=1.0</span><span class="arg">[, channel...]]</span>)
    -&gt; <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Blurs the specified channel. <span class="imquote">We
    convolve the image with a Gaussian operator of the given radius
    and standard deviation (sigma) . The <code>blur_channel</code>
    method differs from <a href=
    "image2.html#gaussian_blur_channel">gaussian_blur_channel</a>
    in that it uses a separable kernel which is faster but
    mathematically equivalent to the non-separable
    kernel.</span></p>

    <h4>Arguments</h4>

    <p class="imquote">For reasonable results, the <span class=
    "arg">radius</span> should be larger than <span class=
    "arg">sigma</span>. Use a radius of 0 and
    <code>blur_channel</code> selects a suitable radius for
    you.</p>

    <dl>
      <dt>channel...</dt>

      <dd>One or more <a href=
      "constants.html#ChannelType">ChannelType</a> values. If none
      are specified, the red, green, and blue channels are blurred.
      This is the equivalent of <a href=
      "#blur_image">blur_image</a>.</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>See also</h4>

    <p><a href="#blur_image">blur_image</a>, <a href=
    "image2.html#gaussian_blur_channel">gaussian_blur_channel</a>,
    <a href="image2.html#motion_blur">motion_blur</a>, <a href=
    "image3.html#radial_blur">radial_blur</a>, <a href=
    "image3.html#selective_blur_channel">selective_blur_channel</a></p>

    <h4>Magick API</h4>

    <p>BlurImageChannel</p>
  </div>

  <div class="sig">
    <h3 id="blur_image">blur_image</h3>

    <p><span class="arg">img</span>.blur_image(<span class=
    "arg">radius</span>=0.0, <span class="arg">sigma</span>=1.0)
    -&gt; <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Blurs the image. <span class="imquote">We convolve the image
    with a Gaussian operator of the given radius and standard
    deviation (sigma).</span></p>

    <h4>Arguments</h4>

    <p class="imquote">For reasonable results, the <span class=
    "arg">radius</span> should be larger than <span class=
    "arg">sigma</span>. Use a <span class="arg">radius</span> of 0
    and <code>blur_image</code> selects a suitable <span class=
    "arg">radius</span> for you.</p>

    <h4>Returns</h4>

    <p>A new image.</p>

    <h4>Example</h4>

    <p class="rollover"><a href=
    "javascript:popup('blur_image.rb.html')"><img onmouseover=
    "this.src='ex/images/Flower_Hat.jpg'" onmouseout=
    "this.src='ex/blur_image.jpg'" src="ex/blur_image.jpg" alt=
    "blur_image example" title=
    "Click to see the example script" /></a> <img src=
    "ex/images/spin.gif" alt="" class="spin" title=
    "Mouse over the example to see the original image" /></p>

    <h4>See also</h4>

    <p><a href="#blur_channel">blur_channel</a>, <a href=
    "image2.html#gaussian_blur">gaussian_blur</a>, <a href=
    "image2.html#motion_blur">motion_blur</a>, <a href=
    "image3.html#radial_blur">radial_blur</a>, <a href=
    "image3.html#selective_blur_channel">selective_blur_channel</a></p>

    <h4>Magick API</h4>

    <p>BlurImage</p>
  </div>

  <div class="sig">
    <h3 id="border">border</h3>

    <p><span class="arg">img</span>.border(<span class=
    "arg">width</span>, <span class="arg">height</span>,
    <span class="arg">color</span>) -&gt; <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Add a border around the image.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>width</dt>

      <dd>Border width in pixels</dd>

      <dt>height</dt>

      <dd>Border height in pixels</dd>

      <dt>color</dt>

      <dd>Border color. Use a <a href=
      "imusage.html#color_names">named color</a> or a <a href=
      "struct.html#Pixel">pixel</a> object.</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Example</h4>

    <p class="rollover"><a href=
    "javascript:popup('border.rb.html')"><img style=
    "padding: 10px; display: none;" id="borderless" onmouseout=
    "this.style.display='none'; bordered.style.display='';" src=
    "ex/images/Flower_Hat.jpg" alt="border example" title=
    "Click to see the example script" /> <img id="bordered"
    onmouseover=
    "this.style.display='none'; borderless.style.display='';" src=
    "ex/border.jpg" alt="border example" /></a><img src=
    "ex/images/spin.gif" alt="" class="spin" style="left: 224px;"
    title="Mouse over the example to see the original image" /></p>

    <h4>See also</h4>

    <p><a href="#border_bang">border!</a>, <a href=
    "image2.html#frame">frame</a></p>

    <h4>Magick API</h4>

    <p>BorderImage</p>
  </div>

  <div class="sig">
    <h3 id="border_bang">border!</h3>

    <p><span class="arg">img</span>.border!(<span class=
    "arg">width</span>, <span class="arg">height</span>,
    <span class="arg">color</span>) -&gt; <em>self</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>In-place form of <a href="#border">border</a></p>

    <h4>Returns</h4>

    <p>self</p>
  </div>

  <div class="sig">
    <h3 id="bounding_box">bounding_box</h3>

    <p><span class="arg">img</span>.bounding_box -&gt;
    <em>rectangle</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>The image's <em>bounding box</em>. The bounding box is the
    rectangle that encloses all the pixels not in the border color.
    Uses the current <a href="imageattrs.html#fuzz">fuzz</a>
    value.</p>

    <h4>Returns</h4>A <a href="struct.html#Rectangle">Rectangle</a>
    object.

    <h4>Example</h4>

    <p>In this example, the bounding box is the gray square
    enclosing the blue circle. (The coordinates and red circles
    were added after the bounding box was computed.)</p>

    <p><a href="javascript:popup('bounding_box.rb.html')"><img src=
    "ex/bounding_box.gif" alt="ex/bounding_box.rb" title=
    "Click to see the example script" /></a></p>
  </div>

  <div class="sig">
    <h3 id="change_geometry">change_geometry</h3>

    <p><span class="arg">img</span>.change_geometry(<span class=
    "arg">string</span>) {|cols,rows,image| <span class=
    "arg">block</span>} -&gt; <em>??? (see Returns)</em><br />
    <span class="arg">img.change_geometry</span>(<span class=
    "arg">geometry</span>) {|cols,rows,image| <span class=
    "arg">block</span>} -&gt; <em>??? (see Returns)</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>The <code>change_geometry</code> method supports resizing a
    method by specifying constraints. For example, you can specify
    that the image should be resized such that the aspect ratio
    should be retained but the resulting image should be no larger
    than 640 pixels wide and 480 pixels tall.</p>

    <p>The argument may be either a <a href=
    "imusage.html#geometry">geometry string</a> or a <a href=
    "struct.html#Geometry">Geometry</a> object.
    <code>Change_geometry</code> yields to the block, passing new
    width and height values based on the argument with respect to
    <code>self</code>. The return value is the return value of the
    block.</p>

    <h4>Arguments</h4>An <a href="imusage.html#geometry">geometry
    string</a> or a <code>Geometry</code> object

    <h4>Returns</h4>

    <p>The value returned by the block</p>

    <h4>Example</h4>
    <pre>
mona = Image.read('MonaLisa.jpg').first
mona.change_geometry!('320x240') { |cols, rows, img|
 img.resize!(cols, rows)
 }
</pre>

    <h4>Magick API</h4>

    <p>ParseSizeString</p>

    <h4>Note</h4>

    <p><code>change_geometry!</code> is an alias for
    <code>change_geometry</code>.</p>
  </div>

  <div class="sig">
    <h3 id="changed_q">changed?</h3>

    <p><span class="arg">img</span>.changed? -&gt;
    <code>true</code> or <code>false</code></p>
  </div>

  <div class="desc">
    <h4>Description</h4>Returns <code>true</code> if any pixel has
    been altered since the image was constituted.

    <h4>Magick API</h4>

    <p>IsTaintImage</p>
  </div>

  <div class="sig">
    <h3 id="channel">channel</h3>

    <p><span class="arg">img</span>.channel(<span class=
    "arg">channel</span>) -&gt; <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Extracts a channel from the image. <span class="imquote">A
    channel is a particular color component of each pixel in the
    [image].</span></p>

    <h4>Arguments</h4>

    <p>A <a href="constants.html#ChannelType">ChannelType</a>
    value.</p>

    <h4>Returns</h4>

    <p>An image in which the RGB values of all the pixels have been
    set to a gray corresponding to the specified channel value. For
    example, given a pixel in the original image with the value
    R=255, G=128, B=0 and the RedChannel argument, the equivalent
    pixel in the result image will have the value R=255, G=255, and
    B=255. For the BlueChannel argument, the pixel would have the
    value R=0, G=0, B=0.</p>

    <h4>Example</h4>

    <p>The channel image preserves the tone of the selected RGB
    component.</p>

    <p><a href="javascript:popup('channel.rb.html')"><img src=
    "ex/channel.jpg" alt="channel example" /></a></p>

    <h4>Magick API</h4>

    <p>ChannelImage</p>
  </div>

  <div class="sig">
    <h3 id="channel_depth">channel_depth</h3>

    <p><span class="arg">img</span>.channel_depth([<span class=
    "arg">channel</span>...]) -&gt; <em>number</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Returns the maximum depth for the specified channel or
    channels.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>channel...</dt>

      <dd>Zero or more <a href=
      "constants.html#ChannelType">ChannelType</a> values. If no
      arguments are specified, the default is all channels.</dd>
    </dl>

    <h4>Returns</h4>

    <p>The maximum depth</p>

    <h4>See also</h4>

    <p><a href=
    "image3.html#set_channel_depth">set_channel_depth</a></p>

    <h4>Magick API</h4>

    <p>GetImageChannelDepth</p>
  </div>

  <div class="sig">
    <h3 id="channel_extrema">channel_extrema</h3>

    <p><span class="arg">img</span>.channel_extrema([<span class=
    "arg">channel</span>...]) -&gt; <em>[number, number]</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Returns the minimum and maximum intensity values for the
    specified channel or channels.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>channel...</dt>

      <dd>Zero or more <a href=
      "constants.html#ChannelType">ChannelType</a> values. If no
      arguments are specified, the default is all channels.</dd>
    </dl>

    <h4>Returns</h4>

    <p>An array. The first element in the array is the minimum
    value. The second element is the maximum value.</p>

    <h4>Magick API</h4>

    <p>GetImageChannelExtrema</p>
  </div>

  <div class="sig">
    <h3 id="channel_mean">channel_mean</h3>

    <p><span class="arg">img</span>.channel_mean([<span class=
    "arg">channel</span>...]) -&gt; <em>[number, number]</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Returns the mean and standard deviation values for the
    specified channel or channels.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>channel...</dt>

      <dd>Zero or more <a href=
      "constants.html#ChannelType">ChannelType</a> values. If no
      arguments are specified, the default is all channels.</dd>
    </dl>

    <h4>Returns</h4>

    <p>An array. The first element in the array is the mean value.
    The second element is the standard deviation.</p>

    <h4>Magick API</h4>

    <p>GetImageChannelMean</p>
  </div>

  <div class="sig">
    <h3 id="charcoal">charcoal</h3>

    <p><span class="arg">img</span>.charcoal(<span class=
    "arg">radius</span>=0.0, <span class="arg">sigma</span>=1.0)
    -&gt; <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Adds a "charcoal" effect to the image. You can alter the
    intensity of the effect by changing the <span class=
    "arg">radius</span> and <span class="arg">sigma</span>
    arguments.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>radius</dt>

      <dd class="imquote">The radius of the pixel
      neighborhood.</dd>

      <dt>sigma</dt>

      <dd class="imquote">The standard deviation of the Gaussian,
      in pixels.</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Example</h4>

    <p class="rollover"><a href=
    "javascript:popup('charcoal.rb.html')"><img onmouseover=
    "this.src='ex/images/Flower_Hat.jpg'" onmouseout=
    "this.src='ex/charcoal.jpg'" src="ex/charcoal.jpg" alt=
    "charcoal example" title=
    "Click the image to see the example script" /></a> <img src=
    "ex/images/spin.gif" alt="" class="spin" title=
    "Mouse over the example to see the original image" /></p>

    <h4>Magick API</h4>

    <p>CharcoalImage</p>
  </div>

  <div class="sig">
    <h3 id="check_destroyed">check_destroyed</h3>

    <p><span class="arg">img</span>.check_destroyed -&gt;
    <code>nil</code></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Raises DestroyedImageError if the image has been destroyed.
    Returns nil otherwise.</p>

    <h4>See also</h4>

    <p><a href="#destroy_bang">destroy!</a>, <a href=
    "#destroyed_q">destroyed?</a></p>
  </div>

  <div class="sig">
    <h3 id="chop">chop</h3>

    <p><span class="arg">img</span>.chop(<span class=
    "arg">x</span>, <span class="arg">y</span>, <span class=
    "arg">width</span>, <span class="arg">height</span>) -&gt;
    <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Removes the specified rectangle and collapses the rest of
    the image to fill the removed portion.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>x</dt>

      <dd>The x offset of the rectangle from the upper-left corner
      of the image.</dd>

      <dt>y</dt>

      <dd>The y offset of the rectangle from the upper-left corner
      of the image.</dd>

      <dt>width</dt>

      <dd>The width of the rectangle.</dd>

      <dt>height</dt>

      <dd>The height of the rectangle.</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Example</h4>

    <p>The chop rectangle is highlighted in the "before" image. The
    result may seem counter-intuitive!</p>

    <p class="rollover"><a href=
    "javascript:popup('chop.rb.html')"><img onmouseover=
    "this.src='ex/chop_before.jpg'" onmouseout=
    "this.src='ex/chop_after.jpg'" src="ex/chop_after.jpg" alt=
    "chop example" title=
    "Click the image to see the example script" /></a> <img src=
    "ex/images/spin.gif" alt="" class="spin" title=
    "Mouse over the example to see the original image" /></p>

    <h4>See also</h4>

    <p><a href="#crop">crop</a></p>

    <h4>Magick API</h4>

    <p>ChopImage</p>
  </div>

  <div class="sig">
    <h3 id="clone">clone</h3>

    <p><span class="arg">img</span>.clone -&gt; <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Same as <a href="#dup">dup</a> except the frozen state of
    the original is propagated to the new copy.</p>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>See also</h4>

    <p><a href="#dup">dup</a></p>
  </div>

  <div class="sig">
    <h3 id="clut_channel">clut_channel</h3>

    <p><span class="arg">img</span>.clut(<span class=
    "arg">clut_image</span> [, <span class=
    "arg">channel...</span>]) -&gt; <em>self</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Replace the channel values in the target image with a lookup
    of its replacement value in an LUT gradient image.</p>

    <p class="imquote">The LUT image should be either a single row
    or column image of replacement colors. The lookup is controlled
    by the -interpolate setting, especially for an LUT which is not
    the full length needed by the IM installed Quality (Q) level.
    Good settings for this is the default 'bilinear' or 'bicubic'
    interpolation setting for a smooth color gradient, or 'integer'
    for a direct unsmoothed lookup of color values.</p>

    <p class="imquote">This method is especially suited to
    replacing a grayscale image with specific color gradient from
    the CLUT image.</p>

    <p class="imquote">Note that color replacements involving
    transparency (alpha/matte channel) will lookup the replacement
    alpha/matte value using the alpha/matte value of the original
    image. As such correct alpha channel lookup for a pure
    gray-scale original image will require a copy of that grayscale
    to be transferred into its alpha channel before applying the
    -clut operator.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>clut_image</dt>

      <dd>The LUT gradient image. Specify which interpolation
      method to use by setting this image's <a href=
      "imageattrs.html#pixel_interpolation_method">pixel_interpolation_method</a>
      attribute to a <a href=
      "constants.html#InterpolatePixelMethod">InterpolatePixelMethod</a>
      value.</dd>

      <dt>channel...</dt>

      <dd>Limit which channels are modified by specifying one or
      more <a href="constants.html#ChannelType">ChannelType</a>
      values. Only these channels will be changed. If no channels
      are specified, all channels will be changed.</dd>
    </dl>

    <h4>Returns</h4>

    <p>self</p>

    <h4>See also</h4>

    <p>ImageMagick's -clut option.</p>
  </div>

  <div class="sig">
    <h3 id="color_fill_to_border">color_fill_to_border</h3>

    <p><span class=
    "arg">img</span>.color_fill_to_border(<span class=
    "arg">x</span>, <span class="arg">y</span>, <span class=
    "arg">fill_color</span>) -&gt; <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Changes any pixel that is a neighbor of the target pixel and
    is not the border color to the fill color.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>x, y</dt>

      <dd>The target pixel's location.</dd>

      <dt>fill_color</dt>

      <dd>The fill color. The fill color can be either color name
      or a <a href="struct.html#Pixel">Pixel</a> object.</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Example</h4>

    <p>In this example, the aquamarine fill starts at the center of
    the circle and fills to the black border. All non-black pixels
    are replaced by the fill color. Contrast the result of
    <code>color_fill_to_border</code> with that of
    <code>color_floodfill</code> example, below.</p>

    <p class="rollover"><a href=
    "javascript:popup('color_fill_to_border.rb.html')"><img onmouseover="this.src='ex/color_fill_to_border_before.gif'"
    onmouseout="this.src='ex/color_fill_to_border_after.gif'" src=
    "ex/color_fill_to_border_after.gif" alt=
    "color_fill_to_border example" title=
    "Click the image to see the example script" /></a><img src=
    "ex/images/spin.gif" alt="" class="spin" style=
    "margin-bottom: 182px; margin-left: 4px;" title=
    "Mouse over the example to see the original image" /></p>

    <h4>See also</h4>

    <p><a href="#color_floodfill">color_floodfill</a></p>

    <h4>Magick API</h4>

    <p>ColorFloodfillImage</p>
  </div>

  <div class="sig">
    <h3 id="color_floodfill">color_floodfill</h3>

    <p><span class="arg">img</span>.color_floodfill(<span class=
    "arg">x</span>, <span class="arg">y</span>, <span class=
    "arg">fill_color</span>) -&gt; <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Changes any pixel that is the same color and is a neighbor
    of the target pixel to the fill color.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>x, y</dt>

      <dd>The target pixel's location.</dd>

      <dt>fill_color</dt>

      <dd>The fill color, either color name or a <a href=
      "struct.html#Pixel">Pixel</a> object.</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Example</h4>

    <p>In this example, the aquamarine fill starts at the center of
    the circle and replaces all neighboring white pixels. Contrast
    the result of <code>color_floodfill</code> with that of
    <code>color_fill_to_border</code>, above.</p>

    <p class="rollover"><a href=
    "javascript:popup('color_floodfill.rb.html')"><img onmouseover=
    "this.src='ex/color_floodfill_before.gif'" onmouseout=
    "this.src='ex/color_floodfill_after.gif'" src=
    "ex/color_floodfill_after.gif" alt="color_floodfill example"
    title="Click the image to see the example script" /></a>
    <img src="ex/images/spin.gif" alt="" class="spin" style=
    "margin-bottom: 182px;" title=
    "Mouse over the example to see the original image" /></p>

    <h4>See also</h4>

    <p><a href="#color_fill_to_border">color_fill_to_border</a>,
    <a href="image2.html#opaque">opaque</a></p>

    <h4>Magick API</h4>

    <p>ColorFloodfillImage</p>
  </div>

  <div class="sig">
    <h3 id="color_histogram">color_histogram</h3>

    <p><span class="arg">img</span>.color_histogram() -&gt;
    <em>hash</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Computes the number of times each unique color appears in
    the image.</p>

    <h4>Returns</h4>

    <p>A hash. Each key in the hash is a <a href=
    "struct.html#Pixel">pixel</a> representing a color that appears
    in the image. The value associated with the key is the number
    of times that color appears in the image. <em>Caution:</em> if
    the image contains many colors the hash will be very large. You
    may want to use the <a href="image3.html#quantize">quantize</a>
    method to reduce the number of colors before using
    <code>color_histogram</code>.</p>

    <h4>Example</h4>

    <p>This histogram was produced by sorting the hash returned by
    <code>color_histogram</code> by increasing frequency.</p>

    <p><a href=
    "javascript:popup('color_histogram.rb.html')"><img src=
    "ex/color_histogram.gif" alt="color_histogram example" title=
    "Click the image to see the example script" /></a></p>

    <h4>Magick API</h4>

    <p>GetImageHistogram</p>
  </div>

  <div class="sig">
    <h3 id="colorize">colorize</h3>

    <p><span class="arg">img</span>.colorize(<span class=
    "arg">red_pct</span>, <span class="arg">green_pct</span>,
    <span class="arg">blue_pct</span>, [<span class=
    "arg">matte_pct</span>, ] <span class="arg">fill</span>) -&gt;
    <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Blend the fill color with the image pixels. The red_pct,
    green_pct, blue_pct and matte_pct arguments are the percentage
    to blend with the red, green, blue and matte channels.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>red_pct, green_pct, blue_pct, matte_pct</dt>

      <dd>The percentage of the fill color red, green, blue and
      matte (transparency) components to blend with the image
      pixel. For example, <code>.25</code> is 25%. The matte_pct
      argument is optional.</dd>

      <dt>fill</dt>

      <dd>A color name or a <a href=
      "struct.html#Pixel">Pixel</a></dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Example</h4>

    <p>This example converts a color image to a "sepia-tone-ish"
    image using the <a href="image3.html#quantize">quantize</a> and
    <code>colorize</code> methods.</p>

    <p class="rollover"><a href=
    "javascript:popup('colorize.rb.html')"><img onmouseover=
    "this.src='ex/images/Flower_Hat.jpg'" onmouseout=
    "this.src='ex/colorize.jpg'" src="ex/colorize.jpg" alt=
    "colorize example" title=
    "Click the image to see the example script" /></a> <img src=
    "ex/images/spin.gif" alt="" class="spin" title=
    "Mouse over the example to see the original image" /></p>

    <h4>See also</h4>

    <p><a href="image3.html#sepiatone">sepiatone</a></p>

    <h4>Magick API</h4>

    <p>ColorizeImage</p>
  </div>

  <div class="sig">
    <h3 id="colormap">colormap</h3>

    <p><span class="arg">img</span>.colormap(<span class=
    "arg">index</span>[, <span class="arg">new_color</span>]) -&gt;
    <em>string</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Returns the color in the color map at the specified index.
    If the <span class="arg">new_color</span> argument is
    specified, replaces the color at that index with the new
    color.</p>

    <p>Raises IndexError if the image does not contain a color map.
    Only <a href="constants.html#ClassType">PseudoClass</a> images
    have a color map.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>index</dt>

      <dd>A number between 0 and the number of colors in the color
      map. If the value is out of range, <code>colormap</code>
      raises an IndexError. You can get the number of colors in the
      color map from the <a href=
      "imageattrs.html#colors">colors</a> attribute.</dd>

      <dt>new_color</dt>

      <dd>Optional. If specified, may be either a <a href=
      "imusage.html#color_names">color name</a> or a <a href=
      "struct.html#Pixel">pixel</a>.</dd>
    </dl>

    <h4>Returns</h4>

    <p>The name of the color at the specified location in the color
    map</p>
  </div>

  <div class="sig">
    <h3 id="color_point">color_point</h3>

    <p><span class="arg">img</span>.color_point(<span class=
    "arg">x</span>, <span class="arg">y</span>, <span class=
    "arg">fill</span>) -&gt; <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>Set the color of the pixel at <span class=
    "arg">x</span>,<span class="arg">y</span> to the fill color.
    This method creates a new image object. If you want to set a
    single pixel in the image without creating a new image, use
    <a href="image3.html#pixel_color">pixel_color</a> or the
    <a href="draw.html#point">Draw#point</a> method.

    <h4>Arguments</h4>

    <dl>
      <dt>x, y</dt>

      <dd>The location of the pixel.</dd>

      <dt>fill</dt>

      <dd>The fill color, either color name or a <a href=
      "struct.html#Pixel">Pixel</a> object.</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Example</h4>
    <pre>
f.color_point(50,50, 'red')
</pre>

    <h4>See also</h4>

    <p><a href="image3.html#pixel_color">pixel_color</a>, <a href=
    "draw.html#point">Draw#point</a></p>

    <h4>Magick API</h4>

    <p>GetImagePixels, SyncImagePixels</p>
  </div>

  <div class="sig">
    <h3 id="color_reset_bang">color_reset!</h3>

    <p><span class="arg">img</span>.color_reset!(<span class=
    "arg">fill</span>) -&gt; <em>self</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Sets all the pixels in the image to the specified fill
    color.</p>

    <h4>Arguments</h4>The fill color, either color name or a
    <a href="struct.html#Pixel">Pixel</a> object.

    <h4>Returns</h4>self

    <h4>Example</h4>
    <pre>
f.color_reset!(red)
</pre>

    <h4>See also</h4>

    <p><a href="image2.html#erase_bang">erase!</a></p>

    <h4>Magick API</h4>SetImage
  </div>

  <div class="sig">
    <h3 id="compare_channel">compare_channel</h3>

    <p><span class="arg">img</span>.compare_channel(<span class=
    "arg">img</span>, <span class="arg">metric</span> [,
    <span class="arg">channel...</span>]) [ <span class=
    "arg">{&nbsp;optional arguments&nbsp;}</span> ] -&gt;
    [<em>image</em>, <em>float</em>]</p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Compares <span class="arg">img</span> with the receiver.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>image</dt>

      <dd>Either an imagelist or an image. If an imagelist, uses
      the current image.</dd>

      <dt>metric</dt>

      <dd>The desired distortion metric. A <a href=
      "constants.html#MetricType">MetricType</a> value.</dd>

      <dt>channel...</dt>

      <dd>Zero or more <a href=
      "constants.html##ChannelType">ChannelType</a> values. All the
      specified channels contribute to the comparison and the
      distortion value. If no channels are specified, compares all
      channels.</dd>

      <dt>optional arguments</dt>

      <dd>
        If present, <code>compare_channel</code> yields to a block
        in which you can set optional arguments by setting
        attributes on <em>self</em>. In both cases <span class=
        "arg">color</span> may be either a <a href=
        "imusage.html#color_names">color name</a> or a <a href=
        "struct.html#Pixel">pixel</a>.

        <dl>
          <dt>self.highlight_color = color</dt>

          <dd>Emphasize pixel differences with this color. The
          default is partially transparent red.</dd>

          <dt>self.lowlight_color = color</dt>

          <dd>Demphasize pixel differences with this color. The
          default is partially transparent white.</dd>
        </dl>
      </dd>
    </dl>

    <h4>Returns</h4>

    <p>An array. The first element is a difference image, the
    second is a the value of the computed distortion represented as
    a <code>Float</code>.</p>

    <h4>See also</h4>

    <p><a href="#difference">difference</a>, <a href=
    "#spaceship">&lt;=&gt;</a>, <a href=
    "#distortion_channel">distortion_channel</a></p>

    <h4>Magick API</h4>

    <p>ImageCompareChannels</p>

    <h4>Notes</h4>

    <p>This method was named <code>channel_compare</code> in
    earlier releases of RMagick. That name remains an alias for
    <code>compare_channel</code>.</p>
  </div>

  <div class="sig">
    <h3 id="composite">composite</h3>

    <p><span class="arg">dest</span>.composite(<span class=
    "arg">src</span>, <span class="arg">x</span>, <span class=
    "arg">y</span>, <span class="arg">composite_op</span>) -&gt;
    <em>image</em><br />
    <span class="arg">dest</span>.composite(<span class=
    "arg">src</span>, <span class="arg">gravity</span>,
    <span class="arg">composite_op</span>) -&gt;
    <em>image</em><br />
    <span class="arg">dest</span>.composite(<span class=
    "arg">src</span>, <span class="arg">gravity</span>,
    <span class="arg">x</span>, <span class="arg">y</span>,
    <span class="arg">composite_op</span>) -&gt; <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>Composites <span class="arg">src</span>
    onto <span class="arg">dest</span> using the specified
    composite operator.

    <h4>Arguments</h4>

    <p>The composite method can be called three different ways:</p>

    <dl>
      <dt style="font-style: normal;">1.&nbsp;Without a gravity
      argument:</dt>

      <dd>
        <dl>
          <dt>src</dt>

          <dd>Either an imagelist or an image. If an imagelist,
          uses the current image.</dd>

          <dt>x, y</dt>

          <dd>The x- and y-offset of the composited image, measured
          from the upper-left corner of the image.</dd>

          <dt>composite_op</dt>

          <dd>A <a href=
          "constants.html#CompositeOperator">CompositeOperator</a>
          value.</dd>
        </dl>
      </dd>

      <dt style="font-style: normal;">2.&nbsp;With a gravity
      argument, without x and y arguments:</dt>

      <dd>
        <dl>
          <dt>src</dt>

          <dd>Either an imagelist or an image. If an imagelist,
          uses the current image.</dd>

          <dt>gravity</dt>

          <dd>
            A <a href="constants.html#GravityType">GravityType</a>
            value that specifies the location of <em>img</em> on
            <em>image</em>:

            <dl>
              <dt>NorthWestGravity</dt>

              <dd>The composited image abuts the top and left sides
              of the image.</dd>

              <dt>NorthGravity</dt>

              <dd>The composited image is centered left-to-right
              and abuts the top of the image.</dd>

              <dt>NorthEastGravity</dt>

              <dd>The composited image abuts the top and right
              sides of the image.</dd>

              <dt>EastGravity</dt>

              <dd>The composited image is centered top-to-bottom
              and abuts the right side of the image.</dd>

              <dt>SouthEastGravity</dt>

              <dd>The composited image abuts the bottom and right
              sides of the image.</dd>

              <dt>SouthGravity</dt>

              <dd>The composited image is centered left-to-right
              and abuts the bottom of the image.</dd>

              <dt>SouthWestGravity</dt>

              <dd>The composited image abuts the bottom and left
              sides of the image.</dd>

              <dt>WestGravity</dt>

              <dd>The composited image is centered top-to-bottom
              and abuts the left side of the image.</dd>

              <dt>CenterGravity</dt>

              <dd>The composited image is centered left-to-right
              and top-to-bottom.</dd>
            </dl>
          </dd>

          <dt>composite_op</dt>

          <dd>A <a href=
          "constants.html#CompositeOperator">CompositeOperator</a>
          value.</dd>
        </dl>
      </dd>

      <dt style="font-style: normal;">3.&nbsp;With gravity, x, and
      y arguments:</dt>

      <dd>
        <dl>
          <dt>src</dt>

          <dd>Either an imagelist or an image. If an imagelist,
          uses the current image.</dd>

          <dt>gravity</dt>

          <dd>A <a href=
          "constants.html#GravityType">GravityType</a> value.</dd>

          <dt>x, y</dt>

          <dd>The x- and y-offset of the composited image, measured
          relative to the <em>gravity</em> argument.</dd>

          <dt>composite_op</dt>

          <dd>A <a href=
          "constants.html#CompositeOperator">CompositeOperator</a>
          value.</dd>
        </dl>
      </dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Example</h4>

    <p>This example shows the effect of some of the composite
    operators.</p>

    <p><a href="javascript:popup('composite.rb.html')"><img src=
    "ex/composite.gif" alt="composite example" title=
    "Click the image to see the example script" /></a></p>

    <h4>See also</h4>

    <p><a href="#composite_bang">composite!</a>, <a href=
    "#dissolve">dissolve</a>, <a href=
    "image3.html#watermark">watermark</a></p>

    <h4>Magick API</h4>

    <p>CompositeImage</p>
  </div>

  <div class="sig">
    <h3 id="composite_bang">composite!</h3>

    <p><span class="arg">dest</span>.composite!(<span class=
    "arg">src</span>, <span class="arg">x</span>, <span class=
    "arg">y</span>, <span class="arg">composite_op</span>) -&gt;
    <em>self</em><br />
    <span class="arg">dest</span>.composite!(<span class=
    "arg">src</span>, <span class="arg">gravity</span>,
    <span class="arg">composite_op</span>) -&gt;
    <em>self</em><br />
    <span class="arg">dest</span>.composite!(<span class=
    "arg">src</span>, <span class="arg">gravity</span>,
    <span class="arg">x</span>, <span class="arg">y</span>,
    <span class="arg">composite_op</span>) -&gt; <em>self</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>In-place form of <a href="#composite">composite</a>.</p>

    <h4>Returns</h4>

    <p>self</p>
  </div>

  <div class="sig">
    <h3 id="composite_affine">composite_affine</h3>

    <p><span class="arg">dest</span>.composite_affine(<span class=
    "arg">src</span>, <span class="arg">affine</span>) -&gt;
    <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>Composite <span class="arg">src</span> over
    <span class="arg">dest</span> as dictated by the <span class=
    "arg">affine</span> argument.

    <h4>Arguments</h4>

    <dl>
      <dt>img</dt>

      <dd>An image or imagelist</dd>

      <dt>affine</dt>

      <dd>An <code>AffineMatrix</code></dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>See also</h4>

    <p><a href="#composite">composite</a>, <a href=
    "#affine_transform">affine_transform</a></p>

    <h4>Magick API</h4>

    <p>DrawAffineImage</p>
  </div>

  <div class="sig">
    <h3 id="composite_mathematics">composite_mathematics</h3>

    <p><span class=
    "arg">dest</span>.composite_mathematics(<span class=
    "arg">src</span>, <span class="arg">a</span>, <span class=
    "arg">b</span>, <span class="arg">c</span>, <span class=
    "arg">d</span>, <span class="arg">gravity</span>) -&gt;
    <em>image</em><br />
    <span class=
    "arg">dest</span>.composite_mathematics(<span class="arg">src</span>,
    <span class="arg">a</span>, <span class="arg">b</span>,
    <span class="arg">c</span>, <span class="arg">d</span>,
    <span class="arg">x</span>, <span class="arg">y</span>) -&gt;
    <em>image</em><br />
    <span class=
    "arg">dest</span>.composite_mathematics(<span class="arg">src</span>,
    <span class="arg">a</span>, <span class="arg">b</span>,
    <span class="arg">c</span>, <span class="arg">d</span>,
    <span class="arg">gravity</span>, <span class="arg">x</span>,
    <span class="arg">y</span>) -&gt; <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Merge the source and destination images according to the
    formula
    <em>a*Sc*Dc&nbsp;+&nbsp;b*Sc&nbsp;+&nbsp;c*Dc&nbsp;+&nbsp;d</em>
    where Sc is the source pixel and Dc is the destination
    pixel.</p>

    <p>Equivalent to the <code>-compose Mathematics -set
    option:compose:args a,b,c,d</code> options to ImagMagick's
    <code>convert</code> command. See <a href=
    "http://www.imagemagick.org/Usage/compose/#mathematics">Examples
    of ImageMagick Usage</a>.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>src</dt>

      <dd>Either an imagelist or an image. If an imagelist, uses
      the current image.</dd>

      <dt>a, b, c, d</dt>

      <dd>See the description.</dd>

      <dt>gravity</dt>

      <dd>A <a href="constants.html#GravityType">GravityType</a>
      value. If omitted, the default gravity is
      NorthWestGravity.</dd>

      <dt>x, y</dt>

      <dd>The x- and y-offset of the composited image, measured
      relative to the <em>gravity</em> argument. If omitted, the
      default value is 0.0.</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>See also</h4>

    <p><a href="#composite">composite</a></p>

    <h4>Magick API</h4>

    <p>CompositeImage</p>
  </div>

  <div class="sig">
    <h3 id="composite_tiled">composite_tiled</h3>

    <p><span class="arg">img</span>.composite_tiled(<span class=
    "arg">src</span>, <span class="arg">composite_op</span> =
    Magick::OverCompositeOp) -&gt; <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Composites multiple copies of the source image across and
    down the image, producing the same results as ImageMagick's
    composite command with the -tile option.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>src</dt>

      <dd>The source image</dd>

      <dt>composite_op</dt>

      <dd>A <a href=
      "constants.html#CompositeOperator">CompositeOperator</a>
      value</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>See also</h4>

    <p><a href="#composite">composite</a>, <a href=
    "#composite_tiled_bang">composite_tiled!</a></p>

    <h4>Magick API</h4>

    <p>CompositeImage</p>
  </div>

  <div class="sig">
    <h3 id="composite_tiled_bang">composite_tiled!</h3>

    <p><span class="arg">img</span>.composite_tiled!(<span class=
    "arg">src</span>, <span class="arg">composite_op</span> =
    Magick::OverCompositeOp) -&gt; <em>self</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>In-place form of <a href=
    "#composite_tiled">composite_tiled</a>.</p>

    <h4>Example</h4>

    <p class="rollover"><a href=
    "javascript:popup('composite_tiled.rb.html')"><img onmouseover=
    "this.src='ex/images/Flower_Hat.jpg'" onmouseout=
    "this.src='ex/composite_tiled.jpg'" src=
    "ex/composite_tiled.jpg" alt="composite_tiled example" title=
    "Click the image to see the example script" /></a> <img src=
    "ex/images/spin.gif" alt="" class="spin" title=
    "Mouse over the example to see the original image" /></p>

    <h4>Returns</h4>

    <p>self</p>

    <h4>See also</h4>

    <p><a href="#composite_bang">composite!</a>, <a href=
    "#composite_tiled">composite_tiled</a></p>

    <h4>Magick API</h4>

    <p>CompositeImage</p>
  </div>

  <div class="sig">
    <h3 id="compress_colormap">compress_colormap</h3>

    <p><span class="arg">img</span>.compress_colormap! -&gt;
    <em>self</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Removes duplicate or unused entries in the colormap. Only
    <a href="constants.html#ClassType">PseudoClass</a> images have
    a colormap. If the image is <code>DirectClass</code> then
    <code>compress_colormap!</code> converts it to
    <code>PseudoClass</code>.</p>

    <h4>Returns</h4>self

    <h4>Example</h4>
    <pre>
f = Image.read('cbezier1.gif').first &raquo;
 cbezier1.gif GIF 500x350+0+0 PseudoClass 128c 8-bit 177503b
f.colors &raquo; 128
f.compress_colormap! &raquo;
 cbezier1.gif GIF 500x350+0+0 PseudoClass 108c 8-bit 177503b
f.colors &raquo; 108
</pre>

    <h4>Magick API</h4>

    <p>CompressColormap</p>
  </div>

  <div class="sig">
    <h3 id="contrast">contrast</h3>

    <p><span class="arg">img</span>.contrast(<span class=
    "arg">sharpen</span>=<code>false</code>) -&gt;
    <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p class="imquote">Enhances or reduces the intensity
    differences between the lighter and darker elements of the
    image.</p>

    <h4>Arguments</h4>If <span class="arg">sharpen</span> is
    <code>true</code>, the contrast is increased, otherwise it is
    reduced.

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Example</h4>

    <p>In this example the contrast is <em>reduced</em> in each
    successive image.</p><a href=
    "javascript:popup('contrast.rb.html')"><img src=
    "ex/contrast.jpg" alt="contrast example" title=
    "Click the image to see the example script" /></a>

    <h4>See also</h4>

    <p><a href=
    "#contrast_stretch_channel">contrast_stretch_channel</a>,
    <a href=
    "image3.html#sigmoidal_contrast_channel">sigmoidal_contrast_channel</a></p>

    <h4>Magick API</h4>

    <p>ContrastImage</p>
  </div>

  <div class="sig">
    <h3 id="contrast_stretch_channel">contrast_stretch_channel</h3>

    <p><span class=
    "arg">img</span>.contrast_stretch_channel(<span class=
    "arg">black_point</span> [, <span class=
    "arg">white_point</span>] [, <span class=
    "arg">channel</span>...]) -&gt; <span class=
    "arg">image</span></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>This method <span class="imquote">is a simple image
    enhancement technique that attempts to improve the contrast in
    an image by `stretching' the range of intensity values it
    contains to span a desired range of values. It differs from the
    more sophisticated histogram equalization in that it can only
    apply a linear scaling function to the image pixel values. As a
    result the `enhancement' is less harsh.</span></p>

    <h4>Arguments</h4>

    <dl>
      <dt>black_point</dt>

      <dd>black out at most this many pixels. Specify an absolute
      number of pixels as a numeric value, or a percentage as a
      string in the form 'NN%'.</dd>

      <dt>white_point</dt>

      <dd>burn at most this many pixels. Specify an absolute number
      of pixels as a numeric value, or a percentage as a string in
      the form 'NN%'. This argument is optional. If not specified
      the default is <code>all pixels - black_point
      pixels</code>.</dd>

      <dt>channel...</dt>

      <dd>0 or more <a href=
      "constants.html#ChannelType">ChannelType</a> arguments. If no
      channels are specified all channels are included.</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>See also</h4>

    <p><a href="#contrast">contrast</a>, <a href=
    "image2.html#equalize">equalize</a></p>

    <h4>Magick API</h4>

    <p>ContrastStretchImage</p>
  </div>

  <div class="sig">
    <h3 id="convolve">convolve</h3>

    <p><span class="arg">img</span>.convolve(<span class=
    "arg">order</span>, <span class="arg">kernel</span>) -&gt;
    <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p class="imquote">Applies a custom convolution kernel to the
    image.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>order</dt>

      <dd>The number of columns and rows in the kernel.</dd>

      <dt>kernel</dt>

      <dd>An <span class="arg">order</span>*<span class=
      "arg">order</span> matrix of <code>Float</code> values.</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>See also</h4>

    <p><a href="#convolve_channel">convolve_channel</a>. The
    <a href="image2.html#edge">edge</a>, <a href=
    "image2.html#emboss">emboss</a>, <a href=
    "image2.html#gaussian_blur">gaussian_blur</a>, <a href=
    "image2.html#motion_blur">motion_blur</a> and <a href=
    "image2.html#sharpen">sharpen</a> methods use convolution to do
    their work.</p>

    <h4>Magick API</h4>

    <p>ConvolveImage</p>

    <h4>Note</h4>

    <p>See <a href=
    "http://www.dai.ed.ac.uk/HIPR2/convolve.htm">Convolution</a> in
    the <a href=
    "http://www.dai.ed.ac.uk/HIPR2/copyrght.htm"><cite>Hypermedia
    Image Processing Reference</cite></a></p>
  </div>

  <div class="sig">
    <h3 id="convolve_channel">convolve_channel</h3>

    <p><span class="arg">img</span>.convolve_channel(<span class=
    "arg">order</span>, <span class="arg">kernel</span> [,
    <span class="arg">channel</span>...]) -&gt; <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Applies a custom convolution kernel to the specified channel
    or channels in the image.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>order</dt>

      <dd>The number of columns and rows in the kernel.</dd>

      <dt>kernel</dt>

      <dd>An <span class="arg">order</span>*<span class=
      "arg">order</span> matrix of <code>Float</code> values.</dd>

      <dt>channel...</dt>

      <dd>0 or more <a href=
      "constants.html#ChannelType">ChannelType</a> arguments. If no
      channels are specified the effect is the same as calling
      <a href="#convolve">convolve</a>.</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Magick API</h4>

    <p>ConvolveImageChannel</p>

    <h4>See also</h4>

    <p><a href="#convolve">convolve</a></p>
  </div>

  <div class="sig">
    <h3 id="copy">copy</h3>

    <p><span class="arg">img</span>.copy -&gt;
    <em>other_image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>Returns a copy of the image. The tainted
    state of the original is propagated to the copy.

    <h4>Example</h4>
    <pre>
f2 = f.copy
</pre>

    <h4>See also</h4>

    <p><a href="#clone">clone</a>, <a href="#dup">dup</a>, <a href=
    "ilist.html#copy">ImageList#copy</a></p>

    <h4>Magick API</h4>

    <p>CloneImage</p>
  </div>

  <div class="sig">
    <h3 id="crop">crop</h3>

    <p><span class="arg">img</span>.crop(<span class=
    "arg">x</span>, <span class="arg">y</span>, <span class=
    "arg">width</span>, <span class="arg">height</span>) -&gt;
    <em>image</em><br />
    <span class="arg">img</span>.crop(<span class=
    "arg">gravity</span>, <span class="arg">x</span>, <span class=
    "arg">y</span>, <span class="arg">width</span>, <span class=
    "arg">height</span>) -&gt; <em>image</em><br />
    <span class="arg">img</span>.crop(<span class=
    "arg">gravity</span>, <span class="arg">width</span>,
    <span class="arg">height</span>) -&gt; <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Extracts the specified rectangle from the image.</p>

    <h4>Arguments</h4>

    <p>The crop method can be called three different ways:</p>

    <dl>
      <dt style="font-style: normal;">1.&nbsp;Without a
      <em>gravity</em> argument:</dt>

      <dd>
        <dl>
          <dt>x, y</dt>

          <dd>The <em>x-</em> and <em>y-</em>offset of the
          rectangle relative to the upper-left corner of the
          image</dd>

          <dt>width, height</dt>

          <dd>The width and height of the rectangle.</dd>
        </dl>
      </dd>

      <dt style="font-style: normal;">2.&nbsp;With a
      <em>gravity</em> argument, but without <em>x</em> and
      <em>y</em> arguments:</dt>

      <dd>
        <dl>
          <dt>gravity</dt>

          <dd>
            A <a href="constants.html#GravityType">GravityType</a>
            value specifying the position of the rectangle.

            <dl>
              <dt>NorthWestGravity</dt>

              <dd>The rectangle abuts the top and left sides of the
              image.</dd>

              <dt>NorthGravity</dt>

              <dd>The rectangle is centered left-to-right and abuts
              the top of the image.</dd>

              <dt>NorthEastGravity</dt>

              <dd>The rectangle abuts the top and right sides of
              the image.</dd>

              <dt>EastGravity</dt>

              <dd>The rectangle is centered top-to-bottom and abuts
              the right side of the image.</dd>

              <dt>SouthEastGravity</dt>

              <dd>The rectangle abuts the bottom and right sides of
              the image.</dd>

              <dt>SouthGravity</dt>

              <dd>The rectangle is centered left-to-right and abuts
              the bottom of the image.</dd>

              <dt>SouthWestGravity</dt>

              <dd>The rectangle abuts the bottom and left sides of
              the image.</dd>

              <dt>WestGravity</dt>

              <dd>The rectangle is centered top-to-bottom and abuts
              the left side of the image.</dd>

              <dt>CenterGravity</dt>

              <dd>The rectangle is centered left-to-right and
              top-to-bottom.</dd>
            </dl>
          </dd>

          <dt>width, height</dt>

          <dd>The width and height of the rectangle.</dd>
        </dl>
      </dd>

      <dt style="font-style: normal;">3.&nbsp;With
      <em>gravity</em>, <em>x</em>, and <em>y</em> arguments:</dt>

      <dd>
        <dl>
          <dt>gravity</dt>

          <dd>A <a href=
          "constants.html#GravityType">GravityType</a> value. If
          the argument is NorthEastGravity, EastGravity, or
          SouthEastGravity, the <em>x-</em>offset is measured from
          the right side of the image. If the argument is
          SouthEastGravity, SouthGravity, or SouthWestGravity, the
          <em>y-</em>offset is measured from the bottom of the
          image. All other values are ignored and the <em>x-</em>
          and <em>y-</em>offsets are measured from the upper-left
          corner of the image.</dd>

          <dt>x, y</dt>

          <dd>The <em>x-</em> and <em>y-</em>offset of the
          rectangle from the sides specified by the
          <em>gravity</em> argument.</dd>

          <dt>width, height</dt>

          <dd>The width and height of the rectangle.</dd>
        </dl>
      </dd>
    </dl>

    <h4>Notes</h4>The <code>crop</code> method retains the offset
    information in the cropped image. This may cause the image to
    appear to be surrounded by blank or black space when viewed
    with an external viewer. This only occurs when the image is
    saved in a format (such as GIF) that saves offset information.
    To reset the offset data, add <code>true</code> as the last
    argument to <code>crop</code>. For example,
    <pre>
cropped = img.crop(x, y, width, height, true)
</pre>

    <p>You can add <code>true</code> as the last argument with any
    of the three argument list formats described above.</p>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Example</h4>

    <p>The crop rectangle is highlighted in the "before" image.</p>

    <p class="rollover"><a href=
    "javascript:popup('crop.rb.html')"><img onmouseover=
    "this.src='ex/crop_before.png'" onmouseout=
    "this.src='ex/crop_after.png'" src="ex/crop_after.png" alt=
    "crop example" title=
    "Click the image to see the example script" /></a><img src=
    "ex/images/spin.gif" alt="" class="spin" title=
    "Mouse over the example to see the original image" /></p>

    <h4>Example 2</h4>

    <p><a href=
    "javascript:popup('crop_with_gravity.rb.html')">crop_with_gravity.rb</a></p>

    <h4>See also</h4>

    <p><a href="#crop_bang">crop!</a>, <a href="#chop">chop</a>,
    <a href="image2.html#excerpt">excerpt</a></p>

    <h4>Magick API</h4>

    <p>CropImage</p>
  </div>

  <div class="sig">
    <h3 id="crop_bang">crop!</h3>

    <p><span class="arg">img</span>.crop!(<span class=
    "arg">x</span>, <span class="arg">y</span>, <span class=
    "arg">width</span>, <span class="arg">height</span>) -&gt;
    <em>self</em><br />
    <span class="arg">img</span>.crop!(<span class=
    "arg">gravity</span>, <span class="arg">x</span>, <span class=
    "arg">y</span>, <span class="arg">width</span>, <span class=
    "arg">height</span>) -&gt; <em>self</em><br />
    <span class="arg">img</span>.crop!(<span class=
    "arg">gravity</span>, <span class="arg">width</span>,
    <span class="arg">height</span>) -&gt; <em>self</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>The in-place form of <a href=
    "#crop">crop</a>.

    <h4>Returns</h4>

    <p>self</p>
  </div>

  <div class="sig">
    <h3 id="crop_resized">crop_resized</h3>

    <p><span class="arg">img</span>.crop_resized(<span class=
    "arg">width</span>, <span class="arg">height</span>,
    gravity=CenterGravity) -&gt; <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>An alias for <a href=
    "image3.html#resize_to_fill">resize_to_fill</a>.</p>
  </div>

  <div class="sig">
    <h3 id="cycle_colormap">cycle_colormap</h3>

    <p><span class="arg">img</span>.cycle_colormap(<span class=
    "arg">amount</span>) -&gt; <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p class="imquote">Displaces the colormap by a given number of
    positions. If you cycle the colormap a number of times you can
    produce a psychedelic effect.</p>

    <p>The returned image is always a <code>PseudoClass</code>
    image, regardless of the type of the original image.</p>

    <h4>Arguments</h4>

    <p>The number of positions to cycle.</p>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Example</h4>

    <p>Mouse over the image to see an animation made by cycling the
    colormap between each copy.</p>

    <p class="rollover"><a href=
    "javascript:popup('cycle_colormap.rb.html')"><img onmouseover=
    "this.src='ex/cycle_colormap.gif'" onmouseout=
    "this.src='ex/images/Hot_Air_Balloons.jpg'" src=
    "ex/images/Hot_Air_Balloons.jpg" alt="cycle_colormap example"
    title=
    "Click the image to see the example script" /></a><img src=
    "ex/images/spin.gif" alt="" class="spin" style="left: 191px;"
    title="Mouse over the example to see the animation" /></p>

    <h4>Magick API</h4>

    <p>CycleColormapImage</p>
  </div>

  <div class="sig">
    <h3 id="decipher">decipher</h3>

    <p><span class="arg">img</span>.decipher(<span class=
    "arg">passphrase</span>) -&gt; <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Decipher an enciphered image.</p>

    <h4>Arguments</h4>

    <p>The passphrase used to encipher the image.</p>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Example</h4>
    <pre>
deciphered_img = img.decipher("magic word")
</pre>

    <h4>Magick API</h4>

    <p>DecipherImage</p>

    <h4>See also</h4>

    <p><a href="image2.html#encipher">encipher</a></p>
  </div>

  <div class="sig">
    <h3 id="delete_compose_mask">delete_compose_mask</h3>

    <p><span class="arg">img</span>.delete_compose_mask() -&gt;
    <em>self</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Deletes the mask added by <a href=
    "#add_compose_mask">add_compose_mask</a>.</p>

    <h4>Returns</h4>

    <p>self</p>

    <h4>See also</h4>

    <p><a href="#add_compose_mask">add_compose_mask</a></p>

    <h4>Magick API</h4>

    <p>SetImageMask</p>
  </div>

  <div class="sig">
    <h3 id="delete_profile">delete_profile</h3>

    <p><span class="arg">img</span>.delete_profile(<span class=
    "arg">profile_name</span>) -&gt; <span class=
    "arg">self</span></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Deletes the specified profile. This method is effectively
    the same as passing a <code>nil</code> 2nd argument to <a href=
    "image3.html#profile_bang">profile!</a>.</p>

    <h4>Arguments</h4>

    <p>The profile name, "IPTC" or "ICC" for example. Specify "*"
    to delete all the profiles in the image.</p>

    <h4>See also</h4>

    <p>Setting the <a href=
    "imageattrs.html#iptc_profile">iptc_profile</a> attribute or
    <a href="imageattrs.html#color_profile">color_profile</a>
    attribute to nil causes the profile to be deleted. Also see
    <a href="image3.html#strip_bang">strip!</a> and <a href=
    "imageattrs.html#add_profile">add_profile</a>.</p>

    <h4>Magick API</h4>

    <p>ProfileImage</p>
  </div>

  <div class="sig">
    <h3 id="deskew">deskew</h3>

    <p><span class="arg">img</span>.deskew(<span class=
    "arg">threshold</span>=0.40, <span class=
    "arg">auto_crop_width</span>=nil) -&gt; <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p class="imquote">Straightens an image. A <span class=
    "arg">threshold</span> of 40% works for most images.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>threshold</dt>

      <dd>A percentage of QuantumRange. Either a Float between 0
      and 1.0, inclusive, or a string in the form "NN%" where NN is
      between 0 and 100.</dd>

      <dt>auto_crop_width</dt>

      <dd>Specify a value for this argument to cause the deskewed
      image to be auto-cropped. The argument is the pixel width of
      the image background (e.g. 40).</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Example</h4>
    <pre>
img2 = img.deskew
</pre>

    <h4>Magick API</h4>DeskewImage (available in 6.4.2)
  </div>

  <div class="sig">
    <h3 id="despeckle">despeckle</h3>

    <p><span class="arg">img</span>.despeckle -&gt;
    <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p class="imquote">Reduces the speckle noise while preserving
    the edges.</p>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Magick API</h4>

    <p>DespeckleImage</p>
  </div>

  <div class="sig">
    <h3 id="destroy_bang">destroy!</h3>

    <p><span class="arg">img</span>.destroy! -&gt;
    <em>self</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Returns all the memory associated with the image to the
    system. After an image has been destroyed, all Image methods
    (except <a href="image1.html#destroyed_q">destroyed?</a> and
    <a href="image2.html#inspect">inspect</a>) called on the image
    will raise a DestroyedImageError.</p>

    <p>It is not possible to recover a destroyed image.</p>

    <h4>Returns</h4>

    <p>self</p>

    <h4>See also</h4>

    <p><a href="#check_destroyed">check_destroyed</a>, <a href=
    "#destroyed_q">destroyed?</a></p>
  </div>

  <div class="sig">
    <h3 id="destroyed_q">destroyed?</h3>

    <p><span class="arg">img</span>.destroyed? -&gt;
    <code>true</code> or <code>false</code></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Returns true if the image has been destroyed, false
    otherwise.</p>

    <h4>See also</h4>

    <p><a href="#check_destroyed">check_destroyed</a>, <a href=
    "#destroy_bang">destroy!</a></p>
  </div>

  <div class="sig">
    <h3 id="difference">difference</h3>

    <p><span class="arg">img</span>.difference(<span class=
    "arg">other</span>) -&gt; <em>array</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p class="imquote">Compares two images and computes statistics
    about their difference.</p>

    <p class="imquote">A small normalized mean square
    error...suggests the images are very similar in spatial layout
    and color.</p>

    <h4>Returns</h4>

    <p>An array of three <code>Float</code> values:</p>

    <dl class="imquote">
      <dt>mean error per pixel</dt>

      <dd>The mean error for any single pixel in the image.</dd>

      <dt>normalized mean error</dt>

      <dd>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.</dd>

      <dt>normalized maximum error</dt>

      <dd>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.</dd>
    </dl>

    <p>After <code>difference</code> returns, these values are also
    available from the <a href=
    "imageattrs.html#mean_error_per_pixel">mean_error_per_pixel</a>,
    <a href=
    "imageattrs.html#normalized_mean_error">normalized_mean_error</a>,
    and <a href=
    "imageattrs.html#normalized_maximum_error">normalized_maximum_error</a>
    attributes.</p>

    <h4>See also</h4>

    <p><a href="#spaceship">&lt;=&gt;</a></p>

    <h4>Magick API</h4>IsImagesEqual
  </div>

  <div class="sig">
    <h3 id="dispatch">dispatch</h3>

    <p><span class="arg">img</span>.dispatch(<span class=
    "arg">x</span>, <span class="arg">y</span>, <span class=
    "arg">columns</span>, <span class="arg">rows</span>,
    <span class="arg">map</span>, <span class=
    "arg">float</span>=<code>false</code>) -&gt; <em>array</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Extracts the pixel data from the specified rectangle and
    returns it as an array of either <code>Integer</code> or
    <code>Float</code> values.</p>

    <p>The array returned by <code>dispatch</code> is suitable for
    use as an argument to <code>constitute</code>.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>x, y</dt>

      <dd>The offset of the rectangle from the upper-left corner of
      the image.</dd>

      <dt>columns, rows</dt>

      <dd>The width and height of the rectangle.</dd>

      <dt>map</dt>

      <dd>A <code>String</code> reflecting the order of the pixel
      data. <span class="imquote">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).</span></dd>

      <dt>float</dt>

      <dd>If <code>true</code>, the returned array elements will be
      <code>Float</code> values in the range 0..1. If
      <code>false</code>, the returned array elements will be
      <code>Integer</code> values in the range
      0..QuantumRange.</dd>
    </dl>

    <h4>Returns</h4>An array

    <h4>Example</h4>
    <pre>
pixels = f.dispatch(0, 0, f.columns, f.rows, "RGB")
</pre>

    <h4>See also</h4>

    <p><a href="#constitute">constitute</a>, <a href=
    "image2.html#export_pixels">export_pixels</a>, <a href=
    "image2.html#get_pixels">get_pixels</a></p>

    <h4>Magick API</h4>

    <p>ExportImagePixels</p>

    <h4>Note</h4>

    <p>This method is deprecated in ImageMagick. Use the
    <code>export_pixels</code> method instead.</p>
  </div>

  <div class="sig">
    <h3 id="displace">displace</h3>

    <p><span class="arg">img</span>.displace(<span class=
    "arg">displacement_map</span>, <span class=
    "arg">x_amplitude</span>, <span class="arg">y_amplitude</span>,
    <span class="arg">x_offset</span>=0, <span class=
    "arg">y_offset</span>=0) -&gt; <em>image</em><br />
    <span class="arg">img</span>.displace(<span class=
    "arg">displacement_map</span>, <span class=
    "arg">x_amplitude</span>, <span class="arg">y_amplitude</span>,
    <span class="arg">gravity</span>, <span class=
    "arg">x_offset</span>=0, <span class="arg">y_offset</span>=0)
    -&gt; <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Uses <span class="arg">displacement_map</span> to move color
    from <span class="arg">img</span> to the output image.</p>

    <p>This method corresponds to the -displace option of
    ImageMagick's <code>composite</code> command.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>displacement_map</dt>

      <dd>The source image for the composite operation. Either an
      imagelist or an image. If an imagelist, uses the current
      image.</dd>

      <dt>x_amplitude</dt>

      <dd>The maximum displacement on the x-axis.</dd>

      <dt>y_amplitude</dt>

      <dd>The maximum displacement on the y-axis. This argument may
      omitted if no other arguments follow it. In this case the
      default is the value of <span class=
      "arg">x_amplitude</span>.</dd>
    </dl>

    <p>The <code>displace</code> method can be called with or
    without a <span class="arg">gravity</span> argument. The
    <span class="arg">gravity</span>, <span class=
    "arg">x_offset</span>, and <span class="arg">y_offset</span>
    arguments are described in the documentation for <a href=
    "image3.html#watermark">watermark</a>.</p>

    <h4>Example</h4>

    <p>See <a href=
    "http://www.cit.gu.edu.au/~anthony/graphics/imagick6/compose/#displace">
    "Composite Displacement Maps"</a> in Anthony Thyssen's
    <cite><a href=
    "http://www.cit.gu.edu.au/~anthony/graphics/imagick6/">Examples
    of ImageMagick Usage</a></cite>.</p>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>See also</h4>

    <p><a href="#composite">composite</a></p>
  </div>

  <div class="sig">
    <h3 id="display">display</h3>

    <p><span class="arg">img</span>.display [ <span class="arg">{
    optional arguments }</span> ] -&gt; <em>self</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Display the image on an X Window screen. By default, the
    screen is the local monitor. Right-click the window to display
    a context menu.</p>

    <h4>Arguments</h4>

    <p>You can specify additional arguments by setting Info
    attributes in a block associated with the method call.
    Specifically, you can set the name of a non-default X Window
    screen with the <code><a href=
    "info.html#Info.server_name_eq">server_name</a></code>
    attribute.</p>

    <h4>Returns</h4>

    <p>self</p>

    <h4>Note</h4>

    <p>The display method is not supported on native MS
    Windows.</p>

    <h4>Magick API</h4>

    <p>DisplayImages</p>
  </div>

  <div class="sig">
    <h3 id="dissolve">dissolve</h3>

    <p><span class="arg">img</span>.dissolve(<span class=
    "arg">overlay</span>, <span class="arg">src_percentage</span>,
    <span class="arg">dst_percentage</span>, <span class=
    "arg">x_offset</span>=0, <span class="arg">y_offset</span>=0)
    -&gt; <em>image</em><br />
    <span class="arg">img</span>.dissolve(<span class=
    "arg">overlay</span>, <span class="arg">src_percentage</span>,
    <span class="arg">dst_percentage</span>, <span class=
    "arg">gravity</span>, <span class="arg">x_offset</span>=0,
    <span class="arg">y_offset</span>=0) -&gt; <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Composites the <span class="arg">overlay</span> image into
    the target image. The opacity of <span class="arg">img</span>
    is multiplied by <span class="arg">dst_percentage</span> and
    opacity of <span class="arg">overlay</span> is multiplied by
    <span class="arg">src_percentage</span>.</p>

    <p>This method corresponds to the -dissolve option of
    ImageMagick's <code>composite</code> command.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>overlay</dt>

      <dd>The source image for the composite operation. Either an
      imagelist or an image. If an imagelist, uses the current
      image.</dd>

      <dt>src_percentage</dt>

      <dd>Either a non-negative number a string in the form "NN%".
      If <span class="arg">src_percentage</span> is a number it is
      interpreted as a percentage. Both 0.25 and "25%" mean 25%.
      This argument is required.</dd>

      <dt>dst_percentage</dt>

      <dd>Either a non-negative number a string in the form "NN%".
      If <span class="arg">src_percentage</span> is a number it is
      interpreted as a percentage. Both 0.25 and "25%" mean 25%.
      This argument may omitted if no other arguments follow it. In
      this case <span class="arg">img</span>'s opacity is
      unchanged.</dd>
    </dl>

    <p>The <code>dissolve</code> method can be called with or
    without a <span class="arg">gravity</span> argument. The
    <span class="arg">gravity</span>, <span class=
    "arg">x_offset</span>, and <span class="arg">y_offset</span>
    arguments are described in the documentation for <a href=
    "image3.html#watermark">watermark</a>.</p>

    <h4>Example</h4>

    <p>See " <a href=
    "http://www.cit.gu.edu.au/~anthony/graphics/imagick6/compose/#dissolve">
    Dissolve One Image Over Another</a>" in Anthony Thyssen's
    <cite><a href=
    "http://www.cit.gu.edu.au/~anthony/graphics/imagick6/">Examples
    of ImageMagick Usage</a></cite>.</p>

    <p><code>bgnd.dissolve(overlay, 0.50, 1.0)</code></p>

    <p class="rollover"><a href=
    "javascript:popup('dissolve.rb.html')"><img onmouseover=
    "this.src='ex/images/Flower_Hat.jpg'" onmouseout=
    "this.src='ex/dissolve.jpg'" src="ex/dissolve.jpg" alt=
    "dissolve example" title=
    "Click to see the example script" /></a> <img src=
    "ex/images/spin.gif" alt="" class="spin" title=
    "Mouse over the example to see the original image" /></p>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>See also</h4>

    <p><a href="#blend">blend</a>, <a href=
    "#composite">composite</a></p>
  </div>

  <div class="sig">
    <h3 id="distort">distort</h3>

    <p><span class="arg">img</span>.distort(<span class=
    "arg">type</span>, <span class="arg">points</span>,
    <span class="arg">bestfit</span>=<code>false</code>) [
    <span class="arg">{&nbsp;optional arguments&nbsp;}</span> ]
    -&gt; <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Distort an image using the specified distortion type and its
    required arguments. This method is equivalent to ImageMagick's
    -distort option.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>type</dt>

      <dd>
        One of the following values:

        <ul>
          <li>AffineDistortion</li>

          <li>AffineProjectionDistortion</li>

          <li>ArcDistortion</li>

          <li>BarrelDistortion</li>

          <li>BarrelInverseDistortion</li>

          <li>BilinearDistortion</li>

          <li>PerspectiveDistortion</li>

          <li>PerspectiveProjectionDistortion</li>

          <li>PolynomialDistortion</li>

          <li>ScaleRotateTranslateDistortion</li>

          <li>ShepardsDistortion</li>
        </ul>
      </dd>

      <dt>points</dt>

      <dd>An array of numbers. The size of the array depends on the
      distortion type.</dd>

      <dt>bestfit</dt>

      <dd class="imquote">If <span class="arg">bestfit</span> is
      enabled, and the distortion allows it, the destination image
      is adjusted to ensure the whole source image will just fit
      within the final destination image, which will be sized and
      offset accordingly. Also in many cases the virtual offset of
      the source image will be taken into account in the
      mapping.</dd>

      <dt>optional arguments</dt>

      <dd>
        If present, <code>distort</code> yields to a block in which
        you can set optional arguments by calling methods on
        <em>self</em>.

        <dl>
          <dt>self.define("distort:viewport", "WxH+X+Y")</dt>

          <dd>Specify the size and offset of the generated viewport
          image of the distorted image space. W and H are the width
          and height, and X and Y are the offset.</dd>

          <dt>self.define("distort:scale", N)</dt>

          <dd>N is an integer factor. <span class="imquote">Scale
          the output image (viewport or otherwise) by that factor
          without changing the viewed contents of the distorted
          image. This can be used either for 'super-sampling' the
          image for a higher quality result, or for panning and
          zooming around the image (with appropriate viewport
          changes, or post-distort cropping and
          resizing).</span></dd>

          <dt>self.verbose(true)</dt>

          <dd class="imquote">Attempt to output the internal
          coefficients, and the -fx equivalent to the distortion,
          for expert study, and debugging purposes. This many not
          be available for all distorts.</dd>
        </dl>
      </dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Example</h4>
    <pre>
result = img.distort(Magick::ScaleRotateTranslateDistortion, [0]) do
                     self.define "distort:viewport", "44x44+15+0"
                     self.define "distort:scale", 2
                  end
</pre>

    <h4>Note</h4>

    <p>See <a href=
    "http://www.imagemagick.org/Usage/distorts/#distort">Distortion
    Operator</a> in Anthony Thyssen's excellent <a href=
    "http://www.imagemagick.org/Usage/">Examples of ImageMagick
    Usage</a> for more information about distortion operations.</p>
  </div>

  <div class="sig">
    <h3 id="distortion_channel">distortion_channel</h3>

    <p><span class="arg">img</span>.distortion_channel(<span class=
    "arg">reconstructed_image</span>, <span class=
    "arg">metric</span>[, <span class="arg">channel</span>...])
    -&gt; <em>float</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p class="imquote">(C)ompares one or more image channels of an
    image to a reconstructed image and returns the specified
    distortion metric.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>reconstructed_image</dt>

      <dd>Either an imagelist or an image. If an imagelist, uses
      the current image.</dd>

      <dt>metric</dt>

      <dd>The desired distortion metric. A <a href=
      "constants.html#MetricType">MetricType</a> value.</dd>

      <dt>channel...</dt>

      <dd>Zero or more <a href=
      "constants.html##ChannelType">ChannelType</a> values. All the
      specified channels contribute to the comparison and the
      distortion value. If no channels are specified, compares all
      channels.</dd>
    </dl>

    <h4>Returns</h4>

    <p>The distortion metric, represented as a floating-point
    number.</p>

    <h4>Magick API</h4>

    <p>GetImageChannelDistortion</p>

    <h4>See also</h4>

    <p><a href="#compare_channel">compare_channel</a>, <a href=
    "#difference">difference</a></p>
  </div>

  <div class="sig">
    <h3 id="dup">dup</h3>

    <p><span class="arg">img</span>.dup -&gt;
    <em>other_image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Same as <a href="#copy">copy</a>.</p>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>See also</h4>

    <p><a href="#clone">clone</a></p>
  </div>

  <p class="spacer">&nbsp;</p>

  <div class="nav">
    &laquo;&nbsp;<a href="imageattrs.html">Prev</a> | <a href=
    "index.html">Contents</a> | <a href=
    "image2.html">Next</a>&nbsp;&raquo;
  </div>
</body>
</html>