rmagick 1.10.1 → 1.11.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.

@@ -121,13 +121,13 @@ float: left;
121
121
  <li><a href="#changed_q">changed?</a></li>
122
122
 
123
123
  <li><a href="#channel">channel</a></li>
124
+
125
+ <li><a href="#channel_depth">channel_depth</a></li>
124
126
  </ul>
125
127
  </div>
126
128
 
127
129
  <div class="toccol">
128
130
  <ul>
129
- <li><a href="#channel_depth">channel_depth</a></li>
130
-
131
131
  <li><a href="#channel_extrema">channel_extrema</a></li>
132
132
 
133
133
  <li><a href="#channel_mean">channel_mean</a></li>
@@ -163,12 +163,15 @@ float: left;
163
163
 
164
164
  <li><a href=
165
165
  "#compress_colormap_bang">compress_colormap!</a></li>
166
+
167
+ <li><a href="#contrast">contrast</a></li>
166
168
  </ul>
167
169
  </div>
168
170
 
169
171
  <div class="toccol">
170
172
  <ul>
171
- <li><a href="#contrast">contrast</a></li>
173
+ <li><a href=
174
+ "#contrast_stretch_channel">contrast_stretch_channel</a></li>
172
175
 
173
176
  <li><a href="#convolve">convolve</a></li>
174
177
 
@@ -2321,6 +2324,8 @@ f.colors &raquo; 108
2321
2324
  <h4>See also</h4>
2322
2325
 
2323
2326
  <p><a href=
2327
+ "#contrast_stretch_channel">contrast_stretch_channel</a>,
2328
+ <a href=
2324
2329
  "image3.html#sigmoidal_contrast_channel">sigmoidal_contrast_channel</a></p>
2325
2330
 
2326
2331
  <h4>Magick API</h4>
@@ -2328,10 +2333,70 @@ f.colors &raquo; 108
2328
2333
  <p>ContrastImage</p>
2329
2334
  </div>
2330
2335
 
2336
+ <div class="sig">
2337
+ <h3 id="contrast_stretch_channel">contrast_stretch_channel</h3>
2338
+
2339
+ <p><span class=
2340
+ "arg">image</span>.contrast_stretch_channel(<span class=
2341
+ "arg">black_point</span> [, <span class=
2342
+ "arg">white_point</span>] [, <span class=
2343
+ "arg">channel</span>...]) -&gt; <span class=
2344
+ "arg">anImage</span></p>
2345
+ </div>
2346
+
2347
+ <div class="desc">
2348
+ <h4>Description</h4>
2349
+
2350
+ <p>This method <span class="imquote">is a simple image
2351
+ enhancement technique that attempts to improve the contrast in
2352
+ an image by `stretching' the range of intensity values it
2353
+ contains to span a desired range of values. It differs from the
2354
+ more sophisticated histogram equalization in that it can only
2355
+ apply a linear scaling function to the image pixel values. As a
2356
+ result the `enhancement' is less harsh.</span></p>
2357
+
2358
+ <h4>Arguments</h4>
2359
+
2360
+ <dl>
2361
+ <dt>black_point</dt>
2362
+
2363
+ <dd>black out at most this many pixels. Specify an absolute
2364
+ number of pixels as a numeric value, or a percentage as a
2365
+ string in the form 'NN%'.</dd>
2366
+
2367
+ <dt>white_point</dt>
2368
+
2369
+ <dd>burn at most this many pixels. Specify an absolute number
2370
+ of pixels as a numeric value, or a percentage as a string in
2371
+ the form 'NN%'. This argument is optional. If not specified
2372
+ the default is <code>all pixels - black_point
2373
+ pixels</code>.</dd>
2374
+
2375
+ <dt>channel...</dt>
2376
+
2377
+ <dd>0 or more <a href=
2378
+ "constants.html#ChannelType">ChannelType</a> arguments. If no
2379
+ channels are specified all channels are included.</dd>
2380
+ </dl>
2381
+
2382
+ <h4>Returns</h4>
2383
+
2384
+ <p>A new image</p>
2385
+
2386
+ <h4>See also</h4>
2387
+
2388
+ <p><a href="#contrast">contrast</a>, <a href=
2389
+ "image2.html#equalize">equalize</a></p>
2390
+
2391
+ <h4>Magick API</h4>
2392
+
2393
+ <p>ContrastStretchImage (available in ImageMagick 6.2.6)</p>
2394
+ </div>
2395
+
2331
2396
  <div class="sig">
2332
2397
  <h3 id="convolve">convolve</h3>
2333
2398
 
2334
- <p>&gt;<span class="arg">image</span>.convolve(<span class=
2399
+ <p><span class="arg">image</span>.convolve(<span class=
2335
2400
  "arg">order</span>, <span class="arg">kernel</span>) -&gt;
2336
2401
  <em>anImage</em></p>
2337
2402
  </div>
@@ -1241,9 +1241,8 @@ f.inspect &raquo; "images/Flower_Hat.jpg JPEG 200x250 DirectClass 8-bit 9kb"
1241
1241
 
1242
1242
  <p><span class="arg">image</span>.level(<span class=
1243
1243
  "arg">black_point</span>=<code>0.0</code>, <span class=
1244
- "arg">mid_point</span>=<code>1.0</code>, <span class=
1245
- "arg">white_point</span>=<code>MaxRGB</code>) -&gt;
1246
- <em>anImage</em></p>
1244
+ "arg">white_point</span>=<code>MaxRGB</code>, <span class=
1245
+ "arg">gamma</span>=<code>1.0</code>) -&gt; <em>anImage</em></p>
1247
1246
  </div>
1248
1247
 
1249
1248
  <div class="desc">
@@ -1254,10 +1253,10 @@ f.inspect &raquo; "images/Flower_Hat.jpg JPEG 200x250 DirectClass 8-bit 9kb"
1254
1253
  the full available quantum range. The parameters provided
1255
1254
  represent the black, mid, and white points. The black point
1256
1255
  specifies the darkest color in the image. Colors darker than
1257
- the black point are set to zero. Mid point specifies a gamma
1256
+ the black point are set to zero. Gamma specifies a gamma
1258
1257
  correction to apply to the image. White point specifies the
1259
1258
  lightest color in the image. Colors brighter than the white
1260
- point are set to the maximum quantum value.</p>
1259
+ point are set to the maximum quantum value</p>
1261
1260
 
1262
1261
  <h4>Arguments</h4>
1263
1262
 
@@ -1268,12 +1267,13 @@ f.inspect &raquo; "images/Flower_Hat.jpg JPEG 200x250 DirectClass 8-bit 9kb"
1268
1267
 
1269
1268
  <dt>mid_point</dt>
1270
1269
 
1271
- <dd>The mid-point level. The default is 1.0.</dd>
1270
+ <dd>The white point level. The default is <a href=
1271
+ "constants.html#Miscellaneous_constants">MaxRGB</a> -
1272
+ <span class="arg">black_point</span>.</dd>
1272
1273
 
1273
- <dt>white_point</dt>
1274
+ <dt>gamma</dt>
1274
1275
 
1275
- <dd>The white point level. The default is <a href=
1276
- "constants.html#Miscellaneous_constants">MaxRGB</a>.</dd>
1276
+ <dd>The gamma correction. The default is 1.0.</dd>
1277
1277
  </dl>
1278
1278
 
1279
1279
  <h4>Returns</h4>
@@ -1306,9 +1306,9 @@ f.inspect &raquo; "images/Flower_Hat.jpg JPEG 200x250 DirectClass 8-bit 9kb"
1306
1306
 
1307
1307
  <p><span class="arg">image</span>.level_channel(<span class=
1308
1308
  "arg">channel</span>, <span class=
1309
- "arg">black_point</span>=<code>0.0</code>, <span class=
1310
- "arg">mid_point</span>=<code>1.0</code>, <span class=
1311
- "arg">white_point</span>=<code>MaxRGB</code>) -&gt;
1309
+ "arg">black_point</span>=<code>0</code>, <span class=
1310
+ "arg">white_point</span>=<code>MaxRGB</code>-<code>black_point</code>,
1311
+ <span class="arg">gamma</span>=<code>1.0</code>) -&gt;
1312
1312
  <em>anImage</em></p>
1313
1313
  </div>
1314
1314
 
@@ -1330,12 +1330,13 @@ f.inspect &raquo; "images/Flower_Hat.jpg JPEG 200x250 DirectClass 8-bit 9kb"
1330
1330
 
1331
1331
  <dt>mid_point</dt>
1332
1332
 
1333
- <dd>The mid-point level. The default is 1.0.</dd>
1333
+ <dd>The white point level. The default is <a href=
1334
+ "constants.html#Miscellaneous_constants">MaxRGB</a> -
1335
+ <span class="arg">black_point</span>.</dd>
1334
1336
 
1335
- <dt>white_point</dt>
1337
+ <dt>gamma</dt>
1336
1338
 
1337
- <dd>The white point level. The default is <a href=
1338
- "constants.html#Miscellaneous_constants">MaxRGB</a>.</dd>
1339
+ <dd>The gamma correction. The default is 1.0.</dd>
1339
1340
  </dl>
1340
1341
 
1341
1342
  <h4>Returns</h4>
@@ -94,6 +94,10 @@
94
94
 
95
95
  <li><a href="#resize_bang">resize!</a></li>
96
96
 
97
+ <li><a href="#resize_to_fit">resize_to_fit</a></li>
98
+
99
+ <li><a href="#resize_to_fit_bang">resize_to_fit!</a></li>
100
+
97
101
  <li><a href="#roll">roll</a></li>
98
102
 
99
103
  <li><a href="#rotate">rotate</a></li>
@@ -875,7 +879,7 @@ random_threshold_channel(geom, RedChannel)
875
879
 
876
880
  <h4>See also</h4>
877
881
 
878
- <p><a href="image1.html#change_geometry">change_geometry</a>
882
+ <p><a href="image1.html#change_geometry">change_geometry</a>,
879
883
  <a href="#resize_bang">resize!</a>, <a href=
880
884
  "image2.html#magnify">magnify</a>, <a href=
881
885
  "image2.html#minify">minify</a>, <a href="#sample">sample</a>,
@@ -901,7 +905,59 @@ random_threshold_channel(geom, RedChannel)
901
905
  <div class="desc">
902
906
  <h4>Description</h4>
903
907
 
904
- <p>In-place form of <a href="#Image.resize">resize</a>.</p>
908
+ <p>In-place form of <a href="#resize">resize</a>.</p>
909
+
910
+ <h4>Returns</h4>
911
+
912
+ <p>self</p>
913
+ </div>
914
+
915
+ <div class="sig">
916
+ <h3 id="resize_to_fit">resize_to_fit</h3>
917
+
918
+ <p><em>image</em>.resize_to_fit(<em>new_width</em>,
919
+ <em>new_height</em>) -&gt; <em>anImage</em></p>
920
+ </div>
921
+
922
+ <div class="desc">
923
+ <h4>Description</h4>
924
+
925
+ <p>A convenience method. Resize the image to fit within the
926
+ specified dimensions while retaining the original aspect
927
+ ratio.</p>
928
+
929
+ <h4>Arguments</h4>
930
+
931
+ <dl>
932
+ <dt>new_width, new_height</dt>
933
+
934
+ <dd>The maximum width and height of the resized image. In
935
+ order to retain the aspect ratio of the input image, the
936
+ actual dimensions of the resized image may be different but
937
+ will not be larger than the specified values.</dd>
938
+ </dl>
939
+
940
+ <h4>Returns</h4>
941
+
942
+ <p>A new image</p>
943
+
944
+ <h4>See also</h4><a href=
945
+ "image1.html#change_geometry">change_geometry</a>, <a href=
946
+ "#resize">resize</a>
947
+ </div>
948
+
949
+ <div class="sig">
950
+ <h3 id="resize_to_fit_bang">resize_to_fit!</h3>
951
+
952
+ <p><em>image</em>.resize_to_fit!(<em>new_width</em>,
953
+ <em>new_height</em>) -&gt; <em>image</em></p>
954
+ </div>
955
+
956
+ <div class="desc">
957
+ <h4>Description</h4>
958
+
959
+ <p>In-place form of <a href=
960
+ "#resize_to_fit">resize_to_fit</a>.</p>
905
961
 
906
962
  <h4>Returns</h4>
907
963
 
@@ -1445,7 +1501,7 @@ random_threshold_channel(geom, RedChannel)
1445
1501
  id="shadowed" onmouseover=
1446
1502
  "this.style.display='none';shadowless.style.display='';" src=
1447
1503
  "ex/shadow_after.gif" alt="shadow example"
1448
- /></a> <img src="ex/images/spin.gif" alt="" style=
1504
+ /></a> <img src="ex/images/spin.gif" alt="" style=
1449
1505
  "margin-bottom: 120px" title=
1450
1506
  "Mouse over the example to see the original image" /></p>
1451
1507
 
@@ -1663,7 +1719,7 @@ random_threshold_channel(geom, RedChannel)
1663
1719
  <img id="sheared" onmouseover=
1664
1720
  "this.style.display='none'; noshear.style.display='';" src=
1665
1721
  "ex/shear.jpg" alt="shear example"
1666
- /></a><img src="ex/images/spin.gif" alt="" class=
1722
+ /></a><img src="ex/images/spin.gif" alt="" class=
1667
1723
  "spin" style="left: 253px; top: 34px" title=
1668
1724
  "Mouse over the example to see the original image" /></p>
1669
1725
 
@@ -115,7 +115,7 @@
115
115
  <ul>
116
116
  <li><a href="#introduction">Introduction</a></li>
117
117
 
118
- <li>Usage Guide</li>
118
+ <li>User's Guide</li>
119
119
 
120
120
  <li style="list-style: none">
121
121
  <ul>
@@ -312,7 +312,7 @@
312
312
  <h3>About this document</h3>
313
313
 
314
314
  <p>This document is divided into 4 parts. The first is this page.
315
- The second part is a usage guide covering both RMagick and
315
+ The second part is a user's guide covering both RMagick and
316
316
  ImageMagick/GraphicsMagick usage and conventions. The third part
317
317
  is a reference guide to the ImageList, Image, and Draw classes.
318
318
  This guide includes many examples.</p>
@@ -398,7 +398,7 @@
398
398
  &times;Magick's version number. Simply bring up irb and run this
399
399
  command: <code>ruby -r RMagick -e "puts Magick::Long_version"</code></p>
400
400
  <pre class="example" id="version">
401
- This is RMagick 1.10.0 ($Date: 2006/01/08 00:21:58 $) Copyright (C) 2006 by Timothy P. Hunter
401
+ This is RMagick 1.10.0 ($Date: 2006/03/26 22:05:56 $) Copyright (C) 2006 by Timothy P. Hunter
402
402
  Built with ImageMagick 6.2.6 01/03/06 Q8 http://www.imagemagick.org
403
403
  Built for ruby 1.8.3 (2005-09-21) [i686-linux]
404
404
  Web page: http://rmagick.rubyforge.org
@@ -4,7 +4,7 @@
4
4
  <html xmlns="http://www.w3.org/1999/xhtml">
5
5
  <head>
6
6
  <meta name="generator" content=
7
- "HTML Tidy for Linux/x86 (vers 1st March 2005), see www.w3.org" />
7
+ "HTML Tidy for Linux/x86 (vers 1st December 2004), see www.w3.org" />
8
8
 
9
9
  <title>RMagick: module Magick</title>
10
10
  <meta http-equiv="Content-Type" content=
@@ -46,6 +46,8 @@
46
46
 
47
47
  <li><a href="#formats">formats</a></li>
48
48
 
49
+ <li><a href="#limit_resource">limit_resource</a></li>
50
+
49
51
  <li><a href=
50
52
  "#set_cache_threshold">set_cache_threshold</a></li>
51
53
 
@@ -322,6 +324,59 @@ p Magick.formats &raquo;
322
324
  your system administrator.</p>
323
325
  </div>
324
326
 
327
+ <div class="sig">
328
+ <h3 id="limit_resource">limit_resource</h3>
329
+
330
+ <p>Magick.limit_resource(<span class="arg">resource_type</span>
331
+ [, <span class="arg">limit</span>]) -&gt; <span class=
332
+ "arg">old_limit</span></p>
333
+ </div>
334
+
335
+ <div class="desc">
336
+ <h4>Description</h4>
337
+
338
+ <p>Sets a limit to the amount of a resource, or gets the
339
+ current limit for the resource. <span class="imquote">When the
340
+ limit is reached, &times;Magick will fail in some fashion or
341
+ take compensating actions if possible.</span> The default
342
+ limits vary according to the platform. See the &times;Magick
343
+ documentation for the <em>-limit</em> option for more
344
+ information.</p>
345
+
346
+ <h4>Arguments</h4>This method may be called with one or two
347
+ arguments. The first argument identifies the resource. If
348
+ specified, the second argument is the limit.
349
+
350
+ <dl>
351
+ <dt>resource_type</dt>
352
+
353
+ <dd>One of the symbols <code>:disk</code>,
354
+ <code>:file</code>, <code>:map</code>, or
355
+ <code>:memory</code>. You may use a string instead of a
356
+ symbol.</dd>
357
+
358
+ <dt>limit</dt>
359
+
360
+ <dd>If present, the limit for the resource. This argument is
361
+ always an integer number. If the resource_type is
362
+ <code>:file</code>, the limit is the number of open files. If
363
+ <code>:memory</code> or <code>:map</code>, the limit is
364
+ measured megabytes. If <code>:disk</code>, the limit is
365
+ measured in gigabytes. If this argument is omitted the limit is not
366
+ changed.</dd>
367
+ </dl>
368
+
369
+ <h4>Returns</h4>
370
+
371
+ <p>The current resource limit. If a new limit is specified this
372
+ is the limit <em>before</em> the change.</p>
373
+
374
+ <h4>Notes</h4>
375
+
376
+ <p>This method supercedes <a href=
377
+ "#set_cache_threshold">set_cache_threshold</a>.</p>
378
+ </div>
379
+
325
380
  <div class="sig">
326
381
  <h3 id="set_cache_threshold">set_cache_threshold</h3>
327
382
 
@@ -344,6 +399,20 @@ p Magick.formats &raquo;
344
399
  <pre>
345
400
  # set the cache threshold to 10Mb
346
401
  Magick.set_cache_threshold(10)
402
+ </pre>
403
+
404
+ <h4>Notes</h4>
405
+
406
+ <p>This method is obsolete. Use <a href=
407
+ "#limit_resource">limit_resource</a> instead. The code:</p>
408
+ <pre>
409
+ Magick.limit_resource(:memory, n)
410
+ Magick.imit_resource(:map, 2*n)
411
+ </pre>
412
+
413
+ <p>is equivalent to</p>
414
+ <pre>
415
+ Magick.set_cache_threshold(n)
347
416
  </pre>
348
417
  </div>
349
418
 
@@ -80,6 +80,10 @@
80
80
  #footnotes h5 {
81
81
  display: none;
82
82
  }
83
+ .sup {
84
+ vertical-align: super;
85
+ font-size: x-small;
86
+ }
83
87
 
84
88
  /*]]>*/
85
89
  </style>
@@ -123,8 +127,8 @@
123
127
 
124
128
  <p>Let's look at the RMagick equivalent of "Hello, world". This
125
129
  program reads an image file named "Cheetah.jpg" and
126
- displays<sup><a href="#display">1</a></sup> it on your
127
- monitor.</p>
130
+ displays<span class="sup"><a href="#display">1</a></span> it on
131
+ your monitor</p>
128
132
  <pre class="example">
129
133
  1. require 'RMagick'
130
134
  2. include Magick
@@ -140,7 +144,8 @@
140
144
  work on native MS Windows. You must use an external viewer to
141
145
  view the images you create.</p>
142
146
 
143
- <p>Line 1 requires the RMagick.rb file, which defines the
147
+ <p>Line 1 requires <span class="sup"><a href=
148
+ "#rubygems">2</a></span> the RMagick.rb file, which defines the
144
149
  <b>Magick</b> module. The Magick module contains 3 major classes,
145
150
  <b>ImageList</b>, <b>Image</b>, and <b>Draw</b>. This section -
146
151
  <em>Basic Comcepts</em> - describes the ImageList and Image
@@ -622,6 +627,11 @@ exit
622
627
 
623
628
  <dd>Resize the image using a filter</dd>
624
629
 
630
+ <dt><a href=
631
+ "image3.html#resize_to_fit">resize_to_fit</a></dt>
632
+
633
+ <dd>Resize the image retaining the aspect ratio</dd>
634
+
625
635
  <dt><a href="image3.html#sample">sample</a></dt>
626
636
 
627
637
  <dd>Resize the image using pixel sampling</dd>
@@ -810,6 +820,11 @@ exit
810
820
  <dd class="ilist">Inlay all the images in the imagelist into
811
821
  a single image</dd>
812
822
 
823
+ <dt class="ilist"><a href=
824
+ "ilist.html#optimize_layers">optimize_layers</a></dt>
825
+
826
+ <dd class="ilist">Optimize or compare image layers</dd>
827
+
813
828
  <dt><a href="image3.html#roll">roll</a></dt>
814
829
 
815
830
  <dd>Offset the image</dd>
@@ -831,6 +846,12 @@ exit
831
846
  <dd>Enhance the intensity differences between the lighter and
832
847
  darker elements in the image</dd>
833
848
 
849
+ <dt><a href=
850
+ "image1.html#contrast_stretch_channel">contrast_stretch_channel</a></dt>
851
+
852
+ <dd>Improve the contrast in the image by stretching the range
853
+ of intensity values</dd>
854
+
834
855
  <dt><a href="image1.html#despeckle">despeckle</a></dt>
835
856
 
836
857
  <dd>Reduce the speckle noise in the image</dd>
@@ -1163,7 +1184,7 @@ exit
1163
1184
  extends to the right. The y axis extends downward. The units
1164
1185
  are pixels. 0&deg; is at 3 o'clock and rotation is clockwise.
1165
1186
  The units of rotation are usually degrees.<sup><a href=
1166
- "#degrees">2</a></sup></p>
1187
+ "#degrees">3</a></sup></p>
1167
1188
 
1168
1189
  <p>You can change the default coordinate system by specifying
1169
1190
  a <em>scaling</em>, <em>rotation</em>, or
@@ -1346,13 +1367,32 @@ exit
1346
1367
  <div>
1347
1368
  <h5 id="footnotes">Footnotes</h5>
1348
1369
 
1349
- <p id="display"><sup>1</sup>The <code>display</code> and
1350
- <code>animate</code> methods do not work on MS Windows. You
1351
- will have to write the image to a file and view it with a
1352
- separate image viewer.</p>
1370
+ <p id="display"><span class="sup">1</span>The
1371
+ <code>display</code> and <code>animate</code> methods do not
1372
+ work on MS Windows. You will have to write the image to a file
1373
+ and view it with a separate image viewer.</p>
1374
+
1375
+ <p id="rubygems"><span class="sup">2</span>If you installed
1376
+ RMagick using <a href="http://docs.rubygems.org/">Rubygems</a>
1377
+ you must set up the RubyGems environment before using RMagick.
1378
+ You can do one of</p>
1379
+
1380
+ <ol>
1381
+ <li>add the <code>require 'rubygems'</code> statement to your
1382
+ program</li>
1383
+
1384
+ <li>use the -rubygems command line option</li>
1385
+
1386
+ <li>add <code>rubygems</code> to the RUBYOPT environment
1387
+ variable</li>
1388
+ </ol>
1389
+
1390
+ <p>See the RubyGems <a href=
1391
+ "http://docs.rubygems.org/read/chapter/3#page70">doc</a> for
1392
+ more information.</p>
1353
1393
 
1354
- <p id="degrees"><sup>2</sup>The rotation attributes
1355
- <code>rx</code> and <code>ry</code> in the <a href=
1394
+ <p id="degrees"><span class="sup">3</span>The rotation
1395
+ attributes <code>rx</code> and <code>ry</code> in the <a href=
1356
1396
  "struct.html#AffineMatrix"><code>AffineMatrix</code></a> class
1357
1397
  use radians instead of degrees.</p>
1358
1398
  </div>