-
Notifications
You must be signed in to change notification settings - Fork 2
/
ilist.html
1901 lines (1343 loc) · 63.7 KB
/
ilist.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" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta name="generator" content="HTML Tidy for Linux/x86 (vers 6 November 2007), see www.w3.org" />
<title>RMagick 6.0.1: class ImageList</title>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
<meta name="GENERATOR" content="Quanta Plus" />
<meta name="Copyright" content="Copyright (C) 2005 by Timothy P. Hunter" />
<link rel="stylesheet" type="text/css" href="css/doc.css" />
<script type="text/javascript" src="scripts/doc.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github.min.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
<script>
hljs.configure({ cssSelector: "pre" });
hljs.highlightAll();
</script>
</head>
<body>
<h6 id="header">RMagick 6.0.1 User's Guide and Reference</h6>
<div class="nav">« <a href="magick.html">Prev</a> | <a href="index.html">Contents</a> | <a href="imageattrs.html">Next</a> »</div>
<h1>
class ImageList<br />
<span class="mixin">mixes in Comparable, Enumerable</span>
</h1>
<div id="toc">
<h2>Table of Contents</h2>
<h3>class methods</h3>
<ul>
<li><a href="#new">new</a></li>
</ul>
<h3>attributes</h3>
<ul>
<li><a href="#delay_eq">delay=</a></li>
<li><a href="#iterations_eq">iterations=</a></li>
<li><a href="#length">length</a></li>
<li><a href="#scene">scene, scene=</a></li>
<li><a href="#ticks_per_second_eq">ticks_per_second=</a></li>
</ul>
<h3>instance methods</h3>
<div class="toccol">
<ul>
<li><a href="#array_methods">Array methods</a></li>
<li><a href="#spaceship"><=></a></li>
<li><a href="#animate">animate</a></li>
<li><a href="#append">append</a></li>
<li><a href="#average">average</a></li>
<li><a href="#clone">clone</a></li>
<li><a href="#coalesce">coalesce</a></li>
<li><a href="#composite_layers">composite_layers</a></li>
<li><a href="#copy">copy</a></li>
<li><a href="#cur_image">cur_image</a></li>
</ul>
</div>
<div class="toccol">
<ul>
<li><a href="#deconstruct">deconstruct</a></li>
<li><a href="#dup">dup</a></li>
<li><a href="#display">display</a></li>
<li><a href="#flatten_images">flatten_images</a></li>
<li><a href="#from_blob">from_blob</a></li>
<li><a href="#fx">fx</a></li>
<li><a href="#inspect">inspect</a></li>
<li><a href="#montage">montage</a></li>
<li><a href="#morph">morph</a></li>
</ul>
</div>
<div class="toccol">
<ul>
<li><a href="#mosaic">mosaic</a></li>
<li><a href="#new_image">new_image</a></li>
<li><a href="#optimize_layers">optimize_layers</a></li>
<li><a href="#ping">ping</a></li>
<li><a href="#quantize">quantize</a></li>
<li><a href="#read">read</a></li>
<li><a href="#remap">remap</a></li>
<li><a href="#to_a">to_a</a></li>
<li><a href="#to_blob">to_blob</a></li>
<li><a href="#write">write</a></li>
</ul>
</div>
</div>
<h2 class="methods">class methods</h2>
<div class="sig">
<h3 id="new">new</h3>
<p>
Magick::ImageList.new
<span class="arg">[ { optional arguments } ]</span> -> <em>imagelist</em><br />
Magick::ImageList.new(<span class="arg">filename[, filename...]]</span>) <span class="arg">[ { optional arguments } ]</span> ->
<em>imagelist</em>
</p>
</div>
<div class="desc">
<h4>Description</h4>
<p>
Creates a new imagelist. If one or more image filenames are specified, opens and reads the files, adding a new image for each image in the image
file(s). Sets the scene number to the index of the last image, or
<code>nil</code> if no filenames are specified.
</p>
<h4>Arguments</h4>
<p>
Zero or more image file names. You can also specify optional arguments to be used when reading the file(s) by setting
<a href="info.html">Image::Info</a> attributes in the optional block.
</p>
<h4>Returns</h4>
<p>
A new imagelist. The imagelist contains an Image object for each image in the specified files. A file can contain more than one image. For example, new
will create an image for each frame in an animated GIF or each layer in a multi-layer Photoshop file.
</p>
<h4>Example</h4>
<pre class="language-ruby">
i = Magick::ImageList.new
i = Magick::ImageList.new("Button_A.gif", "Cheetah.jpg")
</pre
>
</div>
<h2 class="methods">attributes</h2>
<div class="sig">
<h3 id="delay_eq">delay=</h3>
<p><span class="arg">ilist.</span>delay=<em>n</em></p>
</div>
<div class="desc">
<h4>Description</h4>
<p>
In conjunction with
<a href="#ticks_per_second_eq">ticks_per_second</a> sets the length of time between each image in an animation. The <code>delay=</code> attribute
assigns the same delay to all the images in the ilist. Use <a href="imageattrs.html#delay">Image#delay=</a> to set different delay values on individual
images.
</p>
<h4>Arguments</h4>
<p>An integer value representing the number of ticks that must elapse between each image in an animation.</p>
<h4>Returns</h4>
<p>self</p>
<h4>Example</h4>
<pre class="language-ruby">ilist.delay = 20 # delay 1/5 of a second between images.</pre>
<h4>See also</h4>
<p><a href="imageattrs.html#delay">Image#delay=</a></p>
</div>
<div class="sig">
<h3 id="iterations_eq">iterations=</h3>
<p><span class="arg">ilist.</span>iterations=<em>n</em></p>
</div>
<div class="desc">
<h4>Description</h4>
<p>Sets the number of times an animated image should loop.</p>
<p>
The <a href="#animate">animate</a> method and the ImageMagick animate command does not respect this number. Both will repeat the animation until you
stop them. Mozilla (and presumably Netscape) do respect the value..
</p>
<h4>Arguments</h4>
<p>The number of iterations.</p>
<h4>Returns</h4>
<p>self</p>
<h4>Example</h4>
<pre class="language-ruby">ilist.iterations = 10</pre>
</div>
<div class="sig">
<h3 id="length">length</h3>
<p><span class="arg">ilist.</span>length -> <em>integer</em></p>
</div>
<div class="desc">
<h4>Description</h4>
<p>Returns the number of images in the imagelist.</p>
<h4>Example</h4>
<pre class="language-ruby">
i = Magick::ImageList.new("images/Button_A.gif", "images/Button_B.gif")
i.length #=> 2
</pre
>
</div>
<div class="sig">
<h3 id="scene">scene, scene=</h3>
<p>
<span class="arg">ilist</span>.scene -> <em>integer</em><br />
<span class="arg">ilist</span>.scene = <em>integer</em>
</p>
</div>
<div class="desc">
<h4>Description</h4>
<p>Get/set the current <em>scene number</em>. The scene number indicates the image to which <a href="image1.html">Image</a> methods are sent.</p>
<h4>Example</h4>
<pre class="language-ruby">
ilist.scene = 10
ilist.scene #=> 10
</pre
>
</div>
<div class="sig">
<h3 id="ticks_per_second_eq">ticks_per_second=</h3>
<p><span class="arg">ilist</span>.ticks_per_second = <em>integer</em></p>
</div>
<div class="desc">
<h4>Description</h4>
<p>
Used in conjunction with <a href="#delay_eq">delay</a> to establish the elapsed time between frames in an animation. By default the number of ticks per
second is 100.
</p>
<h4>Example</h4>
<pre class="language-ruby">ilist.ticks_per_second = 1000</pre>
</div>
<h2 class="methods">instance methods</h2>
<div class="sig">
<h3 id="array_methods">Array methods</h3>
<p> </p>
</div>
<div class="desc">
<h4>Description</h4>
<p>
<code>ImageList</code> delegates many methods to <code>Array</code>, so you can manipulate the images in an imagelist using almost all of the methods
defined in <code>Array</code>. Typically these methods also update the scene number. The scene number will never exceed the number of images in the
list, and if the imagelist contains no images the scene number will be <code>nil</code>.
</p>
<p>Array methods that would normally return an array return an ImageList.</p>
<p>
Most array methods keep the current image current. If the method moves the current image to a new position, the method updates the scene number to the
new index. If the method deletes the current image, the scene number is set to the last image in the list. The following table lists the methods that do
not follow these rules.
</p>
<table summary="array method affect on scene number" class="simple_table">
<caption>
Array method behavior
</caption>
<thead>
<tr>
<th>Array method</th>
<th>scene number will be...</th>
</tr>
</thead>
<tbody>
<tr>
<td><<</td>
<td>set to index the last image in the list</td>
</tr>
<tr>
<td>clear</td>
<td>set to <code>nil</code></td>
</tr>
<tr>
<td>concat</td>
<td>set to index the last image in the list</td>
</tr>
<tr>
<td>push</td>
<td>set to index the last image in the list</td>
</tr>
<tr>
<td>unshift</td>
<td>set to 0</td>
</tr>
</tbody>
</table>
<p>
Adding anything other than a image to an imagelist has undefined results. Most of the time RMagick will raise an ArgumentError exception. For example,
if you call <code>collect!</code> on an imagelist you should make sure that the members of the imagelist remain images. If you need to replace images in
an imagelist with non-image objects, convert the imagelist to an array with the <code>to_a</code> method, then modify the array.
</p>
<p>
The <code>assoc</code>, <code>flatten</code>, <code>flatten!</code>, <code>join</code>, <code>pack</code>, and <code>rassoc</code> methods are not
defined in the ImageList class.
</p>
<h4>Example</h4>
<p>Add noise to a model image. Append the resulting image to the imagelist in "example". (See the <code>demo.rb</code> example.)</p>
<pre class="language-ruby">
example = Magick::ImageList.new
model = Magick::ImageList.new "model.miff"
example << model.add_noise Magick::LaplacisanNoise
</pre
>
<h4>See also</h4>
<p><a href="#scene">scene</a>, <a href="#scene">scene=</a></p>
</div>
<div class="sig">
<h3 id="spaceship"><=></h3>
<p><span class="arg">ilist</span> <=> <span class="arg">other_imagelist</span> -> -1, 0, 1</p>
</div>
<div class="desc">
<h4>Description</h4>
<p>
Compares two imagelists and returns -1, 0, or 1 if the receiver is less than, equal to, or greater than the other imagelist. The comparison between the
receiver (a) and the other (b) is performed this way:
</p>
<ol>
<li>
For all images <code>n</code>, if the result of <code>a[n] <=> b[n]</code> is not 0 then that is the result of
a <=> b. Individual images are compared by comparing their <a href="image3.html#signature">signatures</a>.
</li>
<li>If <code>a.scene <=> b.scene</code> is not 0, returns the result</li>
<li>Returns <code>a.length <=> b.length</code></li>
</ol>
<p><code>ImageList</code> mixes in the <code>Comparable</code> module.</p>
<h4>See also</h4>
<p>
<a href="image1.html#spaceship">Image#<=></a>,
<a href="image3.html#signature">signature</a>
</p>
</div>
<div class="sig">
<h3 id="animate">animate</h3>
<p>
<span class="arg">ilist.</span>animate(<span class="arg">[delay]</span>) <span class="arg">[ { optional arguments } ]</span> ->
<em>self</em>
</p>
</div>
<div class="desc">
<h4>Description</h4>
<p>
Animate the images to an X Window screen. By default displays to the local screen. You can specify a different screen by assigning the name to the
<code>server_name</code> attribute in the optional arguments block.
</p>
<h4>Returns</h4>
<p>self</p>
<h4>Example</h4>
<pre class="language-ruby">
ilist.animate
ilist.animate { |options| options.server_name = "other:0.0" }
</pre
>
<h4>See also</h4>
<p><a href="#display">display</a></p>
<h4>Note</h4>
<p>The animate method is not supported on native MS Windows.</p>
<h4>Magick API</h4>
<p>AnimateImages</p>
</div>
<div class="sig">
<h3 id="append">append</h3>
<p><span class="arg">ilist.</span>append(<code>true</code> or <code>false</code>) -> <em>image</em></p>
</div>
<div class="desc">
<h4>Description</h4>
<p>
Append all the images in the imagelist, either vertically or horizontally. If the images are not of the same width, any narrow images will be expanded
to fit using the background color.
</p>
<h4>Arguments</h4>
<p>If <code>true</code>, rectangular images are stacked top-to-bottom, otherwise left-to-right.</p>
<h4>Returns</h4>
<p>A image composed of all the images in the imagelist.</p>
<h4>Magick API</h4>
<p>AppendImages</p>
</div>
<div class="sig">
<h3 id="average">average</h3>
<p><span class="arg">ilist.</span>average -> <em>image</em></p>
</div>
<div class="desc">
<h4>Description</h4>
<p>Averages all the images together. Each image in the image must have the same width and height.</p>
<h4>Returns</h4>
<p>A single image representing the average of all the images in the imagelist.</p>
<h4>Example</h4>
<p class="rollover">
<a href="javascript:popup('average.rb.html')">
<!-- This img tag displays the original image when the mouse is over -->
<img
style="display: none"
id="notaveraged"
onmouseout="this.style.display='none'; averaged.style.display=''; averagedspin.style.display='';"
title="Click to see the example script"
src="ex/average_before.gif"
alt="average example" /><!--
This img tag displays the averaged image when the mouse is not over
--><img
style="display:"
id="averaged"
onmouseover="this.style.display='none'; notaveraged.style.display=''; averagedspin.style.display='none';"
src="ex/average_after.gif"
alt="average example"
/></a>
<img
src="ex/images/spin.gif"
alt=""
class="spin"
style="left: 131px; display:"
id="averagedspin"
title="Mouse over the example to see the 3 original images"
/>
</p>
<h4>Magick API</h4>
<p>AverageImages</p>
</div>
<div class="sig">
<h3 id="clone">clone</h3>
<p><span class="arg">ilist</span>.clone -> <em>other_imagelist</em></p>
</div>
<div class="desc">
<h4>Description</h4>
<p>Same as <a href="#dup">dup</a>, but the frozen state of the original is propagated to the copy.</p>
<h4>Returns</h4>
<p>A new imagelist</p>
<h4>See also</h4>
<p><a href="#copy">copy</a></p>
</div>
<div class="sig">
<h3 id="coalesce">coalesce</h3>
<p><span class="arg">ilist.</span>coalesce -> <em>imagelist</em></p>
</div>
<div class="desc">
<h4>Description</h4>
<p>Merges all the images in the imagelist into a new imagelist. Each image in the new imagelist is formed by flattening all the previous images.</p>
<p>
The length of time between images in the new image is specified by the
<a href="imageattrs.html#delay">delay</a> attribute of the input image. The position of the image on the merged images is specified by the
<a href="imageattrs.html#page">page</a> attribute of the input image.
</p>
<h4>Returns</h4>
<p>A new imagelist</p>
<h4>Example</h4>
<p>This example is an animated GIF created by coalescing 25 small images in a grid. Mouse over the image to start the animation.</p>
<p class="rollover">
<a href="javascript:popup('coalesce.rb.html')"
><img
onmouseover="this.src='ex/coalesce_anim.gif'"
onmouseout="this.src='ex/coalesce.gif'"
src="ex/coalesce.gif"
alt="coalesce example"
title="Click the image to see the example script" /></a
><img src="ex/images/spin.gif" alt="" class="spin" style="left: 165px" title="Mouse over the example to see the animation" />
</p>
<h4>See also</h4>
<p>
<a href="#flatten_images">flatten_images</a>,
<a href="#optimize_layers">optimize_layers</a>
</p>
<h4>Magick API</h4>
<p>CoalesceImages</p>
</div>
<div class="sig">
<h3 id="composite_layers">composite_layers</h3>
<p>
<span class="arg">destination_list</span>.composite_layers(<span class="arg">source_list</span>,
<span class="arg">operator</span>=<code>OverCompositeOp</code>) ->
<em>imagelist</em>
</p>
</div>
<div class="desc">
<h4>Description</h4>
<p>
An image from <span class="arg">source_list</span> is composited over an image from <span class="arg">destination_list</span> until one list is
finished. Use the <a href="imageattrs.html#geometry">geometry</a> and <a href="imageattrs.html#gravity">gravity</a> attributes of the first image in
<span class="arg">destination_list</span> to position the source images over the destination images.
<span class="imquote"
>Unlike a normal composite operation, the canvas offset is also included to the composite positioning. If one of the image lists only contains one
image, that image is applied to all the images in the other image list, regardless of which list it is. In this case it is the image meta-data of the
list which preserved.</span
>
</p>
<h4>Arguments</h4>
<p>
The optional <span class="arg">operator</span> argument specifies a <a href="constants.html#CompositeOperator">CompositeOperator</a> to use for the
compositing operations.
</p>
<h4>Returns</h4>
<p>An imagelist</p>
<h4>Example</h4>
<p>This example is an animated GIF. Mouse over the image to start the animation.</p>
<p class="rollover">
<a href="javascript:popup('composite_layers.rb.html')"
><img
onmouseover="this.src='ex/composite_layers.gif'"
onmouseout="this.src='ex/composite_layers1.gif'"
src="ex/composite_layers1.gif"
alt="composite_layers example"
title="Click the image to see the example script" /></a
><img src="ex/images/spin.gif" alt="" class="spin" style="left: 105px" title="Mouse over the example to see the animation" />
</p>
<h4>Notes</h4>
<p>
This method is equivalent to the <code>-layers Composite</code> option of ImageMagick's <code>convert</code> command. See the
<a href="https://www.imagemagick.org/Usage/anim_mods/#composite">Layers Composition</a>
section in
<a href="https://www.imagemagick.org/Usage/">Examples of ImageMagick Usage</a>
for more information.
</p>
<h4>See also</h4>
<p><a href="#optimize_layers">optimize_layers</a></p>
</div>
<div class="sig">
<h3 id="copy">copy</h3>
<p><span class="arg">ilist.</span>copy -> <em>other_imagelist</em></p>
</div>
<div class="desc">
<h4>Description</h4>
<p>Creates a deep copy of the imagelist. The new imagelist contains a copy of all the images in the original imagelist.</p>
<h4>Returns</h4>
<p>An imagelist</p>
<h4>Example</h4>
<pre class="language-ruby">imagelist2 = imagelist1.copy</pre>
<h4>See also</h4>
<p>
<a href="image1.html#copy">Image#copy</a>, <a href="#clone">clone</a>,
<a href="#dup">dup</a>
</p>
</div>
<div class="sig">
<h3 id="cur_image">cur_image</h3>
<p><span class="arg">ilist.</span>cur_image -> <em>image</em></p>
</div>
<div class="desc">
<h4>Description</h4>
<p>Retrieves the image indexed by <a href="#scene">scene</a>. Raises <code>IndexError</code> if there are no images in the list.</p>
<p>
Both the ImageList class and the Image class support the
<code>cur_image</code> method. Of course, in the Image class, <code>cur_image</code> simply returns <code>self</code>. When a method accepts either an
image or a imagelist as an argument, it sends the <code>cur_image</code> method to the argument to get the current image.
</p>
<h4>Returns</h4>
<p>An image</p>
</div>
<div class="sig">
<h3 id="deconstruct">deconstruct</h3>
<p><span class="arg">ilist.</span>deconstruct -> <em>imagelist</em></p>
</div>
<div class="desc">
<h4>Description</h4>
<p>
This method constructs a new imagelist containing images that include only the changed pixels between each image and its successor. The resulting
imagelist usually produces a much smaller file.
</p>
<p>
The <code>deconstruct</code> method starts by copying the first image in the list to the output imagelist. Then, for each pair of images,
<code>deconstruct</code> computes the smallest rectangle that encompasses all the changes between the first and second image and stores just the changed
rectangle of the second image, along with the offset of the rectangle relative to the boundary of the first image.
</p>
<h4>Returns</h4>
<p>A new imagelist</p>
<h4>Magick API</h4>
<p>DeconstructImages</p>
<h4>See also</h4>
<p><a href="#optimize_layers">optimize_layers</a></p>
</div>
<div class="sig">
<h3 id="dup">dup</h3>
<p><span class="arg">ilist</span>.dup -> <em>other_imagelist</em></p>
</div>
<div class="desc">
<h4>Description</h4>
<p>
Makes a <em>shallow</em> copy of the receiver. The image elements in the new imagelist are references to the image elements in the original imagelist,
not copies.
</p>
<h4>See also</h4>
<p><a href="#copy">copy</a>, <a href="#clone">clone</a></p>
</div>
<div class="sig">
<h3 id="display">display</h3>
<p>
<span class="arg">ilist.</span>display <span class="arg">[ { optional arguments } ]</span> ->
<em>self</em>
</p>
</div>
<div class="desc">
<h4>Description</h4>
<p>
Displays the images in the imagelist to any X Window screen. By default displays to the local screen. You can specify a different screen by assigning
the name to the <code>server_name</code> attribute in the optional arguments block.
</p>
<h4>Returns</h4>
<p>self</p>
<h4>See also</h4>
<p>
<a href="#animate">animate</a>,
<a href="image1.html#display">Image#display</a>
</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="flatten_images">flatten_images</h3>
<p><span class="arg">ilist.</span>flatten_images -> <em>image</em></p>
</div>
<div class="desc">
<h4>Description</h4>
<p>
Combines all the images in the imagelist into a single image by overlaying each successive image onto the preceding images. If a image has transparent
areas, the underlying image will show through. Use the
<a href="imageattrs.html#page">page</a> attribute to specify the position of each image with respect to the preceding images.
</p>
<p class="imquote">This is useful for combining Photoshop layers into a single image.</p>
<h4>Returns</h4>
<p>An image</p>
<h4>Example</h4>
<p>
<a href="javascript:popup('flatten_images.rb.html')"
><img alt="flatten_images example" src="ex/flatten_images.gif" title="Click to see the example script"
/></a>
</p>
<h4>See also</h4>
<p>
<a href="#coalesce">coalesce</a>,
<a href="#optimize_layers">optimize_layers</a>
</p>
<h4>Magick API</h4>
<p>MergeImageLayers with the FlattenLayer method.</p>
</div>
<div class="sig">
<h3 id="from_blob">from_blob</h3>
<p>
<span class="arg">ilist.</span>from_blob(blob<span class="arg">[, blob...]</span>) <span class="arg">[ { optional arguments } ]</span> ->
<em>self</em>
</p>
</div>
<div class="desc">
<h4>Description</h4>
<p>Creates images from the blob (<em>B</em>inary <em>L</em>arge <em>O</em>bjects) arguments and appends the images to the imagelist.</p>
<h4>Arguments</h4>
<p>
A <em>blob</em> 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="#to_blob">to_blob</a>. Control how the image(s) are
created by setting additional <a href="info.html">Image::Info</a> attributes in the optional block argument. Useful attributes include
<a href="info.html#scene">scene</a>, <a href="info.html#number_scenes">number_scenes</a>, and <a href="info.html#extract">extract</a>.
</p>
<h4>Returns</h4>
<p>
An image created from the blob argument(s). The
<code>scene</code> attribute is set to the last image in the imagelist.
</p>
<h4>Example</h4>
<pre class="language-ruby">
require "rmagick"
f = File.open('Cheetah.jpg')
blob = f.read
ilist = Magick::ImageList.new
ilist.from_blob(blob)
ilist.display
</pre
>
<h4>See also</h4>
<a href="#to_blob">to_blob</a>, <a href="image3.html#to_blob">Image#to_blob</a>,
<a href="image1.html#from_blob">Image.from_blob</a>
<h4>Magick API</h4>
<p>BlobToImageList</p>
</div>
<div class="sig">
<h3 id="fx">fx</h3>
<p><span class="arg">ilist</span> .fx(<span class="arg">expression</span> [, <span class="arg">channel</span>...]) -> <em>image</em></p>
</div>
<div class="desc">
<h4>Description</h4>
<p>
Applies the specified mathematical expression to the input images. This method corresponds to ImageMagick's
<a href="https://imagemagick.org/script/fx.php">-fx</a> operator.
</p>
<h4>Arguments</h4>
<dl>
<dt>expression</dt>
<dd>A mathematical expression of the form accepted by the -fx operator..</dd>
<dt>channel...</dt>
<dd>
0 or more
<a href="constants.html#ChannelType">ChannelType</a> arguments. Specify the output channels. If no channels are specified the result is set over all
channels except the opacity channel.
</dd>
</dl>
<h4>Notes</h4>
<ul>
<li>
Fx expressions are interpreted. Therefore this method can be quite slow depending on the complexity of the expression. Generally you will get better
performance by accessing the image pixels as
<a href="struct.html#Pixel">Pixel</a> objects (see <a href="image2.html#get_pixels">get_pixels</a> and <a href="image3.html#view">view</a>) and using
Ruby code to perform the mathematics.
</li>
<li>
The <code>u</code> and <code>v</code> symbols refer to the 0th and 1st image in the list. The image reference index (<code>u[2]</code> for example)
works as expected. The current <a href="#scene">scene number</a> has no meaning in the context of the <code>fx</code> method.
</li>
<li>
To specify a non-default pixel interpolation method, set the
<a href="imageattrs.html#pixel_interpolation_method">pixel_interpolation_method</a>
attribute of the last image in the list.
</li>
</ul>
<h4>Returns</h4>
<p>The image created by the expression.</p>
<h4>Example</h4>
<pre class="language-ruby">
# Produce a navy blue image from a black image
imgl = Magick::ImageList.new
imgl << Magick::Image.new(64, 64) { |options| options.background_color = 'black'}
res = imgl.fx('1/2', Magick::BlueChannel)
</pre
>
<h4>ImageMagick API</h4>
<p>FxImageChannel</p>
<h4>See also</h4>
<p>
<a href="image2.html#get_pixels">get_pixels</a>,
<a href="image3.html#view">view</a>
</p>
</div>
<div class="sig">
<h3 id="inspect">inspect</h3>
<p><span class="arg">ilist.</span>inspect -> <em>string</em></p>
</div>
<div class="desc">