-
Notifications
You must be signed in to change notification settings - Fork 138
/
usage.html
1621 lines (1150 loc) · 52.3 KB
/
usage.html
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
<!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 0.0.0: How to use RMagick</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>
<style type="text/css">
/*<![CDATA[*/
/* Styles local to this page. */
#index {
margin-left: 100px;
margin-right: 100px;
}
#index h4 {
position: relative;
left: -100px;
padding-left: 5px;
background-image: url(ex/images/graydient230x6.gif);
background-repeat: repeat-y;
color: black;
}
/*
* The "ilist" class identifies ImageList methods in the index.
*/
.ilist {
font-weight: bold;
}
.ilist a:link {
font-weight: bold;
text-decoration: none;
}
.ilist a:visited {
font-weight: bold;
color: #7f7fff;
}
.ilist a:hover {
text-decoration: underline;
}
.ilist a:active {
background-color: blue;
color: white;
text-decoration: underline;
}
#axes {
margin-left:100px;
margin-right:100px;
margin-bottom: 1em;
position:relative;
}
#axes div {
position:absolute;
top:0;
left: 260px;
}
#rubyname {
margin-left: auto;
margin-right:auto;
width:300px;
margin-bottom:1em;
}
#footnotes {
border-top: thin solid black;
padding-top: 1em;????
}
#footnotes h5 {
display: none;
}
.sup {
vertical-align: super;
font-size: x-small;
}
/*]]>*/
</style>
</head>
<body>
<h6 id="header">RMagick 0.0.0 User's Guide and Reference</h6>
<div class="nav">
« <a href="index.html">Prev</a> | <a href=
"index.html">Contents</a> | <a href=
"imusage.html">Next</a> »
</div>
<h1>How to use RMagick</h1>
<div id="toc">
<h2>Table of Contents</h2>
<ul style="margin-left: 15px; padding-top: 1em">
<li><a href="#basics">Basic concepts</a></li>
<li><a href="#reading">Reading, writing, and creating
images</a></li>
<li><a href="#displaying">Displaying images</a></li>
<li><a href="#modifying">Examining and modifying
images</a></li>
<li><a href="#marshaling">Marshaling images</a></li>
<li><a href="#drawing_on">Drawing on and adding text to
images</a></li>
<li><a href="#more">Where to go from here</a></li>
</ul>
</div>
<h2 id="basics">Basic concepts</h2>
<p>Let's look at the RMagick equivalent of "Hello, world". This
program reads an image file named "Cheetah.jpg" and
displays<span class="sup"><a href="#display">1</a></span> it on
your monitor</p>
<pre class="example">
1. require 'RMagick'
2. include Magick
3.
4. cat = ImageList.new("Cheetah.jpg")
5. cat.display
6. exit
</pre>
<p class="example_cutline">MS Windows users note: The
<span style="font-style:normal">display</span> method does not
work on native MS Windows. You must use an external viewer to
view the images you create.</p>
<p>Line 1 requires <span class="sup"><a href=
"#rubygems">2</a></span> the RMagick.rb file, which defines the
<b>Magick</b> module. The Magick module contains 3 major classes,
<b>ImageList</b>, <b>Image</b>, and <b>Draw</b>. This section -
<em>Basic Concepts</em> - describes the ImageList and Image
classes. The Draw class is explained in the <em><a href=
"#drawing">Drawing on and adding text to images</a></em> section,
below.</p>
<p>The statement on line 5 creates an <em>imagelist</em> object
and initializes it by reading the <code>Cheetah.jpg</code> file
in the current directory. Line 6 sends the <code>display</code>
method to the object. When you send <code>display</code> to an
imagelist, it causes all the images in the imagelist to be
displayed on the default X Window screen. In this case, the
<code>display</code> method makes a picture of a cheetah appear
on your monitor.</p>
<p>Type this program in and try running it now. The
<code>Cheetah.jpg</code> file is in the <code>ex/images</code>
subdirectory where you installed the RMagick documentation.</p>
<p>The Image and ImageList classes are closely related. An
<em>Image</em> object describes one image or one frame in an
image with multiple frames. (An animated GIF or a Photoshop image
with multiple layers are examples of images with multiple
frames.) You can create a image object from an image file such as
a GIF, PNG, or JPEG. You can create a image from scratch by
specifying its dimensions. You can write an image to disk,
display it on a screen, change its size or orientation, convert
it to another format, or otherwise modify it using one of over
100 methods.</p>
<p>An <em>ImageList</em> object is a <em>list</em> of images. It
contains zero or more images and a <em>scene number</em>. The
scene number indicates the <em>current image</em>. The ImageList
class includes methods that operate on all the images in the
list. Also, with a very few exceptions, any method defined in the
Image class can be used as well. Since Image methods always
operate on a single image, when an Image method is sent to an
imagelist, the ImageList class sends the method to the current
image, that is, the image specified by the scene number.</p>
<p>The ImageList class is a subclass of the Array class, so you
can use most Array methods to change the images in the imagelist.
For example, you can use the <code><<</code> method to add
an image to the list.</p>
<p>Going back to the example, let's make one modification.</p>
<pre class="example">
1. require 'RMagick'
2. include Magick
3.
4. cat = ImageList.new("Cheetah.jpg")
5. smallcat = cat.minify
6. smallcat.display
7. exit
</pre>
<p>The difference is the statement on line 5. This statement
sends the <code>minify</code> method to the imagelist. The
<code>minify</code> method is an Image method that reduces the
size of an image to half its original size. Remember, since
<code>minify</code> is an Image method, the ImageList class sends
<code>minify</code> to the current (and only) image. The return
value is a new image, half the size of the original.</p>
<p>Line 6 demonstrates the Image class's <code>display</code>
method, which displays a single image on the X Window screen.
<code>Image#display</code> makes a picture of a (in this case,
small) cheetah appear on your monitor.</p>
<p>Here's how to write the small cheetah to a file in GIF
format.</p>
<pre class="example">
1. require 'RMagick'
2. include Magick
3.
4. cat = ImageList.new("Cheetah.jpg")
5. smallcat = cat.minify
6. smallcat.display
7. smallcat.write("Small-Cheetah.gif")
8. exit
</pre>
<p>The statement on line 7 writes the image to a file. Notice
that the filename extension is <code>gif</code>. When writing
images, ImageMagick uses the filename extension to determine what
image format to write. In this example, the
<code>Small-Cheetah.gif</code> file will be in the GIF format.
Notice how easy it is to covert an image from one format to
another? (For more details, see <a href=
"imusage.html#formats">Image formats and filenames</a>.)</p>
<p>So why, in the previous example, did I create <code>cat</code>
as an ImageList object containing just one image, instead of
creating an Image object? No reason, really. When you only have
one image to deal with, imagelists and images are pretty much
interchangeable.</p>
<p><em><b>Note:</b></em> In most cases, an Image method does not
modify the image to which it is sent. Instead, the method returns
a new image, suitably modified. For example, the <a href=
"image3.html#resize"><code>resize</code></a> method returns a new
image, sized as specified. The receiver image is unaltered.
(Following the Ruby convention, when a method alters the receiver
object, the method name ends with "!". For example, the <a href=
"image3.html#resize_bang"><code>resize!</code></a> method resizes
the receiver in place.)</p>
<h2 id="reading">Reading, writing, and creating images</h2>
<p>You've already seen that you can create an imagelist and
initialize it by specifying the name of an image file as the
argument to <a href=
"ilist.html#new"><code>ImageList.new</code></a>. In fact,
<code>new</code> can take any number of file name arguments. If
the file contains a single image, <code>new</code> reads the
file, creates an image, and adds it to the imagelist. If the file
is a multi-frame image file, <code>new</code> adds an image for
each frame or layer in the file. Lastly, <code>new</code> changes
the scene number to point to the last image in the imagelist. In
the simple case, <code>new</code> reads a single image from a
file and sets the scene number to 0.</p>
<p>You can also create an image from scratch by calling <a href=
"image1.html#new"><code>Image.new</code></a>. This method takes 2
or 3 arguments. The first argument is the number of columns in
the new image (its width). The second argument is the number of
rows (its height). If present, the 3rd argument is a <a href=
"struct.html#fill"><code>Fill</code></a> object. To add a
"scratch" image to an imagelist, call <a href=
"ilist.html#new_image"><code>ImageList#new_image</code></a>. This
method calls <code>Image.new</code>, adds the new image to the
imagelist, and sets the scene number to point to the new image.
Scratch images are good for <a href="#drawing">drawing</a> on or
creating images by <a href=
"image1.html#composite">compositing</a>.</p>
<p>Like many other methods in the Image and ImageList classes,
<code>Image.new</code> accepts an optional block that can be used
to set additional optional parameters. If the block is present,
<code>Image.new</code> creates a <a href="info.html">parameter
object</a> and yields to the block in the scope of that object.
You set the parameters by calling attribute setter methods
defined in the parameter object's class. For example, you can set
the background color of a new image to red with the
<code>background_color=</code> method, as shown here:</p>
<pre class="example">
require 'RMagick'
include Magick
# Create a 100x100 red image.
f = Image.new(100,100) { self.background_color = "red" }
f.display
exit
</pre>
<p>Within the parameter block you must use <code>self</code> so
that Ruby knows that this statement is a method call, not an
assignment to a variable.</p>
<p>You can create an image by capturing it from the XWindow
screen using <a href=
"image1.html#capture"><code>Image.capture</code></a>. This method
can capture the root window, a window identified by name or ID
number, or perform an interactive capture whereby you designate
the desired window by clicking it or by drawing a rectangle on
the screen with your mouse.</p>
<p>Both the Image class and the ImageList class have
<code>write</code> methods. Both accept a single argument, the
name of the file to be written. <a href=
"image3.html#write"><code>Image#write</code></a> simply writes
the image to a file. Like the <code>Image#read</code> method,
<code>write</code> yields to an optional block that you can use
to set parameters that control how the image is written.</p>
<p>If an ImageList object contains only one image, then <a href=
"ilist.html#write"><code>ImageList#write</code></a> is the same
as <code>Image#write</code>. However, if the imagelist contains
multiple images and the file format (determined by the file name
extension, as I mentioned earlier) supports multi-frame images,
<code>Image#write</code> will automatically create a multi-frame
image file.</p>
<p>For example, the following program reads three GIF files and
then uses <code>ImageList#write</code> to combine all the images
in those files (remember, each input file can contain multiple
images) into one animated GIF file.</p>
<pre class="example">
#! /usr/local/bin/ruby -w
require 'RMagick'
anim = ImageList.new("start.gif", "middle.gif", "finish.gif")
anim.write("animated.gif")
exit
</pre>
<h2 id="displaying">Displaying images</h2>
<p>RMagick defines 3 methods for displaying images and
imagelists. Both the Image class and the ImageList class have a
<code>display</code> method. The <a href=
"image1.html#display"><code>Image#display</code></a> method
displays the image on the default X Window screen. For imagelists
with just one image, <a href=
"ilist.html#display"><code>ImageList#display</code></a> is
identical to <code>Image#display</code>. However, if the
imagelist contains multiple images,
<code>ImageList#display</code> displays each of the images in
turn. With both methods, right-clicking the display window will
produce a menu of other options.</p>
<p>The <a href=
"ilist.html#animate"><code>ImageList#animate</code></a> method
repeatedly cycles through all the images in an imagelist,
displaying each one in turn. You can control the speed of the
animation with the <a href=
"ilist.html#delay_eq"><code>ImageList#delay=</code></a>
method.</p>
<h2 id="modifying">Examining and modifying images</h2>
<p>Once you've created an image or imagelist, what can you do
with it? The Image and ImageList classes define over 100 methods
for examining and modifying images, both individually and in
groups. Remember, unless the ImageList class defines a method
with the same name, you can send any method defined in the Image
class to an instance of the ImageList class. The ImageList class
sends the method to the current image and returns the result.</p>
<p>The methods can be classified into the following broad groups.
ImageList method descriptions look like <span class=
"ilist">this</span>. Some of the listed methods are not available
in some releases of ImageMagick. See the method documentation for
details.</p>
<div id="index">
<h4>Utility methods</h4>
<dl>
<dt><a href="image1.html#spaceship"><=></a></dt>
<dd>Compare 2 images</dd>
<dt class="ilist"><a href=
"ilist.html#spaceship"><=></a></dt>
<dd class="ilist">Compare 2 imagelists</dd>
<dt><a href="image1.html#aref">[ ]</a></dt>
<dd>Reference an image property</dd>
<dt><a href="image1.html#aset">[ ]=</a></dt>
<dd>Set an image property</dd>
<dt><a href="image1.html#add_profile">add_profile</a></dt>
<dd>Add an ICC, IPTC, or generic profile</dd>
<dt><a href="image1.html#changed_q">changed?</a></dt>
<dd>Has the image been changed?</dd>
<dt><a href="image1.html#channel">channel</a></dt>
<dd>Extract a color channel from the image</dd>
<dt><a href=
"image1.html#compare_channel">compare_channel</a></dt>
<dd>Compare one or more channels between two images</dd>
<dt><a href=
"image1.html#channel_depth">channel_depth</a></dt>
<dd>Return the depth of the specified channel or
channels</dd>
<dt><a href=
"image1.html#channel_extrema">channel_extrema</a></dt>
<dd>Return the maximum and minimum intensity values for one
or more channels in the image</dd>
<dt><a href=
"image1.html#check_destroyed">check_destroyed</a></dt>
<dd>Raise an exception if the image has been destroyed</dd>
<dt><a href="image1.html#clone">clone</a></dt>
<dd>Return a shallow copy of the image</dd>
<dt class="ilist"><a href="ilist.html#clone">clone</a></dt>
<dd class="ilist">Return a shallow copy of the imagelist</dd>
<dt><a href=
"image1.html#color_histogram">color_histogram</a></dt>
<dd>Count the number of times each unique color appears in
the image</dd>
<dt><a href="image1.html#combine">combine</a></dt>
<dd>Combines the grayscale value of the pixels in each image
to form a new image.</dd>
<dt><a href="image1.html#copy">copy</a></dt>
<dd>Return a deep copy of the image</dd>
<dt class="ilist"><a href="ilist.html#copy">copy</a></dt>
<dd class="ilist">Return a deep copy of the imagelist</dd>
<dt><a href=
"image1.html#delete_profile">delete_profile</a></dt>
<dd>Delete an ICC, IPTC, or generic profile</dd>
<dt><a href="image1.html#destroy_bang">destroy!</a></dt>
<dd>Return all memory associated with the image to the
system</dd>
<dt><a href="image1.html#destroyed_q">destroyed?</a></dt>
<dd>Has the image has been destroyed?</dd>
<dt><a href="image1.html#difference">difference</a></dt>
<dd>Compute the difference between two images</dd>
<dt><a href=
"image1.html#distortion_channel">distortion_channel</a></dt>
<dd>Compare one or more channels to a reconstructed
image</dd>
<dt><a href="image1.html#dup">dup</a></dt>
<dd>Return a shallow copy of the image</dd>
<dt class="ilist"><a href="ilist.html#dup">dup</a></dt>
<dd class="ilist">Return a shallow copy of the imagelist</dd>
<dt><a href="image2.html#each_pixel">each_pixel</a></dt>
<dd>Iterate over all the pixels in the image</dd>
<dt><a href="image2.html#each_profile">each_profile</a></dt>
<dd>Iterate over all the profiles associated with the
image</dd>
<dt><a href=
"image2.html#export_pixels">export_pixels</a></dt>
<dd>Extract pixel data from the image into an array</dd>
<dt><a href=
"image2.html#export_pixels_to_str">export_pixels_to_str</a></dt>
<dd>Extract pixel data from the image into a string</dd>
<dt><a href=
"image2.html#find_similar_region">find_similar_region</a></dt>
<dd>Search for a rectangle matching the target</dd>
<dt><a href=
"image2.html#get_exif_by_entry">get_exif_by_entry</a>,
<a href=
"image2.html#get_exif_by_number">get_exif_by_number</a></dt>
<dd>Get one or more EXIF property values for the image</dd>
<dt><a href="image2.html#get_pixels">get_pixels</a></dt>
<dd>Copy a region of pixels from the image</dd>
<dt><a href="image2.html#gray_q">gray?</a></dt>
<dd>Are all the pixels in the image gray?</dd>
<dt><a href="image2.html#histogram_q">histogram?</a></dt>
<dd>Does the image have <= 1024 unique colors??</dd>
<dt><a href=
"image2.html#import_pixels">import_pixels</a></dt>
<dd>Replace pixels in the image with pixel data from an
array</dd>
<dt><a href="image2.html#monochrome_q">monochrome?</a></dt>
<dd>Are all the pixels in the image either black or
white?</dd>
<dt><a href="image2.html#opaque_q">opaque?</a></dt>
<dd>Are all the pixels in the image opaque?</dd>
<dt><a href="image3.html#palette_q">palette?</a></dt>
<dd>Is the image a PseudoClass type image with 256 colors or
less?</dd>
<dt><a href="image3.html#preview">preview</a></dt>
<dd>Show the effect of a transformation method on the
image</dd>
<dt><a href="image3.html#profile_bang">profile!</a></dt>
<dd>Add or remove an ICM, IPTC, or generic profile from the
image</dd>
<dt><a href="image3.html#properties">properties</a></dt>
<dd>Iterate over all the properties associated with the
image</dd>
<dt><a href="image3.html#separate">separate</a></dt>
<dd>Construct a grayscale image for each channel
specified</dd>
<dt><a href=
"image3.html#set_channel_depth">set_channel_depth</a></dt>
<dd>Set the specified channel's depth</dd>
<dt><a href="image3.html#signature">signature</a></dt>
<dd>Compute the 64-byte message signature for the image</dd>
<dt><a href="image3.html#store_pixels">store_pixels</a></dt>
<dd>Replace a region of pixels in the image</dd>
<dt><a href="image3.html#strip_bang">strip!</a></dt>
<dd>Strip the image of all comments and profiles</dd>
<dt><a href=
"image3.html#sync_profiles">sync_profiles</a></dt>
<dd>Synchronize the image properties with the image
profiles</dd>
<dt><a href=
"image3.html#unique_colors">unique_colors</a></dt>
<dd>Construct an image from the unique colors</dd>
<dt><a href="image3.html#view">view</a></dt>
<dd>Access pixels by their coordinates.</dd>
</dl>
<h4>Reduce the number of colors</h4>
<dl>
<dt><a href=
"image1.html#compress_colormap_bang">compress_colormap!</a></dt>
<dd>Remove duplicate or unused entries in the image's
colormap</dd>
<dt><a href=
"image2.html#ordered_dither">ordered_dither</a></dt>
<dd>Dither the image to a predefined pattern</dd>
<dt><a href="image3.html#posterize">posterize</a></dt>
<dd>Reduce the number of colors for a "poster" effect</dd>
<dt><a href="image3.html#quantize">quantize</a></dt>
<dd>Choose a fixed number of colors to represent the
image</dd>
<dt class="ilist"><a href=
"ilist.html#quantize">quantize</a></dt>
<dd class="ilist">Choose a fixed number of colors to
represent all the images in the imagelist</dd>
<dt><a href="image3.html#remap">remap</a></dt>
<dd>Change the colors in the image to the colors in a
reference image.</dd>
<dt class="ilist"><a href="ilist.html#remap">remap</a></dt>
<dd class="ilist">Change the images in the imagelist to use a
common color map.</dd>
</dl>
<h4>Resize</h4>
<dl>
<dt><a href=
"image1.html#change_geometry">change_geometry</a></dt>
<dd>Compute a new constrained size for the image</dd>
<dt><a href=
"image2.html#liquid_rescale">liquid_rescale</a></dt>
<dd>Rescale image with seam-carving</dd>
<dt><a href="image2.html#magnify">magnify</a></dt>
<dd>Double the size of the image</dd>
<dt><a href="image2.html#minify">minify</a></dt>
<dd>Halve the size of the image</dd>
<dt><a href="image3.html#resample">resample</a></dt>
<dd>Resample the image to the specified horizontal and
vertical resolution</dd>
<dt><a href="image3.html#resize">resize</a></dt>
<dd>Resize the image using a filter</dd>
<dt><a href=
"image1.html#resize_to_fill">resize_to_fill</a></dt>
<dd>Resize and crop while retaining the aspect ratio</dd>
<dt><a href=
"image3.html#resize_to_fit">resize_to_fit</a></dt>
<dd>Resize the image retaining the aspect ratio</dd>
<dt><a href="image3.html#sample">sample</a></dt>
<dd>Resize the image using pixel sampling</dd>
<dt><a href="image3.html#scale">scale</a></dt>
<dd>Resize the image</dd>
<dt><a href="image3.html#thumbnail">thumbnail</a></dt>
<dd>Quickly create a thumbnail of the image</dd>
</dl>
<h4>Change colors or opacity</h4>
<dl>
<dt><a href=
"image1.html#color_fill_to_border">color_fill_to_border</a></dt>
<dd>Change the color of neighboring pixels. Stop at the
image's border color.</dd>
<dt><a href=
"image1.html#color_floodfill">color_floodfill</a></dt>
<dd>Change the color of neighboring pixels that are the same
color</dd>
<dt><a href="image1.html#colormap">colormap</a></dt>
<dd>Get or set a color in the image's colormap</dd>
<dt><a href="image1.html#color_point">color_point</a></dt>
<dd>Change the color of a single pixel in the image</dd>
<dt><a href=
"image1.html#color_reset_bang">color_reset!</a></dt>
<dd>Set the entire image to a single color</dd>
<dt><a href=
"image1.html#cycle_colormap">cycle_colormap</a></dt>
<dd>Displace the image's colormap</dd>
<dt><a href="image2.html#erase_bang">erase!</a></dt>
<dd>Set the entire image to a single color</dd>
<dt><a href=
"image2.html#matte_fill_to_border">matte_fill_to_border</a></dt>
<dd>Make transparent neighboring pixels. Stop at the image's
border color.</dd>
<dt><a href=
"image2.html#matte_floodfill">matte_floodfill</a></dt>
<dd>Make transparent neighboring pixels that are the same
color</dd>
<dt><a href="image2.html#matte_point">matte_point</a></dt>
<dd>Make a single pixel transparent</dd>
<dt><a href=
"image2.html#matte_reset_bang">matte_reset!</a></dt>
<dd>Make the entire image transparent</dd>
<dt><a href="image2.html#opaque">opaque</a>, <a href=
"image2.html#opaque_channel">opaque_channel</a></dt>
<dd>Change all pixels from the specified color to a new
color</dd>
<dt><a href="image3.html#pixel_color">pixel_color</a></dt>
<dd>Get or set the color of a single pixel</dd>
<dt><a href="image3.html#splice">splice</a></dt>
<dd>Splice a solid color into the image.</dd>
<dt><a href=
"image3.html#texture_fill_to_border">texture_fill_to_border</a></dt>
<dd>Replace neighbor pixels with pixels from a texture image.
Stop at the image's border color.</dd>
<dt><a href=
"image3.html#texture_floodfill">texture_floodfill</a></dt>
<dd>Replace neighboring pixels that are the same color with
pixels from a texture image</dd>
<dt><a href=
"image3.html#paint_transparent">paint_transparent</a>,
<a href="image3.html#transparent">transparent</a></dt>
<dd>Change the opacity value of pixels having the specified
color</dd>
<dt><a href=
"image3.html#transparent_chroma">transparent_chroma</a></dt>
<dd>Change the opacity value of pixels within the specified
range</dd>
</dl>
<h4>Rotate, flip, or shear</h4>
<dl>
<dt><a href=
"image1.html#affine_transform">affine_transform</a></dt>
<dd>Transform the image as dictated by an affine matrix</dd>
<dt><a href="image1.html#auto_orient">auto_orient</a></dt>
<dd>Rotate or flip the image using the EXIF orientation
tag</dd>
<dt><a href="image1.html#deskew">deskew</a></dt>
<dd>Straighten the image</dd>
<dt><a href="image2.html#flip">flip</a></dt>
<dd>Create a vertical mirror image</dd>
<dt><a href="image2.html#flop">flop</a></dt>
<dd>Create a horizontal mirror image</dd>
<dt><a href="image3.html#rotate">rotate</a></dt>
<dd>Rotate the image by the specified angle</dd>
<dt><a href="image3.html#shear">shear</a></dt>
<dd>Shear the image along the X or Y axis, creating a
parallelogram</dd>
<dt><a href="image3.html#transpose">transpose</a></dt>
<dd>Create a horizontal mirror image</dd>
<dt><a href="image3.html#transverse">transverse</a></dt>
<dd>Create a vertical mirror image</dd>
</dl>
<h4>Composite</h4>
<dl>
<dt><a href=
"image1.html#add_compose_mask">add_compose_mask</a></dt>
<dd>Add a mask to the background image in a composite
operation</dd>
<dt class="ilist"><a href=
"ilist.html#average">average</a></dt>
<dd class="ilist">Average all the images in the imagelist
into a single image</dd>
<dt><a href="image1.html#blend">blend</a></dt>
<dd>Blend two images together</dd>
<dt><a href="image1.html#composite">composite</a></dt>
<dd>Composite a source image onto the image</dd>
<dt><a href=
"image1.html#composite_affine">composite_affine</a></dt>
<dd>Composite a source image onto the image as dictated by an
affine matrix</dd>
<dt class="ilist"><a href=
"ilist.html#composite_layers">composite_layers</a></dt>
<dd class="ilist">Composite two imagelists</dd>
<dt><a href=
"image1.html#composite_mathematics">composite_mathematics</a></dt>
<dd>Merge a source image onto the image according to a
formula.</dd>
<dt><a href=
"image1.html#composite_tiled">composite_tiled</a></dt>
<dd>Composite multiple copies of an image over another
image</dd>
<dt><a href=
"image1.html#delete_compose_mask">delete_compose_mask</a></dt>
<dd>Delete a compose mask</dd>
<dt><a href="image1.html#displace">displace</a></dt>
<dd>Distort the image using a displacement map</dd>
<dt><a href="image1.html#dissolve">dissolve</a></dt>
<dd>Dissolve two images into each other</dd>
<dt><a href="image2.html#extent">extent</a></dt>
<dd>Extend or crop the image over the background color.</dd>
<dt><a href="image3.html#watermark">watermark</a></dt>
<dd>Composite a watermark onto the image</dd>
</dl>
<h4>Transform</h4>
<dl>
<dt class="ilist"><a href="ilist.html#append">append</a></dt>
<dd class="ilist">Append all the images in the imagelist into
a single image</dd>
<dt><a href="image1.html#chop">chop</a></dt>
<dd>Chop a region from the image</dd>
<dt class="ilist"><a href=
"ilist.html#coalesce">coalesce</a></dt>
<dd class="ilist">Merge successive images in the imagelist
into a new imagelist</dd>
<dt><a href="image1.html#crop">crop</a></dt>
<dd>Extract a region from the image</dd>
<dt><a href="image1.html#decipher">decipher</a></dt>
<dd>Convert enciphered pixels to plain pixels</dd>
<dt class="ilist"><a href=
"ilist.html#deconstruct">deconstruct</a></dt>
<dd class="ilist">Construct a new imagelist containing images
that include only the changed pixels between each image and
its successor</dd>
<dt><a href="image1.html#distort">distort</a></dt>
<dd>Distort the image</dd>
<dt><a href="image2.html#encipher">encipher</a></dt>
<dd>Encipher plain pixels</dd>
<dt><a href="image2.html#excerpt">excerpt</a></dt>
<dd>Excerpt a rectangle from the image</dd>
<dt class="ilist"><a href=
"ilist.html#flatten_images">flatten_images</a></dt>
<dd class="ilist">Merge all the images in the imagelist into
a single image</dd>
<dt class="ilist"><a href="ilist.html#mosaic">mosaic</a></dt>
<dd class="ilist">Inlay all the images in the imagelist into
a single image</dd>
<dt class="ilist"><a href=
"ilist.html#optimize_layers">optimize_layers</a></dt>
<dd class="ilist">Optimize or compare image layers</dd>
<dt><a href=
"image1.html#resize_to_fill">resize_to_fill</a></dt>
<dd>Resize and crop while retaining the aspect ratio</dd>
<dt><a href="image3.html#roll">roll</a></dt>
<dd>Offset the image</dd>
<dt><a href="image3.html#shave">shave</a></dt>
<dd>Shave regions from the edges of the image</dd>
<dt><a href="image3.html#trim">trim</a></dt>
<dd>Remove borders from the edges of the image</dd>
</dl>
<h4>Enhance</h4>
<dl>
<dt><a href="image1.html#clut_channel">clut_channel</a></dt>
<dd>Replace the channel values in the image with a lookup of
its replacement value in an LUT gradient image.</dd>