rmagick 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rmagick might be problematic. Click here for more details.
- data/ChangeLog +9 -0
- data/README.html +13 -13
- data/README.txt +11 -11
- data/doc/comtasks.html +25 -4
- data/doc/constants.html +8 -8
- data/doc/draw.html +112 -116
- data/doc/ex/axes.rb +1 -1
- data/doc/ex/clip_path.rb +5 -4
- data/doc/ex/get_type_metrics.rb +2 -2
- data/doc/ex/resize_to_fill.rb +10 -0
- data/doc/ex/{crop_resized.rb → resize_to_fit.rb} +2 -2
- data/doc/ilist.html +79 -82
- data/doc/image1.html +213 -322
- data/doc/image2.html +123 -136
- data/doc/image3.html +340 -198
- data/doc/imageattrs.html +211 -192
- data/doc/imusage.html +6 -7
- data/doc/index.html +9 -16
- data/doc/info.html +90 -61
- data/doc/magick.html +6 -6
- data/doc/optequiv.html +26 -13
- data/doc/rvg.html +22 -23
- data/doc/rvgclip.html +15 -16
- data/doc/rvggroup.html +23 -23
- data/doc/rvgimage.html +18 -19
- data/doc/rvgpattern.html +101 -82
- data/doc/rvgshape.html +14 -21
- data/doc/rvgstyle.html +4 -4
- data/doc/rvgtext.html +10 -9
- data/doc/rvgtspan.html +12 -11
- data/doc/rvgtut.html +4 -4
- data/doc/rvguse.html +4 -4
- data/doc/rvgxform.html +9 -9
- data/doc/struct.html +193 -195
- data/doc/usage.html +12 -10
- data/examples/constitute.rb +7 -0
- data/ext/RMagick/MANIFEST +4 -4
- data/ext/RMagick/extconf.rb +54 -42
- data/ext/RMagick/rmagick.h +34 -11
- data/ext/RMagick/rmdraw.c +6 -6
- data/ext/RMagick/rmfill.c +2 -2
- data/ext/RMagick/rmilist.c +9 -9
- data/ext/RMagick/rmimage.c +110 -106
- data/ext/RMagick/rminfo.c +33 -14
- data/ext/RMagick/rmmain.c +11 -21
- data/ext/RMagick/rmutil.c +51 -11
- data/lib/RMagick.rb +25 -18
- data/post-clean.rb +3 -3
- data/post-install.rb +4 -5
- data/rmagick.gemspec +5 -3
- data/uninstall.rb +6 -6
- metadata +7 -7
- data/doc/ex/Adispatch.rb +0 -43
- data/doc/ex/Zconstitute.rb +0 -9
data/doc/image3.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
<meta name="generator" content=
|
7
7
|
"HTML Tidy for Linux/x86 (vers 1 September 2005), see www.w3.org" />
|
8
8
|
|
9
|
-
<title>RMagick 2.
|
9
|
+
<title>RMagick 2.1.0: class Image (instance methods p-w)</title>
|
10
10
|
<meta http-equiv="Content-Type" content=
|
11
11
|
"text/html; charset=us-ascii" />
|
12
12
|
<meta name="GENERATOR" content="Quanta Plus" />
|
@@ -51,7 +51,7 @@
|
|
51
51
|
</head>
|
52
52
|
|
53
53
|
<body>
|
54
|
-
<h6 id="header">RMagick 2.
|
54
|
+
<h6 id="header">RMagick 2.1.0 User's Guide and Reference</h6>
|
55
55
|
|
56
56
|
<div class="nav">
|
57
57
|
« <a href="image2.html">Prev</a> | <a href=
|
@@ -109,6 +109,11 @@
|
|
109
109
|
|
110
110
|
<li><a href="#resize_bang">resize!</a></li>
|
111
111
|
|
112
|
+
<li><a href="#resize_to_fill">resize_to_fill</a></li>
|
113
|
+
|
114
|
+
<li><a href=
|
115
|
+
"#resize_to_fill_bang">resize_to_fill!</a></li>
|
116
|
+
|
112
117
|
<li><a href="#resize_to_fit">resize_to_fit</a></li>
|
113
118
|
|
114
119
|
<li><a href="#resize_to_fit_bang">resize_to_fit!</a></li>
|
@@ -118,15 +123,15 @@
|
|
118
123
|
<li><a href="#rotate">rotate</a></li>
|
119
124
|
|
120
125
|
<li><a href="#rotate_bang">rotate!</a></li>
|
121
|
-
|
122
|
-
<li><a href="#sample">sample</a></li>
|
123
|
-
|
124
|
-
<li><a href="#sample_bang">sample!</a></li>
|
125
126
|
</ul>
|
126
127
|
</div>
|
127
128
|
|
128
129
|
<div class="toccol">
|
129
130
|
<ul>
|
131
|
+
<li><a href="#sample">sample</a></li>
|
132
|
+
|
133
|
+
<li><a href="#sample_bang">sample!</a></li>
|
134
|
+
|
130
135
|
<li><a href="#scale">scale</a></li>
|
131
136
|
|
132
137
|
<li><a href="#scale_bang">scale!</a></li>
|
@@ -174,15 +179,15 @@
|
|
174
179
|
<li><a href="#store_pixels">store_pixels</a></li>
|
175
180
|
|
176
181
|
<li><a href="#strip_bang">strip!</a></li>
|
177
|
-
|
178
|
-
<li><a href="#swirl">swirl</a></li>
|
179
|
-
|
180
|
-
<li><a href="#sync_profiles">sync_profiles</a></li>
|
181
182
|
</ul>
|
182
183
|
</div>
|
183
184
|
|
184
185
|
<div class="toccol">
|
185
186
|
<ul>
|
187
|
+
<li><a href="#swirl">swirl</a></li>
|
188
|
+
|
189
|
+
<li><a href="#sync_profiles">sync_profiles</a></li>
|
190
|
+
|
186
191
|
<li><a href=
|
187
192
|
"#texture_fill_to_border">texture_fill_to_border</a></li>
|
188
193
|
|
@@ -243,7 +248,7 @@
|
|
243
248
|
<div class="sig">
|
244
249
|
<h3 id="palette_q">palette?</h3>
|
245
250
|
|
246
|
-
<p><span class="arg">
|
251
|
+
<p><span class="arg">img</span>.palette? -> true or
|
247
252
|
false</p>
|
248
253
|
</div>
|
249
254
|
|
@@ -266,9 +271,9 @@
|
|
266
271
|
<div class="sig">
|
267
272
|
<h3 id="pixel_color">pixel_color</h3>
|
268
273
|
|
269
|
-
<p><span class="arg">
|
274
|
+
<p><span class="arg">img</span>.pixel_color(<span class=
|
270
275
|
"arg">x</span>, <span class="arg">y</span>[, <span class=
|
271
|
-
"arg">new_color</span>]) -> <em>
|
276
|
+
"arg">new_color</span>]) -> <em>pixel</em></p>
|
272
277
|
</div>
|
273
278
|
|
274
279
|
<div class="desc">
|
@@ -311,8 +316,9 @@ old = image.pixel_color(20,40,"white")
|
|
311
316
|
<div class="sig">
|
312
317
|
<h3 id="polaroid">polaroid</h3>
|
313
318
|
|
314
|
-
<p>
|
315
|
-
arguments }</span> ] ->
|
319
|
+
<p><span class="arg">img</span>.polaroid(angle=-5.0) [
|
320
|
+
<span class="arg">{ optional arguments }</span> ] ->
|
321
|
+
image</p>
|
316
322
|
</div>
|
317
323
|
|
318
324
|
<div class="desc">
|
@@ -391,9 +397,9 @@ end
|
|
391
397
|
<div class="sig">
|
392
398
|
<h3 id="posterize">posterize</h3>
|
393
399
|
|
394
|
-
<p><span class="arg">
|
400
|
+
<p><span class="arg">img</span>.posterize(<span class=
|
395
401
|
"arg">levels</span>=4, <span class="arg">dither</span>=false)
|
396
|
-
-> <em>
|
402
|
+
-> <em>image</em></p>
|
397
403
|
</div>
|
398
404
|
|
399
405
|
<div class="desc">
|
@@ -444,8 +450,8 @@ end
|
|
444
450
|
<div class="sig">
|
445
451
|
<h3 id="preview">preview</h3>
|
446
452
|
|
447
|
-
<p><span class="arg">
|
448
|
-
"arg">aPreviewType</span>) -> <em>
|
453
|
+
<p><span class="arg">img</span>.preview(<span class=
|
454
|
+
"arg">aPreviewType</span>) -> <em>image</em></p>
|
449
455
|
</div>
|
450
456
|
|
451
457
|
<div class="desc">
|
@@ -551,9 +557,9 @@ end
|
|
551
557
|
<div class="sig">
|
552
558
|
<h3 id="profile_bang">profile!</h3>
|
553
559
|
|
554
|
-
<p><span class="arg">
|
560
|
+
<p><span class="arg">img</span>.profile!(<span class=
|
555
561
|
"arg">name</span>, <span class="arg">profile</span>) ->
|
556
|
-
<em>
|
562
|
+
<em>self</em></p>
|
557
563
|
</div>
|
558
564
|
|
559
565
|
<div class="desc">
|
@@ -608,8 +614,8 @@ end
|
|
608
614
|
<div class="sig">
|
609
615
|
<h3 id="properties">properties</h3>
|
610
616
|
|
611
|
-
<p><span class="arg">
|
612
|
-
|
617
|
+
<p><span class="arg">img</span>.properties <span class="arg">[
|
618
|
+
{|name,value| block} ]</span> -> <em>hash</em></p>
|
613
619
|
</div>
|
614
620
|
|
615
621
|
<div class="desc">
|
@@ -641,13 +647,13 @@ end
|
|
641
647
|
<div class="sig">
|
642
648
|
<h3 id="quantize">quantize</h3>
|
643
649
|
|
644
|
-
<p><span class="arg">
|
650
|
+
<p><span class="arg">img</span>.quantize(<span class=
|
645
651
|
"arg">number_colors</span>=256, <span class=
|
646
|
-
"arg">colorspace</span>=
|
652
|
+
"arg">colorspace</span>=RGBColorspace, <span class=
|
647
653
|
"arg">dither</span>=<code>true</code>, <span class=
|
648
654
|
"arg">tree_depth</span>=0, <span class=
|
649
655
|
"arg">measure_error</span>=<code>false</code>) ->
|
650
|
-
<em>
|
656
|
+
<em>image</em></p>
|
651
657
|
</div>
|
652
658
|
|
653
659
|
<div class="desc">
|
@@ -728,10 +734,10 @@ end
|
|
728
734
|
<div class="sig">
|
729
735
|
<h3 id="quantum_operator">quantum_operator</h3>
|
730
736
|
|
731
|
-
<p><span class="arg">
|
737
|
+
<p><span class="arg">img</span>.quantum_operator(<span class=
|
732
738
|
"arg">operator</span>, <span class="arg">rvalue</span>,
|
733
739
|
<span class="arg">channel</span>=AllChannels) ->
|
734
|
-
<em>
|
740
|
+
<em>self</em></p>
|
735
741
|
</div>
|
736
742
|
|
737
743
|
<div class="desc">
|
@@ -818,8 +824,8 @@ img.quantum_operator(DivideQuantumOperator, 2, RedChannel)
|
|
818
824
|
<div class="sig">
|
819
825
|
<h3 id="radial_blur">radial_blur</h3>
|
820
826
|
|
821
|
-
<p><span class="arg">
|
822
|
-
"arg">
|
827
|
+
<p><span class="arg">img</span>.radial_blur(<span class=
|
828
|
+
"arg">float</span>) -> <em>image</em></p>
|
823
829
|
</div>
|
824
830
|
|
825
831
|
<div class="desc">
|
@@ -866,9 +872,9 @@ img.quantum_operator(DivideQuantumOperator, 2, RedChannel)
|
|
866
872
|
<h3 id="radial_blur_channel">radial_blur_channel</h3>
|
867
873
|
|
868
874
|
<p><span class=
|
869
|
-
"arg">
|
870
|
-
|
871
|
-
|
875
|
+
"arg">img</span>.radial_blur_channel(<span class="arg">float</span>
|
876
|
+
[, <span class="arg">channel</span>...]) ->
|
877
|
+
<em>image</em></p>
|
872
878
|
</div>
|
873
879
|
|
874
880
|
<div class="desc">
|
@@ -906,10 +912,10 @@ img.quantum_operator(DivideQuantumOperator, 2, RedChannel)
|
|
906
912
|
<div class="sig">
|
907
913
|
<h3 id="raise">raise</h3>
|
908
914
|
|
909
|
-
<p><span class="arg">
|
915
|
+
<p><span class="arg">img</span>.raise(<span class=
|
910
916
|
"arg">width</span>=6, <span class="arg">height</span>=6,
|
911
917
|
<span class="arg">raised</span>=<code>true</code>) ->
|
912
|
-
<em>
|
918
|
+
<em>image</em></p>
|
913
919
|
</div>
|
914
920
|
|
915
921
|
<div class="desc">
|
@@ -960,9 +966,9 @@ img.quantum_operator(DivideQuantumOperator, 2, RedChannel)
|
|
960
966
|
<div class="sig">
|
961
967
|
<h3 id="random_threshold_channel">random_threshold_channel</h3>
|
962
968
|
|
963
|
-
<p><span class="arg">
|
969
|
+
<p><span class="arg">img</span>.random_threshold_channel(
|
964
970
|
<span class="arg">thresholds</span>, [<span class=
|
965
|
-
"arg">channel</span>...] ) -> <em>
|
971
|
+
"arg">channel</span>...] ) -> <em>image</em></p>
|
966
972
|
</div>
|
967
973
|
|
968
974
|
<div class="desc">
|
@@ -1030,8 +1036,8 @@ random_threshold_channel(geom, RedChannel)
|
|
1030
1036
|
<div class="sig">
|
1031
1037
|
<h3 id="recolor">recolor</h3>
|
1032
1038
|
|
1033
|
-
<p><span class="arg">
|
1034
|
-
"arg">color_matrix</span>) -> <em>
|
1039
|
+
<p><span class="arg">img</span>.recolor(<span class=
|
1040
|
+
"arg">color_matrix</span>) -> <em>image</em></p>
|
1035
1041
|
</div>
|
1036
1042
|
|
1037
1043
|
<div class="desc">
|
@@ -1056,8 +1062,8 @@ random_threshold_channel(geom, RedChannel)
|
|
1056
1062
|
<div class="sig">
|
1057
1063
|
<h3 id="reduce_noise">reduce_noise</h3>
|
1058
1064
|
|
1059
|
-
<p><span class="arg">
|
1060
|
-
"arg">radius</span>) -> <em>
|
1065
|
+
<p><span class="arg">img</span>.reduce_noise(<span class=
|
1066
|
+
"arg">radius</span>) -> <em>image</em></p>
|
1061
1067
|
</div>
|
1062
1068
|
|
1063
1069
|
<div class="desc">
|
@@ -1104,9 +1110,9 @@ random_threshold_channel(geom, RedChannel)
|
|
1104
1110
|
<div class="sig">
|
1105
1111
|
<h3 id="resample">resample</h3>
|
1106
1112
|
|
1107
|
-
<p><span class="arg">
|
1113
|
+
<p><span class="arg">img</span>.resample(<span class=
|
1108
1114
|
"arg">horizontal_res</span>=72.0[, <span class=
|
1109
|
-
"arg">vertical_res</span>]) -> <em>
|
1115
|
+
"arg">vertical_res</span>]) -> <em>image</em></p>
|
1110
1116
|
</div>
|
1111
1117
|
|
1112
1118
|
<div class="desc">
|
@@ -1147,13 +1153,13 @@ random_threshold_channel(geom, RedChannel)
|
|
1147
1153
|
<div class="sig">
|
1148
1154
|
<h3 id="resize">resize</h3>
|
1149
1155
|
|
1150
|
-
<p><span class="arg">
|
1156
|
+
<p><span class="arg">img</span>.resize(<span class=
|
1151
1157
|
"arg">new_width</span>, <span class="arg">new_height</span>,
|
1152
1158
|
<em>filter</em>=<a href=
|
1153
1159
|
"constants.html#FilterTypes">LanczosFilter</a>,
|
1154
1160
|
<em>support</em>=1.0) -> <em>image</em><br />
|
1155
|
-
<span class="arg">
|
1156
|
-
"arg">scale_factor</span>) -> <em>
|
1161
|
+
<span class="arg">img</span>.resize(<span class=
|
1162
|
+
"arg">scale_factor</span>) -> <em>image</em></p>
|
1157
1163
|
</div>
|
1158
1164
|
|
1159
1165
|
<div class="desc">
|
@@ -1227,12 +1233,12 @@ random_threshold_channel(geom, RedChannel)
|
|
1227
1233
|
<div class="sig">
|
1228
1234
|
<h3 id="resize_bang">resize!</h3>
|
1229
1235
|
|
1230
|
-
<p><
|
1236
|
+
<p><span class="arg">img</span>.resize!(<em>new_width</em>,
|
1231
1237
|
<em>new_height</em>, <em>filter</em>=<a href=
|
1232
1238
|
"constants.html#FilterTypes">LanczosFilter</a>,
|
1233
|
-
<em>support</em>=1.0) -> <em>
|
1234
|
-
<span class="arg">
|
1235
|
-
"arg">scale_factor</span>) -> <em>
|
1239
|
+
<em>support</em>=1.0) -> <em>self</em><br />
|
1240
|
+
<span class="arg">img</span>.resize!(<span class=
|
1241
|
+
"arg">scale_factor</span>) -> <em>self</em></p>
|
1236
1242
|
</div>
|
1237
1243
|
|
1238
1244
|
<div class="desc">
|
@@ -1245,45 +1251,179 @@ random_threshold_channel(geom, RedChannel)
|
|
1245
1251
|
<p>self</p>
|
1246
1252
|
</div>
|
1247
1253
|
|
1254
|
+
<div class="sig">
|
1255
|
+
<h3 id="resize_to_fill">resize_to_fill</h3>
|
1256
|
+
|
1257
|
+
<p><span class="arg">img</span>.resize_to_fill(<span class=
|
1258
|
+
"arg">width</span> [, <span class="arg">height</span> [,
|
1259
|
+
<span class="arg">gravity</span>=<code>CenterGravity</code>]])
|
1260
|
+
-> <span class="arg">image</span></p>
|
1261
|
+
</div>
|
1262
|
+
|
1263
|
+
<div class="desc">
|
1264
|
+
<h4>Description</h4>
|
1265
|
+
|
1266
|
+
<p>A convenience method. Resize the image to fit within the
|
1267
|
+
specified dimensions while retaining the aspect ratio of the
|
1268
|
+
original image. If necessary, crop the image in the larger
|
1269
|
+
dimension.</p>
|
1270
|
+
|
1271
|
+
<h4>Arguments</h4>
|
1272
|
+
|
1273
|
+
<dl>
|
1274
|
+
<dt>width</dt>
|
1275
|
+
|
1276
|
+
<dd>The width of the resulting image in pixels</dd>
|
1277
|
+
|
1278
|
+
<dt>height</dt>
|
1279
|
+
|
1280
|
+
<dd>(Optional) The height of the resulting image in pixels.
|
1281
|
+
If omitted, defaults to <span class="arg">width</span>.</dd>
|
1282
|
+
|
1283
|
+
<dt>gravity</dt>
|
1284
|
+
|
1285
|
+
<dd>Use this argument to specify which portion of the image
|
1286
|
+
to retain when cropping. The value can be any <a href=
|
1287
|
+
"constants.html#GravityType">GravityType</a> value. The
|
1288
|
+
effect is the same as the <span class="arg">gravity</span>
|
1289
|
+
argument to the <a href=
|
1290
|
+
"image1.html#crop"><code>crop</code></a> method. The default
|
1291
|
+
is <code>CenterGravity</code>.</dd>
|
1292
|
+
</dl>
|
1293
|
+
|
1294
|
+
<h4>Returns</h4>
|
1295
|
+
|
1296
|
+
<p>A new image</p>
|
1297
|
+
|
1298
|
+
<h4>Example</h4>
|
1299
|
+
|
1300
|
+
<p>In this example, some rows have been cropped from the top
|
1301
|
+
and bottom to produce a square thumbnail from a rectangular
|
1302
|
+
image without distorting the image.</p>
|
1303
|
+
|
1304
|
+
<p class="rollover"><a href=
|
1305
|
+
"javascript:popup('resize_to_fill.rb.html')">
|
1306
|
+
<!-- This img tag displays the original image when the mouse is over -->
|
1307
|
+
<img id="cropless" style="display: none" onmouseout=
|
1308
|
+
"this.style.display='none';cropped.style.display='';" src=
|
1309
|
+
"ex/images/Flower_Hat.jpg" alt="crop_resize example" title=
|
1310
|
+
"Click to see the example script" />
|
1311
|
+
<!-- This img tag displays the framed image when the mouse is not over-->
|
1312
|
+
<img style=
|
1313
|
+
"padding-left:62px; padding-right: 62px; padding-top: 87px;padding-bottom:87px;"
|
1314
|
+
id="cropped" onmouseover=
|
1315
|
+
"this.style.display='none';cropless.style.display='';" src=
|
1316
|
+
"ex/resize_to_fill.jpg" alt="frame example" /></a> <img src=
|
1317
|
+
"ex/images/spin.gif" alt="" style="margin-bottom: 230px" title=
|
1318
|
+
"Mouse over the example to see the original image" /></p>
|
1319
|
+
|
1320
|
+
<h4>See also</h4>
|
1321
|
+
|
1322
|
+
<p><a href="image1.html#crop">crop</a>, <a href=
|
1323
|
+
"#resize">resize</a>, <a href=
|
1324
|
+
"#resize_to_fit">resize_to_fit</a></p>
|
1325
|
+
|
1326
|
+
<h4>Notes</h4>
|
1327
|
+
|
1328
|
+
<p><code>crop_resized</code> is an alias for this method.</p>
|
1329
|
+
</div>
|
1330
|
+
|
1331
|
+
<div class="sig">
|
1332
|
+
<h3 id="resize_to_fill_bang">resize_to_fill!</h3>
|
1333
|
+
|
1334
|
+
<p><span class="arg">img</span>.resize_to_fill!(<span class=
|
1335
|
+
"arg">width</span> [, <span class="arg">height</span> [,
|
1336
|
+
<span class="arg">gravity</span>=<code>CenterGravity</code>]])
|
1337
|
+
-> <em>self</em></p>
|
1338
|
+
</div>
|
1339
|
+
|
1340
|
+
<div class="desc">
|
1341
|
+
<h4>Description</h4>The in-place form of <a href=
|
1342
|
+
"#resize_to_fill">resize_to_fill</a>.
|
1343
|
+
|
1344
|
+
<h4>Returns</h4>
|
1345
|
+
|
1346
|
+
<p>self</p>
|
1347
|
+
|
1348
|
+
<h4>See also</h4>
|
1349
|
+
|
1350
|
+
<p><a href="image1.html#crop_bang">crop!</a>, <a href=
|
1351
|
+
"#resize_bang">resize!</a>, <a href=
|
1352
|
+
"#resize_to_fit_bang">resize_to_fit!</a></p>
|
1353
|
+
|
1354
|
+
<h4>Notes</h4>
|
1355
|
+
|
1356
|
+
<p><code>crop_resized!</code> is an alias for this method.</p>
|
1357
|
+
</div>
|
1358
|
+
|
1248
1359
|
<div class="sig">
|
1249
1360
|
<h3 id="resize_to_fit">resize_to_fit</h3>
|
1250
1361
|
|
1251
|
-
<p><
|
1252
|
-
|
1362
|
+
<p><span class="arg">img</span>.resize_to_fit(<span class=
|
1363
|
+
"arg">new_width</span> [, <span class="arg">new_height</span>])
|
1364
|
+
-> <em>image</em></p>
|
1253
1365
|
</div>
|
1254
1366
|
|
1255
1367
|
<div class="desc">
|
1256
1368
|
<h4>Description</h4>
|
1257
1369
|
|
1258
1370
|
<p>A convenience method. Resize the image to fit within the
|
1259
|
-
specified dimensions while retaining the original aspect
|
1260
|
-
|
1371
|
+
specified dimensions while retaining the original aspect ratio.
|
1372
|
+
The image may be shorter or narrower than specified in the
|
1373
|
+
smaller dimension but will not be larger than the specified
|
1374
|
+
values.</p>
|
1261
1375
|
|
1262
1376
|
<h4>Arguments</h4>
|
1263
1377
|
|
1264
1378
|
<dl>
|
1265
|
-
<dt>new_width
|
1379
|
+
<dt>new_width</dt>
|
1380
|
+
|
1381
|
+
<dd>The maximum width of the resized image.</dd>
|
1382
|
+
|
1383
|
+
<dt>new_height</dt>
|
1266
1384
|
|
1267
|
-
<dd>The maximum
|
1268
|
-
|
1269
|
-
|
1270
|
-
will not be larger than the specified values.</dd>
|
1385
|
+
<dd>(Optional) The maximum height of the resized image. If
|
1386
|
+
omitted it defaults to the value of <span class=
|
1387
|
+
"arg">new_width</span>.</dd>
|
1271
1388
|
</dl>
|
1272
1389
|
|
1273
1390
|
<h4>Returns</h4>
|
1274
1391
|
|
1275
1392
|
<p>A new image</p>
|
1276
1393
|
|
1277
|
-
<h4>
|
1278
|
-
|
1279
|
-
|
1394
|
+
<h4>Example</h4>
|
1395
|
+
|
1396
|
+
<p>Compare the result of this example to the result of the
|
1397
|
+
<a href="#resize_to_fill">resize_to_fill</a> example above.</p>
|
1398
|
+
|
1399
|
+
<p class="rollover"><a href=
|
1400
|
+
"javascript:popup('resize_to_fit.rb.html')">
|
1401
|
+
<!-- This img tag displays the original image when the mouse is over -->
|
1402
|
+
<img id="rtfless" style="display: none" onmouseout=
|
1403
|
+
"this.style.display='none';rtf.style.display='';" src=
|
1404
|
+
"ex/images/Flower_Hat.jpg" alt="resize_to_fill example" title=
|
1405
|
+
"Click to see the example script" />
|
1406
|
+
<!-- This img tag displays the framed image when the mouse is not over-->
|
1407
|
+
<img style=
|
1408
|
+
"padding-left:69px; padding-right: 69px; padding-top: 87px;padding-bottom:87px;"
|
1409
|
+
id="rtf" onmouseover=
|
1410
|
+
"this.style.display='none';rtfless.style.display='';" src=
|
1411
|
+
"ex/resize_to_fit.jpg" alt="frame example" /></a> <img src=
|
1412
|
+
"ex/images/spin.gif" alt="" style="margin-bottom: 230px" title=
|
1413
|
+
"Mouse over the example to see the original image" /></p>
|
1414
|
+
|
1415
|
+
<h4>See also</h4>
|
1416
|
+
|
1417
|
+
<p><a href="#resize">resize</a>, <a href=
|
1418
|
+
"#resize_to_fill">resize_to_fill</a></p>
|
1280
1419
|
</div>
|
1281
1420
|
|
1282
1421
|
<div class="sig">
|
1283
1422
|
<h3 id="resize_to_fit_bang">resize_to_fit!</h3>
|
1284
1423
|
|
1285
|
-
<p><
|
1286
|
-
|
1424
|
+
<p><span class="arg">img</span>.resize_to_fit!(<span class=
|
1425
|
+
"arg">new_width</span> [, <span class="arg">new_height</span>])
|
1426
|
+
-> <em>self</em></p>
|
1287
1427
|
</div>
|
1288
1428
|
|
1289
1429
|
<div class="desc">
|
@@ -1295,14 +1435,19 @@ random_threshold_channel(geom, RedChannel)
|
|
1295
1435
|
<h4>Returns</h4>
|
1296
1436
|
|
1297
1437
|
<p>self</p>
|
1438
|
+
|
1439
|
+
<h4>See also</h4>
|
1440
|
+
|
1441
|
+
<p><a href="#resize_bang">resize!</a>, <a href=
|
1442
|
+
"#resize_to_fill_bang">resize_to_fill!</a></p>
|
1298
1443
|
</div>
|
1299
1444
|
|
1300
1445
|
<div class="sig">
|
1301
1446
|
<h3 id="roll">roll</h3>
|
1302
1447
|
|
1303
|
-
<p><span class="arg">
|
1448
|
+
<p><span class="arg">img</span>.roll(<span class=
|
1304
1449
|
"arg">x_offset</span>, <span class="arg">y_offset</span>) ->
|
1305
|
-
<em>
|
1450
|
+
<em>image</em></p>
|
1306
1451
|
</div>
|
1307
1452
|
|
1308
1453
|
<div class="desc">
|
@@ -1348,9 +1493,9 @@ random_threshold_channel(geom, RedChannel)
|
|
1348
1493
|
<div class="sig">
|
1349
1494
|
<h3 id="rotate">rotate</h3>
|
1350
1495
|
|
1351
|
-
<p><span class="arg">
|
1496
|
+
<p><span class="arg">img</span>.rotate(<span class=
|
1352
1497
|
"arg">amount</span> [, <span class="arg">qualifier</span>])
|
1353
|
-
-> <em>
|
1498
|
+
-> <em>image</em></p>
|
1354
1499
|
</div>
|
1355
1500
|
|
1356
1501
|
<div class="desc">
|
@@ -1418,9 +1563,9 @@ random_threshold_channel(geom, RedChannel)
|
|
1418
1563
|
<div class="sig">
|
1419
1564
|
<h3 id="rotate_bang">rotate!</h3>
|
1420
1565
|
|
1421
|
-
<p><span class="arg">
|
1566
|
+
<p><span class="arg">img</span>.rotate!(<span class=
|
1422
1567
|
"arg">amount</span> [, <span class="arg">qualifier</span>])
|
1423
|
-
-> <em>
|
1568
|
+
-> <em>self</em></p>
|
1424
1569
|
</div>
|
1425
1570
|
|
1426
1571
|
<div class="desc">
|
@@ -1438,11 +1583,11 @@ random_threshold_channel(geom, RedChannel)
|
|
1438
1583
|
<div class="sig">
|
1439
1584
|
<h3 id="sample">sample</h3>
|
1440
1585
|
|
1441
|
-
<p><span class="arg">
|
1586
|
+
<p><span class="arg">img</span>.sample(<span class=
|
1442
1587
|
"arg">new_width</span>, <span class="arg">new_height</span>)
|
1443
|
-
-> <span class="arg">
|
1444
|
-
<span class="arg">
|
1445
|
-
"arg">scale_factor</span>) -> <em>
|
1588
|
+
-> <span class="arg">image</span><br />
|
1589
|
+
<span class="arg">img</span>.sample(<span class=
|
1590
|
+
"arg">scale_factor</span>) -> <em>image</em></p>
|
1446
1591
|
</div>
|
1447
1592
|
|
1448
1593
|
<div class="desc">
|
@@ -1488,11 +1633,11 @@ random_threshold_channel(geom, RedChannel)
|
|
1488
1633
|
<div class="sig">
|
1489
1634
|
<h3 id="sample_bang">sample!</h3>
|
1490
1635
|
|
1491
|
-
<p><span class="arg">
|
1636
|
+
<p><span class="arg">img</span>.sample!(<span class=
|
1492
1637
|
"arg">new_width</span>, <span class="arg">new_height</span>)
|
1493
|
-
-> <em>
|
1494
|
-
<span class="arg">
|
1495
|
-
"arg">scale_factor</span>) -> <em>
|
1638
|
+
-> <em>self</em><br />
|
1639
|
+
<span class="arg">img</span>.sample!(<span class=
|
1640
|
+
"arg">scale_factor</span>) -> <em>self</em></p>
|
1496
1641
|
</div>
|
1497
1642
|
|
1498
1643
|
<div class="desc">
|
@@ -1508,11 +1653,11 @@ random_threshold_channel(geom, RedChannel)
|
|
1508
1653
|
<div class="sig">
|
1509
1654
|
<h3 id="scale">scale</h3>
|
1510
1655
|
|
1511
|
-
<p><span class="arg">
|
1656
|
+
<p><span class="arg">img</span>.scale(<span class=
|
1512
1657
|
"arg">new_width</span>, <span class="arg">new_height</span>)
|
1513
|
-
-> <em>
|
1514
|
-
<span class="arg">
|
1515
|
-
"arg">scale_factor</span>) -> <em>
|
1658
|
+
-> <em>image</em><br />
|
1659
|
+
<span class="arg">img</span>.scale(<span class=
|
1660
|
+
"arg">scale_factor</span>) -> <em>image</em></p>
|
1516
1661
|
</div>
|
1517
1662
|
|
1518
1663
|
<div class="desc">
|
@@ -1557,11 +1702,11 @@ random_threshold_channel(geom, RedChannel)
|
|
1557
1702
|
<div class="sig">
|
1558
1703
|
<h3 id="scale_bang">scale!</h3>
|
1559
1704
|
|
1560
|
-
<p><span class="arg">
|
1705
|
+
<p><span class="arg">img</span>.scale!(<span class=
|
1561
1706
|
"arg">new_width</span>, <span class="arg">new_height</span>)
|
1562
|
-
-> <em>
|
1563
|
-
<span class="arg">
|
1564
|
-
"arg">scale_factor</span>) -> <em>
|
1707
|
+
-> <em>self</em><br />
|
1708
|
+
<span class="arg">img</span>.scale!(<span class=
|
1709
|
+
"arg">scale_factor</span>) -> <em>self</em></p>
|
1565
1710
|
</div>
|
1566
1711
|
|
1567
1712
|
<div class="desc">
|
@@ -1577,12 +1722,12 @@ random_threshold_channel(geom, RedChannel)
|
|
1577
1722
|
<div class="sig">
|
1578
1723
|
<h3 id="segment">segment</h3>
|
1579
1724
|
|
1580
|
-
<p>
|
1725
|
+
<p><span class="arg">img</span>.segment(<span class=
|
1581
1726
|
"arg">colorspace</span>=RGBColorspace, <span class=
|
1582
1727
|
"arg">cluster_threshold</span>=1.0, <span class=
|
1583
1728
|
"arg">smoothing_threshold</span>=1.5, <span class=
|
1584
1729
|
"arg">verbose</span>=<code>false</code>) ->
|
1585
|
-
<em>
|
1730
|
+
<em>image</em></p>
|
1586
1731
|
</div>
|
1587
1732
|
|
1588
1733
|
<div class="desc">
|
@@ -1629,7 +1774,7 @@ random_threshold_channel(geom, RedChannel)
|
|
1629
1774
|
|
1630
1775
|
<h4>Example</h4>
|
1631
1776
|
|
1632
|
-
<p><code>segment(
|
1777
|
+
<p><code>segment(YUVColorspace, 0.4, 0.4)</code></p>
|
1633
1778
|
|
1634
1779
|
<p class="rollover"><a href=
|
1635
1780
|
"javascript:popup('segment.rb.html')"><img src="ex/segment.jpg"
|
@@ -1647,9 +1792,8 @@ random_threshold_channel(geom, RedChannel)
|
|
1647
1792
|
<div class="sig">
|
1648
1793
|
<h3 id="separate">separate</h3>
|
1649
1794
|
|
1650
|
-
<p
|
1651
|
-
"arg">
|
1652
|
-
"arg">anImageList</span></p>
|
1795
|
+
<p>Image.separate(<span class="arg">channel</span>...) ->
|
1796
|
+
<span class="arg">imagelist</span></p>
|
1653
1797
|
</div>
|
1654
1798
|
|
1655
1799
|
<div class="desc">
|
@@ -1685,9 +1829,9 @@ random_threshold_channel(geom, RedChannel)
|
|
1685
1829
|
<div class="sig">
|
1686
1830
|
<h3 id="sepiatone">sepiatone</h3>
|
1687
1831
|
|
1688
|
-
<p><span class="arg">
|
1832
|
+
<p><span class="arg">img</span>.sepiatone(<span class=
|
1689
1833
|
"arg">threshold</span>=QuantumRange) -> <span class=
|
1690
|
-
"arg">
|
1834
|
+
"arg">image</span></p>
|
1691
1835
|
</div>
|
1692
1836
|
|
1693
1837
|
<div class="desc">
|
@@ -1710,7 +1854,7 @@ random_threshold_channel(geom, RedChannel)
|
|
1710
1854
|
|
1711
1855
|
<h4>Returns</h4>
|
1712
1856
|
|
1713
|
-
<p>
|
1857
|
+
<p>A new image.</p>
|
1714
1858
|
|
1715
1859
|
<h4>Example</h4>
|
1716
1860
|
|
@@ -1736,9 +1880,9 @@ random_threshold_channel(geom, RedChannel)
|
|
1736
1880
|
<div class="sig">
|
1737
1881
|
<h3 id="set_channel_depth">set_channel_depth</h3>
|
1738
1882
|
|
1739
|
-
<p><span class=
|
1740
|
-
"arg">
|
1741
|
-
<
|
1883
|
+
<p><span class="arg">img.</span>set_channel_depth(<span class=
|
1884
|
+
"arg">channel</span>, <span class="arg">depth</span>) ->
|
1885
|
+
<em>self</em></p>
|
1742
1886
|
</div>
|
1743
1887
|
|
1744
1888
|
<div class="desc">
|
@@ -1776,10 +1920,10 @@ random_threshold_channel(geom, RedChannel)
|
|
1776
1920
|
<div class="sig">
|
1777
1921
|
<h3 id="shade">shade</h3>
|
1778
1922
|
|
1779
|
-
<p><span class="arg">
|
1923
|
+
<p><span class="arg">img</span>.shade(<span class=
|
1780
1924
|
"arg">shading</span>=<code>false</code>, <span class=
|
1781
1925
|
"arg">azimuth</span>=30, <span class="arg">elevation</span>=30)
|
1782
|
-
-> <em>
|
1926
|
+
-> <em>image</em></p>
|
1783
1927
|
</div>
|
1784
1928
|
|
1785
1929
|
<div class="desc">
|
@@ -1833,10 +1977,10 @@ random_threshold_channel(geom, RedChannel)
|
|
1833
1977
|
<div class="sig">
|
1834
1978
|
<h3 id="shadow">shadow</h3>
|
1835
1979
|
|
1836
|
-
<p><span class="arg">
|
1980
|
+
<p><span class="arg">img</span>.shadow(<span class=
|
1837
1981
|
"arg">x_offset=4</span>, <span class="arg">y_offset=4</span>,
|
1838
1982
|
<span class="arg">sigma=4.0</span>, <span class=
|
1839
|
-
"arg">opacity=1.0</span>) -> <em>
|
1983
|
+
"arg">opacity=1.0</span>) -> <em>image</em></p>
|
1840
1984
|
</div>
|
1841
1985
|
|
1842
1986
|
<div class="desc">
|
@@ -1908,9 +2052,9 @@ random_threshold_channel(geom, RedChannel)
|
|
1908
2052
|
<div class="sig">
|
1909
2053
|
<h3 id="sharpen">sharpen</h3>
|
1910
2054
|
|
1911
|
-
<p><span class="arg">
|
2055
|
+
<p><span class="arg">img</span>.sharpen(<span class=
|
1912
2056
|
"arg">radius</span>=0.0, <span class="arg">sigma</span>=1.0)
|
1913
|
-
-> <em>
|
2057
|
+
-> <em>image</em></p>
|
1914
2058
|
</div>
|
1915
2059
|
|
1916
2060
|
<div class="desc">
|
@@ -1946,10 +2090,10 @@ random_threshold_channel(geom, RedChannel)
|
|
1946
2090
|
<div class="sig">
|
1947
2091
|
<h3 id="sharpen_channel">sharpen_channel</h3>
|
1948
2092
|
|
1949
|
-
<p><span class="arg">
|
2093
|
+
<p><span class="arg">img</span>.sharpen_channel( <span class=
|
1950
2094
|
"arg">radius</span>, <span class="arg">sigma</span>
|
1951
2095
|
[,<span class="arg">channel</span>...] ) ->
|
1952
|
-
<em>
|
2096
|
+
<em>image</em></p>
|
1953
2097
|
</div>
|
1954
2098
|
|
1955
2099
|
<div class="desc">
|
@@ -1994,9 +2138,9 @@ random_threshold_channel(geom, RedChannel)
|
|
1994
2138
|
<div class="sig">
|
1995
2139
|
<h3 id="shave">shave</h3>
|
1996
2140
|
|
1997
|
-
<p><span class="arg">
|
2141
|
+
<p><span class="arg">img</span>.shave(<span class=
|
1998
2142
|
"arg">width</span>, <span class="arg">height</span>) ->
|
1999
|
-
<em>
|
2143
|
+
<em>image</em></p>
|
2000
2144
|
</div>
|
2001
2145
|
|
2002
2146
|
<div class="desc">
|
@@ -2046,9 +2190,9 @@ random_threshold_channel(geom, RedChannel)
|
|
2046
2190
|
<div class="sig">
|
2047
2191
|
<h3 id="shave_bang">shave!</h3>
|
2048
2192
|
|
2049
|
-
<p><span class="arg">
|
2193
|
+
<p><span class="arg">img</span>.shave!(<span class=
|
2050
2194
|
"arg">width</span>, <span class="arg">height</span>) ->
|
2051
|
-
<em>
|
2195
|
+
<em>self</em></p>
|
2052
2196
|
</div>
|
2053
2197
|
|
2054
2198
|
<div class="desc">
|
@@ -2064,9 +2208,9 @@ random_threshold_channel(geom, RedChannel)
|
|
2064
2208
|
<div class="sig">
|
2065
2209
|
<h3 id="shear">shear</h3>
|
2066
2210
|
|
2067
|
-
<p><span class="arg">
|
2211
|
+
<p><span class="arg">img</span>.shear(<span class=
|
2068
2212
|
"arg">x_shear</span>, <span class="arg">y_shear</span>) ->
|
2069
|
-
<em>
|
2213
|
+
<em>image</em></p>
|
2070
2214
|
</div>
|
2071
2215
|
|
2072
2216
|
<div class="desc">
|
@@ -2128,11 +2272,11 @@ random_threshold_channel(geom, RedChannel)
|
|
2128
2272
|
|
2129
2273
|
<p><br />
|
2130
2274
|
<span class=
|
2131
|
-
"arg">
|
2275
|
+
"arg">img</span>.sigmoidal_contrast_channel(<span class=
|
2132
2276
|
"arg">contrast</span>=3.0, <span class=
|
2133
2277
|
"arg">midpoint</span>=50.0, <span class=
|
2134
2278
|
"arg">sharpen</span>=false[,<span class=
|
2135
|
-
"arg">channel</span>...]) -> <em>
|
2279
|
+
"arg">channel</span>...]) -> <em>image</em></p>
|
2136
2280
|
</div>
|
2137
2281
|
|
2138
2282
|
<div class="desc">
|
@@ -2186,8 +2330,8 @@ random_threshold_channel(geom, RedChannel)
|
|
2186
2330
|
<div class="sig">
|
2187
2331
|
<h3 id="signature">signature</h3>
|
2188
2332
|
|
2189
|
-
<p><span class="arg">
|
2190
|
-
<em>
|
2333
|
+
<p><span class="arg">img</span>.signature ->
|
2334
|
+
<em>string</em></p>
|
2191
2335
|
</div>
|
2192
2336
|
|
2193
2337
|
<div class="desc">
|
@@ -2232,9 +2376,9 @@ img.properties »
|
|
2232
2376
|
<div class="sig">
|
2233
2377
|
<h3 id="sketch">sketch</h3>
|
2234
2378
|
|
2235
|
-
<p><span class="arg">
|
2379
|
+
<p><span class="arg">img</span>.sketch(<span class=
|
2236
2380
|
"arg">radius</span>=0.0, <span class="arg">sigma</span>=1.0,
|
2237
|
-
<span class="arg">angle</span>=0.0) -> <em>
|
2381
|
+
<span class="arg">angle</span>=0.0) -> <em>image</em></p>
|
2238
2382
|
</div>
|
2239
2383
|
|
2240
2384
|
<div class="desc">
|
@@ -2277,8 +2421,8 @@ img.properties »
|
|
2277
2421
|
<div class="sig">
|
2278
2422
|
<h3 id="solarize">solarize</h3>
|
2279
2423
|
|
2280
|
-
<p><span class="arg">
|
2281
|
-
"arg">threshold</span>=50) -> <em>
|
2424
|
+
<p><span class="arg">img</span>.solarize(<span class=
|
2425
|
+
"arg">threshold</span>=50) -> <em>image</em></p>
|
2282
2426
|
</div>
|
2283
2427
|
|
2284
2428
|
<div class="desc">
|
@@ -2318,10 +2462,10 @@ img.properties »
|
|
2318
2462
|
<div class="sig">
|
2319
2463
|
<h3 id="splice">splice</h3>
|
2320
2464
|
|
2321
|
-
<p><span class="arg">
|
2465
|
+
<p><span class="arg">img</span>.splice(<span class=
|
2322
2466
|
"arg">x</span>, <span class="arg">y</span>, <span class=
|
2323
2467
|
"arg">width</span>, <span class="arg">height</span>[,
|
2324
|
-
<span class="arg">color</span>]) -> <em>
|
2468
|
+
<span class="arg">color</span>]) -> <em>image</em></p>
|
2325
2469
|
</div>
|
2326
2470
|
|
2327
2471
|
<div class="desc">
|
@@ -2387,8 +2531,8 @@ img.properties »
|
|
2387
2531
|
<div class="sig">
|
2388
2532
|
<h3 id="spread">spread</h3>
|
2389
2533
|
|
2390
|
-
<p><span class="arg">
|
2391
|
-
"arg">radius</span>=3) -> <em>
|
2534
|
+
<p><span class="arg">img</span>.spread(<span class=
|
2535
|
+
"arg">radius</span>=3) -> <em>image</em></p>
|
2392
2536
|
</div>
|
2393
2537
|
|
2394
2538
|
<div class="desc">
|
@@ -2420,9 +2564,9 @@ img.properties »
|
|
2420
2564
|
<div class="sig">
|
2421
2565
|
<h3 id="stegano">stegano</h3>
|
2422
2566
|
|
2423
|
-
<p><span class="arg">
|
2567
|
+
<p><span class="arg">img</span>.stegano(<span class=
|
2424
2568
|
"arg">watermark</span>, <span class="arg">offset</span>) ->
|
2425
|
-
<em>
|
2569
|
+
<em>image</em></p>
|
2426
2570
|
</div>
|
2427
2571
|
|
2428
2572
|
<div class="desc">
|
@@ -2481,8 +2625,8 @@ img.properties »
|
|
2481
2625
|
<div class="sig">
|
2482
2626
|
<h3 id="stereo">stereo</h3>
|
2483
2627
|
|
2484
|
-
<p><span class="arg">
|
2485
|
-
"arg">offset_image</span>) -> <em>
|
2628
|
+
<p><span class="arg">img</span>.stereo(<span class=
|
2629
|
+
"arg">offset_image</span>) -> <em>image</em></p>
|
2486
2630
|
</div>
|
2487
2631
|
|
2488
2632
|
<div class="desc">
|
@@ -2510,7 +2654,7 @@ img.properties »
|
|
2510
2654
|
<div class="sig">
|
2511
2655
|
<h3 id="store_pixels">store_pixels</h3>
|
2512
2656
|
|
2513
|
-
<p><span class="arg">
|
2657
|
+
<p><span class="arg">img</span>.store_pixels(<span class=
|
2514
2658
|
"arg">x</span>, <span class="arg">y</span>, <span class=
|
2515
2659
|
"arg">columns</span>, <span class="arg">rows</span>,
|
2516
2660
|
<span class="arg">pixels</span>) -> <em>image</em></p>
|
@@ -2568,8 +2712,7 @@ img.properties »
|
|
2568
2712
|
<div class="sig">
|
2569
2713
|
<h3 id="strip_bang">strip!</h3>
|
2570
2714
|
|
2571
|
-
<p><span class="arg">
|
2572
|
-
<em>image</em></p>
|
2715
|
+
<p><span class="arg">img</span>.strip! -> <em>self</em></p>
|
2573
2716
|
</div>
|
2574
2717
|
|
2575
2718
|
<div class="desc">
|
@@ -2590,8 +2733,8 @@ img.properties »
|
|
2590
2733
|
<div class="sig">
|
2591
2734
|
<h3 id="swirl">swirl</h3>
|
2592
2735
|
|
2593
|
-
<p><span class="arg">
|
2594
|
-
"arg">degrees</span>) -> <em>
|
2736
|
+
<p><span class="arg">img</span>.swirl(<span class=
|
2737
|
+
"arg">degrees</span>) -> <em>image</em></p>
|
2595
2738
|
</div>
|
2596
2739
|
|
2597
2740
|
<div class="desc">
|
@@ -2632,7 +2775,7 @@ img.properties »
|
|
2632
2775
|
<div class="sig">
|
2633
2776
|
<h3 id="sync_profiles">sync_profiles</h3>
|
2634
2777
|
|
2635
|
-
<p><span class="arg">
|
2778
|
+
<p><span class="arg">img</span>.sync_profiles ->
|
2636
2779
|
<code>true</code> or <code>false</code></p>
|
2637
2780
|
</div>
|
2638
2781
|
|
@@ -2661,9 +2804,9 @@ img.properties »
|
|
2661
2804
|
<h3 id="texture_fill_to_border">texture_fill_to_border</h3>
|
2662
2805
|
|
2663
2806
|
<p><span class=
|
2664
|
-
"arg">
|
2807
|
+
"arg">img</span>.texture_fill_to_border(<span class=
|
2665
2808
|
"arg">x</span>, <span class="arg">y</span>, <span class=
|
2666
|
-
"arg">texture</span>) -> <em>
|
2809
|
+
"arg">texture</span>) -> <em>image</em></p>
|
2667
2810
|
</div>
|
2668
2811
|
|
2669
2812
|
<div class="desc">
|
@@ -2728,10 +2871,9 @@ img.properties »
|
|
2728
2871
|
<div class="sig">
|
2729
2872
|
<h3 id="texture_floodfill">texture_floodfill</h3>
|
2730
2873
|
|
2731
|
-
<p><span class=
|
2732
|
-
"arg">
|
2733
|
-
|
2734
|
-
-> <em>anImage</em></p>
|
2874
|
+
<p><span class="arg">img</span>.texture_floodfill(<span class=
|
2875
|
+
"arg">x</span>, <span class="arg">y</span>, <span class=
|
2876
|
+
"arg">texture</span>) -> <em>image</em></p>
|
2735
2877
|
</div>
|
2736
2878
|
|
2737
2879
|
<div class="desc">
|
@@ -2795,8 +2937,8 @@ img.properties »
|
|
2795
2937
|
<div class="sig">
|
2796
2938
|
<h3 id="threshold">threshold</h3>
|
2797
2939
|
|
2798
|
-
<p><span class="arg">
|
2799
|
-
"arg">threshold</span>) -> <em>
|
2940
|
+
<p><span class="arg">img</span>.threshold(<span class=
|
2941
|
+
"arg">threshold</span>) -> <em>image</em></p>
|
2800
2942
|
</div>
|
2801
2943
|
|
2802
2944
|
<div class="desc">
|
@@ -2817,7 +2959,7 @@ img.properties »
|
|
2817
2959
|
|
2818
2960
|
<h4>Example</h4>
|
2819
2961
|
|
2820
|
-
<p><code>threshold(
|
2962
|
+
<p><code>threshold(MaxRGB*0.55)</code></p>
|
2821
2963
|
|
2822
2964
|
<p class="rollover"><a href=
|
2823
2965
|
"javascript:popup('threshold.rb.html')"><img src=
|
@@ -2845,11 +2987,11 @@ img.properties »
|
|
2845
2987
|
<div class="sig">
|
2846
2988
|
<h3 id="thumbnail">thumbnail</h3>
|
2847
2989
|
|
2848
|
-
<p><span class="arg">
|
2990
|
+
<p><span class="arg">img</span>.thumbnail(<span class=
|
2849
2991
|
"arg">new_width</span>, <span class="arg">new_height</span>)
|
2850
|
-
-> <em>
|
2851
|
-
<span class="arg">
|
2852
|
-
"arg">scale_factor</span>) -> <em>
|
2992
|
+
-> <em>image</em><br />
|
2993
|
+
<span class="arg">img</span>.thumbnail(<span class=
|
2994
|
+
"arg">scale_factor</span>) -> <em>image</em></p>
|
2853
2995
|
</div>
|
2854
2996
|
|
2855
2997
|
<div class="desc">
|
@@ -2882,7 +3024,7 @@ img.properties »
|
|
2882
3024
|
|
2883
3025
|
<h4>Example</h4>
|
2884
3026
|
<pre>
|
2885
|
-
img =
|
3027
|
+
img = Image.read("images/Cheetah.jpg").first
|
2886
3028
|
thumbnail = img.thumbnail(img.columns*0.09, img.rows*0.09)
|
2887
3029
|
</pre>
|
2888
3030
|
|
@@ -2900,11 +3042,11 @@ thumbnail = img.thumbnail(img.columns*0.09, img.rows*0.09)
|
|
2900
3042
|
<div class="sig">
|
2901
3043
|
<h3 id="thumbnail_bang">thumbnail!</h3>
|
2902
3044
|
|
2903
|
-
<p><span class="arg">
|
3045
|
+
<p><span class="arg">img</span>.thumbnail!(<span class=
|
2904
3046
|
"arg">new_width</span>, <span class="arg">new_height</span>)
|
2905
|
-
-> <em>
|
2906
|
-
<span class="arg">
|
2907
|
-
"arg">scale_factor</span>) -> <em>
|
3047
|
+
-> <em>self</em><br />
|
3048
|
+
<span class="arg">img</span>.thumbnail!(<span class=
|
3049
|
+
"arg">scale_factor</span>) -> <em>self</em></p>
|
2908
3050
|
</div>
|
2909
3051
|
|
2910
3052
|
<div class="desc">
|
@@ -2920,8 +3062,8 @@ thumbnail = img.thumbnail(img.columns*0.09, img.rows*0.09)
|
|
2920
3062
|
<div class="sig">
|
2921
3063
|
<h3 id="to_blob">to_blob</h3>
|
2922
3064
|
|
2923
|
-
<p><span class="arg">
|
2924
|
-
optional arguments } ]</span>-> <em>
|
3065
|
+
<p><span class="arg">img</span>.to_blob <span class="arg">[ {
|
3066
|
+
optional arguments } ]</span>-> <em>string</em></p>
|
2925
3067
|
</div>
|
2926
3068
|
|
2927
3069
|
<div class="desc">
|
@@ -2964,8 +3106,8 @@ thumbnail = img.thumbnail(img.columns*0.09, img.rows*0.09)
|
|
2964
3106
|
<div class="sig">
|
2965
3107
|
<h3 id="to_color">to_color</h3>
|
2966
3108
|
|
2967
|
-
<p><span class="arg">
|
2968
|
-
"arg">
|
3109
|
+
<p><span class="arg">img</span>.to_color(<span class=
|
3110
|
+
"arg">pixel</span>) -> <em>string</em></p>
|
2969
3111
|
</div>
|
2970
3112
|
|
2971
3113
|
<div class="desc">
|
@@ -2990,7 +3132,7 @@ thumbnail = img.thumbnail(img.columns*0.09, img.rows*0.09)
|
|
2990
3132
|
img = Image.read('ex/images/Flower_Hat.jpg').first
|
2991
3133
|
» ex/images/Flower_Hat.jpg JPEG 200x250 DirectClass 8-bit 9761b
|
2992
3134
|
pixel = img.pixel_color(img.columns/2, img.rows/2)
|
2993
|
-
» #<struct
|
3135
|
+
» #<struct Pixel red=216, green=147, blue=106, opacity=0>
|
2994
3136
|
img.to_color(pixel)
|
2995
3137
|
» "#D8936A"
|
2996
3138
|
</pre>
|
@@ -3007,10 +3149,10 @@ img.to_color(pixel)
|
|
3007
3149
|
<div class="sig">
|
3008
3150
|
<h3 id="transparent">transparent</h3>
|
3009
3151
|
|
3010
|
-
<p><span class="arg">
|
3152
|
+
<p><span class="arg">img</span>.transparent(<span class=
|
3011
3153
|
"arg">color</span>, <span class=
|
3012
|
-
"arg">opacity</span>=
|
3013
|
-
<em>
|
3154
|
+
"arg">opacity</span>=TransparentOpacity) ->
|
3155
|
+
<em>image</em></p>
|
3014
3156
|
</div>
|
3015
3157
|
|
3016
3158
|
<div class="desc">
|
@@ -3073,8 +3215,8 @@ img.to_color(pixel)
|
|
3073
3215
|
<div class="sig">
|
3074
3216
|
<h3 id="transpose">transpose</h3>
|
3075
3217
|
|
3076
|
-
<p><span class="arg">
|
3077
|
-
<em>
|
3218
|
+
<p><span class="arg">img</span>.transpose ->
|
3219
|
+
<em>image</em></p>
|
3078
3220
|
</div>
|
3079
3221
|
|
3080
3222
|
<div class="desc">
|
@@ -3115,7 +3257,7 @@ img.to_color(pixel)
|
|
3115
3257
|
<div class="sig">
|
3116
3258
|
<h3 id="transpose_bang">transpose!</h3>
|
3117
3259
|
|
3118
|
-
<p><span class="arg">
|
3260
|
+
<p><span class="arg">img</span>.transpose! ->
|
3119
3261
|
<em>self</em></p>
|
3120
3262
|
</div>
|
3121
3263
|
|
@@ -3132,8 +3274,8 @@ img.to_color(pixel)
|
|
3132
3274
|
<div class="sig">
|
3133
3275
|
<h3 id="transverse">transverse</h3>
|
3134
3276
|
|
3135
|
-
<p><span class="arg">
|
3136
|
-
<em>
|
3277
|
+
<p><span class="arg">img</span>.transverse ->
|
3278
|
+
<em>image</em></p>
|
3137
3279
|
</div>
|
3138
3280
|
|
3139
3281
|
<div class="desc">
|
@@ -3174,7 +3316,7 @@ img.to_color(pixel)
|
|
3174
3316
|
<div class="sig">
|
3175
3317
|
<h3 id="transverse_bang">transverse!</h3>
|
3176
3318
|
|
3177
|
-
<p><span class="arg">
|
3319
|
+
<p><span class="arg">img</span>.transverse! ->
|
3178
3320
|
<em>self</em></p>
|
3179
3321
|
</div>
|
3180
3322
|
|
@@ -3191,8 +3333,8 @@ img.to_color(pixel)
|
|
3191
3333
|
<div class="sig">
|
3192
3334
|
<h3 id="trim">trim</h3>
|
3193
3335
|
|
3194
|
-
<p><span class="arg">
|
3195
|
-
"arg">reset</span>=false) -> <em>
|
3336
|
+
<p><span class="arg">img</span>.trim(<span class=
|
3337
|
+
"arg">reset</span>=false) -> <em>image</em></p>
|
3196
3338
|
</div>
|
3197
3339
|
|
3198
3340
|
<div class="desc">
|
@@ -3240,7 +3382,7 @@ img.to_color(pixel)
|
|
3240
3382
|
<div class="sig">
|
3241
3383
|
<h3 id="trim_bang">trim!</h3>
|
3242
3384
|
|
3243
|
-
<p><span class="arg">
|
3385
|
+
<p><span class="arg">img</span>.trim!(<span class=
|
3244
3386
|
"arg">reset</span>=false) -> <em>self</em></p>
|
3245
3387
|
</div>
|
3246
3388
|
|
@@ -3255,8 +3397,8 @@ img.to_color(pixel)
|
|
3255
3397
|
<div class="sig">
|
3256
3398
|
<h3 id="unique_colors">unique_colors</h3>
|
3257
3399
|
|
3258
|
-
<p><span class="arg">
|
3259
|
-
<em>
|
3400
|
+
<p><span class="arg">img</span>.unique_colors ->
|
3401
|
+
<em>image</em></p>
|
3260
3402
|
</div>
|
3261
3403
|
|
3262
3404
|
<div class="desc">
|
@@ -3278,10 +3420,10 @@ img.to_color(pixel)
|
|
3278
3420
|
<div class="sig">
|
3279
3421
|
<h3 id="unsharp_mask">unsharp_mask</h3>
|
3280
3422
|
|
3281
|
-
<p><span class="arg">
|
3423
|
+
<p><span class="arg">img</span>.unsharp_mask(<span class=
|
3282
3424
|
"arg">radius=0.0</span>, <span class="arg">sigma=1.0</span>,
|
3283
3425
|
<span class="arg">amount=1.0</span>, <span class=
|
3284
|
-
"arg">threshold=0.05</span>) -> <em>
|
3426
|
+
"arg">threshold=0.05</span>) -> <em>image</em></p>
|
3285
3427
|
</div>
|
3286
3428
|
|
3287
3429
|
<div class="desc">
|
@@ -3351,11 +3493,11 @@ img.to_color(pixel)
|
|
3351
3493
|
<h3 id="unsharp_mask_channel">unsharp_mask_channel</h3>
|
3352
3494
|
|
3353
3495
|
<p><span class=
|
3354
|
-
"arg">
|
3496
|
+
"arg">img</span>.unsharp_mask_channel(<span class=
|
3355
3497
|
"arg">radius=0.0</span>, <span class="arg">sigma=1.0</span>,
|
3356
3498
|
<span class="arg">amount=1.0</span>, <span class=
|
3357
3499
|
"arg">threshold=0.05</span> [,<span class=
|
3358
|
-
"arg">channel</span>...]) -> <em>
|
3500
|
+
"arg">channel</span>...]) -> <em>image</em></p>
|
3359
3501
|
</div>
|
3360
3502
|
|
3361
3503
|
<div class="desc">
|
@@ -3427,11 +3569,11 @@ img.to_color(pixel)
|
|
3427
3569
|
<div class="sig">
|
3428
3570
|
<h3 id="view">view</h3>
|
3429
3571
|
|
3430
|
-
<p><span class="arg">
|
3572
|
+
<p><span class="arg">img</span>.view(<span class=
|
3431
3573
|
"arg">x</span>, <span class="arg">y</span>, <span class=
|
3432
3574
|
"arg">width</span>, <span class="arg">height</span>) ->
|
3433
3575
|
<em>aView</em><br />
|
3434
|
-
<span class="arg">
|
3576
|
+
<span class="arg">img</span>.view(<span class="arg">x</span>,
|
3435
3577
|
<span class="arg">y</span>, <span class="arg">width</span>,
|
3436
3578
|
<span class="arg">height</span>) { |view|
|
3437
3579
|
<em>block</em> } -> <em>nil</em></p>
|
@@ -3461,7 +3603,7 @@ img.to_color(pixel)
|
|
3461
3603
|
<dt>width, height</dt>
|
3462
3604
|
|
3463
3605
|
<dd>The width and height of the view. The view may not extend
|
3464
|
-
past the boundaries of <span class="arg">
|
3606
|
+
past the boundaries of <span class="arg">img</span>.</dd>
|
3465
3607
|
</dl>
|
3466
3608
|
|
3467
3609
|
<h4>Returns</h4>
|
@@ -3534,10 +3676,10 @@ end
|
|
3534
3676
|
<div class="sig">
|
3535
3677
|
<h3 id="vignette">vignette</h3>
|
3536
3678
|
|
3537
|
-
<p
|
3538
|
-
"arg">
|
3539
|
-
<span class="arg">sigma</span>=10.0)
|
3540
|
-
"arg">
|
3679
|
+
<p><span class="arg">img</span>.vignette(<span class=
|
3680
|
+
"arg">x</span>, <span class="arg">y</span>, <span class=
|
3681
|
+
"arg">radius</span>=0.0, <span class="arg">sigma</span>=10.0)
|
3682
|
+
-> <span class="arg">image</span></p>
|
3541
3683
|
</div>
|
3542
3684
|
|
3543
3685
|
<div class="desc">
|
@@ -3556,7 +3698,7 @@ end
|
|
3556
3698
|
"arg">x</span> make the vignette narrower. This argument
|
3557
3699
|
should be positive and less than image.columns / 2. This
|
3558
3700
|
argument is optional. If omitted, the default value is 0.10 *
|
3559
|
-
<span class="arg">
|
3701
|
+
<span class="arg">img</span>.columns.</dd>
|
3560
3702
|
|
3561
3703
|
<dt>y</dt>
|
3562
3704
|
|
@@ -3565,7 +3707,7 @@ end
|
|
3565
3707
|
the vignette shorter. This argument should be positive and
|
3566
3708
|
less than image.rows / 2. This argument is optional. If
|
3567
3709
|
omitted, the default value is 0.10 * <span class=
|
3568
|
-
"arg">
|
3710
|
+
"arg">img</span>.rows.</dd>
|
3569
3711
|
|
3570
3712
|
<dt>radius, sigma</dt>
|
3571
3713
|
|
@@ -3610,16 +3752,16 @@ end
|
|
3610
3752
|
<div class="sig">
|
3611
3753
|
<h3 id="watermark">watermark</h3>
|
3612
3754
|
|
3613
|
-
<p><span class="arg">
|
3755
|
+
<p><span class="arg">img</span>.watermark(<span class=
|
3614
3756
|
"arg">mark</span>, <span class="arg">lightness</span>=1.0,
|
3615
3757
|
<span class="arg">saturation</span>=1.0, <span class=
|
3616
3758
|
"arg">x_offset</span>=0, <span class="arg">y_offset</span>=0)
|
3617
|
-
-> <em>
|
3618
|
-
<span class="arg">
|
3759
|
+
-> <em>image</em><br />
|
3760
|
+
<span class="arg">img</span>.watermark(<span class=
|
3619
3761
|
"arg">mark</span>, <span class="arg">lightness</span>=1.0,
|
3620
3762
|
<span class="arg">saturation</span>=1.0, <span class=
|
3621
3763
|
"arg">gravity</span>, <span class="arg">x_offset</span>=0,
|
3622
|
-
<span class="arg">y_offset</span>=0) -> <em>
|
3764
|
+
<span class="arg">y_offset</span>=0) -> <em>image</em></p>
|
3623
3765
|
</div>
|
3624
3766
|
|
3625
3767
|
<div class="desc">
|
@@ -3767,9 +3909,9 @@ end
|
|
3767
3909
|
<div class="sig">
|
3768
3910
|
<h3 id="wave">wave</h3>
|
3769
3911
|
|
3770
|
-
<p><span class="arg">
|
3912
|
+
<p><span class="arg">img</span>.wave(<span class=
|
3771
3913
|
"arg">amplitude</span>=25.0, <span class=
|
3772
|
-
"arg">wavelength</span>=150.0) -> <em>
|
3914
|
+
"arg">wavelength</span>=150.0) -> <em>image</em></p>
|
3773
3915
|
</div>
|
3774
3916
|
|
3775
3917
|
<div class="desc">
|
@@ -3815,9 +3957,9 @@ end
|
|
3815
3957
|
<div class="sig">
|
3816
3958
|
<h3 id="wet_floor">wet_floor</h3>
|
3817
3959
|
|
3818
|
-
<p><span class="arg">
|
3960
|
+
<p><span class="arg">img</span>.wet_floor(<span class=
|
3819
3961
|
"arg">intial=0.5</span>, <span class="arg">rate=1.0</span>)
|
3820
|
-
-> <em>
|
3962
|
+
-> <em>image</em></p>
|
3821
3963
|
</div>
|
3822
3964
|
|
3823
3965
|
<div class="desc">
|
@@ -3881,11 +4023,11 @@ end
|
|
3881
4023
|
<div class="sig">
|
3882
4024
|
<h3 id="white_threshold">white_threshold</h3>
|
3883
4025
|
|
3884
|
-
<p><span class="arg">
|
4026
|
+
<p><span class="arg">img</span>.white_threshold(<span class=
|
3885
4027
|
"arg">red_channel</span> [, <span class=
|
3886
4028
|
"arg">green_channel</span>[, <span class=
|
3887
4029
|
"arg">blue_channel</span>[, <span class=
|
3888
|
-
"arg">opacity_channel</span>]]]) -> <em>
|
4030
|
+
"arg">opacity_channel</span>]]]) -> <em>image</em></p>
|
3889
4031
|
</div>
|
3890
4032
|
|
3891
4033
|
<div class="desc">
|
@@ -3923,12 +4065,12 @@ end
|
|
3923
4065
|
<div class="sig">
|
3924
4066
|
<h3 id="write">write</h3>
|
3925
4067
|
|
3926
|
-
<p><span class="arg">
|
4068
|
+
<p><span class="arg">img</span>.write(<span class=
|
3927
4069
|
"arg">filename</span>) <span class="arg">[ { optional arguments
|
3928
|
-
} ]</span> -> <
|
3929
|
-
<span class="arg">
|
4070
|
+
} ]</span> -> <em>self</em><br />
|
4071
|
+
<span class="arg">img</span>.write(<span class=
|
3930
4072
|
"arg">file</span>) <span class="arg">[ { optional arguments }
|
3931
|
-
]</span> -> <em>
|
4073
|
+
]</span> -> <em>self</em></p>
|
3932
4074
|
</div>
|
3933
4075
|
|
3934
4076
|
<div class="desc">
|